stitchkit 0.115.0 → 0.116.0

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 (43) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/agent-runtime/coding-tool-paths.d.ts.map +1 -1
  3. package/dist/entrypoints/agent-runtime/coding-tools.js +4 -4
  4. package/dist/entrypoints/agent-runtime/harness.js +2 -2
  5. package/dist/entrypoints/agent-runtime/sandbox.js +4 -4
  6. package/dist/entrypoints/agent-runtime/sqlite/bun.js +6 -6
  7. package/dist/entrypoints/agent-runtime/sqlite/node.js +6 -6
  8. package/dist/entrypoints/agent-runtime/testing.js +6 -6
  9. package/dist/entrypoints/agent-runtime.js +6 -6
  10. package/dist/entrypoints/cli.js +3 -3
  11. package/dist/entrypoints/telegram/grammy.js +2 -2
  12. package/dist/entrypoints/telegram.d.ts +1 -1
  13. package/dist/entrypoints/telegram.d.ts.map +1 -1
  14. package/dist/entrypoints/telegram.js +22 -9
  15. package/dist/entrypoints/tools.js +3 -3
  16. package/dist/{index-dx5cm9pc.js → index-4g6qmgdx.js} +1 -1
  17. package/dist/{index-nregbbsc.js → index-6f49krb5.js} +1 -1
  18. package/dist/{index-x0ddbj85.js → index-arjmb6de.js} +36 -1
  19. package/dist/{index-crmswbrt.js → index-fa435yq2.js} +1 -1
  20. package/dist/{index-944x38nv.js → index-jq2ky8fw.js} +1 -1
  21. package/dist/{index-7yx8j6ay.js → index-n5sv4z0w.js} +12 -3
  22. package/dist/{index-j8kf56wx.js → index-q968hy6y.js} +1 -1
  23. package/dist/{index-3qqdqwxe.js → index-w7jq3fz9.js} +25 -5
  24. package/dist/internal/contained-files.d.ts +10 -0
  25. package/dist/internal/contained-files.d.ts.map +1 -1
  26. package/dist/telegram/budget-transformer.d.ts +5 -2
  27. package/dist/telegram/budget-transformer.d.ts.map +1 -1
  28. package/dist/telegram/outbound-budget.d.ts +26 -11
  29. package/dist/telegram/outbound-budget.d.ts.map +1 -1
  30. package/dist/tools/cli/view.d.ts +7 -1
  31. package/dist/tools/cli/view.d.ts.map +1 -1
  32. package/llms/agent-runtime.txt +2 -2
  33. package/llms/cli.txt +3 -1
  34. package/llms/stitchkit.txt +3 -3
  35. package/llms/telegram.txt +10 -3
  36. package/llms/{upgrading-0.104.0-0.115.0.txt → upgrading-0.105.0-0.116.0.txt} +26 -124
  37. package/llms/{upgrading-0.44.0-0.61.0.txt → upgrading-0.44.0-0.62.0.txt} +120 -3
  38. package/llms/{upgrading-0.62.0-0.78.0.txt → upgrading-0.63.0-0.83.0.txt} +181 -120
  39. package/llms/{upgrading-0.79.0-0.103.13.txt → upgrading-0.84.0-0.104.0.txt} +124 -181
  40. package/llms/upgrading.txt +4 -4
  41. package/llms-full.txt +41 -9
  42. package/llms.txt +6 -6
  43. package/package.json +1 -1
package/llms-full.txt CHANGED
@@ -78,13 +78,13 @@ own, recorded as an ADR.
78
78
  | `stitchkit/geo` | server (Bun or Node) | evolving | managed GeoIP reader generations, last-known-good reload and the optional MaxMind adapter |
79
79
  | `stitchkit/oauth` | browser **and** server | evolving | provider-neutral Authorization Code + PKCE request and one-shot callback transaction mechanics |
80
80
  | `stitchkit/google` | server (Bun or Node) | evolving | optional Google code exchange and verified OIDC identity adapter |
81
- | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 60 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
81
+ | `stitchkit/observability` | server | stable<br>_redefined in 2 of the 61 minors since 0.56.2, most recently 0.92.0_ | request/tool event projections — `createObservability`, trace context, sanitisation |
82
82
  | `stitchkit/testing` | tests on Bun or Node | stable | in-process generated clients over a real Fetch handler, the managed-resource conformance kit and manual time for schedules and retries |
83
83
  | `stitchkit/declaration` | browser + build and deployment tooling (Bun or Node) | evolving | `ProjectDeclarationSchema` — the one machine-readable statement a repository makes about itself |
84
84
  | `stitchkit/react` | browser + server rendering | stable | `createCursorQuery`, `createCacheBridge`, QueryClient and `ApiError` retry policy |
85
85
  | `stitchkit/react/keyboard` | browser | evolving | which part of a screen gets a key — ordered layers, one Escape per level, list zones with real focus; see [keyboard guide](keyboard.md) |
86
86
  | `stitchkit/react/keyboard/testing` | server (Bun or Node) | evolving | the keyboard layers and zones without a DOM — fakes for the window, elements and key events beside the two engines, to test the order of layers, `scope`/`inert` and the edges of a zone in milliseconds |
87
- | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 25 of the 60 minors since 0.56.2, most recently 0.115.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
87
+ | `stitchkit/agent-runtime` | server | evolving<br>_redefined in 25 of the 61 minors since 0.56.2, most recently 0.115.0_ | optional durable conversation/run loop, history, models, prompts, fencing and events |
88
88
  | `stitchkit/agent-runtime/sandbox` | server | evolving | optional Linux Bubblewrap sessions, durable workspaces and a host HTTP credential gateway; see [sandbox guide](sandbox.md) |
89
89
  | `stitchkit/agent-runtime/testing` | tests on Bun or Node | evolving | credential-free replay, scripted provider faults, deterministic race controls and the agent-store conformance kit |
90
90
  | `stitchkit/agent-runtime/harness` | server | evolving | resource-aware process-local facade over the canonical Agent runtime; supervision stays outside |
@@ -96,7 +96,7 @@ own, recorded as an ADR.
96
96
  | `stitchkit/agent-runtime/sqlite/bun` | server (Bun) | evolving | durable built-in SQLite store for the agent runtime |
97
97
  | `stitchkit/agent-runtime/sqlite/node` | server (Node ≥ 22.5) | evolving | durable built-in SQLite store for the agent runtime |
98
98
  | `stitchkit-tui` | terminal (Bun) | evolving | optional official OpenTUI host over a caller-composed headless runtime |
99
- | `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the 60 minors since 0.56.2, most recently 0.110.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
99
+ | `stitchkit/application` | browser + server | evolving<br>_redefined in 14 of the 61 minors since 0.56.2, most recently 0.110.0_ | managed resource graph, readiness, admission, schedules, subtree restart and bounded shutdown |
100
100
  | `stitchkit/application/grammy` | server | evolving | a grammY bot as application resources — configuration, then polling with updates admitted by batch — and the webhook adapter |
101
101
  | `stitchkit/application/opentelemetry` | server | evolving | maps application snapshots onto an injected OpenTelemetry `Meter` |
102
102
  | `stitchkit/application/schemas` | browser + server | evolving | the application's snapshot, health and shutdown schemas alone, without the kernel |
@@ -5671,8 +5671,8 @@ stay pinned through authorization; `write_file` plans before it and opens the pa
5671
5671
  the parent it creates does not exist yet. Reads revalidate the pinned file identity;
5672
5672
  writes and patches revalidate the pinned parent identity; search and resource discovery descend
5673
5673
  only through opened directories. A path that changed during authorization refuses with `CONFLICT`.
5674
- Policies compare path strings, so on a case-insensitive filesystem such as default macOS volumes a
5675
- rule on `credentials` does not match `CREDENTIALS`; such a host must normalize in its own policy.
5674
+ A path spelled differently from the name stored on disk refuses before any policy reads it, so on a
5675
+ case-insensitive volume a rule on `credentials` cannot be passed by asking for `CREDENTIALS`.
5676
5676
  NUL bytes are refused before either host policy sees a path.
5677
5677
  Reads and edits open file candidates without blocking on special files, then require a regular
5678
5678
  file. A writerless FIFO therefore refuses instead of occupying a filesystem worker. `write_file`
@@ -10483,7 +10483,9 @@ myapp item_list --sort messages --top 5 --json # the same five, a
10483
10483
  myapp item_list --sort name --ascending # ordered the other way
10484
10484
  ```
10485
10485
 
10486
- Groups come back largest first for the same reason. A record that carries no
10486
+ Groups come back largest first for the same reason, in the printed bytes even when a key looks
10487
+ like a number; a reader that parses them into a JavaScript object reorders such keys itself.
10488
+ A string equal to `null` or `(absent)` is quoted, so it stays apart from the missing value. A record that carries no
10487
10489
  value for the sort field sorts **last in both directions**: it is not the
10488
10490
  smallest, it is not on the scale at all, and letting it lead an ascending list
10489
10491
  would answer a question nobody asked.
@@ -15916,6 +15918,13 @@ cast, and a send cancelled in the queue then waits for its slot and fails as
15916
15918
  a follow-up call to action after an album costs one more. Reads and edits
15917
15919
  (`getMe`, `getFile`, `editMessage*`, `deleteMessage`, `sendChatAction`) do not
15918
15920
  spend the budget.
15921
+ - **Two lanes share one rate.** A call is `interactive` by default; a campaign passes
15922
+ `{ lane: 'bulk' }` to `run` or `acquire`, or installs
15923
+ `telegramBudgetTransformer(budget, { lane: 'bulk' })` on its own `Api`. A waiting
15924
+ interactive call is granted first, so a reply never queues behind recipients;
15925
+ the wait it can still see is the interval of the grant before it, up to one
15926
+ album. Bulk runs at whatever rate replies leave, and the sum never exceeds
15927
+ `messagesPerSecond`.
15919
15928
  - **The first send after idle is immediate; the rest are spaced.** This is a
15920
15929
  strict budget, not a bucket that saves a burst: at 24/s the next send is due
15921
15930
  one interval later. A 429 pauses the whole token; when it resumes, one send
@@ -15927,8 +15936,8 @@ cast, and a send cancelled in the queue then waits for its slot and fails as
15927
15936
  The refusal may be thrown or returned: a client transformer sits below the
15928
15937
  place where grammY turns Telegram's `{ ok: false, error_code: 429, … }` body into
15929
15938
  a `GrammyError`, so `run` reads that body too and hands it back unchanged.
15930
- A 429 from an edit or a read is still a fact about the token and pauses later
15931
- sends too. A network failure is rethrown unchanged and stays `unknown`; a 5xx
15939
+ A 429 from an edit or a read concerns that call and pauses nothing; `budget.pauseAfter`
15940
+ remains for a caller who decides otherwise. A network failure is rethrown unchanged and stays `unknown`; a 5xx
15932
15941
  is rethrown unchanged and stays `server-error`. Neither is retried by the
15933
15942
  budget or pauses the token — repeating a send whose outcome is unknown is a
15934
15943
  decision, not a primitive's silent guess.
@@ -16786,6 +16795,29 @@ analytics policy belong to the application.
16786
16795
 
16787
16796
  # Upgrading stitchkit
16788
16797
 
16798
+ ## Released migration: 0.116.0
16799
+
16800
+ ### send-only-telegram-pause
16801
+
16802
+ **Who must act:** code that relied on a 429 from `editMessage*`, `deleteMessage` or a read to stop a
16803
+ token's sends. Code that only sends needs no change.
16804
+
16805
+ `run` pauses the token only on a method that spends the budget
16806
+ ([ADR 0277](../decisions/0277-a-telegram-budget-serves-replies-first.md)). Where an edit must still stop
16807
+ the sends, say so:
16808
+
16809
+ ```ts
16810
+ // before
16811
+ await budget.run('editMessageText', payload, signal, send)
16812
+ // after
16813
+ await budget.run('editMessageText', payload, signal, send).catch((error) => {
16814
+ budget.pauseAfter(error)
16815
+ throw error
16816
+ })
16817
+ ```
16818
+
16819
+ Search pattern: `budget.run` next to edit and read methods.
16820
+
16789
16821
  ## Released migration: 0.115.0
16790
16822
 
16791
16823
  ### contained-cli-downloads
@@ -23828,7 +23860,7 @@ injected grammY bot. → ADR 0143, ADR 0201, ADR 0274 — [guide](../guide/teleg
23828
23860
  | `TelegramFetch` / `TelegramBotTransportOpen` / `TelegramBotTransportResolve` / `TelegramBotTransportSocket` | _types_ | the `(url, init) => Promise<Response>` the senders take; the transport's socket factory, resolver and the structural socket it needs (a Node `net.Socket` or `tls.TLSSocket` fits) |
23829
23861
  | `TelegramNotDispatchedError` / `TelegramNotDispatchedStage` | class / _type_ | a request that provably never left (`lookup`, `connect` or `request`), so repeating it cannot duplicate a message |
23830
23862
  | `TelegramSendFailureReason` / `TELEGRAM_SEND_FAILURE_REASONS` | _type_ / constant | `blocked-by-user` / `user-deactivated` / `chat-not-found` / `not-started` / `bot-to-bot-disabled` / `rate-limited` / `message-invalid` / `server-error` / `not-dispatched` / `unknown`, and the same as a list; a `Record<TelegramSendFailureReason, …>` over them fails to compile when a reason is added |
23831
- | `telegramOutboundBudget` / `TelegramOutboundBudget` / `TelegramOutboundBudgetConfig` / `TelegramOutboundBudgetStats` | function / _type_ | one token-wide outbound budget: one object per token in the process, strict 24 messages/s by default, weighted albums and multi-message copies, `run(method, payload, signal, send)` as the transformer adapter (a 429 pauses the token whether `send` throws it or resolves with the Bot API's `{ ok: false, … }` body), `pause`/`pauseAfter` for 429, `waitUntilResumed` for non-send retries and `stats`; it paces and never retries, and no public value carries the token |
23863
+ | `telegramOutboundBudget` / `TelegramOutboundBudget` / `TelegramOutboundBudgetConfig` / `TelegramOutboundBudgetStats` / `TelegramOutboundCallOptions` / `TelegramOutboundLane` | function / _type_ | one token-wide outbound budget: one object per token in the process, strict 24 messages/s by default, weighted albums and multi-message copies, an `interactive` lane granted before `bulk`, `run(method, payload, signal, send, { lane })` as the transformer adapter (a 429 on a send pauses the token whether `send` throws it or resolves with the Bot API's `{ ok: false, … }` body), `pause`/`pauseAfter` for 429, `waitUntilResumed` for non-send retries and `stats`; it paces and never retries, and no public value carries the token |
23832
23864
  | `runTelegramBroadcast` | function | a resumable broadcast by `name` under a state `directory`: audience and journal durably recorded, pacing at `ratePerSecond` (25), exact retry delays within the finite declared budget, injected classifier, uncertain send outcomes never replayed, `dryRun`, one fenced runner per name |
23833
23865
  | `TelegramBroadcastConfig` / `TelegramBroadcastSend` / `TelegramBroadcastReport` / `TelegramBroadcastRunOutcome` / `TelegramBroadcastOutcome` / `TelegramBroadcastRecipient` | _type_ | `name`, `directory`, `recipients()`, `send({ recipient, attempt })`, `maxAttempts`, `signal`, `onProgress`; counts `delivered` / `unreachable` / `failed` / `uncertain` / `pending` and `finished` / `stopped` / `halted` / `dry-run` |
23834
23866
  | `TelegramBroadcastFailureSchema` / `TelegramBroadcastFailure` | schema / _type_ | injected `classify` answers retry-after/transient/permanent/ambiguous; exact provider delay is bounded by `maxRetryDelayMs` without shortening, unknown outcome remains uncertain and is never replayed |
package/llms.txt CHANGED
@@ -19,7 +19,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
19
19
  - **stitchkit/tools/contract**: [llms/tools-contract.txt](llms/tools-contract.txt) 0.2 KB
20
20
  - **stitchkit/tools/invoker**: [llms/tools-invoker.txt](llms/tools-invoker.txt) 0.2 KB
21
21
  - **stitchkit/tools/connections**: [llms/tools-connections.txt](llms/tools-connections.txt) 3.9 KB
22
- - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 36.3 KB → [llms/cli.2.txt](llms/cli.2.txt) 36.4 KB
22
+ - **stitchkit/cli**: [llms/cli.txt](llms/cli.txt) 36.5 KB → [llms/cli.2.txt](llms/cli.2.txt) 36.4 KB
23
23
  - **stitchkit/cli/publish**: [llms/cli-publish.txt](llms/cli-publish.txt) 1.5 KB
24
24
  - **stitchkit/remote**: [llms/remote.txt](llms/remote.txt) 1.0 KB
25
25
  - **stitchkit/contract**: [llms/contract.txt](llms/contract.txt) 31.9 KB
@@ -43,7 +43,7 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
43
43
  - **stitchkit/testing**: [llms/testing.txt](llms/testing.txt) 33.6 KB
44
44
  - **stitchkit/agent-runtime/sandbox**: [llms/agent-runtime-sandbox.txt](llms/agent-runtime-sandbox.txt) 8.3 KB
45
45
  - **stitchkit/files**: [llms/files.txt](llms/files.txt) 5.7 KB
46
- - **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 41.6 KB
46
+ - **stitchkit/telegram**: [llms/telegram.txt](llms/telegram.txt) 42.2 KB
47
47
  - **stitchkit/telegram/grammy**: [llms/telegram-grammy.txt](llms/telegram-grammy.txt) 1.2 KB
48
48
  - **stitchkit/telegram/html**: [llms/telegram-html.txt](llms/telegram-html.txt) 2.7 KB
49
49
  - **stitchkit/telegram/screens**: [llms/telegram-screens.txt](llms/telegram-screens.txt) 21.2 KB
@@ -66,10 +66,10 @@ Load the slice for each entrypoint your code imports — `import … from 'stitc
66
66
 
67
67
  ## Upgrading slices
68
68
  - **Upgrading — how to move across versions**: [llms/upgrading.txt](llms/upgrading.txt) 12.7 KB
69
- - **Upgrading 0.104.0 → 0.115.0**: [llms/upgrading-0.104.0-0.115.0.txt](llms/upgrading-0.104.0-0.115.0.txt) 46.3 KB
70
- - **Upgrading 0.79.0 → 0.103.13**: [llms/upgrading-0.79.0-0.103.13.txt](llms/upgrading-0.79.0-0.103.13.txt) 46.3 KB
71
- - **Upgrading 0.62.0 → 0.78.0**: [llms/upgrading-0.62.0-0.78.0.txt](llms/upgrading-0.62.0-0.78.0.txt) 42.2 KB
72
- - **Upgrading 0.44.0 → 0.61.0**: [llms/upgrading-0.44.0-0.61.0.txt](llms/upgrading-0.44.0-0.61.0.txt) 41.4 KB
69
+ - **Upgrading 0.105.0 → 0.116.0**: [llms/upgrading-0.105.0-0.116.0.txt](llms/upgrading-0.105.0-0.116.0.txt) 40.2 KB
70
+ - **Upgrading 0.84.0 → 0.104.0**: [llms/upgrading-0.84.0-0.104.0.txt](llms/upgrading-0.84.0-0.104.0.txt) 46.1 KB
71
+ - **Upgrading 0.63.0 → 0.83.0**: [llms/upgrading-0.63.0-0.83.0.txt](llms/upgrading-0.63.0-0.83.0.txt) 44.0 KB
72
+ - **Upgrading 0.44.0 → 0.62.0**: [llms/upgrading-0.44.0-0.62.0.txt](llms/upgrading-0.44.0-0.62.0.txt) 46.5 KB
73
73
  - **Upgrading 0.37.0 → 0.44.0**: [llms/upgrading-0.37.0-0.44.0.txt](llms/upgrading-0.37.0-0.44.0.txt) 14.7 KB
74
74
 
75
75
  ## Guide (web)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "stitchkit",
3
- "version": "0.115.0",
3
+ "version": "0.116.0",
4
4
  "description": "Contract-first backend framework — one defineContract() into an HTTP API, MCP tools, AI-agent tools and a typed client. Bun and Node.",
5
5
  "keywords": [
6
6
  "bun",