@parcha/agentrun-serve 0.1.0-beta.29 → 0.1.0-beta.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. package/CHANGELOG.md +188 -0
  2. package/README.md +564 -97
  3. package/dist/adapters.d.ts +35 -6
  4. package/dist/adapters.js +152 -26
  5. package/dist/agents.d.ts +11 -5
  6. package/dist/agents.js +16 -10
  7. package/dist/app.js +80 -20
  8. package/dist/background.d.ts +28 -0
  9. package/dist/background.js +376 -0
  10. package/dist/box-egress.d.ts +98 -0
  11. package/dist/box-egress.js +259 -0
  12. package/dist/box-image.d.ts +1 -1
  13. package/dist/box-image.js +9 -7
  14. package/dist/box-relay-vm.d.ts +80 -0
  15. package/dist/box-relay-vm.js +389 -0
  16. package/dist/box-relay.d.ts +8 -5
  17. package/dist/box-relay.js +14 -9
  18. package/dist/boxes.d.ts +21 -3
  19. package/dist/boxes.js +14 -7
  20. package/dist/browser-cost.d.ts +41 -0
  21. package/dist/browser-cost.js +158 -0
  22. package/dist/cap.d.ts +129 -21
  23. package/dist/cap.js +338 -67
  24. package/dist/coding-tools.d.ts +7 -3
  25. package/dist/coding-tools.js +16 -10
  26. package/dist/console/THIRD-PARTY-NOTICES.txt +580 -0
  27. package/dist/console/assets/index-34jfpIbQ.js +481 -0
  28. package/dist/console/assets/index-DUHbWcIP.css +1 -0
  29. package/dist/console/index.html +2 -2
  30. package/dist/content-filter.d.ts +7 -0
  31. package/dist/content-filter.js +23 -0
  32. package/dist/decision-rows.d.ts +11 -3
  33. package/dist/decision-rows.js +18 -11
  34. package/dist/errors.d.ts +2 -0
  35. package/dist/errors.js +5 -2
  36. package/dist/files.d.ts +6 -1
  37. package/dist/files.js +7 -2
  38. package/dist/grade.d.ts +7 -10
  39. package/dist/grade.js +31 -51
  40. package/dist/graph-served.d.ts +23 -0
  41. package/dist/graph-served.js +75 -0
  42. package/dist/graph-view.d.ts +7 -5
  43. package/dist/graph-view.js +10 -3
  44. package/dist/harness-app.d.ts +4 -2
  45. package/dist/harness-app.js +101 -19
  46. package/dist/harness-opencode/adapter.d.ts +45 -0
  47. package/dist/harness-opencode/adapter.js +272 -0
  48. package/dist/harness-opencode/binary.d.ts +18 -0
  49. package/dist/harness-opencode/binary.js +87 -0
  50. package/dist/harness-opencode/config.d.ts +24 -0
  51. package/dist/harness-opencode/config.js +61 -0
  52. package/dist/harness-opencode/harness.d.ts +77 -0
  53. package/dist/harness-opencode/harness.js +620 -0
  54. package/dist/harness-opencode/host/mcp.d.ts +40 -0
  55. package/dist/harness-opencode/host/mcp.js +208 -0
  56. package/dist/harness-opencode/host/policy.d.ts +71 -0
  57. package/dist/harness-opencode/host/policy.js +419 -0
  58. package/dist/harness-opencode/host/server.d.ts +55 -0
  59. package/dist/harness-opencode/host/server.js +165 -0
  60. package/dist/harness-opencode/index.d.ts +9 -0
  61. package/dist/harness-opencode/index.js +6 -0
  62. package/dist/harness-opencode/verify.d.ts +32 -0
  63. package/dist/harness-opencode/verify.js +75 -0
  64. package/dist/harness-opencode/versions.d.ts +33 -0
  65. package/dist/harness-opencode/versions.js +64 -0
  66. package/dist/harness.d.ts +4 -1
  67. package/dist/harness.js +5 -2
  68. package/dist/host-tools.d.ts +12 -2
  69. package/dist/host-tools.js +26 -12
  70. package/dist/host.js +6 -2
  71. package/dist/hosted-search.js +5 -1
  72. package/dist/import.d.ts +2 -2
  73. package/dist/import.js +4 -3
  74. package/dist/key-check.d.ts +3 -2
  75. package/dist/key-check.js +7 -3
  76. package/dist/key-refusal.js +8 -4
  77. package/dist/learn/check.d.ts +10 -1
  78. package/dist/learn/check.js +19 -1
  79. package/dist/learn/grade.d.ts +3 -2
  80. package/dist/learn/grade.js +25 -13
  81. package/dist/learn/index.d.ts +2 -2
  82. package/dist/learn/index.js +2 -2
  83. package/dist/learn/notes.js +2 -1
  84. package/dist/learn/reflect.d.ts +2 -2
  85. package/dist/learn/reflect.js +51 -5
  86. package/dist/learn/secrets.js +28 -8
  87. package/dist/learn/skills.d.ts +17 -4
  88. package/dist/learn/skills.js +79 -6
  89. package/dist/learned-workflow.d.ts +59 -0
  90. package/dist/learned-workflow.js +191 -0
  91. package/dist/learning-run.d.ts +7 -5
  92. package/dist/learning-run.js +45 -23
  93. package/dist/learning-words.d.ts +6 -3
  94. package/dist/learning-words.js +8 -5
  95. package/dist/learning.d.ts +44 -3
  96. package/dist/learning.js +148 -3
  97. package/dist/mcp-servers.d.ts +7 -4
  98. package/dist/mcp-servers.js +5 -0
  99. package/dist/mcp.js +5 -5
  100. package/dist/model.d.ts +13 -11
  101. package/dist/model.js +11 -10
  102. package/dist/openapi/agentrun-v2.openapi.json +1 -0
  103. package/dist/openapi.js +358 -48
  104. package/dist/paid-calls.d.ts +5 -1
  105. package/dist/paid-calls.js +1 -1
  106. package/dist/pause.d.ts +2 -0
  107. package/dist/place.d.ts +27 -4
  108. package/dist/place.js +42 -10
  109. package/dist/propose.d.ts +2 -0
  110. package/dist/propose.js +38 -8
  111. package/dist/request-start.d.ts +12 -4
  112. package/dist/request-start.js +139 -15
  113. package/dist/run-box.d.ts +56 -4
  114. package/dist/run-box.js +173 -23
  115. package/dist/runnable.d.ts +5 -2
  116. package/dist/runnable.js +12 -4
  117. package/dist/runs.d.ts +258 -36
  118. package/dist/runs.js +830 -89
  119. package/dist/secrets.d.ts +12 -0
  120. package/dist/secrets.js +18 -0
  121. package/dist/server.d.ts +131 -35
  122. package/dist/server.js +467 -105
  123. package/dist/sign-ins.d.ts +99 -0
  124. package/dist/sign-ins.js +288 -0
  125. package/dist/skills.d.ts +16 -4
  126. package/dist/skills.js +35 -7
  127. package/dist/stats.d.ts +7 -2
  128. package/dist/stats.js +28 -7
  129. package/dist/tool-gate.d.ts +266 -0
  130. package/dist/tool-gate.js +554 -0
  131. package/dist/tool-keys.d.ts +46 -10
  132. package/dist/tool-keys.js +44 -2
  133. package/dist/tool-plane.d.ts +112 -27
  134. package/dist/tool-plane.js +205 -47
  135. package/dist/tools.d.ts +69 -14
  136. package/dist/tools.js +143 -24
  137. package/dist/trigger-secrets.d.ts +32 -0
  138. package/dist/trigger-secrets.js +143 -0
  139. package/dist/triggers.d.ts +439 -0
  140. package/dist/triggers.js +863 -0
  141. package/dist/turn-end.d.ts +3 -2
  142. package/dist/turn-end.js +3 -2
  143. package/dist/usage-lines.d.ts +26 -0
  144. package/dist/usage-lines.js +28 -0
  145. package/dist/validate.d.ts +2 -0
  146. package/dist/validate.js +11 -2
  147. package/dist/webhooks.d.ts +11 -4
  148. package/dist/webhooks.js +17 -1
  149. package/launcher/agentrun-serve +1 -1
  150. package/package.json +19 -13
  151. package/dist/console/assets/index-BN7oVcO4.js +0 -445
  152. package/dist/console/assets/index-By-jkqki.css +0 -1
@@ -0,0 +1,266 @@
1
+ import type { Context } from "@earendil-works/chord";
2
+ import { type Extension, type ToolRegistration, type Tx } from "@earendil-works/pi-durable";
3
+ import type { DurableRun } from "@parcha/pi-durable-disk";
4
+ import type { TurnOrigin } from "./learning-run.js";
5
+ /** What the gate does with a tool's calls. */
6
+ export declare const PERMISSIONS: readonly ["allow", "ask", "deny"];
7
+ export type Permission = (typeof PERMISSIONS)[number];
8
+ /** An MCP tool's gate name: `mcp:<server>/<tool>`. */
9
+ export declare const mcpToolName: (server: string, tool: string) => string;
10
+ /** Whether `name` is an MCP tool's gate name. */
11
+ export declare const isMcpTool: (name: string) => boolean;
12
+ /** A third-party catalog tool, by its name: monid's (`monid.<tool>`) or an MCP server's (`mcp:<server>/<tool>`). */
13
+ export declare const isCatalogTool: (name: string) => boolean;
14
+ /** The owner's defaults (11-01): a built-in kernel tool allow; a third-party catalog tool ask. */
15
+ export declare const defaultPermission: (name: string) => Permission;
16
+ /** The tools that run a command in the run's box (background.ts SHELL_TOOLS), each held to bash's setting: bash: deny
17
+ * refuses bash_background as it refuses bash, and none of them is a settings key of its own. */
18
+ export declare const SHELL_FAMILY: Readonly<Record<string, string>>;
19
+ /** The settings keys that may set `name`'s permission, most specific first: the tool's own name, then, for an MCP
20
+ * tool, its server's wildcard `mcp:<server>/*`. */
21
+ export declare function permissionKeys(name: string): string[];
22
+ /** The settings key a call named `name` on `harness` is held to: the one mapping from every name a call reaches the gate
23
+ * by. A settings key is itself (a table tool, `monid.<tool>`, `mcp:<server>/<tool>`); a CLI's own tool is the table's it
24
+ * is; an MCP alias, `mcp__<server>__<tool>` (claude-agent's host tools `mcp__hands__<wire name>`, mapped as their
25
+ * wire name) and on OpenCode `<server>_<tool>`, is `mcp:<server>/<tool>`; a catalog's wire name (`monid_run`) is its
26
+ * catalog name; the browser's registrations are `browser`. OpenCode's `<server>_<tool>` maps only for a server of
27
+ * `mcpServers` (the run's configured MCP servers), never by its shape, since a host tool's name has the same shape.
28
+ * Undefined: nothing maps it, and the gate asks. The key only: an MCP call enters the gate once, in the MCP gateway. */
29
+ export declare function settingsKeyOf(harness: string, name: string, mcpServers?: readonly string[]): string | undefined;
30
+ /** A layer of tool settings (the server's, PUT /v2/settings/tools, or an agent's own, definition.tool_settings) as the
31
+ * gate reads it: a permission by settings key. */
32
+ export type PermissionSettings = Readonly<Record<string, {
33
+ permission?: Permission;
34
+ } | undefined>>;
35
+ /** `name`'s permission in force and the layer it came from, most specific first: the agent's exact key, the agent's
36
+ * server wildcard, the server's exact key, the server's server wildcard, then the default. Rules over a call's
37
+ * arguments are not in V1. */
38
+ export declare function permissionFrom(name: string, server: PermissionSettings, agent?: PermissionSettings): {
39
+ permission: Permission;
40
+ from: "agent" | "server" | "default";
41
+ };
42
+ /** `name`'s permission in force (permissionFrom): the one rule every path reads, the gate's, the tool plane's and a
43
+ * workflow's call nodes'. */
44
+ export declare const permissionOf: (name: string, server: PermissionSettings, agent?: PermissionSettings) => Permission;
45
+ /** A call's answer as the model reads it: its text, and whether it failed. */
46
+ export type ToolAnswer = {
47
+ text: string;
48
+ isError: boolean;
49
+ };
50
+ /** An approval's price for the person who answers it: USD where the tool declares one (booked through the spend cap's
51
+ * paidCall), else "not metered" (an unpriced MCP call, the owner's ruling of 11-04). */
52
+ export type ApprovalPrice = number | "not metered";
53
+ /** One pending approval, as the run's view shows it (`pending`) and the console's approval card reads it. */
54
+ export type PendingApproval = {
55
+ kind: "approval";
56
+ /** The approval's id, the answer route's `{approval_id}`; the same for the same call after a crash. */
57
+ id: string;
58
+ tool: string;
59
+ call_id: string;
60
+ /** The call's arguments as text, at most ARGS_PREVIEW_BYTES. */
61
+ args_preview: string;
62
+ requested_at: string;
63
+ price?: ApprovalPrice;
64
+ };
65
+ /** The run's journal commit for the call, which makes the request durable before the gate answers, and who is told it
66
+ * parked, so its turn ends (harness-app.ts endsTurn): by the call's id, or, where the caller cannot name it, by its tool
67
+ * and its arguments' digest. */
68
+ export type Park = {
69
+ commit<T>(change: (tx: unknown) => Promise<T>): Promise<T>;
70
+ parked?(callId: string): void;
71
+ parkedBy?(match: {
72
+ tool: string;
73
+ argsDigest: string;
74
+ }): void; /** The message the turn running the call took (harness-app's), kept with its request. */
75
+ turn?(): string | undefined;
76
+ };
77
+ /** What a call's ask carries beyond the call. */
78
+ export type EnterOptions = {
79
+ /** What the approval card shows the call costs. */
80
+ price?: ApprovalPrice;
81
+ };
82
+ /** enter's answer. `undefined`: run the call. Otherwise the answer the model reads instead: a refusal
83
+ * (`isError: true`), or the waiting text with `parked: true`, after which the caller ends the turn. */
84
+ export type Entered = undefined | (ToolAnswer & {
85
+ parked?: true;
86
+ });
87
+ /** Runs an APPROVED parked call of a tool family the gate does not own (the MCP gateway's), exactly once. It owns the
88
+ * call's deadline: the gate puts no wall-clock bound on it (only a stop or a cancel cuts it, through `signal`), so an
89
+ * executor bounds its own work and answers a timeout as an error result (`isError: true`), never by waiting on. */
90
+ export type Executor = (tool: string, args: unknown, callId: string, signal: AbortSignal) => Promise<ToolAnswer>;
91
+ /** The gate of one run, in the run's process. */
92
+ export interface Gate {
93
+ /** One model-initiated call at the gate: allow, deny, or ask, which parks (see the header). */
94
+ enter(tool: string, args: unknown, callId: string, park: Park, options?: EnterOptions): Promise<Entered>;
95
+ /** Registers how an approved parked call of tools named `prefix…` (e.g. "mcp:") runs; one per prefix and run. */
96
+ executor(prefix: string, run: Executor): void;
97
+ /** A call's result text as the model gets it: as it is, a host tool's result already cut by HOST_RESULT_MAX_CHARS. */
98
+ spill(callId: string, text: string): string;
99
+ }
100
+ /** The refusal of a call whose tool is set to deny; of one held to another tool's setting (`heldTo`, a shell tool's
101
+ * bash), naming the setting to change. */
102
+ export declare const deniedText: (tool: string, heldTo?: string) => string;
103
+ /** The refusal of an ask where no one can approve it: a server with accounts off, whose answer route takes no token. */
104
+ export declare const noApproverText: (tool: string) => string;
105
+ /** Set by the server in a run's environment when no one can approve here (accounts off): the gate refuses each ask. */
106
+ export declare const NO_APPROVER_ENV = "AGENTRUN_SERVE_NO_APPROVER";
107
+ /** A parked call's answer: the run pauses here. */
108
+ export declare const waitingText: (tool: string) => string;
109
+ /** A call a person denied, with their reason when they gave one. */
110
+ export declare const refusedText: (tool: string, note?: string) => string;
111
+ /** The Timeline row of a call that waits for an approval. */
112
+ export declare const APPROVAL_ROW: "tool_approval_requested";
113
+ /** A call's arguments shown on its approval, at most this many bytes. */
114
+ export declare const ARGS_PREVIEW_BYTES = 2048;
115
+ /** A gate of `policy` (the run's permission of a tool now) with no run behind it: allow and deny are enforced and
116
+ * executors are kept; an ask throws, since nothing here can park a call (a run's is RunGate), and spill returns
117
+ * the text as it is. */
118
+ export declare function gateOf(policy: (tool: string) => Permission): Gate;
119
+ /** The file in a run's directory that names the origin of the turn it runs now: written by the server alone, as it sends
120
+ * the learning lane's reflect turn (runs.ts's toLiveDoor), and gone before a person's turn is sent (runs.ts's personsTurn).
121
+ * The gate refuses that turn's writes under work/.learning/ (NOTE_ONLY_TEXT). */
122
+ export declare const TURN_ORIGIN_FILE = "turn-origin.json";
123
+ /** The run's store's record of a call that waits for approval (`phase: "requested"`), and of its answer acted on
124
+ * (`phase: "resolved"`), on its root conversation. */
125
+ export declare const APPROVAL_ENTRY = "agentrun.tool_approval";
126
+ /** The refusal of the end-of-run turn's write or edit under work/.learning/: its notes are kept only from its answer's
127
+ * note blocks (learn/reflect.ts parseReflection), which the host merges in its own store; a file there is never kept. */
128
+ export declare const NOTE_ONLY_TEXT = "A note is kept only from your answer: write it in a ```note block, not to a file.";
129
+ /** Whether `args.path`, as a file tool resolves it (a leading `@` dropped, Unicode spaces made plain, then lexically),
130
+ * names work/.learning/ or a path under it: by this machine's `work` or the box's (BOX_WORK). */
131
+ export declare function underLearning(work: string, args: unknown): boolean;
132
+ /** One call that waits for approval, as the run's store keeps it. */
133
+ export type ApprovalRequest = {
134
+ id: string;
135
+ tool: string;
136
+ call_id: string;
137
+ args: unknown;
138
+ args_preview: string;
139
+ requested_at: string; /** The message the turn that parked it took: a reopen settles that turn, answered or not. */
140
+ turn?: string;
141
+ price?: ApprovalPrice;
142
+ };
143
+ /** Resumes the session with `content` as one message of its own (`approval-<id>`), writing `mark` with it or after it. */
144
+ export type Resume = (id: string, content: string, mark: (tx: Tx) => Promise<unknown>) => Promise<void>;
145
+ /** `text` cut to at most ARGS_PREVIEW_BYTES. What is shown of a call's arguments is the whole of them redacted first, then
146
+ * cut (runs.ts), so a cut never leaves the head of a key no redaction recognizes. */
147
+ export declare function previewOf(text: string): string;
148
+ /** `args` as JSON, at most ARGS_PREVIEW_BYTES: the request's own record of them, never shown as it is. */
149
+ export declare const argsPreview: (args: unknown) => string;
150
+ /** How the gate's resume message starts: the server knows its row by it, and redacts the row whole (runs.ts). */
151
+ export declare const RESUME_PREFIX = "[tool approval] ";
152
+ /** The one message that resumes a session once a person answered: it names the call it answers (its tool, call id and
153
+ * arguments), so the model tells it from a person's new input, and carries the call's result, or the refusal. */
154
+ export declare function resumeText(request: Pick<ApprovalRequest, "tool" | "call_id">, shown: string, decision: "allow" | "deny", result: ToolAnswer): string;
155
+ /** The gate of the run `runId` at `where` (its directory, under the data directory's runs/), on its pinned revision:
156
+ * an agentic run's parks an asked call; a workflow's model node cannot. */
157
+ export declare function runGate(where: {
158
+ root: string;
159
+ work: string;
160
+ }, runId: string, revision: {
161
+ kind: string;
162
+ body: {
163
+ toolSettings?: unknown;
164
+ harness?: string;
165
+ };
166
+ }): RunGate;
167
+ /** The gate in a run's process, park mode: its policy, the turn's origin, the calls that wait, and the answers acted on. */
168
+ export declare class RunGate {
169
+ private readonly where;
170
+ private readonly overrides;
171
+ private readonly parks;
172
+ private readonly approvers;
173
+ private readonly requests;
174
+ private durable?;
175
+ private context?;
176
+ private coding?;
177
+ /** The run's own tools beyond the table (its learned_workflow), on which an approved call of one runs. */
178
+ private extra;
179
+ private resume?;
180
+ private drive?;
181
+ private timer?;
182
+ private settling;
183
+ private readonly stop;
184
+ /** `where.data`: the server's data directory, its tool settings beside the store; `overrides`: the pinned revision's
185
+ * own; `parks`: whether an asked call parks the run (an agentic run's), which a workflow's model node cannot;
186
+ * `approvers`: whether anyone can answer an ask here (the owner's password session: accounts on). */
187
+ constructor(where: {
188
+ root: string;
189
+ work: string;
190
+ data: string;
191
+ runId: string;
192
+ harness?: string;
193
+ mcpServers?: readonly string[];
194
+ }, overrides?: PermissionSettings, parks?: boolean, approvers?: boolean);
195
+ /** A tool's permission now (permissionOf): the revision's own over the server's setting, read at each call, so a change
196
+ * reaches a live run at its next call. */
197
+ readonly policy: (tool: string) => Permission;
198
+ private lastGood?;
199
+ private readonly told;
200
+ /** The server's settings now: read at each call, so a change reaches a live run; a file that does not read keeps the
201
+ * last good (undefined: none read yet). Each problem is said once, by file and field, never a value. */
202
+ private serverSettings;
203
+ /** The origin of the turn running now: what the server's internal path wrote for it; none for a person's turn. */
204
+ turnOrigin(): TurnOrigin | undefined;
205
+ /** One model-initiated call at the gate: undefined when it may run; else its answer, refused at once (deny) or parked
206
+ * (ask). One call waits at a time: another asked meanwhile is answered so, not run. */
207
+ enter(name: string, args: unknown, callId: string, park: Park, options?: EnterOptions): Promise<Entered>;
208
+ /** pi's `tools` behind the gate: wraps, by name, for the run's registry, which apply wherever it is selected (every
209
+ * agent selects it: the root by default, a workflow's model node by name, app.ts). */
210
+ extension(tools: readonly ToolRegistration[]): Extension;
211
+ private wrap;
212
+ /** Reads the requests the run's store holds, as the run's process opens, before its turns go on. `coding`: the run's
213
+ * coding source (coding-tools.ts), on which an approved coding call runs, as the run's own would; `extra`, the run's
214
+ * own tools beyond the table (its learned_workflow), on which an approved call of one runs. */
215
+ load(durable: DurableRun, context: Context, coding?: readonly ToolRegistration[], extra?: readonly ToolRegistration[]): Promise<void>;
216
+ /** Whether a call waits for its answer, or for its answer to be acted on: a harness keeps the turn it ended closed. */
217
+ waiting(): boolean;
218
+ /** Whether a call of the turn that took `message` was parked, answered or not: that turn ended at the park, though a
219
+ * process that went before the next open settled it leaves it open in its session. */
220
+ parkedIn(message: string | undefined): boolean;
221
+ /** Acts on the answers from now on, resuming the session through `resume`; by default pi's root conversation. */
222
+ start(resume?: Resume): void;
223
+ private note;
224
+ /** Reads the run's serve.json for answers while a call waits. */
225
+ private watch;
226
+ /** pi's resume: an input to the root conversation under the request's own id, which pi takes once however often it
227
+ * is sent, then the mark. */
228
+ private readonly submit;
229
+ private settle;
230
+ /** The approved call in flight, and its own abort: a stop or a cancel of the run cuts it (cutIfWithdrawn). */
231
+ private inFlight?;
232
+ /** Cuts the approved call in flight when a stop or a cancel since withdrew its answer (runs.ts supersede). */
233
+ private cutIfWithdrawn;
234
+ /** A call withdrawn with its run: resolved in the run's store with nothing run and nothing resumed. */
235
+ private resolveSilently;
236
+ /** The approved call, run once by the kernel through the journal any host tool's call goes through, as an effect of
237
+ * the run's own `approvals:` session, on the run's coding source: its intent is durable before it runs, its outcome
238
+ * after; a replay-safe call a crash cut off runs again, any other is answered interrupted and never runs again. */
239
+ private run;
240
+ private readonly executors;
241
+ /** Registers how an approved call of tools named `prefix…` runs (the MCP gateway's, "mcp:"): one per prefix and run.
242
+ * The gate runs it exactly once on its journaled path, as it runs a kernel host tool, with no deadline of its own: the
243
+ * executor bounds the call (Executor). */
244
+ executor(prefix: string, run: Executor): void;
245
+ /** What runs an approved call: the executor its tool's prefix names, which may have effects anywhere, so a call a
246
+ * crash cut off is never run again; else the kernel's host tool of the name, as replay-safe as that tool is. Neither:
247
+ * refused, in words, and never run. */
248
+ private runnerOf;
249
+ }
250
+ /** A parked call: by its id, or, where the caller cannot name it (OpenCode's MCP calls carry none), by its tool, as the
251
+ * harness reports it, and its arguments' digest (argsDigest). */
252
+ export type ParkedCall = {
253
+ callId: string;
254
+ } | {
255
+ tool: string;
256
+ argsDigest: string;
257
+ };
258
+ /** The digest a park by tool and arguments is matched on: the sha256 of the arguments' canonical JSON, in hex. */
259
+ export declare const argsDigest: (args: unknown) => string;
260
+ /** Whether the tool result `result` ends the turn `parked` waits in (harness-app.ts asks it at each one): the parked
261
+ * call's own, by its id; or, for a park by tool and arguments, the next result of that tool with those arguments. */
262
+ export declare function endsTurn(parked: ParkedCall | undefined, result: {
263
+ callId: string;
264
+ tool: string;
265
+ args: unknown;
266
+ }): boolean;