@reinsjs/lowering-fetch 0.6.0 → 0.6.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,30 @@
1
1
  # @reinsjs/lowering-fetch
2
2
 
3
+ ## 0.6.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [b79d193]
8
+ - @reinsjs/core@0.11.0
9
+
10
+ ## 0.6.1
11
+
12
+ ### Patch Changes
13
+
14
+ - 45bfc8d: Stop semantics, no replay of interrupted writes, a stop request in the server, and narrower resume validation.
15
+
16
+ - **Stop is a kind of abort.** `controller.abort(new RunStop())` makes every pause point close the pending tool calls with an error result ("Not executed: the run was stopped by the user…"; calls that had already started get "outcome unknown" or "interrupted"), so the next run asks the model directly instead of re-running what the user stopped. Approval-pending and client-tool calls are closed too. The result is still `paused` / `host` with the note `stopped by the user`. `new RunStop("host")` is for a host closing calls left by an interrupted run: the same closing, but the texts say an earlier run was interrupted instead of blaming the user (`stopTextsOf`). A run whose signal is already aborted when it starts no longer writes `core.tools_bound` or the tool-change note. Other abort reasons keep the old behaviour (pending calls are replayed on resume). An abort that lands while the request is still connecting now ends as `paused(host)` instead of `error`.
17
+ - **Interrupted writes are not replayed.** New `Tool.replayable` (default: only `risk: "low"` tools) and `isReplayable()`. Non-replayable tools get a model-invisible `core.tool_started` event before `execute`; on resume, a started call without a result is closed with "outcome unknown, check the current state before retrying" instead of running again. A signal-aware write tool cut off by an abort gets the same result instead of "Tool execution failed". Tools that do not declare `risk` now write one extra event per call.
18
+ - **Server stop request.** `POST { sessionId, stop: true }` answers JSON `{ status: "stopping" | "idle", sessionId }` without waiting for the run. `SessionAuthzInput.method` gains `"STOP"` — hooks that allow writes only for `"POST"` will refuse stop requests until they accept `"STOP"`.
19
+ - **`asTool`** declares `replayable: true`, resumes a child only when the parent already recorded `tool_started` for that call (a stopped expert's next task is no longer swallowed), and closes a child's leftover pending calls with `RunStop("host")` before starting a new task.
20
+ - **Narrower resume validation.** `SerializedRunState` gains optional `modelDigest` / `pendingToolsDigest` (included in the signature when present). States carrying them only check the model and the definitions of the tools behind the pending calls, so adding an unrelated tool no longer makes paused sessions answer `409 config_mismatch`; older states still compare the whole configuration hash.
21
+ - Lowerings and the AG-UI encoder declare landings for `core.tool_started` (dropped / `CUSTOM`). The TanStack adapter writes `tool_started` in `onBeforeToolCall` and applies the same no-replay rule; stop handling and resume validation stay out of its scope.
22
+
23
+ **Rollback risk:** sessions that contain `core.tool_started` cannot be read by `@reinsjs/core` 0.9 or earlier. Sessions paused inside a sub-agent before upgrading resume the child as a new task after upgrading; let them finish first.
24
+
25
+ - Updated dependencies [45bfc8d]
26
+ - @reinsjs/core@0.10.0
27
+
3
28
  ## 0.6.0
4
29
 
5
30
  ### Minor Changes
package/dist/index.js CHANGED
@@ -346,6 +346,12 @@ var NOT_SENT = {
346
346
  "a snapshot of the tool table; the loop announces changes to it in a separate system_note"
347
347
  )
348
348
  ],
349
+ "core.tool_started": [
350
+ dropped(
351
+ "none",
352
+ "marks that a call began executing, for resume and stop handling; the model learns the outcome from tool_result"
353
+ )
354
+ ],
349
355
  "core.error": [
350
356
  dropped(
351
357
  "none",
@@ -696,6 +702,7 @@ function eventsToIr(input) {
696
702
  case "core.memory_op":
697
703
  case "core.handoff":
698
704
  case "core.tools_bound":
705
+ case "core.tool_started":
699
706
  case "core.error":
700
707
  items.push({ kind: "dropped", event: e, note: NOT_SENT_NOTE });
701
708
  break;