agentfootprint 7.4.0 → 7.5.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/CLAUDE.md +1 -1
- package/README.md +88 -11
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/dist/core/Agent.js +19 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/RunnerBase.js +12 -1
- package/dist/core/RunnerBase.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +33 -1
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +225 -16
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/checkin.js +266 -0
- package/dist/core/checkin.js.map +1 -0
- package/dist/core/pause.js +17 -1
- package/dist/core/pause.js.map +1 -1
- package/dist/core/tools.js +3 -0
- package/dist/core/tools.js.map +1 -1
- package/dist/debug.js +8 -2
- package/dist/debug.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +6 -1
- package/dist/esm/core/Agent.js +19 -1
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/RunnerBase.js +12 -1
- package/dist/esm/core/RunnerBase.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +27 -0
- package/dist/esm/core/agent/AgentBuilder.js +33 -1
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +9 -0
- package/dist/esm/core/agent/stages/toolCalls.js +225 -16
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +2 -0
- package/dist/esm/core/checkin.d.ts +263 -0
- package/dist/esm/core/checkin.js +254 -0
- package/dist/esm/core/checkin.js.map +1 -0
- package/dist/esm/core/pause.d.ts +24 -0
- package/dist/esm/core/pause.js +15 -0
- package/dist/esm/core/pause.js.map +1 -1
- package/dist/esm/core/tools.d.ts +19 -0
- package/dist/esm/core/tools.js +3 -0
- package/dist/esm/core/tools.js.map +1 -1
- package/dist/esm/debug.d.ts +2 -2
- package/dist/esm/debug.js +2 -2
- package/dist/esm/debug.js.map +1 -1
- package/dist/esm/events/dispatcher.d.ts +1 -1
- package/dist/esm/events/dispatcher.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +19 -0
- package/dist/esm/events/registry.d.ts +7 -1
- package/dist/esm/events/registry.js +6 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/index.d.ts +4 -1
- package/dist/esm/index.js +9 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/context-bisect/index.d.ts +1 -0
- package/dist/esm/lib/context-bisect/index.js +3 -0
- package/dist/esm/lib/context-bisect/index.js.map +1 -1
- package/dist/esm/lib/context-bisect/localize.d.ts +6 -2
- package/dist/esm/lib/context-bisect/localize.js +19 -3
- package/dist/esm/lib/context-bisect/localize.js.map +1 -1
- package/dist/esm/lib/context-bisect/rerun.d.ts +123 -0
- package/dist/esm/lib/context-bisect/rerun.js +155 -0
- package/dist/esm/lib/context-bisect/rerun.js.map +1 -0
- package/dist/esm/lib/context-bisect/types.d.ts +8 -0
- package/dist/esm/lib/context-bisect/types.js.map +1 -1
- package/dist/esm/lib/influence-core/index.d.ts +2 -0
- package/dist/esm/lib/influence-core/index.js +2 -0
- package/dist/esm/lib/influence-core/index.js.map +1 -1
- package/dist/esm/lib/influence-core/lexical.d.ts +60 -0
- package/dist/esm/lib/influence-core/lexical.js +142 -0
- package/dist/esm/lib/influence-core/lexical.js.map +1 -0
- package/dist/esm/lib/influence-core/signals.d.ts +5 -0
- package/dist/esm/lib/influence-core/signals.js +6 -2
- package/dist/esm/lib/influence-core/signals.js.map +1 -1
- package/dist/esm/lib/influence-core/strategies.d.ts +51 -0
- package/dist/esm/lib/influence-core/strategies.js +29 -0
- package/dist/esm/lib/influence-core/strategies.js.map +1 -0
- package/dist/esm/recorders/core/CheckInRecorder.d.ts +90 -0
- package/dist/esm/recorders/core/CheckInRecorder.js +109 -0
- package/dist/esm/recorders/core/CheckInRecorder.js.map +1 -0
- package/dist/events/dispatcher.js.map +1 -1
- package/dist/events/registry.js +6 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/context-bisect/index.js +6 -1
- package/dist/lib/context-bisect/index.js.map +1 -1
- package/dist/lib/context-bisect/localize.js +19 -3
- package/dist/lib/context-bisect/localize.js.map +1 -1
- package/dist/lib/context-bisect/rerun.js +160 -0
- package/dist/lib/context-bisect/rerun.js.map +1 -0
- package/dist/lib/context-bisect/types.js.map +1 -1
- package/dist/lib/influence-core/index.js +7 -1
- package/dist/lib/influence-core/index.js.map +1 -1
- package/dist/lib/influence-core/lexical.js +146 -0
- package/dist/lib/influence-core/lexical.js.map +1 -0
- package/dist/lib/influence-core/signals.js +8 -3
- package/dist/lib/influence-core/signals.js.map +1 -1
- package/dist/lib/influence-core/strategies.js +33 -0
- package/dist/lib/influence-core/strategies.js.map +1 -0
- package/dist/recorders/core/CheckInRecorder.js +114 -0
- package/dist/recorders/core/CheckInRecorder.js.map +1 -0
- package/dist/types/core/Agent.d.ts +6 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/RunnerBase.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +27 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +9 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +2 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/checkin.d.ts +264 -0
- package/dist/types/core/checkin.d.ts.map +1 -0
- package/dist/types/core/pause.d.ts +24 -0
- package/dist/types/core/pause.d.ts.map +1 -1
- package/dist/types/core/tools.d.ts +19 -0
- package/dist/types/core/tools.d.ts.map +1 -1
- package/dist/types/debug.d.ts +2 -2
- package/dist/types/debug.d.ts.map +1 -1
- package/dist/types/events/dispatcher.d.ts +1 -1
- package/dist/types/events/dispatcher.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +19 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +7 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/index.d.ts +1 -0
- package/dist/types/lib/context-bisect/index.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/localize.d.ts +6 -2
- package/dist/types/lib/context-bisect/localize.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/rerun.d.ts +124 -0
- package/dist/types/lib/context-bisect/rerun.d.ts.map +1 -0
- package/dist/types/lib/context-bisect/types.d.ts +8 -0
- package/dist/types/lib/context-bisect/types.d.ts.map +1 -1
- package/dist/types/lib/influence-core/index.d.ts +2 -0
- package/dist/types/lib/influence-core/index.d.ts.map +1 -1
- package/dist/types/lib/influence-core/lexical.d.ts +61 -0
- package/dist/types/lib/influence-core/lexical.d.ts.map +1 -0
- package/dist/types/lib/influence-core/signals.d.ts +5 -0
- package/dist/types/lib/influence-core/signals.d.ts.map +1 -1
- package/dist/types/lib/influence-core/strategies.d.ts +52 -0
- package/dist/types/lib/influence-core/strategies.d.ts.map +1 -0
- package/dist/types/recorders/core/CheckInRecorder.d.ts +91 -0
- package/dist/types/recorders/core/CheckInRecorder.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* checkin — the evidence-carrying human-consent primitive.
|
|
3
|
+
*
|
|
4
|
+
* "OpenWorker-class agents check in; agentfootprint checks in WITH THE
|
|
5
|
+
* RECEIPTS." A tool declares `checkIn` (see `Tool.checkIn` in `core/tools.ts`); when
|
|
6
|
+
* it trips, the tool-dispatch loop pauses BEFORE executing and surfaces a
|
|
7
|
+
* {@link CheckInRequest} — a typed ask that carries an EVIDENCE PACK
|
|
8
|
+
* ({@link CheckInEvidence}): what the tool will do, what context the run
|
|
9
|
+
* consumed, which context drove the choice, and a compact run-so-far trail.
|
|
10
|
+
* A human answers with {@link checkInApproved} / {@link checkInDeclined};
|
|
11
|
+
* the {@link CheckInDecision} lands as a typed record.
|
|
12
|
+
*
|
|
13
|
+
* This is the LEAF that owns every check-in TYPE + the pure assembly logic.
|
|
14
|
+
* It has zero runtime/engine imports (only type-only imports of the message
|
|
15
|
+
* shape + the influence-core attribution unit), so it stays cheap to import
|
|
16
|
+
* and trivial to unit-test. The pause plumbing lives in
|
|
17
|
+
* `core/agent/stages/toolCalls.ts`; the events in `events/`; the store in
|
|
18
|
+
* `recorders/core/CheckInRecorder.ts`.
|
|
19
|
+
*
|
|
20
|
+
* NOT a policy engine (the `PermissionChecker` in `adapters/types.ts` is
|
|
21
|
+
* untouched, and runs BEFORE this gate) and NOT UI. This asks a person to
|
|
22
|
+
* CONSENT, with the receipts attached.
|
|
23
|
+
*
|
|
24
|
+
* Pattern: Strategy (pluggable evidence assembler + driver scorer) + pure
|
|
25
|
+
* value types. Every value here survives `structuredClone` + JSON
|
|
26
|
+
* (checkpoint discipline) — no functions, no class instances.
|
|
27
|
+
*/
|
|
28
|
+
/**
|
|
29
|
+
* Approve a pending check-in — the paused tool executes normally on resume.
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* const decision = checkInApproved({ by: 'alice@ops', note: 'verified with customer' });
|
|
33
|
+
* const final = await agent.resume(outcome.checkpoint, decision);
|
|
34
|
+
*/
|
|
35
|
+
export function checkInApproved(input) {
|
|
36
|
+
return { approved: true, by: input.by, at: Date.now(), ...(input.note && { note: input.note }) };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Decline a pending check-in — the tool is NOT executed; the model receives
|
|
40
|
+
* a `"declined by human: <note>"` tool result and adapts in-loop.
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* const decision = checkInDeclined({ by: 'alice@ops', note: 'amount too high' });
|
|
44
|
+
* const final = await agent.resume(outcome.checkpoint, decision);
|
|
45
|
+
*/
|
|
46
|
+
export function checkInDeclined(input) {
|
|
47
|
+
return { approved: false, by: input.by, at: Date.now(), ...(input.note && { note: input.note }) };
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Type guard — is this resume input a {@link CheckInDecision}? Distinguishes
|
|
51
|
+
* a check-in answer from a plain `askHuman` tool-result value.
|
|
52
|
+
*/
|
|
53
|
+
export function isCheckInDecision(x) {
|
|
54
|
+
return (typeof x === 'object' &&
|
|
55
|
+
x !== null &&
|
|
56
|
+
typeof x.approved === 'boolean' &&
|
|
57
|
+
typeof x.by === 'string');
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Decide whether a tool's declared demand trips for this call. Returns false
|
|
61
|
+
* when the tool declared no `checkIn` (backward-compatible: byte-identical
|
|
62
|
+
* behavior for tools without the field).
|
|
63
|
+
*/
|
|
64
|
+
export function shouldCheckIn(demand, args, ctx) {
|
|
65
|
+
if (demand === undefined)
|
|
66
|
+
return false;
|
|
67
|
+
if (demand === 'always')
|
|
68
|
+
return true;
|
|
69
|
+
try {
|
|
70
|
+
return demand(args, ctx) === true;
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
// A buggy predicate must not let a consequential action slip through
|
|
74
|
+
// unreviewed — fail toward asking the human.
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
const WORD_RE = /[a-z0-9]+/g;
|
|
79
|
+
const STOP = new Set([
|
|
80
|
+
'the',
|
|
81
|
+
'a',
|
|
82
|
+
'an',
|
|
83
|
+
'and',
|
|
84
|
+
'or',
|
|
85
|
+
'to',
|
|
86
|
+
'of',
|
|
87
|
+
'in',
|
|
88
|
+
'on',
|
|
89
|
+
'for',
|
|
90
|
+
'with',
|
|
91
|
+
'is',
|
|
92
|
+
'are',
|
|
93
|
+
'this',
|
|
94
|
+
'that',
|
|
95
|
+
'it',
|
|
96
|
+
'as',
|
|
97
|
+
'at',
|
|
98
|
+
'by',
|
|
99
|
+
'be',
|
|
100
|
+
'you',
|
|
101
|
+
'your',
|
|
102
|
+
'i',
|
|
103
|
+
]);
|
|
104
|
+
function tokenize(text) {
|
|
105
|
+
const out = new Set();
|
|
106
|
+
const lower = text.toLowerCase();
|
|
107
|
+
let m;
|
|
108
|
+
while ((m = WORD_RE.exec(lower))) {
|
|
109
|
+
if (m[0].length > 1 && !STOP.has(m[0]))
|
|
110
|
+
out.add(m[0]);
|
|
111
|
+
}
|
|
112
|
+
WORD_RE.lastIndex = 0;
|
|
113
|
+
return out;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* The default drivers scorer: deterministic Jaccard token overlap between
|
|
117
|
+
* the tool text and each context unit. Zero LLM, zero network, structuredClone
|
|
118
|
+
* -safe output. Ties keep input order (stable sort).
|
|
119
|
+
*/
|
|
120
|
+
export const lexicalDriverScorer = ({ tool, units }) => {
|
|
121
|
+
const toolTokens = tokenize(tool.text);
|
|
122
|
+
const scored = units.map((u) => {
|
|
123
|
+
const unitTokens = tokenize(u.text);
|
|
124
|
+
let shared = 0;
|
|
125
|
+
for (const t of unitTokens)
|
|
126
|
+
if (toolTokens.has(t))
|
|
127
|
+
shared++;
|
|
128
|
+
const union = toolTokens.size + unitTokens.size - shared;
|
|
129
|
+
const score = union === 0 ? 0 : shared / union;
|
|
130
|
+
return { id: u.id, channel: u.channel, text: u.text, score };
|
|
131
|
+
});
|
|
132
|
+
// Stable descending sort — Array.prototype.sort is stable in modern engines.
|
|
133
|
+
return scored.sort((a, b) => b.score - a.score);
|
|
134
|
+
};
|
|
135
|
+
const MAX_SUMMARY = 160;
|
|
136
|
+
function truncate(s, max = MAX_SUMMARY) {
|
|
137
|
+
const flat = s.replace(/\s+/g, ' ').trim();
|
|
138
|
+
return flat.length <= max ? flat : `${flat.slice(0, max - 1)}…`;
|
|
139
|
+
}
|
|
140
|
+
/** Render args as a compact `k=v, k=v` string (values truncated, clone-safe). */
|
|
141
|
+
function renderArgs(args) {
|
|
142
|
+
const parts = Object.entries(args).map(([k, v]) => {
|
|
143
|
+
const val = typeof v === 'string' ? v : v === null || v === undefined ? String(v) : JSON.stringify(v);
|
|
144
|
+
return `${k}=${truncate(val, 60)}`;
|
|
145
|
+
});
|
|
146
|
+
return parts.join(', ');
|
|
147
|
+
}
|
|
148
|
+
/** Plain-words "what will happen" claim. */
|
|
149
|
+
function buildWillDo(tool, args) {
|
|
150
|
+
const desc = tool.description.trim() || tool.name;
|
|
151
|
+
const rendered = renderArgs(args);
|
|
152
|
+
return rendered ? `${desc} — with ${rendered}` : desc;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Derive attribution units from the run-so-far conversation: system rules
|
|
156
|
+
* (split into sentences), the user task, and prior tool results. These feed
|
|
157
|
+
* BOTH `read` (as frames) and `drivers` (scored). Ids are unique + stable.
|
|
158
|
+
*/
|
|
159
|
+
export function unitsFromHistory(history) {
|
|
160
|
+
const units = [];
|
|
161
|
+
let sysN = 0;
|
|
162
|
+
let taskN = 0;
|
|
163
|
+
let resN = 0;
|
|
164
|
+
for (const m of history) {
|
|
165
|
+
const content = (m.content ?? '').trim();
|
|
166
|
+
if (!content)
|
|
167
|
+
continue;
|
|
168
|
+
if (m.role === 'system') {
|
|
169
|
+
// Split the system prompt into rule-sized units so a single rule can be
|
|
170
|
+
// cited. Sentence-ish split; keep non-empty pieces.
|
|
171
|
+
for (const piece of content.split(/(?<=[.!?])\s+|\n+/)) {
|
|
172
|
+
const t = piece.trim();
|
|
173
|
+
if (t)
|
|
174
|
+
units.push({ id: `system-${++sysN}`, channel: 'system', text: t });
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
else if (m.role === 'user') {
|
|
178
|
+
units.push({ id: `task-${++taskN}`, channel: 'task', text: content });
|
|
179
|
+
}
|
|
180
|
+
else if (m.role === 'tool') {
|
|
181
|
+
units.push({
|
|
182
|
+
id: `result-${++resN}`,
|
|
183
|
+
channel: 'result',
|
|
184
|
+
text: m.toolName ? `${m.toolName}: ${content}` : content,
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
return units;
|
|
189
|
+
}
|
|
190
|
+
function framesFromUnits(units) {
|
|
191
|
+
return units.map((u) => ({ channel: u.channel, summary: truncate(u.text) }));
|
|
192
|
+
}
|
|
193
|
+
function buildTrail(history, iteration) {
|
|
194
|
+
const toolCalls = [];
|
|
195
|
+
for (const m of history) {
|
|
196
|
+
if (m.role === 'tool' && m.toolName) {
|
|
197
|
+
// A tool result whose content advertises an error is marked not-ok. The
|
|
198
|
+
// synthetic strings the loop writes ("[permission denied…]", "declined by
|
|
199
|
+
// human…", "credential error…") all read as failures here.
|
|
200
|
+
const c = (m.content ?? '').toLowerCase();
|
|
201
|
+
const ok = !(c.startsWith('[permission denied') ||
|
|
202
|
+
c.startsWith('declined by human') ||
|
|
203
|
+
c.startsWith('credential error') ||
|
|
204
|
+
c.startsWith('authorization required'));
|
|
205
|
+
toolCalls.push({ name: m.toolName, ok });
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const summary = toolCalls.length === 0
|
|
209
|
+
? `no tools run yet (iteration ${iteration})`
|
|
210
|
+
: `${toolCalls.length} tool${toolCalls.length === 1 ? '' : 's'} run over ${iteration} iteration${iteration === 1 ? '' : 's'}`;
|
|
211
|
+
return { iteration, toolCalls, summary };
|
|
212
|
+
}
|
|
213
|
+
/**
|
|
214
|
+
* The `'standard'` assembler — fills all four evidence fields. The `drivers`
|
|
215
|
+
* ranking runs the configured scorer over the run-so-far context units; the
|
|
216
|
+
* default scorer is deterministic and makes zero LLM/network calls.
|
|
217
|
+
*/
|
|
218
|
+
export const standardEvidenceAssembler = async (input) => {
|
|
219
|
+
const { tool, args, iteration, history, scorer, signal } = input;
|
|
220
|
+
const units = unitsFromHistory(history);
|
|
221
|
+
const willDo = buildWillDo(tool, args);
|
|
222
|
+
const read = framesFromUnits(units);
|
|
223
|
+
const trail = buildTrail(history, iteration);
|
|
224
|
+
let drivers = [];
|
|
225
|
+
if (units.length > 0) {
|
|
226
|
+
const toolText = `${tool.name} ${tool.description} ${renderArgs(args)}`.trim();
|
|
227
|
+
drivers = await scorer({
|
|
228
|
+
tool: { name: tool.name, text: toolText },
|
|
229
|
+
units,
|
|
230
|
+
...(signal && { signal }),
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
return { willDo, read, drivers, trail };
|
|
234
|
+
};
|
|
235
|
+
/** The `'minimal'` assembler — only `willDo`. Zero cost; no scorer call. */
|
|
236
|
+
export const minimalEvidenceAssembler = (input) => ({
|
|
237
|
+
willDo: buildWillDo(input.tool, input.args),
|
|
238
|
+
});
|
|
239
|
+
/**
|
|
240
|
+
* Resolve builder options (or nothing) into a runtime config. The default —
|
|
241
|
+
* `standard` evidence + `lexicalDriverScorer` — makes a tool that declares
|
|
242
|
+
* `checkIn` work even when the builder never called `.checkIn()`.
|
|
243
|
+
*/
|
|
244
|
+
export function resolveCheckInConfig(opts) {
|
|
245
|
+
const scorer = opts?.scorer ?? lexicalDriverScorer;
|
|
246
|
+
const evidence = opts?.evidence ?? 'standard';
|
|
247
|
+
const assembler = evidence === 'standard'
|
|
248
|
+
? standardEvidenceAssembler
|
|
249
|
+
: evidence === 'minimal'
|
|
250
|
+
? minimalEvidenceAssembler
|
|
251
|
+
: evidence;
|
|
252
|
+
return { assembler, scorer };
|
|
253
|
+
}
|
|
254
|
+
//# sourceMappingURL=checkin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkin.js","sourceRoot":"","sources":["../../../src/core/checkin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAwGH;;;;;;GAMG;AACH,MAAM,UAAU,eAAe,CAAC,KAA2B;IACzD,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAE,EAAE,EAAE,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,IAAI,CAA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,WAAW,IAAI,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;QAC/E,OAAO,GAAG,MAAM,MAAM,CAAC;YACrB,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzC,KAAK;YACL,GAAG,CAAC,MAAM,IAAI,EAAE,MAAM,EAAE,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC;IACD,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;AAC1C,CAAC,CAAC;AAEF,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAqB,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpE,MAAM,EAAE,WAAW,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC;CAC5C,CAAC,CAAC;AAyBH;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,IAA4B;IAC/D,MAAM,MAAM,GAAG,IAAI,EAAE,MAAM,IAAI,mBAAmB,CAAC;IACnD,MAAM,QAAQ,GAAG,IAAI,EAAE,QAAQ,IAAI,UAAU,CAAC;IAC9C,MAAM,SAAS,GACb,QAAQ,KAAK,UAAU;QACrB,CAAC,CAAC,yBAAyB;QAC3B,CAAC,CAAC,QAAQ,KAAK,SAAS;YACxB,CAAC,CAAC,wBAAwB;YAC1B,CAAC,CAAC,QAAQ,CAAC;IACf,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC"}
|
package/dist/esm/core/pause.d.ts
CHANGED
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* the tool API clean (tools are pure-ish) while still supporting pause.
|
|
17
17
|
*/
|
|
18
18
|
import type { FlowchartCheckpoint } from 'footprintjs';
|
|
19
|
+
import type { CheckInRequest } from './checkin.js';
|
|
19
20
|
/**
|
|
20
21
|
* Outcome returned by `runner.run()` / `runner.resume()` when execution
|
|
21
22
|
* has paused mid-flow. The shape mirrors footprintjs's `PausedResult` but
|
|
@@ -28,9 +29,32 @@ export interface RunnerPauseOutcome {
|
|
|
28
29
|
readonly checkpoint: FlowchartCheckpoint;
|
|
29
30
|
/** Data passed to `scope.$pause()` / `pauseHere()`. Consumer-typed. */
|
|
30
31
|
readonly pauseData: unknown;
|
|
32
|
+
/**
|
|
33
|
+
* Present ONLY when this pause is an evidence-carrying check-in (a tool
|
|
34
|
+
* declared `checkIn`). Carries the typed ask + evidence pack. Absent for
|
|
35
|
+
* plain `askHuman` / `pauseHere` pauses — that's the clean discriminant
|
|
36
|
+
* between the two pause kinds. Resume with a `CheckInDecision`
|
|
37
|
+
* (`checkInApproved` / `checkInDeclined`).
|
|
38
|
+
*/
|
|
39
|
+
readonly checkIn?: CheckInRequest;
|
|
31
40
|
}
|
|
32
41
|
/** Type guard — discriminates `RunnerPauseOutcome` from a normal `TOut`. */
|
|
33
42
|
export declare function isPaused<T>(result: T | RunnerPauseOutcome): result is RunnerPauseOutcome;
|
|
43
|
+
/**
|
|
44
|
+
* Type guard — is this a check-in pause (evidence-carrying human consent),
|
|
45
|
+
* as opposed to a plain `askHuman` pause? Narrows `checkIn` to present.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* const out = await agent.run({ message });
|
|
49
|
+
* if (isCheckInPause(out)) {
|
|
50
|
+
* showToHuman(out.checkIn.evidence); // the receipts
|
|
51
|
+
* const decision = checkInApproved({ by: 'alice' });
|
|
52
|
+
* await agent.resume(out.checkpoint, decision);
|
|
53
|
+
* }
|
|
54
|
+
*/
|
|
55
|
+
export declare function isCheckInPause(result: unknown): result is RunnerPauseOutcome & {
|
|
56
|
+
readonly checkIn: CheckInRequest;
|
|
57
|
+
};
|
|
34
58
|
/**
|
|
35
59
|
* Control-flow error raised by `pauseHere()` inside a tool's `execute()`.
|
|
36
60
|
* Caught by the Agent's tool-call stage, which forwards to `scope.$pause()`.
|
package/dist/esm/core/pause.js
CHANGED
|
@@ -19,6 +19,21 @@
|
|
|
19
19
|
export function isPaused(result) {
|
|
20
20
|
return (typeof result === 'object' && result !== null && result.paused === true);
|
|
21
21
|
}
|
|
22
|
+
/**
|
|
23
|
+
* Type guard — is this a check-in pause (evidence-carrying human consent),
|
|
24
|
+
* as opposed to a plain `askHuman` pause? Narrows `checkIn` to present.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* const out = await agent.run({ message });
|
|
28
|
+
* if (isCheckInPause(out)) {
|
|
29
|
+
* showToHuman(out.checkIn.evidence); // the receipts
|
|
30
|
+
* const decision = checkInApproved({ by: 'alice' });
|
|
31
|
+
* await agent.resume(out.checkpoint, decision);
|
|
32
|
+
* }
|
|
33
|
+
*/
|
|
34
|
+
export function isCheckInPause(result) {
|
|
35
|
+
return isPaused(result) && result.checkIn !== undefined;
|
|
36
|
+
}
|
|
22
37
|
/**
|
|
23
38
|
* Control-flow error raised by `pauseHere()` inside a tool's `execute()`.
|
|
24
39
|
* Caught by the Agent's tool-call stage, which forwards to `scope.$pause()`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pause.js","sourceRoot":"","sources":["../../../src/core/pause.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"pause.js","sourceRoot":"","sources":["../../../src/core/pause.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA2BH,4EAA4E;AAC5E,MAAM,UAAU,QAAQ,CAAI,MAA8B;IACxD,OAAO,CACL,OAAO,MAAM,KAAK,QAAQ,IAAI,MAAM,KAAK,IAAI,IAAK,MAA6B,CAAC,MAAM,KAAK,IAAI,CAChG,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,cAAc,CAC5B,MAAe;IAEf,OAAO,QAAQ,CAAC,MAAM,CAAC,IAAK,MAA6B,CAAC,OAAO,KAAK,SAAS,CAAC;AAClF,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,IAAI,CAAU;IACvB,YAAY,IAAa;QACvB,KAAK,CAAC,cAAc,CAAC,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,kEAAkE;QAClE,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;IAClB,CAAC;CACF;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,SAAS,CAAC,IAAa;IACrC,MAAM,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,8CAA8C;AAC9C,MAAM,UAAU,cAAc,CAAC,GAAY;IACzC,OAAO,CACL,GAAG,YAAY,YAAY;QAC3B,CAAC,GAAG,YAAY,KAAK;YACnB,GAAG,CAAC,IAAI,KAAK,cAAc;YAC3B,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC,CACrD,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,QAAQ,GAAG,SAAS,CAAC"}
|
package/dist/esm/core/tools.d.ts
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
*/
|
|
9
9
|
import type { LLMToolSchema } from '../adapters/types.js';
|
|
10
10
|
import type { Credential, CredentialNeed, CredentialProvider } from '../identity/types.js';
|
|
11
|
+
import type { CheckInDemand } from './checkin.js';
|
|
11
12
|
/**
|
|
12
13
|
* One executable tool the Agent can call.
|
|
13
14
|
*
|
|
@@ -22,6 +23,21 @@ export interface Tool<TArgs = Record<string, unknown>, TResult = unknown> {
|
|
|
22
23
|
* BEFORE invoking and injects `ctx.credential`; it is NOT in `schema`, so the
|
|
23
24
|
* LLM never sees or fills it. */
|
|
24
25
|
readonly needs?: CredentialNeed;
|
|
26
|
+
/**
|
|
27
|
+
* Declarative demand for a human check-in BEFORE this tool runs — consent
|
|
28
|
+
* for a consequential action, with an evidence pack riding the ask.
|
|
29
|
+
* `'always'` trips on every call; a `(args, ctx) => boolean` predicate trips
|
|
30
|
+
* selectively (e.g. only refunds over $1000). When it trips the tool-dispatch
|
|
31
|
+
* loop pauses BEFORE execute and surfaces a `CheckInRequest`; the human
|
|
32
|
+
* answers with `checkInApproved` / `checkInDeclined`. Omitted → byte-identical
|
|
33
|
+
* behavior (no gate, no events, no pause). See `.checkIn()` on the Agent
|
|
34
|
+
* builder to configure the evidence pack. Ordered AFTER the permission gate
|
|
35
|
+
* and arg-validation, BEFORE credential resolution.
|
|
36
|
+
*
|
|
37
|
+
* Non-generic here (a `Tool` widens into `Tool[]` registries); `defineTool`
|
|
38
|
+
* exposes a predicate typed to the tool's args at the CALL site.
|
|
39
|
+
*/
|
|
40
|
+
readonly checkIn?: CheckInDemand;
|
|
25
41
|
execute(args: TArgs, ctx: ToolExecutionContext): Promise<TResult> | TResult;
|
|
26
42
|
}
|
|
27
43
|
/** Runtime context passed to tool.execute(). */
|
|
@@ -69,6 +85,9 @@ export interface DefineToolOptions<TArgs, TResult> {
|
|
|
69
85
|
/** Declare a credential this tool needs (declare-and-push). Resolved by the
|
|
70
86
|
* framework before `execute` and injected as `ctx.credential`. */
|
|
71
87
|
readonly needs?: CredentialNeed;
|
|
88
|
+
/** Demand a human check-in before this tool runs (see {@link Tool.checkIn}).
|
|
89
|
+
* `'always'` or a `(args, ctx) => boolean` predicate. */
|
|
90
|
+
readonly checkIn?: CheckInDemand<TArgs>;
|
|
72
91
|
execute(args: TArgs, ctx: ToolExecutionContext): Promise<TResult> | TResult;
|
|
73
92
|
}
|
|
74
93
|
/**
|
package/dist/esm/core/tools.js
CHANGED
|
@@ -83,6 +83,9 @@ export function defineTool(options) {
|
|
|
83
83
|
inputSchema: options.inputSchema ?? { type: 'object', properties: {} },
|
|
84
84
|
},
|
|
85
85
|
...(options.needs && { needs: options.needs }),
|
|
86
|
+
// The call-site predicate is typed to TArgs; the stored Tool keeps the
|
|
87
|
+
// non-generic shape so it widens into `Tool[]` registries.
|
|
88
|
+
...(options.checkIn !== undefined && { checkIn: options.checkIn }),
|
|
86
89
|
execute: options.execute,
|
|
87
90
|
};
|
|
88
91
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/core/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"tools.js","sourceRoot":"","sources":["../../../src/core/tools.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AA2FxC;;;;;;;;;;;;;;;;;;GAkBG;AACH;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAEjD;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAa;IAC/C,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CACb,yDAAyD,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAClF,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,MAAM,MAAM,GACV,IAAI,CAAC,MAAM,GAAG,EAAE;YACd,CAAC,CAAC,SAAS,IAAI,CAAC,MAAM,iBAAiB;YACvC,CAAC,CAAC,mFAAmF,CAAC;QAC1F,MAAM,IAAI,KAAK,CACb,aAAa,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,MAAM,IAAI;YAC/C,sFAAsF;YACtF,wEAAwE;YACxE,0DAA0D,CAC7D,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,IAAa;IACjD,IAAI,CAAC,SAAS,EAAE;QAAE,OAAO;IACzB,IAAI,CAAC;QACH,mBAAmB,CAAC,IAAI,CAAC,CAAC;IAC5B,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,sCAAsC;QACtC,OAAO,CAAC,IAAI,CAAC,4BAA6B,CAAW,CAAC,OAAO,EAAE,CAAC,CAAC;IACnE,CAAC;AACH,CAAC;AAED,MAAM,UAAU,UAAU,CACxB,OAA0C;IAE1C,qBAAqB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IACpC,OAAO;QACL,MAAM,EAAE;YACN,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,WAAW,EAAE,OAAO,CAAC,WAAW;YAChC,WAAW,EAAE,OAAO,CAAC,WAAW,IAAI,EAAE,IAAI,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,EAAE;SACvE;QACD,GAAG,CAAC,OAAO,CAAC,KAAK,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,CAAC;QAC9C,uEAAuE;QACvE,2DAA2D;QAC3D,GAAG,CAAC,OAAO,CAAC,OAAO,KAAK,SAAS,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,OAAwB,EAAE,CAAC;QACnF,OAAO,EAAE,OAAO,CAAC,OAAO;KACzB,CAAC;AACJ,CAAC"}
|
package/dist/esm/debug.d.ts
CHANGED
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
* For backward compatibility these are ALSO re-exported (deprecated) from
|
|
18
18
|
* `agentfootprint/observe` for one transition version.
|
|
19
19
|
*/
|
|
20
|
-
export { adaptWeights, averageRelevancy, compositeScore, contentHash, DEFAULT_CLEAR_WINNER_MARGIN, DEFAULT_CLEAR_WINNER_RATIO, DEFAULT_INFLUENCE_WEIGHTS, DEFAULT_MARGIN_THRESHOLD, DEFAULT_PERSISTENCE_THRESHOLD, DEFAULT_SHORTLIST_BAND, EmbeddingCache, embeddingCache, finalAnswerSimilarity, attributeChoice, explainChoice, marginStrategy, pairwiseSimilarity, persistence, rankingConfidence, ratioStrategy, scoreContrastiveInfluence, scoreInfluence, scoreMargin, snippetUnits, structuralProximity, type AttributeChoiceArgs, type AttributionUnit, type CandidateScore, type ChannelVerdict, type ChoiceAttribution, type ChoiceExplanation, type ConfidenceStrategy, type Embedder, type EmbeddingCacheOptions, type EmbeddingCacheStats, type EvidenceInput, type ExplainChoiceArgs, type InfluenceScore, type InfluenceScorer, type InfluenceWeights, type MarginCandidate, type MarginResult, type PairwiseSimilarityArgs, type PairwiseSimilarityResult, type RankingConfidence, type RankingConfidenceOptions, type ScoreContrastiveInfluenceArgs, type ScoreInfluenceArgs, type ScoreMarginArgs, type SignalScores, type SimilarityItem, type SimilarityPair, type SnippetUnitsOptions, type UnitScore, } from './lib/influence-core/index.js';
|
|
20
|
+
export { adaptWeights, averageRelevancy, compositeScore, contentHash, DEFAULT_CLEAR_WINNER_MARGIN, DEFAULT_CLEAR_WINNER_RATIO, DEFAULT_INFLUENCE_WEIGHTS, DEFAULT_MARGIN_THRESHOLD, DEFAULT_PERSISTENCE_THRESHOLD, DEFAULT_SHORTLIST_BAND, EmbeddingCache, embeddingCache, finalAnswerSimilarity, attributeChoice, explainChoice, lexicalOverlapStrategy, listInfluenceStrategies, marginStrategy, pairwiseSimilarity, persistence, rankingConfidence, ratioStrategy, scoreContrastiveInfluence, scoreInfluence, scoreLexicalInfluence, scoreMargin, semanticAlignmentStrategy, snippetUnits, structuralProximity, type AttributeChoiceArgs, type AttributionUnit, type CandidateScore, type ChannelVerdict, type ChoiceAttribution, type ChoiceExplanation, type ConfidenceStrategy, type Embedder, type EmbeddingCacheOptions, type EmbeddingCacheStats, type EvidenceInput, type ExplainChoiceArgs, type InfluenceScore, type InfluenceScorer, type InfluenceStrategy, type InfluenceStrategyRequirement, type InfluenceWeights, type MarginCandidate, type MarginResult, type PairwiseSimilarityArgs, type PairwiseSimilarityResult, type RankingConfidence, type RankingConfidenceOptions, type ScoreContrastiveInfluenceArgs, type ScoreInfluenceArgs, type ScoreLexicalInfluenceArgs, type ScoreMarginArgs, type SignalScores, type SimilarityItem, type SimilarityPair, type SnippetUnitsOptions, type UnitScore, } from './lib/influence-core/index.js';
|
|
21
21
|
export { callTraceTool, lazyTraceToolpack, NO_COMPLETED_RUN_MESSAGE, TOOLPACK_HARD_CAPS, traceToolpack, type TraceToolpackArtifacts, type TraceToolpackOptions, } from './lib/trace-toolpack/index.js';
|
|
22
22
|
export { buildSelfExplainSkill, buildSelfExplainToolProvider, SelfExplainBinding, traceDebugAgent, type SelfExplainOptions, type TraceDebugAgentOptions, } from './lib/trace-toolpack/index.js';
|
|
23
|
-
export { ablationForSuspect, applyAblations, assembleTrajectory, assignCostVerdicts, bisectCulprits, bucketByAnchors, shortlistEarlyCulprits, walkToRoot, walkTrajectory, buildWriterFrameIndex, DEFAULT_RECENCY_DECAY, classifySuspect, findLoopHeads, CONTEXT_BISECT_DEFAULTS, defaultOutcomeComparator, defaultSuspectClassifier, findDroppedContext, formatContextBugReport, llmCallIdsFromEvents, llmEdgeWeigher, localizeContextBug, probeFlipped, runAblationProbe, runRestorationProbe, stepOutputText, suspectLabel, verdictFor, type AblationRerun, type AblationRunner, type AblationRunStats, type AblationSpec, type AblationTargets, type AblationVerdict, type AblationVerdictKind, type AnchorBucket, type AssembleTrajectoryOptions, type LoopCandidate, type LoopRecallShortlist, type ShortlistEarlyCulpritsOptions, type RootCauseHop, type RootCauseNote, type RootCausePath, type WalkToRootOptions, type BisectCulpritsOptions, type BisectionProbe, type BisectionResult, type CapturedEventLike, type ClassifyContext, type ContextBugArtifacts, type ContextBugReport, type ContextSource, type ContextUnit, type CostRange, type CostStats, type CostVerdict, type DroppedUnit, type EdgePathStep, type LoopFrame, type HonestyFlag, type HonestyFlagKind, type LlmEdgeWeigherHandle, type LlmEdgeWeigherOptions, type LocalizeContextBugOptions, type MissingContextResult, type OutcomeComparator, type QualityTriggerLookup, type RankedParentEdge, type RestorationProbeConfig, type RestorationRerun, type RestorationRunner, type RestoredCandidate, type RunCost, type SimilarityStats, type SliceStats, type Suspect, type SuspectClass, type SuspectClassifier, type SuspectDetail, type SuspectKind, type SuspectSeed, type SyntheticQuestionNode, type Trajectory, } from './lib/context-bisect/index.js';
|
|
23
|
+
export { ablationForSuspect, applyAblations, assembleTrajectory, assignCostVerdicts, bisectCulprits, bucketByAnchors, shortlistEarlyCulprits, walkToRoot, walkTrajectory, buildWriterFrameIndex, DEFAULT_RECENCY_DECAY, classifySuspect, findLoopHeads, CONTEXT_BISECT_DEFAULTS, defaultOutcomeComparator, defaultSuspectClassifier, findDroppedContext, formatContextBugReport, llmCallIdsFromEvents, llmEdgeWeigher, localizeContextBug, probeFlipped, removableSources, rerunWithoutSources, runAblationProbe, runRestorationProbe, stepOutputText, suspectLabel, verdictFor, type AblationRerun, type AblationRunner, type AblationRunStats, type AblationSpec, type AblationTargets, type AblationVerdict, type AblationVerdictKind, type AnchorBucket, type AssembleTrajectoryOptions, type LoopCandidate, type LoopRecallShortlist, type ShortlistEarlyCulpritsOptions, type RootCauseHop, type RootCauseNote, type RootCausePath, type WalkToRootOptions, type BisectCulpritsOptions, type BisectionProbe, type BisectionResult, type CapturedEventLike, type ClassifyContext, type ContextBugArtifacts, type ContextBugReport, type ContextSource, type ContextUnit, type CostRange, type CostStats, type CostVerdict, type DroppedUnit, type EdgePathStep, type LoopFrame, type HonestyFlag, type HonestyFlagKind, type IgnoredSource, type LlmEdgeWeigherHandle, type LlmEdgeWeigherOptions, type LocalizeContextBugOptions, type MissingContextResult, type OutcomeComparator, type QualityTriggerLookup, type RankedParentEdge, type RemovableSource, type RerunWithoutSourcesOptions, type RerunWithoutSourcesResult, type RestorationProbeConfig, type RestorationRerun, type RestorationRunner, type RestoredCandidate, type RunCost, type SimilarityStats, type SliceStats, type Suspect, type SuspectClass, type SuspectClassifier, type SuspectDetail, type SuspectKind, type SuspectSeed, type SyntheticQuestionNode, type Trajectory, type WhatChanged, } from './lib/context-bisect/index.js';
|
|
24
24
|
export { sliceToBacktrackTrace, toBacktrackTrace, type BacktrackCustodyHop, type BacktrackHop, type BacktrackSuspectCard, type BacktrackTrace, type BacktrackTrail, type SliceToBacktrackTraceOptions, type ToBacktrackTraceOptions, } from './lib/context-bisect/index.js';
|
|
25
25
|
export { analyzeToolCatalog, catalogFromTools, coerceCatalog, confusabilityText, DEFAULT_CONFUSABILITY_THRESHOLD, DEFAULT_OMISSION_CUES, DEFAULT_WATCH_BAND, DEFAULT_WHEN_CUES, defaultStructuralRules, descriptionRule, differentiationHint, enumInProseRule, formatToolCatalogReport, MOCK_EMBEDDER_CALIBRATION, optionalParamRule, runToolLintCli, saysWhatNotWhenRule, type AnalyzeToolCatalogOptions, type CatalogTool, type ConfusablePairFinding, type DescriptionRuleOptions, type FormatReportOptions, type LintRule, type LintSeverity, type OptionalParamRuleOptions, type PairVerdict, type SaysWhatNotWhenRuleOptions, type SimilarityReport, type StructuralFinding, type ToolCatalogReport, type ToolLintCliIO, } from './lib/tool-lint/index.js';
|
package/dist/esm/debug.js
CHANGED
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// + the shared bounded embedding cache. Honest claim: every score is an
|
|
23
23
|
// embedding-geometry PROXY — semantic alignment, never model internals,
|
|
24
24
|
// never causal attribution.
|
|
25
|
-
export { adaptWeights, averageRelevancy, compositeScore, contentHash, DEFAULT_CLEAR_WINNER_MARGIN, DEFAULT_CLEAR_WINNER_RATIO, DEFAULT_INFLUENCE_WEIGHTS, DEFAULT_MARGIN_THRESHOLD, DEFAULT_PERSISTENCE_THRESHOLD, DEFAULT_SHORTLIST_BAND, EmbeddingCache, embeddingCache, finalAnswerSimilarity, attributeChoice, explainChoice, marginStrategy, pairwiseSimilarity, persistence, rankingConfidence, ratioStrategy, scoreContrastiveInfluence, scoreInfluence, scoreMargin, snippetUnits, structuralProximity, } from './lib/influence-core/index.js';
|
|
25
|
+
export { adaptWeights, averageRelevancy, compositeScore, contentHash, DEFAULT_CLEAR_WINNER_MARGIN, DEFAULT_CLEAR_WINNER_RATIO, DEFAULT_INFLUENCE_WEIGHTS, DEFAULT_MARGIN_THRESHOLD, DEFAULT_PERSISTENCE_THRESHOLD, DEFAULT_SHORTLIST_BAND, EmbeddingCache, embeddingCache, finalAnswerSimilarity, attributeChoice, explainChoice, lexicalOverlapStrategy, listInfluenceStrategies, marginStrategy, pairwiseSimilarity, persistence, rankingConfidence, ratioStrategy, scoreContrastiveInfluence, scoreInfluence, scoreLexicalInfluence, scoreMargin, semanticAlignmentStrategy, snippetUnits, structuralProximity, } from './lib/influence-core/index.js';
|
|
26
26
|
// Introspection toolpack (RFC-003 Part C) — footprintjs trace evidence
|
|
27
27
|
// exposed as TOOLS a debugging LLM calls over a COMPLETED run's artifacts.
|
|
28
28
|
// Bounded, honest (⚠ markers), redaction-respecting, id-navigable.
|
|
@@ -38,7 +38,7 @@ export { buildSelfExplainSkill, buildSelfExplainToolProvider, SelfExplainBinding
|
|
|
38
38
|
// counterfactual ablation. §B2 claim tiers: scores/weights are
|
|
39
39
|
// embedding-geometry PROXIES; ablation verdicts are the ONLY causal
|
|
40
40
|
// claims; slice completeness is bounded by tracking — and says so.
|
|
41
|
-
export { ablationForSuspect, applyAblations, assembleTrajectory, assignCostVerdicts, bisectCulprits, bucketByAnchors, shortlistEarlyCulprits, walkToRoot, walkTrajectory, buildWriterFrameIndex, DEFAULT_RECENCY_DECAY, classifySuspect, findLoopHeads, CONTEXT_BISECT_DEFAULTS, defaultOutcomeComparator, defaultSuspectClassifier, findDroppedContext, formatContextBugReport, llmCallIdsFromEvents, llmEdgeWeigher, localizeContextBug, probeFlipped, runAblationProbe, runRestorationProbe, stepOutputText, suspectLabel, verdictFor, } from './lib/context-bisect/index.js';
|
|
41
|
+
export { ablationForSuspect, applyAblations, assembleTrajectory, assignCostVerdicts, bisectCulprits, bucketByAnchors, shortlistEarlyCulprits, walkToRoot, walkTrajectory, buildWriterFrameIndex, DEFAULT_RECENCY_DECAY, classifySuspect, findLoopHeads, CONTEXT_BISECT_DEFAULTS, defaultOutcomeComparator, defaultSuspectClassifier, findDroppedContext, formatContextBugReport, llmCallIdsFromEvents, llmEdgeWeigher, localizeContextBug, probeFlipped, removableSources, rerunWithoutSources, runAblationProbe, runRestorationProbe, stepOutputText, suspectLabel, verdictFor, } from './lib/context-bisect/index.js';
|
|
42
42
|
// BacktrackTrace serializer — feeds agentThinkingUI's <BacktrackView>
|
|
43
43
|
// (the "why?" board) straight off a localizer report. Pure mapping, no
|
|
44
44
|
// UI dependency; the interfaces mirror agentthinkingui's contract.
|
package/dist/esm/debug.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,4BAA4B;AAC5B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,cAAc,EACd,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,iBAAiB,EACjB,aAAa,EACb,yBAAyB,EACzB,cAAc,EACd,WAAW,EACX,YAAY,EACZ,mBAAmB,
|
|
1
|
+
{"version":3,"file":"debug.js","sourceRoot":"","sources":["../../src/debug.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,uEAAuE;AACvE,uEAAuE;AACvE,wEAAwE;AACxE,wEAAwE;AACxE,4BAA4B;AAC5B,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,WAAW,EACX,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,EACzB,wBAAwB,EACxB,6BAA6B,EAC7B,sBAAsB,EACtB,cAAc,EACd,cAAc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AAuE;AACvE,gEAAgE;AAChE,gDAAgD;AAChD,OAAO,EACL,kBAAkB,EAClB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,+BAA+B,EAC/B,qBAAqB,EACrB,kBAAkB,EAClB,iBAAiB,EACjB,sBAAsB,EACtB,eAAe,EACf,mBAAmB,EACnB,eAAe,EACf,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,cAAc,EACd,mBAAmB,GAepB,MAAM,0BAA0B,CAAC"}
|
|
@@ -30,7 +30,7 @@ export interface ListenOptions {
|
|
|
30
30
|
readonly signal?: AbortSignal;
|
|
31
31
|
}
|
|
32
32
|
export type Unsubscribe = () => void;
|
|
33
|
-
export type DomainWildcard = 'agentfootprint.composition.*' | 'agentfootprint.agent.*' | 'agentfootprint.stream.*' | 'agentfootprint.context.*' | 'agentfootprint.memory.*' | 'agentfootprint.tools.*' | 'agentfootprint.skill.*' | 'agentfootprint.permission.*' | 'agentfootprint.risk.*' | 'agentfootprint.fallback.*' | 'agentfootprint.cost.*' | 'agentfootprint.eval.*' | 'agentfootprint.error.*' | 'agentfootprint.pause.*' | 'agentfootprint.embedding.*';
|
|
33
|
+
export type DomainWildcard = 'agentfootprint.composition.*' | 'agentfootprint.agent.*' | 'agentfootprint.stream.*' | 'agentfootprint.context.*' | 'agentfootprint.memory.*' | 'agentfootprint.tools.*' | 'agentfootprint.skill.*' | 'agentfootprint.permission.*' | 'agentfootprint.risk.*' | 'agentfootprint.fallback.*' | 'agentfootprint.cost.*' | 'agentfootprint.eval.*' | 'agentfootprint.error.*' | 'agentfootprint.pause.*' | 'agentfootprint.checkin.*' | 'agentfootprint.embedding.*';
|
|
34
34
|
export type AllWildcard = '*';
|
|
35
35
|
export type WildcardSubscription = DomainWildcard | AllWildcard;
|
|
36
36
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../../src/events/dispatcher.ts"],"names":[],"mappings":"AAAA;;;;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BACtC,OAAO,CAAC,KAAK,CAAC,0CAA0C,IAAI,aAAa,EAAE,GAAG,CAAC,CAAC;YAClF,CAAC,CAAC,CAAC;QACL,CAAC;IACH,CAAC,CAAC;IAEF,YAAY,CAAC,GAAG,CAAC,OAA4B,EAAE,QAAQ,CAAC,CAAC;IACzD,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -299,6 +299,25 @@ export interface PauseResumePayload {
|
|
|
299
299
|
readonly resumeInput: Readonly<Record<string, unknown>>;
|
|
300
300
|
readonly pausedDurationMs: number;
|
|
301
301
|
}
|
|
302
|
+
/** A tool declared `checkIn` and it tripped — the run paused to ask a human,
|
|
303
|
+
* with the evidence pack riding the ask. Emitted BEFORE the tool executes. */
|
|
304
|
+
export interface CheckInRequestPayload {
|
|
305
|
+
readonly toolName: string;
|
|
306
|
+
readonly toolCallId: string;
|
|
307
|
+
readonly iteration: number;
|
|
308
|
+
/** The typed ask + evidence pack (`CheckInRequest`). JSON/clone-safe. */
|
|
309
|
+
readonly request: Readonly<Record<string, unknown>>;
|
|
310
|
+
}
|
|
311
|
+
/** A human answered a pending check-in. Emitted on resume, BEFORE the tool
|
|
312
|
+
* runs (approve) or the decline result lands. */
|
|
313
|
+
export interface CheckInDecisionPayload {
|
|
314
|
+
readonly toolName: string;
|
|
315
|
+
readonly toolCallId: string;
|
|
316
|
+
readonly iteration: number;
|
|
317
|
+
readonly approved: boolean;
|
|
318
|
+
readonly by: string;
|
|
319
|
+
readonly note?: string;
|
|
320
|
+
}
|
|
302
321
|
export interface MemoryStrategyAppliedPayload {
|
|
303
322
|
readonly strategyId: string;
|
|
304
323
|
readonly strategyKind: 'sliding-window' | 'summarizing' | 'semantic' | 'fact-extraction' | 'hybrid';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* major bump. See agentfootprint_v2_detailed_design.md for rules.
|
|
17
17
|
*/
|
|
18
18
|
import type { AgentfootprintEventEnvelope } from './types.js';
|
|
19
|
-
import type { AgentHandoffPayload, AgentIterationEndPayload, AgentIterationStartPayload, AgentRouteDecidedPayload, AgentTurnEndPayload, AgentTurnStartPayload, CompositionEnterPayload, CompositionExitPayload, ConditionalRouteDecidedPayload, ContextBudgetPressurePayload, ContextEvaluatedPayload, ContextEvictedPayload, ContextInjectedPayload, ContextSlotComposedPayload, CostLimitHitPayload, CostTickPayload, EmbeddingGeneratedPayload, ErrorFatalPayload, ErrorRecoveredPayload, ErrorRetriedPayload, EvalScorePayload, EvalThresholdCrossedPayload, AgentOutputSchemaValidationFailedPayload, AgentThinkingParseFailedPayload, StreamThinkingDeltaPayload, StreamThinkingEndPayload, FallbackTriggeredPayload, LLMEndPayload, LLMStartPayload, LLMTokenPayload, LoopIterationExitPayload, LoopIterationStartPayload, MemoryAttachedPayload, MemoryDetachedPayload, MemoryStrategyAppliedPayload, MemoryWrittenPayload, ParallelBranchCompletePayload, ParallelForkStartPayload, ParallelMergeEndPayload, PauseRequestPayload, PauseResumePayload, PermissionCheckPayload, PermissionGateClosedPayload, PermissionHaltPayload, PermissionGateOpenedPayload, CredentialRequestedPayload, CredentialAcquiredPayload, CredentialAuthorizationRequiredPayload, CredentialFailedPayload, ReliabilityFailFastPayload, ReliabilityRetriedPayload, ReliabilityRecoveredPayload, RiskFlaggedPayload, SkillActivatedPayload, SkillDeactivatedPayload, SkillRejectedPayload, ToolEndPayload, ToolsActivatedPayload, ToolsDeactivatedPayload, ToolsDiscoveryStartedPayload, ToolsDiscoveryCompletedPayload, ToolsDiscoveryFailedPayload, ToolsOfferedPayload, ToolStartPayload, ValidationArgsInvalidPayload } from './payloads.js';
|
|
19
|
+
import type { AgentHandoffPayload, AgentIterationEndPayload, AgentIterationStartPayload, AgentRouteDecidedPayload, AgentTurnEndPayload, AgentTurnStartPayload, CompositionEnterPayload, CompositionExitPayload, ConditionalRouteDecidedPayload, ContextBudgetPressurePayload, ContextEvaluatedPayload, ContextEvictedPayload, ContextInjectedPayload, ContextSlotComposedPayload, CostLimitHitPayload, CostTickPayload, EmbeddingGeneratedPayload, ErrorFatalPayload, ErrorRecoveredPayload, ErrorRetriedPayload, EvalScorePayload, EvalThresholdCrossedPayload, AgentOutputSchemaValidationFailedPayload, AgentThinkingParseFailedPayload, StreamThinkingDeltaPayload, StreamThinkingEndPayload, FallbackTriggeredPayload, LLMEndPayload, LLMStartPayload, LLMTokenPayload, LoopIterationExitPayload, LoopIterationStartPayload, MemoryAttachedPayload, MemoryDetachedPayload, MemoryStrategyAppliedPayload, MemoryWrittenPayload, ParallelBranchCompletePayload, ParallelForkStartPayload, ParallelMergeEndPayload, PauseRequestPayload, PauseResumePayload, CheckInRequestPayload, CheckInDecisionPayload, PermissionCheckPayload, PermissionGateClosedPayload, PermissionHaltPayload, PermissionGateOpenedPayload, CredentialRequestedPayload, CredentialAcquiredPayload, CredentialAuthorizationRequiredPayload, CredentialFailedPayload, ReliabilityFailFastPayload, ReliabilityRetriedPayload, ReliabilityRecoveredPayload, RiskFlaggedPayload, SkillActivatedPayload, SkillDeactivatedPayload, SkillRejectedPayload, ToolEndPayload, ToolsActivatedPayload, ToolsDeactivatedPayload, ToolsDiscoveryStartedPayload, ToolsDiscoveryCompletedPayload, ToolsDiscoveryFailedPayload, ToolsOfferedPayload, ToolStartPayload, ValidationArgsInvalidPayload } from './payloads.js';
|
|
20
20
|
export declare const EVENT_NAMES: {
|
|
21
21
|
readonly composition: {
|
|
22
22
|
readonly enter: "agentfootprint.composition.enter";
|
|
@@ -116,6 +116,10 @@ export declare const EVENT_NAMES: {
|
|
|
116
116
|
readonly request: "agentfootprint.pause.request";
|
|
117
117
|
readonly resume: "agentfootprint.pause.resume";
|
|
118
118
|
};
|
|
119
|
+
readonly checkin: {
|
|
120
|
+
readonly request: "agentfootprint.checkin.request";
|
|
121
|
+
readonly decision: "agentfootprint.checkin.decision";
|
|
122
|
+
};
|
|
119
123
|
readonly embedding: {
|
|
120
124
|
readonly generated: "agentfootprint.embedding.generated";
|
|
121
125
|
};
|
|
@@ -185,6 +189,8 @@ export interface AgentfootprintEventMap {
|
|
|
185
189
|
'agentfootprint.reliability.recovered': AgentfootprintEventEnvelope<'agentfootprint.reliability.recovered', ReliabilityRecoveredPayload>;
|
|
186
190
|
'agentfootprint.pause.request': AgentfootprintEventEnvelope<'agentfootprint.pause.request', PauseRequestPayload>;
|
|
187
191
|
'agentfootprint.pause.resume': AgentfootprintEventEnvelope<'agentfootprint.pause.resume', PauseResumePayload>;
|
|
192
|
+
'agentfootprint.checkin.request': AgentfootprintEventEnvelope<'agentfootprint.checkin.request', CheckInRequestPayload>;
|
|
193
|
+
'agentfootprint.checkin.decision': AgentfootprintEventEnvelope<'agentfootprint.checkin.decision', CheckInDecisionPayload>;
|
|
188
194
|
'agentfootprint.embedding.generated': AgentfootprintEventEnvelope<'agentfootprint.embedding.generated', EmbeddingGeneratedPayload>;
|
|
189
195
|
}
|
|
190
196
|
/** Union of every typed event. Consumers use this for exhaustive `switch`. */
|
|
@@ -117,6 +117,10 @@ export const EVENT_NAMES = {
|
|
|
117
117
|
request: 'agentfootprint.pause.request',
|
|
118
118
|
resume: 'agentfootprint.pause.resume',
|
|
119
119
|
},
|
|
120
|
+
checkin: {
|
|
121
|
+
request: 'agentfootprint.checkin.request',
|
|
122
|
+
decision: 'agentfootprint.checkin.decision',
|
|
123
|
+
},
|
|
120
124
|
embedding: {
|
|
121
125
|
generated: 'agentfootprint.embedding.generated',
|
|
122
126
|
},
|
|
@@ -190,6 +194,8 @@ export const ALL_EVENT_TYPES = [
|
|
|
190
194
|
'agentfootprint.reliability.recovered',
|
|
191
195
|
'agentfootprint.pause.request',
|
|
192
196
|
'agentfootprint.pause.resume',
|
|
197
|
+
'agentfootprint.checkin.request',
|
|
198
|
+
'agentfootprint.checkin.decision',
|
|
193
199
|
'agentfootprint.embedding.generated',
|
|
194
200
|
];
|
|
195
201
|
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/events/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/events/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAyEH,yEAAyE;AACzE,gEAAgE;AAChE,wEAAwE;AACxE,MAAM,CAAC,MAAM,WAAW,GAAG;IACzB,WAAW,EAAE;QACX,KAAK,EAAE,kCAAkC;QACzC,IAAI,EAAE,iCAAiC;QACvC,SAAS,EAAE,uCAAuC;QAClD,cAAc,EAAE,4CAA4C;QAC5D,QAAQ,EAAE,sCAAsC;QAChD,YAAY,EAAE,0CAA0C;QACxD,cAAc,EAAE,4CAA4C;QAC5D,aAAa,EAAE,2CAA2C;KAC3D;IACD,KAAK,EAAE;QACL,SAAS,EAAE,iCAAiC;QAC5C,OAAO,EAAE,+BAA+B;QACxC,cAAc,EAAE,sCAAsC;QACtD,YAAY,EAAE,oCAAoC;QAClD,YAAY,EAAE,oCAAoC;QAClD,OAAO,EAAE,8BAA8B;QACvC,4BAA4B,EAAE,sDAAsD;QACpF,mBAAmB,EAAE,4CAA4C;KAClE;IACD,MAAM,EAAE;QACN,QAAQ,EAAE,iCAAiC;QAC3C,MAAM,EAAE,+BAA+B;QACvC,KAAK,EAAE,6BAA6B;QACpC,SAAS,EAAE,kCAAkC;QAC7C,OAAO,EAAE,gCAAgC;QACzC,aAAa,EAAE,sCAAsC;QACrD,WAAW,EAAE,oCAAoC;KAClD;IACD,OAAO,EAAE;QACP,QAAQ,EAAE,iCAAiC;QAC3C,OAAO,EAAE,gCAAgC;QACzC,YAAY,EAAE,sCAAsC;QACpD,cAAc,EAAE,wCAAwC;QACxD,SAAS,EAAE,kCAAkC;KAC9C;IACD,MAAM,EAAE;QACN,eAAe,EAAE,wCAAwC;QACzD,QAAQ,EAAE,gCAAgC;QAC1C,QAAQ,EAAE,gCAAgC;QAC1C,OAAO,EAAE,+BAA+B;KACzC;IACD,KAAK,EAAE;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AAE,oCAAoC;KAChD;CACO,CAAC;AA4SX;;;GAGG;AACH,MAAM,CAAC,MAAM,eAAe,GAAuC;IACjE,kCAAkC;IAClC,iCAAiC;IACjC,uCAAuC;IACvC,4CAA4C;IAC5C,sCAAsC;IACtC,0CAA0C;IAC1C,4CAA4C;IAC5C,2CAA2C;IAC3C,iCAAiC;IACjC,+BAA+B;IAC/B,sCAAsC;IACtC,oCAAoC;IACpC,oCAAoC;IACpC,8BAA8B;IAC9B,sDAAsD;IACtD,4CAA4C;IAC5C,iCAAiC;IACjC,+BAA+B;IAC/B,6BAA6B;IAC7B,kCAAkC;IAClC,gCAAgC;IAChC,sCAAsC;IACtC,oCAAoC;IACpC,iCAAiC;IACjC,gCAAgC;IAChC,sCAAsC;IACtC,wCAAwC;IACxC,kCAAkC;IAClC,wCAAwC;IACxC,gCAAgC;IAChC,gCAAgC;IAChC,+BAA+B;IAC/B,8BAA8B;IAC9B,gCAAgC;IAChC,kCAAkC;IAClC,wCAAwC;IACxC,0CAA0C;IAC1C,uCAAuC;IACvC,wCAAwC;IACxC,gCAAgC;IAChC,kCAAkC;IAClC,+BAA+B;IAC/B,iCAAiC;IACjC,uCAAuC;IACvC,uCAAuC;IACvC,gCAAgC;IAChC,qCAAqC;IACrC,oCAAoC;IACpC,kDAAkD;IAClD,kCAAkC;IAClC,6BAA6B;IAC7B,mCAAmC;IACnC,0BAA0B;IAC1B,+BAA+B;IAC/B,2BAA2B;IAC3B,uCAAuC;IACvC,8BAA8B;IAC9B,gCAAgC;IAChC,4BAA4B;IAC5B,sCAAsC;IACtC,oCAAoC;IACpC,sCAAsC;IACtC,8BAA8B;IAC9B,6BAA6B;IAC7B,gCAAgC;IAChC,iCAAiC;IACjC,oCAAoC;CAC5B,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -17,7 +17,10 @@ export { contextEngineering, isEngineeredSource, isBaselineSource, ENGINEERED_SO
|
|
|
17
17
|
export type { EmittedEvent, EnableNamespace, Runner } from './core/runner.js';
|
|
18
18
|
export { RunnerBase, makeRunId } from './core/RunnerBase.js';
|
|
19
19
|
export type { GroupKind, GroupMember, GroupMetadata, GroupTranslator } from './core/translator.js';
|
|
20
|
-
export { pauseHere, askHuman, isPauseRequest, isPaused, type RunnerPauseOutcome, } from './core/pause.js';
|
|
20
|
+
export { pauseHere, askHuman, isPauseRequest, isPaused, isCheckInPause, type RunnerPauseOutcome, } from './core/pause.js';
|
|
21
|
+
export { checkInApproved, checkInDeclined, isCheckInDecision, lexicalDriverScorer, standardEvidenceAssembler, minimalEvidenceAssembler, type CheckInRequest, type CheckInEvidence, type CheckInContextFrame, type CheckInDriver, type CheckInTrail, type CheckInDecision, type CheckInDecisionInput, type CheckInDemand, type CheckInPredicateContext, type CheckInScorer, type CheckInScoreInput, type CheckInAssembler, type CheckInAssemblerInput, type EvidencePreset, type CheckInBuilderOptions, } from './core/checkin.js';
|
|
22
|
+
export type { AttributionUnit } from './lib/influence-core/types.js';
|
|
23
|
+
export { CheckInRecorder, type CheckInRequestRecord, type CheckInDecisionRecord, type CheckInStats, } from './recorders/core/CheckInRecorder.js';
|
|
21
24
|
export type { FlowchartHandle, FlowchartOptions, } from './recorders/observability/FlowchartRecorder.js';
|
|
22
25
|
export { defaultCommentaryTemplates, extractAgentName, extractCommentaryVars, renderCommentary, selectCommentaryKey, type CommentaryContext, type CommentaryTemplates, } from './recorders/observability/commentary/commentaryTemplates.js';
|
|
23
26
|
export { LLMCall, LLMCallBuilder, type LLMCallInput, type LLMCallOptions, type LLMCallOutput, } from './core/LLMCall.js';
|