agentfootprint 9.14.0 → 9.16.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/ai-instructions/claude-code/SKILL.md +1 -1
- package/dist/core/agent/AgentBuilder.js +130 -0
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js +3 -0
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart.js +6 -0
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +32 -1
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +24 -1
- package/dist/esm/core/agent/AgentBuilder.js +130 -0
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.js +3 -0
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildDynamicAgentChart.js +6 -0
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +0 -3
- package/dist/esm/core/agent/stages/toolCalls.js +32 -1
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +13 -1
- package/dist/esm/events/payloads.d.ts +35 -0
- package/dist/esm/events/registry.d.ts +3 -1
- package/dist/esm/events/registry.js +2 -0
- package/dist/esm/events/registry.js.map +1 -1
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.d.ts +1 -0
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js +17 -0
- package/dist/esm/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/esm/lib/injection-engine/evaluator.d.ts +8 -3
- package/dist/esm/lib/injection-engine/evaluator.js +13 -7
- package/dist/esm/lib/injection-engine/evaluator.js.map +1 -1
- package/dist/esm/lib/injection-engine/factories/defineSkill.d.ts +28 -12
- package/dist/esm/lib/injection-engine/factories/defineSkill.js +32 -0
- package/dist/esm/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/esm/lib/injection-engine/index.d.ts +2 -1
- package/dist/esm/lib/injection-engine/index.js +11 -1
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraph.d.ts +140 -8
- package/dist/esm/lib/injection-engine/skillGraph.js +235 -39
- package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +11 -3
- package/dist/esm/lib/injection-engine/skillGraphCheckup.js +75 -2
- package/dist/esm/lib/injection-engine/skillGraphCheckup.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillMatch.d.ts +107 -0
- package/dist/esm/lib/injection-engine/skillMatch.js +144 -0
- package/dist/esm/lib/injection-engine/skillMatch.js.map +1 -0
- package/dist/esm/lib/injection-engine/types.d.ts +39 -3
- package/dist/esm/lib/injection-engine/types.js +12 -0
- package/dist/esm/lib/injection-engine/types.js.map +1 -1
- package/dist/events/registry.js +2 -0
- package/dist/events/registry.js.map +1 -1
- package/dist/lib/injection-engine/buildInjectionEngineSubflow.js +17 -0
- package/dist/lib/injection-engine/buildInjectionEngineSubflow.js.map +1 -1
- package/dist/lib/injection-engine/evaluator.js +13 -7
- package/dist/lib/injection-engine/evaluator.js.map +1 -1
- package/dist/lib/injection-engine/factories/defineSkill.js +32 -0
- package/dist/lib/injection-engine/factories/defineSkill.js.map +1 -1
- package/dist/lib/injection-engine/index.js +12 -1
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/lib/injection-engine/skillGraph.js +236 -40
- package/dist/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/lib/injection-engine/skillGraphCheckup.js +75 -2
- package/dist/lib/injection-engine/skillGraphCheckup.js.map +1 -1
- package/dist/lib/injection-engine/skillMatch.js +150 -0
- package/dist/lib/injection-engine/skillMatch.js.map +1 -0
- package/dist/lib/injection-engine/types.js +14 -1
- package/dist/lib/injection-engine/types.js.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +24 -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/stages/toolCalls.d.ts +0 -3
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +13 -1
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +35 -0
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/events/registry.d.ts +3 -1
- package/dist/types/events/registry.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts +1 -0
- package/dist/types/lib/injection-engine/buildInjectionEngineSubflow.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/evaluator.d.ts +8 -3
- package/dist/types/lib/injection-engine/evaluator.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts +28 -12
- package/dist/types/lib/injection-engine/factories/defineSkill.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/index.d.ts +2 -1
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraph.d.ts +140 -8
- package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts +11 -3
- package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillMatch.d.ts +108 -0
- package/dist/types/lib/injection-engine/skillMatch.d.ts.map +1 -0
- package/dist/types/lib/injection-engine/types.d.ts +39 -3
- package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"buildInjectionEngineSubflow.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/buildInjectionEngineSubflow.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"buildInjectionEngineSubflow.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/buildInjectionEngineSubflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,mCAAmC,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,sBAAsB,GAIvB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,wBAAwB,EAAsC,MAAM,iBAAiB,CAAC;AAqE/F,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAiB;IAChD,YAAY,EAAE,EAAE;IAChB,QAAQ,EAAE,EAAE;IACZ,KAAK,EAAE,EAAE;CACV,CAAC;AAiCF;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAA6B;IACvE,MAAM,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAErC,OAAO,SAAS,CAAuB,QAAQ,EAAE,WAAW,EAAE,QAAQ,EAAE;QACtE,WAAW,EACT,sFAAsF;KACzF,CAAC;SACC,WAAW,CACV,UAAU,EACV,iBAAiB,CACf,UAAU,EACV,MAAM,CAAC,SAAS,EAChB,MAAM,CAAC,gBAAgB,EACvB,MAAM,CAAC,iBAAiB,CACzB,EACD,UAAU,EACV,uEAAuE,CACxE;SACA,WAAW,CACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,sFAAsF,CACvF;SACA,WAAW,CACV,OAAO,EACP,UAAU,EACV,OAAO,EACP,oEAAoE,CACrE;SACA,KAAK,EAAE,CAAC;AACb,CAAC;AAED,4EAA4E;AAE5E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,CAAC"}
|
|
@@ -13,9 +13,14 @@
|
|
|
13
13
|
* • `rule` → predicate runs against `ctx`. Errors are
|
|
14
14
|
* caught + reported in `skipped`; never
|
|
15
15
|
* propagate. Run never crashes.
|
|
16
|
-
* • `on-tool-return` → active when
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* • `on-tool-return` → active when ANY tool result of the previous
|
|
17
|
+
* iteration's batch (`toolResultsOf(ctx)` —
|
|
18
|
+
* `ctx.toolResults`, falling back to the
|
|
19
|
+
* singular `ctx.lastToolResult`) has a
|
|
20
|
+
* `toolName` matching `trigger.toolName`
|
|
21
|
+
* (string equal or regex test). Before 9.16.0
|
|
22
|
+
* only the LAST call of a parallel batch was
|
|
23
|
+
* consulted — earlier calls were dropped.
|
|
19
24
|
* • `llm-activated` → active when the Injection's `id` is in
|
|
20
25
|
* `ctx.activatedInjectionIds` (the LLM
|
|
21
26
|
* previously called `viaToolName(<id>)`).
|
|
@@ -13,13 +13,19 @@
|
|
|
13
13
|
* • `rule` → predicate runs against `ctx`. Errors are
|
|
14
14
|
* caught + reported in `skipped`; never
|
|
15
15
|
* propagate. Run never crashes.
|
|
16
|
-
* • `on-tool-return` → active when
|
|
17
|
-
*
|
|
18
|
-
*
|
|
16
|
+
* • `on-tool-return` → active when ANY tool result of the previous
|
|
17
|
+
* iteration's batch (`toolResultsOf(ctx)` —
|
|
18
|
+
* `ctx.toolResults`, falling back to the
|
|
19
|
+
* singular `ctx.lastToolResult`) has a
|
|
20
|
+
* `toolName` matching `trigger.toolName`
|
|
21
|
+
* (string equal or regex test). Before 9.16.0
|
|
22
|
+
* only the LAST call of a parallel batch was
|
|
23
|
+
* consulted — earlier calls were dropped.
|
|
19
24
|
* • `llm-activated` → active when the Injection's `id` is in
|
|
20
25
|
* `ctx.activatedInjectionIds` (the LLM
|
|
21
26
|
* previously called `viaToolName(<id>)`).
|
|
22
27
|
*/
|
|
28
|
+
import { toolResultsOf } from './types.js';
|
|
23
29
|
export function evaluateInjections(injections, ctx) {
|
|
24
30
|
const active = [];
|
|
25
31
|
const skipped = [];
|
|
@@ -45,10 +51,10 @@ export function evaluateInjections(injections, ctx) {
|
|
|
45
51
|
break;
|
|
46
52
|
}
|
|
47
53
|
case 'on-tool-return': {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
const matches = typeof t.toolName === 'string' ? t.toolName === toolName : t.toolName.test(toolName);
|
|
54
|
+
// The WHOLE batch, in call order (9.16.0) — a trigger fires when any
|
|
55
|
+
// call of the previous iteration returned from the named tool, not
|
|
56
|
+
// only when that tool happened to be last in a parallel batch.
|
|
57
|
+
const matches = toolResultsOf(ctx).some((r) => typeof t.toolName === 'string' ? t.toolName === r.toolName : t.toolName.test(r.toolName));
|
|
52
58
|
if (matches)
|
|
53
59
|
active.push(inj);
|
|
54
60
|
break;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/evaluator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"evaluator.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/evaluator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG3C,MAAM,UAAU,kBAAkB,CAChC,UAAgC,EAChC,GAAqB;IAErB,MAAM,MAAM,GAAgB,EAAE,CAAC;IAC/B,MAAM,OAAO,GAIR,EAAE,CAAC;IAER,KAAK,MAAM,GAAG,IAAI,UAAU,EAAE,CAAC;QAC7B,MAAM,CAAC,GAAG,GAAG,CAAC,OAAO,CAAC;QACtB,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;YACf,KAAK,QAAQ,CAAC,CAAC,CAAC;gBACd,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACjB,MAAM;YACR,CAAC;YACD,KAAK,MAAM,CAAC,CAAC,CAAC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AG,CAAC,EAAE;oBACV,MAAM,EAAE,sBAAsB;oBAC9B,KAAK,EAAE,sBAAsB,IAAI,CAAC,SAAS,CAAC,WAAW,CAAC,EAAE;iBAC3D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
* and callable from iteration 1 unless the Skill sets
|
|
11
11
|
* `autoActivate: 'currentSkill'` — see that option.
|
|
12
12
|
*
|
|
13
|
+
* **Activation lifetime: the rest of the turn.** Once the model picks a
|
|
14
|
+
* skill with `read_skill`, the activation lasts until the turn ends — every
|
|
15
|
+
* later iteration of that `run()` keeps the body active, and there is no
|
|
16
|
+
* mid-turn deactivation (nothing removes an id from
|
|
17
|
+
* `ctx.activatedInjectionIds`; the next `run()` starts clean). This is
|
|
18
|
+
* deliberate: the cache layer's skill history and the context ledger both
|
|
19
|
+
* lean on the cumulative property. A skill that should stop applying
|
|
20
|
+
* mid-turn is a `rule` trigger or a `skillGraph()` route, not a read_skill
|
|
21
|
+
* pick.
|
|
22
|
+
*
|
|
13
23
|
* Produces an `Injection` with:
|
|
14
24
|
* - flavor: `'skill'`
|
|
15
25
|
* - trigger: `{ kind: 'llm-activated', viaToolName: 'read_skill' }`
|
|
@@ -68,17 +78,21 @@ export type SurfaceMode = 'auto' | 'system-prompt' | 'tool-only' | 'both';
|
|
|
68
78
|
* When (if ever) to re-deliver a Skill's body in long-running runs.
|
|
69
79
|
*
|
|
70
80
|
* Even on providers with strong system-prompt adherence, attention to
|
|
71
|
-
* the system slot decays past long contexts. `refreshPolicy`
|
|
72
|
-
* the body via tool result past a token threshold so the LLM
|
|
73
|
-
* fresh again.
|
|
81
|
+
* the system slot decays past long contexts. `refreshPolicy` was declared
|
|
82
|
+
* to re-inject the body via tool result past a token threshold so the LLM
|
|
83
|
+
* sees it fresh again.
|
|
74
84
|
*
|
|
75
|
-
* **
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
81
|
-
*
|
|
85
|
+
* @deprecated **DEPRECATED-pending-steps (9.16.0) — stored, never read, and
|
|
86
|
+
* it will stay that way.** `defineSkill` records what you pass on
|
|
87
|
+
* `skill.metadata.refreshPolicy` and nothing in the engine has ever read it:
|
|
88
|
+
* no re-injection happens today, on any version. The hook is superseded by a
|
|
89
|
+
* planned steps-as-data feature, which will own re-delivery declaratively —
|
|
90
|
+
* this field will NOT be wired up in the meantime, and will be removed in the
|
|
91
|
+
* next major after steps ship. The field stays accepted (additive-only law)
|
|
92
|
+
* so existing declarations keep compiling; dev mode warns once per process
|
|
93
|
+
* when one is set. If you need a body re-surfaced in a long run today,
|
|
94
|
+
* deliver it yourself (e.g. `surfaceMode: 'both'`, so every `read_skill`
|
|
95
|
+
* call returns the body afresh).
|
|
82
96
|
*/
|
|
83
97
|
export interface RefreshPolicy {
|
|
84
98
|
/**
|
|
@@ -117,8 +131,10 @@ export interface DefineSkillOptions {
|
|
|
117
131
|
* Intent to re-deliver the body past a token threshold, to defend
|
|
118
132
|
* against long-context attention decay. Default: undefined.
|
|
119
133
|
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
134
|
+
* @deprecated DEPRECATED-pending-steps (9.16.0): recorded on the Skill's
|
|
135
|
+
* metadata, never acted on by the engine, and superseded by a planned
|
|
136
|
+
* steps-as-data feature — it will not be wired up. Dev mode warns once per
|
|
137
|
+
* process when set. See `RefreshPolicy` for what to do instead today.
|
|
122
138
|
*/
|
|
123
139
|
readonly refreshPolicy?: RefreshPolicy;
|
|
124
140
|
/**
|
|
@@ -10,6 +10,16 @@
|
|
|
10
10
|
* and callable from iteration 1 unless the Skill sets
|
|
11
11
|
* `autoActivate: 'currentSkill'` — see that option.
|
|
12
12
|
*
|
|
13
|
+
* **Activation lifetime: the rest of the turn.** Once the model picks a
|
|
14
|
+
* skill with `read_skill`, the activation lasts until the turn ends — every
|
|
15
|
+
* later iteration of that `run()` keeps the body active, and there is no
|
|
16
|
+
* mid-turn deactivation (nothing removes an id from
|
|
17
|
+
* `ctx.activatedInjectionIds`; the next `run()` starts clean). This is
|
|
18
|
+
* deliberate: the cache layer's skill history and the context ledger both
|
|
19
|
+
* lean on the cumulative property. A skill that should stop applying
|
|
20
|
+
* mid-turn is a `rule` trigger or a `skillGraph()` route, not a read_skill
|
|
21
|
+
* pick.
|
|
22
|
+
*
|
|
13
23
|
* Produces an `Injection` with:
|
|
14
24
|
* - flavor: `'skill'`
|
|
15
25
|
* - trigger: `{ kind: 'llm-activated', viaToolName: 'read_skill' }`
|
|
@@ -31,6 +41,7 @@
|
|
|
31
41
|
* tools: [refundTool, chargeHistoryTool],
|
|
32
42
|
* });
|
|
33
43
|
*/
|
|
44
|
+
import { isDevMode } from 'footprintjs';
|
|
34
45
|
import { resolveCachePolicy } from '../../../cache/applyCachePolicy.js';
|
|
35
46
|
/**
|
|
36
47
|
* Resolve `surfaceMode: 'auto'` to a concrete mode based on provider
|
|
@@ -85,6 +96,25 @@ function assertNoViaToolName(where, opts) {
|
|
|
85
96
|
`skills already share ONE activation tool and the model picks WHICH skill by id. If you ` +
|
|
86
97
|
`need the skill gated on something else, use a \`rule\` trigger or a skillGraph() edge.`);
|
|
87
98
|
}
|
|
99
|
+
/** One warn per process for the deprecated `refreshPolicy` — the field is
|
|
100
|
+
* accepted (additive-only law) but a declaration that does nothing should
|
|
101
|
+
* say so ONCE, not on every skill of a 40-skill catalog. */
|
|
102
|
+
let warnedRefreshPolicyDeprecated = false;
|
|
103
|
+
/**
|
|
104
|
+
* The dev-mode deprecation warn for `refreshPolicy` (9.16.0). Named, not
|
|
105
|
+
* inlined, so the once-flag and the message live beside each other.
|
|
106
|
+
*/
|
|
107
|
+
function warnRefreshPolicyDeprecated(skillId) {
|
|
108
|
+
if (warnedRefreshPolicyDeprecated || !isDevMode())
|
|
109
|
+
return;
|
|
110
|
+
warnedRefreshPolicyDeprecated = true;
|
|
111
|
+
// eslint-disable-next-line no-console
|
|
112
|
+
console.warn(`agentfootprint defineSkill('${skillId}'): \`refreshPolicy\` is DEPRECATED-pending-steps — ` +
|
|
113
|
+
'it is stored on skill.metadata and nothing in the engine reads it, so NO re-injection ' +
|
|
114
|
+
'happens. It is superseded by a planned steps-as-data feature and will not be wired up. ' +
|
|
115
|
+
"To re-surface a body in a long run today, use surfaceMode: 'both' (read_skill returns " +
|
|
116
|
+
'the body afresh) or deliver it yourself. This warning fires once per process.');
|
|
117
|
+
}
|
|
88
118
|
export function defineSkill(opts) {
|
|
89
119
|
if (!opts.id || opts.id.trim().length === 0) {
|
|
90
120
|
throw new Error('defineSkill: `id` is required and must be non-empty.');
|
|
@@ -96,6 +126,8 @@ export function defineSkill(opts) {
|
|
|
96
126
|
throw new Error(`defineSkill(${opts.id}): \`body\` is required.`);
|
|
97
127
|
}
|
|
98
128
|
assertNoViaToolName(`defineSkill(${opts.id})`, opts);
|
|
129
|
+
if (opts.refreshPolicy)
|
|
130
|
+
warnRefreshPolicyDeprecated(opts.id);
|
|
99
131
|
return Object.freeze({
|
|
100
132
|
id: opts.id,
|
|
101
133
|
description: opts.description,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defineSkill.js","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineSkill.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"defineSkill.js","sourceRoot":"","sources":["../../../../../src/lib/injection-engine/factories/defineSkill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAGxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,oCAAoC,CAAC;AA8IxE;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,KAAc;IACjE,MAAM,CAAC,GAAG,QAAQ,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IAAI,CAAC,YAAY,EAAE,CAAC;YAC7D,KAAK,EAAE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;SAC/C,CAAC;KACH,CAAyB,CAAC;AAC7B,CAAC"}
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export type { Injection, InjectionTrigger, InjectionContent, InjectionContext, InjectionEvaluation, ActiveInjection, } from './types.js';
|
|
9
9
|
export { projectActiveInjection } from './types.js';
|
|
10
|
+
export { toolResultsOf } from './types.js';
|
|
10
11
|
export { evaluateInjections } from './evaluator.js';
|
|
11
12
|
export { buildInjectionEngineSubflow, type InjectionEngineConfig, } from './buildInjectionEngineSubflow.js';
|
|
12
13
|
export { defineInstruction, type DefineInstructionOptions } from './factories/defineInstruction.js';
|
|
@@ -18,6 +19,6 @@ export { buildListSkillsTool, buildReadSkillTool, type SkillToolPair } from './s
|
|
|
18
19
|
export { defineSteering, type DefineSteeringOptions } from './factories/defineSteering.js';
|
|
19
20
|
export { defineFact, type DefineFactOptions } from './factories/defineFact.js';
|
|
20
21
|
export { defineInjection, type DefineInjectionOptions, type InjectionFlavor, } from './factories/defineInjection.js';
|
|
21
|
-
export { skillGraph, decideSkill, formatCheckup, SKILL_GRAPH_METADATA_KEY, type SkillGraph, type SkillGraphBuilder, type SkillRouteOptions, type SkillEntryOptions, type TreeOptions, type SkillEdge, type SkillEdgeKind, type SkillNode, type DecisionNode, type SkillRouting, type SkillRoutingStep, type CursorMove, type CursorMoveCause, type EntryScore, type EntryScoring, type SkillGraphConfig, type SkillGraphFlatConfig, type SkillGraphTreeConfig, type SkillGraphStart, type SkillGraphStep, type BuildOptions, type CheckupOptions, type GraphCheckMode, type GraphCheckup, type GraphProblem, type GraphProblemCode, } from './skillGraph.js';
|
|
22
|
+
export { skillGraph, decideSkill, formatCheckup, SKILL_GRAPH_METADATA_KEY, type SkillGraph, type SkillGraphBuilder, type SkillRouteOptions, type SkillEntryOptions, type TreeOptions, type SkillEdge, type SkillEdgeKind, type SkillNode, type DecisionNode, type SkillRouting, type SkillRoutingStep, type CursorMove, type CursorMoveCause, type RouteBatchConflict, type RouteBatchOutcome, type EntryScore, type EntryScoring, type SkillGraphConfig, type SkillGraphFlatConfig, type SkillGraphTreeConfig, type SkillGraphStart, type SkillGraphStep, type SkillMatch, type SkillMatchData, type SkillStartRule, SKILL_GRAPH_DEFERRED_CONTRACT_KEY, type DeferredBodyContract, type BuildOptions, type CheckupOptions, type GraphCheckMode, type GraphCheckup, type GraphProblem, type GraphProblemCode, } from './skillGraph.js';
|
|
22
23
|
export { keywordScorer, embeddingScorer, rankEntries, type EntryScorer, type EntryScorerInput, type EntryCandidate, } from './entryScorer.js';
|
|
23
24
|
export { checkSkillContract, checkSkillContracts, skillToolNames, type SkillContractOptions, } from './skillContract.js';
|
|
@@ -7,6 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
// POJO projection — used by slot subflows + advanced consumers
|
|
9
9
|
export { projectActiveInjection } from './types.js';
|
|
10
|
+
// The iteration's tool-result batch with the singular fallback applied
|
|
11
|
+
// (9.16.0) — the one reader `rule` predicates should use to see every call of
|
|
12
|
+
// a parallel batch, not only the last (`ctx.toolResults ?? [ctx.lastToolResult]`).
|
|
13
|
+
export { toolResultsOf } from './types.js';
|
|
10
14
|
// Engine
|
|
11
15
|
export { evaluateInjections } from './evaluator.js';
|
|
12
16
|
export { buildInjectionEngineSubflow, } from './buildInjectionEngineSubflow.js';
|
|
@@ -37,7 +41,13 @@ export { skillGraph, decideSkill,
|
|
|
37
41
|
// the library itself uses; without it every consumer wrote their own. `checkupGraph`
|
|
38
42
|
// stays private: its input is the graph's internal wiring shape, and `graph.checkup()`
|
|
39
43
|
// is already the door to it.
|
|
40
|
-
formatCheckup, SKILL_GRAPH_METADATA_KEY,
|
|
44
|
+
formatCheckup, SKILL_GRAPH_METADATA_KEY,
|
|
45
|
+
// The graph's note that its body-contract checks wait for Agent build (present
|
|
46
|
+
// only when built without `knownTools`) — see SkillGraph.deferredBodyContract.
|
|
47
|
+
// The note rides the graph AND each compiled skill's metadata (under
|
|
48
|
+
// SKILL_GRAPH_DEFERRED_CONTRACT_KEY), so Agent build honors it whichever way
|
|
49
|
+
// the skills arrive — `.skillGraph(graph)` or `.skills({ list: () => graph.skills })`.
|
|
50
|
+
SKILL_GRAPH_DEFERRED_CONTRACT_KEY, } from './skillGraph.js';
|
|
41
51
|
export { keywordScorer, embeddingScorer, rankEntries, } from './entryScorer.js';
|
|
42
52
|
export { checkSkillContract, checkSkillContracts, skillToolNames, } from './skillContract.js';
|
|
43
53
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAYH,+DAA+D;AAC/D,OAAO,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAEpD,SAAS;AACT,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AACpD,OAAO,EACL,2BAA2B,GAE5B,MAAM,kCAAkC,CAAC;AAE1C,gFAAgF;AAChF,OAAO,EAAE,iBAAiB,EAAiC,MAAM,kCAAkC,CAAC;AACpG,OAAO,EACL,mBAAmB,EACnB,+BAA+B,GAEhC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,WAAW,EACX,kBAAkB,GAKnB,MAAM,4BAA4B,CAAC;AAEpC,OAAO,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAE9E,8EAA8E;AAC9E,+EAA+E;AAC/E,6DAA6D;AAC7D,OAAO,EAAE,aAAa,EAA6B,MAAM,oBAAoB,CAAC;AAE9E,wEAAwE;AACxE,sEAAsE;AACtE,iEAAiE;AACjE,+BAA+B;AAC/B,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAsB,MAAM,iBAAiB,CAAC;AAE9F,OAAO,EAAE,cAAc,EAA8B,MAAM,+BAA+B,CA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EAAE,UAAU,EAA0B,MAAM,2BAA2B,CAAC;AAE/E,6EAA6E;AAC7E,0EAA0E;AAC1E,qDAAqD;AACrD,OAAO,EACL,eAAe,GAGhB,MAAM,gCAAgC,CAAC;AAExC,4EAA4E;AAC5E,8EAA8E;AAC9E,OAAO,EACL,UAAU,EACV,WAAW;AACX,mFAAmF;AACnF,qFAAqF;AACrF,uFAAuF;AACvF,6BAA6B;AAC7B,aAAa,EACb,wBAAwB;AAiCxB,+EAA+E;AAC/E,+EAA+E;AAC/E,qEAAqE;AACrE,6EAA6E;AAC7E,uFAAuF;AACvF,iCAAiC,GAQlC,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,aAAa,EACb,eAAe,EACf,WAAW,GAIZ,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,cAAc,GAEf,MAAM,oBAAoB,CAAC"}
|
|
@@ -61,8 +61,10 @@ import type { Injection, InjectionContext } from './types.js';
|
|
|
61
61
|
import type { Embedder } from '../../memory/embedding/types.js';
|
|
62
62
|
import type { EntryScore, EntryScoring, EntryScorer } from './entryScorer.js';
|
|
63
63
|
import { type GraphCheckup } from './skillGraphCheckup.js';
|
|
64
|
+
import { type SkillMatch, type SkillMatchData } from './skillMatch.js';
|
|
64
65
|
export { formatCheckup } from './skillGraphCheckup.js';
|
|
65
66
|
export type { GraphCheckup, GraphProblem, GraphProblemCode } from './skillGraphCheckup.js';
|
|
67
|
+
export type { SkillMatch, SkillMatchData } from './skillMatch.js';
|
|
66
68
|
/** How `.build({ check })` reacts to the graph check-up. */
|
|
67
69
|
export type GraphCheckMode = 'throw' | 'warn' | 'off';
|
|
68
70
|
/** Options for `.build()`. */
|
|
@@ -87,8 +89,28 @@ export interface BuildOptions {
|
|
|
87
89
|
* `ToolProvider`). Without them the skill-body contract check reads a body's
|
|
88
90
|
* `lookup_order(id)` as a typo, because the graph only knows the tools its own
|
|
89
91
|
* skills carry. Same field as `checkup({ knownTools })` — see `SkillGraph.checkup`.
|
|
92
|
+
*
|
|
93
|
+
* Omitted, the body-contract checks (`body-foreign-tool` / `body-unknown-tool`)
|
|
94
|
+
* are DEFERRED out of this build pass and run once at Agent build instead, where
|
|
95
|
+
* the full tool registry exists — see {@link SkillGraph.deferredBodyContract}.
|
|
90
96
|
*/
|
|
91
97
|
readonly knownTools?: readonly string[];
|
|
98
|
+
/**
|
|
99
|
+
* FLAT graphs: stamp `autoActivate: 'currentSkill'` on every WIRED skill (every
|
|
100
|
+
* skill an entry or a route mentions), exactly as a decision `.tree()` stamps its
|
|
101
|
+
* leaves — so a skill's tools reach the LLM only while the graph is on it, instead
|
|
102
|
+
* of every skill's tools landing in the always-on registry from iteration 1.
|
|
103
|
+
*
|
|
104
|
+
* Default `false` — today's additive behavior (10.0.0 flips the default to `true`).
|
|
105
|
+
* A skill that declared its OWN `autoActivate` in `defineSkill(...)` always keeps
|
|
106
|
+
* it: this fills the default, it never overrides. A listed-but-unwired skill is
|
|
107
|
+
* not stamped — the graph does not route it, so the graph does not scope it.
|
|
108
|
+
*
|
|
109
|
+
* A decision `.tree()` takes this dial on `.tree(root, { scopeTools })` (object
|
|
110
|
+
* form: the tree arm's own `scopeTools` field); setting it here alongside a tree
|
|
111
|
+
* is refused so one dial cannot live in two homes.
|
|
112
|
+
*/
|
|
113
|
+
readonly scopeTools?: boolean;
|
|
92
114
|
}
|
|
93
115
|
/** Options for `graph.checkup()`. */
|
|
94
116
|
export interface CheckupOptions {
|
|
@@ -103,14 +125,28 @@ export interface CheckupOptions {
|
|
|
103
125
|
*/
|
|
104
126
|
readonly knownTools?: readonly string[];
|
|
105
127
|
}
|
|
128
|
+
/**
|
|
129
|
+
* One start rule: route the turn's start to `use` when the rule matches.
|
|
130
|
+
* Exactly ONE of `match` (data) / `when` (code) per rule — the union enforces it
|
|
131
|
+
* at the keystroke and the build refuses it for everyone else. A rule exists to
|
|
132
|
+
* be conditional; for an unconditional start use `start: 'id'` / `{ use }`.
|
|
133
|
+
*/
|
|
134
|
+
export type SkillStartRule = {
|
|
135
|
+
readonly use: string;
|
|
136
|
+
/** The code form — an opaque predicate over the iteration context. */
|
|
137
|
+
readonly when: (ctx: InjectionContext) => boolean;
|
|
138
|
+
readonly match?: never;
|
|
139
|
+
} | {
|
|
140
|
+
readonly use: string;
|
|
141
|
+
/** The data form — comparable, drawable, stored. See {@link SkillMatch}. */
|
|
142
|
+
readonly match: SkillMatch;
|
|
143
|
+
readonly when?: never;
|
|
144
|
+
};
|
|
106
145
|
/** Where a turn starts, in the object-literal (flat) form. */
|
|
107
146
|
export type SkillGraphStart = string | {
|
|
108
147
|
readonly use: string;
|
|
109
148
|
} | {
|
|
110
|
-
readonly rules: ReadonlyArray<
|
|
111
|
-
readonly when: (ctx: InjectionContext) => boolean;
|
|
112
|
-
readonly use: string;
|
|
113
|
-
}>;
|
|
149
|
+
readonly rules: ReadonlyArray<SkillStartRule>;
|
|
114
150
|
} | {
|
|
115
151
|
readonly entries: readonly string[];
|
|
116
152
|
/** Rank the entries with a scorer strategy (`keywordScorer()`,
|
|
@@ -141,9 +177,16 @@ export interface SkillGraphFlatConfig {
|
|
|
141
177
|
/** Tool-result transitions; `from`/`to` are skill ids resolved against `skills`. */
|
|
142
178
|
readonly steps?: readonly SkillGraphStep[];
|
|
143
179
|
readonly tree?: never;
|
|
144
|
-
/**
|
|
145
|
-
*
|
|
146
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Stamp `autoActivate: 'currentSkill'` on every WIRED skill (every skill an
|
|
182
|
+
* entry or a step mentions), exactly as the tree arm already stamps its leaves —
|
|
183
|
+
* a skill's tools reach the LLM only while the graph is on it. **Default `false`**
|
|
184
|
+
* (today's additive behavior — every skill's tools visible from iteration 1);
|
|
185
|
+
* 10.0.0 flips the default to `true`. A skill whose author set its own
|
|
186
|
+
* `autoActivate` keeps it: the graph level is a default, never an override.
|
|
187
|
+
* See {@link BuildOptions.scopeTools}.
|
|
188
|
+
*/
|
|
189
|
+
readonly scopeTools?: boolean;
|
|
147
190
|
readonly check?: GraphCheckMode;
|
|
148
191
|
/** Baseline agent tool names — see {@link BuildOptions.knownTools}. */
|
|
149
192
|
readonly knownTools?: readonly string[];
|
|
@@ -222,6 +265,15 @@ export interface SkillEntryOptions {
|
|
|
222
265
|
* entry, which is a position in a state machine.
|
|
223
266
|
*/
|
|
224
267
|
readonly when?: (ctx: InjectionContext) => boolean;
|
|
268
|
+
/**
|
|
269
|
+
* The DATA form of `when` — a declared matcher over the user's message instead
|
|
270
|
+
* of a predicate (see {@link SkillMatch}): comparable by the check-up, captioned
|
|
271
|
+
* by `toMermaid()`, stored on the compiled skill's provenance. Same start
|
|
272
|
+
* semantics as `when` in every other way. At most ONE of `match`/`when` — both
|
|
273
|
+
* set is refused at build time. Omitting both keeps this an `always` entry,
|
|
274
|
+
* exactly as before.
|
|
275
|
+
*/
|
|
276
|
+
readonly match?: SkillMatch;
|
|
225
277
|
readonly label?: string;
|
|
226
278
|
}
|
|
227
279
|
/** Options for a decision `tree()`. */
|
|
@@ -255,6 +307,10 @@ export interface SkillEdge {
|
|
|
255
307
|
readonly to: string;
|
|
256
308
|
readonly kind: SkillEdgeKind;
|
|
257
309
|
readonly label?: string;
|
|
310
|
+
/** The DATA matcher on an entry edge, when the rule was declared as data
|
|
311
|
+
* (`match:`). `toMermaid()` captions the edge with it when no explicit
|
|
312
|
+
* `label` was given. */
|
|
313
|
+
readonly match?: SkillMatchData;
|
|
258
314
|
}
|
|
259
315
|
/**
|
|
260
316
|
* A decision-tree node (v3): a predicate that branches to a subtree (or a skill
|
|
@@ -293,6 +349,33 @@ export declare function decideSkill(predicate: (ctx: InjectionContext) => boolea
|
|
|
293
349
|
* therefore attributed to that edge, label and all, in the recorded route.
|
|
294
350
|
*/
|
|
295
351
|
export type CursorMoveCause = 'entry' | 'route' | 'model-pick' | 'stay' | 'none';
|
|
352
|
+
/**
|
|
353
|
+
* One tool result's routing implication inside a parallel batch (9.16.0) —
|
|
354
|
+
* which call it was, and the edge target it matched. Named by
|
|
355
|
+
* `skill.route_conflict` as the winner or a suppressed loser.
|
|
356
|
+
*/
|
|
357
|
+
export interface RouteBatchOutcome {
|
|
358
|
+
/** The provider's tool_use id for the call. Absent only for a context that
|
|
359
|
+
* supplied the singular `lastToolResult` (which can never conflict). */
|
|
360
|
+
readonly toolCallId?: string;
|
|
361
|
+
/** The tool whose result matched an edge. */
|
|
362
|
+
readonly toolName: string;
|
|
363
|
+
/** The edge target that result routed to. */
|
|
364
|
+
readonly target: string;
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Two or more results of ONE parallel batch matched edges to DIFFERENT
|
|
368
|
+
* targets (9.16.0). The first in call order wins the cursor; the rest are
|
|
369
|
+
* suppressed — and reported here rather than silently dropped, so the record
|
|
370
|
+
* explains the hop the run did NOT take. Same-target matches are not a
|
|
371
|
+
* conflict (they all asked for the move that happened).
|
|
372
|
+
*/
|
|
373
|
+
export interface RouteBatchConflict {
|
|
374
|
+
/** The call-order-first match — the one that moved the cursor. */
|
|
375
|
+
readonly winner: RouteBatchOutcome;
|
|
376
|
+
/** Later matches to other targets, in call order, that did not move it. */
|
|
377
|
+
readonly losers: readonly RouteBatchOutcome[];
|
|
378
|
+
}
|
|
296
379
|
/** The cursor resolver's full answer: where, and by which clause. */
|
|
297
380
|
export interface CursorMove {
|
|
298
381
|
/** The cursor after this iteration (what `nextSkill` returns). */
|
|
@@ -301,6 +384,10 @@ export interface CursorMove {
|
|
|
301
384
|
readonly from?: string;
|
|
302
385
|
/** The winning clause. */
|
|
303
386
|
readonly by: CursorMoveCause;
|
|
387
|
+
/** Present only when `by: 'route'` resolved a parallel batch whose results
|
|
388
|
+
* matched edges to different targets — the suppression, on the record.
|
|
389
|
+
* The Evaluate stage emits it as `agentfootprint.skill.route_conflict`. */
|
|
390
|
+
readonly conflict?: RouteBatchConflict;
|
|
304
391
|
}
|
|
305
392
|
/** A node in the drawn graph — a `predicate` diamond or a `skill` box. */
|
|
306
393
|
export interface SkillNode {
|
|
@@ -340,9 +427,33 @@ export interface SkillRouting {
|
|
|
340
427
|
readonly from?: string;
|
|
341
428
|
/** The compiled trigger kind for a route (`rule` / `on-tool-return`). */
|
|
342
429
|
readonly triggerKind?: string;
|
|
430
|
+
/** The DATA matcher that routes here (entry only, when declared as `match:`) —
|
|
431
|
+
* serializable, so commentary/lens can say WHICH pattern chose the skill. */
|
|
432
|
+
readonly match?: SkillMatchData;
|
|
343
433
|
}
|
|
344
434
|
/** The metadata key carrying a skill's routing provenance. */
|
|
345
435
|
export declare const SKILL_GRAPH_METADATA_KEY: "skillGraph";
|
|
436
|
+
/**
|
|
437
|
+
* The note a graph leaves for Agent build when its own build pass DEFERRED the
|
|
438
|
+
* skill-body ↔ tool-contract checks (`body-foreign-tool` / `body-unknown-tool`) —
|
|
439
|
+
* see {@link SkillGraph.deferredBodyContract}.
|
|
440
|
+
*/
|
|
441
|
+
export interface DeferredBodyContract {
|
|
442
|
+
/** The graph's `check` mode — the severity the deferred run respects
|
|
443
|
+
* (`'off'` never defers: it stays off at agent build too). */
|
|
444
|
+
readonly mode: 'throw' | 'warn';
|
|
445
|
+
}
|
|
446
|
+
/**
|
|
447
|
+
* The metadata key carrying the {@link DeferredBodyContract} note on each COMPILED
|
|
448
|
+
* skill. The graph-level `graph.deferredBodyContract` note names the deferral, but
|
|
449
|
+
* skills reach an agent through more than one door — `.skillGraph(graph)` sees the
|
|
450
|
+
* graph, `.skills({ list: () => graph.skills })` sees only the skills — so the note
|
|
451
|
+
* also rides each skill's own metadata. Agent build collects it from the final
|
|
452
|
+
* injection list, whichever door the skills came through, and runs the deferred
|
|
453
|
+
* checks exactly once (skills found by BOTH the metadata and the graph note are
|
|
454
|
+
* deduped by id).
|
|
455
|
+
*/
|
|
456
|
+
export declare const SKILL_GRAPH_DEFERRED_CONTRACT_KEY: "skillGraphDeferredBodyContract";
|
|
346
457
|
export interface SkillGraph {
|
|
347
458
|
/** Skills with graph-derived triggers — feed to the Agent (`.skillGraph()` or
|
|
348
459
|
* `.skills({ list: () => graph.skills })`). */
|
|
@@ -359,7 +470,9 @@ export interface SkillGraph {
|
|
|
359
470
|
* Returns the skill id the graph should be *in* after this iteration:
|
|
360
471
|
* • cold start (`ctx.currentSkillId` unset) → the first matching `entry`,
|
|
361
472
|
* else the entry the model picked with `read_skill`;
|
|
362
|
-
* • a `from`-gated route whose predicate matches
|
|
473
|
+
* • a `from`-gated route whose predicate matches a result of the previous
|
|
474
|
+
* iteration's tool batch (`ctx.toolResults`, in call order; falls back to
|
|
475
|
+
* the singular `ctx.lastToolResult`) → its target;
|
|
363
476
|
* • else the model's `read_skill` pick (`ctx.pendingSkillPick`), which the
|
|
364
477
|
* runtime sets only after the reachability gate accepted it;
|
|
365
478
|
* • otherwise the current cursor unchanged (sticky stay).
|
|
@@ -462,6 +575,25 @@ export interface SkillGraph {
|
|
|
462
575
|
* if (!report.ok) throw new Error(formatCheckup(report));
|
|
463
576
|
*/
|
|
464
577
|
checkup(options?: CheckupOptions): GraphCheckup;
|
|
578
|
+
/**
|
|
579
|
+
* Present when this graph's own build pass DEFERRED the skill-body ↔
|
|
580
|
+
* tool-contract checks (`body-foreign-tool` / `body-unknown-tool`): built
|
|
581
|
+
* WITHOUT `knownTools`, the graph cannot tell a typo from a baseline tool the
|
|
582
|
+
* agent registers later — `lookup_order(id)` in a body and `lokup_order(id)`
|
|
583
|
+
* look identical to it — so instead of reporting what it cannot prove, it
|
|
584
|
+
* leaves this note and Agent build runs those checks exactly once, against the
|
|
585
|
+
* agent's full tool registry. The note also rides each compiled skill's own
|
|
586
|
+
* metadata ({@link SKILL_GRAPH_DEFERRED_CONTRACT_KEY}), so it is honored
|
|
587
|
+
* whichever way the skills arrive — `.skillGraph(graph)` or
|
|
588
|
+
* `.skills({ list: () => graph.skills })`.
|
|
589
|
+
*
|
|
590
|
+
* Absent when the checks already ran at graph build (`knownTools` was given —
|
|
591
|
+
* the manual override stays an override) or were switched off (`check: 'off'`);
|
|
592
|
+
* the agent then never re-runs them, so one problem is reported at one build
|
|
593
|
+
* point, never both. `graph.checkup()` is unaffected — it always runs every
|
|
594
|
+
* check over what it can see, and remains the graph-only lint surface.
|
|
595
|
+
*/
|
|
596
|
+
readonly deferredBodyContract?: DeferredBodyContract;
|
|
465
597
|
}
|
|
466
598
|
export interface SkillGraphBuilder {
|
|
467
599
|
/** Mark a skill as reachable at turn start (optionally intent-conditional). */
|