6559ad3944
Express server with /health and a LiveKit token endpoint. Module skeletons for the full loop: vision (Gemini), GitHub fusion, collision detector (pure, testable), intervention engine, and continual-learning memory store. Approve native build scripts (esbuild/genai/protobufjs) at the workspace root. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
581 B
TypeScript
26 lines
581 B
TypeScript
import { AccessToken } from 'livekit-server-sdk';
|
|
import { env } from '../env.js';
|
|
|
|
/**
|
|
* Mint a LiveKit access token so an engineer's browser can join a pod room
|
|
* and publish screen + mic + cam tracks.
|
|
*/
|
|
export async function createPodToken(
|
|
podId: string,
|
|
identity: string,
|
|
name?: string,
|
|
): Promise<string> {
|
|
const at = new AccessToken(env.livekit.apiKey, env.livekit.apiSecret, {
|
|
identity,
|
|
name,
|
|
});
|
|
at.addGrant({
|
|
room: podId,
|
|
roomJoin: true,
|
|
canPublish: true,
|
|
canSubscribe: true,
|
|
canPublishData: true,
|
|
});
|
|
return at.toJwt();
|
|
}
|