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,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* scoreLexicalInfluence — the DETERMINISTIC, zero-dependency influence
|
|
3
|
+
* scorer: the same four-signal FDL frame as `scoreInfluence`
|
|
4
|
+
* (fa / avg / persist / depth, adaptive weights, composite, stable desc
|
|
5
|
+
* sort), with ONE substitution — cosine-over-embeddings becomes set-cosine
|
|
6
|
+
* over word tokens. Nothing here embeds; nothing here calls the network.
|
|
7
|
+
*
|
|
8
|
+
* ## Honest claim (same discipline as `scoreInfluence`, one rung blinder)
|
|
9
|
+
*
|
|
10
|
+
* Every returned `InfluenceScore.signals` / `weights` / `adapted` is
|
|
11
|
+
* GENUINELY computed — nothing is fabricated. But the FA signal here means
|
|
12
|
+
* "shares words with the final answer", NOT "semantically close" and NOT
|
|
13
|
+
* "caused". It is cheaper and BLINDER than `'semantic-alignment'`: a
|
|
14
|
+
* paraphrase (different words, same meaning) is a miss. The claim-ladder
|
|
15
|
+
* guarantee is unchanged — a scorer only reorders suspects; ablation alone
|
|
16
|
+
* convicts. So the worst a lexical ranking does is confirm slower, never
|
|
17
|
+
* wrong.
|
|
18
|
+
*
|
|
19
|
+
* English / ASCII by construction (the tokenizer splits on non-alphanumerics
|
|
20
|
+
* and folds a single trailing plural `s`) — use `'semantic-alignment'` for
|
|
21
|
+
* other languages.
|
|
22
|
+
*/
|
|
23
|
+
import type { Embedder, EvidenceInput, InfluenceScore, InfluenceWeights } from './types.js';
|
|
24
|
+
/**
|
|
25
|
+
* Args for `scoreLexicalInfluence` — a SUPERTYPE of `ScoreInfluenceArgs`:
|
|
26
|
+
* everything the embedding scorer takes, with `embedder` optional and NEVER
|
|
27
|
+
* called. That supertype relationship is what makes `scoreLexicalInfluence`
|
|
28
|
+
* assignable to `InfluenceScorer` (parameter contravariance) while remaining
|
|
29
|
+
* honestly callable with no embedder at all.
|
|
30
|
+
*/
|
|
31
|
+
export interface ScoreLexicalInfluenceArgs {
|
|
32
|
+
/** Evidence items (tool results / context sources) with ancestors. */
|
|
33
|
+
readonly evidence: readonly EvidenceInput[];
|
|
34
|
+
/** The final answer text the evidence is scored against. */
|
|
35
|
+
readonly finalAnswerText: string;
|
|
36
|
+
/** Accepted only for `InfluenceScorer` compatibility. IGNORED — this scorer never embeds. */
|
|
37
|
+
readonly embedder?: Embedder;
|
|
38
|
+
/** Composite weights (same frame as `scoreInfluence`). Default 0.40/0.30/0.20/0.10. */
|
|
39
|
+
readonly weights?: InfluenceWeights;
|
|
40
|
+
/** PERSIST threshold on the LEXICAL overlap scale (set-cosine, 0..1). Default 0.30. */
|
|
41
|
+
readonly persistenceThreshold?: number;
|
|
42
|
+
/** Accepted for compatibility; unused (nothing async to abort — resolves immediately). */
|
|
43
|
+
readonly signal?: AbortSignal;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Score every evidence item on the four FDL signals — the LEXICAL kernel
|
|
47
|
+
* (set-cosine over word tokens instead of embedding cosine) — and rank by
|
|
48
|
+
* composite, descending. Ties keep input order (stable sort).
|
|
49
|
+
*
|
|
50
|
+
* Deterministic: same inputs → byte-identical output, every run, every
|
|
51
|
+
* machine. Zero dependencies, zero network, sync-fast (async only to satisfy
|
|
52
|
+
* the `InfluenceScorer` seam). Never touches `args.embedder` or `args.signal`.
|
|
53
|
+
*
|
|
54
|
+
* Honest claim: ranked WORD-OVERLAP proxies — cheaper and blinder than the
|
|
55
|
+
* embedding scorer (paraphrase = miss). NOT causal attribution — see module
|
|
56
|
+
* docs.
|
|
57
|
+
*
|
|
58
|
+
* @throws on duplicate evidence ids or invalid weights.
|
|
59
|
+
*/
|
|
60
|
+
export declare function scoreLexicalInfluence(args: ScoreLexicalInfluenceArgs): Promise<InfluenceScore[]>;
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { DEFAULT_INFLUENCE_WEIGHTS, DEFAULT_PERSISTENCE_THRESHOLD } from './types.js';
|
|
2
|
+
import { adaptWeights, assertUniqueIds, assertValidWeights, compositeScore, structuralProximity, } from './signals.js';
|
|
3
|
+
/** Small, conservative stop list — fillers that would only add noise to
|
|
4
|
+
* the overlap. Copied verbatim from the injection-engine's `EntryScorer`
|
|
5
|
+
* (influence-core is a leaf — it restates rather than imports). */
|
|
6
|
+
const STOP_WORDS = new Set([
|
|
7
|
+
'a',
|
|
8
|
+
'an',
|
|
9
|
+
'the',
|
|
10
|
+
'and',
|
|
11
|
+
'or',
|
|
12
|
+
'but',
|
|
13
|
+
'if',
|
|
14
|
+
'to',
|
|
15
|
+
'of',
|
|
16
|
+
'for',
|
|
17
|
+
'in',
|
|
18
|
+
'on',
|
|
19
|
+
'at',
|
|
20
|
+
'by',
|
|
21
|
+
'with',
|
|
22
|
+
'is',
|
|
23
|
+
'are',
|
|
24
|
+
'was',
|
|
25
|
+
'were',
|
|
26
|
+
'be',
|
|
27
|
+
'been',
|
|
28
|
+
'it',
|
|
29
|
+
'this',
|
|
30
|
+
'that',
|
|
31
|
+
'these',
|
|
32
|
+
'those',
|
|
33
|
+
'i',
|
|
34
|
+
'you',
|
|
35
|
+
'we',
|
|
36
|
+
'my',
|
|
37
|
+
'our',
|
|
38
|
+
'me',
|
|
39
|
+
'please',
|
|
40
|
+
'can',
|
|
41
|
+
'could',
|
|
42
|
+
'would',
|
|
43
|
+
'should',
|
|
44
|
+
'do',
|
|
45
|
+
'does',
|
|
46
|
+
'how',
|
|
47
|
+
'what',
|
|
48
|
+
'need',
|
|
49
|
+
'want',
|
|
50
|
+
]);
|
|
51
|
+
/**
|
|
52
|
+
* Lowercase → split on non-alphanumerics → drop 1-char tokens + stop words →
|
|
53
|
+
* light plural fold → set. The plural fold (drop a single trailing `s` on
|
|
54
|
+
* tokens length ≥ 4, but never `-ss`) lets `refund` match `refunds` while
|
|
55
|
+
* `address` stays `address`. ASCII-only by construction (the regex splits
|
|
56
|
+
* away non-Latin/accented text — use `'semantic-alignment'` for other
|
|
57
|
+
* languages).
|
|
58
|
+
*/
|
|
59
|
+
function tokenize(text) {
|
|
60
|
+
const out = new Set();
|
|
61
|
+
for (const raw of text.toLowerCase().split(/[^a-z0-9]+/)) {
|
|
62
|
+
if (raw.length < 2 || STOP_WORDS.has(raw))
|
|
63
|
+
continue;
|
|
64
|
+
const fold = raw.length >= 4 && raw.endsWith('s') && !raw.endsWith('ss');
|
|
65
|
+
out.add(fold ? raw.slice(0, -1) : raw);
|
|
66
|
+
}
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
/** |A ∩ B| / sqrt(|A| · |B|) — set cosine, range [0, 1]. Empty either side → 0.
|
|
70
|
+
* Iterates the smaller set (same kernel as EntryScorer's `setCosine`). */
|
|
71
|
+
function overlap(a, b) {
|
|
72
|
+
if (a.size === 0 || b.size === 0)
|
|
73
|
+
return 0;
|
|
74
|
+
const [small, large] = a.size <= b.size ? [a, b] : [b, a];
|
|
75
|
+
let shared = 0;
|
|
76
|
+
for (const t of small)
|
|
77
|
+
if (large.has(t))
|
|
78
|
+
shared += 1;
|
|
79
|
+
return shared / Math.sqrt(a.size * b.size);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Score every evidence item on the four FDL signals — the LEXICAL kernel
|
|
83
|
+
* (set-cosine over word tokens instead of embedding cosine) — and rank by
|
|
84
|
+
* composite, descending. Ties keep input order (stable sort).
|
|
85
|
+
*
|
|
86
|
+
* Deterministic: same inputs → byte-identical output, every run, every
|
|
87
|
+
* machine. Zero dependencies, zero network, sync-fast (async only to satisfy
|
|
88
|
+
* the `InfluenceScorer` seam). Never touches `args.embedder` or `args.signal`.
|
|
89
|
+
*
|
|
90
|
+
* Honest claim: ranked WORD-OVERLAP proxies — cheaper and blinder than the
|
|
91
|
+
* embedding scorer (paraphrase = miss). NOT causal attribution — see module
|
|
92
|
+
* docs.
|
|
93
|
+
*
|
|
94
|
+
* @throws on duplicate evidence ids or invalid weights.
|
|
95
|
+
*/
|
|
96
|
+
export async function scoreLexicalInfluence(args) {
|
|
97
|
+
const weights = args.weights ?? DEFAULT_INFLUENCE_WEIGHTS;
|
|
98
|
+
assertValidWeights(weights, 'scoreLexicalInfluence');
|
|
99
|
+
const threshold = args.persistenceThreshold ?? DEFAULT_PERSISTENCE_THRESHOLD;
|
|
100
|
+
assertUniqueIds(args.evidence, 'scoreLexicalInfluence');
|
|
101
|
+
// One deduplicated tokenization pass over every distinct text.
|
|
102
|
+
const tokensByText = new Map();
|
|
103
|
+
const tokensOf = (text) => {
|
|
104
|
+
let set = tokensByText.get(text);
|
|
105
|
+
if (set === undefined) {
|
|
106
|
+
set = tokenize(text);
|
|
107
|
+
tokensByText.set(text, set);
|
|
108
|
+
}
|
|
109
|
+
return set;
|
|
110
|
+
};
|
|
111
|
+
const answerTokens = tokensOf(args.finalAnswerText);
|
|
112
|
+
const scored = args.evidence.map((item) => {
|
|
113
|
+
const evidenceTokens = tokensOf(item.text);
|
|
114
|
+
const ancestorTokens = item.ancestorTexts.map((t) => tokensOf(t));
|
|
115
|
+
const n = ancestorTokens.length;
|
|
116
|
+
let avgSum = 0;
|
|
117
|
+
let above = 0;
|
|
118
|
+
for (const ancestor of ancestorTokens) {
|
|
119
|
+
const sim = overlap(evidenceTokens, ancestor);
|
|
120
|
+
avgSum += sim;
|
|
121
|
+
if (sim > threshold)
|
|
122
|
+
above += 1;
|
|
123
|
+
}
|
|
124
|
+
const signals = {
|
|
125
|
+
fa: overlap(evidenceTokens, answerTokens),
|
|
126
|
+
avg: n === 0 ? 0 : avgSum / n,
|
|
127
|
+
persist: n === 0 ? 0 : above / n,
|
|
128
|
+
depth: structuralProximity(n),
|
|
129
|
+
};
|
|
130
|
+
const effective = adaptWeights(weights, n);
|
|
131
|
+
return {
|
|
132
|
+
id: item.id,
|
|
133
|
+
signals,
|
|
134
|
+
weights: effective.weights,
|
|
135
|
+
adapted: effective.adapted,
|
|
136
|
+
score: compositeScore(signals, effective.weights),
|
|
137
|
+
};
|
|
138
|
+
});
|
|
139
|
+
// Stable sort — equal scores keep evidence input order.
|
|
140
|
+
return scored.sort((a, b) => b.score - a.score);
|
|
141
|
+
}
|
|
142
|
+
//# sourceMappingURL=lexical.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lexical.js","sourceRoot":"","sources":["../../../../src/lib/influence-core/lexical.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,yBAAyB,EAAE,6BAA6B,EAAE,MAAM,YAAY,CAAC;AACtF,OAAO,EACL,YAAY,EACZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EACd,mBAAmB,GACpB,MAA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,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,OAAO,EAAE,SAAS,CAAC,OAAO;YAC1B,KAAK,EAAE,cAAc,CAAC,OAAO,EAAE,SAAS,CAAC,OAAO,CAAC;SAClD,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,wDAAwD;IACxD,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AAClD,CAAC"}
|
|
@@ -126,3 +126,8 @@ export declare function embedAll(embedder: Embedder, texts: readonly string[], s
|
|
|
126
126
|
* attributes the error to the actual caller.
|
|
127
127
|
*/
|
|
128
128
|
export declare function assertValidWeights(weights: InfluenceWeights, fnName?: string): void;
|
|
129
|
+
/**
|
|
130
|
+
* Validate that every evidence id is unique. Shared by `scoreInfluence` and
|
|
131
|
+
* `scoreLexicalInfluence` — `fnName` attributes the error to the actual caller.
|
|
132
|
+
*/
|
|
133
|
+
export declare function assertUniqueIds(evidence: readonly EvidenceInput[], fnName?: string): void;
|
|
@@ -225,11 +225,15 @@ export function assertValidWeights(weights, fnName = 'scoreInfluence') {
|
|
|
225
225
|
throw new Error(`${fnName}: all weights are zero — the composite would always be 0`);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
|
-
|
|
228
|
+
/**
|
|
229
|
+
* Validate that every evidence id is unique. Shared by `scoreInfluence` and
|
|
230
|
+
* `scoreLexicalInfluence` — `fnName` attributes the error to the actual caller.
|
|
231
|
+
*/
|
|
232
|
+
export function assertUniqueIds(evidence, fnName = 'scoreInfluence') {
|
|
229
233
|
const seen = new Set();
|
|
230
234
|
for (const item of evidence) {
|
|
231
235
|
if (seen.has(item.id)) {
|
|
232
|
-
throw new Error(
|
|
236
|
+
throw new Error(`${fnName}: duplicate evidence id '${item.id}' — ids must be unique`);
|
|
233
237
|
}
|
|
234
238
|
seen.add(item.id);
|
|
235
239
|
}
|
|
@@ -1 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AAC;QAC5B,IAAI,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,GAAG,MAAM,4BAA4B,IAAI,CAAC,EAAE,wBAAwB,CAAC,CAAC;QACxF,CAAC;QACD,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named influence strategies — a plain-named descriptor AROUND the already-
|
|
3
|
+
* public `InfluenceScorer` function seam, exactly the shape a host UI's
|
|
4
|
+
* strategy selector needs (mirrors the `EntryScorer` / `ConfidenceStrategy`
|
|
5
|
+
* "name shown in any strategy picker" precedent).
|
|
6
|
+
*
|
|
7
|
+
* A strategy is `{ name, description, requirements, scorer }`. Two ship:
|
|
8
|
+
* • `semanticAlignmentStrategy` — the FDL four-signal embedding composite
|
|
9
|
+
* (`scoreInfluence`). The default; needs an embedder.
|
|
10
|
+
* • `lexicalOverlapStrategy` — deterministic word overlap
|
|
11
|
+
* (`scoreLexicalInfluence`). Free, zero deps; requires nothing.
|
|
12
|
+
*
|
|
13
|
+
* `listInfluenceStrategies()` enumerates them so a selector can render the
|
|
14
|
+
* two options and grey out what the host can't run (`requirements`).
|
|
15
|
+
*
|
|
16
|
+
* Sugar, not a replacement: `localizeContextBug({ scorer })` still accepts a
|
|
17
|
+
* bare `InfluenceScorer` function; it now ALSO accepts one of these.
|
|
18
|
+
*/
|
|
19
|
+
import type { InfluenceScorer } from './signals.js';
|
|
20
|
+
/**
|
|
21
|
+
* What a strategy needs the host to supply before it can run. A selector UI
|
|
22
|
+
* greys out strategies whose requirements the host can't meet. `'embedder'`
|
|
23
|
+
* is the only well-known value today; the type stays open for consumer
|
|
24
|
+
* strategies (`'llm'`, `'reference-run'`, …).
|
|
25
|
+
*/
|
|
26
|
+
export type InfluenceStrategyRequirement = 'embedder' | (string & Record<never, never>);
|
|
27
|
+
/**
|
|
28
|
+
* A NAMED influence-scoring strategy — an `InfluenceScorer` plus the metadata
|
|
29
|
+
* a strategy picker needs. Sugar AROUND the function seam, not a replacement:
|
|
30
|
+
* `localizeContextBug({ scorer })` accepts either a bare `InfluenceScorer` or
|
|
31
|
+
* one of these.
|
|
32
|
+
*/
|
|
33
|
+
export interface InfluenceStrategy {
|
|
34
|
+
/** Stable kebab-case id — shown in a selector, echoed on `ContextBugReport.rankedBy`. */
|
|
35
|
+
readonly name: string;
|
|
36
|
+
/** One-or-two-sentence plain description for the picker, honesty caveat included. */
|
|
37
|
+
readonly description: string;
|
|
38
|
+
/** What the host must supply to run this strategy (empty = runs anywhere, $0). */
|
|
39
|
+
readonly requirements: readonly InfluenceStrategyRequirement[];
|
|
40
|
+
/** The scorer itself — plugs into `localizeContextBug({ scorer })` directly. */
|
|
41
|
+
readonly scorer: InfluenceScorer;
|
|
42
|
+
}
|
|
43
|
+
/** The DEFAULT: the FDL four-signal embedding composite (`scoreInfluence`). */
|
|
44
|
+
export declare const semanticAlignmentStrategy: InfluenceStrategy;
|
|
45
|
+
/** The cheap option: deterministic word overlap (`scoreLexicalInfluence`), zero deps. */
|
|
46
|
+
export declare const lexicalOverlapStrategy: InfluenceStrategy;
|
|
47
|
+
/**
|
|
48
|
+
* The built-in strategies, default first. Frozen — a host UI renders its
|
|
49
|
+
* selector straight off this (concat your own custom strategies after).
|
|
50
|
+
*/
|
|
51
|
+
export declare function listInfluenceStrategies(): readonly InfluenceStrategy[];
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { scoreInfluence } from './signals.js';
|
|
2
|
+
import { scoreLexicalInfluence } from './lexical.js';
|
|
3
|
+
/** The DEFAULT: the FDL four-signal embedding composite (`scoreInfluence`). */
|
|
4
|
+
export const semanticAlignmentStrategy = Object.freeze({
|
|
5
|
+
name: 'semantic-alignment',
|
|
6
|
+
description: 'Ranks sources by how semantically close their content is to the final answer, using ' +
|
|
7
|
+
'embeddings (the four-signal composite). The default. Needs an embedder; scores are a ' +
|
|
8
|
+
'proxy for alignment, never proof of cause.',
|
|
9
|
+
requirements: Object.freeze(['embedder']),
|
|
10
|
+
scorer: scoreInfluence,
|
|
11
|
+
});
|
|
12
|
+
/** The cheap option: deterministic word overlap (`scoreLexicalInfluence`), zero deps. */
|
|
13
|
+
export const lexicalOverlapStrategy = Object.freeze({
|
|
14
|
+
name: 'lexical-overlap',
|
|
15
|
+
description: 'Ranks sources by plain word overlap with the final answer. Deterministic, free, no ' +
|
|
16
|
+
'dependencies — the simpler, cheaper option. Misses paraphrases; same proxy caveat: ' +
|
|
17
|
+
'overlap is not cause.',
|
|
18
|
+
requirements: Object.freeze([]),
|
|
19
|
+
scorer: scoreLexicalInfluence,
|
|
20
|
+
});
|
|
21
|
+
const BUILT_IN = Object.freeze([semanticAlignmentStrategy, lexicalOverlapStrategy]);
|
|
22
|
+
/**
|
|
23
|
+
* The built-in strategies, default first. Frozen — a host UI renders its
|
|
24
|
+
* selector straight off this (concat your own custom strategies after).
|
|
25
|
+
*/
|
|
26
|
+
export function listInfluenceStrategies() {
|
|
27
|
+
return BUILT_IN;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=strategies.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strategies.js","sourceRoot":"","sources":["../../../../src/lib/influence-core/strategies.ts"],"names":[],"mappings":"AAmBA,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AA2BrD,+EAA+E;AAC/E,MAAM,CAAC,MAAM,yBAAyB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACxE,IAAI,EAAE,oBAAoB;IAC1B,WAAW,EACT,sFAAsF;QACtF,uFAAuF;QACvF,4CAA4C;IAC9C,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,CAAC,UAAU,CAAU,CAAC;IAClD,MAAM,EAAE,cAAc;CACvB,CAAC,CAAC;AAEH,yFAAyF;AACzF,MAAM,CAAC,MAAM,sBAAsB,GAAsB,MAAM,CAAC,MAAM,CAAC;IACrE,IAAI,EAAE,iBAAiB;IACvB,WAAW,EACT,qFAAqF;QACrF,qFAAqF;QACrF,uBAAuB;IACzB,YAAY,EAAE,MAAM,CAAC,MAAM,CAAC,EAAW,CAAC;IACxC,MAAM,EAAE,qBAAqB;CAC9B,CAAC,CAAC;AAEH,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,yBAAyB,EAAE,sBAAsB,CAAC,CAAC,CAAC;AAEpF;;;GAGG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,90 @@
|
|
|
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
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
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 { EmitBridge } from './EmitBridge.js';
|
|
23
|
+
/**
|
|
24
|
+
* The always-on dispatcher bridge for `agentfootprint.checkin.*`. Wiring only:
|
|
25
|
+
* forwards the emits so typed `agent.on(...)` listeners fire.
|
|
26
|
+
*/
|
|
27
|
+
export function checkInEventsBridge(options) {
|
|
28
|
+
return new EmitBridge({
|
|
29
|
+
id: options.id ?? 'agentfootprint.checkin-bridge',
|
|
30
|
+
prefix: 'agentfootprint.checkin.',
|
|
31
|
+
dispatcher: options.dispatcher,
|
|
32
|
+
getRunContext: options.getRunContext,
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A queryable store of every check-in ask + decision. Attach once; read after
|
|
37
|
+
* the run (or between runs — it accumulates across `agent.run()` calls until
|
|
38
|
+
* you detach or make a fresh one).
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* const checkins = new CheckInRecorder();
|
|
42
|
+
* agent.attach(checkins);
|
|
43
|
+
* await agent.run({ message });
|
|
44
|
+
* // ...human approves...
|
|
45
|
+
* await agent.resume(outcome.checkpoint, checkInApproved({ by: 'alice' }));
|
|
46
|
+
* checkins.getStats(); // { requested: 1, approved: 1, declined: 0, pending: 0 }
|
|
47
|
+
* checkins.getDecisions(); // [{ toolName, approved: true, by: 'alice', ... }]
|
|
48
|
+
*/
|
|
49
|
+
export class CheckInRecorder {
|
|
50
|
+
id;
|
|
51
|
+
requests = [];
|
|
52
|
+
decisions = [];
|
|
53
|
+
/**
|
|
54
|
+
* @param id Stable recorder id for idempotent attach/detach. Give distinct
|
|
55
|
+
* ids if you attach more than one to the same agent.
|
|
56
|
+
*/
|
|
57
|
+
constructor(id = 'agentfootprint.checkin-recorder') {
|
|
58
|
+
this.id = id;
|
|
59
|
+
}
|
|
60
|
+
onEmit(event) {
|
|
61
|
+
if (event.name === 'agentfootprint.checkin.request') {
|
|
62
|
+
const p = event.payload;
|
|
63
|
+
this.requests.push({
|
|
64
|
+
toolName: p.toolName,
|
|
65
|
+
toolCallId: p.toolCallId,
|
|
66
|
+
iteration: p.iteration,
|
|
67
|
+
request: p.request,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
else if (event.name === 'agentfootprint.checkin.decision') {
|
|
71
|
+
const p = event.payload;
|
|
72
|
+
this.decisions.push({
|
|
73
|
+
toolName: p.toolName,
|
|
74
|
+
toolCallId: p.toolCallId,
|
|
75
|
+
iteration: p.iteration,
|
|
76
|
+
approved: p.approved,
|
|
77
|
+
by: p.by,
|
|
78
|
+
...(p.note !== undefined && { note: p.note }),
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
/** Every check-in ask captured, oldest first. */
|
|
83
|
+
getRequests() {
|
|
84
|
+
return this.requests;
|
|
85
|
+
}
|
|
86
|
+
/** Every human decision captured, oldest first. */
|
|
87
|
+
getDecisions() {
|
|
88
|
+
return this.decisions;
|
|
89
|
+
}
|
|
90
|
+
/** Roll-up counts. `pending` = asks still awaiting a decision. */
|
|
91
|
+
getStats() {
|
|
92
|
+
let approved = 0;
|
|
93
|
+
let declined = 0;
|
|
94
|
+
for (const d of this.decisions)
|
|
95
|
+
d.approved ? approved++ : declined++;
|
|
96
|
+
return {
|
|
97
|
+
requested: this.requests.length,
|
|
98
|
+
approved,
|
|
99
|
+
declined,
|
|
100
|
+
pending: this.requests.length - this.decisions.length,
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
/** Drop all captured records (e.g. between runs when reusing the recorder). */
|
|
104
|
+
reset() {
|
|
105
|
+
this.requests.length = 0;
|
|
106
|
+
this.decisions.length = 0;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=CheckInRecorder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CheckInRecorder.js","sourceRoot":"","sources":["../../../../src/recorders/core/CheckInRecorder.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AAQrE;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAqC;IACvE,OAAO,IAAI,UAAU,CAAC;QACpB,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,+BAA+B;QACjD,MAAM,EAAE,yBAAyB;QACjC,UAAU,EAAE,OAAO,CAAC,UAAU;QAC9B,aAAa,EAAE,OAAO,CAAC,aAAa;KACrC,CAAC,CAAC;AACL,CAAC;AA8BD;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,eAAe;IACjB,EAAE,CAAS;IACH,QAAQ,GAA2B,EAAE,CAAC;IACtC,SAAS,GAA4B,EAAE,CAAC;IAEzD;;;OAGG;IACH,YAAY,EAAE,GAAG,iCAAiC;QAChD,IAAI,CAAC,EAAE,GAAG,EAAE,CAAC;IACf,CAAC;IAED,MAAM,CAAC,KAAgB;QACrB,IAAI,KAAK,CAAC,IAAI,KAAK,gCAAgC,EAAE,CAAC;YACpD,MAAM,CAAC,GAAG,KAAK,CAAC,OAAgC,CAAC;YACjD,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC;gBACjB,QA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CAAC;IAED,+EAA+E;IAC/E,KAAK;QACH,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC;QACzB,IAAI,CAAC,SAAS,CAAC,MAAM,GAAG,CAAC,CAAC;IAC5B,CAAC;CACF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/events/dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,6CAAwC;AA0BxC;2EAC2E;AAC3E,MAAM,eAAe,GAAgB,GAAG,EAAE,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"dispatcher.js","sourceRoot":"","sources":["../../src/events/dispatcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;;;AAEH,6CAAwC;AA0BxC;2EAC2E;AAC3E,MAAM,eAAe,GAAgB,GAAG,EAAE,CAAC,SAAS,CAAC;AAmDrD;;;GAGG;AACH,SAAS,WAAW,CAAC,MAA2B;IAC9C,KAAK,MAAM,MAAM,IAAI,MAAM;QAAE,MAAM,CAAC,OAAO,EAAE,EAAE,CAAC;IAChD,MAAM,CAAC,KAAK,EAAE,CAAC;AACjB,CAAC;AAED,wEAAwE;AAExE;;;;;GAKG;AACH,MAAa,eAAe;IACT,MAAM,GAAG,IAAI,GAAG,EAA+B,CAAC;IAChD,eAAe,GAAG,IAAI,GAAG,EAA+B,CAAC;IACzD,YAAY,GAAG,IAAI,GAAG,EAAkB,CAAC;IAE1D,qEAAqE;IAErE;;;OAGG;IACH,eAAe,CAAC,IAA6B;QAC3C,IAAI,IAAI,CAAC,YAAY,CAAC,IAAI,GAAG,CAAC;YAAE,OAAO,IAAI,CAAC;QAC5C,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACpC,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,GAAG,CAAC;YAAE,O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,MAAM,EAAE,CAAC;YAC7D,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACV,kCAAkC,IAAI,yBAAyB;gBAC7D,0EAA0E;gBAC1E,sEAAsE;gBACtE,+DAA+D,CAClE,CAAC;YACF,8DAA8D;YAC7D,MAA2B,CAAC,KAAK,CAAC,CAAC,GAAY,EAAE,EAAE;gBAClD,sCAAsC;gBACtC,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"}
|
package/dist/events/registry.js
CHANGED
|
@@ -120,6 +120,10 @@ exports.EVENT_NAMES = {
|
|
|
120
120
|
request: 'agentfootprint.pause.request',
|
|
121
121
|
resume: 'agentfootprint.pause.resume',
|
|
122
122
|
},
|
|
123
|
+
checkin: {
|
|
124
|
+
request: 'agentfootprint.checkin.request',
|
|
125
|
+
decision: 'agentfootprint.checkin.decision',
|
|
126
|
+
},
|
|
123
127
|
embedding: {
|
|
124
128
|
generated: 'agentfootprint.embedding.generated',
|
|
125
129
|
},
|
|
@@ -193,6 +197,8 @@ exports.ALL_EVENT_TYPES = [
|
|
|
193
197
|
'agentfootprint.reliability.recovered',
|
|
194
198
|
'agentfootprint.pause.request',
|
|
195
199
|
'agentfootprint.pause.resume',
|
|
200
|
+
'agentfootprint.checkin.request',
|
|
201
|
+
'agentfootprint.checkin.decision',
|
|
196
202
|
'agentfootprint.embedding.generated',
|
|
197
203
|
];
|
|
198
204
|
//# 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","sourceRo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