@theoremjs/web 0.3.4-next.715.geef22fd → 0.3.4-next.717.gd16ffc6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -131,8 +131,13 @@ const boundary = await createTheoremSessionBoundary({
131
131
  });
132
132
  const open = parseLiveOpenMessage(firstFrame);
133
133
  const session = await runSession(
134
- { profile, ...await boundary.prepareLiveOpen(open, hostContext) },
135
- { vault: hostKeyVault, execution: boundary.toolExecution, pageExecution: boundary.pageExecution },
134
+ {
135
+ profile,
136
+ ...await boundary.prepareLiveOpen(open, hostContext),
137
+ execution: boundary.toolExecution,
138
+ pageExecution: boundary.pageExecution,
139
+ },
140
+ { vault: hostKeyVault },
136
141
  );
137
142
  for await (const event of session.events()) {
138
143
  if ((event.type === 'done' || event.type === 'provider_checkpoint') && event.providerState) {
@@ -447,9 +452,9 @@ These claims do not provide exactly-once effects at the destination. Use the ope
447
452
  Concurrent pending attempts can reach preparation before one claims the body.
448
453
  Permission checks and pre-body hooks must be read-only or independently idempotent. The kernel cannot prove hook purity.
449
454
  A live session does not restore a dispatched call after an unexpected failure. It retains an uncertain call on that connection.
450
- To retain execution claims across connections, supply a durable coordinator through `RunSessionOptions.execution`.
455
+ To retain execution claims across connections, supply a durable coordinator as `execution` on `SessionRequest`.
451
456
  Browser dispatch uses a host-owned `PageToolExecution` service beside the execution coordinator.
452
- `createTheoremHandler` supplies both services. Live relays pass the session boundary's `pageExecution` and `toolExecution` to `runSession`.
457
+ `createTheoremHandler` supplies both services. Live relays put the session boundary's `pageExecution` and `toolExecution` on `SessionRequest`.
453
458
 
454
459
  A tool with a `background` setting runs inline until you pass the `background` option to `createTheoremHandler`. The option takes `{ request, sessionId }` and returns a `ToolBackgroundService`, which receives each detached call and its late events. The session keeps the call as `background` until it settles, and a late settlement does not invalidate a checkpoint. Keep the service's values valid after the request ends. A live relay passes its service to `runSession`.
455
460
  Forward live page results to `answerPageResult`. Preserve checkpoint ownership through `beforeEvent` when using the Studio bridge.
@@ -19,6 +19,10 @@ export type LiveCallOptions = {
19
19
  slots?: Record<string, string>;
20
20
  /** Which prompt lines the call gets, for a host that lets its page choose (`pageStatesTurn`). */
21
21
  stated?: StatedTurn;
22
+ /** The model picked for the call, read as the call starts, when the profile allows it. */
23
+ model?: string;
24
+ /** That model's effort, read as the call starts, when the binding allows it. */
25
+ effort?: string;
22
26
  /**
23
27
  * What the page tells the agent: any JSON. It goes with the call's opening, and
24
28
  * again whenever it changes, as background the agent reads without replying.
@@ -26,6 +26,10 @@ export interface LiveClientOptions {
26
26
  slots?: Record<string, string>;
27
27
  /** Which prompt lines the call gets, for a host that lets its page choose (`pageStatesTurn`). */
28
28
  stated?: StatedTurn;
29
+ /** The model picked for the call, when the profile allows it. */
30
+ model?: string;
31
+ /** That model's effort, when the binding allows it. */
32
+ effort?: string;
29
33
  /** What the page tells the agent as the call opens; `setContext` replaces it during the call. */
30
34
  context?: unknown;
31
35
  relayUrl?: string;
@@ -228,12 +228,14 @@ export class LiveSessionClient {
228
228
  }
229
229
  /** The first message: the call's values, and the handle and time away when it takes a dropped call up again. */
230
230
  openMessage() {
231
- const { slots, stated, openMessage: host } = this.options;
231
+ const { slots, stated, model, effort, openMessage: host } = this.options;
232
232
  return {
233
233
  type: 'open',
234
234
  ...(this.history.length ? { history: structuredClone(this.history) } : {}),
235
235
  ...(slots ? { slots } : {}),
236
236
  ...(stated ? { stated } : {}),
237
+ ...(model ? { model } : {}),
238
+ ...(effort ? { effort } : {}),
237
239
  ...(this.context === undefined ? {} : { context: this.context }),
238
240
  ...(this.providerState
239
241
  ? {
@@ -22,6 +22,10 @@ export type LiveOpenMessage = {
22
22
  context?: unknown;
23
23
  /** Which prompt lines the call gets, for a host that lets its page choose (`pageStatesTurn`). */
24
24
  stated?: StatedTurn;
25
+ /** The model picked for the call, when the profile allows it. */
26
+ model?: string;
27
+ /** That model's effort, when the binding allows it. */
28
+ effort?: string;
25
29
  /** A call that dropped, taken up again: the provider's handle, and how long the caller was away. */
26
30
  resume?: {
27
31
  providerState: ProviderCheckpoint;
@@ -15,6 +15,8 @@ const liveOpenMessage = z.object({
15
15
  slots: z.record(z.string(), z.string()).optional(),
16
16
  context: z.unknown().optional(),
17
17
  stated: statedTurnSchema.optional(),
18
+ model: z.string().optional(),
19
+ effort: z.string().optional(),
18
20
  resume: z
19
21
  .object({ providerState: providerCheckpointSchema, awayMs: z.number().nonnegative() })
20
22
  .optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theoremjs/web",
3
- "version": "0.3.4-next.715.geef22fd",
3
+ "version": "0.3.4-next.717.gd16ffc6",
4
4
  "description": "Theorem on the web platform, with no UI framework: Web-standard server handlers that serve a profile, and the browser client that talks to them.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,6 +25,6 @@
25
25
  },
26
26
  "peerDependencies": {
27
27
  "zod": "^4.6.5",
28
- "@theoremjs/agents": "^0.3.4-next.715.geef22fd"
28
+ "@theoremjs/agents": "^0.3.4-next.717.gd16ffc6"
29
29
  }
30
30
  }
@@ -7,4 +7,4 @@ export declare function kernelTurnInput(input: TheoremTurnInput, server?: unknow
7
7
  * What a live call's first message asks of the session, as `runSession` takes
8
8
  * it: the page's context is the client's, and `server` is the host's own.
9
9
  */
10
- export declare function liveSessionOpen(open: LiveOpenMessage, server?: unknown): Pick<SessionRequest, 'slots' | 'context' | 'providerState' | 'awayMs' | 'history' | 'path' | 'conditions'>;
10
+ export declare function liveSessionOpen(open: LiveOpenMessage, server?: unknown): Pick<SessionRequest, 'slots' | 'context' | 'providerState' | 'awayMs' | 'history' | 'path' | 'conditions' | 'model' | 'effort'>;
@@ -23,6 +23,8 @@ export function liveSessionOpen(open, server) {
23
23
  ...(open.slots ? { slots: open.slots } : {}),
24
24
  ...(context ? { context } : {}),
25
25
  ...open.stated,
26
+ ...(open.model ? { model: open.model } : {}),
27
+ ...(open.effort ? { effort: open.effort } : {}),
26
28
  ...(open.resume
27
29
  ? { providerState: open.resume.providerState, awayMs: open.resume.awayMs }
28
30
  : {}),