agentfootprint 9.74.0 → 9.76.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/AGENTS.md +1 -1
- package/CHANGELOG.md +126 -0
- package/CLAUDE.md +24 -19
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/dist/artifacts/index.js +3 -1
- package/dist/artifacts/index.js.map +1 -1
- package/dist/artifacts/recordingArtifact.js +47 -1
- package/dist/artifacts/recordingArtifact.js.map +1 -1
- package/dist/core/Agent.js +53 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +12 -0
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/evidence/gate.js +22 -3
- package/dist/core/agent/evidence/gate.js.map +1 -1
- package/dist/core/agent/stagedRefs.js +161 -0
- package/dist/core/agent/stagedRefs.js.map +1 -0
- package/dist/core/agent/stages/callLLM.js +22 -2
- package/dist/core/agent/stages/callLLM.js.map +1 -1
- package/dist/core/agent/stages/evidenceRecheck.js +21 -2
- package/dist/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +42 -0
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/agent/toolDispatch.js +101 -0
- package/dist/core/agent/toolDispatch.js.map +1 -0
- package/dist/core/flowchartAsTool.js +9 -2
- package/dist/core/flowchartAsTool.js.map +1 -1
- package/dist/core/runbook/coverage.js +162 -0
- package/dist/core/runbook/coverage.js.map +1 -0
- package/dist/core/runbook/dispatch.js +119 -0
- package/dist/core/runbook/dispatch.js.map +1 -0
- package/dist/core/runbook/index.js +24 -0
- package/dist/core/runbook/index.js.map +1 -0
- package/dist/core/runbook/runbookAsTool.js +358 -0
- package/dist/core/runbook/runbookAsTool.js.map +1 -0
- package/dist/core/runbook/types.js +22 -0
- package/dist/core/runbook/types.js.map +1 -0
- package/dist/core/runbook/verdicts.js +156 -0
- package/dist/core/runbook/verdicts.js.map +1 -0
- package/dist/core/runbook/walk.js +115 -0
- package/dist/core/runbook/walk.js.map +1 -0
- package/dist/core/tools.js +55 -1
- package/dist/core/tools.js.map +1 -1
- package/dist/esm/artifacts/index.d.ts +1 -1
- package/dist/esm/artifacts/index.js +1 -1
- package/dist/esm/artifacts/index.js.map +1 -1
- package/dist/esm/artifacts/recordingArtifact.d.ts +36 -0
- package/dist/esm/artifacts/recordingArtifact.js +45 -0
- package/dist/esm/artifacts/recordingArtifact.js.map +1 -1
- package/dist/esm/core/Agent.js +53 -1
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +12 -0
- package/dist/esm/core/agent/AgentBuilder.js +12 -0
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/evidence/gate.d.ts +11 -1
- package/dist/esm/core/agent/evidence/gate.js +22 -3
- package/dist/esm/core/agent/evidence/gate.js.map +1 -1
- package/dist/esm/core/agent/evidence/types.d.ts +23 -0
- package/dist/esm/core/agent/stagedRefs.d.ts +94 -0
- package/dist/esm/core/agent/stagedRefs.js +154 -0
- package/dist/esm/core/agent/stagedRefs.js.map +1 -0
- package/dist/esm/core/agent/stages/callLLM.d.ts +17 -0
- package/dist/esm/core/agent/stages/callLLM.js +22 -2
- package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.d.ts +19 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.js +21 -2
- package/dist/esm/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.js +42 -0
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/toolDispatch.d.ts +50 -0
- package/dist/esm/core/agent/toolDispatch.js +97 -0
- package/dist/esm/core/agent/toolDispatch.js.map +1 -0
- package/dist/esm/core/flowchartAsTool.d.ts +6 -0
- package/dist/esm/core/flowchartAsTool.js +9 -2
- package/dist/esm/core/flowchartAsTool.js.map +1 -1
- package/dist/esm/core/runbook/coverage.d.ts +69 -0
- package/dist/esm/core/runbook/coverage.js +155 -0
- package/dist/esm/core/runbook/coverage.js.map +1 -0
- package/dist/esm/core/runbook/dispatch.d.ts +69 -0
- package/dist/esm/core/runbook/dispatch.js +112 -0
- package/dist/esm/core/runbook/dispatch.js.map +1 -0
- package/dist/esm/core/runbook/index.d.ts +9 -0
- package/dist/esm/core/runbook/index.js +9 -0
- package/dist/esm/core/runbook/index.js.map +1 -0
- package/dist/esm/core/runbook/runbookAsTool.d.ts +88 -0
- package/dist/esm/core/runbook/runbookAsTool.js +354 -0
- package/dist/esm/core/runbook/runbookAsTool.js.map +1 -0
- package/dist/esm/core/runbook/types.d.ts +196 -0
- package/dist/esm/core/runbook/types.js +21 -0
- package/dist/esm/core/runbook/types.js.map +1 -0
- package/dist/esm/core/runbook/verdicts.d.ts +78 -0
- package/dist/esm/core/runbook/verdicts.js +148 -0
- package/dist/esm/core/runbook/verdicts.js.map +1 -0
- package/dist/esm/core/runbook/walk.d.ts +72 -0
- package/dist/esm/core/runbook/walk.js +110 -0
- package/dist/esm/core/runbook/walk.js.map +1 -0
- package/dist/esm/core/tools.d.ts +112 -0
- package/dist/esm/core/tools.js +52 -0
- package/dist/esm/core/tools.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +39 -0
- package/dist/esm/events/registry.d.ts +3 -1
- package/dist/esm/events/registry.js +2 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/index.d.ts +4 -3
- package/dist/esm/index.js +19 -2
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/mcp/toolExtras.d.ts +8 -0
- package/dist/esm/lib/mcp/toolExtras.js +7 -1
- package/dist/esm/lib/mcp/toolExtras.js.map +1 -1
- package/dist/events/registry.js +2 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/index.js +97 -66
- package/dist/index.js.map +1 -1
- package/dist/lib/mcp/toolExtras.js +6 -0
- package/dist/lib/mcp/toolExtras.js.map +1 -1
- package/dist/types/artifacts/index.d.ts +1 -1
- package/dist/types/artifacts/index.d.ts.map +1 -1
- package/dist/types/artifacts/recordingArtifact.d.ts +36 -0
- package/dist/types/artifacts/recordingArtifact.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +12 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/gate.d.ts +11 -1
- package/dist/types/core/agent/evidence/gate.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/types.d.ts +23 -0
- package/dist/types/core/agent/evidence/types.d.ts.map +1 -1
- package/dist/types/core/agent/stagedRefs.d.ts +95 -0
- package/dist/types/core/agent/stagedRefs.d.ts.map +1 -0
- package/dist/types/core/agent/stages/callLLM.d.ts +17 -0
- package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
- package/dist/types/core/agent/stages/evidenceRecheck.d.ts +19 -1
- package/dist/types/core/agent/stages/evidenceRecheck.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/toolDispatch.d.ts +51 -0
- package/dist/types/core/agent/toolDispatch.d.ts.map +1 -0
- package/dist/types/core/flowchartAsTool.d.ts +6 -0
- package/dist/types/core/flowchartAsTool.d.ts.map +1 -1
- package/dist/types/core/runbook/coverage.d.ts +70 -0
- package/dist/types/core/runbook/coverage.d.ts.map +1 -0
- package/dist/types/core/runbook/dispatch.d.ts +70 -0
- package/dist/types/core/runbook/dispatch.d.ts.map +1 -0
- package/dist/types/core/runbook/index.d.ts +10 -0
- package/dist/types/core/runbook/index.d.ts.map +1 -0
- package/dist/types/core/runbook/runbookAsTool.d.ts +89 -0
- package/dist/types/core/runbook/runbookAsTool.d.ts.map +1 -0
- package/dist/types/core/runbook/types.d.ts +197 -0
- package/dist/types/core/runbook/types.d.ts.map +1 -0
- package/dist/types/core/runbook/verdicts.d.ts +79 -0
- package/dist/types/core/runbook/verdicts.d.ts.map +1 -0
- package/dist/types/core/runbook/walk.d.ts +73 -0
- package/dist/types/core/runbook/walk.d.ts.map +1 -0
- package/dist/types/core/tools.d.ts +112 -0
- package/dist/types/core/tools.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +39 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +3 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/mcp/toolExtras.d.ts +8 -0
- package/dist/types/lib/mcp/toolExtras.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runbook/types — the vocabulary of the runbook bridge.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: one options bag, four concerns (declarations, procedure, evidence
|
|
5
|
+
* policy, walk policy) + one envelope type split into a MANDATORY
|
|
6
|
+
* SPINE and an OPTIONAL projection. Pure data, no behavior.
|
|
7
|
+
* Role: core/ layer. `runbookAsTool.ts` consumes; consumers read the
|
|
8
|
+
* envelope types when they assert on results.
|
|
9
|
+
* Emits: N/A.
|
|
10
|
+
*
|
|
11
|
+
* The SPINE / PROJECTION split is load-bearing honesty, not taste: the spine
|
|
12
|
+
* (coverage, provenance, rule version, the recorded walk) is what EVERY
|
|
13
|
+
* runbook ships whatever its shape, so an answer can never arrive without its
|
|
14
|
+
* boundary; the verdict/rowset projection is one shape of answer (a triage),
|
|
15
|
+
* selected by `resultKind: 'verdict/*'` — an action-taking runbook ships the
|
|
16
|
+
* spine plus its own `report` payload and no rowset. The spine's wire shape
|
|
17
|
+
* is explicitly PROVISIONAL until a second, differently-shaped consumer has
|
|
18
|
+
* shipped through it.
|
|
19
|
+
*/
|
|
20
|
+
import type { CombinedRecorder, FlowChart, RedactionPolicy } from 'footprintjs';
|
|
21
|
+
import type { CoverageItem } from '../agent/coverage/types.js';
|
|
22
|
+
import type { ToolDispatch, ToolOwner, ToolResultCeiling } from '../tools.js';
|
|
23
|
+
import type { ToolResultClass } from '../../lib/semantics/types.js';
|
|
24
|
+
import type { ToolWants } from '../../artifacts/wants.js';
|
|
25
|
+
/**
|
|
26
|
+
* The procedure: a factory invoked PER CALL with the run's own tool dispatch
|
|
27
|
+
* (`ctx.tools`), returning a FRESH chart whose stages close over it.
|
|
28
|
+
*
|
|
29
|
+
* Per call for two reasons that are really one: a chart shared between two
|
|
30
|
+
* runs is a chart whose closures belong to whichever run built it last, and
|
|
31
|
+
* the dispatch only exists at execute time — so the factory is both the
|
|
32
|
+
* fresh-chart law and the delivery mechanism.
|
|
33
|
+
*
|
|
34
|
+
* It is ALSO invoked once at definition time, with a probe dispatch whose
|
|
35
|
+
* `has` answers false and whose `call` refuses — to read the chart's declared
|
|
36
|
+
* contract (input schema, the named decider's branches). Stage bodies do not
|
|
37
|
+
* run at build, so a well-formed factory pays nothing; a factory with side
|
|
38
|
+
* effects at build time is a factory that lies about being a declaration.
|
|
39
|
+
*/
|
|
40
|
+
export type RunbookProcedure = (tools: ToolDispatch) => FlowChart;
|
|
41
|
+
/** Rule provenance — threaded bridge → envelope → coverage sentence, so an
|
|
42
|
+
* answer produced under one reading of the rules can be told apart from an
|
|
43
|
+
* answer produced under the next. */
|
|
44
|
+
export interface RunbookRules {
|
|
45
|
+
/** The rule set's name ('health-signal'). Non-empty. */
|
|
46
|
+
readonly name: string;
|
|
47
|
+
/** Its version stamp ('v1'). Non-empty; bump when the READING changes,
|
|
48
|
+
* never for wording. */
|
|
49
|
+
readonly version: string;
|
|
50
|
+
}
|
|
51
|
+
/** The verdict/rowset projection's dials. */
|
|
52
|
+
export interface RunbookVerdictsOptions {
|
|
53
|
+
/**
|
|
54
|
+
* The decider stage (by id or name) whose declared branch labels generate
|
|
55
|
+
* `verdict_meanings`. Branch descriptions come from the chart's own
|
|
56
|
+
* structure when the decider is statically declared; rule labels observed
|
|
57
|
+
* in this run's decide() evidence refine them (and are the only source
|
|
58
|
+
* when the decider lives inside a dynamically generated fan-out branch,
|
|
59
|
+
* where build-time structure cannot see it).
|
|
60
|
+
*/
|
|
61
|
+
readonly decider: string;
|
|
62
|
+
/** Cap on `verdicts` rows AND the rendered table — ONE number for both
|
|
63
|
+
* halves (a longer list beside a shorter table is an invitation to retype
|
|
64
|
+
* identifiers). Default 50. */
|
|
65
|
+
readonly maxRows?: number;
|
|
66
|
+
}
|
|
67
|
+
/** The walk policy. */
|
|
68
|
+
export interface RunbookWalkOptions {
|
|
69
|
+
/** Row cap on the minted walk (default 500). When the full walk does not
|
|
70
|
+
* fit, the CONTROL FLOW survives — see `walk.ts` for the projection law. */
|
|
71
|
+
readonly cap?: number;
|
|
72
|
+
}
|
|
73
|
+
/** Everything `runbookAsTool` accepts. Smallest legal call:
|
|
74
|
+
* `{ name, description, procedure }` — and it still yields the spine. */
|
|
75
|
+
export interface RunbookAsToolOptions {
|
|
76
|
+
/** Tool name the LLM dispatches by. */
|
|
77
|
+
readonly name: string;
|
|
78
|
+
/** REQUIRED — a description-less tool is invisible to the model. */
|
|
79
|
+
readonly description: string;
|
|
80
|
+
/** The procedure factory — see {@link RunbookProcedure}. */
|
|
81
|
+
readonly procedure: RunbookProcedure;
|
|
82
|
+
/** Selects the envelope projection (`'verdict/*'` gets the rowset) AND is
|
|
83
|
+
* the artifact kind a placed result is minted under. */
|
|
84
|
+
readonly resultKind?: string;
|
|
85
|
+
readonly resultClass?: ToolResultClass;
|
|
86
|
+
readonly owner?: ToolOwner;
|
|
87
|
+
readonly resultCeiling?: ToolResultCeiling;
|
|
88
|
+
readonly wants?: ToolWants;
|
|
89
|
+
readonly argumentsFrom?: readonly string[];
|
|
90
|
+
/** The named ingredient tools the procedure calls through `ctx.tools` —
|
|
91
|
+
* drift-checked at agent build. */
|
|
92
|
+
readonly composedOf?: readonly string[];
|
|
93
|
+
/** Explicit input schema wins; otherwise the chart's `.contract()` input
|
|
94
|
+
* is lifted when it is a plain JSON-Schema object (a parseable schema —
|
|
95
|
+
* zod et al. — cannot be serialized for the model and falls back to the
|
|
96
|
+
* empty-object default). */
|
|
97
|
+
readonly inputSchema?: Readonly<Record<string, unknown>>;
|
|
98
|
+
/** Rule provenance — see {@link RunbookRules}. */
|
|
99
|
+
readonly rules?: RunbookRules;
|
|
100
|
+
/** The verdict projection's dials — see {@link RunbookVerdictsOptions}. */
|
|
101
|
+
readonly verdicts?: RunbookVerdictsOptions;
|
|
102
|
+
/** The walk policy — see {@link RunbookWalkOptions}. */
|
|
103
|
+
readonly walk?: RunbookWalkOptions;
|
|
104
|
+
/** Observers attached to each invocation's fresh inner executor. */
|
|
105
|
+
readonly recorders?: ReadonlyArray<CombinedRecorder>;
|
|
106
|
+
/** Keep each invocation's inner record for `inspect_tool_run` descent. */
|
|
107
|
+
readonly keepRecord?: boolean;
|
|
108
|
+
/** Bounded LRU size for kept records (requires `keepRecord: true`). */
|
|
109
|
+
readonly keepRecordLimit?: number;
|
|
110
|
+
/** Redaction policy for the inner run (commit-time scrub). */
|
|
111
|
+
readonly redact?: RedactionPolicy;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* The recorded-walk descriptor — ALWAYS on the spine. The walk itself ships
|
|
115
|
+
* as an artifact ticket (`ref`), never as bytes in the envelope; with no
|
|
116
|
+
* store attached (or a failed mint) the descriptor still states its
|
|
117
|
+
* counters and the `note` names why there is no ticket — a missing walk must
|
|
118
|
+
* never be mistaken for a short run.
|
|
119
|
+
*/
|
|
120
|
+
export interface WalkDescriptor {
|
|
121
|
+
/** The claim-ticket ref of the minted walk artifact. Absent when no store
|
|
122
|
+
* is attached or the mint failed — `note` says which. */
|
|
123
|
+
readonly ref?: string;
|
|
124
|
+
/** The artifact kind (`'recording/chart-walk'`). Present with `ref`. */
|
|
125
|
+
readonly kind?: string;
|
|
126
|
+
/** Rows in the minted artifact. */
|
|
127
|
+
readonly rows: number;
|
|
128
|
+
/** Total execution steps the narrative recorder counted — spans isolated
|
|
129
|
+
* subflow logs, which the root commit log cannot. */
|
|
130
|
+
readonly steps_executed: number;
|
|
131
|
+
/** `'full'` — every narrative entry fit under the cap; `'control-flow'` —
|
|
132
|
+
* it did not, and the stages/forks/subflows/decisions survived while the
|
|
133
|
+
* per-key reads and writes were dropped. */
|
|
134
|
+
readonly projection: 'full' | 'control-flow';
|
|
135
|
+
readonly shown: number;
|
|
136
|
+
readonly total: number;
|
|
137
|
+
readonly complete: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* WHICH SEGMENT of the run this walk covers. `'full'` for an un-gated run
|
|
140
|
+
* (all of phase 1). When approval gates land, a resumed run's recorders
|
|
141
|
+
* start empty on the fresh executor — its walk will say `'post-resume'`
|
|
142
|
+
* and its counters will count only that segment; the discriminant ships
|
|
143
|
+
* NOW so the wire does not break then.
|
|
144
|
+
*/
|
|
145
|
+
readonly walk_segment: 'full' | 'pre-pause' | 'post-resume';
|
|
146
|
+
/** The human sentence: what the walk is, and (when projected) what the
|
|
147
|
+
* control-flow projection kept and dropped, or why there is no ticket. */
|
|
148
|
+
readonly note: string;
|
|
149
|
+
}
|
|
150
|
+
/** One verdict row, as the chart wrote it. The bridge reads rows from the
|
|
151
|
+
* final state's `verdicts` key and requires only `verdict`; every other
|
|
152
|
+
* column is the app's own vocabulary. */
|
|
153
|
+
export interface VerdictRow {
|
|
154
|
+
readonly verdict: string;
|
|
155
|
+
readonly [column: string]: unknown;
|
|
156
|
+
}
|
|
157
|
+
/** The mandatory-spine + optional-projection envelope every runbook returns
|
|
158
|
+
* (unless an inner absence passed through — then the answer IS that absence,
|
|
159
|
+
* verbatim). Recognized by the framework's coverage funnel at the dispatch
|
|
160
|
+
* boundary like any `coverage()` ledger. */
|
|
161
|
+
export interface RunbookEnvelope {
|
|
162
|
+
readonly af_coverage: {
|
|
163
|
+
readonly checked?: readonly CoverageItem[];
|
|
164
|
+
readonly not_checked?: readonly CoverageItem[];
|
|
165
|
+
readonly cannot_cover?: readonly CoverageItem[];
|
|
166
|
+
/** The static coverage law sentence (the `coverage()` note). */
|
|
167
|
+
readonly note: string;
|
|
168
|
+
/** The run's own sentence — names the rule set and version. */
|
|
169
|
+
readonly sentence: string;
|
|
170
|
+
};
|
|
171
|
+
readonly result: {
|
|
172
|
+
/** Re-emitted FIRST: the carried inner provenance stamp (if any inner
|
|
173
|
+
* tool declared one — a LOCAL SEED confession survives composition)
|
|
174
|
+
* plus this call's own `{tool, toolCallId}`. */
|
|
175
|
+
readonly af_provenance: Readonly<Record<string, unknown>>;
|
|
176
|
+
/** `rules.version`, or the honest `'undeclared'` when no rules were
|
|
177
|
+
* declared — the field never silently vanishes. */
|
|
178
|
+
readonly rule_version: string;
|
|
179
|
+
/** The recorded walk — always present. */
|
|
180
|
+
readonly walk: WalkDescriptor;
|
|
181
|
+
readonly verdicts?: readonly VerdictRow[];
|
|
182
|
+
readonly rows_shown?: number;
|
|
183
|
+
readonly rows_total?: number;
|
|
184
|
+
readonly rows_complete?: boolean;
|
|
185
|
+
/** Pre-rendered markdown table over the SAME rows as `verdicts`. */
|
|
186
|
+
readonly table?: string;
|
|
187
|
+
/** The render law, stated to the model. Present with `table`. */
|
|
188
|
+
readonly render_note?: string;
|
|
189
|
+
/** branch → meaning, GENERATED from the decider's declared branches and
|
|
190
|
+
* the rule labels this run's evidence carried — never hand-restated. */
|
|
191
|
+
readonly verdict_meanings?: Readonly<Record<string, string>>;
|
|
192
|
+
/** Everything the chart put in its `report` state key — the app's own
|
|
193
|
+
* result fields, spread here verbatim (spine keys win). */
|
|
194
|
+
readonly [appField: string]: unknown;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/core/runbook/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,aAAa,C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;QACpE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;QACxB,iEAAiE;QACjE,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;QAC9B;iFACyE;QACzE,QAAQ,CAAC,gBAAgB,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;QAC7D;oEAC4D;QAC5D,QAAQ,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;KACtC,CAAC;CACH"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runbook/verdicts — the OPTIONAL verdict/rowset projection.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: pure selection + rendering over the run's final state, plus one
|
|
5
|
+
* tiny recorder that harvests decide() evidence for generated
|
|
6
|
+
* meanings. Selected by `resultKind: 'verdict/*'`; a runbook of any
|
|
7
|
+
* other kind never sees this module.
|
|
8
|
+
* Role: core/runbook.
|
|
9
|
+
* Emits: N/A.
|
|
10
|
+
*
|
|
11
|
+
* THE ONE-NUMBER LAW: the rendered table and the structured `verdicts` list
|
|
12
|
+
* show the SAME rows under the SAME cap. A rendered table beside a longer
|
|
13
|
+
* structured list is an invitation that gets accepted — rows come back
|
|
14
|
+
* retyped with subtly wrong identifiers.
|
|
15
|
+
*
|
|
16
|
+
* GENERATED MEANINGS, never hand-restated: `verdict_meanings` is composed
|
|
17
|
+
* from (a) the named decider's declared branches in the chart's own structure
|
|
18
|
+
* (branch description, falling back to branch name), overlaid by (b) the rule
|
|
19
|
+
* LABELS this run's decide() evidence carried — the rule speaking for itself.
|
|
20
|
+
* A decider inside a dynamically generated fan-out branch is invisible to (a)
|
|
21
|
+
* by construction (the branch chart does not exist at build time); (b) still
|
|
22
|
+
* covers every verdict an executed rule produced.
|
|
23
|
+
*/
|
|
24
|
+
import type { CombinedRecorder } from 'footprintjs';
|
|
25
|
+
import type { FlowChart } from 'footprintjs';
|
|
26
|
+
import type { VerdictRow } from './types.js';
|
|
27
|
+
/** Default cap on `verdicts` rows and the rendered table. */
|
|
28
|
+
export declare const DEFAULT_MAX_ROWS = 50;
|
|
29
|
+
/** The render law, stated to the model beside every table. */
|
|
30
|
+
export declare const VERDICT_RENDER_NOTE: string;
|
|
31
|
+
/** The reserved verdict word for "no classification was reached" — rows
|
|
32
|
+
* carrying it are counted into the coverage ledger as not-checked ground
|
|
33
|
+
* (the three-outcome honesty: reached, reached-and-clear, DECLINED). */
|
|
34
|
+
export declare const DECLINED_VERDICT = "declined";
|
|
35
|
+
/** Read the rowset off the final state's `verdicts` key — an array of bags
|
|
36
|
+
* each carrying a string `verdict`. Anything else reads as "no rowset". */
|
|
37
|
+
export declare function verdictRowsOf(state: Readonly<Record<string, unknown>>): VerdictRow[];
|
|
38
|
+
/**
|
|
39
|
+
* Render the shown rows as one markdown table. Columns are the FIRST row's
|
|
40
|
+
* own keys in declaration order — the chart writes its rows, so the chart
|
|
41
|
+
* owns the column vocabulary; the bridge only renders it.
|
|
42
|
+
*/
|
|
43
|
+
export declare function renderVerdictTable(rows: readonly VerdictRow[]): string;
|
|
44
|
+
/** The two spellings of the configured decider, once the static walk has
|
|
45
|
+
* (maybe) resolved it — flow events report the decider by name. */
|
|
46
|
+
export interface DeciderIdentity {
|
|
47
|
+
readonly spellings: ReadonlySet<string>;
|
|
48
|
+
/** branch → declared meaning, from the chart's own structure. */
|
|
49
|
+
readonly declared: ReadonlyMap<string, string>;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Find the named decider in the chart's static structure (root graph plus
|
|
53
|
+
* statically declared subflows) and read its branches. Loop-ref stubs are
|
|
54
|
+
* skipped FIRST — they deliberately violate node-id uniqueness.
|
|
55
|
+
*/
|
|
56
|
+
export declare function resolveDecider(chart: FlowChart, decider: string): DeciderIdentity;
|
|
57
|
+
/** The evidence harvest: rule labels observed in this run, branch → label. */
|
|
58
|
+
export interface MeaningsHarvest {
|
|
59
|
+
readonly recorder: CombinedRecorder;
|
|
60
|
+
readonly observed: ReadonlyMap<string, string>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* A tiny flow recorder capturing the named decider's decide() evidence as it
|
|
64
|
+
* fires — collected DURING the traversal, never reconstructed after. Rule
|
|
65
|
+
* labels are harvested for every rule the evidence lists (matched or not):
|
|
66
|
+
* a rule that was evaluated has spoken its label, whichever branch won.
|
|
67
|
+
*
|
|
68
|
+
* A decider inside a subflow (including a generated fan-out branch) reports
|
|
69
|
+
* itself PATH-PREFIXED (`per-subject~0/Protection posture`), so the match is
|
|
70
|
+
* on the LAST `/`-segment — the same last-delimiter reading every upstream
|
|
71
|
+
* parser of these paths uses, which is what keeps the generated-branch
|
|
72
|
+
* marker opaque here.
|
|
73
|
+
*/
|
|
74
|
+
export declare function meaningsRecorder(identity: DeciderIdentity): MeaningsHarvest;
|
|
75
|
+
/** Compose the final meanings: declared branches first, observed rule labels
|
|
76
|
+
* winning where both speak (the rule is the sharper sentence). Undefined
|
|
77
|
+
* when neither source produced anything — absent, never `{}`. */
|
|
78
|
+
export declare function composeMeanings(identity: DeciderIdentity, observed: ReadonlyMap<string, string>): Record<string, string> | undefined;
|
|
79
|
+
//# sourceMappingURL=verdicts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verdicts.d.ts","sourceRoot":"","sources":["../../../../src/core/runbook/verdicts.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAqB,MAAM,aAAa,CAAC;AACvE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,YAAY,CAAC;AAE7C,6DAA6D;AAC7D,eAAO,MAAM,gBAAgB,KAAK,CAAC;AAEnC,8DAA8D;AAC9D,eAAO,MAAM,mBAAmB,QAGoB,CAAC;AAErD;;yEAEyE;AACzE,eAAO,MAAM,gBAAgB,aAAa,CAAC;AAE3C;4EAC4E;AAC5E,wBAAgB,aAAa,CAAC,KAAK,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,GAAG,UAAU,EAAE,CAUpF;AAWD;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,SAAS,UAAU,EAAE,GAAG,MAAM,CAStE;AAgBD;oEACoE;AACpE,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,iEAAiE;IACjE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,GAAG,eAAe,CAyBjF;AAED,8EAA8E;AAC9E,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,eAAe,CAkB3E;AAED;;kEAEkE;AAClE,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,eAAe,EACzB,QAAQ,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAKpC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* runbook/walk — the recorded walk: projection law, counters, mint.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: pure projection (`projectWalk`) + one guarded side effect
|
|
5
|
+
* (`mintWalk`, which files the artifact and NEVER fails the answer).
|
|
6
|
+
* Role: core/runbook. The walk is not a debugging extra — a procedure that
|
|
7
|
+
* cannot show how it reached a verdict is a procedure somebody has
|
|
8
|
+
* to take on trust.
|
|
9
|
+
* Emits: nothing (the artifact capability emits its own `artifacts.*`).
|
|
10
|
+
*
|
|
11
|
+
* THE CAP LAW, and why a head slice is the wrong cap: in a chart walk the
|
|
12
|
+
* per-key reads and writes come FIRST and the decisions come LAST, so a
|
|
13
|
+
* naive head slice over a fleet sweep keeps four hundred writes and drops
|
|
14
|
+
* every decision — a walk with the walking taken out. When the whole thing
|
|
15
|
+
* does not fit, the CONTROL FLOW survives (stages, forks, subflows, and
|
|
16
|
+
* every `condition` entry carrying its decide() evidence) and the projection
|
|
17
|
+
* is DECLARED, so a reader knows which of the two they are holding.
|
|
18
|
+
*/
|
|
19
|
+
import type { ToolExecutionContext } from '../tools.js';
|
|
20
|
+
import type { WalkDescriptor } from './types.js';
|
|
21
|
+
/** The default row cap — a readable artifact, not an archive. The count is
|
|
22
|
+
* always reported, so a truncated walk says it is truncated instead of
|
|
23
|
+
* looking like a short run. */
|
|
24
|
+
export declare const DEFAULT_WALK_CAP = 500;
|
|
25
|
+
/** A narrative entry as this module reads it. `rawValue` is deliberately NOT
|
|
26
|
+
* in the list: it is a LIVE reference into engine memory and has no business
|
|
27
|
+
* in a value checked into an artifact store. */
|
|
28
|
+
export interface NarrativeEntryView {
|
|
29
|
+
readonly type: string;
|
|
30
|
+
readonly text: string;
|
|
31
|
+
readonly depth: number;
|
|
32
|
+
readonly stageName?: string;
|
|
33
|
+
readonly stageId?: string;
|
|
34
|
+
readonly runtimeStageId?: string;
|
|
35
|
+
readonly subflowId?: string;
|
|
36
|
+
}
|
|
37
|
+
/** One walk row — plain data by construction (every field projected). */
|
|
38
|
+
export interface WalkRow {
|
|
39
|
+
readonly step: number;
|
|
40
|
+
readonly type: string;
|
|
41
|
+
readonly depth: number;
|
|
42
|
+
readonly stage: string | null;
|
|
43
|
+
readonly stage_id: string | null;
|
|
44
|
+
readonly runtime_stage_id: string | null;
|
|
45
|
+
readonly subflow: string | null;
|
|
46
|
+
readonly text: string;
|
|
47
|
+
}
|
|
48
|
+
/** The pure projection result — rows plus truthful counters. */
|
|
49
|
+
export interface ProjectedWalk {
|
|
50
|
+
readonly rows: readonly WalkRow[];
|
|
51
|
+
readonly projection: 'full' | 'control-flow';
|
|
52
|
+
readonly shown: number;
|
|
53
|
+
readonly total: number;
|
|
54
|
+
readonly complete: boolean;
|
|
55
|
+
}
|
|
56
|
+
/** Apply the cap law. Counters are about the WHOLE narrative (`total`), so a
|
|
57
|
+
* projected walk cannot read as a short run. */
|
|
58
|
+
export declare function projectWalk(entries: readonly NarrativeEntryView[], cap: number): ProjectedWalk;
|
|
59
|
+
/** What the mint needs from the call. */
|
|
60
|
+
export interface WalkMintFacts {
|
|
61
|
+
readonly toolName: string;
|
|
62
|
+
readonly toolCallId: string;
|
|
63
|
+
readonly runId?: string;
|
|
64
|
+
readonly stepsExecuted: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* File the walk and build the descriptor. THE SPINE ALWAYS GETS A
|
|
68
|
+
* DESCRIPTOR: with no store attached, or when the mint fails, the counters
|
|
69
|
+
* still travel and the note names why there is no ticket — a failed mint
|
|
70
|
+
* costs the TICKET, never the answer and never the counts.
|
|
71
|
+
*/
|
|
72
|
+
export declare function mintWalk(ctx: ToolExecutionContext, projected: ProjectedWalk, facts: WalkMintFacts): Promise<WalkDescriptor>;
|
|
73
|
+
//# sourceMappingURL=walk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"walk.d.ts","sourceRoot":"","sources":["../../../../src/core/runbook/walk.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAExD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD;;gCAEgC;AAChC,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC;;iDAEiD;AACjD,MAAM,W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AAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAC5B,GAAG,EAAE,oBAAoB,EACzB,SAAS,EAAE,aAAa,EACxB,KAAK,EAAE,aAAa,GACnB,OAAO,CAAC,cAAc,CAAC,CA4CzB"}
|
|
@@ -208,6 +208,41 @@ export interface Tool<TArgs = Record<string, unknown>, TResult = unknown> {
|
|
|
208
208
|
* tool is never that check's subject, byte-identical.
|
|
209
209
|
*/
|
|
210
210
|
readonly argumentsFrom?: readonly string[];
|
|
211
|
+
/**
|
|
212
|
+
* THE NAMED INGREDIENT TOOLS THIS TOOL IS COMPOSED OF (9.76.0) — the
|
|
213
|
+
* registered tools its body calls through the run's own dispatch
|
|
214
|
+
* (`ctx.tools`), declared by the author, never inferred.
|
|
215
|
+
*
|
|
216
|
+
* Consumer-side readers, which is what earns it a place here (the
|
|
217
|
+
* `resultKind` / `argumentsFrom` law — a declaration rails read, nothing
|
|
218
|
+
* that governs execution): the agent-build drift gate asserts every named
|
|
219
|
+
* ingredient is a registered tool, so a runbook whose inventory tool was
|
|
220
|
+
* renamed fails the BUILD by name instead of failing its first run; and it
|
|
221
|
+
* joins the MCP `_meta` declaration list so a composed tool served over the
|
|
222
|
+
* wire says what it is made of.
|
|
223
|
+
*
|
|
224
|
+
* Checked at AGENT BUILD, not at definition — the ingredients need not
|
|
225
|
+
* exist before this tool is defined, and the catalog is only complete once
|
|
226
|
+
* every `.tool()` registration has landed. Tools delivered by a
|
|
227
|
+
* `ToolProvider` are invisible to the check (there is no build-time list);
|
|
228
|
+
* with a provider configured the gate warns instead of refusing.
|
|
229
|
+
* Omitted → nothing is checked, byte-identical.
|
|
230
|
+
*/
|
|
231
|
+
readonly composedOf?: readonly string[];
|
|
232
|
+
/**
|
|
233
|
+
* WHETHER THIS TOOL'S PROCEDURE CAN RAISE AN APPROVAL GATE (9.76.0) — a
|
|
234
|
+
* mid-run pause that asks a human before continuing. Declared, never
|
|
235
|
+
* inferred (the `capabilities` law): the framework cannot see through a
|
|
236
|
+
* tool boundary into an inner chart that gates.
|
|
237
|
+
*
|
|
238
|
+
* Consumer-side readers: composition-time checks that must refuse a gating
|
|
239
|
+
* tool where a pause cannot be resumed (a fan-out branch — the runbook
|
|
240
|
+
* grammar's compiler is the named reader). It does not govern execution;
|
|
241
|
+
* the runtime pause refusal remains the backstop for a tool that omits it.
|
|
242
|
+
* `false` is a declaration too ("this procedure never gates"), distinct
|
|
243
|
+
* from saying nothing. Omitted → byte-identical.
|
|
244
|
+
*/
|
|
245
|
+
readonly gates?: boolean;
|
|
211
246
|
/**
|
|
212
247
|
* FINGERPRINT THE REPEATED-CALL LEDGER ON ARGUMENTS ALONE (9.62.0) —
|
|
213
248
|
* `'arguments'` tells `core/agent/repeatedCall.ts` that this tool's own
|
|
@@ -349,6 +384,67 @@ export declare function assertToolOwner(toolName: string, owner: ToolOwner | und
|
|
|
349
384
|
* on a declaration a remote server sent.
|
|
350
385
|
*/
|
|
351
386
|
export declare function assertArgumentsFrom(toolName: string, argumentsFrom: readonly string[] | undefined): void;
|
|
387
|
+
/**
|
|
388
|
+
* Refuse a `composedOf` list that could never be drift-checked, at definition
|
|
389
|
+
* time — the {@link assertArgumentsFrom} law applied to composition: the
|
|
390
|
+
* agent-build gate joins on these names, and a blank one — or a tool composed
|
|
391
|
+
* of itself — would join the wrong subjects or none. The REGISTRATION check
|
|
392
|
+
* (is every named ingredient actually registered?) deliberately does NOT
|
|
393
|
+
* happen here: the ingredients need not exist before this tool is defined,
|
|
394
|
+
* and only the agent build sees the complete catalog.
|
|
395
|
+
*/
|
|
396
|
+
export declare function assertComposedOf(toolName: string, composedOf: readonly string[] | undefined): void;
|
|
397
|
+
/**
|
|
398
|
+
* Refuse a `gates` declaration that is not a boolean, at definition time.
|
|
399
|
+
* Trivial for anyone the compiler vets; load-bearing at the MCP ingest
|
|
400
|
+
* boundary, where a foreign server can put anything under the key and a
|
|
401
|
+
* truthy string would silently declare a gate nobody wrote.
|
|
402
|
+
*/
|
|
403
|
+
export declare function assertGates(toolName: string, gates: boolean | undefined): void;
|
|
404
|
+
/** Options for one {@link ToolDispatch.call}. */
|
|
405
|
+
export interface ToolDispatchCallOptions {
|
|
406
|
+
/** Abort signal for the inner call. Defaults to the outer call's own. */
|
|
407
|
+
readonly signal?: AbortSignal;
|
|
408
|
+
/**
|
|
409
|
+
* Declare an inner ABSENCE survivable (9.76.0). By default a dispatch
|
|
410
|
+
* consumer that composes answers (runbookAsTool) propagates an inner
|
|
411
|
+
* `absent()` as its own answer — "the inventory found nothing" IS the
|
|
412
|
+
* runbook's result, and pretending to a verdict over it would be the
|
|
413
|
+
* confident-partial-answer failure. Pass `true` when the caller can carry
|
|
414
|
+
* on without this source and will state the gap itself (usually as a
|
|
415
|
+
* coverage entry). The raw dispatch delivered on `ctx.tools` returns every
|
|
416
|
+
* result untouched either way — the propagation policy belongs to the
|
|
417
|
+
* consumer that wraps it.
|
|
418
|
+
*/
|
|
419
|
+
readonly allowAbsent?: boolean;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* The run's own tool dispatch, delivered at execute time as `ctx.tools`
|
|
423
|
+
* (9.76.0) — how one tool's body calls ANOTHER registered tool through the
|
|
424
|
+
* same map the model dispatches by, instead of importing its module and
|
|
425
|
+
* building a second query stack.
|
|
426
|
+
*
|
|
427
|
+
* What it sees: the agent's static catalog (`.tool()` registrations plus
|
|
428
|
+
* skill-carried tools) — the same dispatch map the tool-calls handler uses.
|
|
429
|
+
* Tools delivered by a `ToolProvider` are NOT visible (there is no build-time
|
|
430
|
+
* list), a stated caveat, not an accident.
|
|
431
|
+
*
|
|
432
|
+
* What an inner call gets: the outer call's own facts (credentials, signal,
|
|
433
|
+
* progress) with `hasArtifacts: false` — an inner tool must not mint claim
|
|
434
|
+
* tickets competing with the composed answer's own — and a derived
|
|
435
|
+
* `toolCallId` naming the outer call it belongs to. A declared `needs` is
|
|
436
|
+
* resolved before the inner execute (fail-closed: a service that requires
|
|
437
|
+
* interactive consent refuses by name — an inner call cannot pause).
|
|
438
|
+
*/
|
|
439
|
+
export interface ToolDispatch {
|
|
440
|
+
/** Is this name in the dispatch map? Provider-delivered tools answer false. */
|
|
441
|
+
has(name: string): boolean;
|
|
442
|
+
/**
|
|
443
|
+
* Execute a registered tool and return its result exactly as returned —
|
|
444
|
+
* a coverage envelope arrives as the envelope, an absence as the absence.
|
|
445
|
+
*/
|
|
446
|
+
call(name: string, args: unknown, opts?: ToolDispatchCallOptions): Promise<unknown>;
|
|
447
|
+
}
|
|
352
448
|
/** Runtime context passed to tool.execute(). */
|
|
353
449
|
export interface ToolExecutionContext {
|
|
354
450
|
/** Unique id of THIS tool invocation (matches stream.tool_start.toolCallId). */
|
|
@@ -392,6 +488,15 @@ export interface ToolExecutionContext {
|
|
|
392
488
|
/** The credential resolved for this tool's declared `needs` (declare-and-push).
|
|
393
489
|
* Present only when the tool declared a need and it resolved successfully. */
|
|
394
490
|
readonly credential?: Credential;
|
|
491
|
+
/**
|
|
492
|
+
* The run's own tool dispatch (9.76.0) — see {@link ToolDispatch}. Present
|
|
493
|
+
* on the agent's dispatch paths; ABSENT at doors with no dispatch map
|
|
494
|
+
* (`mcpServe`, the offline trace context, a hand-built context in a test).
|
|
495
|
+
* Absent and empty are different facts: branch on the absence rather than
|
|
496
|
+
* optional-chaining past it, and prefer a fail-closed refusal (the
|
|
497
|
+
* `credentials` law) when your tool cannot work without it.
|
|
498
|
+
*/
|
|
499
|
+
readonly tools?: ToolDispatch;
|
|
395
500
|
/**
|
|
396
501
|
* Report progress from INSIDE a long-running tool — "hop 3 of 12 done", said
|
|
397
502
|
* mid-`execute`, while the call is still running.
|
|
@@ -575,6 +680,13 @@ export interface DefineToolOptions<TArgs, TResult> {
|
|
|
575
680
|
readonly owner?: ToolOwner;
|
|
576
681
|
/** The declared argument grounds — see {@link Tool.argumentsFrom}. */
|
|
577
682
|
readonly argumentsFrom?: readonly string[];
|
|
683
|
+
/** The named ingredient tools this tool calls through `ctx.tools` — see
|
|
684
|
+
* {@link Tool.composedOf}. Drift-checked at agent build, when the catalog
|
|
685
|
+
* is complete. Omitted → nothing checked, byte-identical. */
|
|
686
|
+
readonly composedOf?: readonly string[];
|
|
687
|
+
/** Whether this tool's procedure can raise an approval gate — see
|
|
688
|
+
* {@link Tool.gates}. Omitted → nothing declared, byte-identical. */
|
|
689
|
+
readonly gates?: boolean;
|
|
578
690
|
/** Fingerprint the repeated-call ledger on arguments alone, ignoring this
|
|
579
691
|
* tool's own result — see {@link Tool.repeatedWhen}. Omitted →
|
|
580
692
|
* byte-identical (the ledger keeps comparing results, as always). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/core/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAC;AAChE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAC1D,OAAO,EAAmB,KAAK,SAAS,EAAE,MAAM,uBAAuB,CAAC;AACxE,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAkB,KAAK,eAAe,EAAE,MAAM,2BAA2B,CAAC;AACjF,OAAO,EAAsB,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAA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B,CAAC,KAAK,EAAE,OAAO,CAAC,GACzC,IAAI,CAAC,KAAK,EAAE,OAAO,CAAC,CAyEtB"}
|
|
@@ -1791,6 +1791,45 @@ export interface AgentEvidenceCheckedPayload {
|
|
|
1791
1791
|
* tool result. The gate then records its verdict WITHOUT acting on it —
|
|
1792
1792
|
* a partial corpus can call a grounded value fabricated. */
|
|
1793
1793
|
readonly evidenceTruncated?: boolean;
|
|
1794
|
+
/**
|
|
1795
|
+
* On `action: 'revision-asked'` only, and only when the turn held placed
|
|
1796
|
+
* artifact tickets a served `wants` tool can spend: the refs the
|
|
1797
|
+
* correction NAMED as the route to a grounded number. Absent otherwise —
|
|
1798
|
+
* including for every agent without a `wants`-declaring tool.
|
|
1799
|
+
*/
|
|
1800
|
+
readonly stagedRefs?: readonly {
|
|
1801
|
+
readonly ref: string;
|
|
1802
|
+
readonly kind: string;
|
|
1803
|
+
}[];
|
|
1804
|
+
/** The spender tools the correction named, beside {@link stagedRefs}. */
|
|
1805
|
+
readonly spenderTools?: readonly string[];
|
|
1806
|
+
}
|
|
1807
|
+
/**
|
|
1808
|
+
* The staged-refs nudge fired (`.namesAndNumbersFromEvidence({ nudge: true })`)
|
|
1809
|
+
* — one per iteration whose request gained the late line naming staged
|
|
1810
|
+
* artifact refs and the `wants` tool that spends them.
|
|
1811
|
+
*
|
|
1812
|
+
* The line itself is request-only (never history), so this event is the ONE
|
|
1813
|
+
* record that it existed: which refs, which spenders, which iteration. A run
|
|
1814
|
+
* where the nudge never armed emits none of these.
|
|
1815
|
+
*/
|
|
1816
|
+
export interface AgentGroundingNudgedPayload {
|
|
1817
|
+
/** The ReAct iteration whose request carried the line. */
|
|
1818
|
+
readonly iteration: number;
|
|
1819
|
+
/** The staged refs the line named — `ref` verbatim, `kind` as minted
|
|
1820
|
+
* (`Tool.resultKind` / `tool-result/<toolName>`). Capped; see
|
|
1821
|
+
* {@link refsOmitted}. */
|
|
1822
|
+
readonly refs: readonly {
|
|
1823
|
+
readonly ref: string;
|
|
1824
|
+
readonly kind: string;
|
|
1825
|
+
}[];
|
|
1826
|
+
/** Matched refs beyond the cap, stated rather than silently dropped.
|
|
1827
|
+
* Absent when every match was named. */
|
|
1828
|
+
readonly refsOmitted?: number;
|
|
1829
|
+
/** The spender tools named, by their registered names — the tools whose
|
|
1830
|
+
* declared `wants` matched a staged ref's kind, exact-string, never by
|
|
1831
|
+
* tool name. */
|
|
1832
|
+
readonly tools: readonly string[];
|
|
1794
1833
|
}
|
|
1795
1834
|
/**
|
|
1796
1835
|
* The model this run STARTS with, and what may replace it mid-run.
|