agentfootprint 8.6.0 → 8.8.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 +12 -4
- package/CLAUDE.md +4 -2
- package/README.md +1 -1
- package/ai-instructions/claude-code/SKILL.md +1 -1
- package/ai-instructions/setup.sh +0 -0
- package/bin/agentfootprint-lint-tools.mjs +0 -0
- package/dist/core/agent/AgentBuilder.js +104 -0
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js +12 -1
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart.js +12 -1
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/memoryRecallInjections.js +100 -10
- package/dist/core/agent/memoryRecallInjections.js.map +1 -1
- package/dist/core/agent/stages/deliver.js.map +1 -1
- package/dist/core/slots/buildSystemPromptSlot.js +10 -0
- package/dist/core/slots/buildSystemPromptSlot.js.map +1 -1
- package/dist/core/slots/buildToolsSlot.js +77 -0
- package/dist/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/core/slots/helpers.js +12 -10
- package/dist/core/slots/helpers.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.js +104 -0
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.js +13 -2
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildDynamicAgentChart.js +13 -2
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/memoryRecallInjections.d.ts +13 -3
- package/dist/esm/core/agent/memoryRecallInjections.js +101 -11
- package/dist/esm/core/agent/memoryRecallInjections.js.map +1 -1
- package/dist/esm/core/agent/stages/deliver.d.ts +6 -3
- package/dist/esm/core/agent/stages/deliver.js.map +1 -1
- package/dist/esm/core/slots/buildSystemPromptSlot.js +10 -0
- package/dist/esm/core/slots/buildSystemPromptSlot.js.map +1 -1
- package/dist/esm/core/slots/buildToolsSlot.js +78 -1
- package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/core/slots/helpers.d.ts +11 -2
- package/dist/esm/core/slots/helpers.js +11 -9
- package/dist/esm/core/slots/helpers.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +92 -0
- package/dist/esm/events/registry.d.ts +5 -1
- package/dist/esm/events/registry.js +4 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/index.d.ts +2 -1
- package/dist/esm/index.js +6 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/fnv1a.d.ts +16 -0
- package/dist/esm/lib/fnv1a.js +24 -0
- package/dist/esm/lib/fnv1a.js.map +1 -0
- package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.d.ts +15 -0
- package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.js +16 -0
- package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineSkill.d.ts +9 -0
- package/dist/esm/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/esm/lib/injection-engine/index.d.ts +3 -3
- package/dist/esm/lib/injection-engine/index.js +8 -3
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillContract.d.ts +25 -2
- package/dist/esm/lib/injection-engine/skillContract.js +11 -4
- package/dist/esm/lib/injection-engine/skillContract.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraph.d.ts +65 -4
- package/dist/esm/lib/injection-engine/skillGraph.js +36 -11
- package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +47 -7
- package/dist/esm/lib/injection-engine/skillGraphCheckup.js +165 -13
- package/dist/esm/lib/injection-engine/skillGraphCheckup.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillsFromDir.d.ts +24 -0
- package/dist/esm/lib/injection-engine/skillsFromDir.js +19 -0
- package/dist/esm/lib/injection-engine/skillsFromDir.js.map +1 -1
- package/dist/esm/lib/injection-engine/types.d.ts +25 -0
- package/dist/esm/lib/injection-engine/types.js.map +1 -1
- package/dist/esm/lib/rag/defineRAG.d.ts +126 -26
- package/dist/esm/lib/rag/defineRAG.js +112 -25
- package/dist/esm/lib/rag/defineRAG.js.map +1 -1
- package/dist/esm/lib/rag/index.d.ts +1 -1
- package/dist/esm/lib/rag/index.js +1 -1
- package/dist/esm/lib/rag/index.js.map +1 -1
- package/dist/esm/memory/define.js +38 -2
- package/dist/esm/memory/define.js.map +1 -1
- package/dist/esm/memory/define.types.d.ts +93 -1
- package/dist/esm/memory/define.types.js +18 -0
- package/dist/esm/memory/define.types.js.map +1 -1
- package/dist/esm/memory/embedding/loadRelevant.d.ts +49 -15
- package/dist/esm/memory/embedding/loadRelevant.js +136 -7
- package/dist/esm/memory/embedding/loadRelevant.js.map +1 -1
- package/dist/esm/memory/index.d.ts +2 -1
- package/dist/esm/memory/index.js +2 -1
- package/dist/esm/memory/index.js.map +1 -1
- package/dist/esm/memory/pipeline/semantic.d.ts +15 -0
- package/dist/esm/memory/pipeline/semantic.js +3 -1
- package/dist/esm/memory/pipeline/semantic.js.map +1 -1
- package/dist/esm/memory/retrieval/index.d.ts +10 -0
- package/dist/esm/memory/retrieval/index.js +3 -0
- package/dist/esm/memory/retrieval/index.js.map +1 -0
- package/dist/esm/memory/retrieval/provenance.d.ts +43 -0
- package/dist/esm/memory/retrieval/provenance.js +60 -0
- package/dist/esm/memory/retrieval/provenance.js.map +1 -0
- package/dist/esm/memory/retrieval/topK.d.ts +67 -0
- package/dist/esm/memory/retrieval/topK.js +53 -0
- package/dist/esm/memory/retrieval/topK.js.map +1 -0
- package/dist/esm/memory/retrieval/types.d.ts +189 -0
- package/dist/esm/memory/retrieval/types.js +2 -0
- package/dist/esm/memory/retrieval/types.js.map +1 -0
- package/dist/esm/memory/stages/formatDefault.d.ts +52 -26
- package/dist/esm/memory/stages/formatDefault.js +118 -28
- package/dist/esm/memory/stages/formatDefault.js.map +1 -1
- package/dist/esm/memory/stages/pickByBudget.js +53 -3
- package/dist/esm/memory/stages/pickByBudget.js.map +1 -1
- package/dist/esm/memory/stages/types.d.ts +15 -0
- package/dist/esm/memory/wire/mountMemoryPipeline.d.ts +25 -0
- package/dist/esm/memory/wire/mountMemoryPipeline.js +11 -2
- package/dist/esm/memory/wire/mountMemoryPipeline.js.map +1 -1
- package/dist/esm/tool-providers/index.d.ts +1 -1
- package/dist/esm/tool-providers/index.js +4 -1
- package/dist/esm/tool-providers/index.js.map +1 -1
- package/dist/esm/tool-providers/skillScopedTools.d.ts +4 -0
- package/dist/esm/tool-providers/skillScopedTools.js +33 -2
- package/dist/esm/tool-providers/skillScopedTools.js.map +1 -1
- package/dist/esm/tool-providers/types.d.ts +25 -0
- package/dist/events/registry.js +4 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/fnv1a.js +28 -0
- package/dist/lib/fnv1a.js.map +1 -0
- package/dist/lib/injection-engine/factories/defineRelevanceHint.js +17 -1
- package/dist/lib/injection-engine/factories/defineRelevanceHint.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/lib/injection-engine/index.js +7 -1
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/lib/injection-engine/skillContract.js +11 -4
- package/dist/lib/injection-engine/skillContract.js.map +1 -1
- package/dist/lib/injection-engine/skillGraph.js +37 -11
- package/dist/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/lib/injection-engine/skillGraphCheckup.js +165 -13
- package/dist/lib/injection-engine/skillGraphCheckup.js.map +1 -1
- package/dist/lib/injection-engine/skillsFromDir.js +19 -0
- package/dist/lib/injection-engine/skillsFromDir.js.map +1 -1
- package/dist/lib/injection-engine/types.js.map +1 -1
- package/dist/lib/rag/defineRAG.js +113 -26
- package/dist/lib/rag/defineRAG.js.map +1 -1
- package/dist/lib/rag/index.js +2 -1
- package/dist/lib/rag/index.js.map +1 -1
- package/dist/memory/define.js +38 -2
- package/dist/memory/define.js.map +1 -1
- package/dist/memory/define.types.js +21 -1
- package/dist/memory/define.types.js.map +1 -1
- package/dist/memory/embedding/loadRelevant.js +138 -8
- package/dist/memory/embedding/loadRelevant.js.map +1 -1
- package/dist/memory/index.js +5 -1
- package/dist/memory/index.js.map +1 -1
- package/dist/memory/pipeline/semantic.js +2 -0
- package/dist/memory/pipeline/semantic.js.map +1 -1
- package/dist/memory/retrieval/index.js +9 -0
- package/dist/memory/retrieval/index.js.map +1 -0
- package/dist/memory/retrieval/provenance.js +65 -0
- package/dist/memory/retrieval/provenance.js.map +1 -0
- package/dist/memory/retrieval/topK.js +57 -0
- package/dist/memory/retrieval/topK.js.map +1 -0
- package/dist/memory/retrieval/types.js +3 -0
- package/dist/memory/retrieval/types.js.map +1 -0
- package/dist/memory/stages/formatDefault.js +118 -28
- package/dist/memory/stages/formatDefault.js.map +1 -1
- package/dist/memory/stages/pickByBudget.js +53 -3
- package/dist/memory/stages/pickByBudget.js.map +1 -1
- package/dist/memory/wire/mountMemoryPipeline.js +11 -2
- package/dist/memory/wire/mountMemoryPipeline.js.map +1 -1
- package/dist/tool-providers/index.js +5 -1
- package/dist/tool-providers/index.js.map +1 -1
- package/dist/tool-providers/skillScopedTools.js +35 -3
- package/dist/tool-providers/skillScopedTools.js.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/buildDynamicAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/memoryRecallInjections.d.ts +13 -3
- package/dist/types/core/agent/memoryRecallInjections.d.ts.map +1 -1
- package/dist/types/core/agent/stages/deliver.d.ts +6 -3
- package/dist/types/core/agent/stages/deliver.d.ts.map +1 -1
- package/dist/types/core/slots/buildSystemPromptSlot.d.ts.map +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
- package/dist/types/core/slots/helpers.d.ts +11 -2
- package/dist/types/core/slots/helpers.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +92 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +5 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/fnv1a.d.ts +17 -0
- package/dist/types/lib/fnv1a.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/factories/defineRelevanceHint.d.ts +15 -0
- package/dist/types/lib/injection-engine/factories/defineRelevanceHint.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts +9 -0
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/index.d.ts +3 -3
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillContract.d.ts +25 -2
- package/dist/types/lib/injection-engine/skillContract.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraph.d.ts +65 -4
- package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts +47 -7
- package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillsFromDir.d.ts +24 -0
- package/dist/types/lib/injection-engine/skillsFromDir.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/types.d.ts +25 -0
- package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
- package/dist/types/lib/rag/defineRAG.d.ts +126 -26
- package/dist/types/lib/rag/defineRAG.d.ts.map +1 -1
- package/dist/types/lib/rag/index.d.ts +1 -1
- package/dist/types/lib/rag/index.d.ts.map +1 -1
- package/dist/types/memory/define.d.ts.map +1 -1
- package/dist/types/memory/define.types.d.ts +93 -1
- package/dist/types/memory/define.types.d.ts.map +1 -1
- package/dist/types/memory/embedding/loadRelevant.d.ts +49 -15
- package/dist/types/memory/embedding/loadRelevant.d.ts.map +1 -1
- package/dist/types/memory/index.d.ts +2 -1
- package/dist/types/memory/index.d.ts.map +1 -1
- package/dist/types/memory/pipeline/semantic.d.ts +15 -0
- package/dist/types/memory/pipeline/semantic.d.ts.map +1 -1
- package/dist/types/memory/retrieval/index.d.ts +11 -0
- package/dist/types/memory/retrieval/index.d.ts.map +1 -0
- package/dist/types/memory/retrieval/provenance.d.ts +44 -0
- package/dist/types/memory/retrieval/provenance.d.ts.map +1 -0
- package/dist/types/memory/retrieval/topK.d.ts +68 -0
- package/dist/types/memory/retrieval/topK.d.ts.map +1 -0
- package/dist/types/memory/retrieval/types.d.ts +190 -0
- package/dist/types/memory/retrieval/types.d.ts.map +1 -0
- package/dist/types/memory/stages/formatDefault.d.ts +52 -26
- package/dist/types/memory/stages/formatDefault.d.ts.map +1 -1
- package/dist/types/memory/stages/pickByBudget.d.ts.map +1 -1
- package/dist/types/memory/stages/types.d.ts +15 -0
- package/dist/types/memory/stages/types.d.ts.map +1 -1
- package/dist/types/memory/wire/mountMemoryPipeline.d.ts +25 -0
- package/dist/types/memory/wire/mountMemoryPipeline.d.ts.map +1 -1
- package/dist/types/tool-providers/index.d.ts +1 -1
- package/dist/types/tool-providers/index.d.ts.map +1 -1
- package/dist/types/tool-providers/skillScopedTools.d.ts +4 -0
- package/dist/types/tool-providers/skillScopedTools.d.ts.map +1 -1
- package/dist/types/tool-providers/types.d.ts +25 -0
- package/dist/types/tool-providers/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* iteration. Full permission gating / skill activation / context-aware
|
|
11
11
|
* tool filtering arrives in Phase 5.
|
|
12
12
|
*/
|
|
13
|
-
import { flowChart } from 'footprintjs';
|
|
13
|
+
import { flowChart, isDevMode } from 'footprintjs';
|
|
14
14
|
import { INJECTION_KEYS } from '../../conventions.js';
|
|
15
15
|
import { COMPOSITION_KEYS } from '../../recorders/core/types.js';
|
|
16
16
|
import { typedEmit } from '../../recorders/core/typedEmit.js';
|
|
@@ -35,6 +35,9 @@ export function buildToolsSlot(config) {
|
|
|
35
35
|
// typed `context.budget_pressure` event still fires every iteration and
|
|
36
36
|
// carries the per-iteration truth.
|
|
37
37
|
let warnedOverflow = false;
|
|
38
|
+
// Same latch discipline for the provider↔skill tool-name shadow warning (8.7.0):
|
|
39
|
+
// one console line per offending NAME per built chart. The typed event is unlatched.
|
|
40
|
+
const warnedShadow = new Set();
|
|
38
41
|
// Stage 1 — Discover: consult the external ToolProvider (if any) and
|
|
39
42
|
// resolve its Tool[] for this iteration. ALWAYS runs (even when no
|
|
40
43
|
// provider) so the trace shape is consistent across agents — the
|
|
@@ -59,9 +62,17 @@ export function buildToolsSlot(config) {
|
|
|
59
62
|
const env = scope.$getEnv();
|
|
60
63
|
const activatedIds = scope.$getValue('activatedInjectionIds') ?? [];
|
|
61
64
|
const identity = scope.$getValue('runIdentity');
|
|
65
|
+
// `activeSkillIds` is the REAL active set (8.7.0) — every skill the injection
|
|
66
|
+
// engine resolved for this iteration, whatever activated it. `activeSkillId`
|
|
67
|
+
// stays what it always was: the tail of `activatedInjectionIds`, which only
|
|
68
|
+
// `read_skill` writes. The two answer different questions and both are needed.
|
|
69
|
+
const activeSkillIds = (scope.$getValue('activeInjections') ?? [])
|
|
70
|
+
.filter((inj) => inj.flavor === 'skill')
|
|
71
|
+
.map((inj) => inj.id);
|
|
62
72
|
const ctx = {
|
|
63
73
|
iteration,
|
|
64
74
|
...(activatedIds.length > 0 && { activeSkillId: activatedIds[activatedIds.length - 1] }),
|
|
75
|
+
...(activeSkillIds.length > 0 && { activeSkillIds }),
|
|
65
76
|
...(identity && { identity }),
|
|
66
77
|
...(env.signal && { signal: env.signal }),
|
|
67
78
|
};
|
|
@@ -204,6 +215,13 @@ export function buildToolsSlot(config) {
|
|
|
204
215
|
merged.push(t);
|
|
205
216
|
}
|
|
206
217
|
scope.toolSchemas = merged;
|
|
218
|
+
reportShadowedTools(scope, {
|
|
219
|
+
iteration,
|
|
220
|
+
...(toolProvider?.id && { providerId: toolProvider.id }),
|
|
221
|
+
providerSchemas,
|
|
222
|
+
activeInjections,
|
|
223
|
+
warnedShadow,
|
|
224
|
+
});
|
|
207
225
|
const composition = composeSlot('tools', iteration, injections, budgetCap, toolProvider ? 'registry+provider+injections' : 'registry+injections');
|
|
208
226
|
scope.$setValue(COMPOSITION_KEYS.SLOT_COMPOSED, composition);
|
|
209
227
|
// Overflow is LOUD. Nothing here truncates — the full tool definitions
|
|
@@ -233,4 +251,63 @@ export function buildToolsSlot(config) {
|
|
|
233
251
|
.addFunction('Compose', composeStage, 'compose', 'Compose tools slot')
|
|
234
252
|
.build();
|
|
235
253
|
}
|
|
254
|
+
/**
|
|
255
|
+
* Report a tool name a `ToolProvider` and an active SKILL both claim (8.7.0).
|
|
256
|
+
*
|
|
257
|
+
* The two sources disagree in opposite directions, and both directions are laws of
|
|
258
|
+
* this codebase rather than races:
|
|
259
|
+
*
|
|
260
|
+
* • **The provider wins the LLM's tool list.** The merge above is
|
|
261
|
+
* `[static, provider, skill]` with first-occurrence-wins, and an
|
|
262
|
+
* `autoActivate: 'currentSkill'` skill's tools are deliberately kept OUT of the
|
|
263
|
+
* static registry (`buildToolRegistry`), so the provider's schema — its name, its
|
|
264
|
+
* description, its `inputSchema` — is the one the model reads.
|
|
265
|
+
* • **The skill wins dispatch.** `lookupTool` checks `registryByName` first, and
|
|
266
|
+
* every skill tool is in that map (`buildToolRegistry` adds autoActivate tools
|
|
267
|
+
* explicitly so dispatch resolves once the skill is active). Provider tools are
|
|
268
|
+
* not in it. So the skill's `execute` is what runs.
|
|
269
|
+
*
|
|
270
|
+
* The model therefore reads one contract and calls a different implementation, with
|
|
271
|
+
* nothing in the trace saying so. Reported rather than refused: the provider's list
|
|
272
|
+
* is resolved per iteration (`list(ctx)`) and the skill has to be active, so there is
|
|
273
|
+
* no build-time moment at which this is knowable.
|
|
274
|
+
*
|
|
275
|
+
* A static `.tool()` colliding with a skill tool is NOT reported here —
|
|
276
|
+
* `buildToolRegistry` already throws on that pair at build time, which is the better
|
|
277
|
+
* answer when the answer is available that early.
|
|
278
|
+
*/
|
|
279
|
+
function reportShadowedTools(scope, input) {
|
|
280
|
+
const { iteration, providerId, providerSchemas, activeInjections, warnedShadow } = input;
|
|
281
|
+
if (providerSchemas.length === 0)
|
|
282
|
+
return;
|
|
283
|
+
const providerNames = new Set(providerSchemas.map((s) => s.name));
|
|
284
|
+
for (const inj of activeInjections) {
|
|
285
|
+
for (const tool of inj.inject.tools ?? []) {
|
|
286
|
+
const toolName = tool.schema.name;
|
|
287
|
+
if (!providerNames.has(toolName))
|
|
288
|
+
continue;
|
|
289
|
+
// The EVENT fires every iteration — it is the channel that reaches production,
|
|
290
|
+
// where a dynamic provider can start shadowing on iteration 9 of a run nobody
|
|
291
|
+
// is watching. The console line is dev-mode only and latched per tool name, so
|
|
292
|
+
// a 20-iteration loop prints once (same discipline as the overflow warning).
|
|
293
|
+
typedEmit(scope, 'agentfootprint.tools.shadowed', {
|
|
294
|
+
toolName,
|
|
295
|
+
iteration,
|
|
296
|
+
schemaFrom: 'provider',
|
|
297
|
+
...(providerId && { schemaFromId: providerId }),
|
|
298
|
+
dispatchTo: 'skill',
|
|
299
|
+
dispatchToId: inj.id,
|
|
300
|
+
});
|
|
301
|
+
if (!isDevMode() || warnedShadow.has(toolName))
|
|
302
|
+
continue;
|
|
303
|
+
warnedShadow.add(toolName);
|
|
304
|
+
// eslint-disable-next-line no-console
|
|
305
|
+
console.warn(`agentfootprint tools: '${toolName}' is declared by BOTH the tool provider` +
|
|
306
|
+
`${providerId ? ` '${providerId}'` : ''} and the active skill '${inj.id}'. The model ` +
|
|
307
|
+
`is shown the PROVIDER's description, but dispatch always resolves the SKILL's ` +
|
|
308
|
+
`implementation — so the model reads one tool's contract and calls another's. Rename ` +
|
|
309
|
+
`one of them, or drop it from the skill's tools:[] if the provider is meant to own it.`);
|
|
310
|
+
}
|
|
311
|
+
}
|
|
312
|
+
}
|
|
236
313
|
//# sourceMappingURL=buildToolsSlot.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildToolsSlot.js","sourceRoot":"","sources":["../../../../src/core/slots/buildToolsSlot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"buildToolsSlot.js","sourceRoot":"","sources":["../../../../src/core/slots/buildToolsSlot.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGnD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAEtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEjE,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAG9D,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,qBAAqB,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAuDjG;;;;;;;;GAQG;AACH,MAAM,UAAU,cAAc,CAAC,MAAuB;IACpD,MAAM,SAAS,GAAG,MAAM,CAAC,SAAS,IAAI,IAAI,CAAC;IAC3C,MAAM,WAAW,GAAG,MAAM,CAAC,KAAK,CAAC;IACjC,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IACzC,MAAM,YAAY,GAAG,MAAM,CAAC,YAAY,CAAC;IACzC,MAAM,iBAAiB,GAAG,MAAM,CAAC,iBAAiB,CAAC;IACnD,wEAAwE;IACxE,sEAAsE;IACtE,wEAAwE;IACxE,mCAAmC;IACnC,IAAI,cAAc,GAAG,KAAK,CAAC;IAC3B,iFAAiF;IACjF,qFAAqF;IACrF,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAEvC,qEAA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YAAY,EAAE,GAAG,CAAC,EAAE;aACrB,CAAC,CAAC;YACH,IAAI,CAAC,SAAS,EAAE,IAAI,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC;gBAAE,SAAS;YACzD,YAAY,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC;YAC3B,sCAAsC;YACtC,OAAO,CAAC,IAAI,CACV,0BAA0B,QAAQ,yCAAyC;gBACzE,GAAG,UAAU,CAAC,CAAC,CAAC,KAAK,UAAU,GAAG,CAAC,CAAC,CAAC,EAAE,0BAA0B,GAAG,CAAC,EAAE,eAAe;gBACtF,gFAAgF;gBAChF,sFAAsF;gBACtF,uFAAuF,CAC1F,CAAC;QACJ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -7,8 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { ContextSource, ContextSlot } from '../../events/types.js';
|
|
9
9
|
import type { BudgetPressureRecord, InjectionRecord, SlotComposition } from '../../recorders/core/types.js';
|
|
10
|
-
/**
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* Non-cryptographic stable hash — sufficient for InjectionRecord dedup.
|
|
12
|
+
*
|
|
13
|
+
* The implementation moved to `lib/fnv1a.ts` in 8.8.0 so the memory
|
|
14
|
+
* layer's retrieval record can hash the same way without importing
|
|
15
|
+
* `core/` (which imports `memory/` — the cycle is why a second copy was
|
|
16
|
+
* the alternative). Re-exported here under the same name: every existing
|
|
17
|
+
* importer of `helpers.fnv1a` is untouched, and there is still exactly
|
|
18
|
+
* one implementation.
|
|
19
|
+
*/
|
|
20
|
+
export { fnv1a } from '../../lib/fnv1a.js';
|
|
12
21
|
/** Truncate with ellipsis for contentSummary fields. */
|
|
13
22
|
export declare function truncate(s: string, n: number): string;
|
|
14
23
|
/** Aggregate injection chars/count per source — payload for SlotComposition. */
|
|
@@ -5,15 +5,17 @@
|
|
|
5
5
|
* Role: Tiny pure functions the slot builders share — hash, truncate,
|
|
6
6
|
* breakdown. Kept co-located to avoid cross-package import churn.
|
|
7
7
|
*/
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
/**
|
|
9
|
+
* Non-cryptographic stable hash — sufficient for InjectionRecord dedup.
|
|
10
|
+
*
|
|
11
|
+
* The implementation moved to `lib/fnv1a.ts` in 8.8.0 so the memory
|
|
12
|
+
* layer's retrieval record can hash the same way without importing
|
|
13
|
+
* `core/` (which imports `memory/` — the cycle is why a second copy was
|
|
14
|
+
* the alternative). Re-exported here under the same name: every existing
|
|
15
|
+
* importer of `helpers.fnv1a` is untouched, and there is still exactly
|
|
16
|
+
* one implementation.
|
|
17
|
+
*/
|
|
18
|
+
export { fnv1a } from '../../lib/fnv1a.js';
|
|
17
19
|
/** Truncate with ellipsis for contentSummary fields. */
|
|
18
20
|
export function truncate(s, n) {
|
|
19
21
|
if (s.length <= n)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/core/slots/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../src/core/slots/helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AASH;;;;;;;;;GASG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C,wDAAwD;AACxD,MAAM,UAAU,QAAQ,CAAC,CAAS,EAAE,CAAS;IAC3C,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC;QAAE,OAAO,CAAC,CAAC;IAC5B,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,GAAG,GAAG,CAAC;AACjC,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,SAAS,CACvB,UAAsC;IAEtC,MAAM,GAAG,GAAqE,EAAE,CAAC;IACjF,KA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;QACjC,gBAAgB,EAAE,OAAO,EAAE,SAAS,IAAI,EAAE;KAC3C,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,YAAY,CAAC,WAA4B;IACvD,MAAM,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,WAAW,CAAC,MAAM,CAAC;IACzC,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,IAAI,GAAG;QAAE,OAAO,IAAI,CAAC;IACzC,OAAO;QACL,IAAI,EAAE,WAAW,CAAC,IAAI;QACtB,SAAS,EAAE,GAAG;QACd,eAAe,EAAE,IAAI;QACrB,UAAU,EAAE,IAAI,GAAG,GAAG;QACtB,UAAU,EAAE,MAAM;KACnB,CAAC;AACJ,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,IASrC;IACC,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACpE,OAAO,CACL,oBAAoB,QAAQ,CAAC,IAAI,qBAAqB;QACtD,GAAG,QAAQ,CAAC,eAAe,IAAI,QAAQ,CAAC,SAAS,YAAY,QAAQ,CAAC,UAAU,KAAK;QACrF,GAAG,SAAS,IAAI,QAAQ,yCAAyC,WAAW,aAAa;QACzF,0DAA0D,MAAM,EAAE,CACnE,CAAC;AACJ,CAAC"}
|
|
@@ -392,6 +392,17 @@ export interface MemoryStrategyAppliedPayload {
|
|
|
392
392
|
readonly droppedIds: readonly string[];
|
|
393
393
|
readonly addedIds: readonly string[];
|
|
394
394
|
}
|
|
395
|
+
/**
|
|
396
|
+
* One piece of stored content reached the prompt.
|
|
397
|
+
*
|
|
398
|
+
* Emitted once per admitted chunk by the memory formatter (8.8.0 — the
|
|
399
|
+
* payload was declared in 2.x and nothing emitted it until then).
|
|
400
|
+
* `memoryId` is the STORE ENTRY's id, which for an indexed corpus is the
|
|
401
|
+
* chunk id you can cite. Which retriever produced it is
|
|
402
|
+
* `meta.runtimeStageId` (`sf-memory-read-<id>/format-default#N`) — the
|
|
403
|
+
* house rule is that events correlate by runtime stage id, not by
|
|
404
|
+
* duplicating the owner into every payload.
|
|
405
|
+
*/
|
|
395
406
|
export interface MemoryAttachedPayload {
|
|
396
407
|
readonly memoryId: string;
|
|
397
408
|
readonly contentSummary: string;
|
|
@@ -400,6 +411,58 @@ export interface MemoryAttachedPayload {
|
|
|
400
411
|
readonly source: 'store' | 'auto-extract' | 'manual';
|
|
401
412
|
readonly retriever?: 'pinecone' | 'weaviate' | 'qdrant' | 'chroma' | 'custom';
|
|
402
413
|
}
|
|
414
|
+
/** One candidate a retrieval considered, admitted or not. */
|
|
415
|
+
export interface RetrievedCandidatePayload {
|
|
416
|
+
readonly id: string;
|
|
417
|
+
readonly score: number;
|
|
418
|
+
readonly rank: number;
|
|
419
|
+
readonly admitted: boolean;
|
|
420
|
+
readonly reason?: 'below-threshold' | 'over-budget' | 'over-max-entries';
|
|
421
|
+
readonly docUri?: string;
|
|
422
|
+
readonly page?: number;
|
|
423
|
+
readonly heading?: string;
|
|
424
|
+
}
|
|
425
|
+
/**
|
|
426
|
+
* A retrieval happened — here is everything it considered (8.8.0).
|
|
427
|
+
*
|
|
428
|
+
* The event that makes "why did the agent NOT read that passage"
|
|
429
|
+
* answerable. Until 8.8.0 the quality floor was applied inside the store,
|
|
430
|
+
* so a rejected candidate never came back and a retrieval that injected
|
|
431
|
+
* nothing left no trace of what it nearly injected.
|
|
432
|
+
*
|
|
433
|
+
* `candidates` absent means the store could not tell us (see
|
|
434
|
+
* `candidatesOmittedReason`) — it never means there were none. That case
|
|
435
|
+
* is `candidates: []` with `consideredCount: 0` and `corpusEmpty: true`.
|
|
436
|
+
*/
|
|
437
|
+
export interface MemoryRetrievedPayload {
|
|
438
|
+
/** Stable hash of the query text. The text itself is already in the recording once. */
|
|
439
|
+
readonly queryHash: string;
|
|
440
|
+
/** How many chunks the retriever was willing to admit. */
|
|
441
|
+
readonly k: number;
|
|
442
|
+
/** The quality floor, when the retriever set one. */
|
|
443
|
+
readonly threshold?: number;
|
|
444
|
+
readonly embedderId?: string;
|
|
445
|
+
/** Length of the query vector. */
|
|
446
|
+
readonly dimensions?: number;
|
|
447
|
+
readonly consideredCount: number;
|
|
448
|
+
readonly admittedCount: number;
|
|
449
|
+
readonly rejectedCount: number;
|
|
450
|
+
readonly candidates?: readonly RetrievedCandidatePayload[];
|
|
451
|
+
/**
|
|
452
|
+
* Whether `candidates` is every candidate that existed, or only as far
|
|
453
|
+
* as the requested pool reached. `false` never weakens the ADMITTED
|
|
454
|
+
* set — only the rejected list is then a sample.
|
|
455
|
+
*/
|
|
456
|
+
readonly candidatesComplete: boolean;
|
|
457
|
+
readonly candidatesOmittedReason?: string;
|
|
458
|
+
/**
|
|
459
|
+
* The namespace held nothing at all. Almost always means the corpus was
|
|
460
|
+
* indexed under a different identity than the one being queried.
|
|
461
|
+
*/
|
|
462
|
+
readonly corpusEmpty: boolean;
|
|
463
|
+
/** The namespace that was searched. */
|
|
464
|
+
readonly namespace?: string;
|
|
465
|
+
}
|
|
403
466
|
export interface MemoryDetachedPayload {
|
|
404
467
|
readonly memoryId: string;
|
|
405
468
|
readonly reason: 'stale' | 'budget' | 'score_low' | 'policy';
|
|
@@ -464,6 +527,35 @@ export interface ToolsDiscoveryFailedPayload {
|
|
|
464
527
|
readonly iteration: number;
|
|
465
528
|
readonly durationMs: number;
|
|
466
529
|
}
|
|
530
|
+
/**
|
|
531
|
+
* Emitted when two sources claim ONE tool name and the source the model READS is not
|
|
532
|
+
* the source that will RUN (8.7.0).
|
|
533
|
+
*
|
|
534
|
+
* Today that is exactly one pair: a `ToolProvider` and an active Skill's
|
|
535
|
+
* `inject.tools`. The tools slot merges `[static, provider, skill]` first-wins, so the
|
|
536
|
+
* provider's schema reaches the LLM; the dispatcher resolves `registryByName` first,
|
|
537
|
+
* which holds every skill tool and no provider tool, so the skill's `execute` runs.
|
|
538
|
+
* The model reads one description and calls a different function.
|
|
539
|
+
*
|
|
540
|
+
* Not an error event: the run continues, a tool really executes, and the fix is a
|
|
541
|
+
* rename. It fires once per offending name PER ITERATION, because a provider list is
|
|
542
|
+
* resolved per iteration and a shadow can begin mid-run.
|
|
543
|
+
*
|
|
544
|
+
* Carries names only — never args, never results, never a description body.
|
|
545
|
+
*/
|
|
546
|
+
export interface ToolsShadowedPayload {
|
|
547
|
+
/** The contested tool name. */
|
|
548
|
+
readonly toolName: string;
|
|
549
|
+
readonly iteration: number;
|
|
550
|
+
/** Which source's SCHEMA the model was shown. */
|
|
551
|
+
readonly schemaFrom: 'provider' | 'registry' | 'skill';
|
|
552
|
+
/** That source's id — the `ToolProvider.id`, when it has one. */
|
|
553
|
+
readonly schemaFromId?: string;
|
|
554
|
+
/** Which source's IMPLEMENTATION the dispatcher will resolve. */
|
|
555
|
+
readonly dispatchTo: 'provider' | 'registry' | 'skill';
|
|
556
|
+
/** That source's id — the skill id, for the provider↔skill pair. */
|
|
557
|
+
readonly dispatchToId?: string;
|
|
558
|
+
}
|
|
467
559
|
/**
|
|
468
560
|
* Emitted when LLM-produced tool args fail validation against the tool's
|
|
469
561
|
* declared `inputSchema` (backlog #9). Fires for BOTH modes that validate:
|
|
@@ -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, AgentOutputSchemaRetryPayload, 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, SkillRerouteSupersededPayload, ToolEndPayload, ToolsActivatedPayload, ToolsDeactivatedPayload, ToolsDiscoveryStartedPayload, ToolsDiscoveryCompletedPayload, ToolsDiscoveryFailedPayload, ToolsOfferedPayload, ToolStartPayload, ValidationArgsInvalidPayload, MiddlewareDecisionPayload } 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, AgentOutputSchemaRetryPayload, AgentThinkingParseFailedPayload, StreamThinkingDeltaPayload, StreamThinkingEndPayload, FallbackTriggeredPayload, LLMEndPayload, LLMStartPayload, LLMTokenPayload, LoopIterationExitPayload, LoopIterationStartPayload, MemoryAttachedPayload, MemoryDetachedPayload, MemoryRetrievedPayload, MemoryStrategyAppliedPayload, MemoryWrittenPayload, ParallelBranchCompletePayload, ParallelForkStartPayload, ParallelMergeEndPayload, PauseRequestPayload, PauseResumePayload, CheckInRequestPayload, CheckInDecisionPayload, PermissionCheckPayload, PermissionGateClosedPayload, PermissionHaltPayload, PermissionGateOpenedPayload, CredentialRequestedPayload, CredentialAcquiredPayload, CredentialAuthorizationRequiredPayload, CredentialFailedPayload, ReliabilityFailFastPayload, ReliabilityRetriedPayload, ReliabilityRecoveredPayload, RiskFlaggedPayload, SkillActivatedPayload, SkillDeactivatedPayload, SkillRejectedPayload, SkillRerouteSupersededPayload, ToolEndPayload, ToolsActivatedPayload, ToolsDeactivatedPayload, ToolsDiscoveryStartedPayload, ToolsDiscoveryCompletedPayload, ToolsDiscoveryFailedPayload, ToolsShadowedPayload, ToolsOfferedPayload, ToolStartPayload, ValidationArgsInvalidPayload, MiddlewareDecisionPayload } from './payloads.js';
|
|
20
20
|
export declare const EVENT_NAMES: {
|
|
21
21
|
readonly composition: {
|
|
22
22
|
readonly enter: "agentfootprint.composition.enter";
|
|
@@ -58,6 +58,7 @@ export declare const EVENT_NAMES: {
|
|
|
58
58
|
readonly memory: {
|
|
59
59
|
readonly strategyApplied: "agentfootprint.memory.strategy_applied";
|
|
60
60
|
readonly attached: "agentfootprint.memory.attached";
|
|
61
|
+
readonly retrieved: "agentfootprint.memory.retrieved";
|
|
61
62
|
readonly detached: "agentfootprint.memory.detached";
|
|
62
63
|
readonly written: "agentfootprint.memory.written";
|
|
63
64
|
};
|
|
@@ -68,6 +69,7 @@ export declare const EVENT_NAMES: {
|
|
|
68
69
|
readonly discoveryStarted: "agentfootprint.tools.discovery_started";
|
|
69
70
|
readonly discoveryCompleted: "agentfootprint.tools.discovery_completed";
|
|
70
71
|
readonly discoveryFailed: "agentfootprint.tools.discovery_failed";
|
|
72
|
+
readonly shadowed: "agentfootprint.tools.shadowed";
|
|
71
73
|
};
|
|
72
74
|
readonly skill: {
|
|
73
75
|
readonly activated: "agentfootprint.skill.activated";
|
|
@@ -161,6 +163,7 @@ export interface AgentfootprintEventMap {
|
|
|
161
163
|
'agentfootprint.context.evaluated': AgentfootprintEventEnvelope<'agentfootprint.context.evaluated', ContextEvaluatedPayload>;
|
|
162
164
|
'agentfootprint.memory.strategy_applied': AgentfootprintEventEnvelope<'agentfootprint.memory.strategy_applied', MemoryStrategyAppliedPayload>;
|
|
163
165
|
'agentfootprint.memory.attached': AgentfootprintEventEnvelope<'agentfootprint.memory.attached', MemoryAttachedPayload>;
|
|
166
|
+
'agentfootprint.memory.retrieved': AgentfootprintEventEnvelope<'agentfootprint.memory.retrieved', MemoryRetrievedPayload>;
|
|
164
167
|
'agentfootprint.memory.detached': AgentfootprintEventEnvelope<'agentfootprint.memory.detached', MemoryDetachedPayload>;
|
|
165
168
|
'agentfootprint.memory.written': AgentfootprintEventEnvelope<'agentfootprint.memory.written', MemoryWrittenPayload>;
|
|
166
169
|
'agentfootprint.tools.offered': AgentfootprintEventEnvelope<'agentfootprint.tools.offered', ToolsOfferedPayload>;
|
|
@@ -169,6 +172,7 @@ export interface AgentfootprintEventMap {
|
|
|
169
172
|
'agentfootprint.tools.discovery_started': AgentfootprintEventEnvelope<'agentfootprint.tools.discovery_started', ToolsDiscoveryStartedPayload>;
|
|
170
173
|
'agentfootprint.tools.discovery_completed': AgentfootprintEventEnvelope<'agentfootprint.tools.discovery_completed', ToolsDiscoveryCompletedPayload>;
|
|
171
174
|
'agentfootprint.tools.discovery_failed': AgentfootprintEventEnvelope<'agentfootprint.tools.discovery_failed', ToolsDiscoveryFailedPayload>;
|
|
175
|
+
'agentfootprint.tools.shadowed': AgentfootprintEventEnvelope<'agentfootprint.tools.shadowed', ToolsShadowedPayload>;
|
|
172
176
|
'agentfootprint.skill.activated': AgentfootprintEventEnvelope<'agentfootprint.skill.activated', SkillActivatedPayload>;
|
|
173
177
|
'agentfootprint.skill.deactivated': AgentfootprintEventEnvelope<'agentfootprint.skill.deactivated', SkillDeactivatedPayload>;
|
|
174
178
|
'agentfootprint.skill.rejected': AgentfootprintEventEnvelope<'agentfootprint.skill.rejected', SkillRejectedPayload>;
|
|
@@ -59,6 +59,7 @@ export const EVENT_NAMES = {
|
|
|
59
59
|
memory: {
|
|
60
60
|
strategyApplied: 'agentfootprint.memory.strategy_applied',
|
|
61
61
|
attached: 'agentfootprint.memory.attached',
|
|
62
|
+
retrieved: 'agentfootprint.memory.retrieved',
|
|
62
63
|
detached: 'agentfootprint.memory.detached',
|
|
63
64
|
written: 'agentfootprint.memory.written',
|
|
64
65
|
},
|
|
@@ -69,6 +70,7 @@ export const EVENT_NAMES = {
|
|
|
69
70
|
discoveryStarted: 'agentfootprint.tools.discovery_started',
|
|
70
71
|
discoveryCompleted: 'agentfootprint.tools.discovery_completed',
|
|
71
72
|
discoveryFailed: 'agentfootprint.tools.discovery_failed',
|
|
73
|
+
shadowed: 'agentfootprint.tools.shadowed',
|
|
72
74
|
},
|
|
73
75
|
skill: {
|
|
74
76
|
activated: 'agentfootprint.skill.activated',
|
|
@@ -166,6 +168,7 @@ export const ALL_EVENT_TYPES = [
|
|
|
166
168
|
'agentfootprint.context.evaluated',
|
|
167
169
|
'agentfootprint.memory.strategy_applied',
|
|
168
170
|
'agentfootprint.memory.attached',
|
|
171
|
+
'agentfootprint.memory.retrieved',
|
|
169
172
|
'agentfootprint.memory.detached',
|
|
170
173
|
'agentfootprint.memory.written',
|
|
171
174
|
'agentfootprint.tools.offered',
|
|
@@ -174,6 +177,7 @@ export const ALL_EVENT_TYPES = [
|
|
|
174
177
|
'agentfootprint.tools.discovery_started',
|
|
175
178
|
'agentfootprint.tools.discovery_completed',
|
|
176
179
|
'agentfootprint.tools.discovery_failed',
|
|
180
|
+
'agentfootprint.tools.shadowed',
|
|
177
181
|
'agentfootprint.validation.args_invalid',
|
|
178
182
|
'agentfootprint.skill.activated',
|
|
179
183
|
'agentfootprint.skill.deactivated',
|
|
@@ -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;AA8EH,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,iBAAiB,EAAE,0CAA0C;QAC7D,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,E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,8BAA8B;IAC9B,gCAAgC;IAChC,4BAA4B;IAC5B,sCAAsC;IACtC,oCAAoC;IACpC,sCAAsC;IACtC,8BAA8B;IAC9B,6BAA6B;IAC7B,gCAAgC;IAChC,iCAAiC;IACjC,oCAAoC;IACpC,oCAAoC;CAC5B,CAAC"}
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -53,4 +53,5 @@ export { workflow, Workflow, type NextStepInput, type WorkflowOptions, } from '.
|
|
|
53
53
|
export { graph, Graph, type GraphEdge, type GraphInput, type GraphNode, type GraphOptions, type GraphOutput, } from './core-flow/Graph.js';
|
|
54
54
|
export { providerFromEnv, type ProviderKind, type CreateProviderOptions, type ProviderFromEnv, } from './adapters/llm/createProvider.js';
|
|
55
55
|
export * from './patterns/index.js';
|
|
56
|
-
export { defineRAG, type DefineRAGOptions, indexDocuments, type IndexDocumentsOptions, type RagDocument, } from './lib/rag/index.js';
|
|
56
|
+
export { defineRAG, DEFAULT_CORPUS_IDENTITY, type DefineRAGOptions, indexDocuments, type IndexDocumentsOptions, type RagDocument, } from './lib/rag/index.js';
|
|
57
|
+
export { topK, type TopKOptions, type RetrievalStrategy, type RetrievalEvidence, type RetrievedCandidate, type RetrievalRejectReason, } from './memory/retrieval/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -173,7 +173,12 @@ export * from './patterns/index.js';
|
|
|
173
173
|
// RAG — retrieval-augmented generation as a context-engineering flavor.
|
|
174
174
|
// Thin sugar over `defineMemory({ type: SEMANTIC, strategy: TOP_K })`
|
|
175
175
|
// plus the `indexDocuments` helper for seeding the corpus at startup.
|
|
176
|
-
export { defineRAG, indexDocuments, } from './lib/rag/index.js';
|
|
176
|
+
export { defineRAG, DEFAULT_CORPUS_IDENTITY, indexDocuments, } from './lib/rag/index.js';
|
|
177
|
+
// The retrieval seam (8.8.0) — what a retrieval considered, and the rule
|
|
178
|
+
// that decided what it kept. `topK` is the rule every release before this
|
|
179
|
+
// one applied without naming it. The record types are here because a
|
|
180
|
+
// consumer reading `agentfootprint.memory.retrieved` needs them.
|
|
181
|
+
export { topK, } from './memory/retrieval/index.js';
|
|
177
182
|
// MCP + tool dispatch. Tool sources — `mcpClient` / `mockMcpClient`,
|
|
178
183
|
// which connect to a Model Context Protocol server and expose its tools
|
|
179
184
|
// as agentfootprint `Tool[]` for `agent.tools(...)` — and the dispatch
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oEAAoE;AACpE,8DAA8D;AAC9D,uEAAuE;AACvE,kEAAkE;AAClE,sEAAsE;AACtE,sDAAsD;AACtD,OAAO,8CAA8C,CAAC;AACtD,OAAO,2CAA2C,CAAC;AACnD,OAAO,4CAA4C,CAAC;AAsCpD,6BAA6B;AAC7B,cAAc,qBAAqB,CAAC;AAEpC,yEAAyE;AACzE,uDAAuD;AACvD,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc;AAEd,yEAAyE;AACzE,wEAAwE;AACxE,yEAAyE;AACzE,gBAAgB;AAChB,SAAS;AAET,2EAA2E;AAC3E,6EAA6E;AAC7E,6EAA6E;AAC7E,6DAA6D;AAC7D,YAAY,GAGb,MAAM,kBAAkB,CAAC;AAC1B,oEAAoE;AACpE,yEAAyE;AACzE,wEAAwE;AACxE,qEAAqE;AACrE,kDAAkD;AAClD,OAAO,EACL,gBAAgB,GAMjB,MAAM,2BAA2B,CAAC;AAKnC,yCAAyC;AACzC,EAAE;AACF,yEAAyE;AACzE,kEAAkE;AAClE,oEAAoE;AACpE,qEAAqE;AACrE,2EAA2E;AAC3E,8EAA8E;AAC9E,0DAA0D;AAC1D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,EAClB,gBAAgB,GAKjB,MAAM,wCAAwC,CAAC;AAIhD,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,sBAA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/D,oEAAoE;AACpE,gEAAgE;AAEhE,qEAAqE;AACrE,0DAA0D;AAC1D,cAAc,qBAAqB,CAAC;AAEpC,uEAAuE;AACvE,uEAAuE;AACvE,oEAAoE;AACpE,sEAAsE;AACtE,8CAA8C;AAE9C,wEAAwE;AACxE,sEAAsE;AACtE,sEAAsE;AACtE,OAAO,EACL,SAAS,EACT,uBAAuB,EAEvB,cAAc,GAGf,MAAM,oBAAoB,CAAC;AAE5B,yEAAyE;AACzE,0EAA0E;AAC1E,qEAAqE;AACrE,iEAAiE;AACjE,OAAO,EACL,IAAI,GAML,MAAM,6BAA6B,CAAC;AAErC,qEAAqE;AACrE,wEAAwE;AACxE,uEAAuE;AACvE,oEAAoE;AACpE,8DAA8D;AAC9D,wEAAwE;AACxE,gDAAgD;AAChD,wEAAwE;AACxE,gEAAgE;AAEhE,wEAAwE;AACxE,wEAAwE;AACxE,uDAAuD;AAEvD,mEAAmE;AACnE,oEAAoE;AACpE,sDAAsD"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fnv1a — the one 32-bit content hash this library uses.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: leaf utility (imports nothing).
|
|
5
|
+
* Role: shared by the slot composers (`core/slots/helpers.ts`, which
|
|
6
|
+
* re-exports it under the same name) and by the memory layer's
|
|
7
|
+
* retrieval record. It lives here rather than in either of them
|
|
8
|
+
* because `memory/` must not import `core/` — `core/` already
|
|
9
|
+
* imports `memory/`, and a second hash implementation is how two
|
|
10
|
+
* recordings of the same bytes end up disagreeing about their id.
|
|
11
|
+
* Emits: N/A.
|
|
12
|
+
*
|
|
13
|
+
* Not cryptographic and not meant to be: this identifies content for
|
|
14
|
+
* dedup and correlation inside one recording, never for authentication.
|
|
15
|
+
*/
|
|
16
|
+
export declare function fnv1a(input: string): string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* fnv1a — the one 32-bit content hash this library uses.
|
|
3
|
+
*
|
|
4
|
+
* Pattern: leaf utility (imports nothing).
|
|
5
|
+
* Role: shared by the slot composers (`core/slots/helpers.ts`, which
|
|
6
|
+
* re-exports it under the same name) and by the memory layer's
|
|
7
|
+
* retrieval record. It lives here rather than in either of them
|
|
8
|
+
* because `memory/` must not import `core/` — `core/` already
|
|
9
|
+
* imports `memory/`, and a second hash implementation is how two
|
|
10
|
+
* recordings of the same bytes end up disagreeing about their id.
|
|
11
|
+
* Emits: N/A.
|
|
12
|
+
*
|
|
13
|
+
* Not cryptographic and not meant to be: this identifies content for
|
|
14
|
+
* dedup and correlation inside one recording, never for authentication.
|
|
15
|
+
*/
|
|
16
|
+
export function fnv1a(input) {
|
|
17
|
+
let h = 2166136261;
|
|
18
|
+
for (let i = 0; i < input.length; i++) {
|
|
19
|
+
h ^= input.charCodeAt(i);
|
|
20
|
+
h = Math.imul(h, 16777619);
|
|
21
|
+
}
|
|
22
|
+
return (h >>> 0).toString(16);
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=fnv1a.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fnv1a.js","sourceRoot":"","sources":["../../../src/lib/fnv1a.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,KAAK,CAAC,KAAa;IACjC,IAAI,CAAC,GAAG,UAAU,CAAC;IACnB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QACtC,CAAC,IAAI,KAAK,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;QACzB,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -23,4 +23,19 @@ export interface RelevanceHintOptions {
|
|
|
23
23
|
*/
|
|
24
24
|
readonly threshold?: number;
|
|
25
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* The metadata marker that says "this injection reads `ctx.entryScores`" (8.7.0).
|
|
28
|
+
*
|
|
29
|
+
* Only `.entryBy()` / `.entryByRelevance()` ever write `entryScores` — the PickEntry
|
|
30
|
+
* stage runs a scorer and stamps them. Mounted on a graph with no scorer, the hint's
|
|
31
|
+
* trigger simply can never be true, and nothing said so: the injection registered,
|
|
32
|
+
* evaluated false on every iteration for the life of the agent, and the author saw a
|
|
33
|
+
* feature that was configured and inert.
|
|
34
|
+
*
|
|
35
|
+
* A marker rather than an id match, because the id is the caller's to choose
|
|
36
|
+
* (`defineRelevanceHint({ id })`) — matching on `'relevance-hint'` would miss every
|
|
37
|
+
* renamed one and would false-positive on anybody else's injection of that name.
|
|
38
|
+
* `AgentBuilder.build()` reads it and dev-warns.
|
|
39
|
+
*/
|
|
40
|
+
export declare const READS_ENTRY_SCORES_METADATA_KEY: "readsEntryScores";
|
|
26
41
|
export declare function defineRelevanceHint(options?: RelevanceHintOptions): Injection;
|
|
@@ -13,6 +13,21 @@
|
|
|
13
13
|
*
|
|
14
14
|
* Add it explicitly: `Agent.create(...).skillGraph(graph).injection(defineRelevanceHint())`.
|
|
15
15
|
*/
|
|
16
|
+
/**
|
|
17
|
+
* The metadata marker that says "this injection reads `ctx.entryScores`" (8.7.0).
|
|
18
|
+
*
|
|
19
|
+
* Only `.entryBy()` / `.entryByRelevance()` ever write `entryScores` — the PickEntry
|
|
20
|
+
* stage runs a scorer and stamps them. Mounted on a graph with no scorer, the hint's
|
|
21
|
+
* trigger simply can never be true, and nothing said so: the injection registered,
|
|
22
|
+
* evaluated false on every iteration for the life of the agent, and the author saw a
|
|
23
|
+
* feature that was configured and inert.
|
|
24
|
+
*
|
|
25
|
+
* A marker rather than an id match, because the id is the caller's to choose
|
|
26
|
+
* (`defineRelevanceHint({ id })`) — matching on `'relevance-hint'` would miss every
|
|
27
|
+
* renamed one and would false-positive on anybody else's injection of that name.
|
|
28
|
+
* `AgentBuilder.build()` reads it and dev-warns.
|
|
29
|
+
*/
|
|
30
|
+
export const READS_ENTRY_SCORES_METADATA_KEY = 'readsEntryScores';
|
|
16
31
|
/** Is the top entry a near-tie with the runner-up? */
|
|
17
32
|
function isNearTie(scores, threshold) {
|
|
18
33
|
if (!scores || scores.length < 2)
|
|
@@ -30,6 +45,7 @@ export function defineRelevanceHint(options = {}) {
|
|
|
30
45
|
kind: 'rule',
|
|
31
46
|
activeWhen: (ctx) => ctx.iteration === 1 && isNearTie(ctx.entryScores, threshold),
|
|
32
47
|
},
|
|
48
|
+
metadata: { [READS_ENTRY_SCORES_METADATA_KEY]: true },
|
|
33
49
|
inject: {
|
|
34
50
|
systemPrompt: 'Note: an offline relevance scorer found two or more starting skills nearly tied for ' +
|
|
35
51
|
'this request. That scorer only matches description keywords and cannot see the ' +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineRelevanceHint.js","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineRelevanceHint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH,sDAAsD;AACtD,SAAS,SAAS,CAAC,MAAuC,EAAE,SAAiB;IAC3E,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC,CAAC,CAAE,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC,SAAS,GAAG,SAAS,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAgC,EAAE;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;IAC5C,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,gBAAgB;QAClC,MAAM,EAAE,cAAc;QACtB,WAAW,EAAE,8EAA8E;QAC3F,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC;SAClF;QACD,MAAM,EAAE;YACN,YAAY,EACV,sFAAsF;gBACtF,iFAAiF;gBACjF,sFAAsF;gBACtF,uFAAuF;gBACvF,uBAAuB;SAC1B;KACF,CAAC;AACJ,CAAC"}
|
|
1
|
+
{"version":3,"file":"defineRelevanceHint.js","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineRelevanceHint.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAcH;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAG,kBAA2B,CAAC;AAE3E,sDAAsD;AACtD,SAAS,SAAS,CAAC,MAAuC,EAAE,SAAiB;IAC3E,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IAC/C,MAAM,MAAM,GAAG,CAAC,GAAG,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC;IACrE,OAAO,MAAM,CAAC,CAAC,CAAE,CAAC,SAAS,GAAG,MAAM,CAAC,CAAC,CAAE,CAAC,SAAS,GAAG,SAAS,CAAC;AACjE,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,UAAgC,EAAE;IACpE,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,IAAI,CAAC;IAC5C,OAAO;QACL,EAAE,EAAE,OAAO,CAAC,EAAE,IAAI,gBAAgB;QAClC,MAAM,EAAE,cAAc;QACtB,WAAW,EAAE,8EAA8E;QAC3F,OAAO,EAAE;YACP,IAAI,EAAE,MAAM;YACZ,UAAU,EAAE,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,SAAS,KAAK,CAAC,IAAI,SAAS,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC;SAClF;QACD,QAAQ,EAAE,EAAE,CAAC,+BAA+B,CAAC,EAAE,IAAI,EAAE;QACrD,MAAM,EAAE;YACN,YAAY,EACV,sFAAsF;gBACtF,iFAAiF;gBACjF,sFAAsF;gBACtF,uFAAuF;gBACvF,uBAAuB;SAC1B;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -91,6 +91,15 @@ export interface DefineSkillOptions {
|
|
|
91
91
|
* Override the activation tool name. Defaults to `'read_skill'`.
|
|
92
92
|
* Multiple Skills sharing one activation tool is the common pattern;
|
|
93
93
|
* the LLM picks WHICH skill via the tool's argument.
|
|
94
|
+
*
|
|
95
|
+
* @deprecated Since 8.7.0 — `'read_skill'` is the only value that has ever worked,
|
|
96
|
+
* and anything else is now REFUSED when the skill is mounted on an agent. No tool is
|
|
97
|
+
* built from this name: the evaluator activates an `llm-activated` skill by matching
|
|
98
|
+
* `ctx.activatedInjectionIds`, which only `read_skill` writes, and it never reads
|
|
99
|
+
* this field. A skill declaring another name activated through `read_skill` exactly
|
|
100
|
+
* like every other skill, so the declaration described a door that does not exist.
|
|
101
|
+
* Drop it — skills already share ONE activation tool and the model picks which skill
|
|
102
|
+
* by id. Removed in 9.0.0.
|
|
94
103
|
*/
|
|
95
104
|
readonly viaToolName?: string;
|
|
96
105
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSkill.js","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineSkill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;
|
|
1
|
+
{"version":3,"file":"defineSkill.js","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineSkill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAIH,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AAmIxE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,KAAc;IACjE,MAAM,CAAC,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC;IACjC,IAAI,CAAC,KAAK,WAAW,EAAE,CAAC;QACtB,2CAA2C;QAC3C,4CAA4C;QAC5C,+EAA+E;QAC/E,gFAAgF;QAChF,IAAI,KAAK,IAAI,iEAAiE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;YAC3F,OAAO,MAAM,CAAC;QAChB,CAAC;QACD,OAAO,WAAW,CAAC;IACrB,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC;AAED,MAAM,UAAU,WAAW,CAAC,IAAwB;IAClD,IAAI,CAAC,IAAI,CAAC,EAAE,IAAI,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,WAAW,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvD,MAAM,IAAI,KAAK,CACb,eAAe,IAAI,CAAC,EAAE,0EAA0E,CACjG,CAAC;IACJ,CAAC;IACD,IAAI,CAAC,IAAI,CAAC,IAAI,IAAI,IAAI,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CAAC,eAAe,IAAI,CAAC,EAAE,0BAA0B,CAAC,CAAC;IACpE,CAAC;IACD,O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