@reinsjs/server 0.7.1 → 0.7.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @reinsjs/server
2
2
 
3
+ ## 0.7.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [fba2410]
8
+ - @reinsjs/core@0.13.0
9
+
3
10
  ## 0.7.1
4
11
 
5
12
  ### Patch Changes
package/README.md CHANGED
@@ -82,6 +82,7 @@ A message is queued only when all of these hold: the body has `sessionId` and a
82
82
  | `429 mailbox_full` | 16 messages are waiting to be written | resend later |
83
83
 
84
84
  - Generate the `deliveryId` before sending and **always** send it with `lastSeq` (`deliveryId`: printable ASCII without spaces, at most 128 characters; it may be omitted, then the server makes one and returns it in the `202`). A plain `POST` that starts a run carries it too, so every message is checked the same way. A retry with the same id is idempotent within one run; across runs, look for the ref in the events you already have before resending.
85
+ - `deliveryId` belongs to user messages only. A `core.tool_result` filling in a client-side tool must not carry it (`400`); it is delivered when the timeline holds a result for its `toolCallId`, and resending it is safe — once written the call is no longer pending, so a duplicate is never written twice and answers `409` (`unknown_tool_call`, or `run_in_progress` while the run it resumed is still going).
85
86
  - A host that builds a handler per request (for example, tools assembled from per-session credentials) gets mid-run input as long as every handler is created with the same `runs` instance — the same requirement as for `409` and stop requests to work across them. `createAgent` from `@reinsjs/agent` builds a new registry on every call, so create one at process level (`leasedRunRegistry(store.runLease)` or `new InMemoryRunRegistry()`) and pass it as `handler: { runs }`; otherwise each call has its own and a mid-run message answers `409` — or, without a `RunLease`, starts a second run on the same session (which typically ends in `seq_conflict`).
86
87
  - Handlers sharing one `runs` form one trust domain: the receiving handler's `principal` and `authorizeSession` decide whether a message is accepted, while the run executes it with the starting handler's tools, log and `onEvent`. Share a registry only between handlers that use the same log, the same namespace of principal ids and the same authorization rules.
87
88
  - You need a stream attached to the run to see the message arrive: the `POST` that started it, or `GET ?sessionId&lastSeq` to reconnect.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@reinsjs/server",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "reins — Web-standard (Request) => Response handler: runs the loop, streams the timeline as SSE, replays from lastSeq on reconnect",
5
5
  "keywords": [
6
6
  "agent",
@@ -36,7 +36,7 @@
36
36
  "CHANGELOG.md"
37
37
  ],
38
38
  "dependencies": {
39
- "@reinsjs/core": "0.12.0"
39
+ "@reinsjs/core": "0.13.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "esbuild": "^0.25.0",