@theoremjs/web 0.3.5-next.927.g1f89ea0 → 0.3.5-next.930.gfb5cd40

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.
Files changed (2) hide show
  1. package/README.md +2 -2
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -458,11 +458,11 @@ Browser dispatch uses a host-owned `PageToolExecution` service beside the execut
458
458
  `createTheoremHandler` supplies both services. Live relays put the session boundary's `pageExecution` and `toolExecution` on `SessionRequest`.
459
459
 
460
460
  A tool with a `background` setting runs inline until you pass the `background` option to `createTheoremHandler`, or return `background` from `prepare`, with an `execution` of your own that has `detach`, when the same turns run elsewhere in your app too. 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. A conversation read shows the call as it stands: running, then its result, or an error for a marked call. An open page reads it on its next turn or reload, unless you set `notifier`. When the session has dropped a settled operation, the block reads an error with the code `outcome_not_retained`. On a durable store, a worker that dies leaves the operation as `background`, so your sweep marks it `uncertain` with `worker_lost` through `compareAndSwap`. Keep the service's values valid after the request ends. A live relay passes its service to `runSession`.
461
- To show an open page that a background call ended, with no turn or reload, pass `notifier: createMemoryNotifier()` to `createTheoremHandler`. While a call runs, the conversation read tells the page to open `POST <base>/notify`. The handler sends one `changed` line when the stream opens, and one when each background call in the session ends. The line carries no content, so the page calls the same conversation read as before. The page closes the stream when no call runs. The model reads the result without a new message. When results are due, the conversation read says `wake: true`, and the page posts `<base>/wake` once it is idle. The handler runs a turn with no message: it passes the session's stored outcome in `input.lateResults`, and the model answers. The turn is the wake. A result is due when its call settled, the transcript does not end on a person's message, no `late-results` block names the call, and no wake took the result up before. The handler marks each result taken (`wokenAt` on the session's operation) before the model runs, so one result wakes the conversation once. Two pages that post at once run one turn, and a wake that fails is not tried again. The next message still reads any result that no `late-results` block names, so nothing is lost. A message the person sends during a wake wins: the wake writes nothing, and its stream ends with no error. `authorizeWake` decides whether a wake runs, for example to cap wakes for each person. A refused wake still marks its results taken. A call `authorizeToolReplay` withholds from the request stays unread and does not wake.
461
+ To show an open page that a background call ended, with no turn or reload, pass `notifier: createMemoryNotifier()` to `createTheoremHandler`. While a call runs, the conversation read tells the page to open `POST <base>/notify`. The handler sends one `changed` line when the stream opens, and one when each background call in the session ends. The line carries no content, so the page calls the same conversation read as before. The page closes the stream when no call runs. The model reads the result without a new message. When results are due, the conversation read says `wake: true`, and the page posts `<base>/wake` once it is idle. The handler runs a turn with no message: it passes the session's stored outcome in `input.lateResults`, and the model answers. The turn is the wake. A result is due when its call settled, the transcript does not end on a person's message, no `late-results` block names the call, and no wake took the result up before. The handler marks each result taken (`wokenAt` on the session's operation) before the model runs, so one result wakes the conversation once. Two pages that post at once run one turn, and a wake that fails is not tried again. The next message still reads any result that no `late-results` block names, while the session keeps the operation. A message the person sends during a wake wins: the wake writes nothing, and its stream ends with no error. `authorizeWake` decides whether a wake runs, for example to cap wakes for each person. A refused wake still marks its results taken. A call `authorizeToolReplay` withholds from the request stays unread and does not wake.
462
462
 
463
463
  The late-results feed is the one way a result reaches the model. If your `background` service told the model a result some other way, such as with your own `onStage`, remove that, or the model reads it twice.
464
464
 
465
- To wake a conversation with no page open, post `<base>/wake` through the handler from your server, with your own `Request` and the conversation's current reference. Your `conversationStore` must give that reference: `createSealedConversationStore` gives a new one on each write, which only the page holds.
465
+ To wake a conversation with no page open, post `<base>/wake` through the handler from your server, with your own `Request` and the conversation's current reference. Your `conversationStore` must give that reference: the reference of `createSealedConversationStore` is the sealed conversation itself, so each write gives a new one, which only the page holds.
466
466
 
467
467
  `createMemoryNotifier` reaches only pages connected to the process that ran the call. On more than one instance, give a shared `TheoremNotifier`. Your sweep calls `publish` with the session id after it marks a call `worker_lost`, because that write does not pass through the handler. Hosting platforms cut long responses. Set `notifyRetryMs` so that the page reopens the stream after that wait. Unset, the page does not reopen it, and reads the end on its next turn or reload.
468
468
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theoremjs/web",
3
- "version": "0.3.5-next.927.g1f89ea0",
3
+ "version": "0.3.5-next.930.gfb5cd40",
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.5-next.927.g1f89ea0"
28
+ "@theoremjs/agents": "^0.3.5-next.930.gfb5cd40"
29
29
  }
30
30
  }