@sema-agent/core 7.15.0 β 7.16.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 +29 -0
- package/dist/core/governance-codes.js +2 -0
- package/dist/core/memory-engine/delegation-settlement.d.ts +37 -12
- package/dist/core/memory-engine/delegation-settlement.js +128 -39
- package/dist/core/memory-engine/engine.d.ts +9 -8
- package/dist/core/memory-engine/engine.js +115 -120
- package/dist/core/memory-engine/file-backend.d.ts +17 -5
- package/dist/core/memory-engine/file-backend.js +78 -34
- package/dist/core/memory-engine/index.d.ts +2 -2
- package/dist/core/memory-engine/index.js +2 -2
- package/dist/core/memory-engine/layout.d.ts +152 -54
- package/dist/core/memory-engine/layout.js +441 -104
- package/dist/core/memory-engine/types.d.ts +8 -3
- package/dist/core/memory-engine/types.js +5 -0
- package/dist/core/runner/abort-race.d.ts +3 -3
- package/dist/core/runner/active-skill-scope.d.ts +2 -2
- package/dist/core/runner/assemble-result.d.ts +29 -29
- package/dist/core/runner/checkpoint-scope.d.ts +4 -4
- package/dist/core/runner/clock-and-limits.d.ts +3 -3
- package/dist/core/runner/compaction-call-options.d.ts +11 -11
- package/dist/core/runner/compaction-knobs.d.ts +4 -4
- package/dist/core/runner/compaction-seams.d.ts +5 -5
- package/dist/core/runner/contracts.d.ts +222 -224
- package/dist/core/runner/decide-continuation.d.ts +6 -6
- package/dist/core/runner/denial-limit-arms.d.ts +8 -8
- package/dist/core/runner/derived-route-fallback.d.ts +2 -2
- package/dist/core/runner/gate-exit.d.ts +6 -6
- package/dist/core/runner/git-status-frame.d.ts +7 -7
- package/dist/core/runner/inherited-ask-grants.d.ts +6 -6
- package/dist/core/runner/memory-capture-optout.d.ts +1 -1
- package/dist/core/runner/memory-consolidation-driver.d.ts +4 -4
- package/dist/core/runner/memory-consolidation.d.ts +6 -6
- package/dist/core/runner/park-commit.d.ts +6 -6
- package/dist/core/runner/permission-rule-lanes.d.ts +19 -19
- package/dist/core/runner/prepare-acquire-reconcile.d.ts +4 -4
- package/dist/core/runner/prepare-ask-lane.d.ts +3 -3
- package/dist/core/runner/prepare-boundary-parks.d.ts +3 -3
- package/dist/core/runner/prepare-caps-and-workflow.d.ts +5 -5
- package/dist/core/runner/prepare-config-doors.d.ts +21 -21
- package/dist/core/runner/prepare-context-lane.d.ts +6 -6
- package/dist/core/runner/prepare-defer-classify.d.ts +2 -2
- package/dist/core/runner/prepare-delegation-surface.d.ts +1 -1
- package/dist/core/runner/prepare-file-history.d.ts +2 -2
- package/dist/core/runner/prepare-gate-stations.d.ts +5 -5
- package/dist/core/runner/prepare-hands-readface.d.ts +33 -33
- package/dist/core/runner/prepare-inherited-gate.d.ts +4 -4
- package/dist/core/runner/prepare-listings.d.ts +3 -3
- package/dist/core/runner/prepare-lsp.d.ts +3 -3
- package/dist/core/runner/prepare-memory-engine-session.d.ts +5 -5
- package/dist/core/runner/prepare-memory.js +6 -7
- package/dist/core/runner/prepare-offload-wrappers.d.ts +2 -2
- package/dist/core/runner/prepare-park-ask.d.ts +6 -6
- package/dist/core/runner/prepare-policy-chain.d.ts +4 -4
- package/dist/core/runner/prepare-prompt-inputs.d.ts +5 -5
- package/dist/core/runner/prepare-protocol-tools.d.ts +1 -1
- package/dist/core/runner/prepare-question-face.d.ts +4 -4
- package/dist/core/runner/prepare-run-refs.d.ts +11 -11
- package/dist/core/runner/prepare-safety-scan.d.ts +1 -1
- package/dist/core/runner/prepare-suspend-saga.d.ts +4 -4
- package/dist/core/runner/prepare-task.d.ts +12 -12
- package/dist/core/runner/prepare-tool-disclosure-mount.d.ts +2 -3
- package/dist/core/runner/prepare-wiring-manifest.d.ts +4 -4
- package/dist/core/runner/prepare-workspace-restore.d.ts +1 -1
- package/dist/core/runner/remote-env-retry.d.ts +3 -3
- package/dist/core/runner/resume-admission.d.ts +1 -1
- package/dist/core/runner/resume-claim.d.ts +1 -1
- package/dist/core/runner/resume-internals-and-config.d.ts +1 -1
- package/dist/core/runner/resume-policy-outcome.d.ts +1 -1
- package/dist/core/runner/resume-preflight.d.ts +1 -1
- package/dist/core/runner/resume-review-outcome.d.ts +1 -1
- package/dist/core/runner/run-brain-sinks.d.ts +1 -1
- package/dist/core/runner/run-clock-and-content.d.ts +4 -4
- package/dist/core/runner/run-compaction-machinery.d.ts +3 -3
- package/dist/core/runner/run-git-lane.d.ts +1 -1
- package/dist/core/runner/run-harness-handlers.d.ts +2 -2
- package/dist/core/runner/run-identity-wiring.d.ts +4 -4
- package/dist/core/runner/run-leg.d.ts +3 -3
- package/dist/core/runner/run-notification-lane.d.ts +2 -2
- package/dist/core/runner/run-reasoning-seat.d.ts +2 -2
- package/dist/core/runner/run-settle-and-teardown.d.ts +4 -4
- package/dist/core/runner/run-telemetry-and-budget-seats.d.ts +2 -2
- package/dist/core/runner/run-terminal-adoption.d.ts +5 -5
- package/dist/core/runner/runtask.d.ts +14 -14
- package/dist/core/runner/session-file-state-replay.d.ts +3 -3
- package/dist/core/runner/session-rule-policy.d.ts +2 -2
- package/dist/core/runner/steer-admission.d.ts +2 -2
- package/dist/core/runner/stream-halt-verbs.d.ts +1 -1
- package/dist/core/runner/stream-reap.d.ts +1 -1
- package/dist/core/runner/synthetic-tools.d.ts +8 -8
- package/dist/core/runner/teardown-bounded.d.ts +2 -2
- package/dist/core/runner/tool-defer-gate.d.ts +1 -1
- package/dist/core/runner/tool-disclosure.d.ts +33 -33
- package/dist/core/runner/tool-end-body.d.ts +3 -3
- package/dist/core/runner/tool-face-overlay.d.ts +2 -2
- package/dist/core/runner/tool-output-projection.d.ts +2 -2
- package/dist/core/runner/turn-attachments.d.ts +53 -53
- package/dist/core/runner/usage-accounting.d.ts +4 -4
- package/dist/core/runner/workspace-path.d.ts +1 -1
- package/dist/engine/llm/types.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/tools/fs/bash-readonly-classifier.d.ts +40 -40
- package/dist/tools/fs/encoding.d.ts +31 -40
- package/dist/tools/fs/fs-bash.d.ts +35 -35
- package/dist/tools/fs/fs-pdf.d.ts +8 -8
- package/dist/tools/fs/fs-search-tools.d.ts +4 -4
- package/dist/tools/fs/fs-shared.d.ts +144 -158
- package/dist/tools/fs/fs-write.d.ts +8 -8
- package/dist/tools/fs/gh-rate-limit.d.ts +13 -14
- package/dist/tools/fs/index.d.ts +74 -78
- package/dist/tools/fs/notebook.d.ts +24 -25
- package/dist/tools/fs/pdf.d.ts +3 -3
- package/dist/tools/fs/read-deny.d.ts +22 -22
- package/dist/tools/fs/read-face.d.ts +21 -24
- package/dist/tools/fs/repo-map.d.ts +8 -8
- package/dist/tools/fs/safety.d.ts +116 -129
- package/dist/tools/fs/search.d.ts +63 -71
- package/package.json +5 -2
- package/test/export-surface.snapshot.json +5 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type TSchema } from "typebox";
|
|
2
2
|
import type { AgentMessage, AgentTool, AgentToolResult, AgentToolUpdateCallback, ToolExecutionMode } from "../../internal/harness-types.js";
|
|
3
3
|
/**
|
|
4
|
-
* Deferred-tool dynamic disclosure
|
|
4
|
+
* Deferred-tool dynamic disclosure. A deployment with hundreds of tools / several MCP
|
|
5
5
|
* servers can't inline every full JSON Schema into every request β turn-1 cache-creation tokens
|
|
6
6
|
* explode and any tool-description drift breaks the prefix cache. Instead, deferred tools ship as
|
|
7
7
|
* lightweight placeholders ({name, one-line hint, empty params}); a resident `tool_search` lets the
|
|
@@ -10,13 +10,13 @@ import type { AgentMessage, AgentTool, AgentToolResult, AgentToolUpdateCallback,
|
|
|
10
10
|
* announces them via the search's own result content (tail of the log; the cache prefix is untouched).
|
|
11
11
|
*
|
|
12
12
|
* This module is pure tool/registry logic: prepare-task owns the harness wiring and supplies a
|
|
13
|
-
* `rematerialize` callback (which calls `harness.setTools` + refreshes the
|
|
13
|
+
* `rematerialize` callback (which calls `harness.setTools` + refreshes the fingerprint).
|
|
14
14
|
*/
|
|
15
15
|
export declare const TOOL_SEARCH_NAME = "ToolSearch";
|
|
16
|
-
/** Default keyword-search result cap (
|
|
16
|
+
/** Default keyword-search result cap (CC ToolSearchTool.ts:28-32 `max_results` default 5). */
|
|
17
17
|
export declare const TOOL_SEARCH_DEFAULT_MAX_RESULTS = 5;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* How many times in a row ONE placeholder may answer the IDENTICAL invalid-arguments
|
|
20
20
|
* shape before the lane declares the loop unproductive and stops re-teaching. Three, because the
|
|
21
21
|
* corrective round is worth paying for twice (the first rejection hands over the schema; a second
|
|
22
22
|
* covers a model that needed the restatement) and a third identical failure is evidence that the
|
|
@@ -43,14 +43,14 @@ export interface DeferredToolInfo {
|
|
|
43
43
|
/** First line of a description, trimmed to a single short hint for a placeholder / announcement. */
|
|
44
44
|
export declare function deferHint(description: string, max?: number): string;
|
|
45
45
|
/**
|
|
46
|
-
* Neutralize a tool name before it appears in ANY model-facing text
|
|
46
|
+
* Neutralize a tool name before it appears in ANY model-facing text. A tool name is
|
|
47
47
|
* externally influenced β an untrusted MCP server can return one containing newlines (to inject a fake
|
|
48
48
|
* `<system-reminder>`/instruction line), backticks/quotes (to corrupt the JSON or markdown the model is
|
|
49
49
|
* told to emit), or angle brackets (to break a delimiter). Strip control chars, CR/LF, `` ` ``, `"`, `<`, `>`.
|
|
50
50
|
* For a normal name (`[A-Za-z0-9_.-]`, incl. MCP `server__tool`) this is a no-op.
|
|
51
51
|
*
|
|
52
52
|
* MUST wrap a tool name at EVERY site where it reaches the model β placeholder text, the search tool's
|
|
53
|
-
* announcement, anywhere. A bare interpolation is a prompt-injection hole
|
|
53
|
+
* announcement, anywhere. A bare interpolation is a prompt-injection hole.
|
|
54
54
|
*/
|
|
55
55
|
export declare function safeName(name: string): string;
|
|
56
56
|
/** Build the registry the search ranks over (deferred tools only β non-deferred are already visible). */
|
|
@@ -60,7 +60,7 @@ export declare function buildDeferredRegistry(deferred: ReadonlySet<string>, too
|
|
|
60
60
|
aliases?: readonly string[];
|
|
61
61
|
}>): Map<string, DeferredToolInfo>;
|
|
62
62
|
/**
|
|
63
|
-
*
|
|
63
|
+
* The direct-call lane a placeholder may carry. The upstream defer gate is SHAPE
|
|
64
64
|
* validation, not activation state: a call whose arguments validate against the REAL tool's
|
|
65
65
|
* declared schema runs the real tool directly (activation is only about whether the model has
|
|
66
66
|
* been SHOWN the schema, never an execution gate). Governance cannot be laundered through this
|
|
@@ -70,7 +70,7 @@ export declare function buildDeferredRegistry(deferred: ReadonlySet<string>, too
|
|
|
70
70
|
*/
|
|
71
71
|
export interface PlaceholderDirectCall {
|
|
72
72
|
/**
|
|
73
|
-
*
|
|
73
|
+
* Resolve the real tool AT CALL TIME, never from a prepare-time snapshot. The mounted
|
|
74
74
|
* roster is a LIVE array: an MCP refresh splices a server's name domain out and pushes freshly
|
|
75
75
|
* materialized tool objects back in, so a Map captured when the placeholder was built would hand
|
|
76
76
|
* this lane the WITHDRAWN object (stale schema shape gate, stale transport client) long after the
|
|
@@ -79,19 +79,19 @@ export interface PlaceholderDirectCall {
|
|
|
79
79
|
*/
|
|
80
80
|
resolveReal: () => PlaceholderDirectTarget | undefined;
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
82
|
+
* The scheduling declaration this placeholder carries while it stands in for the real
|
|
83
83
|
* tool. Mirrors the REAL tool's own `executionMode` (see the mirror rationale in
|
|
84
84
|
* {@link createPlaceholderTool}); absent β the engine's fail-closed default, exactly as it would
|
|
85
85
|
* be for the real tool once activated.
|
|
86
86
|
*/
|
|
87
87
|
executionMode?: ToolExecutionMode;
|
|
88
88
|
/**
|
|
89
|
-
*
|
|
89
|
+
* Does THIS name sit on the static face right now, i.e. will it never be swapped for
|
|
90
90
|
* the real tool's declaration? The lane's model-facing rejection text reads it to say where the
|
|
91
91
|
* schema it hands back actually lives (this result only, versus this result AND every later
|
|
92
92
|
* request's tools block). Absent β the swap posture.
|
|
93
93
|
*
|
|
94
|
-
|
|
94
|
+
* A FUNCTION, evaluated per call, for the same reason `resolveReal` is: the answer is not
|
|
95
95
|
* a prepare-time constant. The run-wide strategy is, but the per-tool exemption on top of it reads
|
|
96
96
|
* the LIVE roster β an MCP refresh can replace a tool with a declaration that no longer fits the
|
|
97
97
|
* result-text carrier (or one that now does), and a boolean captured when the placeholder was built
|
|
@@ -101,9 +101,9 @@ export interface PlaceholderDirectCall {
|
|
|
101
101
|
/**
|
|
102
102
|
* Activation side effects (active-set add + rematerialize + boundary delta announcement).
|
|
103
103
|
* Idempotent; awaited BEFORE the invoke so the next boundary already shows the full schema.
|
|
104
|
-
*
|
|
104
|
+
* MUST be atomic: a thrown rematerialize has to leave the active set as it found it.
|
|
105
105
|
*
|
|
106
|
-
*
|
|
106
|
+
* Returns the announcement text this activation has to CARRY, or `undefined` when it has
|
|
107
107
|
* none (already active, or nothing rides on this name). The ToolSearch lane announces on its own
|
|
108
108
|
* result content; a direct call makes no ToolSearch call at all, so a face whose only carrier is
|
|
109
109
|
* that result β today the agent-type roster of a deferred delegation tool β had no way to reach
|
|
@@ -118,13 +118,13 @@ export interface PlaceholderDirectTarget {
|
|
|
118
118
|
/** The REAL tool's declared parameter schema β the shape gate for a direct call. */
|
|
119
119
|
parameters: TSchema;
|
|
120
120
|
/** Invoke the real tool; the result passes through VERBATIM (structured details intact).
|
|
121
|
-
*
|
|
121
|
+
* `onUpdate` is part of the contract: the engine hands every execute a progress sink,
|
|
122
122
|
* and dropping it here silently mutes streaming progress (MCP `notifications/progress`) for any
|
|
123
123
|
* tool reached through this lane, while the SAME tool streams normally once activated. */
|
|
124
124
|
invoke: (toolCallId: string, params: unknown, signal?: AbortSignal, onUpdate?: AgentToolUpdateCallback<unknown>) => Promise<AgentToolResult<unknown>>;
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
127
|
-
*
|
|
127
|
+
* Can the STATIC face carry this declaration at all? Static's only in-context schema
|
|
128
128
|
* carrier is result TEXT, so a declaration that cannot be serialized, or that the model-facing error
|
|
129
129
|
* bound would truncate into non-JSON, has no carrier there. Such a tool is exempted per-tool from the
|
|
130
130
|
* static face (it materializes into the tools block on activation, the swap way) rather than being
|
|
@@ -133,20 +133,20 @@ export interface PlaceholderDirectTarget {
|
|
|
133
133
|
*/
|
|
134
134
|
export declare function staticSchemaRenderable(schema: TSchema | undefined): boolean;
|
|
135
135
|
/** A placeholder AgentTool for a deferred tool: visible name + hint, empty params. Without `direct`,
|
|
136
|
-
* every call is the teaching rejection; with it, a schema-valid call runs the real tool
|
|
136
|
+
* every call is the teaching rejection; with it, a schema-valid call runs the real tool. */
|
|
137
137
|
export declare function createPlaceholderTool(info: DeferredToolInfo, direct?: PlaceholderDirectCall): AgentTool;
|
|
138
138
|
/** Keyword score of a query against a deferred tool: name hits weigh more than description/hint hits. */
|
|
139
139
|
export declare function scoreToolMatch(query: string, info: DeferredToolInfo): number;
|
|
140
|
-
/** The argument shapes `tool_search` accepts (
|
|
141
|
-
* `max_results`).
|
|
142
|
-
* durable-replay compat was already sacrificed by
|
|
140
|
+
/** The argument shapes `tool_search` accepts (CC-canonical): `query` (+ optional
|
|
141
|
+
* `max_results`). The pre-keyword-search `select` ARRAY arm is retired β
|
|
142
|
+
* durable-replay compat was already sacrificed by a prior ruling (replay resolution included);
|
|
143
143
|
* the CC-canonical `select:A,B,C` string prefix inside `query` is the live selection form. */
|
|
144
144
|
export interface ToolSearchArgs {
|
|
145
145
|
query?: string;
|
|
146
146
|
max_results?: number;
|
|
147
147
|
}
|
|
148
148
|
/**
|
|
149
|
-
* Resolve a tool_search request to deferred-tool names (
|
|
149
|
+
* Resolve a tool_search request to deferred-tool names (CC ToolSearchTool.ts form).
|
|
150
150
|
* Query forms, checked in order:
|
|
151
151
|
* β `select:A,B,C` prefix (case-insensitive prefix, CC ToolSearchTool.ts:363) β comma-split EXACT
|
|
152
152
|
* name activation against the registry's names; misses are reported in `missing` (never silently
|
|
@@ -154,7 +154,7 @@ export interface ToolSearchArgs {
|
|
|
154
154
|
* β‘ bare tool name (case-insensitive equality, CC:199-204) β selects that tool directly; handles
|
|
155
155
|
* models sending a name instead of the select: prefix (seen from subagents/post-compaction).
|
|
156
156
|
* β’ keyword search β scored matches capped at `max_results` (CC default 5).
|
|
157
|
-
*
|
|
157
|
+
* The pre-keyword-search `select` ARRAY arm is retired (see {@link ToolSearchArgs}) β a stale
|
|
158
158
|
* replayed array argument now resolves like an empty query (nothing matched, honestly).
|
|
159
159
|
*/
|
|
160
160
|
export declare function resolveToolSearchDetailed(args: ToolSearchArgs, registry: ReadonlyMap<string, DeferredToolInfo>): {
|
|
@@ -165,16 +165,16 @@ export declare function resolveToolSearchDetailed(args: ToolSearchArgs, registry
|
|
|
165
165
|
* {@link extractDiscoveredToolNames} (and kept as the stable exported signature). */
|
|
166
166
|
export declare function resolveToolSearch(args: ToolSearchArgs, registry: ReadonlyMap<string, DeferredToolInfo>): string[];
|
|
167
167
|
/**
|
|
168
|
-
* Stateless recompute of the activated-tool set from the message log
|
|
168
|
+
* Stateless recompute of the activated-tool set from the message log. The in-process
|
|
169
169
|
* `active` Set is the primary source within one process, but a RESUMED session (new process) starts with
|
|
170
170
|
* an empty Set β without this, previously-activated tools would revert to placeholders. Two carriers,
|
|
171
171
|
* both deterministic and both replayed here:
|
|
172
172
|
*
|
|
173
173
|
* β every prior `tool_search` call's arguments, re-resolved through `resolveToolSearch` β unless that
|
|
174
|
-
* call's OWN result carries the error flag (
|
|
174
|
+
* call's OWN result carries the error flag (a denied/blocked search never reached execute
|
|
175
175
|
* and staged nothing; a call with no result at all keeps the historic credit);
|
|
176
|
-
* β‘
|
|
177
|
-
*
|
|
176
|
+
* β‘ A SUCCESSFUL call on a deferred name, which is an activation in its own right: the
|
|
177
|
+
* direct lane runs `activate()` BEFORE it invokes the real tool, so a result that came back
|
|
178
178
|
* without an error flag can only have come from a call that passed the shape gate and activated.
|
|
179
179
|
* No new carrier had to be minted for this: the toolCall part and its result are already in the
|
|
180
180
|
* transcript. Before this arm, a direct activation left NO trace at all β the next leg reverted the
|
|
@@ -187,14 +187,14 @@ export declare function resolveToolSearch(args: ToolSearchArgs, registry: Readon
|
|
|
187
187
|
* denial or hook block, an abort, invalid arguments β is flagged as an error, and none of them activated
|
|
188
188
|
* anything. It is an UNDER-approximation in one direction only: an activation whose real tool then failed
|
|
189
189
|
* (or threw) is not counted, so that name reverts to a placeholder and the model re-activates on demand β
|
|
190
|
-
* self-healing, exactly like the
|
|
190
|
+
* self-healing, exactly like the keyword-cap note below, never a widening. The shape-INVALID
|
|
191
191
|
* direct call (ruled 2026-08-03) activates too and is flagged as an error, so it lands in that same
|
|
192
192
|
* under-approximated class by construction: within the process the in-memory `active` set carries it, and
|
|
193
193
|
* a replay that loses it costs the corrected call β which succeeds, and is itself carrier β‘. The one way to
|
|
194
194
|
* self-declare a positive is a deployment `tool_result` hook that rewrites a rejection's error flag to false,
|
|
195
195
|
* which is the deployment editing its own transcript.
|
|
196
196
|
*
|
|
197
|
-
*
|
|
197
|
+
* Pre-116 checkpoints whose KEYWORD queries activated up to 25 tools re-derive at
|
|
198
198
|
* the new default cap (5) β the extra tools revert to placeholders, which is self-healing (the model
|
|
199
199
|
* re-activates on demand), never a widening. Exact-name and `select:`-prefix activations replay unchanged.
|
|
200
200
|
*
|
|
@@ -208,14 +208,14 @@ export declare function extractDiscoveredToolNames(messages: ReadonlyArray<Agent
|
|
|
208
208
|
/**
|
|
209
209
|
* Build the resident `tool_search` tool. On a search that NEWLY activates deferred tools it (1) adds them
|
|
210
210
|
* to the monotonic `active` Set, (2) calls `rematerialize` (prepare-task swaps placeholdersβfull schema
|
|
211
|
-
* via `harness.setTools` and refreshes the
|
|
211
|
+
* via `harness.setTools` and refreshes the fingerprint), and (3) returns the "now available"
|
|
212
212
|
* announcement as its OWN result content β the delta lands at the tail of the log, never in the cache prefix.
|
|
213
213
|
*/
|
|
214
214
|
export declare function createToolSearchTool(opts: {
|
|
215
215
|
registry: ReadonlyMap<string, DeferredToolInfo>;
|
|
216
216
|
active: Set<string>;
|
|
217
217
|
rematerialize: (active: ReadonlySet<string>) => Promise<void>;
|
|
218
|
-
/**
|
|
218
|
+
/** Listing ride-along on the deferred-tool channel: when an activation newly
|
|
219
219
|
* materializes a listing-bearing tool (the deferred delegation tool whose description points at an
|
|
220
220
|
* agent-types listing that the deferred leg's boundary producer never ships), the caller returns
|
|
221
221
|
* the listing text here and it rides THIS search's own result content β tail of the log, cache
|
|
@@ -226,12 +226,12 @@ export declare function createToolSearchTool(opts: {
|
|
|
226
226
|
* "Workflow is already available β call it" instead of a generic not-found that reads as absence
|
|
227
227
|
* (observed: the model treated the miss as unavailability and only recovered by guessing). */
|
|
228
228
|
mountedNames?: () => ReadonlySet<string>;
|
|
229
|
-
/**
|
|
229
|
+
/** Whether the placeholders on this task carry the direct-call lane
|
|
230
230
|
* (`TaskSpec.deferSelfResolve` not disabled). Selects which of the two teaching postures below is
|
|
231
231
|
* true for this task; defaults to the direct-lane posture, matching the spec field's own default. */
|
|
232
232
|
directCallEnabled?: boolean;
|
|
233
|
-
/**
|
|
234
|
-
* private one. The `active` set and `rematerialize` are shared with the
|
|
233
|
+
/** Run this tool's activation critical section on the CALLER's serializer instead of a
|
|
234
|
+
* private one. The `active` set and `rematerialize` are shared with the direct-call lane,
|
|
235
235
|
* which activates from a placeholder's own execute; both lanes must queue on ONE section or a
|
|
236
236
|
* concurrent batch lets the direct lane stage a name while this section is still pending (and
|
|
237
237
|
* vice versa, so a rollback here cannot be observed as "already active" there). Absent β a private
|
|
@@ -247,7 +247,7 @@ export declare function createToolSearchTool(opts: {
|
|
|
247
247
|
*/
|
|
248
248
|
isMounted?: (name: string) => boolean;
|
|
249
249
|
serializeActivation?: <T>(section: () => Promise<T>) => Promise<T>;
|
|
250
|
-
/**
|
|
250
|
+
/** Resolve a deferred name's REAL declared
|
|
251
251
|
* parameter schema, read from the live roster at call time. Presence switches this face to the
|
|
252
252
|
* static posture: activation never swaps the placeholder in the tools block, so the result text
|
|
253
253
|
* BELOW is the schema's only in-context carrier β each matched tool's schema is inlined into the
|
|
@@ -17,13 +17,13 @@ import { type McpDelivered } from "../mcp-failure.js";
|
|
|
17
17
|
import type { RecoveredOrphan } from "../session-reconcile.js";
|
|
18
18
|
import { type StructuredProjector } from "./tool-output-projection.js";
|
|
19
19
|
import type { WriteFamily } from "./turn-attachments.js";
|
|
20
|
-
/**
|
|
20
|
+
/** Derive the thin `response` digest from a harness tool result: model-facing text
|
|
21
21
|
* content only (never `details` β the H4 thin-projection discipline), capped with a truncation note. */
|
|
22
22
|
export declare function batchResponseDigest(result: unknown): string | undefined;
|
|
23
23
|
/** The `tool_end` body fields projected from a harness tool result β output/truncated/totalChars via
|
|
24
24
|
* {@link toolOutputFrom} and the CC card via the LEG's projector (`Prepared.structuredProjector`: the engine card set
|
|
25
25
|
* βͺ the caller rows' declared `renderHints.resultCards`, an undeclared type dropped and announced once per leg β
|
|
26
|
-
*
|
|
26
|
+
* handed in because the once-per-leg state lives on the leg. Single construction point for BOTH
|
|
27
27
|
* the live loop's frames and the resumed batch's frames (`resolvePendingCall` + the deferred-sibling
|
|
28
28
|
* close): the resumed frames used to carry only `isError`, so a client rendering tool output from frames
|
|
29
29
|
* showed an empty body for every durable-approved call. Same projection = same source as the transcript.
|
|
@@ -72,7 +72,7 @@ export declare function reconciledToolEndBody(orphan: Pick<RecoveredOrphan, "tex
|
|
|
72
72
|
/** task #51 F2/F3 β the CANONICAL write-tool β reminder-window mapping (CC qFm :480253-480254
|
|
73
73
|
* `a.name === bD || a.name === hF` = TaskCreate/TaskUpdate; BFm :480217-480219 = TodoWrite). Live
|
|
74
74
|
* deployment-alias resolution happens at the call sites (run-local `writeFamilyOf` over the mounted
|
|
75
|
-
* roster); retired-name normalization is gone
|
|
75
|
+
* roster); retired-name normalization is gone. */
|
|
76
76
|
export declare function writeFamilyOfCanonical(name: string): WriteFamily | undefined;
|
|
77
77
|
/** A `toolResult` transcript message (text content). Used by the resume engine to close pending calls. */
|
|
78
78
|
export declare function toolResultMsg(toolCallId: string, toolName: string, text: string, isError: boolean): AgentMessage;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The MCP `toolFaces` OVERLAY: a deployment's per-tool face declaration for a
|
|
3
3
|
* protocol tool that has no `ToolSpec` of its own (`McpServerSpec.toolFaces`, keyed by the server's RAW
|
|
4
4
|
* tool name like `allowTools` / `toolAxes`). Validated against the MATERIALIZED schema at every listing
|
|
5
5
|
* (the first mount and every RefreshMcpTools): `pathTarget.param` must be a top-level property; an
|
|
@@ -16,7 +16,7 @@ import type { AgentTool } from "../../internal/harness-types.js";
|
|
|
16
16
|
import type { McpServerSpec } from "../mcp-server-spec.js";
|
|
17
17
|
import { type ToolApprovalCard } from "../tool-face.js";
|
|
18
18
|
import { type EngineNotice } from "../engine-notice.js";
|
|
19
|
-
/** The keys each specialised approval card needs on the call (
|
|
19
|
+
/** The keys each specialised approval card needs on the call (the SHELL owns the
|
|
20
20
|
* card's full schema; this is the pre-filter the overlay is validated against). */
|
|
21
21
|
export declare const APPROVAL_CARD_REQUIRED_KEYS: Readonly<Record<ToolApprovalCard, readonly string[]>>;
|
|
22
22
|
export type McpToolFace = NonNullable<McpServerSpec["toolFaces"]>[string];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The `tool_end` output/structured projection, verbatim from
|
|
3
3
|
* `runtask.ts`'s runLocked R4 phase. Pure functions over the harness `AgentToolResult`: zero closure
|
|
4
4
|
* state, zero runtask coupling β the ONLY module-level input is the size cap below. Event-sequence
|
|
5
5
|
* snapshot pin (recorded before/after the move, byte-equal) guards the projection semantics.
|
|
@@ -14,7 +14,7 @@ export declare const toolOutputFrom: (result: unknown) => {
|
|
|
14
14
|
* as a parameter β there is no module-level card set to fall back to. */
|
|
15
15
|
export type StructuredProjector = (result: unknown) => unknown;
|
|
16
16
|
/**
|
|
17
|
-
* L4's run-time half
|
|
17
|
+
* L4's run-time half: a per-leg projector β the engine card set plus the leg's declared
|
|
18
18
|
* caller cards β that DROPS an undeclared `details.type` and announces it ONCE per leg
|
|
19
19
|
* (`config.tool_card_undeclared`, audience operator). With no options it is the engine set alone, unannounced β
|
|
20
20
|
* the shape a caller outside a leg (a test, a fixture) uses.
|