stitchkit 0.100.2 → 0.100.3
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 +86 -0
- package/README.md +2 -1
- package/dist/entrypoints/agent-runtime/browser.js +119 -119
- package/dist/entrypoints/agent-runtime/coding-tools.js +15 -20
- package/dist/entrypoints/agent-runtime/harness.js +55 -63
- package/dist/entrypoints/agent-runtime/openrouter.js +6 -6
- package/dist/entrypoints/agent-runtime/sandbox.js +20 -25
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +11 -13
- package/dist/entrypoints/agent-runtime/sqlite/node.js +11 -13
- package/dist/entrypoints/agent-runtime/testing.js +32 -34
- package/dist/entrypoints/agent-runtime.js +395 -402
- package/dist/entrypoints/application/diagnostic-journal.js +26 -27
- package/dist/entrypoints/application/directory-inbox.js +16 -17
- package/dist/entrypoints/application/grammy.js +13 -13
- package/dist/entrypoints/application/opentelemetry.js +13 -13
- package/dist/entrypoints/application/schemas.js +24 -24
- package/dist/entrypoints/application.js +208 -210
- package/dist/entrypoints/bin/upgrade-cli.js +2 -2
- package/dist/entrypoints/cli.js +81 -84
- package/dist/entrypoints/contract.js +54 -57
- package/dist/entrypoints/declaration.js +22 -22
- package/dist/entrypoints/files.js +18 -21
- package/dist/entrypoints/geo.js +7 -8
- package/dist/entrypoints/google.js +2 -2
- package/dist/entrypoints/index.js +150 -154
- package/dist/entrypoints/live.js +45 -47
- package/dist/entrypoints/node.js +68 -74
- package/dist/entrypoints/oauth.js +6 -6
- package/dist/entrypoints/observability.d.ts +1 -0
- package/dist/entrypoints/observability.d.ts.map +1 -1
- package/dist/entrypoints/observability.js +115 -87
- package/dist/entrypoints/primitives.js +35 -35
- package/dist/entrypoints/react/keyboard.d.ts +4 -0
- package/dist/entrypoints/react/keyboard.d.ts.map +1 -0
- package/dist/entrypoints/react/keyboard.js +397 -0
- package/dist/entrypoints/react.js +10 -10
- package/dist/entrypoints/release.js +7 -7
- package/dist/entrypoints/remote.js +15 -17
- package/dist/entrypoints/server.js +198 -200
- package/dist/entrypoints/telegram/html.d.ts +5 -0
- package/dist/entrypoints/telegram/html.d.ts.map +1 -0
- package/dist/entrypoints/telegram/html.js +26 -0
- package/dist/entrypoints/telegram/screens.d.ts +14 -0
- package/dist/entrypoints/telegram/screens.d.ts.map +1 -0
- package/dist/entrypoints/telegram/screens.js +2028 -0
- package/dist/entrypoints/telegram.d.ts +5 -1
- package/dist/entrypoints/telegram.d.ts.map +1 -1
- package/dist/entrypoints/telegram.js +548 -156
- package/dist/entrypoints/testing.js +75 -79
- package/dist/entrypoints/tools/connections.js +30 -32
- package/dist/entrypoints/tools/contract.js +18 -20
- package/dist/entrypoints/tools/invoker.js +12 -17
- package/dist/entrypoints/tools.js +223 -229
- package/dist/entrypoints/tracking/server.js +6 -6
- package/dist/entrypoints/tracking.js +40 -42
- package/dist/entrypoints/voice.js +3 -3
- package/dist/{index-eaysmdtq.js → index-0ndk4555.js} +56 -56
- package/dist/{index-2bxbyab0.js → index-1bx1xv1k.js} +1 -1
- package/dist/{index-p5r7qpdd.js → index-1eeqpadm.js} +4 -4
- package/dist/{index-hadmp193.js → index-3ct7hhq6.js} +210 -210
- package/dist/{index-e01r054k.js → index-45tdvqa3.js} +26 -26
- package/dist/{index-dce5wxcq.js → index-4s0fep5q.js} +8 -8
- package/dist/index-50ejfz75.js +9 -0
- package/dist/{index-m9zn6cpq.js → index-5107q189.js} +12 -12
- package/dist/{index-sbdmyz75.js → index-5cc6r990.js} +3 -3
- package/dist/index-6k1svmjh.js +141 -0
- package/dist/{index-c6bxbsnc.js → index-7kxw1awn.js} +2 -2
- package/dist/{index-0r0fbk7z.js → index-7z9ym7t8.js} +28 -28
- package/dist/{index-p7hgdyhb.js → index-814xpr6d.js} +2 -2
- package/dist/{index-gtj3zc53.js → index-8kzct1d6.js} +99 -99
- package/dist/{index-1zbbzgfh.js → index-9pw0a51a.js} +4 -4
- package/dist/{index-79z7m7dt.js → index-a9pd417t.js} +35 -35
- package/dist/{index-ham5sz8m.js → index-aaj97r4y.js} +45 -45
- package/dist/{index-s812ycat.js → index-aan6hqb9.js} +3 -3
- package/dist/{index-10x2hbx0.js → index-adhgd4pe.js} +44 -44
- package/dist/{index-2gxzjvyr.js → index-afjvjyck.js} +23 -23
- package/dist/{index-qmy6zq75.js → index-ahvsksw5.js} +16 -16
- package/dist/{index-hr4tzbwq.js → index-ap3gqe56.js} +3 -3
- package/dist/{index-znfs20ss.js → index-b2bz0kdm.js} +16 -16
- package/dist/{index-r066jx76.js → index-c6aagrbd.js} +148 -120
- package/dist/{index-k30h66yd.js → index-ck71tbcf.js} +9 -9
- package/dist/{index-eqqvgdb3.js → index-ct75c3at.js} +2 -2
- package/dist/{index-gw8bmyaj.js → index-djjhhgjk.js} +41 -41
- package/dist/{index-8qt2m66q.js → index-dvwj1f43.js} +43 -43
- package/dist/{index-fhwqwxe0.js → index-ej331hah.js} +1 -1
- package/dist/{index-9t3dffv2.js → index-ewbaywk5.js} +5 -5
- package/dist/{index-7p1f0vp2.js → index-fyphpknh.js} +25 -25
- package/dist/{index-83bdg97s.js → index-g149e9pk.js} +1 -1
- package/dist/{index-ngfhvfpd.js → index-g6a3na27.js} +4 -4
- package/dist/{index-qwhynv6x.js → index-h124epcf.js} +20 -20
- package/dist/{index-h6eeys1v.js → index-h97tqqp1.js} +9 -9
- package/dist/{index-zcgf3gqf.js → index-hby4qhax.js} +10 -10
- package/dist/{index-5jrd0yng.js → index-j8aw2c0e.js} +4 -4
- package/dist/{index-d8m8zpd8.js → index-jzczzcsb.js} +14 -14
- package/dist/index-kqnd6a85.js +26 -0
- package/dist/{index-35mh5bhj.js → index-kw1ws0cs.js} +12 -12
- package/dist/{index-yw4fzmdz.js → index-kzz6rq0w.js} +28 -17
- package/dist/{index-4gcnakhx.js → index-m38ej7e5.js} +2 -2
- package/dist/{index-ndddxtyx.js → index-m79yr938.js} +19 -19
- package/dist/{index-5p2m7we1.js → index-m9fndta6.js} +11 -11
- package/dist/index-mnkk1ffz.js +150 -0
- package/dist/index-n15jny5b.js +4 -0
- package/dist/{index-2vtcmrj9.js → index-n53mswt3.js} +20 -20
- package/dist/{index-bt14acb5.js → index-n5yqxd3d.js} +21 -21
- package/dist/{index-bm5rx7n6.js → index-n9tyz8z3.js} +12 -12
- package/dist/index-nmaqxdx7.js +463 -0
- package/dist/{index-mqv3b5rh.js → index-nx6eazt0.js} +30 -30
- package/dist/{index-3z73fh2c.js → index-q0th8q0z.js} +9 -9
- package/dist/{index-v260df89.js → index-qjeggp8w.js} +20 -20
- package/dist/{index-zfrhfn82.js → index-r1z0rd9c.js} +20 -20
- package/dist/{index-wqgjfstn.js → index-r5c4fedv.js} +3 -3
- package/dist/{index-cyktc4bp.js → index-r5hsgkz5.js} +118 -118
- package/dist/{index-0b1ess5e.js → index-r7a7r7ha.js} +1 -1
- package/dist/{index-1j8pm5t0.js → index-rfkh44ss.js} +15 -15
- package/dist/index-rz3z13e9.js +47 -0
- package/dist/{index-k6gpggb9.js → index-s80awwsw.js} +35 -35
- package/dist/{index-vqr7f7v8.js → index-ssmd41kh.js} +124 -124
- package/dist/{index-ensd0r74.js → index-v14qqmys.js} +41 -41
- package/dist/{index-paz6sgdp.js → index-v4a2fjtk.js} +36 -36
- package/dist/{index-d9pk3td4.js → index-w0eqdhyd.js} +14 -14
- package/dist/{index-5qn1kx34.js → index-w575evhq.js} +29 -29
- package/dist/{index-3gye9wzb.js → index-w5s3xftz.js} +26 -26
- package/dist/{index-tm88avnj.js → index-wykebpn9.js} +3 -3
- package/dist/{index-sh3s86na.js → index-xkhk5d6g.js} +17 -17
- package/dist/{index-6k1937bx.js → index-xqhede6x.js} +4 -4
- package/dist/{index-f4fx2tza.js → index-zs4ms3th.js} +181 -181
- package/dist/{index-k5hsfc3j.js → index-zsvzhjtk.js} +1 -1
- package/dist/observability/bounded-logger.d.ts +2 -0
- package/dist/observability/bounded-logger.d.ts.map +1 -1
- package/dist/observability/sanitize.d.ts +6 -0
- package/dist/observability/sanitize.d.ts.map +1 -1
- package/dist/observability/secret-values.d.ts +25 -0
- package/dist/observability/secret-values.d.ts.map +1 -0
- package/dist/react/keyboard/hooks.d.ts +71 -0
- package/dist/react/keyboard/hooks.d.ts.map +1 -0
- package/dist/react/keyboard/layers.d.ts +98 -0
- package/dist/react/keyboard/layers.d.ts.map +1 -0
- package/dist/react/keyboard/zone.d.ts +139 -0
- package/dist/react/keyboard/zone.d.ts.map +1 -0
- package/dist/telegram/crypto.d.ts +16 -0
- package/dist/telegram/crypto.d.ts.map +1 -0
- package/dist/telegram/html/check.d.ts +26 -0
- package/dist/telegram/html/check.d.ts.map +1 -0
- package/dist/telegram/html/nodes.d.ts +70 -0
- package/dist/telegram/html/nodes.d.ts.map +1 -0
- package/dist/telegram/html/parse.d.ts +35 -0
- package/dist/telegram/html/parse.d.ts.map +1 -0
- package/dist/telegram/html/render.d.ts +39 -0
- package/dist/telegram/html/render.d.ts.map +1 -0
- package/dist/telegram/init-data.d.ts.map +1 -1
- package/dist/telegram/operator-channel.d.ts +36 -3
- package/dist/telegram/operator-channel.d.ts.map +1 -1
- package/dist/telegram/screens/callback-codec.d.ts +34 -0
- package/dist/telegram/screens/callback-codec.d.ts.map +1 -0
- package/dist/telegram/screens/dispatch.d.ts +22 -0
- package/dist/telegram/screens/dispatch.d.ts.map +1 -0
- package/dist/telegram/screens/display.d.ts +70 -0
- package/dist/telegram/screens/display.d.ts.map +1 -0
- package/dist/telegram/screens/execute.d.ts +57 -0
- package/dist/telegram/screens/execute.d.ts.map +1 -0
- package/dist/telegram/screens/html.d.ts +36 -0
- package/dist/telegram/screens/html.d.ts.map +1 -0
- package/dist/telegram/screens/outcome.d.ts +74 -0
- package/dist/telegram/screens/outcome.d.ts.map +1 -0
- package/dist/telegram/screens/path.d.ts +29 -0
- package/dist/telegram/screens/path.d.ts.map +1 -0
- package/dist/telegram/screens/reconcile.d.ts +67 -0
- package/dist/telegram/screens/reconcile.d.ts.map +1 -0
- package/dist/telegram/screens/registry.d.ts +23 -0
- package/dist/telegram/screens/registry.d.ts.map +1 -0
- package/dist/telegram/screens/render.d.ts +70 -0
- package/dist/telegram/screens/render.d.ts.map +1 -0
- package/dist/telegram/screens/runtime.d.ts +133 -0
- package/dist/telegram/screens/runtime.d.ts.map +1 -0
- package/dist/telegram/screens/screen-types.d.ts +130 -0
- package/dist/telegram/screens/screen-types.d.ts.map +1 -0
- package/dist/telegram/screens/screen.d.ts +138 -0
- package/dist/telegram/screens/screen.d.ts.map +1 -0
- package/dist/telegram/screens/state.d.ts +115 -0
- package/dist/telegram/screens/state.d.ts.map +1 -0
- package/dist/telegram/screens/telegram-screens.d.ts +18 -0
- package/dist/telegram/screens/telegram-screens.d.ts.map +1 -0
- package/dist/telegram/screens/test-chat-telegram.d.ts +47 -0
- package/dist/telegram/screens/test-chat-telegram.d.ts.map +1 -0
- package/dist/telegram/screens/test-chat.d.ts +66 -0
- package/dist/telegram/screens/test-chat.d.ts.map +1 -0
- package/dist/telegram/screens/view.d.ts +89 -0
- package/dist/telegram/screens/view.d.ts.map +1 -0
- package/dist/telegram/send-failure.d.ts +19 -0
- package/dist/telegram/send-failure.d.ts.map +1 -1
- package/dist/telegram/update-intake.d.ts +78 -0
- package/dist/telegram/update-intake.d.ts.map +1 -0
- package/dist/telegram/update-store-sqlite.d.ts +26 -0
- package/dist/telegram/update-store-sqlite.d.ts.map +1 -0
- package/dist/telegram/update-store.d.ts +67 -0
- package/dist/telegram/update-store.d.ts.map +1 -0
- package/dist/telegram/webhook.d.ts +105 -0
- package/dist/telegram/webhook.d.ts.map +1 -0
- package/dist/tools/cli/args-fields.d.ts +8 -0
- package/dist/tools/cli/args-fields.d.ts.map +1 -1
- package/dist/tools/cli/args-route.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/help.d.ts.map +1 -1
- package/llms/cli.txt +8 -2
- package/llms/observability.txt +2 -1
- package/llms/react-keyboard.txt +193 -0
- package/llms/stitchkit.txt +7 -1
- package/llms/telegram-html.txt +35 -0
- package/llms/telegram-screens.txt +365 -0
- package/llms/telegram.txt +160 -4
- package/llms-full.txt +736 -8
- package/llms.txt +10 -5
- package/package.json +17 -2
- package/dist/index-2k4yrqkc.js +0 -9
- package/dist/index-crykmqkr.js +0 -26
- package/dist/index-y64k3s0h.js +0 -150
- package/dist/index-y91ry9h2.js +0 -4
- /package/dist/{index-hffjpmq9.js → index-9jfdm5tg.js} +0 -0
- /package/dist/{index-zjjyynm3.js → index-d4pa2bgs.js} +0 -0
- /package/dist/{index-rxfy4cq7.js → index-dwfv9a85.js} +0 -0
- /package/dist/{index-5jm36zv1.js → index-gfk7nrht.js} +0 -0
- /package/dist/{index-b9aefrqd.js → index-n1dqr7gf.js} +0 -0
- /package/dist/{index-q3pyb9n0.js → index-sykb5ag7.js} +0 -0
- /package/dist/{index-48ffdxgk.js → index-xhzq2qvj.js} +0 -0
- /package/dist/{index-kzfs85xp.js → index-zsarb5xp.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -15,6 +15,92 @@ additive**; the first breaking change landed in 0.10.0. Grep the file for
|
|
|
15
15
|
|
|
16
16
|
## [Unreleased]
|
|
17
17
|
|
|
18
|
+
## [0.100.3] — 2026-09-29
|
|
19
|
+
|
|
20
|
+
### Added
|
|
21
|
+
|
|
22
|
+
- `stitchkit/react/keyboard` (new, evolving) — which part of a React screen
|
|
23
|
+
gets a key. `useKeyLayer` puts a layer on one window-wide stack asked
|
|
24
|
+
`overlay` → `local` → `route` → `zone` → `global`, innermost first within a
|
|
25
|
+
kind (by element containment, so a panel outranks the page it mounted with);
|
|
26
|
+
a live overlay is a barrier, keys typed in fields pass layers by except
|
|
27
|
+
Escape, and the listener sits in the bubbling phase so widgets and fields keep
|
|
28
|
+
what they handle. `useEscapeLayer` closes one level per press, and a held
|
|
29
|
+
Escape closes one. `useNavZone` makes a list the arrows move through with real
|
|
30
|
+
focus — roving `tabIndex`, `listbox`/`tablist` roles or `aria-current`,
|
|
31
|
+
`select` and `highlight` modes, `onEnter`/`onExit` on the cross axis,
|
|
32
|
+
`onBoundary` or `loop` at the ends, and `onReveal` for a virtualized list
|
|
33
|
+
whose next row is not rendered yet — focus lands on it when it mounts. Hooks
|
|
34
|
+
only; `react` is the only peer.
|
|
35
|
+
→ ADR 0212, [keyboard guide](docs/guide/keyboard.md)
|
|
36
|
+
- `stitchkit/telegram/html` (new, evolving; browser and server, no peer) —
|
|
37
|
+
Telegram's HTML parse mode as a tree. `parseTelegramHtml` turns any markup
|
|
38
|
+
into nodes Telegram accepts — synonyms renamed, block tags into line breaks, a
|
|
39
|
+
link only with an `href` Telegram opens, an entity where Telegram forbids it
|
|
40
|
+
(formatting inside `code`, a quote in a quote) kept as its words — and
|
|
41
|
+
`renderTelegramHtml` / `sanitizeTelegramHtml` write it back.
|
|
42
|
+
`splitTelegramHtml` cuts by what the reader sees, not the markup's length, at
|
|
43
|
+
a paragraph, a line, a space, never inside a character or a custom emoji, and
|
|
44
|
+
reopens every element across a cut with its attributes; `truncateTelegramHtml`,
|
|
45
|
+
`telegramHtmlText`, `checkTelegramHtml` (what Telegram would refuse, without
|
|
46
|
+
repairing), `escapeTelegramHtml`, `TELEGRAM_TEXT_LIMIT` /
|
|
47
|
+
`TELEGRAM_CAPTION_LIMIT`. → ADR 0213, [guide](docs/guide/telegram.md#message-markup)
|
|
48
|
+
- `stitchkit/telegram` — a bot on a webhook. `claimTelegramWebhook` sets the
|
|
49
|
+
webhook only where it already points to this address with this secret, or
|
|
50
|
+
where `takeoverFrom` names the current owner's host (`'none'` for no webhook);
|
|
51
|
+
the address carries an `owner` tag of the secret, so a copy of the production
|
|
52
|
+
address with another secret is refused (`TelegramWebhookClaimError`:
|
|
53
|
+
`owned-elsewhere`, `other-secret`, `not-confirmed`, hosts only).
|
|
54
|
+
`checkTelegramWebhook` notices a webhook that moved; `receiveTelegramWebhook`
|
|
55
|
+
answers a request — 403 without the secret, 200 once the update is recorded.
|
|
56
|
+
`createTelegramUpdateIntake` records an update before Telegram is answered and
|
|
57
|
+
handles it after: chat order kept, other chats alongside, a renewed lease per
|
|
58
|
+
attempt, a sweep that takes over what a restart or a dead process left,
|
|
59
|
+
retries, `maxAttempts`, repeats refused for `retainMs`; at least once. The
|
|
60
|
+
store is an interface of atomic steps, with `memoryTelegramUpdateStore` and
|
|
61
|
+
`sqliteTelegramUpdateStore` over a `bun:sqlite` or `node:sqlite` handle.
|
|
62
|
+
→ ADR 0213, [guide](docs/guide/telegram.md#a-bot-on-a-webhook)
|
|
63
|
+
- `stitchkit/telegram` — `dedupe` on `createTelegramOperatorChannel`: one
|
|
64
|
+
message per fingerprint per window, the next one sent carries how many were
|
|
65
|
+
held back, and a budget per window turns a storm into one count; held-back
|
|
66
|
+
messages reach `onDropped` as `repeated` / `over-budget`. `sensitiveValues`
|
|
67
|
+
masks exact secrets.
|
|
68
|
+
- `stitchkit/observability` — `sensitiveValues` on `createJsonLogger`,
|
|
69
|
+
`createBoundedLogger` and `SanitizeOptions` masks exact secret values in every
|
|
70
|
+
string; `secretValuesFromEnv(env)` collects them from variables named as a
|
|
71
|
+
token, secret, key, password or credential and from inside URL variables,
|
|
72
|
+
URL-encoded too.
|
|
73
|
+
- `stitchkit/telegram/screens` (new, evolving) — a bot's menus as declared
|
|
74
|
+
screens over grammY. `telegramScreens<Ctx>()` declares screens and groups by
|
|
75
|
+
path (`tg.screen('/project/:id').load(…).action(…).on(…).view(…)`), with params
|
|
76
|
+
typed from the path literal, typed action buttons (`act.name(label, input)`)
|
|
77
|
+
and a group `load` that checks access for every screen under it. A view is
|
|
78
|
+
reconciled against what the chat shows by message key — only the part that
|
|
79
|
+
changed is edited, order holds, "not modified" and a deleted message are
|
|
80
|
+
absorbed — and the chat's record lives in any grammY `StorageAdapter`, so
|
|
81
|
+
navigation and waiting for input survive a restart. Outcomes `stay`, `go`,
|
|
82
|
+
`back`, `toast` and `notice` (a receipt, or a remark with `expiresInMs`);
|
|
83
|
+
input deleted before any load or handler unless `keepMessage`; a params
|
|
84
|
+
schema must accept its own output (a compile error otherwise); a refusal
|
|
85
|
+
halfway leaves the record on the screen the chat was on; `screens.open`,
|
|
86
|
+
`screens.button(link(…))` for notifications, `onStale`, `onError`, `onEvent`;
|
|
87
|
+
a forged `callback_data` never reaches a handler. `createScreenTestChat(bot)`
|
|
88
|
+
drives the application's own `Bot` against an in-memory Bot API. grammY is
|
|
89
|
+
named in the declarations only. → ADR 0211, [guide](docs/guide/telegram-screens.md)
|
|
90
|
+
|
|
91
|
+
### Fixed
|
|
92
|
+
|
|
93
|
+
- `stitchkit/cli` — `--flag true` and `--flag false` after a boolean flag are
|
|
94
|
+
its value. The word used to be read as a positional argument: it filled the
|
|
95
|
+
first non-boolean field, so the refusal named a field nobody had touched, and
|
|
96
|
+
`--flag false` turned the flag on. The same for a short alias, a framework
|
|
97
|
+
flag (`--json false`) and an application option; any other word stays a
|
|
98
|
+
positional, and command help says so.
|
|
99
|
+
- `stitchkit/telegram` — `telegramOperatorSender({ parseMode: 'HTML' })` sends
|
|
100
|
+
markup Telegram accepts. The channel cuts a long text by characters, and the
|
|
101
|
+
cut could end inside a tag, so Telegram refused the message and it was dropped
|
|
102
|
+
as `refused`; the sender now cleans the markup and cuts it by what it shows.
|
|
103
|
+
|
|
18
104
|
## [0.100.2] — 2026-09-28
|
|
19
105
|
|
|
20
106
|
### Added
|
package/README.md
CHANGED
|
@@ -445,9 +445,10 @@ peer — an install pulls in only what the project actually uses.
|
|
|
445
445
|
| `stitchkit-tui` | separate optional package | Renderer-neutral `./core` state plus a Bun/OpenTUI terminal controller, commands, model/session pickers and authenticated local attachment over a caller-composed harness. |
|
|
446
446
|
| `@openrouter/ai-sdk-provider` | peer, optional | Only `stitchkit/agent-runtime/openrouter`; neutral runtime imports do not resolve it. |
|
|
447
447
|
| SQLite | runtime built-in, optional | `bun:sqlite` through `stitchkit/agent-runtime/sqlite/bun`, or `node:sqlite` on Node ≥ 22.5 through the Node leaf. |
|
|
448
|
-
| `grammy` | peer, optional | Only `stitchkit/application/grammy`; the neutral application kernel does not resolve it. |
|
|
448
|
+
| `grammy` | peer, optional | Only `stitchkit/application/grammy` at run time, and the declarations of `stitchkit/telegram/screens`; the neutral application kernel does not resolve it. |
|
|
449
449
|
| `@opentelemetry/api` | peer, optional | Type-only boundary for `stitchkit/application/opentelemetry`; the adapter has no runtime import and owns no SDK/exporter. |
|
|
450
450
|
| `@tanstack/react-query` + `react-query-kit` | peer, optional | Only `stitchkit/react` — `createCursorQuery`, `createCacheBridge`. |
|
|
451
|
+
| `react` | peer, optional | Only the React subpaths: `stitchkit/react` with the two above, and `stitchkit/react/keyboard` — keyboard layers and list zones, hooks only. |
|
|
451
452
|
| `socket.io` / `@socket.io/bun-engine` / `socket.io-client` | peer, optional | Only the Socket.IO wrappers. `@socket.io/bun-engine` is Bun-only; shipping one self-contained artifact? Hand the loaders to `createSocketIOServer({ peers })`. |
|
|
452
453
|
| `@socket.io/component-emitter` | peer, optional, **types only** | Referenced by the browser Socket.IO declarations. Arrives with `socket.io-client`; nothing imports it at runtime. |
|
|
453
454
|
| `srvx` | peer, optional | Only `serveNode` — the Node ≥ 22 HTTP adapter. Bun uses `Bun.serve` and needs nothing. |
|
|
@@ -1,124 +1,124 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
AgentRecordIdSchema2,
|
|
3
|
+
AgentRecordVersionSchema2,
|
|
4
|
+
AgentTimestampSchema2,
|
|
5
|
+
AgentJsonObjectSchema2,
|
|
6
|
+
AgentProviderEnvelopeSchema2,
|
|
7
|
+
AgentProviderResponseSchema2,
|
|
8
|
+
AgentTextPartSchema2,
|
|
9
|
+
AgentReasoningPartSchema2,
|
|
10
|
+
AgentFilePartSchema2,
|
|
11
|
+
AgentSourcePartSchema2,
|
|
12
|
+
AgentToolCallPartSchema2,
|
|
13
|
+
AgentToolResultPartSchema2,
|
|
14
|
+
AgentToolApprovalRequestPartSchema2,
|
|
15
|
+
AgentToolApprovalResponsePartSchema2,
|
|
16
|
+
AgentOpaquePartSchema2,
|
|
17
|
+
AgentControlPartSchema2,
|
|
18
|
+
AgentMessagePartSchema2,
|
|
19
|
+
AgentMessageRoleSchema2,
|
|
20
|
+
AgentMessageStatusSchema2,
|
|
21
|
+
AgentMessageSchema2,
|
|
22
|
+
AgentAssistantPlaceholderSchema2,
|
|
23
|
+
AgentRunStateSchema2,
|
|
24
|
+
AgentRunQueuePrioritySchema2,
|
|
25
|
+
AgentRunOperationKindSchema2,
|
|
26
|
+
AgentRunOperationPhaseSchema2,
|
|
27
|
+
AgentRunOperationSchema2,
|
|
28
|
+
AgentTerminalReasonSchema2,
|
|
29
|
+
runStateForTerminalReason2,
|
|
30
|
+
AgentProvenanceSchema2,
|
|
31
|
+
AgentUsageValueSchema2,
|
|
32
|
+
AgentCostValueSchema2,
|
|
33
|
+
AgentUsageSchema2,
|
|
34
|
+
AgentRunSchema2,
|
|
35
|
+
AgentSnapshotSchema2,
|
|
36
|
+
AgentRunMetricsSchema2
|
|
37
|
+
} from "../../index-8kzct1d6.js";
|
|
11
38
|
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
} from "../../index-
|
|
39
|
+
AgentAdmissionEventSchema2,
|
|
40
|
+
AgentTransientDeltaEventSchema2,
|
|
41
|
+
AgentReasoningStartEventSchema2,
|
|
42
|
+
AgentReasoningDeltaEventSchema2,
|
|
43
|
+
AgentReasoningEndEventSchema2,
|
|
44
|
+
AgentAttemptResetEventSchema2,
|
|
45
|
+
AgentCheckpointEventSchema2,
|
|
46
|
+
AgentRunStateEventSchema2,
|
|
47
|
+
AgentRunOperationEventSchema2,
|
|
48
|
+
AgentToolStatusEventSchema2,
|
|
49
|
+
AgentTerminalEventSchema2,
|
|
50
|
+
AgentRuntimeEventSchema2,
|
|
51
|
+
AgentRuntimeEventCursorSchema2,
|
|
52
|
+
advanceAgentRuntimeEventCursor2,
|
|
53
|
+
agentDurableEventId2
|
|
54
|
+
} from "../../index-mnkk1ffz.js";
|
|
28
55
|
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
AgentOpaquePartSchema,
|
|
39
|
-
AgentProvenanceSchema,
|
|
40
|
-
AgentProviderEnvelopeSchema,
|
|
41
|
-
AgentProviderResponseSchema,
|
|
42
|
-
AgentReasoningPartSchema,
|
|
43
|
-
AgentRecordIdSchema,
|
|
44
|
-
AgentRecordVersionSchema,
|
|
45
|
-
AgentRunMetricsSchema,
|
|
46
|
-
AgentRunOperationKindSchema,
|
|
47
|
-
AgentRunOperationPhaseSchema,
|
|
48
|
-
AgentRunOperationSchema,
|
|
49
|
-
AgentRunQueuePrioritySchema,
|
|
50
|
-
AgentRunSchema,
|
|
51
|
-
AgentRunStateSchema,
|
|
52
|
-
AgentSnapshotSchema,
|
|
53
|
-
AgentSourcePartSchema,
|
|
54
|
-
AgentTerminalReasonSchema,
|
|
55
|
-
AgentTextPartSchema,
|
|
56
|
-
AgentTimestampSchema,
|
|
57
|
-
AgentToolApprovalRequestPartSchema,
|
|
58
|
-
AgentToolApprovalResponsePartSchema,
|
|
59
|
-
AgentToolCallPartSchema,
|
|
60
|
-
AgentToolResultPartSchema,
|
|
61
|
-
AgentUsageSchema,
|
|
62
|
-
AgentUsageValueSchema,
|
|
63
|
-
runStateForTerminalReason
|
|
64
|
-
} from "../../index-gtj3zc53.js";
|
|
56
|
+
AgentControlRequestSchema2,
|
|
57
|
+
AgentControlResponseSchema2,
|
|
58
|
+
AgentControlDeliverySchema2,
|
|
59
|
+
AgentMultiSessionCursorSchema2,
|
|
60
|
+
advanceAgentMultiSessionCursor2,
|
|
61
|
+
createAgentControlView2,
|
|
62
|
+
reduceAgentControlSnapshot2,
|
|
63
|
+
reduceAgentControlEvent2
|
|
64
|
+
} from "../../index-n5yqxd3d.js";
|
|
65
65
|
export {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
66
|
+
AgentAdmissionEventSchema2 as AgentAdmissionEventSchema,
|
|
67
|
+
AgentAssistantPlaceholderSchema2 as AgentAssistantPlaceholderSchema,
|
|
68
|
+
AgentAttemptResetEventSchema2 as AgentAttemptResetEventSchema,
|
|
69
|
+
AgentCheckpointEventSchema2 as AgentCheckpointEventSchema,
|
|
70
|
+
AgentControlDeliverySchema2 as AgentControlDeliverySchema,
|
|
71
|
+
AgentControlPartSchema2 as AgentControlPartSchema,
|
|
72
|
+
AgentControlRequestSchema2 as AgentControlRequestSchema,
|
|
73
|
+
AgentControlResponseSchema2 as AgentControlResponseSchema,
|
|
74
|
+
AgentCostValueSchema2 as AgentCostValueSchema,
|
|
75
|
+
AgentFilePartSchema2 as AgentFilePartSchema,
|
|
76
|
+
AgentJsonObjectSchema2 as AgentJsonObjectSchema,
|
|
77
|
+
AgentMessagePartSchema2 as AgentMessagePartSchema,
|
|
78
|
+
AgentMessageRoleSchema2 as AgentMessageRoleSchema,
|
|
79
|
+
AgentMessageSchema2 as AgentMessageSchema,
|
|
80
|
+
AgentMessageStatusSchema2 as AgentMessageStatusSchema,
|
|
81
|
+
AgentMultiSessionCursorSchema2 as AgentMultiSessionCursorSchema,
|
|
82
|
+
AgentOpaquePartSchema2 as AgentOpaquePartSchema,
|
|
83
|
+
AgentProvenanceSchema2 as AgentProvenanceSchema,
|
|
84
|
+
AgentProviderEnvelopeSchema2 as AgentProviderEnvelopeSchema,
|
|
85
|
+
AgentProviderResponseSchema2 as AgentProviderResponseSchema,
|
|
86
|
+
AgentReasoningDeltaEventSchema2 as AgentReasoningDeltaEventSchema,
|
|
87
|
+
AgentReasoningEndEventSchema2 as AgentReasoningEndEventSchema,
|
|
88
|
+
AgentReasoningPartSchema2 as AgentReasoningPartSchema,
|
|
89
|
+
AgentReasoningStartEventSchema2 as AgentReasoningStartEventSchema,
|
|
90
|
+
AgentRecordIdSchema2 as AgentRecordIdSchema,
|
|
91
|
+
AgentRecordVersionSchema2 as AgentRecordVersionSchema,
|
|
92
|
+
AgentRunMetricsSchema2 as AgentRunMetricsSchema,
|
|
93
|
+
AgentRunOperationEventSchema2 as AgentRunOperationEventSchema,
|
|
94
|
+
AgentRunOperationKindSchema2 as AgentRunOperationKindSchema,
|
|
95
|
+
AgentRunOperationPhaseSchema2 as AgentRunOperationPhaseSchema,
|
|
96
|
+
AgentRunOperationSchema2 as AgentRunOperationSchema,
|
|
97
|
+
AgentRunQueuePrioritySchema2 as AgentRunQueuePrioritySchema,
|
|
98
|
+
AgentRunSchema2 as AgentRunSchema,
|
|
99
|
+
AgentRunStateEventSchema2 as AgentRunStateEventSchema,
|
|
100
|
+
AgentRunStateSchema2 as AgentRunStateSchema,
|
|
101
|
+
AgentRuntimeEventCursorSchema2 as AgentRuntimeEventCursorSchema,
|
|
102
|
+
AgentRuntimeEventSchema2 as AgentRuntimeEventSchema,
|
|
103
|
+
AgentSnapshotSchema2 as AgentSnapshotSchema,
|
|
104
|
+
AgentSourcePartSchema2 as AgentSourcePartSchema,
|
|
105
|
+
AgentTerminalEventSchema2 as AgentTerminalEventSchema,
|
|
106
|
+
AgentTerminalReasonSchema2 as AgentTerminalReasonSchema,
|
|
107
|
+
AgentTextPartSchema2 as AgentTextPartSchema,
|
|
108
|
+
AgentTimestampSchema2 as AgentTimestampSchema,
|
|
109
|
+
AgentToolApprovalRequestPartSchema2 as AgentToolApprovalRequestPartSchema,
|
|
110
|
+
AgentToolApprovalResponsePartSchema2 as AgentToolApprovalResponsePartSchema,
|
|
111
|
+
AgentToolCallPartSchema2 as AgentToolCallPartSchema,
|
|
112
|
+
AgentToolResultPartSchema2 as AgentToolResultPartSchema,
|
|
113
|
+
AgentToolStatusEventSchema2 as AgentToolStatusEventSchema,
|
|
114
|
+
AgentTransientDeltaEventSchema2 as AgentTransientDeltaEventSchema,
|
|
115
|
+
AgentUsageSchema2 as AgentUsageSchema,
|
|
116
|
+
AgentUsageValueSchema2 as AgentUsageValueSchema,
|
|
117
|
+
advanceAgentMultiSessionCursor2 as advanceAgentMultiSessionCursor,
|
|
118
|
+
advanceAgentRuntimeEventCursor2 as advanceAgentRuntimeEventCursor,
|
|
119
|
+
agentDurableEventId2 as agentDurableEventId,
|
|
120
|
+
createAgentControlView2 as createAgentControlView,
|
|
121
|
+
reduceAgentControlEvent2 as reduceAgentControlEvent,
|
|
122
|
+
reduceAgentControlSnapshot2 as reduceAgentControlSnapshot,
|
|
123
|
+
runStateForTerminalReason2 as runStateForTerminalReason
|
|
124
124
|
};
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
+
import"../../index-ct75c3at.js";
|
|
2
|
+
import"../../index-7z9ym7t8.js";
|
|
3
|
+
import"../../index-n53mswt3.js";
|
|
4
|
+
import"../../index-b2bz0kdm.js";
|
|
1
5
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
} from "../../index-
|
|
7
|
-
import"../../index-
|
|
8
|
-
import"../../index-
|
|
9
|
-
import"../../index-qmy6zq75.js";
|
|
10
|
-
import"../../index-d8m8zpd8.js";
|
|
11
|
-
import"../../index-0r0fbk7z.js";
|
|
12
|
-
import"../../index-eqqvgdb3.js";
|
|
13
|
-
import"../../index-znfs20ss.js";
|
|
14
|
-
import"../../index-p5r7qpdd.js";
|
|
15
|
-
import"../../index-2vtcmrj9.js";
|
|
16
|
-
import"../../index-k5hsfc3j.js";
|
|
17
|
-
import"../../index-hffjpmq9.js";
|
|
6
|
+
AgentCodingToolLimitsSchema2,
|
|
7
|
+
AgentCodingToolAuthorizationSchema2,
|
|
8
|
+
AgentCodingToolPathAuthorizationSchema2,
|
|
9
|
+
createAgentCodingTools2
|
|
10
|
+
} from "../../index-djjhhgjk.js";
|
|
11
|
+
import"../../index-ahvsksw5.js";
|
|
12
|
+
import"../../index-jzczzcsb.js";
|
|
18
13
|
export {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
14
|
+
AgentCodingToolAuthorizationSchema2 as AgentCodingToolAuthorizationSchema,
|
|
15
|
+
AgentCodingToolLimitsSchema2 as AgentCodingToolLimitsSchema,
|
|
16
|
+
AgentCodingToolPathAuthorizationSchema2 as AgentCodingToolPathAuthorizationSchema,
|
|
17
|
+
createAgentCodingTools2 as createAgentCodingTools
|
|
23
18
|
};
|
|
@@ -1,42 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
AgentModelDescriptorSchema2
|
|
3
|
+
} from "../../index-nx6eazt0.js";
|
|
4
|
+
import"../../index-8kzct1d6.js";
|
|
5
5
|
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
} from "../../index-
|
|
10
|
-
import"../../index-
|
|
11
|
-
import"../../index-
|
|
6
|
+
createAgentRuntimeEventSink2,
|
|
7
|
+
composeAgentPrompt2,
|
|
8
|
+
createAgentRuntime2
|
|
9
|
+
} from "../../index-zs4ms3th.js";
|
|
10
|
+
import"../../index-h97tqqp1.js";
|
|
11
|
+
import"../../index-mnkk1ffz.js";
|
|
12
|
+
import"../../index-n53mswt3.js";
|
|
13
|
+
import"../../index-b2bz0kdm.js";
|
|
14
|
+
import"../../index-hby4qhax.js";
|
|
15
|
+
import"../../index-9pw0a51a.js";
|
|
16
|
+
import"../../index-ct75c3at.js";
|
|
17
|
+
import"../../index-7z9ym7t8.js";
|
|
18
|
+
import"../../index-dvwj1f43.js";
|
|
19
|
+
import"../../index-a9pd417t.js";
|
|
20
|
+
import"../../index-r5hsgkz5.js";
|
|
12
21
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
22
|
+
AgentControlRequestSchema2,
|
|
23
|
+
AgentControlResponseSchema2
|
|
24
|
+
} from "../../index-n5yqxd3d.js";
|
|
16
25
|
import {
|
|
17
26
|
walkContainedFiles
|
|
18
|
-
} from "../../index-
|
|
19
|
-
import"../../index-
|
|
20
|
-
import"../../index-cyktc4bp.js";
|
|
21
|
-
import"../../index-gtj3zc53.js";
|
|
22
|
-
import"../../index-q3pyb9n0.js";
|
|
23
|
-
import"../../index-79z7m7dt.js";
|
|
24
|
-
import"../../index-8qt2m66q.js";
|
|
25
|
-
import"../../index-zfrhfn82.js";
|
|
26
|
-
import"../../index-35mh5bhj.js";
|
|
27
|
-
import"../../index-zcgf3gqf.js";
|
|
28
|
-
import"../../index-1zbbzgfh.js";
|
|
27
|
+
} from "../../index-ej331hah.js";
|
|
28
|
+
import"../../index-r1z0rd9c.js";
|
|
29
29
|
import {
|
|
30
|
-
|
|
31
|
-
} from "../../index-
|
|
32
|
-
import"../../index-0r0fbk7z.js";
|
|
33
|
-
import"../../index-eqqvgdb3.js";
|
|
34
|
-
import"../../index-znfs20ss.js";
|
|
35
|
-
import"../../index-p5r7qpdd.js";
|
|
36
|
-
import"../../index-2vtcmrj9.js";
|
|
37
|
-
import"../../index-k5hsfc3j.js";
|
|
38
|
-
import"../../index-kzfs85xp.js";
|
|
39
|
-
import"../../index-hffjpmq9.js";
|
|
30
|
+
defineRuntimeTool2
|
|
31
|
+
} from "../../index-jzczzcsb.js";
|
|
40
32
|
|
|
41
33
|
// src/agent-runtime/harness-contract.ts
|
|
42
34
|
import { z } from "zod";
|
|
@@ -65,7 +57,7 @@ var AgentHarnessProfileEventSchema = z.object({
|
|
|
65
57
|
type: z.literal("profile-applied"),
|
|
66
58
|
conversationId: z.string().min(1),
|
|
67
59
|
runId: z.string().min(1),
|
|
68
|
-
model:
|
|
60
|
+
model: AgentModelDescriptorSchema2,
|
|
69
61
|
resources: z.array(AgentHarnessAppliedResourceSchema),
|
|
70
62
|
diagnostics: z.array(AgentHarnessResourceDiagnosticSchema),
|
|
71
63
|
toolNames: z.array(z.string().min(1))
|
|
@@ -251,7 +243,7 @@ function createAgentHarnessFileResources(config) {
|
|
|
251
243
|
loaded ??= discover();
|
|
252
244
|
return loaded;
|
|
253
245
|
};
|
|
254
|
-
const readResource =
|
|
246
|
+
const readResource = defineRuntimeTool2({
|
|
255
247
|
name: "read_resource",
|
|
256
248
|
description: "Read one exact discovered harness skill or resource by canonical name.",
|
|
257
249
|
identity: { serviceName: "harness", action: "read-resource", method: "POST" },
|
|
@@ -279,7 +271,7 @@ async function runControlledOperation(harness, request) {
|
|
|
279
271
|
conversationId: request.conversationId,
|
|
280
272
|
runId: request.runId
|
|
281
273
|
});
|
|
282
|
-
return
|
|
274
|
+
return AgentControlResponseSchema2.parse({
|
|
283
275
|
schemaVersion: 1,
|
|
284
276
|
requestId: request.requestId,
|
|
285
277
|
outcome: "ok",
|
|
@@ -287,7 +279,7 @@ async function runControlledOperation(harness, request) {
|
|
|
287
279
|
});
|
|
288
280
|
}
|
|
289
281
|
if (request.operation === "respond-approval") {
|
|
290
|
-
const
|
|
282
|
+
const ticket = await harness.respondToApproval({
|
|
291
283
|
conversationId: request.conversationId,
|
|
292
284
|
approvalId: request.approvalId,
|
|
293
285
|
approved: request.approved,
|
|
@@ -295,12 +287,12 @@ async function runControlledOperation(harness, request) {
|
|
|
295
287
|
context: request.context,
|
|
296
288
|
...request.metadata !== undefined && { metadata: request.metadata }
|
|
297
289
|
});
|
|
298
|
-
const
|
|
299
|
-
return
|
|
290
|
+
const admission = await ticket.admission;
|
|
291
|
+
return AgentControlResponseSchema2.parse({
|
|
300
292
|
schemaVersion: 1,
|
|
301
293
|
requestId: request.requestId,
|
|
302
294
|
outcome: "ok",
|
|
303
|
-
runId:
|
|
295
|
+
runId: admission.runId,
|
|
304
296
|
snapshot: await harness.snapshot(request.conversationId)
|
|
305
297
|
});
|
|
306
298
|
}
|
|
@@ -312,7 +304,7 @@ async function runControlledOperation(harness, request) {
|
|
|
312
304
|
...request.metadata !== undefined && { metadata: request.metadata }
|
|
313
305
|
});
|
|
314
306
|
const admission = await ticket.admission;
|
|
315
|
-
return
|
|
307
|
+
return AgentControlResponseSchema2.parse({
|
|
316
308
|
schemaVersion: 1,
|
|
317
309
|
requestId: request.requestId,
|
|
318
310
|
outcome: "ok",
|
|
@@ -358,7 +350,7 @@ function createAgentHarnessControlServer(harness, config = {}) {
|
|
|
358
350
|
attached: new Map,
|
|
359
351
|
pendingAttachments: new Set,
|
|
360
352
|
overflowed: false,
|
|
361
|
-
sink:
|
|
353
|
+
sink: createAgentRuntimeEventSink2({
|
|
362
354
|
write: (event) => deliver({ schemaVersion: 1, type: "event", event }),
|
|
363
355
|
maxPending: config.maxPendingEvents ?? 128,
|
|
364
356
|
onDrop: ({ event }) => {
|
|
@@ -378,8 +370,8 @@ function createAgentHarnessControlServer(harness, config = {}) {
|
|
|
378
370
|
connections.set(id, state);
|
|
379
371
|
return {
|
|
380
372
|
async request(raw) {
|
|
381
|
-
const request =
|
|
382
|
-
const fail = (code, message) =>
|
|
373
|
+
const request = AgentControlRequestSchema2.parse(raw);
|
|
374
|
+
const fail = (code, message) => AgentControlResponseSchema2.parse({
|
|
383
375
|
schemaVersion: 1,
|
|
384
376
|
requestId: request.requestId,
|
|
385
377
|
outcome: "error",
|
|
@@ -434,7 +426,7 @@ function createAgentHarnessControlServer(harness, config = {}) {
|
|
|
434
426
|
if (request.access === "observe" && controllers.get(request.conversationId) === id) {
|
|
435
427
|
controllers.delete(request.conversationId);
|
|
436
428
|
}
|
|
437
|
-
return
|
|
429
|
+
return AgentControlResponseSchema2.parse({
|
|
438
430
|
schemaVersion: 1,
|
|
439
431
|
requestId: request.requestId,
|
|
440
432
|
outcome: "ok",
|
|
@@ -448,7 +440,7 @@ function createAgentHarnessControlServer(harness, config = {}) {
|
|
|
448
440
|
if (controllers.get(request.conversationId) === id)
|
|
449
441
|
controllers.delete(request.conversationId);
|
|
450
442
|
state.attached.delete(request.conversationId);
|
|
451
|
-
return
|
|
443
|
+
return AgentControlResponseSchema2.parse({
|
|
452
444
|
schemaVersion: 1,
|
|
453
445
|
requestId: request.requestId,
|
|
454
446
|
outcome: "ok"
|
|
@@ -458,7 +450,7 @@ function createAgentHarnessControlServer(harness, config = {}) {
|
|
|
458
450
|
return fail("NOT_ATTACHED", "Attach before requesting conversation state");
|
|
459
451
|
if (request.operation === "snapshot") {
|
|
460
452
|
const snapshot = await harness.snapshot(request.conversationId);
|
|
461
|
-
return
|
|
453
|
+
return AgentControlResponseSchema2.parse({
|
|
462
454
|
schemaVersion: 1,
|
|
463
455
|
requestId: request.requestId,
|
|
464
456
|
outcome: "ok",
|
|
@@ -499,7 +491,7 @@ class AgentHarnessApprovalRejectedError extends Error {
|
|
|
499
491
|
}
|
|
500
492
|
}
|
|
501
493
|
function activeRunId(snapshot) {
|
|
502
|
-
const active = snapshot.runs.filter((
|
|
494
|
+
const active = snapshot.runs.filter((run) => run.state === "running" || run.state === "interrupt_requested");
|
|
503
495
|
if (active.length !== 1) {
|
|
504
496
|
throw new Error("Agent harness prompt requires exactly one active run");
|
|
505
497
|
}
|
|
@@ -632,7 +624,7 @@ function createHeadlessAgentHarness(config) {
|
|
|
632
624
|
pending.delete(event.runId);
|
|
633
625
|
}
|
|
634
626
|
};
|
|
635
|
-
const runtime =
|
|
627
|
+
const runtime = createAgentRuntime2({
|
|
636
628
|
...runtimeConfig,
|
|
637
629
|
models,
|
|
638
630
|
publish,
|
|
@@ -651,7 +643,7 @@ function createHeadlessAgentHarness(config) {
|
|
|
651
643
|
};
|
|
652
644
|
pending.set(runId, entry);
|
|
653
645
|
await emitProfile(runId);
|
|
654
|
-
const prompt =
|
|
646
|
+
const prompt = composeAgentPrompt2([
|
|
655
647
|
{
|
|
656
648
|
name: "harness-resources",
|
|
657
649
|
stability: "dynamic",
|
|
@@ -691,11 +683,11 @@ function createHeadlessAgentHarness(config) {
|
|
|
691
683
|
},
|
|
692
684
|
pendingApprovals,
|
|
693
685
|
async respondToApproval(input) {
|
|
694
|
-
const
|
|
695
|
-
if (
|
|
686
|
+
const pending = (await pendingApprovals(input.conversationId)).filter((approval) => approval.approvalId === input.approvalId);
|
|
687
|
+
if (pending.length !== 1) {
|
|
696
688
|
throw new Error("Approval request is missing, stale or already answered");
|
|
697
689
|
}
|
|
698
|
-
const request =
|
|
690
|
+
const request = pending[0];
|
|
699
691
|
if (!request) {
|
|
700
692
|
throw new Error("Approval request is missing, stale or already answered");
|
|
701
693
|
}
|
|
@@ -727,15 +719,15 @@ function createHeadlessAgentHarness(config) {
|
|
|
727
719
|
};
|
|
728
720
|
}
|
|
729
721
|
export {
|
|
730
|
-
|
|
731
|
-
createAgentHarnessFileResources,
|
|
732
|
-
createAgentHarnessControlServer,
|
|
733
|
-
AgentHarnessResourceSchema,
|
|
734
|
-
AgentHarnessResourceKindSchema,
|
|
735
|
-
AgentHarnessResourceDiagnosticSchema,
|
|
736
|
-
AgentHarnessProfileEventSchema,
|
|
737
|
-
AgentHarnessLimitsSchema,
|
|
738
|
-
AgentHarnessFileRootSchema,
|
|
722
|
+
AgentHarnessApprovalRejectedError,
|
|
739
723
|
AgentHarnessFileLimitsSchema,
|
|
740
|
-
|
|
724
|
+
AgentHarnessFileRootSchema,
|
|
725
|
+
AgentHarnessLimitsSchema,
|
|
726
|
+
AgentHarnessProfileEventSchema,
|
|
727
|
+
AgentHarnessResourceDiagnosticSchema,
|
|
728
|
+
AgentHarnessResourceKindSchema,
|
|
729
|
+
AgentHarnessResourceSchema,
|
|
730
|
+
createAgentHarnessControlServer,
|
|
731
|
+
createAgentHarnessFileResources,
|
|
732
|
+
createHeadlessAgentHarness
|
|
741
733
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
} from "../../index-
|
|
2
|
+
AgentModelCatalogSchema2
|
|
3
|
+
} from "../../index-nx6eazt0.js";
|
|
4
4
|
import {
|
|
5
5
|
isRecord
|
|
6
|
-
} from "../../index-
|
|
6
|
+
} from "../../index-9jfdm5tg.js";
|
|
7
7
|
|
|
8
8
|
// src/agent-runtime/openrouter.ts
|
|
9
9
|
import {
|
|
@@ -166,7 +166,7 @@ function openRouterModelCatalog(options) {
|
|
|
166
166
|
} else
|
|
167
167
|
diagnostics.push("Design Arena benchmark data is unavailable");
|
|
168
168
|
const seen = new Set;
|
|
169
|
-
return
|
|
169
|
+
return AgentModelCatalogSchema2.parse({
|
|
170
170
|
schemaVersion: 1,
|
|
171
171
|
source: "openrouter",
|
|
172
172
|
observedAt,
|
|
@@ -264,7 +264,7 @@ function normalizeOpenRouterUsage(usage, providerMetadata) {
|
|
|
264
264
|
};
|
|
265
265
|
}
|
|
266
266
|
export {
|
|
267
|
-
|
|
267
|
+
normalizeOpenRouterUsage,
|
|
268
268
|
openRouterModelCatalog,
|
|
269
|
-
|
|
269
|
+
openRouterProvider
|
|
270
270
|
};
|