agentfootprint 7.3.1 → 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 +26 -4
- 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/embedders/index.js +2 -1
- package/dist/embedders/index.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +31 -5
- package/dist/esm/core/Agent.js +26 -4
- 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/embedders/index.js +2 -1
- package/dist/esm/embedders/index.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 +6 -3
- package/dist/esm/index.js +9 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/context-bisect/index.d.ts +2 -1
- package/dist/esm/lib/context-bisect/index.js +4 -1
- 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/sliceToBacktrackTrace.js +12 -3
- package/dist/esm/lib/context-bisect/sliceToBacktrackTrace.js.map +1 -1
- 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/context-ledger/contextLedger.js +10 -1
- package/dist/esm/lib/context-ledger/contextLedger.js.map +1 -1
- package/dist/esm/lib/context-ledger/gates.js +4 -1
- package/dist/esm/lib/context-ledger/gates.js.map +1 -1
- package/dist/esm/lib/influence-core/attribute.js +4 -1
- package/dist/esm/lib/influence-core/attribute.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/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/esm/observe.d.ts +2 -2
- package/dist/esm/observe.js +2 -2
- package/dist/esm/observe.js.map +1 -1
- 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/sliceToBacktrackTrace.js +12 -3
- package/dist/lib/context-bisect/sliceToBacktrackTrace.js.map +1 -1
- package/dist/lib/context-bisect/types.js.map +1 -1
- package/dist/lib/context-ledger/contextLedger.js +10 -1
- package/dist/lib/context-ledger/contextLedger.js.map +1 -1
- package/dist/lib/context-ledger/gates.js +4 -1
- package/dist/lib/context-ledger/gates.js.map +1 -1
- package/dist/lib/influence-core/attribute.js +4 -1
- package/dist/lib/influence-core/attribute.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/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/observe.js.map +1 -1
- package/dist/recorders/core/CheckInRecorder.js +114 -0
- package/dist/recorders/core/CheckInRecorder.js.map +1 -0
- package/dist/types/core/Agent.d.ts +31 -5
- 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/embedders/index.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 +6 -3
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/context-bisect/index.d.ts +2 -1
- 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/sliceToBacktrackTrace.d.ts.map +1 -1
- 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/context-ledger/contextLedger.d.ts.map +1 -1
- package/dist/types/lib/context-ledger/gates.d.ts.map +1 -1
- package/dist/types/lib/influence-core/attribute.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/lib/trace-toolpack/traceToolpack.d.ts.map +1 -1
- package/dist/types/observe.d.ts +2 -2
- package/dist/types/observe.d.ts.map +1 -1
- 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,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CheckInRecorder — the audit record for evidence-carrying human consent.
|
|
3
|
+
*
|
|
4
|
+
* Two exports, both for `agentfootprint.checkin.*`:
|
|
5
|
+
*
|
|
6
|
+
* • `checkInEventsBridge(...)` — an {@link EmitBridge} factory (same shape as
|
|
7
|
+
* `costRecorder` / `permissionRecorder`). Forwards `checkin.request` /
|
|
8
|
+
* `checkin.decision` `$emit`s to the EventDispatcher so
|
|
9
|
+
* `agent.on('agentfootprint.checkin.*')` fires. Attached ALWAYS by the
|
|
10
|
+
* Agent (zero-cost until a `checkIn`-declaring tool trips) — this is pure
|
|
11
|
+
* wiring, not a store.
|
|
12
|
+
*
|
|
13
|
+
* • `CheckInRecorder` — a compose-a-STORE recorder (no base class). Attach it
|
|
14
|
+
* with `agent.attach(new CheckInRecorder())` to CAPTURE every ask + decision
|
|
15
|
+
* as a queryable record — the "the decision is a record" pillar. It reads
|
|
16
|
+
* the same `$emit` stream (footprintjs calls `onEmit` for every emit), so it
|
|
17
|
+
* works whether or not any `agent.on(...)` listener is attached.
|
|
18
|
+
*
|
|
19
|
+
* Pattern: Factory over EmitBridge (wiring) + compose-a-store CombinedRecorder
|
|
20
|
+
* (capture). Telemetry rides the EMIT channel — never CommitBundle.
|
|
21
|
+
*/
|
|
22
|
+
import type { CombinedRecorder, EmitEvent } from 'footprintjs';
|
|
23
|
+
import { EmitBridge, type EmitBridgeOptions } from './EmitBridge.js';
|
|
24
|
+
import type { CheckInRequest } from '../../core/checkin.js';
|
|
25
|
+
export type CheckInRecorderBridgeOptions = Omit<EmitBridgeOptions, 'id' | 'prefix'> & {
|
|
26
|
+
readonly id?: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* The always-on dispatcher bridge for `agentfootprint.checkin.*`. Wiring only:
|
|
30
|
+
* forwards the emits so typed `agent.on(...)` listeners fire.
|
|
31
|
+
*/
|
|
32
|
+
export declare function checkInEventsBridge(options: CheckInRecorderBridgeOptions): EmitBridge;
|
|
33
|
+
/** One captured check-in ask. */
|
|
34
|
+
export interface CheckInRequestRecord {
|
|
35
|
+
readonly toolName: string;
|
|
36
|
+
readonly toolCallId: string;
|
|
37
|
+
readonly iteration: number;
|
|
38
|
+
/** The typed ask + evidence pack. */
|
|
39
|
+
readonly request: CheckInRequest;
|
|
40
|
+
}
|
|
41
|
+
/** One captured human decision. */
|
|
42
|
+
export interface CheckInDecisionRecord {
|
|
43
|
+
readonly toolName: string;
|
|
44
|
+
readonly toolCallId: string;
|
|
45
|
+
readonly iteration: number;
|
|
46
|
+
readonly approved: boolean;
|
|
47
|
+
readonly by: string;
|
|
48
|
+
readonly note?: string;
|
|
49
|
+
}
|
|
50
|
+
/** Roll-up counts across a run (or the recorder's lifetime). */
|
|
51
|
+
export interface CheckInStats {
|
|
52
|
+
readonly requested: number;
|
|
53
|
+
readonly approved: number;
|
|
54
|
+
readonly declined: number;
|
|
55
|
+
/** Asks with no decision yet (paused, awaiting a human). */
|
|
56
|
+
readonly pending: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A queryable store of every check-in ask + decision. Attach once; read after
|
|
60
|
+
* the run (or between runs — it accumulates across `agent.run()` calls until
|
|
61
|
+
* you detach or make a fresh one).
|
|
62
|
+
*
|
|
63
|
+
* @example
|
|
64
|
+
* const checkins = new CheckInRecorder();
|
|
65
|
+
* agent.attach(checkins);
|
|
66
|
+
* await agent.run({ message });
|
|
67
|
+
* // ...human approves...
|
|
68
|
+
* await agent.resume(outcome.checkpoint, checkInApproved({ by: 'alice' }));
|
|
69
|
+
* checkins.getStats(); // { requested: 1, approved: 1, declined: 0, pending: 0 }
|
|
70
|
+
* checkins.getDecisions(); // [{ toolName, approved: true, by: 'alice', ... }]
|
|
71
|
+
*/
|
|
72
|
+
export declare class CheckInRecorder implements CombinedRecorder {
|
|
73
|
+
readonly id: string;
|
|
74
|
+
private readonly requests;
|
|
75
|
+
private readonly decisions;
|
|
76
|
+
/**
|
|
77
|
+
* @param id Stable recorder id for idempotent attach/detach. Give distinct
|
|
78
|
+
* ids if you attach more than one to the same agent.
|
|
79
|
+
*/
|
|
80
|
+
constructor(id?: string);
|
|
81
|
+
onEmit(event: EmitEvent): void;
|
|
82
|
+
/** Every check-in ask captured, oldest first. */
|
|
83
|
+
getRequests(): readonly CheckInRequestRecord[];
|
|
84
|
+
/** Every human decision captured, oldest first. */
|
|
85
|
+
getDecisions(): readonly CheckInDecisionRecord[];
|
|
86
|
+
/** Roll-up counts. `pending` = asks still awaiting a decision. */
|
|
87
|
+
getStats(): CheckInStats;
|
|
88
|
+
/** Drop all captured records (e.g. between runs when reusing the recorder). */
|
|
89
|
+
reset(): void;
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=CheckInRecorder.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckInRecorder.d.ts","sourceRoot":"","sources":["../../../../src/recorders/core/CheckInRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACrE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAG5D,MAAM,MAAM,4BAA4B,GAAG,IAAI,CAAC,iBAAiB,EAAE,IAAI,GAAG,QAAQ,CAAC,GAAG;IACpF,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,4BAA4B,GAAG,UAAU,CAOrF;AAED,iCAAiC;AACjC,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,qCAAqC;IACrC,QAAQ,CAAC,OAAO,EAAE,cAAc,CAAC;CAClC;AAED,mCAAmC;AACnC,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,gEAAgE;AAChE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,eAAgB,YAAW,gBAAgB;IACtD,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAA8B;IACvD,OAAO,CAAC,QAAQ,CAAC,SAAS,CAA+B;IAEzD;;;OAGG;gBACS,EAAE,SAAoC;IAIlD,MAAM,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IAsB9B,iDAAiD;IACjD,WAAW,IAAI,SAAS,oBAAoB,EAAE;IAI9C,mDAAmD;IACnD,YAAY,IAAI,SAAS,qBAAqB,EAAE;IAIhD,kEAAkE;IAClE,QAAQ,IAAI,YAAY;IAYxB,+EAA+E;IAC/E,KAAK,IAAI,IAAI;CAId"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentfootprint",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.5.0",
|
|
4
4
|
"description": "The explainable agent framework — backtrack a wrong answer to the exact context that caused it (evidence, not guesses). Built on footprintjs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Sanjay Krishna Anbalagan",
|