fix: For posterity, am committing this

This commit is contained in:
Wanjohi
2026-07-24 14:20:06 +03:00
parent b592172425
commit 042c2bed3c
7 changed files with 15 additions and 15 deletions

View File

@@ -1,6 +1,6 @@
import z from "zod";
import path from "path"; import path from "path";
import { $ } from "bun"; import { $ } from "bun";
import z from "zod";
import { Bus } from "../bus/index.js"; import { Bus } from "../bus/index.js";
import { Log } from "../utils/log.js"; import { Log } from "../utils/log.js";
import { NamedError } from "../utils/error.js"; import { NamedError } from "../utils/error.js";

View File

@@ -98,9 +98,9 @@ export namespace Session {
id: input.id, id: input.id,
// room: input.room || undefined, // room: input.room || undefined,
machine: input.machine, machine: input.machine,
relayUrl: input.relayUrl,
retry: input.retry || undefined, retry: input.retry || undefined,
queue: input.queue || undefined, queue: input.queue || undefined,
relayUrl: input.relayUrl || undefined,
description: input.description || undefined, description: input.description || undefined,
maxDuration: input.maxDuration || undefined, maxDuration: input.maxDuration || undefined,
resolution: input.resolution || undefined, resolution: input.resolution || undefined,

View File

@@ -38,7 +38,7 @@ export const sessionTable = pgTable("sessions", {
.notNull() .notNull()
.default("ns3-micro"), .default("ns3-micro"),
maxDuration: integer("max_duration"), maxDuration: integer("max_duration"),
relayUrl: varchar("relay_url", { length: 500 }).notNull(), relayUrl: varchar("relay_url", { length: 500 }),
resolution: varchar("resolution", { resolution: varchar("resolution", {
length: 20, length: 20,
}).$type<ScreenResolutionPresetName>(), }).$type<ScreenResolutionPresetName>(),

View File

@@ -135,14 +135,10 @@ export const SessionInfo = z
example: Examples.Session.maxDuration, example: Examples.Session.maxDuration,
}), }),
/** Nestri relay URL for streaming and signaling */ /** Nestri relay URL for streaming and signaling */
relayUrl: z relayUrl: z.url().optional().meta({
.url()
.optional()
.meta({
description: "Nestri relay URL for streaming and signaling", description: "Nestri relay URL for streaming and signaling",
example: Examples.Session.relayUrl, example: Examples.Session.relayUrl,
}) }),
.default("https://relay.nestri.io"),
/** Display or stream resolution in 'WxH' format */ /** Display or stream resolution in 'WxH' format */
resolution: ScreenResolutionPresetName.optional().meta({ resolution: ScreenResolutionPresetName.optional().meta({
description: "Display or stream resolution in 'WxH' format", description: "Display or stream resolution in 'WxH' format",

View File

@@ -12,7 +12,7 @@ type Tags = {
export namespace Log { export namespace Log {
const ctx = Context.create<{ const ctx = Context.create<{
tags: Record<string, any>; tags: Record<string, any>;
}>(); }>("Log");
export const Level = z export const Level = z
.enum(["DEBUG", "INFO", "WARN", "ERROR"]) .enum(["DEBUG", "INFO", "WARN", "ERROR"])

View File

@@ -9,13 +9,12 @@ const myTestSession = session({
framerate: 60, framerate: 60,
audioBitrate: 128, audioBitrate: 128,
gpuCardPath: "/dev/dri/renderD128", gpuCardPath: "/dev/dri/renderD128",
run: async (payload) => { run: async (payload) => {
console.log("Running test session with payload:", payload); console.log("Running test session with payload:", payload);
return { message: "Test session completed" }; return { message: "Test session completed" };
}, },
}); });
myTestSession.start().then((result) => { myTestSession.start({}).then((result) => {
console.log("Session result:", result); console.log("Session result:", result);
}); });

View File

@@ -1,10 +1,15 @@
import { Session } from "@nestri/core/session/index"; import { Session } from "@nestri/core/session/index";
type StartOptions = {
memberID: string;
userID: string;
};
// Simple session creation function using our clean Session types // Simple session creation function using our clean Session types
export function createSession(config: Session.Config): Session.Session { export function createSession(config: Session.Config): Session.Session {
const session: Session.Session = { const session: Session.Session = {
description: config.description, description: config.description,
start: async (payload: any) => { start: async (payload: any, options: StartOptions) => {
console.log( console.log(
`Starting session ${config.description} with payload:`, `Starting session ${config.description} with payload:`,
payload, payload,