(fn?: CreateSession)
| 98 | } |
| 99 | |
| 100 | function createSessionResolver(fn?: CreateSession) { |
| 101 | if (!fn) { |
| 102 | return undefined |
| 103 | } |
| 104 | |
| 105 | return async (ctx: BootContext, input: CreateSessionInput): Promise<ResolvedSession> => { |
| 106 | const created = await fn(ctx.sdk, input) |
| 107 | if (!created.id) { |
| 108 | throw new Error("Failed to create session") |
| 109 | } |
| 110 | |
| 111 | return { |
| 112 | sessionID: created.id, |
| 113 | sessionTitle: created.title, |
| 114 | agent: input.agent, |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | |
| 119 | type RuntimeState = { |
| 120 | shown: boolean |
no test coverage detected