agentfootprint 9.85.0 → 9.86.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/CHANGELOG.md +376 -24
- package/dist/core/Agent.js +15 -4
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js +5 -0
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/buildDynamicAgentChart.js +22 -4
- package/dist/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/core/agent/buildToolRegistry.js +12 -1
- package/dist/core/agent/buildToolRegistry.js.map +1 -1
- package/dist/core/agent/selfCallNotice.js +20 -7
- package/dist/core/agent/selfCallNotice.js.map +1 -1
- package/dist/core/agent/skillBrains.js +3 -2
- package/dist/core/agent/skillBrains.js.map +1 -1
- package/dist/core/agent/stages/stepNudge.js +13 -4
- package/dist/core/agent/stages/stepNudge.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +389 -58
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/agent/stages/wrapUp.js +43 -6
- package/dist/core/agent/stages/wrapUp.js.map +1 -1
- package/dist/core/agent/window/currentRequest.js +4 -2
- package/dist/core/agent/window/currentRequest.js.map +1 -1
- package/dist/core/slots/buildToolsSlot.js +20 -4
- package/dist/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/doors/skill-graph.js +4 -1
- package/dist/doors/skill-graph.js.map +1 -1
- package/dist/esm/core/Agent.js +15 -4
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +2 -1
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.js +5 -0
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildDynamicAgentChart.js +22 -4
- package/dist/esm/core/agent/buildDynamicAgentChart.js.map +1 -1
- package/dist/esm/core/agent/buildToolRegistry.d.ts +20 -0
- package/dist/esm/core/agent/buildToolRegistry.js +12 -1
- package/dist/esm/core/agent/buildToolRegistry.js.map +1 -1
- package/dist/esm/core/agent/selfCallNotice.d.ts +20 -7
- package/dist/esm/core/agent/selfCallNotice.js +20 -7
- package/dist/esm/core/agent/selfCallNotice.js.map +1 -1
- package/dist/esm/core/agent/skillBrains.d.ts +12 -4
- package/dist/esm/core/agent/skillBrains.js +3 -2
- package/dist/esm/core/agent/skillBrains.js.map +1 -1
- package/dist/esm/core/agent/stages/stepNudge.d.ts +13 -4
- package/dist/esm/core/agent/stages/stepNudge.js +13 -4
- package/dist/esm/core/agent/stages/stepNudge.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +171 -0
- package/dist/esm/core/agent/stages/toolCalls.js +385 -57
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/stages/wrapUp.d.ts +33 -2
- package/dist/esm/core/agent/stages/wrapUp.js +41 -5
- package/dist/esm/core/agent/stages/wrapUp.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +21 -4
- package/dist/esm/core/agent/window/currentRequest.d.ts +4 -2
- package/dist/esm/core/agent/window/currentRequest.js +4 -2
- package/dist/esm/core/agent/window/currentRequest.js.map +1 -1
- package/dist/esm/core/slots/buildToolsSlot.d.ts +1 -1
- package/dist/esm/core/slots/buildToolsSlot.js +20 -4
- package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
- package/dist/esm/doors/skill-graph.d.ts +1 -1
- package/dist/esm/doors/skill-graph.js +4 -1
- package/dist/esm/doors/skill-graph.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +26 -2
- package/dist/esm/index.js +6 -5
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/index.d.ts +1 -1
- package/dist/esm/lib/injection-engine/index.js +4 -1
- package/dist/esm/lib/injection-engine/index.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillGraph.d.ts +56 -0
- package/dist/esm/lib/injection-engine/skillGraph.js +29 -3
- package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillSteps.d.ts +20 -1
- package/dist/esm/lib/injection-engine/skillSteps.js +24 -3
- package/dist/esm/lib/injection-engine/skillSteps.js.map +1 -1
- package/dist/esm/lib/injection-engine/skillToolDescriptors.d.ts +18 -0
- package/dist/esm/lib/injection-engine/skillToolDescriptors.js +103 -10
- package/dist/esm/lib/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/esm/lib/injection-engine/types.d.ts +12 -10
- package/dist/esm/lib/injection-engine/types.js +5 -4
- package/dist/esm/lib/injection-engine/types.js.map +1 -1
- package/dist/esm/lib/saidByPerson.d.ts +48 -15
- package/dist/esm/lib/saidByPerson.js +52 -17
- package/dist/esm/lib/saidByPerson.js.map +1 -1
- package/dist/esm/lib/spokenIds.d.ts +52 -0
- package/dist/esm/lib/spokenIds.js +11 -0
- package/dist/esm/lib/spokenIds.js.map +1 -0
- package/dist/esm/lib/trace-toolpack/traceToolpack.js +12 -5
- package/dist/esm/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/index.js +6 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/injection-engine/index.js +5 -2
- package/dist/lib/injection-engine/index.js.map +1 -1
- package/dist/lib/injection-engine/skillGraph.js +31 -4
- package/dist/lib/injection-engine/skillGraph.js.map +1 -1
- package/dist/lib/injection-engine/skillSteps.js +24 -3
- package/dist/lib/injection-engine/skillSteps.js.map +1 -1
- package/dist/lib/injection-engine/skillToolDescriptors.js +103 -10
- package/dist/lib/injection-engine/skillToolDescriptors.js.map +1 -1
- package/dist/lib/injection-engine/types.js +5 -4
- package/dist/lib/injection-engine/types.js.map +1 -1
- package/dist/lib/saidByPerson.js +53 -18
- package/dist/lib/saidByPerson.js.map +1 -1
- package/dist/lib/spokenIds.js +15 -0
- package/dist/lib/spokenIds.js.map +1 -0
- package/dist/lib/trace-toolpack/traceToolpack.js +12 -5
- package/dist/lib/trace-toolpack/traceToolpack.js.map +1 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +2 -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/buildToolRegistry.d.ts +20 -0
- package/dist/types/core/agent/buildToolRegistry.d.ts.map +1 -1
- package/dist/types/core/agent/selfCallNotice.d.ts +20 -7
- package/dist/types/core/agent/selfCallNotice.d.ts.map +1 -1
- package/dist/types/core/agent/skillBrains.d.ts +12 -4
- package/dist/types/core/agent/skillBrains.d.ts.map +1 -1
- package/dist/types/core/agent/stages/stepNudge.d.ts +13 -4
- package/dist/types/core/agent/stages/stepNudge.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +171 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/stages/wrapUp.d.ts +33 -2
- package/dist/types/core/agent/stages/wrapUp.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +21 -4
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/agent/window/currentRequest.d.ts +4 -2
- package/dist/types/core/agent/window/currentRequest.d.ts.map +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts +1 -1
- package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
- package/dist/types/doors/skill-graph.d.ts +1 -1
- package/dist/types/doors/skill-graph.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +26 -2
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/index.d.ts +1 -1
- package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillGraph.d.ts +56 -0
- package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillSteps.d.ts +20 -1
- package/dist/types/lib/injection-engine/skillSteps.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/skillToolDescriptors.d.ts +18 -0
- package/dist/types/lib/injection-engine/skillToolDescriptors.d.ts.map +1 -1
- package/dist/types/lib/injection-engine/types.d.ts +12 -10
- package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
- package/dist/types/lib/saidByPerson.d.ts +48 -15
- package/dist/types/lib/saidByPerson.d.ts.map +1 -1
- package/dist/types/lib/spokenIds.d.ts +53 -0
- package/dist/types/lib/spokenIds.d.ts.map +1 -0
- package/dist/types/lib/trace-toolpack/traceToolpack.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
* into `history`, and then read by the model on call N+1 AND ON EVERY CALL
|
|
21
21
|
* AFTER IT for the rest of the turn — including the out-of-budget WRAP-UP,
|
|
22
22
|
* which `callLLM` serves with an EMPTY tool list under a user message saying
|
|
23
|
-
*
|
|
23
|
+
* that no tools were offered on it.
|
|
24
24
|
*
|
|
25
25
|
* The consequence is the whole design: NO COMPOSE-TIME CHECK CAN MAKE A
|
|
26
26
|
* FORWARD-LOOKING SENTENCE SAFE. A budget test, a posture test, a cursor test
|
|
@@ -44,7 +44,8 @@
|
|
|
44
44
|
* open-skill offer ("These activate without moving you: gamma"), and the
|
|
45
45
|
* budget clause that was added to gate them. Each was false somewhere:
|
|
46
46
|
*
|
|
47
|
-
* • the exhortation, on the wrap-up call, beside
|
|
47
|
+
* • the exhortation, on the wrap-up call, beside a frame reporting that no
|
|
48
|
+
* tools were offered on it;
|
|
48
49
|
* • the move offer, on the wrap-up call (a hop is a tool call), under
|
|
49
50
|
* `strictness: 'rails'` (every model hop refused) and under `'guard'` on a
|
|
50
51
|
* decisively-routed turn (every hop not on an outstanding menu refused) —
|
|
@@ -73,11 +74,23 @@
|
|
|
73
74
|
* that cannot be established, which is not the same answer and must not be
|
|
74
75
|
* reported as one.
|
|
75
76
|
*
|
|
76
|
-
* `undefined` means the notice says nothing about tools at all
|
|
77
|
-
*
|
|
78
|
-
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
77
|
+
* `undefined` means the notice says nothing about tools at all, and there are
|
|
78
|
+
* exactly two ways to get it (9.86.0 — the previous note named a third that
|
|
79
|
+
* cannot happen). It happens when the cursor's skill is not in the ACTIVE set
|
|
80
|
+
* for that call, and when the wire key is absent from scope altogether.
|
|
81
|
+
*
|
|
82
|
+
* `reactMode: 'classic'` is NOT one of them, which is worth stating because the
|
|
83
|
+
* old note said it was: seed writes `scope.dynamicToolSchemas` from the
|
|
84
|
+
* build-time schemas at turn start (`stages/seed.ts`), so under classic the key
|
|
85
|
+
* is present and holds the list `callLLM` really sends — the notice would name
|
|
86
|
+
* the build-time list, correctly. (No self-call can arise there anyway:
|
|
87
|
+
* `.skillGraph()` is refused at build under classic, and only a graph gives the
|
|
88
|
+
* gate a cursor to compare against.) The grouped chart used to be a real third
|
|
89
|
+
* way — the Tools slot writes the key inside `sf-llm-call` and this gate reads
|
|
90
|
+
* it outside — until that boundary began bubbling it out.
|
|
91
|
+
*
|
|
92
|
+
* Silence is the only honest output in the two remaining cases: the
|
|
93
|
+
* alternative is a sentence naming tools the model may not have.
|
|
81
94
|
*
|
|
82
95
|
* The out-of-budget wrap-up is NOT one of these cases and must not be modelled
|
|
83
96
|
* as one. Its empty tool list belongs to a LATER call; the wire read here is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selfCallNotice.js","sourceRoot":"","sources":["../../../../src/core/agent/selfCallNotice.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"selfCallNotice.js","sourceRoot":"","sources":["../../../../src/core/agent/selfCallNotice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsEG;AAaH;;;;;;;;;;;;;;;;;;;;;;;;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,KAAK,KAAK,SAAS;QACjB,CAAC,CAAC,EAAE;QACJ,CAAC,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;YAC7B,CAAC,CAAC,mCAAmC;YACrC,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC;gBACzB,CAAC,CAAC,gDAAgD,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;gBAC5E,CAAC,CAAC,wDAAwD,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;oBACpF,GAAG,KAAK,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,aAAa,CAAC;IACnE,6EAA6E;IAC7E,yEAAyE;IACzE,2EAA2E;IAC3E,6EAA6E;IAC7E,4EAA4E;IAC5E,2EAA2E;IAC3E,oEAAoE;IACpE,MAAM,MAAM,GACV,eAAe,OAAO,2DAA2D;QACjF,kFAAkF;QAClF,mBAAmB,UAAU,GAAG,UAAU,EAAE,CAAC;IAC/C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,EAAE,CAAC;IACjC,OAAO,IAAI,KAAK,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,OAAO,IAAI,EAAE,CAAC;AAChE,CAAC"}
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
* that disagrees with itself must not pick a silent winner.
|
|
30
30
|
*
|
|
31
31
|
* ESCALATE-ON-EVIDENCE. `escalation: { provider, model?, afterRefusals: N }`
|
|
32
|
-
* — when the gate refuses N routing picks in ONE turn (`skill.rejected
|
|
33
|
-
* reachability
|
|
32
|
+
* — when the gate refuses N routing picks in ONE turn (`skill.rejected` —
|
|
33
|
+
* reachability, posture, OR a self-call: all three refusal arms count, and
|
|
34
|
+
* they are real recorded refusals, never vibes), the rest
|
|
34
35
|
* of the turn runs on the escalation brain, `skill.escalated` goes on the
|
|
35
36
|
* record once, and the next turn's seed de-escalates. The loop the model is
|
|
36
37
|
* flubbing gets the bigger brain until the turn resolves.
|
|
@@ -51,8 +52,15 @@ export interface ProviderChoice {
|
|
|
51
52
|
}
|
|
52
53
|
/** Escalate-on-evidence policy (see the module header). */
|
|
53
54
|
export interface EscalationPolicy extends ProviderChoice {
|
|
54
|
-
/** Gate refusals (`skill.rejected`
|
|
55
|
-
*
|
|
55
|
+
/** Gate refusals (`skill.rejected`) in ONE turn that flip the rest of the
|
|
56
|
+
* turn onto this brain. Integer ≥ 1.
|
|
57
|
+
*
|
|
58
|
+
* ALL THREE refusal arms count — an unreachable pick, a pick a `strictness`
|
|
59
|
+
* posture declined, and a SELF-CALL (`read_skill` naming the cursor's own
|
|
60
|
+
* skill). The self-call arm composes a notice rather than a refusal, and it
|
|
61
|
+
* still counts here on purpose: what this budget measures is a model asking
|
|
62
|
+
* the graph where it stands instead of working, which is the same stuck loop
|
|
63
|
+
* whichever arm answered it. */
|
|
56
64
|
readonly afterRefusals: number;
|
|
57
65
|
}
|
|
58
66
|
/** A brain as the fold stores it: `defineSkill({ model })` alone is legal
|
|
@@ -29,8 +29,9 @@
|
|
|
29
29
|
* that disagrees with itself must not pick a silent winner.
|
|
30
30
|
*
|
|
31
31
|
* ESCALATE-ON-EVIDENCE. `escalation: { provider, model?, afterRefusals: N }`
|
|
32
|
-
* — when the gate refuses N routing picks in ONE turn (`skill.rejected
|
|
33
|
-
* reachability
|
|
32
|
+
* — when the gate refuses N routing picks in ONE turn (`skill.rejected` —
|
|
33
|
+
* reachability, posture, OR a self-call: all three refusal arms count, and
|
|
34
|
+
* they are real recorded refusals, never vibes), the rest
|
|
34
35
|
* of the turn runs on the escalation brain, `skill.escalated` goes on the
|
|
35
36
|
* record once, and the next turn's seed de-escalates. The loop the model is
|
|
36
37
|
* flubbing gets the bigger brain until the turn resolves.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skillBrains.js","sourceRoot":"","sources":["../../../../src/core/agent/skillBrains.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"skillBrains.js","sourceRoot":"","sources":["../../../../src/core/agent/skillBrains.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAIH,OAAO,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAoE1E;;;0EAG0E;AAC1E,MAAM,UAAU,YAAY,CAAC,SAAoB;IAC/C,MAAM,IAAI,GAAG,SAAS,CAAC,QAAkE,CAAC;IAC1F,IAAI,IAAI,EAAE,QAAQ,KAAK,SAAS,IAAI,IAAI,EAAE,KAAK,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IAChF,OAAO;QACL,oEAAoE;QACpE,GAAG,CAAC,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC/D,GAAG,CAAC,IAAI,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;KACvD,CAAC;AACJ,CAAC;AAoBD;;;;GAIG;AACH,MAAM,UAAU,eAAe,CAAC,IAAyB;IACvD,MAAM,WAAW,GAAG,IAAI,GAAG,CAAyB,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC;IAC1F,MAAM,UAAU,GAAG,IAAI,GAAG,EAA0B,CAAC;IACrD,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;QAClC,IAAI,GAAG,CAAC,MAAM,KAAK,OAAO;YAAE,SAAS;QACrC,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC;QAChC,IAAI,KAAK;YAAE,UAAU,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;IAC3C,CAAC;IACD,MAAM,gBA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AC,UAAU,CAAC,KAAK;aACpC,CAAC;YACF,aAAa,EAAE,WAAW,CAAC,IAAI,CAAC,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC;YAC3D,GAAG,EAAE,YAAY;SAClB;QACH,CAAC,CAAC,SAAS,CAAC;IAEd,OAAO,CAAC,YAAY,EAAE,SAAS,EAAE,EAAE;QACjC,uEAAuE;QACvE,sEAAsE;QACtE,IAAI,SAAS,IAAI,UAAU,KAAK,SAAS;YAAE,OAAO,UAAU,CAAC;QAC7D,IAAI,YAAY,KAAK,SAAS;YAAE,OAAO,SAAS,CAAC;QACjD,OAAO,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;IACnC,CAAC,CAAC;AACJ,CAAC;AAED;;6EAE6E;AAC7E,MAAM,UAAU,oBAAoB,CAAC,IAMpC;IACC,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC3F,MAAM,QAAQ,GAAG,KAAK,EAAE,QAAQ,EAAE,IAAI,IAAI,IAAI,CAAC,iBAAiB,CAAC;IACjE,MAAM,KAAK,GAAG,KAAK,EAAE,KAAK,IAAI,IAAI,CAAC,aAAa,IAAI,IAAI,CAAC,YAAY,CAAC;IACtE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;AAC7B,CAAC"}
|
|
@@ -11,10 +11,19 @@
|
|
|
11
11
|
*
|
|
12
12
|
* What it appends is the conversation as it really went: the premature
|
|
13
13
|
* answer as the assistant turn, then a `role: 'user'` teaching message
|
|
14
|
-
* naming every unrun step and its note
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* naming every unrun step and its note. At most once per turn
|
|
15
|
+
* (`stepNudgeSpent`); the model stopping AGAIN is honored
|
|
16
|
+
* (`steps_unfinished { action: 'accepted' }`, judged by the decider) — a
|
|
17
|
+
* procedure is a declared order, never a forced march.
|
|
18
|
+
*
|
|
19
|
+
* That teaching message is written by `nudgeTeachingMessage` (skillSteps.ts
|
|
20
|
+
* owns every sentence about a procedure) and, since 9.86.0, opens with
|
|
21
|
+
* `STEP_NUDGE_FRAME_PREFIX` from the authorship registry. It has to: this
|
|
22
|
+
* stage puts it in `scope.history` under `role: 'user'`, where it looks like
|
|
23
|
+
* a person's turn to `isSaidByPerson` — and its body lists the skill id and
|
|
24
|
+
* the unrun steps' TOOL NAMES, which is precisely what a routing rule
|
|
25
|
+
* scanning history matches on. The opening is what tells the window's
|
|
26
|
+
* refusal engine and a rule author that nobody said it.
|
|
18
27
|
*
|
|
19
28
|
* Pure function apart from its plan closure — no Agent class state.
|
|
20
29
|
*/
|
|
@@ -11,10 +11,19 @@
|
|
|
11
11
|
*
|
|
12
12
|
* What it appends is the conversation as it really went: the premature
|
|
13
13
|
* answer as the assistant turn, then a `role: 'user'` teaching message
|
|
14
|
-
* naming every unrun step and its note
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
14
|
+
* naming every unrun step and its note. At most once per turn
|
|
15
|
+
* (`stepNudgeSpent`); the model stopping AGAIN is honored
|
|
16
|
+
* (`steps_unfinished { action: 'accepted' }`, judged by the decider) — a
|
|
17
|
+
* procedure is a declared order, never a forced march.
|
|
18
|
+
*
|
|
19
|
+
* That teaching message is written by `nudgeTeachingMessage` (skillSteps.ts
|
|
20
|
+
* owns every sentence about a procedure) and, since 9.86.0, opens with
|
|
21
|
+
* `STEP_NUDGE_FRAME_PREFIX` from the authorship registry. It has to: this
|
|
22
|
+
* stage puts it in `scope.history` under `role: 'user'`, where it looks like
|
|
23
|
+
* a person's turn to `isSaidByPerson` — and its body lists the skill id and
|
|
24
|
+
* the unrun steps' TOOL NAMES, which is precisely what a routing rule
|
|
25
|
+
* scanning history matches on. The opening is what tells the window's
|
|
26
|
+
* refusal engine and a rule author that nobody said it.
|
|
18
27
|
*
|
|
19
28
|
* Pure function apart from its plan closure — no Agent class state.
|
|
20
29
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stepNudge.js","sourceRoot":"","sources":["../../../../../src/core/agent/stages/stepNudge.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"stepNudge.js","sourceRoot":"","sources":["../../../../../src/core/agent/stages/stepNudge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAIH,OAAO,EAAE,SAAS,EAAE,MAAM,sCAAsC,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,SAAS,EACT,gBAAgB,EAChB,cAAc,GAEf,MAAM,6CAA6C,CAAC;AAGrD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CACjC,WAAwB;IAExB,OAAO,CAAC,KAAK,EAAE,EAAE;QACf,MAAM,GAAG,GAAG,SAAS,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;QACzC,MAAM,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACxE,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;YAClB,4DAA4D;YAC5D,iEAAiE;YACjE,oEAAoE;YACpE,mEAAmE;YACnE,OAAO;QACT,CAAC;QAED,MAAM,SAAS,GAAG,KAAK,CAAC,SAAmB,CAAC;QAC5C,MAAM,eAAe,GAAG,KAAK,CAAC,gBAA0B,CAAC;QACzD,MAAM,QAAQ,GAAG,oBAAoB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QAEjD,sEAAsE;QACtE,uEAAuE;QACvE,wEAAwE;QACxE,+BAA+B;QAC/B,MAAM,UAAU,GAAiB;YAC/B,GAAI,KAAK,CAAC,OAAiC;YAC3C,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,eAAe,EAAE;YAC/C,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE;SACpC,CAAC;QACF,KAAK,CAAC,OAAO,GAAG,UAAU,CAAC;QAE3B,mEAAmE;QACnE,oEAAoE;QACpE,YAAY;QACZ,KAAK,CAAC,cAAc,GAAG,IAAI,CAAC;QAE5B,SAAS,CAAC,KAAK,EAAE,uCAAuC,EAAE;YACxD,OAAO,EAAE,GAAG,CAAC,OAAO;YACpB,SAAS,EAAE,gBAAgB,CAAC,GAAG,EAAE,IAAI,CAAC;YACtC,KAAK,EAAE,GAAG,CAAC,KAAK;YAChB,MAAM,EAAE,QAAQ;YAChB,SAAS;SACV,CAAC,CAAC;QAEH,wEAAwE;QACxE,qEAAqE;QACrE,uEAAuE;QACvE,8DAA8D;QAC9D,SAAS,CAAC,KAAK,EAAE,oCAAoC,EAAE;YACrD,SAAS,EAAE,CAAC;YACZ,SAAS,EAAE,SAAS;YACpB,aAAa,EAAE,CAAC;YAChB,OAAO,EAAE,UAAU;SACpB,CAAC,CAAC;QAEH,wEAAwE;QACxE,iDAAiD;QACjD,KAAK,CAAC,SAAS,GAAG,SAAS,GAAG,CAAC,CAAC;IAClC,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -44,6 +44,8 @@
|
|
|
44
44
|
*/
|
|
45
45
|
import type { PausableHandler, TypedScope } from 'footprintjs';
|
|
46
46
|
import type { PermissionChecker } from '../../../adapters/types.js';
|
|
47
|
+
import { type SkillTargetClass } from '../../../lib/injection-engine/skillGraph.js';
|
|
48
|
+
import { type SpokenIds } from '../../../lib/spokenIds.js';
|
|
47
49
|
import type { ToolProvider } from '../../../tool-providers/types.js';
|
|
48
50
|
import type { CredentialProvider } from '../../../identity/types.js';
|
|
49
51
|
import type { ArtifactStore } from '../../../artifacts/types.js';
|
|
@@ -114,6 +116,21 @@ export interface ToolCallsHandlerDeps {
|
|
|
114
116
|
readonly integrityLedger?: {
|
|
115
117
|
current: import('../../../integrity/disposition/ledger.js').DispositionLedger | undefined;
|
|
116
118
|
};
|
|
119
|
+
/**
|
|
120
|
+
* WHICH SKILLS DECLARE EACH TOOL NAME (9.86.0) — tool name → the ids of the
|
|
121
|
+
* skills whose `inject.tools` carry it, from `buildToolRegistry`, the one
|
|
122
|
+
* place that already walks every skill's tool array.
|
|
123
|
+
*
|
|
124
|
+
* Read by `dispatchRoster` and by nothing else: a role that may not see a
|
|
125
|
+
* skill may not be told the names of the tools that skill brought. A name is
|
|
126
|
+
* unnameable only when EVERY declaring skill is hidden, so a tool two skills
|
|
127
|
+
* share survives one of them being hidden.
|
|
128
|
+
*
|
|
129
|
+
* Absent for an agent with no skill-carried tools — the map is built only
|
|
130
|
+
* when at least one skill declares one — and then the roster is the raw
|
|
131
|
+
* dispatch set, exactly as it was.
|
|
132
|
+
*/
|
|
133
|
+
readonly toolDeclaringSkills?: ReadonlyMap<string, readonly string[]>;
|
|
117
134
|
/** Optional external `.toolProvider()` for per-iteration dynamic
|
|
118
135
|
* tools (skill-scoped, multi-tenant, etc.). Consulted only when
|
|
119
136
|
* the static registry doesn't have the tool. */
|
|
@@ -395,4 +412,158 @@ export interface ToolCallsHandlerDeps {
|
|
|
395
412
|
*/
|
|
396
413
|
readonly clearConsentOutstanding?: (service: string) => void;
|
|
397
414
|
}
|
|
415
|
+
/**
|
|
416
|
+
* Is this `read_skill` target the cursor's own skill AND is that cursor
|
|
417
|
+
* MOUNTED — the one owner of "this call would change nothing" (9.86.0).
|
|
418
|
+
*
|
|
419
|
+
* ── WHY POSITION ALONE IS NOT THE ANSWER ────────────────────────────────
|
|
420
|
+
*
|
|
421
|
+
* `classifySkillTarget` answers a question about POSITION: is the target where
|
|
422
|
+
* the cursor stands? For most of the loop that settles it — the cursor's body
|
|
423
|
+
* is in that call's system prompt and its tools are on that call's wire, so
|
|
424
|
+
* asking to read it activates nothing, moves nothing and reveals nothing the
|
|
425
|
+
* request did not already carry.
|
|
426
|
+
*
|
|
427
|
+
* A PARKED map breaks that. Parking suppresses a map's contribution and leaves
|
|
428
|
+
* the cursor exactly where it was, so at a parked cursor the very same id is a
|
|
429
|
+
* RE-ENGAGEMENT: the gate admits it, the map engages, and the member's body and
|
|
430
|
+
* tools ride again on the next pass. That call moves something, which makes it
|
|
431
|
+
* a capability, which makes it the policy's question to answer.
|
|
432
|
+
*
|
|
433
|
+
* The dispatch gate has known this since 9.59.0 — it tests re-engagement BEFORE
|
|
434
|
+
* its self-call arm, which is this same fact written as two ordered arms. The
|
|
435
|
+
* `skill_read` permission gate, 480 lines upstream, has no arms to order: it
|
|
436
|
+
* asks one question and either spends the policy check or skips it, and it was
|
|
437
|
+
* asking `classifySkillTarget` alone. So a role whose checker hid a skill could
|
|
438
|
+
* have the model un-park and re-activate it. This function is the question that
|
|
439
|
+
* gate now asks, over the parked set `parkedNow` hands both of them.
|
|
440
|
+
*
|
|
441
|
+
* @example
|
|
442
|
+
* ```ts
|
|
443
|
+
* atMountedCursor({ cursor: 'audit', target: 'audit' }); // true — a stay
|
|
444
|
+
* atMountedCursor({ cursor: 'audit', target: 'audit', parked: new Set(['audit']) }); // false — a re-engagement
|
|
445
|
+
* atMountedCursor({ cursor: 'audit', target: 'billing' }); // false — a move
|
|
446
|
+
* ```
|
|
447
|
+
*/
|
|
448
|
+
export declare function atMountedCursor(args: {
|
|
449
|
+
/** Where the cursor stands. `undefined` = cold start (nothing is a stay). */
|
|
450
|
+
readonly cursor?: string | undefined;
|
|
451
|
+
/** The id the model asked for. */
|
|
452
|
+
readonly target: string;
|
|
453
|
+
/** Members of every map the kernel holds PARKED — `parkedMemberIds`. */
|
|
454
|
+
readonly parked?: ReadonlySet<string> | undefined;
|
|
455
|
+
}): boolean;
|
|
456
|
+
/**
|
|
457
|
+
* What a call to a name nothing can dispatch gets back (9.86.0).
|
|
458
|
+
*
|
|
459
|
+
* `Unknown tool: X` was the whole sentence, on both dispatch doors, while
|
|
460
|
+
* `mcpServe` — the same library, one directory away — had been answering
|
|
461
|
+
* "Unknown tool 'rm_rf'. Served tools: echo, delete_account." for releases. The
|
|
462
|
+
* model that mistyped a name, or named one from a restored transcript, was told
|
|
463
|
+
* only that it was wrong, never what would have worked, and the cheapest repair
|
|
464
|
+
* (read the roster) was the one it could not make.
|
|
465
|
+
*
|
|
466
|
+
* The roster is the DISPATCH set — `registryByName` plus the provider cache —
|
|
467
|
+
* because that is the true statement about resolution: these are the names that
|
|
468
|
+
* answered to something. It is deliberately NOT the offer: the wire is narrowed
|
|
469
|
+
* by steps, parks and postures, and a held-out tool still dispatches by name, so
|
|
470
|
+
* an offer-shaped list would be a different (and here, false) claim.
|
|
471
|
+
*
|
|
472
|
+
* ── AND IT SAYS "RESOLVED", NOT "COULD BE DISPATCHED" ───────────────────
|
|
473
|
+
*
|
|
474
|
+
* The first draft said "Tools that could be dispatched on that call". Two gates
|
|
475
|
+
* sit between resolution and a tool running — the `tool_call` permission check
|
|
476
|
+
* and the middleware chain — so a name in this map can resolve and still be
|
|
477
|
+
* refused, and the sentence promised the model a dispatch the very next gate
|
|
478
|
+
* would decline. Neither gate is asked here: a `PermissionChecker` is a port
|
|
479
|
+
* (a hub call per name, with its own events and its own audit rows), and
|
|
480
|
+
* spending a whole permission sweep to phrase an error is a cost the sentence
|
|
481
|
+
* does not need. It reports what this map DID — resolve a name — and claims
|
|
482
|
+
* nothing about what would have happened next.
|
|
483
|
+
*
|
|
484
|
+
* The roster is role-filtered before it gets here (`dispatchRoster`), so a tool
|
|
485
|
+
* belonging to a skill the caller's policy hides is never named; and when the
|
|
486
|
+
* filter empties a stocked roster the clause is DROPPED, because "no tool name
|
|
487
|
+
* resolved" would be a denial of what the dispatch map is holding.
|
|
488
|
+
*
|
|
489
|
+
* Anchored past tense, like every other persistent result: "on that call" binds
|
|
490
|
+
* the roster to the finished call the result answers, so a later iteration that
|
|
491
|
+
* adds or drops a provider tool cannot make this sentence wrong. No exhortation
|
|
492
|
+
* — the model does not need to be told to try again.
|
|
493
|
+
*
|
|
494
|
+
* Exported for the producer registry, and used by BOTH dispatch doors so they
|
|
495
|
+
* cannot drift.
|
|
496
|
+
*/
|
|
497
|
+
export declare function unknownToolResult(toolName: string, dispatchable: SpokenIds): string;
|
|
498
|
+
/**
|
|
499
|
+
* THE ONE COMPOSER of every `read_skill` refusal (9.86.0) — reachability,
|
|
500
|
+
* posture and tree, from one set of inputs.
|
|
501
|
+
*
|
|
502
|
+
* ── WHY ONE ─────────────────────────────────────────────────────────────
|
|
503
|
+
*
|
|
504
|
+
* There were two, and they disagreed. `skillRefusal` named "Reachable skills:
|
|
505
|
+
* beta" from the graph's raw hop set; `postureRefusal`, forty lines below it in
|
|
506
|
+
* the same gate, answered a model that took that offer up with "read_skill here
|
|
507
|
+
* reaches only the open skills: gamma". Same call, same turn, opposite claims —
|
|
508
|
+
* and the second one cost a refusal from the escalation budget to discover.
|
|
509
|
+
* Neither had heard of the role filter, so both could name a skill the caller's
|
|
510
|
+
* policy hides. One composer, handed the FILTERED sets and the posture that
|
|
511
|
+
* will judge the next pick, cannot contradict itself that way.
|
|
512
|
+
*
|
|
513
|
+
* ── THE TENSE DISCIPLINE (the law `selfCallNotice` is written against) ──
|
|
514
|
+
*
|
|
515
|
+
* A tool result is composed on iteration N and re-read by the model on every
|
|
516
|
+
* later call of the turn, including the tool-less wrap-up. So every clause here
|
|
517
|
+
* is a PAST fact about ONE named call — the call the model made `read_skill`
|
|
518
|
+
* on — anchored by the phrase "that call", never by deixis ("this turn", "the
|
|
519
|
+
* call you just made") and never by a forecast ("you can call", "pick one of
|
|
520
|
+
* these"). What the model may do NEXT is owned by the `read_skill` DESCRIPTION,
|
|
521
|
+
* which is recomposed for every single request and may therefore speak in the
|
|
522
|
+
* present. Two owners, one tense each, and they can no longer disagree.
|
|
523
|
+
*
|
|
524
|
+
* ── AND WHY IT NEVER NAMES A HOP THE POSTURE WOULD DECLINE ──────────────
|
|
525
|
+
*
|
|
526
|
+
* Under `'rails'` the model does not route at all; under `'guard'` it routes
|
|
527
|
+
* only from an outstanding menu. Naming hops there is an offer the very next
|
|
528
|
+
* arm of this gate refuses. So those arms name no hop: they say who DID route,
|
|
529
|
+
* and (when there are any) which open skills were admitted anyway — open skills
|
|
530
|
+
* never reach the posture arm, so that clause cannot be contradicted.
|
|
531
|
+
*
|
|
532
|
+
* ── AND WHY AN EMPTY LIST IS NEVER A DENIAL ─────────────────────────────
|
|
533
|
+
*
|
|
534
|
+
* Every set arrives as {@link SpokenIds}, which carries whether the UNFILTERED
|
|
535
|
+
* set held anything. That is the difference between "nothing was reachable" and
|
|
536
|
+
* "nothing reachable may be named", and this composer used to say the first
|
|
537
|
+
* when the second was true — over a graph that was routing the cursor the whole
|
|
538
|
+
* time. Where the filter empties a set, the clause is omitted. A model told the
|
|
539
|
+
* map is a dead end stops asking for the door it may not be shown.
|
|
540
|
+
*
|
|
541
|
+
* Exported so a producer registry can list it beside the other model-facing
|
|
542
|
+
* composers rather than re-deriving what it says.
|
|
543
|
+
*/
|
|
544
|
+
export declare function composeReadSkillRefusal(args: {
|
|
545
|
+
/** The id the model asked for, verbatim. */
|
|
546
|
+
readonly requestedId: string;
|
|
547
|
+
/** Which class the target fell in — from `classifySkillTarget`, the one owner. */
|
|
548
|
+
readonly targetClass: SkillTargetClass;
|
|
549
|
+
/** Where the cursor stood when that call was made. */
|
|
550
|
+
readonly cursorId?: string;
|
|
551
|
+
/** Declared hops from that cursor, through the role filter — and carrying
|
|
552
|
+
* whether the graph held any, so a filtered-to-empty set omits its clause
|
|
553
|
+
* instead of denying the hops the graph is holding. */
|
|
554
|
+
readonly hops: SpokenIds;
|
|
555
|
+
/** Open skills, through the same filter. */
|
|
556
|
+
readonly openIds: SpokenIds;
|
|
557
|
+
/** The mounted graph is a decision `tree()` — no cursor to move. */
|
|
558
|
+
readonly isTree?: boolean;
|
|
559
|
+
/** The posture that declined a reachable hop, when one did (SG-C). */
|
|
560
|
+
readonly posture?: 'guard' | 'rails';
|
|
561
|
+
/** The menu that was outstanding when that call was made, through the same
|
|
562
|
+
* filter. Present only under `'guard'` with a menu the pick missed — and
|
|
563
|
+
* `held: true` with nothing named says a menu WAS outstanding and none of it
|
|
564
|
+
* may be named, which is a third sentence, not the no-menu one. */
|
|
565
|
+
readonly menuOffered?: SpokenIds;
|
|
566
|
+
/** How the turn's start was resolved, for the `'guard'`-without-a-menu arm. */
|
|
567
|
+
readonly routedDecisively?: boolean;
|
|
568
|
+
}): string;
|
|
398
569
|
export declare function buildToolCallsHandler(deps: ToolCallsHandlerDeps): PausableHandler<TypedScope<AgentState>>;
|