stitchkit 0.127.0 → 0.129.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.
- package/CHANGELOG.md +194 -6
- package/dist/agent-executor/acp/v1-connect.d.ts +9 -1
- package/dist/agent-executor/acp/v1-connect.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-driver.d.ts +8 -2
- package/dist/agent-executor/acp/v1-driver.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-map.d.ts.map +1 -1
- package/dist/agent-executor/acp/v1-session.d.ts +8 -0
- package/dist/agent-executor/acp/v1-session.d.ts.map +1 -1
- package/dist/agent-executor/claude/cli-driver.d.ts +4 -0
- package/dist/agent-executor/claude/cli-driver.d.ts.map +1 -1
- package/dist/agent-executor/claude/protocol.d.ts +20 -2
- package/dist/agent-executor/claude/protocol.d.ts.map +1 -1
- package/dist/agent-executor/claude/session.d.ts +2 -1
- package/dist/agent-executor/claude/session.d.ts.map +1 -1
- package/dist/agent-executor/claude/transcript.d.ts +9 -6
- package/dist/agent-executor/claude/transcript.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/controls.d.ts +19 -0
- package/dist/agent-executor/claude-sdk/controls.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/driver.d.ts +118 -4
- package/dist/agent-executor/claude-sdk/driver.d.ts.map +1 -1
- package/dist/agent-executor/claude-sdk/query-loop.d.ts +46 -0
- package/dist/agent-executor/claude-sdk/query-loop.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts +27 -0
- package/dist/agent-executor/claude-sdk/query-options.d.ts.map +1 -0
- package/dist/agent-executor/claude-sdk/session.d.ts +6 -5
- package/dist/agent-executor/claude-sdk/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/classify.d.ts.map +1 -1
- package/dist/agent-executor/codex/connect.d.ts +45 -0
- package/dist/agent-executor/codex/connect.d.ts.map +1 -0
- package/dist/agent-executor/codex/driver.d.ts +55 -10
- package/dist/agent-executor/codex/driver.d.ts.map +1 -1
- package/dist/agent-executor/codex/limits.d.ts +11 -2
- package/dist/agent-executor/codex/limits.d.ts.map +1 -1
- package/dist/agent-executor/codex/protocol.d.ts +75 -6
- package/dist/agent-executor/codex/protocol.d.ts.map +1 -1
- package/dist/agent-executor/codex/session-controls.d.ts +155 -0
- package/dist/agent-executor/codex/session-controls.d.ts.map +1 -0
- package/dist/agent-executor/codex/session.d.ts +28 -30
- package/dist/agent-executor/codex/session.d.ts.map +1 -1
- package/dist/agent-executor/codex/unix-socket-target.d.ts +26 -0
- package/dist/agent-executor/codex/unix-socket-target.d.ts.map +1 -0
- package/dist/agent-executor/codex/unix-socket.d.ts +26 -0
- package/dist/agent-executor/codex/unix-socket.d.ts.map +1 -0
- package/dist/agent-executor/codex/ws-frame.d.ts +15 -0
- package/dist/agent-executor/codex/ws-frame.d.ts.map +1 -0
- package/dist/agent-executor/contract.d.ts +2 -0
- package/dist/agent-executor/contract.d.ts.map +1 -1
- package/dist/agent-executor/engine-process.d.ts +9 -0
- package/dist/agent-executor/engine-process.d.ts.map +1 -1
- package/dist/agent-executor/hello.d.ts +8 -0
- package/dist/agent-executor/hello.d.ts.map +1 -1
- package/dist/agent-executor/image-input.d.ts +71 -0
- package/dist/agent-executor/image-input.d.ts.map +1 -0
- package/dist/agent-executor/session-primitives.d.ts +0 -3
- package/dist/agent-executor/session-primitives.d.ts.map +1 -1
- package/dist/agent-runtime/agent-tool.d.ts +21 -7
- package/dist/agent-runtime/agent-tool.d.ts.map +1 -1
- package/dist/agent-runtime/branch-contract.d.ts +1 -0
- package/dist/agent-runtime/branch-contract.d.ts.map +1 -1
- package/dist/agent-runtime/branch-identities.d.ts +5 -2
- package/dist/agent-runtime/branch-identities.d.ts.map +1 -1
- package/dist/agent-runtime/branch-messages.d.ts +9 -9
- package/dist/agent-runtime/branch-messages.d.ts.map +1 -1
- package/dist/agent-runtime/branch-observations.d.ts +49 -36
- package/dist/agent-runtime/branch-observations.d.ts.map +1 -1
- package/dist/agent-runtime/branch-provider.d.ts +14 -8
- package/dist/agent-runtime/branch-provider.d.ts.map +1 -1
- package/dist/agent-runtime/branch-source.d.ts +13 -1
- package/dist/agent-runtime/branch-source.d.ts.map +1 -1
- package/dist/agent-runtime/child-tools.d.ts +64 -0
- package/dist/agent-runtime/child-tools.d.ts.map +1 -1
- package/dist/agent-runtime/event-search-tools.d.ts +82 -5
- package/dist/agent-runtime/event-search-tools.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-attempt.d.ts +1 -1
- package/dist/agent-runtime/invocation-attempt.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-payload.d.ts +12 -0
- package/dist/agent-runtime/invocation-payload.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-read.d.ts +6 -3
- package/dist/agent-runtime/invocation-read.d.ts.map +1 -1
- package/dist/agent-runtime/invocation-schema.d.ts +50 -8
- package/dist/agent-runtime/invocation-schema.d.ts.map +1 -1
- package/dist/agent-runtime/invocations.d.ts +20 -9
- package/dist/agent-runtime/invocations.d.ts.map +1 -1
- package/dist/agent-runtime/postgres.d.ts.map +1 -1
- package/dist/agent-runtime/schedule-tools.d.ts +30 -0
- package/dist/agent-runtime/schedule-tools.d.ts.map +1 -1
- package/dist/agent-runtime/schemas-invocation-payload.d.ts +48 -0
- package/dist/agent-runtime/schemas-invocation-payload.d.ts.map +1 -0
- package/dist/agent-runtime/sql-events.d.ts.map +1 -1
- package/dist/agent-runtime/sql-rows.d.ts +10 -10
- package/dist/agent-runtime/sql-session.d.ts +11 -0
- package/dist/agent-runtime/sql-session.d.ts.map +1 -1
- package/dist/agent-runtime/sqlite-transactions.d.ts.map +1 -1
- package/dist/agent-runtime/state-tools.d.ts +55 -0
- package/dist/agent-runtime/state-tools.d.ts.map +1 -1
- package/dist/agent-runtime/store-branch.d.ts.map +1 -1
- package/dist/agent-runtime/store-conformance-lifecycle.d.ts +20 -20
- package/dist/agent-runtime/store-conformance-support.d.ts +10 -10
- package/dist/agent-runtime/store-create.d.ts.map +1 -1
- package/dist/agent-runtime/store-driver-contract.d.ts +12 -0
- package/dist/agent-runtime/store-driver-contract.d.ts.map +1 -1
- package/dist/agent-runtime/store-memory-events.d.ts.map +1 -1
- package/dist/agent-runtime/store.d.ts +7 -0
- package/dist/agent-runtime/store.d.ts.map +1 -1
- package/dist/agent-runtime/terminal-commit.d.ts +10 -10
- package/dist/declaration/declaration.d.ts +6 -3
- package/dist/declaration/declaration.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts +1 -1
- package/dist/entrypoints/agent-executor/acp.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/acp.js +28 -17
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts +1 -1
- package/dist/entrypoints/agent-executor/claude-sdk.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/claude-sdk.js +543 -96
- package/dist/entrypoints/agent-executor/claude.js +40 -21
- package/dist/entrypoints/agent-executor/codex.d.ts +4 -0
- package/dist/entrypoints/agent-executor/codex.d.ts.map +1 -1
- package/dist/entrypoints/agent-executor/codex.js +1530 -207
- package/dist/entrypoints/agent-executor.js +7 -7
- package/dist/entrypoints/agent-runtime/browser.js +1 -1
- package/dist/entrypoints/agent-runtime/coding-tools.js +3 -3
- package/dist/entrypoints/agent-runtime/harness.js +10 -11
- package/dist/entrypoints/agent-runtime/openrouter.js +4 -4
- package/dist/entrypoints/agent-runtime/postgres.js +12 -7
- package/dist/entrypoints/agent-runtime/realtime.js +4 -4
- package/dist/entrypoints/agent-runtime/sandbox.js +7 -7
- package/dist/entrypoints/agent-runtime/sqlite/bun.js +7 -7
- package/dist/entrypoints/agent-runtime/sqlite/node.js +7 -7
- package/dist/entrypoints/agent-runtime/testing.js +9 -9
- package/dist/entrypoints/agent-runtime.d.ts +9 -7
- package/dist/entrypoints/agent-runtime.d.ts.map +1 -1
- package/dist/entrypoints/agent-runtime.js +254 -207
- package/dist/entrypoints/application/diagnostic-journal.js +4 -4
- package/dist/entrypoints/application/directory-inbox.js +8 -8
- package/dist/entrypoints/application/opentelemetry.js +2 -2
- package/dist/entrypoints/application.js +2 -2
- package/dist/entrypoints/cli/publish.js +8 -8
- package/dist/entrypoints/cli.js +12 -11
- package/dist/entrypoints/contract.js +2 -2
- package/dist/entrypoints/declaration.js +0 -1
- package/dist/entrypoints/files/packaging.js +2 -2
- package/dist/entrypoints/files.js +42 -19
- package/dist/entrypoints/handler.js +4 -4
- package/dist/entrypoints/http.js +5 -5
- package/dist/entrypoints/index.js +7 -7
- package/dist/entrypoints/node.js +7 -7
- package/dist/entrypoints/observability.js +4 -4
- package/dist/entrypoints/primitives.js +2 -2
- package/dist/entrypoints/process.js +6 -6
- package/dist/entrypoints/react.js +1 -1
- package/dist/entrypoints/remote.js +2 -2
- package/dist/entrypoints/server.js +10 -10
- package/dist/entrypoints/service-host/macos.js +6 -6
- package/dist/entrypoints/service-host.d.ts +4 -1
- package/dist/entrypoints/service-host.d.ts.map +1 -1
- package/dist/entrypoints/service-host.js +835 -224
- package/dist/entrypoints/spend.js +1 -1
- package/dist/entrypoints/sync/postgres.js +1 -1
- package/dist/entrypoints/sync.js +2 -2
- package/dist/entrypoints/telegram.js +5 -5
- package/dist/entrypoints/testing.js +5 -5
- package/dist/entrypoints/tools/agent.js +5 -4
- package/dist/entrypoints/tools/connections.js +2 -2
- package/dist/entrypoints/tools/invoker.js +4 -3
- package/dist/entrypoints/tools/mcp.js +5 -4
- package/dist/entrypoints/tools/toolkit.js +8 -7
- package/dist/entrypoints/tools.d.ts +1 -1
- package/dist/entrypoints/tools.d.ts.map +1 -1
- package/dist/entrypoints/tools.js +15 -13
- package/dist/entrypoints/tracking/contract.js +1 -1
- package/dist/entrypoints/xlsx.js +1 -1
- package/dist/files/directory-appearance.d.ts +20 -9
- package/dist/files/directory-appearance.d.ts.map +1 -1
- package/dist/files/polled-json.d.ts.map +1 -1
- package/dist/files/regular-file.d.ts +15 -5
- package/dist/files/regular-file.d.ts.map +1 -1
- package/dist/{index-prf6ayhf.js → index-13wmzpa6.js} +1 -1
- package/dist/{index-qnzhmk2s.js → index-17qgm6xe.js} +91 -48
- package/dist/{index-wv8dqy7q.js → index-205456mf.js} +1 -1
- package/dist/{index-3gwp8ez6.js → index-21cfxc4z.js} +13 -18
- package/dist/{index-xtkw9866.js → index-2c5w2d1d.js} +1 -1
- package/dist/{index-g1q7fwn9.js → index-2nwvn7m2.js} +1 -1
- package/dist/{index-d4svrknj.js → index-39c2hj6h.js} +2 -2
- package/dist/{index-sfzfd2m2.js → index-39rmc00v.js} +1 -1
- package/dist/{index-ky3ardqn.js → index-3fym4j8n.js} +1 -1
- package/dist/{index-d96c1n1q.js → index-5tdc0q43.js} +20 -19
- package/dist/{index-3ypvpkwr.js → index-669374qc.js} +1 -1
- package/dist/{index-x90w78yz.js → index-673drwkn.js} +23 -8
- package/dist/{index-83n766x4.js → index-7jqn3b3g.js} +16 -10
- package/dist/{index-5jyjb4s0.js → index-80acsm27.js} +1 -1
- package/dist/{index-xmr47znh.js → index-827bgv33.js} +1 -1
- package/dist/{index-xypxnzhp.js → index-93n6jwy0.js} +4 -4
- package/dist/{index-wbnpa8z6.js → index-9kpxz49v.js} +5 -5
- package/dist/{index-fcw255hd.js → index-9sfhje6y.js} +3 -3
- package/dist/{index-bh4pmtr9.js → index-afb6z77w.js} +3 -1
- package/dist/{index-9y0afd5f.js → index-apf5g7y9.js} +1 -1
- package/dist/{index-4qvyhn23.js → index-bjmj2q1z.js} +1 -1
- package/dist/{index-bbzvrq66.js → index-dcsxj68j.js} +457 -204
- package/dist/{index-j516jaaz.js → index-dnzxxf8a.js} +49 -2
- package/dist/{index-kmbpej2y.js → index-emgrmavr.js} +102 -61
- package/dist/index-fgahdc7s.js +100 -0
- package/dist/{index-kzavdze2.js → index-gr0kxymw.js} +5 -1
- package/dist/{index-e06z0tkb.js → index-gya4hwh3.js} +2 -2
- package/dist/{index-3djgv3ch.js → index-hab790s6.js} +26 -11
- package/dist/{index-j13gzgdv.js → index-j0ef04jw.js} +9 -5
- package/dist/{index-rhb33thr.js → index-jcge9tx3.js} +1 -1
- package/dist/{index-dvd1qdwa.js → index-ke02kxsr.js} +3 -3
- package/dist/{index-3agqmmrg.js → index-mkfhpk11.js} +7 -9
- package/dist/{index-a725ayvz.js → index-mttkdm5a.js} +1 -1
- package/dist/{index-9wh98cpa.js → index-n3bm7zqq.js} +131 -91
- package/dist/{index-7xp05h20.js → index-p06z7g7w.js} +7 -7
- package/dist/{index-kt6dh1n6.js → index-p16q492v.js} +1 -1
- package/dist/{index-5zwac8ft.js → index-pp97q86a.js} +3 -3
- package/dist/{index-39n02e0q.js → index-psye60qn.js} +1 -1
- package/dist/{index-5ptwb6ka.js → index-pzhqydxb.js} +1 -1
- package/dist/{index-7kfcb576.js → index-qa2jjb65.js} +1 -1
- package/dist/{index-0djnptn8.js → index-qhjmmsm2.js} +10 -3
- package/dist/{index-7grgs8cx.js → index-qpzyahe3.js} +2 -2
- package/dist/{index-8xr2eq99.js → index-r97ppg0g.js} +4 -4
- package/dist/{index-bmaz3jzy.js → index-rjs94dny.js} +1 -1
- package/dist/{index-p1m9djt6.js → index-rxh3qy4x.js} +33 -6
- package/dist/{index-en8e5zsj.js → index-ryxb427v.js} +1 -1
- package/dist/{index-nbv44x0x.js → index-s2e3h616.js} +137 -36
- package/dist/{index-dwa6pskj.js → index-sd4e5x5j.js} +86 -47
- package/dist/{index-g56ht6qf.js → index-t3qcac2a.js} +1 -1
- package/dist/index-vgzhw2zk.js +304 -0
- package/dist/{index-jrka9029.js → index-vmbxj75t.js} +2 -2
- package/dist/{index-caywx1c0.js → index-wv2amqm4.js} +109 -12
- package/dist/{index-5e0zsbf7.js → index-x2fb37t0.js} +2 -2
- package/dist/{index-z4k0hqp9.js → index-y71zn1gw.js} +137 -27
- package/dist/{index-wavv538x.js → index-ybdq8kk2.js} +3 -3
- package/dist/{index-4gk6k3zc.js → index-ycr4pk0z.js} +1 -1
- package/dist/{index-0tyt97nk.js → index-yrr3n391.js} +1 -1
- package/dist/{index-v37b2cd6.js → index-z20pdxeb.js} +2 -2
- package/dist/{index-0hdm5sx6.js → index-z9d74jmb.js} +8 -4
- package/dist/{index-4s2w4g37.js → index-zhshhxew.js} +80 -2
- package/dist/{index-3b31z0pc.js → index-znd1b57f.js} +12 -6
- package/dist/internal/bounded-file-confirm.d.ts +32 -0
- package/dist/internal/bounded-file-confirm.d.ts.map +1 -0
- package/dist/internal/bounded-file-read.d.ts +10 -7
- package/dist/internal/bounded-file-read.d.ts.map +1 -1
- package/dist/internal/file-observation.d.ts +5 -1
- package/dist/internal/file-observation.d.ts.map +1 -1
- package/dist/internal/positive-integer.d.ts +2 -0
- package/dist/internal/positive-integer.d.ts.map +1 -1
- package/dist/internal/process-instance.d.ts +8 -0
- package/dist/internal/process-instance.d.ts.map +1 -1
- package/dist/internal/unix-socket.d.ts +10 -1
- package/dist/internal/unix-socket.d.ts.map +1 -1
- package/dist/server/unix-client.d.ts +7 -0
- package/dist/server/unix-client.d.ts.map +1 -1
- package/dist/service-host/systemd-inspect.d.ts +3 -1
- package/dist/service-host/systemd-inspect.d.ts.map +1 -1
- package/dist/service-host/systemd-render-shared.d.ts +64 -0
- package/dist/service-host/systemd-render-shared.d.ts.map +1 -0
- package/dist/service-host/systemd-render.d.ts +31 -26
- package/dist/service-host/systemd-render.d.ts.map +1 -1
- package/dist/service-host/systemd-timer-render.d.ts +31 -0
- package/dist/service-host/systemd-timer-render.d.ts.map +1 -0
- package/dist/service-host/systemd-timer-rollback.d.ts +26 -0
- package/dist/service-host/systemd-timer-rollback.d.ts.map +1 -0
- package/dist/service-host/systemd-timer.d.ts +82 -0
- package/dist/service-host/systemd-timer.d.ts.map +1 -0
- package/dist/service-host/systemd-unit-ops.d.ts +26 -0
- package/dist/service-host/systemd-unit-ops.d.ts.map +1 -0
- package/dist/service-host/systemd.d.ts +1 -1
- package/dist/service-host/systemd.d.ts.map +1 -1
- package/dist/tools/access.d.ts +30 -1
- package/dist/tools/access.d.ts.map +1 -1
- package/dist/tools/agent.d.ts +2 -2
- package/dist/tools/agent.d.ts.map +1 -1
- package/dist/tools/cli/args-scan.d.ts +5 -0
- package/dist/tools/cli/args-scan.d.ts.map +1 -1
- package/dist/tools/cli/args.d.ts +11 -5
- package/dist/tools/cli/args.d.ts.map +1 -1
- package/dist/tools/cli/invoke.d.ts +2 -1
- package/dist/tools/cli/invoke.d.ts.map +1 -1
- package/dist/tools/cli/notices.d.ts.map +1 -1
- package/dist/tools/cli/run-managed.d.ts.map +1 -1
- package/dist/tools/cli/session.d.ts.map +1 -1
- package/dist/tools/execute.d.ts.map +1 -1
- package/dist/tools/invoker.d.ts +2 -1
- package/dist/tools/invoker.d.ts.map +1 -1
- package/dist/tools/list-names.d.ts +2 -3
- package/dist/tools/list-names.d.ts.map +1 -1
- package/dist/tools/manifest.d.ts +2 -3
- package/dist/tools/manifest.d.ts.map +1 -1
- package/dist/tools/mcp/mount.d.ts +5 -5
- package/dist/tools/mcp/mount.d.ts.map +1 -1
- package/dist/tools/mcp/register.d.ts +2 -1
- package/dist/tools/mcp/register.d.ts.map +1 -1
- package/dist/tools/mcp/runtime-tools.d.ts.map +1 -1
- package/llms/agent-executor-acp.txt +10 -6
- package/llms/agent-executor-claude-sdk.txt +13 -10
- package/llms/agent-executor-claude.txt +2 -2
- package/llms/agent-executor-codex.txt +9 -3
- package/llms/agent-executor.txt +2 -2
- package/llms/agent-runtime.4.txt +21 -9
- package/llms/cli.3.txt +4 -4
- package/llms/cli.txt +1 -0
- package/llms/declaration.txt +2 -2
- package/llms/files.txt +1 -1
- package/llms/node.txt +2 -2
- package/llms/server.5.txt +2 -2
- package/llms/service-host.txt +5 -5
- package/llms/stitchkit.txt +81 -77
- package/llms/tools.3.txt +3 -2
- package/llms/upgrading-0.128.0-0.129.0.txt +175 -0
- package/llms/upgrading.txt +1 -0
- package/llms-full.txt +323 -127
- package/llms.txt +15 -14
- package/package.json +1 -1
- package/dist/index-ajmtxsky.js +0 -193
- package/dist/index-ax3wns1a.js +0 -93
package/dist/tools/manifest.d.ts
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { ToolTransport } from '../contract/define.js';
|
|
2
|
-
import type
|
|
2
|
+
import { type SurfaceRuntimeToolDefinition, type ToolSurfaceProjection } from './internal/surface-projector.js';
|
|
3
3
|
import type { CollectToolsConfig } from './mount.js';
|
|
4
|
-
import type { RuntimeToolDefinition } from './runtime-tool-declaration.js';
|
|
5
4
|
export interface ToolManifestEntry {
|
|
6
5
|
name: string;
|
|
7
6
|
description: string;
|
|
8
7
|
inputSchema: Record<string, unknown>;
|
|
9
8
|
}
|
|
10
|
-
export interface ToolManifestConfig extends ToolSurfaceProjection<
|
|
9
|
+
export interface ToolManifestConfig extends ToolSurfaceProjection<SurfaceRuntimeToolDefinition> {
|
|
11
10
|
/** Model-facing surface whose exposure rules the manifest must mirror. */
|
|
12
11
|
transport: ToolTransport;
|
|
13
12
|
extend?: CollectToolsConfig['extend'];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"manifest.d.ts","sourceRoot":"","sources":["../../src/tools/manifest.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAEL,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC3B,MAAM,8BAA8B,CAAC;AACtC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAElD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED,MAAM,WAAW,kBACf,SAAQ,qBAAqB,CAAC,4BAA4B,CAAC;IAC3D,0EAA0E;IAC1E,SAAS,EAAE,aAAa,CAAC;IACzB,MAAM,CAAC,EAAE,kBAAkB,CAAC,QAAQ,CAAC,CAAC;IACtC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,gGAAgG;IAChG,mBAAmB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,gBAAiB,SAAQ,iBAAiB;IACzD,MAAM,EAAE;QAAE,IAAI,EAAE,UAAU,GAAG,SAAS,CAAC;QAAC,OAAO,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1E,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,aAAa,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAMD,0FAA0F;AAC1F,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,iBAAiB,GAAG,gBAAgB,EAAE,CAgCjF;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,EAAE,CAWjF"}
|
|
@@ -10,7 +10,7 @@ import { type McpSchemaValidationConfig, type McpSurfaceRegistry, type PreparedM
|
|
|
10
10
|
import type { McpRoundRuntime } from './round.js';
|
|
11
11
|
/**
|
|
12
12
|
* Options for `mountMcp`; `access` is required — pass `{ gate }` with your auth
|
|
13
|
-
* `beforeHandle` hook
|
|
13
|
+
* `beforeHandle` hook, `{ open }`, or `{ inspect: true }` for read-only surface inspection.
|
|
14
14
|
*/
|
|
15
15
|
export interface McpMountConfig {
|
|
16
16
|
context?: Record<string, unknown>;
|
|
@@ -18,8 +18,8 @@ export interface McpMountConfig {
|
|
|
18
18
|
hooks?: ToolCallHooks;
|
|
19
19
|
/**
|
|
20
20
|
* Required access policy for every mounted tool call — pass `{ gate }` with
|
|
21
|
-
* `beforeHandle` (for example from `createAuthHook`)
|
|
22
|
-
*
|
|
21
|
+
* `beforeHandle` (for example from `createAuthHook`), `{ open: 'public' | 'local-operator' | 'remote' }`,
|
|
22
|
+
* or `{ inspect: true }` for read-only surface inspection that refuses every execution.
|
|
23
23
|
*/
|
|
24
24
|
access: ToolAccess;
|
|
25
25
|
extend?: ToolExtend;
|
|
@@ -81,8 +81,8 @@ export interface McpServerSharedConfig<TAuth> {
|
|
|
81
81
|
* `onToolError` adds the raw thrown value behind a failed one. */
|
|
82
82
|
hooks?: ToolCallHooks;
|
|
83
83
|
/** Required access policy for every tool call — pass `{ gate }` with
|
|
84
|
-
* `beforeHandle` (for example from `createAuthHook`)
|
|
85
|
-
*
|
|
84
|
+
* `beforeHandle` (for example from `createAuthHook`), `{ open: 'public' | 'local-operator' | 'remote' }`,
|
|
85
|
+
* or `{ inspect: true }` for read-only surface inspection that refuses every execution. */
|
|
86
86
|
access: ToolAccess;
|
|
87
87
|
/** Add extra tool arguments resolved into handler context (e.g. a `tenantId`
|
|
88
88
|
* for one API key serving many tenants). Same `ToolExtend` accepted by
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mount.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/mount.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,SAAS,EAET,KAAK,aAAa,EACnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAqB,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACnE,OAAO,EAAoB,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;A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GAAG,eAAe,GAAG,SAAS,CAE/E;AAED,iFAAiF;AACjF,wBAAgB,0BAA0B,CAAC,KAAK,EAC9C,MAAM,EAAE,oBAAoB,CAAC,KAAK,CAAC,EACnC,IAAI,EAAE,KAAK,EACX,QAAQ,EAAE,wBAAwB,GACjC,SAAS,CA0EX;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,cAAc,GAAG,IAAI,CAmBlF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type CallToolResult, type McpServer } from '@modelcontextprotocol/server';
|
|
2
2
|
import type { EndpointUiMeta } from '../../contract/tool-options.js';
|
|
3
3
|
import type { ToolExecutionOptions } from '../execute.js';
|
|
4
|
-
import type { ToolCallHooks } from '../execute-hooks.js';
|
|
4
|
+
import type { ToolCallHooks, ToolLifecycle } from '../execute-hooks.js';
|
|
5
5
|
import { type ToolResult } from '../execute-result.js';
|
|
6
6
|
import type { MountableTool } from '../mount.js';
|
|
7
7
|
import type { McpCatalogStamp } from './catalog-stamp.js';
|
|
@@ -23,6 +23,7 @@ export interface McpToolRegistrationConfig {
|
|
|
23
23
|
catalog?: McpCatalogStamp;
|
|
24
24
|
multiRoundRuntime?: McpRoundRuntime;
|
|
25
25
|
hooks?: ToolCallHooks;
|
|
26
|
+
lifecycle?: ToolLifecycle;
|
|
26
27
|
context?: Record<string, unknown>;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/register.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,cAAc,EAEnB,KAAK,SAAS,EACf,MAAM,8BAA8B,CAAC;AAGtC,OAAO,KAAK,EAA2B,cAAc,EAAE,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"register.d.ts","sourceRoot":"","sources":["../../../src/tools/mcp/register.ts"],"names":[],"mappings":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AAE,sBAAsB,CAAC,YAAY,CAAC,CAAC,YAAY,CAAC,EACxD,QAAQ,EAAE,MAAM,KACb,cAAc,CAAC;CACrB;AAaD;;;;GAIG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,SAAS,EACjB,KAAK,EAAE,SAAS,sBAAsB,EAAE,EACxC,MAAM,EAAE,sBAAsB,GAC7B,IAAI,CAkCN"}
|
|
@@ -24,15 +24,19 @@ ACP keeps no client id, so reconcile is `none`: a send whose outcome is
|
|
|
24
24
|
unknown stays unknown. Unknown keys an agent adds — `_meta`, a vendor's own
|
|
25
25
|
fields — are let through; the keys the driver reads are typed. Evolving.
|
|
26
26
|
|
|
27
|
-
Whether an agent
|
|
28
|
-
|
|
29
|
-
`session/request_permission
|
|
30
|
-
|
|
27
|
+
Whether an agent pauses for host approval before running a tool is controlled by the agent
|
|
28
|
+
itself, not by ACP: the driver's `approvalEnforcement` is `'agent-initiated'`, meaning it
|
|
29
|
+
answers `session/request_permission` requests when the agent sends them and never synthesizes
|
|
30
|
+
approvals for unprompted tool calls. Some ACP agents execute tools without sending
|
|
31
|
+
`session/request_permission` in their default configuration; a host that requires interactive
|
|
32
|
+
tool approval must configure the agent's own approval policy (for example `toolPermission: "strict"`
|
|
33
|
+
in the agent's settings under `profile.home`, bearing in mind whether the agent's OAuth session
|
|
34
|
+
is bound to that profile directory).
|
|
31
35
|
|
|
32
36
|
| Export | Kind | Purpose |
|
|
33
37
|
|--------|------|---------|
|
|
34
|
-
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver: `executable` and `args`; `model`, `thoughtLevel` and `mode` set at open through the option of that category, in that order, a value the agent does not offer refused; `mcpServers` on every new, loaded or resumed session; `resolveFile` and `maxImageBytes` (5 MiB, eagerly validated as a positive safe integer) for images; `maxFrameBytes` (8 MiB) for one line from the agent; `requestTimeoutMs` (60 s) for each request, also capping `session/close` to at most `min(requestTimeoutMs, 5 s)`; each numeric option is refused when the driver is created, before any agent is spawned. The agent runs with `HOME` set to the profile's `home`. `info` answers the model option's values as `models: { answer: 'listed', ids }` (empty when the agent offers none) or `{ answer: 'failed', error }`, `status` opens and closes a session without a prompt — a session refused for auth is `signed-out`; `sessions` asks `session/list` |
|
|
35
|
-
| `AcpSession` / `AcpConfigOption` | _types_ | a session's settings, title and commands as the agent last reported them, and `setConfigOption(category or id, value)`, answered with every option, which may have narrowed |
|
|
38
|
+
| `createAcpDriver` / `AcpDriver` / `AcpDriverConfig` | function / _types_ | the driver (`approvalEnforcement: 'agent-initiated'`): `executable` and `args`; `model`, `thoughtLevel` and `mode` set at open through the option of that category, in that order, a value the agent does not offer refused; `mcpServers` on every new, loaded or resumed session; `resolveFile` and `maxImageBytes` (5 MiB, eagerly validated as a positive safe integer) for images; `maxFrameBytes` (8 MiB) for one line from the agent; `requestTimeoutMs` (60 s) for each request, also capping `session/close` to at most `min(requestTimeoutMs, 5 s)`; each numeric option is refused when the driver is created, before any agent is spawned. The agent runs with `HOME` set to the profile's `home`. `info` answers the model option's values as `models: { answer: 'listed', ids }` (empty when the agent offers none) or `{ answer: 'failed', error }`, `status` opens and closes a session without a prompt — a session refused for auth is `signed-out`; `sessions` asks `session/list` |
|
|
39
|
+
| `AcpSession` / `AcpConfigOption` / `AcpApprovalEnforcement` | _types_ | a session's settings, title and commands as the agent last reported them, its constant `approvalEnforcement` (`'agent-initiated'`: the host answers `session/request_permission` requests when the agent sends them and never synthesizes approvals for unprompted tool calls), and `setConfigOption(category or id, value)`, answered with every option, which may have narrowed |
|
|
36
40
|
| `AcpSessionSummary` | _type_ | a session the agent keeps: id, working directory, title, last update |
|
|
37
41
|
| `AcpMcpServerSchema` / `AcpMcpServer` | schema / _type_ | an MCP server as ACP v1 names it: a command with arguments and environment, or an `http`/`sse` URL with headers |
|
|
38
42
|
| `ACP_PROTOCOL_VERSION` | constant | `1`; an agent answering another version is refused at hello |
|
|
@@ -14,18 +14,21 @@ Also read:
|
|
|
14
14
|
|
|
15
15
|
## `stitchkit/agent-executor/claude-sdk`
|
|
16
16
|
|
|
17
|
-
Claude through the Agent SDK. The application imports `query`
|
|
18
|
-
`@anthropic-ai/claude-agent-sdk` (an optional peer) and
|
|
19
|
-
imports only the SDK's types, so it loads without the
|
|
20
|
-
the same classifier as the CLI's, permissions arrive
|
|
21
|
-
interrupt is `Query.interrupt()` and denies a
|
|
22
|
-
query that breaks fails its turn — the next
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
Claude through the Agent SDK. The application imports `query` (and optionally
|
|
18
|
+
`forkSession`) from `@anthropic-ai/claude-agent-sdk` (an optional peer) and
|
|
19
|
+
passes them in; the leaf imports only the SDK's types, so it loads without the
|
|
20
|
+
SDK. Records are read by the same classifier as the CLI's, permissions arrive
|
|
21
|
+
through `canUseTool`, an interrupt is `Query.interrupt()` and denies a
|
|
22
|
+
permission still pending, and a query that breaks fails its turn — the next
|
|
23
|
+
turn opens a new one that resumes the session with live model, permission mode
|
|
24
|
+
and flag settings re-applied. Reconcile is by the input's `uuid` in the
|
|
25
|
+
profile's transcript. Evolving.
|
|
25
26
|
|
|
26
27
|
| Export | Kind | Purpose |
|
|
27
28
|
|--------|------|---------|
|
|
28
|
-
| `createClaudeSdkDriver` / `ClaudeSdkDriverConfig` | function /
|
|
29
|
-
| `
|
|
29
|
+
| `createClaudeSdkDriver` / `ClaudeSdkDriver` / `ClaudeSdkDriverConfig` | function / _types_ | the driver: `query` and `sdkVersion` required; optional `forkSession`, `model`, `permissionMode` (default `default`), `allowDangerouslySkipPermissions`, `pathToClaudeCodeExecutable`, `systemPrompt`, `settingSources`, `enableFileCheckpointing`, `supportedDialogKinds` / `onUserDialog`, `hooks`, `tools`, `allowedTools`, `disallowedTools`, `mcpServers`, `mcpServersDelivery`, `strictMcpConfig`, `plugins`, `agents`, `extraArgs`, `stderr`, `spawnClaudeCodeProcess`, `onProviderPid`, `verifyDelegation`, `resolveFile`, `maxImageBytes` (default 5 MiB), and `ambient`. `status` reports the plan windows the session's `rate_limit_event` carried and the login as `unknown`; `forkSession(sessionId, options?)` delegates to the injected SDK function |
|
|
30
|
+
| `ClaudeSdkSession` | _type_ | extended session returned by `open()`: exposes `providerPid`, `setModel`, `setPermissionMode`, `applyFlagSettings`, `initializationResult`, `supportedModels`, `supportedCommands`, `accountInfo`, `getContextUsage`, `mcpServerStatus`, `toggleMcpServer`, `reconnectMcpServer`, and `rewindFiles` |
|
|
31
|
+
| `ClaudeSdkDelegationCheck` | _type_ | fail-closed startup verification options (`requireHooksApplied`, `requireNoMcpServers`, `timeoutMs`) enforced at `open()` and on every query restart |
|
|
32
|
+
| `ClaudeSdkQuery` / `ClaudeSdkRun` / `ClaudeSdkForkSession` | _types_ | the SDK `query` / `forkSession` signatures the leaf takes and the subset of a running `Query` it uses; the SDK's own functions fit as they are |
|
|
30
33
|
|
|
31
34
|
---
|
|
@@ -21,9 +21,9 @@ Evolving.
|
|
|
21
21
|
|
|
22
22
|
| Export | Kind | Purpose |
|
|
23
23
|
|--------|------|---------|
|
|
24
|
-
| `createClaudeCliDriver` / `ClaudeCliDriverConfig` | function / _type_ | the driver; `permissionMode` defaults to `default`, so the server decides every tool the profile does not already allow |
|
|
24
|
+
| `createClaudeCliDriver` / `ClaudeCliDriverConfig` | function / _type_ | the driver; `permissionMode` defaults to `default`, so the server decides every tool the profile does not already allow; optional `resolveFile` and `maxImageBytes` (default 5 MiB) enable ordered turn-input image attachments |
|
|
25
25
|
| `claudeFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted engine |
|
|
26
|
-
| `claudeTranscriptPath` | function | where a profile keeps a session's transcript (`{ home, cwd, sessionId }`) |
|
|
26
|
+
| `claudeTranscriptPath` | function | where a profile keeps a session's transcript (`{ home, cwd, sessionId }`), resolving `realpath` of `cwd` (or its nearest existing ancestor) so symlinked workspaces match the canonical transcript location |
|
|
27
27
|
| `claudePlanWindows` | function | Claude's `rate_limit_event` as plan windows (`five_hour`, `seven_day`) |
|
|
28
28
|
|
|
29
29
|
---
|
|
@@ -14,12 +14,18 @@ Also read:
|
|
|
14
14
|
|
|
15
15
|
## `stitchkit/agent-executor/codex`
|
|
16
16
|
|
|
17
|
-
Codex through `codex app-server` over stdio
|
|
17
|
+
Codex through `codex app-server` over stdio (default) or RFC 6455
|
|
18
|
+
WebSocket-over-Unix-socket (`unix-listen` / `unix-connect`). Evolving.
|
|
18
19
|
|
|
19
20
|
| Export | Kind | Purpose |
|
|
20
21
|
|--------|------|---------|
|
|
21
|
-
| `createCodexDriver` / `CodexDriverConfig` | function /
|
|
22
|
+
| `createCodexDriver` / `CodexDriver` / `CodexDriverConfig` | function / _types_ | the driver: `transport` (`stdio`, `unix-listen`, `unix-connect`), `serverArgs`, thread policy (`model`, `modelProvider`, `approvalPolicy`, `sandbox`, `developerInstructions`, `runtimeWorkspaceRoots`, `config`), `prepareThread` / `verifyThread` lifecycle hooks, optional `resolveFile` and `maxImageBytes` (default 5 MiB) for turn-input images, approvals and input asked of the host, multi-bucket limits from `account/rateLimits/read` |
|
|
23
|
+
| `CodexTransportConfig` | _type_ | transport selector: `{ kind: 'stdio' }`, `{ kind: 'unix-listen', socketPath, listenTimeoutMs? }`, or `{ kind: 'unix-connect', socketPath, expectedOwnerUid? }` |
|
|
24
|
+
| `CodexSession` / `CodexControlClient` | _types_ | extended session returned by `open()`: exposes `providerPid`, applied `threadContext`, per-turn overrides on `startTurn`, `steerTurn`, non-mutating `forkThread`, `compactThread`, `readConfig`, `listMcpServerStatus`, `listSkills`, `listModels`, `readAccount`, and `readRateLimits` |
|
|
25
|
+
| `CodexThreadContext` / `CodexThreadPolicyOverrides` / `CodexApprovalPolicy` / `CodexSandboxMode` | _types_ | applied policy/model context reported by `thread/start`, `thread/resume`, or `thread/fork`, and overridable thread policy fields |
|
|
26
|
+
| `CodexTurnInput` / `CodexCollaborationMode` / `CodexSteerTurnInput` / `CodexForkThreadOptions` / `CodexForkedThread` | _types_ | per-turn `startTurn` overrides (`model`, fail-closed `modelProvider`, `reasoningEffort`, `collaborationMode`, `approvalPolicy`, `sandboxPolicy`, `runtimeWorkspaceRoots`), `steerTurn` input, and `forkThread` options/result |
|
|
27
|
+
| `CodexUnixSocketError` / `CodexUnixSocketErrorKind` | class / _type_ | typed Unix-socket refusal/transport error distinguishing `endpoint-absent`, `endpoint-not-listening`, `target-refused`, `upgrade-refused`, and `connection-lost` |
|
|
22
28
|
| `codexFakeScenarios` | constant | the conformance scenarios in this dialect, for a scripted app-server |
|
|
23
|
-
| `codexPlanWindows` | function | Codex's `rateLimits`
|
|
29
|
+
| `codexPlanWindows` | function | unfolds Codex's `account/rateLimits/read` envelope (including `rateLimitsByLimitId`) or a single snapshot into `<limitId\|limit>:<minutes>m\|<slot>` plan windows carrying optional `windowDurationMins` and `label` |
|
|
24
30
|
|
|
25
31
|
---
|
package/llms/agent-executor.txt
CHANGED
|
@@ -22,14 +22,14 @@ leaves of their own; this entrypoint knows no vendor. Evolving.
|
|
|
22
22
|
|--------|------|---------|
|
|
23
23
|
| `defineAgentExecutorContract` / `agentExecutorRealtimeContract` | functions / contract | the operations (`hello`, `claim`, `renew`, `release`, `report`) and the events the server pushes (`turn:offer`, `turn:interrupt`, `turn:reply`) |
|
|
24
24
|
| `ExecutorHelloSchema` / `ExecutorHello` / `ExecutorHelloAckSchema` / `ExecutorHelloAck` / `ExecutorEngineSchema` / `ExecutorEngine` / `ExecutorEngineInfoSchema` / `ExecutorReconcileSchema` / `ExecutorProfileSchema` / `ExecutorProfile` / `ExecutorResumableTurnSchema` | schemas / _types_ | what an executor announces — engines (their `models`: `listed` with ids, `not-asked` or `failed` with why), private profiles, resumable turns with their `turnOrdinal` — and what the server holds of each: `acked` up to `ackedSeq`, or `not-retained` |
|
|
25
|
-
| `PlanLimitsSchema` / `PlanLimits` / `PlanWindowSchema` / `PlanWindow` | schemas / _types_ | a subscription's limits: `known`, `no-plan-limit` or `unpublished`, with the last read's error beside the last answer |
|
|
25
|
+
| `PlanLimitsSchema` / `PlanLimits` / `PlanWindowSchema` / `PlanWindow` | schemas / _types_ | a subscription's limits: `known`, `no-plan-limit` or `unpublished`, with the last read's error beside the last answer; each window carries `name`, `usedPercent`, and optional `resetsAt`, `windowDurationMins` and `label` |
|
|
26
26
|
| `ThreadClaimSchema` / `ThreadClaim` / `ThreadLeaseSchema` / `ThreadLease` / `ThreadRenewSchema` / `ThreadReleaseSchema` | schemas / _types_ | thread leases pinned to an executor and profile, under a fence |
|
|
27
27
|
| `TurnOfferSchema` / `TurnOffer` / `TurnPhaseSchema` / `TurnPhase` / `TurnReportSchema` / `TurnReport` / `TurnReportAckSchema` / `TurnFailureKindSchema` / `TurnInterruptSchema` / `InteractionReplySchema` / `InteractionReply` / `EXECUTOR_ERRORS` | schemas / _types_ / constant | a turn offered under its thread's `turnOrdinal`, its phases and reports applied once by `executorSeq` (acknowledged `applied`, `duplicate` or `not-retained`), interrupts, answers to an engine's requests, and the refusal codes |
|
|
28
28
|
| `ExecutorDeltaSchema` / `ExecutorDelta` / `ExecutorErrorKindSchema` / `ExecutorErrorKind` / `ExecutorRawSchema` | schemas / _types_ | what an engine said: `agent-parts` blocks with `turnId`, `itemId` and `raw`, plus requests, usage, the context gauge (`context-usage`), the end of the turn, errors by kind and window resets |
|
|
29
29
|
| `projectExecutorDeltas` | function | fold a turn's deltas into the message parts the agent runtime stores |
|
|
30
30
|
| `AgentEngineDriver` / `AgentEngineSession` / `AgentEngineTurn` / `ExecutorEngineInfo` | _types_ | one vendor's engine behind one interface: info, login status, a session per connection, turns with `interrupt` and `respond`, `findInput` for a `client-id` engine |
|
|
31
31
|
| `dispatchTurn` / `DispatchOutcome` | function / _type_ | send a turn's input at most once through `LocalStepDurability.effect`: `sent`, `delivered` after a reconcile, or `unknown_after_restart` — never resent |
|
|
32
|
-
| `spawnEngineProcess` / `EngineProcess` | function / _type_ | an engine process talked to by lines over `stitchkit/process`: declared environment, owner-loss termination, bounded lines (`maxLineBytes`), stderr, queued stdin (`maxPendingStdinBytes`) and stdin written over the connection's life (`maxStdinBytes`, a refused `send()` that leaves the engine running); every option checked before the spawn |
|
|
32
|
+
| `spawnEngineProcess` / `EngineProcess` | function / _type_ | an engine process talked to by lines over `stitchkit/process`: declared environment, owner-loss termination, optional leader `pid` / `pidReady`, `stdoutMode` (`'lines'` default or `'drain'` for socket-serving engines), bounded lines (`maxLineBytes`), stderr, queued stdin (`maxPendingStdinBytes`) and stdin written over the connection's life (`maxStdinBytes`, a refused `send()` that leaves the engine running); every option checked before the spawn |
|
|
33
33
|
| `createExecutorLeases` / `memoryExecutorLeaseStore` / `ExecutorLeaseStateStore` / `ExecutorLeaseState` / `ExecutorLeaseStateSchema` / `ExecutorLeaseRefusal` | functions / _types_ / class | the server's thread leases and turn receipts over one atomically updated value, bounded by threads: each thread keeps the receipts of its last `retainedTurns` turns (default 64, at most 1024) and the highest `turnOrdinal` it let go, a report of a turn at or below it is `not-retained`, and `resume(resumable)` answers a hello the same way; a `StateStore` of `stitchkit/application` fits; a refusal is an `ExecutorLeaseRefusal` — an `AppError` with status 409 and a code of `EXECUTOR_ERRORS` — so an operation returning the service's promise answers `409 { error: { code } }` |
|
|
34
34
|
| `ExecutorProfileConfigSchema` / `ExecutorProfileConfig` / `engineEnvironment` / `ownCredentials` / `helloProfile` / `CREDENTIAL_VARIABLES` | schema / _type_ / functions / constant | a profile on the executor's machine, the engine's allowlisted environment with the profile's `home` as `CLAUDE_CONFIG_DIR`, `CODEX_HOME` or (ACP) `HOME`, and `helloProfile({ profile, status, ambient })` carrying no path and no value; a driver refuses a profile whose `engine` is not its own with a `TypeError`, before it reads a file or starts the engine |
|
|
35
35
|
| `mergeRateLimitEvent` / `planLimitsReadFailed` / `planLimitsDue` / `planWindowExpired` | functions | plan limits kept as three answers (`mergeRateLimitEvent`, `planLimitsReadFailed`, `planLimitsDue` take an options object), with a failed read beside the last answer |
|
package/llms/agent-runtime.4.txt
CHANGED
|
@@ -34,7 +34,7 @@ Server-only optional application runtime. See the
|
|
|
34
34
|
| `AgentMessageSchema` / `AgentRunSchema` / `AgentSnapshotSchema` | schema | versioned canonical engine records |
|
|
35
35
|
| `AgentRunQueuePrioritySchema` | schema | durable opt-in priority for queued `interrupt-next` runs |
|
|
36
36
|
| `AgentRuntimeStore` | _type_ | aggregate CAS transaction boundary for message, run and compaction mutations |
|
|
37
|
-
| `BranchAgentConversationInputSchema` / `BranchAgentConversationInput` | schema / _type_ | strict branch request: stable request key, empty destination, settled conversation boundary or archive bytes, fresh artifact authorization, and `applicationFiles` — `{ reference, destinationReference }` pairs for file parts the application stores; an undeclared non-spill file reference refuses the branch. `applicationKeys` declares, once each, runtime reference names such as `messageId` or `runId` that are the application's own data inside its JSON — `sourceIdentity: 'refuse'` (default) refuses a value naming the source, `'retain'` carries a value naming the source conversation, a run or a message byte for byte as a record of the past |
|
|
37
|
+
| `BranchAgentConversationInputSchema` / `BranchAgentConversationInput` | schema / _type_ | strict branch request: stable request key, empty destination, settled conversation boundary or archive bytes, fresh artifact authorization, and `applicationFiles` — `{ reference, destinationReference }` pairs for file parts the application stores; an undeclared non-spill file reference refuses the branch. Spills validly retired by `spill/deleted` cross as deterministic rekeyed history (emitting an inert `runtime/branch-observation` across `throughRunId` cutoffs) while missing or inconsistent spills refuse with `integrity`. `applicationKeys` declares, once each, runtime reference names such as `messageId` or `runId` that are the application's own data inside its JSON — `sourceIdentity: 'refuse'` (default) refuses a value naming the source, `'retain'` carries a value naming the source conversation, a run or a message byte for byte as a record of the past, and `'rekey-spill'` rekeys source spill references (live or legitimately expired) while still refusing foreign spills and all other source identities (→ ADR 0300, ADR 0328) |
|
|
38
38
|
| `AgentConversationBranchRefusedError` / `AgentBranchRefusalSchema` / `AgentBranchRefusal` / `AgentBranchRefusalCodeSchema` / `AgentBranchRefusalCode` | class / schemas / _types_ | a branch refusal: a `TypeError` whose `refusals` lists every refusal a declaration or authorization lifts (up to 100, `omittedRefusals` counts the rest), each with `code` and its address — event `seq`, `eventKind`, `messageId`, `toolName`, key `path`, attachment `reference` — never a value; `integrity` stops at once |
|
|
39
39
|
| `AgentConversationBranchPlanSchema` / `AgentConversationBranchPlan` / `AgentRuntimeStore.planConversationBranch` | schema / _type_ / method | what `branchConversation` would refuse for the same input, without writing: `ready`, `refusals`, `omittedRefusals`, `applicationFiles` (every non-spill attachment reference to grant and declare), `undeclaredKeys`, `fingerprint`, `sourceArchiveDigest` |
|
|
40
40
|
| `AgentConversationBranchReceiptSchema` / `AgentConversationBranchReceipt` | schema / _type_ | durable lineage: request fingerprint, source/destination identities, source sequence/version/digest and creation time |
|
|
@@ -119,18 +119,18 @@ Server-only optional application runtime. See the
|
|
|
119
119
|
| `agentSummaryProjection` / `agentUsageProjection` / `agentOutlineProjection` | constants | built-in list summary, provenance-carrying usage and request outline projections |
|
|
120
120
|
| `agentConversationCardProjection` / `agentStateSlotsProjection` / `agentScheduleSummaryProjection` | constants | focused card, durable-state and schedule lifecycle projections |
|
|
121
121
|
| `defineStateSlot` / `AgentStateSlotDefinition` / `AgentStateSlotStore` / `AgentStateSlotValue` / `AnyAgentStateSlot` / `createAgentStateSlotStore` / `renderAgentStateSlots` | functions / _types_ | typed durable state written as ledger events and injected on every provider request |
|
|
122
|
-
| `agentGoalStateSlot` / `agentTodoStateSlot` / `createAgentStateTools` / `AgentStateToolsConfig` | constants / function / _type_ | built-in goal/todo state
|
|
122
|
+
| `agentGoalStateSlot` / `agentTodoStateSlot` / `createAgentStateTools` / `AgentStateToolsConfig` / `AGENT_STATE_TOOL_DESCRIPTORS` | constants / function / _type_ | built-in goal/todo state, `goal_*` / `todo_write` Agent tools bound to the conversation of the run context `tools()` receives, and their deeply frozen non-executable static catalog descriptors |
|
|
123
123
|
| `AgentProcessSandbox` | _type_ | host-provided process sandbox handle accepted by agent coding tools (probe helpers and grade/restriction schemas live in `stitchkit/agent-runtime/sandbox`) |
|
|
124
124
|
| `AgentSandboxProcess` / `AgentSandboxOutputStream` | _types_ | structural child/output interface for optional lifecycle-owned `AgentProcessSandbox.spawn`, without Node ambient type dependencies |
|
|
125
|
-
| `AgentEventSearchResultSchema` / `AgentEventSearchResult` / `createAgentEventSearch` / `createAgentEventSearchTools` / `AgentEventSearchToolsConfig` | schema / _types_ / functions | authorized event search (SQLite FTS5 or Postgres `tsvector`, ADR 0315) with exact event addresses
|
|
125
|
+
| `AgentEventSearchResultSchema` / `AgentEventSearchResult` / `createAgentEventSearch` / `createAgentEventSearchTools` / `AgentEventSearchToolsConfig` / `AGENT_EVENT_SEARCH_TOOL_DESCRIPTORS` | schema / _types_ / functions / constant | authorized event search (SQLite FTS5 or Postgres `tsvector`, ADR 0315) with exact event addresses, `session_*` tools for the conversation of the run context `tools()` receives, and their deeply frozen non-executable static catalog descriptors |
|
|
126
126
|
| `PostgresAgentEventSearchConfig` | _type_ | the Postgres index's options for `createAgentEventSearch({ postgres })` — `diacritics` (`preserve` / `unaccent`), `maxIndexedChars`, `maxSyncEvents` |
|
|
127
127
|
| `createAgentSpillStore` | function | durable content-address-checked artifact storage, bounded read/search, retention facts and archive participation |
|
|
128
|
-
| `AgentScheduleSchema` / `AgentSchedule` / `AgentScheduleService` / `AgentScheduleDeliveryOutcomeSchema` / `AgentScheduleDeliveryOutcome` / `createAgentScheduleService` / `AgentScheduleServiceConfig` / `createAgentScheduleTools` / `AgentScheduleToolsConfig` | schemas / _types_ / functions | durable `at`/`after`/timezone-explicit `every` schedules over the store's `AgentCompanionHost`, required `maxActivePerConversation` and `minIntervalMs`, indexed retry eligibility, typed retry/terminal failure (any other returned value delivers), `maxAttempts` (default 1000) per occurrence — a one-off ends `failed`, a recurring schedule skips to its next slot — bounded dispatch and fenced stable occurrence identity (ADR 0202); the tools are bound to the conversation of the run context `tools()` receives |
|
|
128
|
+
| `AgentScheduleSchema` / `AgentSchedule` / `AgentScheduleService` / `AgentScheduleDeliveryOutcomeSchema` / `AgentScheduleDeliveryOutcome` / `createAgentScheduleService` / `AgentScheduleServiceConfig` / `createAgentScheduleTools` / `AgentScheduleToolsConfig` / `AGENT_SCHEDULE_TOOL_DESCRIPTORS` | schemas / _types_ / functions / constant | durable `at`/`after`/timezone-explicit `every` schedules over the store's `AgentCompanionHost`, required `maxActivePerConversation` and `minIntervalMs`, indexed retry eligibility, typed retry/terminal failure (any other returned value delivers), `maxAttempts` (default 1000) per occurrence — a one-off ends `failed`, a recurring schedule skips to its next slot — bounded dispatch and fenced stable occurrence identity (ADR 0202); the tools are bound to the conversation of the run context `tools()` receives, with deeply frozen non-executable static catalog descriptors |
|
|
129
129
|
| `AgentChildBudgetSchema` / `AgentChildBudget` / `AgentChildStateSchema` / `AgentChildState` / `AgentChildRecordSchema` / `AgentChildRecord` | schema / _type_ | durable child graph, bounded seed and measured budget state |
|
|
130
130
|
| `AgentChildBlockingKindSchema` / `AgentChildBlockingKind` / `AgentChildBlockingSourceSchema` / `AgentChildBlockingSource` / `AgentChildBlockingEventSchema` / `AgentChildBlockingEvent` / `AgentChildBlockingDecision` | schemas / _types_ | parent-owned request identities; responses discriminate approval decisions from JSON input values |
|
|
131
|
-
| `AgentChildHandle` / `AgentChildManager` / `AgentChildManagerConfig` / `AgentChildRemainingBudget` / `createAgentChildManager` / `createAgentChildTools` / `AgentChildToolsConfig` / `agentChildBudgetStopPolicy` | _types_ / functions | host execution port, child lifecycle with required `remainingBudget` and `maxActiveChildren`, cascade (given to `createAgentRuntime` as `children`), messaging, Agent tools bound to the parent conversation of the run context `tools()` receives, and the child runtime's own budget stop policy — `recordStepUsage` at every step boundary, `policy_stop` as `child-budget` when spent |
|
|
131
|
+
| `AgentChildHandle` / `AgentChildManager` / `AgentChildManagerConfig` / `AgentChildRemainingBudget` / `createAgentChildManager` / `createAgentChildTools` / `AgentChildToolsConfig` / `AGENT_CHILD_TOOL_DESCRIPTORS` / `agentChildBudgetStopPolicy` | _types_ / functions / constant | host execution port, child lifecycle with required `remainingBudget` and `maxActiveChildren`, cascade (given to `createAgentRuntime` as `children`), messaging, Agent tools bound to the parent conversation of the run context `tools()` receives (plus their deeply frozen static catalog descriptors), and the child runtime's own budget stop policy — `recordStepUsage` at every step boundary, `policy_stop` as `child-budget` when spent |
|
|
132
132
|
| `AgentCompanionHost` / `AgentCompanionScope` / `AgentSqlSession` / `AgentSqlTables` / `AgentSqlValue` | _types_ | the store's companion host — one store transaction with the purge check and the event append (`transaction(conversationId, work)`), a read transaction (`read(work)`), the companion tables — given by the SQLite and Postgres stores and taken by every companion |
|
|
133
|
-
| `AgentToolDefinition` |
|
|
133
|
+
| `AgentToolDefinition` / `AgentToolDescriptor` | _types_ | peer-neutral executable shape returned by the bound agent-only tool factories and its non-executable static catalog descriptor shape (assignable to `SurfaceRuntimeToolDefinition` without an active run) |
|
|
134
134
|
| `AgentProviderStreamCutError` | class | explicit retryable provider stream truncation evidence |
|
|
135
135
|
|
|
136
136
|
### Complete runtime inventory
|
|
@@ -303,14 +303,26 @@ or framework instructions; repeated keys return the existing invocation ID. It
|
|
|
303
303
|
resolves `{ invocationId, outcome, text?, receiptError? }`: `receiptError` says a
|
|
304
304
|
receipt could not be written and never changes `outcome` or drops `text`.
|
|
305
305
|
`read(input, context)` returns a bounded event page shared by agent and completion;
|
|
306
|
-
`readPayload(input, context)` requires a separate authorization action
|
|
307
|
-
|
|
306
|
+
`readPayload(input, context)` requires a separate authorization action and returns a
|
|
307
|
+
discriminated `ModelInvocationPayloadRead` (`available` with decrypted payload or `expired`
|
|
308
|
+
with `expiredAt` once redacted); `purgePayloads(input, context)` redacts expired ciphertext
|
|
309
|
+
in-place across the store and search indexes while retaining receipt metadata and digests.
|
|
310
|
+
When a request or response payload exceeds `maxPayloadBytes`, the provider call still succeeds
|
|
311
|
+
while recording `payloadOmitted: 'max-payload-bytes'` (with `artifactId` omitted and `payloadSha256`
|
|
312
|
+
preserved) and reporting `InvocationPayloadTooLargeError` through `complete().receiptError`. See the
|
|
313
|
+
[guide and migration example](../guide/agent-runtime.md#plain-completions-and-shared-invocation-receipts).
|
|
308
314
|
|
|
309
315
|
| Export | Kind | Purpose |
|
|
310
316
|
| --- | --- | --- |
|
|
311
317
|
| `CompletionInvocationInputSchema` / `CompletionInvocationInput` | schema/type | strict prompt, model-attempt list, deadline, idempotency key and trace input |
|
|
312
318
|
| `ModelInvocationTraceSchema` / `ModelInvocationTrace` | schema/type | operation, purpose, project, parent trace and optional experiment/case/profile |
|
|
313
|
-
| `ModelInvocationRecordSchema` / `ModelInvocationRecord` | schema/type | discriminated invocation start/finish and per-attempt requested/sent/effective evidence |
|
|
319
|
+
| `ModelInvocationRecordSchema` / `ModelInvocationRecord` | schema/type | discriminated invocation start/finish and per-attempt requested/sent/effective evidence (with optional `artifactId` and `payloadOmitted` when oversized, keeping `payloadSha256`) |
|
|
320
|
+
| `InvocationPayloadTooLargeError` | class | `RangeError` carrying `{ bytes, maxBytes, sha256 }` when a recorded invocation payload exceeds `maxPayloadBytes` without aborting the provider call |
|
|
321
|
+
| `InvocationPayloadOmissionReasonSchema` / `InvocationPayloadOmissionReason` | schema/type | reason a payload body was not stored (`'max-payload-bytes'`) |
|
|
322
|
+
| `ModelInvocationPayloadReadSchema` / `ModelInvocationPayloadRead` | schema/type | discriminated result of `readPayload`: `{ status: 'available', payload, ... }` or `{ status: 'expired', expiredAt, ... }` |
|
|
323
|
+
| `PurgeInvocationPayloadsInputSchema` / `PurgeInvocationPayloadsInput` | schema/type | input for `purgePayloads` / `store.purgeExpiredPayloads`: `before`, optional `conversationId` and `limit` |
|
|
324
|
+
| `PurgeInvocationPayloadsResultSchema` / `PurgeInvocationPayloadsResult` | schema/type | result of `purgePayloads`: `purged`, `freedBytes`, and `hasMore` |
|
|
325
|
+
| `ModelInvocationAuthorizationInput` | type | discriminated authorization payload passed to `ModelInvocationConfig.authorize` (`'complete'`, `'agent'`, `'read'`, `'read-payload'`, or `'purge-payloads'`) |
|
|
314
326
|
| `ModelInvocationAttemptContext` | type | conversation, operation, invocation, attempt, step and optional agent run identity |
|
|
315
327
|
| `currentModelInvocationAttempt` | function | returns causal IDs inside the provider transport; undefined outside an invocation |
|
|
316
328
|
| `modelInvocationSpendAttribution` | function | the current attempt as `stitchkit/spend` attribution fields (conversation, run, invocation, attempt, step) — a spend gateway's `context` |
|
package/llms/cli.3.txt
CHANGED
|
@@ -24,9 +24,9 @@ SDK nor the `ai` peer.
|
|
|
24
24
|
| `defineCliCommand` | function | define one Zod-typed CLI-only executable command with optional validated-result presentation/exit policy |
|
|
25
25
|
| `defineCliResult` | function | type a managed command's `present` / `exitCode` policy against its output schema, for `CliConfig.results` — [guide](../guide/cli.md#the-same-policy-for-a-managed-command) |
|
|
26
26
|
| `parseCliArgs` | function | argv → typed tool args against a schema, in the grammar `createCli` reads a command with (`--bool=maybe` on a pure boolean is a `CliArgumentError`; a line asking for help or `--schema` is answered before arguments it cannot read, with empty `toolArgs`); inline `--field:=JSON` assigns a whole JSON value, including null, while ordinary string flags remain lexical; optional `separatedBefore` marks token boundaries left by stripped options so surrounding tokens are never glued; named array options together with bare positionals require an explicit `positionals` policy (advanced) |
|
|
27
|
-
| `scanCliInvocation` | function | single-pass CLI invocation scanner returning framework flags, application globals, selected command, command tokens
|
|
27
|
+
| `scanCliInvocation` | function | single-pass CLI invocation scanner returning framework flags, application globals, selected command, command tokens, top-level help/version state, and an optional `error?: CliArgumentError` field on malformed flag syntax (returning `command: undefined` and `commandTokens: []` instead of throwing) — [guide](../guide/cli.md#global-flags), [ADR 0327](../decisions/0327-cli-option-projections-return-errors-as-fields.md) |
|
|
28
28
|
| `routeCliArgv` | function | select the command using the framework's option grammar before catalogue discovery (thin projection over `scanCliInvocation`); takes `{ defaultCommand?, separatedBefore? }` and carries `separatedBefore` onto `commandArgv`; a line `createCli` refuses before a command runs (`--` before the command, `--json=maybe`, a repeated framework option) comes back with `error` and an empty `commandArgv`, unless help, `--version` or `--schema` answers it — [guide](../guide/cli.md#global-flags) |
|
|
29
|
-
| `extractCliGlobalOptions` | function | lift the application's own global options out of argv before routing (thin projection over `scanCliInvocation`);
|
|
29
|
+
| `extractCliGlobalOptions` | function | lift the application's own global options out of argv before routing (thin projection over `scanCliInvocation`); never throws on malformed flag syntax — returns `{ argv: [], globals, error }` when a global or framework flag is malformed or breaks a boolean boundary (non-framework option boundaries return in `separatedBefore`) — [ADR 0327](../decisions/0327-cli-option-projections-return-errors-as-fields.md) |
|
|
30
30
|
| `coerceJsonArgs` | function | the second half of `parseCliArgs` — parse array/object values a consumer sends itself, including discovered MCP object guards restored from JSON Schema, without the `stitchkit/tools` barrel |
|
|
31
31
|
| `CliArgumentError` | class | the refusal `parseCliArgs` and the view flags raise; a CLI reports it and exits `2` |
|
|
32
32
|
| `renderCliView` | function | compute an aggregate over a result (`--count-by`, `--sum`, `--top`, `--table`) — [guide](../guide/cli.md#aggregate-views) |
|
|
@@ -54,10 +54,10 @@ SDK nor the `ai` peer.
|
|
|
54
54
|
| `CliProfileStore` / `CliProfileStoreConfig` / `ResolvedCliProfile` | _type_ | the profile store, its directory/schema/hint config, and one resolution |
|
|
55
55
|
| `CliResultView` | _type_ | the requested view — `count`, `sum`, or `records` (ordered and/or table-rendered) |
|
|
56
56
|
| `CliViewOutput` | _type_ | a JSON value, or the one human-facing text shape |
|
|
57
|
-
| `CliGlobalOptionsParse` | _type_ | `{ argv, globals, separatedBefore? }` returned by `extractCliGlobalOptions` (`separatedBefore` present when a lifted global separated an option from a value-shaped token; a `--` before the command stays in `argv`) |
|
|
57
|
+
| `CliGlobalOptionsParse` | _type_ | `{ argv, globals, separatedBefore?, error? }` returned by `extractCliGlobalOptions` (`error` holds any `CliArgumentError` with `argv: []`; `separatedBefore` is present when a lifted global separated an option from a value-shaped token; a `--` before the command stays in `argv`) |
|
|
58
58
|
| `CliArgvRoute` | _type_ | `{ command, commandArgv, topLevelHelp, version, error?, separatedBefore? }` returned by `routeCliArgv` (`separatedBefore` indexes `commandArgv`, for `parseCliArgs`) |
|
|
59
59
|
| `CliRouteOptions` | _type_ | `{ defaultCommand?, separatedBefore? }` accepted by `routeCliArgv`; `separatedBefore` is the set `extractCliGlobalOptions` returned |
|
|
60
|
-
| `CliInvocationScanOptions` / `CliInvocationScan` / `CliFrameworkOptions` | _types_ | options (`appGlobals`, `defaultCommand`), full scan output (`framework`, `globals`, `command`, `commandTokens`, `separatedBefore`, `topLevelHelp`, `helpFilter`, `version`), and parsed framework flags returned by `scanCliInvocation` |
|
|
60
|
+
| `CliInvocationScanOptions` / `CliInvocationScan` / `CliFrameworkOptions` | _types_ | options (`appGlobals`, `defaultCommand`), full scan output (`framework`, `globals`, `command`, `commandTokens`, `separatedBefore`, `topLevelHelp`, `helpFilter`, `version`, `error?`), and parsed framework flags returned by `scanCliInvocation` |
|
|
61
61
|
| `pollUntilDone` | function | the generic `--wait` poller (advanced) |
|
|
62
62
|
| `emitResult` | function | write a pretty or compact `ToolResult` record to stdout/stderr + exit code (advanced) |
|
|
63
63
|
| `cliExitCode` | function | the exit code a result earns, from the same table, without writing anything — so an in-process run and the printed path cannot disagree |
|
package/llms/cli.txt
CHANGED
|
@@ -623,6 +623,7 @@ import { CliArgumentError, extractCliGlobalOptions, parseCliArgs, routeCliArgv }
|
|
|
623
623
|
|
|
624
624
|
try {
|
|
625
625
|
const lifted = extractCliGlobalOptions(argv, GlobalsSchema)
|
|
626
|
+
if (lifted.error !== undefined) return refuse(lifted.error.message) // exit 2, nothing ran
|
|
626
627
|
const route = routeCliArgv(lifted.argv, { separatedBefore: lifted.separatedBefore })
|
|
627
628
|
if (route.error !== undefined) return refuse(route.error) // exit 2, nothing ran
|
|
628
629
|
if (route.command === undefined || route.topLevelHelp) return showHelp()
|
package/llms/declaration.txt
CHANGED
|
@@ -157,7 +157,7 @@ invisible: it succeeds on the machine that happens to have the database.
|
|
|
157
157
|
| --- | --- |
|
|
158
158
|
| `schemaVersion` | which format this is; checked before anything else |
|
|
159
159
|
| `kind` | `application` or `library` |
|
|
160
|
-
| `identity` | `slug`, `name`, `
|
|
160
|
+
| `identity` | `slug`, `name`, `description` per locale (the project's own version lives solely in the root `package.json`) |
|
|
161
161
|
| `roles` | each with its own working directory, per-mode argv commands, optional listener and `drainFloorMs` |
|
|
162
162
|
| `build` | the build command and the artifact paths it produces |
|
|
163
163
|
| `requires` | what the code needs and does not provide, per phase (`release`, `start`) |
|
|
@@ -248,7 +248,7 @@ is how a partially understood declaration becomes a running, wrong deployment.
|
|
|
248
248
|
| `PROJECT_DECLARATION_SCHEMA_VERSION` | constant | the declaration format this build understands — the number a reader refuses on |
|
|
249
249
|
| `namesAMachine` | function | why a string names a particular machine, or `undefined` — the one predicate every free string is checked against |
|
|
250
250
|
| `findProjectRole` | function | the role with a given name, or `undefined` |
|
|
251
|
-
| `ProjectIdentitySchema` / `ProjectIdentity` | schema / _type_ | `slug`, `name
|
|
251
|
+
| `ProjectIdentitySchema` / `ProjectIdentity` | schema / _type_ | `slug`, `name` and a per-locale `description` (version lives solely in the root `package.json`) |
|
|
252
252
|
| `ProjectRoleSchema` / `ProjectRole` | schema / _type_ | one runnable role: a `workingDirectory` inside the source, per-mode `commands`, an optional `listener`, and `drainFloorMs` |
|
|
253
253
|
| `ProjectCommandSchema` / `ProjectCommand` | schema / _type_ | `executable` plus `args` — argv, never a shell string |
|
|
254
254
|
| `ProjectRoleCommandSchema` / `ProjectRoleCommand` | schema / _type_ | a command run under a supervisor: additionally never a script runner, because a launcher duplicates the shutdown signal |
|
package/llms/files.txt
CHANGED
|
@@ -56,4 +56,4 @@ available from `stitchkit/contract`.
|
|
|
56
56
|
| `parseJsonBytes` / `readJsonFileSync` / `JsonValueSchema` | function / _type_ | strict fatal UTF-8 JSON parsing that refuses a `__proto__` key rather than dropping it, and schema validation (Zod and `{ safeParse }` compatible); every failure is a `RegularFileError` with reason `encoding`, `syntax` or `schema` |
|
|
57
57
|
| `readJsonOnce` / `JsonFileReading` / `PolledJsonFile` / `PolledJsonFiles` / `PolledJsonOptions` | function / _type_ / class / _type_ | classified JSON polling (`missing` / `unreadable` — the operating system or a file rule refused it, with the rule's `reason` / `invalid` — the bytes are not the value, with `reason` `encoding`, `syntax` or `schema` / `read`) with bounded LRU cache and `readChanged()` returning `null` when unchanged; `noFollow` and `accept` apply to every read from disk — a file whose identity is unchanged is answered from the cache, once a read found its last change at least 3 s old (a younger file is read and compared again, since a same-length rewrite in one tick of a coarse filesystem clock keeps size, mtime and ctime) — and with `noFollow` that shortcut uses `lstat`, so a symbolic link to the cached inode is refused too; a schema that throws is an `invalid` file |
|
|
58
58
|
| `PolledJsonFiles.refresh(entries)` / `PolledJsonFiles.refreshAsync(entries, { signal })` / `PolledJsonEntry` / `PolledJsonChange` / `MAX_POLLED_JSON_PATHS` | method / method / _type_ / _type_ / const | make the `{ path, options }` entries the tracked set and get its changes in their order: `changed` with the new reading for a new path or a new state, `removed` for a path that left the set. A path's own `options` replace the set's field by field (a set of explicit files that follow links and drop-ins read with `noFollow` and `accept`), and new options read the file again; a path listed twice is a `TypeError`. `refreshAsync` stats and reads asynchronously, commits nothing when aborted, and refuses every other call on the set while it runs. A declaration goes away either way: its path left the set (`removed`), or its file did (`changed` to `missing`). Tracking more than `MAX_POLLED_JSON_PATHS` (1024) throws `RangeError` — from `refresh`, `read` and `readChanged` alike — instead of evicting, since an evicted path would come back as a false change |
|
|
59
|
-
| `waitForDirectory` / `WaitForDirectoryOptions` | function / _type_ | resolves once a path
|
|
59
|
+
| `waitForDirectory` / `WaitForDirectoryOptions` | function / _type_ | resolves once a path satisfies `match` (`'directory'`, the default, waits for a directory; `'entry'` resolves as soon as any entry — regular file, broken or cyclic symlink, FIFO, or directory — exists at the target path while still refusing intermediate non-directory components), without a polling timer: `fs.watch` on the nearest existing ancestor, moving down as components appear and back up if the watched directory is removed; each watch start is followed by one immediate and one deferred rescan (`settleMs`, default 250) for an entry created before the watch saw it, and each event re-arms the watch, so a path removed and made again at once is followed; under `match: 'directory'`, a symbolic link at the path counts once it resolves to a directory; `signal` rejects with its reason and closes every watcher; `keepAlive: false` unreferences the watcher and the deferred rescan, so the wait does not hold the process |
|
package/llms/node.txt
CHANGED
|
@@ -28,7 +28,7 @@ runtime-agnostic pieces of `stitchkit/server` and the error helpers.
|
|
|
28
28
|
| `createHandler` | function | the router as a bare `(req) => Response` (same as `/server`) |
|
|
29
29
|
| `createLocalHostGuard` / `LocalHostGuard` / `LocalHostGuardConfig` / `LocalHostRefusal` | function / _types_ | the local-host guard for `serveNode` (same as `/server`) |
|
|
30
30
|
| `createSocketIOServer` | function | the typed Node Socket.IO server (`io` + `attach`; no Bun engine declarations) |
|
|
31
|
-
| `createUnixClientTransport` | function | the same fail-closed Bun/Node Unix client adapter exported by `stitchkit/server` |
|
|
31
|
+
| `createUnixClientTransport` | function | the same fail-closed Bun/Node Unix client adapter exported by `stitchkit/server` (including optional `expectedOwnerUid`) |
|
|
32
32
|
| `implement` / `createImplement` / `createScopedImplement` / `createScopedImplementRegistry` / `createMultipartStream` | function | bind a contract to typed handlers, optionally typed per endpoint scope (same as `/server`) |
|
|
33
33
|
| `NodeServerConfig` | _type_ | config for `serveNode` |
|
|
34
34
|
| `NodeServerHandle` | _type_ | managed Node handle (`url`, `port`, `runtime`, `status`, `shutdown`) |
|
|
@@ -36,7 +36,7 @@ runtime-agnostic pieces of `stitchkit/server` and the error helpers.
|
|
|
36
36
|
| `NodeSocketLifecycle` | _type_ | Bun-free Socket.IO lifecycle accepted by `serveNode` |
|
|
37
37
|
| `HandlerConfig` / `ServiceDef` / `RawRoute` / `RawRouteContext` | _type_ | runtime-neutral handler types; raw routes default their host server to `unknown` and may declare stable `serviceName` / `action` observability identity |
|
|
38
38
|
| `SocketIORequestPolicy` / `SocketIOServerConfig` / `SocketIOPeerLoaders` / `SocketIOServerHandle` | _type_ | runtime-neutral handshake policy, config, optional-peer loaders and the Bun-free Node handle with `io`, `attach` and lifecycle |
|
|
39
|
-
| `UnixClientTransportConfig` / `UnixClientTransport` | _type_ | Unix socket bounds, explicit response-body mode and owned Fetch-compatible handle |
|
|
39
|
+
| `UnixClientTransportConfig` / `UnixClientTransport` | _type_ | Unix socket bounds, optional `expectedOwnerUid`, explicit response-body mode and owned Fetch-compatible handle |
|
|
40
40
|
| `UnixResponseBodyMode` | _type_ | finite cumulative `bounded` mode or explicit pull-driven `streaming` mode |
|
|
41
41
|
| `UnixClientTransportError` / `UnixClientTransportErrorCode` / `UnixClientDeliveryState` | class / _type_ | stable failure plus dispatch certainty; no cross-transport fallback |
|
|
42
42
|
| `AppError` + `badRequest` / `unauthorized` / `forbidden` / `notFound` / `conflict` / `rateLimited` | — | error helpers (same as `/contract`) |
|
package/llms/server.5.txt
CHANGED
|
@@ -227,8 +227,8 @@ Also re-exports the error helpers from `stitchkit/contract`.
|
|
|
227
227
|
| `StreamingRouteOptions` | _type_ | options for `streamingRoute` / `ndjsonRoute` / `sseRoute` |
|
|
228
228
|
| `StreamingSourceContext` | _type_ | what a streaming source is given, including the cancellation `signal` |
|
|
229
229
|
| `StreamingFormat` | _type_ | `'ndjson' \| 'sse'` |
|
|
230
|
-
| `createUnixClientTransport` | function | owned Fetch-compatible Unix-socket transport on Bun and Node;
|
|
231
|
-
| `UnixClientTransportConfig` | _type_ | absolute socket path
|
|
230
|
+
| `createUnixClientTransport` | function | owned Fetch-compatible Unix-socket transport on Bun and Node; enforces parent-directory, symlink, non-group/world-writable, and owner-UID (`expectedOwnerUid`, defaulting to current EUID) checks on every dispatch and redirect — [guide](../guide/client.md#unix-domain-sockets) |
|
|
231
|
+
| `UnixClientTransportConfig` | _type_ | absolute socket path, optional `expectedOwnerUid` for cross-UID group-accessible local daemons, request/header/connection/redirect bounds, and an explicit bounded-or-streaming response policy |
|
|
232
232
|
| `UnixClientTransport` | _type_ | `{ fetch, closed, close() }`; `close()` settles owned active work |
|
|
233
233
|
| `UnixResponseBodyMode` | _type_ | `bounded \| streaming`; bounded is the 16 MiB cumulative default, streaming keeps pull-driven buffering without a lifetime total |
|
|
234
234
|
| `UnixClientTransportError` | class | stable transport failure with `code` and dispatch certainty in `delivery` |
|
package/llms/service-host.txt
CHANGED
|
@@ -29,13 +29,13 @@ Peer-free server-only host supervision primitives built on `stitchkit/files` and
|
|
|
29
29
|
|
|
30
30
|
| Export | Kind | Summary |
|
|
31
31
|
|--------|------|---------|
|
|
32
|
-
| `renderSystemdServiceUnit` | function | render strictly escaped `.service`
|
|
33
|
-
| `checkSystemdUnit` / `systemdUnitActive` / `systemdMainPid` | function | inspect unit
|
|
34
|
-
| `installAndStartSystemdUnit` / `reloadSystemdUnit` | function | apply, enable and reload units with stability-window MainPID monitoring
|
|
32
|
+
| `renderSystemdServiceUnit` / `renderSystemdTimerUnit` | function | render strictly escaped `.service` (including `StartLimitIntervalSec`, `SuccessExitStatus`, `TimeoutStartSec`, `DynamicUser`, `Nice`, `IOSchedulingClass`, sandboxing directives and `BindReadOnlyPaths`) and `.timer` units (`%`, `$`, `\`, `"`, injection rejection, explicit `allowHomeSpecifier`) |
|
|
33
|
+
| `checkSystemdUnit` / `checkSystemdTimerPair` / `systemdUnitActive` / `systemdMainPid` | function | inspect unit or `.service` + `.timer` pair digests, `systemctl show` state, active/enabled status, MainPID and foreign `<unit>.d/*.conf` drop-ins across `UnitPath` even when `LoadState=not-found`; `missing` only when nothing else answers for the name — a vendor, transient or generated unit loaded with no file at `unitPath` is `fragment-mismatch`; `FragmentPath` is compared with `unitPath` after resolving links in their directories (`fragmentIsUnitPath`), so a unit under a linked directory is ours |
|
|
34
|
+
| `installAndStartSystemdUnit` / `reloadSystemdUnit` / `installSystemdTimerPair` | function | apply, enable and reload `.service` units (with stability-window MainPID monitoring) or `.service` + `.timer` pairs (enabling/starting only the `.timer`, never starting the companion `.service`) with automatic rollback (refused with `FOREIGN_FRAGMENT` before any write when systemd loads a unit from elsewhere; `rolledBack: true` only when every rollback step succeeded, enablement included; a relative or unnormalised unit path is `INVALID_CONFIG`) |
|
|
35
35
|
| `createDefaultSystemdHostAdapter` | function | default Linux adapter backed by `runNativeCommand`, `readRegularFile` and `writeFileAtomic`; runs `/usr/bin/systemctl` with a declared environment (`PATH=/usr/sbin:/usr/bin:/sbin:/bin`, `HOME`, `XDG_RUNTIME_DIR`, `DBUS_SESSION_BUS_ADDRESS`) |
|
|
36
|
-
| `SystemdScopeSchema` / `SystemdScope` / `SystemdServiceUnitConfigSchema` / `SystemdServiceUnitConfig` | schema / _type_ | strict Zod v4 schemas and types for `system`/`user` `.service` configuration |
|
|
36
|
+
| `SystemdScopeSchema` / `SystemdScope` / `SystemdServiceUnitConfigSchema` / `SystemdServiceUnitConfig` / `SystemdBindReadOnlyPath` / `SystemdTimerUnitConfigSchema` / `SystemdTimerUnitConfig` | schema / _type_ | strict Zod v4 schemas and types for `system`/`user` `.service` and `.timer` configuration and `BindReadOnlyPaths=` entries |
|
|
37
37
|
| `SystemdUnitError` / `SystemdUnitErrorCode` | class / _type_ | typed systemd inspection/apply/rollback error |
|
|
38
|
-
| `SystemdCommandResult` / `SystemdHostAdapter` / `CheckSystemdUnitOptions` / `SystemdUnitCheckStatus` / `SystemdUnitCheckResult` / `SystemdUnitQueryOptions` / `ApplySystemdUnitOptions` / `SystemdApplyResult` | _types_ | adapter, inspection, query and
|
|
38
|
+
| `SystemdCommandResult` / `SystemdHostAdapter` / `CheckSystemdUnitOptions` / `SystemdUnitCheckStatus` / `SystemdUnitCheckResult` / `SystemdUnitQueryOptions` / `ApplySystemdUnitOptions` / `SystemdApplyResult` / `CheckSystemdTimerPairOptions` / `SystemdTimerPairCheckResult` / `InstallSystemdTimerPairOptions` / `SystemdTimerPairInstallResult` | _types_ | adapter, inspection, query, apply and timer-pair contracts |
|
|
39
39
|
| `ServiceHostPathState` | _type_ | what `inspectPath` of a `SystemdHostAdapter` or `LaunchdHostAdapter` finds at a path by `lstat`: `missing`, `file` with its `mode`, `symlink` with its `target`, or `other`. An apply or reload refuses a link or a non-regular node at `unitPath`/`plistPath` with `FOREIGN_FRAGMENT` before any write, and a rollback restores the file's previous mode; `canonicalPath(path)` resolves the links in a path's directories (last component as given) for the comparison with the path a manager reports |
|
|
40
40
|
|
|
41
41
|
### macOS `launchd` supervision
|