agentfootprint 8.5.0 → 8.7.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.
Files changed (142) hide show
  1. package/AGENTS.md +1 -1
  2. package/CLAUDE.md +1 -1
  3. package/README.md +1 -1
  4. package/ai-instructions/claude-code/SKILL.md +1 -1
  5. package/dist/core/Agent.js +62 -1
  6. package/dist/core/Agent.js.map +1 -1
  7. package/dist/core/RunnerBase.js +7 -1
  8. package/dist/core/RunnerBase.js.map +1 -1
  9. package/dist/core/agent/AgentBuilder.js +104 -0
  10. package/dist/core/agent/AgentBuilder.js.map +1 -1
  11. package/dist/core/agent/stages/toolCalls.js +136 -5
  12. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  13. package/dist/core/slots/buildToolsSlot.js +77 -0
  14. package/dist/core/slots/buildToolsSlot.js.map +1 -1
  15. package/dist/esm/core/Agent.d.ts +15 -0
  16. package/dist/esm/core/Agent.js +62 -1
  17. package/dist/esm/core/Agent.js.map +1 -1
  18. package/dist/esm/core/RunnerBase.js +7 -1
  19. package/dist/esm/core/RunnerBase.js.map +1 -1
  20. package/dist/esm/core/agent/AgentBuilder.js +104 -0
  21. package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
  22. package/dist/esm/core/agent/stages/toolCalls.d.ts +35 -0
  23. package/dist/esm/core/agent/stages/toolCalls.js +136 -5
  24. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  25. package/dist/esm/core/agent/types.d.ts +26 -0
  26. package/dist/esm/core/slots/buildToolsSlot.js +78 -1
  27. package/dist/esm/core/slots/buildToolsSlot.js.map +1 -1
  28. package/dist/esm/events/payloads.d.ts +29 -0
  29. package/dist/esm/events/registry.d.ts +3 -1
  30. package/dist/esm/events/registry.js +2 -0
  31. package/dist/esm/events/registry.js.map +1 -1
  32. package/dist/esm/identity/CredentialConsentRequiredError.d.ts +63 -0
  33. package/dist/esm/identity/CredentialConsentRequiredError.js +65 -0
  34. package/dist/esm/identity/CredentialConsentRequiredError.js.map +1 -0
  35. package/dist/esm/identity/consent.d.ts +81 -0
  36. package/dist/esm/identity/consent.js +85 -0
  37. package/dist/esm/identity/consent.js.map +1 -0
  38. package/dist/esm/identity.d.ts +2 -0
  39. package/dist/esm/identity.js +1 -0
  40. package/dist/esm/identity.js.map +1 -1
  41. package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.d.ts +15 -0
  42. package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.js +16 -0
  43. package/dist/esm/lib/injection-engine/factories/defineRelevanceHint.js.map +1 -1
  44. package/dist/esm/lib/injection-engine/factories/defineSkill.d.ts +9 -0
  45. package/dist/esm/lib/injection-engine/factories/defineSkill.js.map +1 -1
  46. package/dist/esm/lib/injection-engine/index.d.ts +3 -3
  47. package/dist/esm/lib/injection-engine/index.js +8 -3
  48. package/dist/esm/lib/injection-engine/index.js.map +1 -1
  49. package/dist/esm/lib/injection-engine/skillContract.d.ts +25 -2
  50. package/dist/esm/lib/injection-engine/skillContract.js +11 -4
  51. package/dist/esm/lib/injection-engine/skillContract.js.map +1 -1
  52. package/dist/esm/lib/injection-engine/skillGraph.d.ts +65 -4
  53. package/dist/esm/lib/injection-engine/skillGraph.js +36 -11
  54. package/dist/esm/lib/injection-engine/skillGraph.js.map +1 -1
  55. package/dist/esm/lib/injection-engine/skillGraphCheckup.d.ts +47 -7
  56. package/dist/esm/lib/injection-engine/skillGraphCheckup.js +165 -13
  57. package/dist/esm/lib/injection-engine/skillGraphCheckup.js.map +1 -1
  58. package/dist/esm/lib/injection-engine/skillsFromDir.d.ts +24 -0
  59. package/dist/esm/lib/injection-engine/skillsFromDir.js +19 -0
  60. package/dist/esm/lib/injection-engine/skillsFromDir.js.map +1 -1
  61. package/dist/esm/lib/injection-engine/types.d.ts +8 -0
  62. package/dist/esm/lib/injection-engine/types.js.map +1 -1
  63. package/dist/esm/lib/mcp/mcpServe.js +11 -1
  64. package/dist/esm/lib/mcp/mcpServe.js.map +1 -1
  65. package/dist/esm/tool-providers/index.d.ts +1 -1
  66. package/dist/esm/tool-providers/index.js +4 -1
  67. package/dist/esm/tool-providers/index.js.map +1 -1
  68. package/dist/esm/tool-providers/skillScopedTools.d.ts +4 -0
  69. package/dist/esm/tool-providers/skillScopedTools.js +33 -2
  70. package/dist/esm/tool-providers/skillScopedTools.js.map +1 -1
  71. package/dist/esm/tool-providers/types.d.ts +25 -0
  72. package/dist/events/registry.js +2 -0
  73. package/dist/events/registry.js.map +1 -1
  74. package/dist/identity/CredentialConsentRequiredError.js +69 -0
  75. package/dist/identity/CredentialConsentRequiredError.js.map +1 -0
  76. package/dist/identity/consent.js +91 -0
  77. package/dist/identity/consent.js.map +1 -0
  78. package/dist/identity.js +3 -1
  79. package/dist/identity.js.map +1 -1
  80. package/dist/lib/injection-engine/factories/defineRelevanceHint.js +17 -1
  81. package/dist/lib/injection-engine/factories/defineRelevanceHint.js.map +1 -1
  82. package/dist/lib/injection-engine/factories/defineSkill.js.map +1 -1
  83. package/dist/lib/injection-engine/index.js +7 -1
  84. package/dist/lib/injection-engine/index.js.map +1 -1
  85. package/dist/lib/injection-engine/skillContract.js +11 -4
  86. package/dist/lib/injection-engine/skillContract.js.map +1 -1
  87. package/dist/lib/injection-engine/skillGraph.js +37 -11
  88. package/dist/lib/injection-engine/skillGraph.js.map +1 -1
  89. package/dist/lib/injection-engine/skillGraphCheckup.js +165 -13
  90. package/dist/lib/injection-engine/skillGraphCheckup.js.map +1 -1
  91. package/dist/lib/injection-engine/skillsFromDir.js +19 -0
  92. package/dist/lib/injection-engine/skillsFromDir.js.map +1 -1
  93. package/dist/lib/injection-engine/types.js.map +1 -1
  94. package/dist/lib/mcp/mcpServe.js +11 -1
  95. package/dist/lib/mcp/mcpServe.js.map +1 -1
  96. package/dist/tool-providers/index.js +5 -1
  97. package/dist/tool-providers/index.js.map +1 -1
  98. package/dist/tool-providers/skillScopedTools.js +35 -3
  99. package/dist/tool-providers/skillScopedTools.js.map +1 -1
  100. package/dist/types/core/Agent.d.ts +15 -0
  101. package/dist/types/core/Agent.d.ts.map +1 -1
  102. package/dist/types/core/RunnerBase.d.ts.map +1 -1
  103. package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
  104. package/dist/types/core/agent/stages/toolCalls.d.ts +35 -0
  105. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  106. package/dist/types/core/agent/types.d.ts +26 -0
  107. package/dist/types/core/agent/types.d.ts.map +1 -1
  108. package/dist/types/core/slots/buildToolsSlot.d.ts.map +1 -1
  109. package/dist/types/events/payloads.d.ts +29 -0
  110. package/dist/types/events/payloads.d.ts.map +1 -1
  111. package/dist/types/events/registry.d.ts +3 -1
  112. package/dist/types/events/registry.d.ts.map +1 -1
  113. package/dist/types/identity/CredentialConsentRequiredError.d.ts +64 -0
  114. package/dist/types/identity/CredentialConsentRequiredError.d.ts.map +1 -0
  115. package/dist/types/identity/consent.d.ts +82 -0
  116. package/dist/types/identity/consent.d.ts.map +1 -0
  117. package/dist/types/identity.d.ts +2 -0
  118. package/dist/types/identity.d.ts.map +1 -1
  119. package/dist/types/lib/injection-engine/factories/defineRelevanceHint.d.ts +15 -0
  120. package/dist/types/lib/injection-engine/factories/defineRelevanceHint.d.ts.map +1 -1
  121. package/dist/types/lib/injection-engine/factories/defineSkill.d.ts +9 -0
  122. package/dist/types/lib/injection-engine/factories/defineSkill.d.ts.map +1 -1
  123. package/dist/types/lib/injection-engine/index.d.ts +3 -3
  124. package/dist/types/lib/injection-engine/index.d.ts.map +1 -1
  125. package/dist/types/lib/injection-engine/skillContract.d.ts +25 -2
  126. package/dist/types/lib/injection-engine/skillContract.d.ts.map +1 -1
  127. package/dist/types/lib/injection-engine/skillGraph.d.ts +65 -4
  128. package/dist/types/lib/injection-engine/skillGraph.d.ts.map +1 -1
  129. package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts +47 -7
  130. package/dist/types/lib/injection-engine/skillGraphCheckup.d.ts.map +1 -1
  131. package/dist/types/lib/injection-engine/skillsFromDir.d.ts +24 -0
  132. package/dist/types/lib/injection-engine/skillsFromDir.d.ts.map +1 -1
  133. package/dist/types/lib/injection-engine/types.d.ts +8 -0
  134. package/dist/types/lib/injection-engine/types.d.ts.map +1 -1
  135. package/dist/types/lib/mcp/mcpServe.d.ts.map +1 -1
  136. package/dist/types/tool-providers/index.d.ts +1 -1
  137. package/dist/types/tool-providers/index.d.ts.map +1 -1
  138. package/dist/types/tool-providers/skillScopedTools.d.ts +4 -0
  139. package/dist/types/tool-providers/skillScopedTools.d.ts.map +1 -1
  140. package/dist/types/tool-providers/types.d.ts +25 -0
  141. package/dist/types/tool-providers/types.d.ts.map +1 -1
  142. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/events/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA4EH,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,6BAA6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yC;IACzC,iCAAiC;IACjC,uCAAuC;IACvC,uCAAuC;IACvC,gCAAgC;IAChC,qCAAqC;IACrC,oCAAoC;IACpC,kDAAkD;IAClD,kCAAkC;IAClC,6BAA6B;IAC7B,mCAAmC;IACnC,0BAA0B;IAC1B,+BAA+B;IAC/B,2BAA2B;IAC3B,uCAAuC;IACvC,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"}
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../../src/events/registry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AA6EH,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,E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AyC;IACzC,iCAAiC;IACjC,uCAAuC;IACvC,uCAAuC;IACvC,gCAAgC;IAChC,qCAAqC;IACrC,oCAAoC;IACpC,kDAAkD;IAClD,kCAAkC;IAClC,6BAA6B;IAC7B,mCAAmC;IACnC,0BAA0B;IAC1B,+BAA+B;IAC/B,2BAA2B;IAC3B,uCAAuC;IACvC,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"}
@@ -0,0 +1,63 @@
1
+ /**
2
+ * CredentialConsentRequiredError — typed error thrown by `Agent.run()` under
3
+ * `onAuthorizationRequired: 'tell-model'` when a turn finished while a tool's
4
+ * DECLARED credential was never obtained.
5
+ *
6
+ * Pattern: Typed Error (parallel to `PolicyHaltError` / `MessageDeniedError`).
7
+ * Role: The honesty terminal for the non-pausing mode. `'tell-model'` lets
8
+ * the model adapt in-loop after a consent block — but a turn that
9
+ * returned a plain answer string would be claiming a completion it
10
+ * did not earn, because the tool never ran. `AgentOutput` is a bare
11
+ * string with nowhere to hang "…and a consent is still outstanding",
12
+ * so the fact is surfaced as an error instead of being dropped.
13
+ * Emits: N/A (this file DEFINES the class; `agentfootprint.credential.
14
+ * authorization_required` fires from the toolCalls handler at the
15
+ * moment the block resolves, and carries `{ service, sessionId }`
16
+ * only — never the URL).
17
+ *
18
+ * **The `authorizationUrl` on this error is a bearer capability.** It carries a
19
+ * session-correlating `state` parameter: whoever holds the URL can complete the
20
+ * consent flow. It reaches the caller HERE and on `PendingAsk` under
21
+ * `'pause'` — and deliberately nowhere else. It is never written to the
22
+ * conversation, the snapshot, the narrative, the typed event stream, or a
23
+ * recording. Treat it like the token it stands in for: hand it to the person
24
+ * who must click it, and do not log it.
25
+ *
26
+ * Under the default `onAuthorizationRequired: 'pause'` this error never fires —
27
+ * the run pauses at the block instead and the same three fields ride
28
+ * `PendingAsk`.
29
+ *
30
+ * @example
31
+ * try {
32
+ * await agent.run({ message: 'pay invoice INV-42' });
33
+ * } catch (e) {
34
+ * if (e instanceof CredentialConsentRequiredError) {
35
+ * // Show the URL to the PERSON. Never log it.
36
+ * await notifyUser(e.service, e.authorizationUrl);
37
+ * } else {
38
+ * throw e;
39
+ * }
40
+ * }
41
+ */
42
+ export interface CredentialConsentRequiredContext {
43
+ /** Downstream service id the tool declared, e.g. 'github', 'billing'. */
44
+ readonly service: string;
45
+ /** The 3LO consent URL. A BEARER CAPABILITY — see the class note. */
46
+ readonly authorizationUrl: string;
47
+ /** Correlates the authorization session with the provider. */
48
+ readonly sessionId: string;
49
+ /** The tool whose declared credential was refused. */
50
+ readonly tool: string;
51
+ /** ReAct iteration the block fired on. */
52
+ readonly iteration: number;
53
+ }
54
+ export declare class CredentialConsentRequiredError extends Error {
55
+ readonly code: "ERR_CREDENTIAL_CONSENT_REQUIRED";
56
+ readonly service: string;
57
+ /** The 3LO consent URL. A BEARER CAPABILITY — see the class note. */
58
+ readonly authorizationUrl: string;
59
+ readonly sessionId: string;
60
+ readonly tool: string;
61
+ readonly iteration: number;
62
+ constructor(ctx: CredentialConsentRequiredContext);
63
+ }
@@ -0,0 +1,65 @@
1
+ /**
2
+ * CredentialConsentRequiredError — typed error thrown by `Agent.run()` under
3
+ * `onAuthorizationRequired: 'tell-model'` when a turn finished while a tool's
4
+ * DECLARED credential was never obtained.
5
+ *
6
+ * Pattern: Typed Error (parallel to `PolicyHaltError` / `MessageDeniedError`).
7
+ * Role: The honesty terminal for the non-pausing mode. `'tell-model'` lets
8
+ * the model adapt in-loop after a consent block — but a turn that
9
+ * returned a plain answer string would be claiming a completion it
10
+ * did not earn, because the tool never ran. `AgentOutput` is a bare
11
+ * string with nowhere to hang "…and a consent is still outstanding",
12
+ * so the fact is surfaced as an error instead of being dropped.
13
+ * Emits: N/A (this file DEFINES the class; `agentfootprint.credential.
14
+ * authorization_required` fires from the toolCalls handler at the
15
+ * moment the block resolves, and carries `{ service, sessionId }`
16
+ * only — never the URL).
17
+ *
18
+ * **The `authorizationUrl` on this error is a bearer capability.** It carries a
19
+ * session-correlating `state` parameter: whoever holds the URL can complete the
20
+ * consent flow. It reaches the caller HERE and on `PendingAsk` under
21
+ * `'pause'` — and deliberately nowhere else. It is never written to the
22
+ * conversation, the snapshot, the narrative, the typed event stream, or a
23
+ * recording. Treat it like the token it stands in for: hand it to the person
24
+ * who must click it, and do not log it.
25
+ *
26
+ * Under the default `onAuthorizationRequired: 'pause'` this error never fires —
27
+ * the run pauses at the block instead and the same three fields ride
28
+ * `PendingAsk`.
29
+ *
30
+ * @example
31
+ * try {
32
+ * await agent.run({ message: 'pay invoice INV-42' });
33
+ * } catch (e) {
34
+ * if (e instanceof CredentialConsentRequiredError) {
35
+ * // Show the URL to the PERSON. Never log it.
36
+ * await notifyUser(e.service, e.authorizationUrl);
37
+ * } else {
38
+ * throw e;
39
+ * }
40
+ * }
41
+ */
42
+ export class CredentialConsentRequiredError extends Error {
43
+ code = 'ERR_CREDENTIAL_CONSENT_REQUIRED';
44
+ service;
45
+ /** The 3LO consent URL. A BEARER CAPABILITY — see the class note. */
46
+ authorizationUrl;
47
+ sessionId;
48
+ tool;
49
+ iteration;
50
+ constructor(ctx) {
51
+ // The MESSAGE deliberately omits the URL. An error message is the one
52
+ // string that reliably reaches a log line, and this class exists to keep
53
+ // a capability out of logs.
54
+ super(`Authorization required for '${ctx.service}' (tool='${ctx.tool}', ` +
55
+ `iteration=${ctx.iteration}). The tool did not run. Read ` +
56
+ `\`error.authorizationUrl\` to send the person to consent.`);
57
+ this.name = 'CredentialConsentRequiredError';
58
+ this.service = ctx.service;
59
+ this.authorizationUrl = ctx.authorizationUrl;
60
+ this.sessionId = ctx.sessionId;
61
+ this.tool = ctx.tool;
62
+ this.iteration = ctx.iteration;
63
+ }
64
+ }
65
+ //# sourceMappingURL=CredentialConsentRequiredError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CredentialConsentRequiredError.js","sourceRoot":"","sources":["../../../src/identity/CredentialConsentRequiredError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AAeH,MAAM,OAAO,8BAA+B,SAAQ,KAAK;IAC9C,IAAI,GAAG,iCAA0C,CAAC;IAClD,OAAO,CAAS;IACzB,qEAAqE;IAC5D,gBAAgB,CAAS;IACzB,SAAS,CAAS;IAClB,IAAI,CAAS;IACb,SAAS,CAAS;IAE3B,YAAY,GAAqC;QAC/C,sEAAsE;QACtE,yEAAyE;QACzE,4BAA4B;QAC5B,KAAK,CACH,+BAA+B,GAAG,CAAC,OAAO,YAAY,GAAG,CAAC,IAAI,KAAK;YACjE,aAAa,GAAG,CAAC,SAAS,gCAAgC;YAC1D,2DAA2D,CAC9D,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,gCAAgC,CAAC;QAC7C,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC,OAAO,CAAC;QAC3B,IAAI,CAAC,gBAAgB,GAAG,GAAG,CAAC,gBAAgB,CAAC;QAC7C,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;QAC/B,IAAI,CAAC,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IACjC,CAAC;CACF"}
@@ -0,0 +1,81 @@
1
+ /**
2
+ * The 3LO consent vocabulary — one place, because four surfaces must agree on
3
+ * it and three of them are security boundaries.
4
+ *
5
+ * A `CredentialProvider` that answers `authorization-required` is saying: a
6
+ * PERSON has to click a link before this tool can run. Two things follow, and
7
+ * they are the whole of this module.
8
+ *
9
+ * **1. The URL is a bearer capability, not a message.** It carries a
10
+ * session-correlating `state` parameter; whoever holds it can complete the
11
+ * consent flow. It goes to the CALLER — on `PendingAsk` under `'pause'`, on
12
+ * `CredentialConsentRequiredError` under `'tell-model'` — and to nowhere else.
13
+ * Before 8.6.0 it was interpolated into the tool-result string, which put it in
14
+ * the conversation and therefore in every channel built to preserve tool output
15
+ * (history, `stream.tool_end`, `agent.iteration_end`, `context.injected`, the
16
+ * commit log, the snapshot, the narrative's `rawValue`, and any recording).
17
+ * `modelRefusal()` is the URL-free replacement, and it is why the interpolation
18
+ * has no remaining call site.
19
+ *
20
+ * **2. The model is the one party that cannot act on it.** So what the model
21
+ * reads names the service, says a person is handling it, and tells it what to
22
+ * do instead — the same shape as the `[permission denied: …]` refusal it
23
+ * already knows how to read.
24
+ */
25
+ /**
26
+ * What a run does when a tool's declared credential needs consent.
27
+ *
28
+ * - `'pause'` (default) — the run stops at the block. `agent.run()` returns a
29
+ * pause outcome, a host answers 202 with `{ awaiting }`, and
30
+ * `agent.resume(checkpoint)` re-resolves the credential and runs the tool
31
+ * that was waiting. The model is never told; nothing is fabricated.
32
+ * - `'tell-model'` — the model reads {@link modelRefusal} and may route around
33
+ * the block. The turn still cannot report a clean completion: it raises
34
+ * `CredentialConsentRequiredError`.
35
+ */
36
+ export type AuthorizationRequiredMode = 'pause' | 'tell-model';
37
+ /**
38
+ * The key under which a consent request rides `pauseData` (and therefore
39
+ * `PendingAsk.pauseData`). Named, rather than free-form, for one reason:
40
+ * `agentfootprint.pause.request` mirrors the WHOLE `pauseData` into its
41
+ * `questionPayload`, so the emitter has to be able to find this block and
42
+ * withhold the URL from the event stream. A free-form shape could not be
43
+ * bounded by name, and the URL would have leaked into every observer again.
44
+ *
45
+ * @see redactConsentUrlForEvent
46
+ */
47
+ export declare const CONSENT_PAUSE_KEY = "authorization";
48
+ /** The consent block handed to the CALLER on `pauseData` / `PendingAsk`. */
49
+ export interface ConsentRequest {
50
+ readonly service: string;
51
+ /** BEARER CAPABILITY. Show it to the person; never log it. */
52
+ readonly authorizationUrl: string;
53
+ readonly sessionId: string;
54
+ }
55
+ /** Placeholder written where the consent URL is deliberately withheld. */
56
+ export declare const CONSENT_URL_WITHHELD = "[withheld: consent URL is caller-only]";
57
+ /**
58
+ * What the MODEL reads when a declared credential needs consent. Never the URL.
59
+ *
60
+ * Bracketed like the permission-gate refusal, because it is the same kind of
61
+ * fact: the call did not happen and the model must adapt. It names the service
62
+ * (so the model can reason about what is unavailable), says a person is on it
63
+ * (so it does not invent a way to authorize itself), and offers the two honest
64
+ * continuations.
65
+ */
66
+ export declare function modelRefusal(service: string): string;
67
+ /** The plain-words question a host shows the person, via `PendingAsk.question`. */
68
+ export declare function consentQuestion(service: string, tool: string): string;
69
+ /**
70
+ * Strip the consent URL out of a `pause.request` payload.
71
+ *
72
+ * `RunnerBase.emitPauseRequest` copies the whole `pauseData` into
73
+ * `PauseRequestPayload.questionPayload`, which is right for a check-in's
74
+ * evidence pack and wrong for a bearer URL. This withholds exactly one field by
75
+ * name and leaves every other pause shape untouched — the same discipline the
76
+ * audit adapter's `BOUND_FIELDS` already applies to `tool_end.result`.
77
+ *
78
+ * Returns the input unchanged (same reference) when there is no consent block,
79
+ * so no existing pause pays for this.
80
+ */
81
+ export declare function redactConsentUrlForEvent(payload: Readonly<Record<string, unknown>>): Readonly<Record<string, unknown>>;
@@ -0,0 +1,85 @@
1
+ /**
2
+ * The 3LO consent vocabulary — one place, because four surfaces must agree on
3
+ * it and three of them are security boundaries.
4
+ *
5
+ * A `CredentialProvider` that answers `authorization-required` is saying: a
6
+ * PERSON has to click a link before this tool can run. Two things follow, and
7
+ * they are the whole of this module.
8
+ *
9
+ * **1. The URL is a bearer capability, not a message.** It carries a
10
+ * session-correlating `state` parameter; whoever holds it can complete the
11
+ * consent flow. It goes to the CALLER — on `PendingAsk` under `'pause'`, on
12
+ * `CredentialConsentRequiredError` under `'tell-model'` — and to nowhere else.
13
+ * Before 8.6.0 it was interpolated into the tool-result string, which put it in
14
+ * the conversation and therefore in every channel built to preserve tool output
15
+ * (history, `stream.tool_end`, `agent.iteration_end`, `context.injected`, the
16
+ * commit log, the snapshot, the narrative's `rawValue`, and any recording).
17
+ * `modelRefusal()` is the URL-free replacement, and it is why the interpolation
18
+ * has no remaining call site.
19
+ *
20
+ * **2. The model is the one party that cannot act on it.** So what the model
21
+ * reads names the service, says a person is handling it, and tells it what to
22
+ * do instead — the same shape as the `[permission denied: …]` refusal it
23
+ * already knows how to read.
24
+ */
25
+ /**
26
+ * The key under which a consent request rides `pauseData` (and therefore
27
+ * `PendingAsk.pauseData`). Named, rather than free-form, for one reason:
28
+ * `agentfootprint.pause.request` mirrors the WHOLE `pauseData` into its
29
+ * `questionPayload`, so the emitter has to be able to find this block and
30
+ * withhold the URL from the event stream. A free-form shape could not be
31
+ * bounded by name, and the URL would have leaked into every observer again.
32
+ *
33
+ * @see redactConsentUrlForEvent
34
+ */
35
+ export const CONSENT_PAUSE_KEY = 'authorization';
36
+ /** Placeholder written where the consent URL is deliberately withheld. */
37
+ export const CONSENT_URL_WITHHELD = '[withheld: consent URL is caller-only]';
38
+ /**
39
+ * What the MODEL reads when a declared credential needs consent. Never the URL.
40
+ *
41
+ * Bracketed like the permission-gate refusal, because it is the same kind of
42
+ * fact: the call did not happen and the model must adapt. It names the service
43
+ * (so the model can reason about what is unavailable), says a person is on it
44
+ * (so it does not invent a way to authorize itself), and offers the two honest
45
+ * continuations.
46
+ */
47
+ export function modelRefusal(service) {
48
+ return (`[authorization required: '${service}' — a person must consent before this ` +
49
+ `tool can run. The caller has been told; you cannot do it yourself. ` +
50
+ `Continue with work that does not need '${service}', or say plainly that ` +
51
+ `you could not finish this step.]`);
52
+ }
53
+ /** The plain-words question a host shows the person, via `PendingAsk.question`. */
54
+ export function consentQuestion(service, tool) {
55
+ return `Authorize access to '${service}' so '${tool}' can run.`;
56
+ }
57
+ /**
58
+ * Strip the consent URL out of a `pause.request` payload.
59
+ *
60
+ * `RunnerBase.emitPauseRequest` copies the whole `pauseData` into
61
+ * `PauseRequestPayload.questionPayload`, which is right for a check-in's
62
+ * evidence pack and wrong for a bearer URL. This withholds exactly one field by
63
+ * name and leaves every other pause shape untouched — the same discipline the
64
+ * audit adapter's `BOUND_FIELDS` already applies to `tool_end.result`.
65
+ *
66
+ * Returns the input unchanged (same reference) when there is no consent block,
67
+ * so no existing pause pays for this.
68
+ */
69
+ export function redactConsentUrlForEvent(payload) {
70
+ const block = payload[CONSENT_PAUSE_KEY];
71
+ if (typeof block !== 'object' ||
72
+ block === null ||
73
+ !('authorizationUrl' in block) ||
74
+ typeof block.authorizationUrl !== 'string') {
75
+ return payload;
76
+ }
77
+ return {
78
+ ...payload,
79
+ [CONSENT_PAUSE_KEY]: {
80
+ ...block,
81
+ authorizationUrl: CONSENT_URL_WITHHELD,
82
+ },
83
+ };
84
+ }
85
+ //# sourceMappingURL=consent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"consent.js","sourceRoot":"","sources":["../../../src/identity/consent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAeH;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,eAAe,CAAC;AAUjD,0EAA0E;AAC1E,MAAM,CAAC,MAAM,oBAAoB,GAAG,wCAAwC,CAAC;AAE7E;;;;;;;;GAQG;AACH,MAAM,UAAU,YAAY,CAAC,OAAe;IAC1C,OAAO,CACL,6BAA6B,OAAO,wCAAwC;QAC5E,qEAAqE;QACrE,0CAA0C,OAAO,yBAAyB;QAC1E,kCAAkC,CACnC,CAAC;AACJ,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,OAAe,EAAE,IAAY;IAC3D,OAAO,wBAAwB,OAAO,SAAS,IAAI,YAAY,CAAC;AAClE,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,wBAAwB,CACtC,OAA0C;IAE1C,MAAM,KAAK,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;IACzC,IACE,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,KAAK,IAAI;QACd,CAAC,CAAC,kBAAkB,IAAI,KAAK,CAAC;QAC9B,OAAQ,KAAuC,CAAC,gBAAgB,KAAK,QAAQ,EAC7E,CAAC;QACD,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,OAAO;QACL,GAAG,OAAO;QACV,CAAC,iBAAiB,CAAC,EAAE;YACnB,GAAI,KAAiC;YACrC,gBAAgB,EAAE,oBAAoB;SACvC;KACF,CAAC;AACJ,CAAC"}
@@ -31,5 +31,7 @@ export type { Credential, CredentialProvider, CredentialRequest, CredentialResul
31
31
  export { isCredentialIssued, unconfiguredCredentialProvider } from './identity/types.js';
32
32
  export { bearer, apiKey, basic, headers, type BearerCredential, type ApiKeyCredential, type BasicCredential, type HeadersCredential, } from './identity/kinds.js';
33
33
  export { staticTokens, type StaticTokensOptions } from './identity/staticTokens.js';
34
+ export type { AuthorizationRequiredMode, ConsentRequest } from './identity/consent.js';
35
+ export { CredentialConsentRequiredError, type CredentialConsentRequiredContext, } from './identity/CredentialConsentRequiredError.js';
34
36
  export { withCredentialRetry, type WithCredentialRetryOptions, } from './identity/withCredentialRetry.js';
35
37
  export { agentCoreIdentity, type AgentCoreIdentityOptions, type AgentCoreIdentityClientLike, type AgentCoreOauthResponse, } from './adapters/identity/agentcore.js';
@@ -30,6 +30,7 @@
30
30
  export { isCredentialIssued, unconfiguredCredentialProvider } from './identity/types.js';
31
31
  export { bearer, apiKey, basic, headers, } from './identity/kinds.js';
32
32
  export { staticTokens } from './identity/staticTokens.js';
33
+ export { CredentialConsentRequiredError, } from './identity/CredentialConsentRequiredError.js';
33
34
  export { withCredentialRetry, } from './identity/withCredentialRetry.js';
34
35
  export { agentCoreIdentity, } from './adapters/identity/agentcore.js';
35
36
  //# sourceMappingURL=identity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAWH,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,GAKR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAA4B,MAAM,4BAA4B,CAAC;AACpF,OAAO,EACL,mBAAmB,GAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,GAIlB,MAAM,kCAAkC,CAAC"}
1
+ {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../src/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAWH,OAAO,EAAE,kBAAkB,EAAE,8BAA8B,EAAE,MAAM,qBAAqB,CAAC;AACzF,OAAO,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,OAAO,GAKR,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,YAAY,EAA4B,MAAM,4BAA4B,CAAC;AAKpF,OAAO,EACL,8BAA8B,GAE/B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACL,mBAAmB,GAEpB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,iBAAiB,GAIlB,MAAM,kCAAkC,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;AA0HxE;;;;;;;;;;;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,OAAO,MAAM,CAAC,MAAM,CAAC;QACnB,EAAE,EAAE,IAAI,CAAC,EAAE;QACX,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,MAAM,EAAE,OAAgB;QACxB,OAAO,EAAE;YACP,IAAI,EAAE,eAAwB;YAC9B,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,YAAY;SAC9C;QACD,MAAM,EAAE;YACN,YAAY,EAAE,IAAI,CAAC,IAAI;YACvB,GAAG,CAAC,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SAClE;QACD,iEAAiE;QACjE,oEAAoE;QACpE,iEAAiE;QACjE,mCAAmC;QACnC,EAAE;QACF,iEAAiE;QACjE,iEAAiE;QACjE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,MAAM;YACvC,GAAG,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;YAChE,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;YAC7D,KAAK,EAAE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;SAC/C,CAAC;KACH,CAAyB,CAAC;AAC7B,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;I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AK,IAAI,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE,CAAC;SAClE;QACD,iEAAiE;QACjE,oEAAoE;QACpE,iEAAiE;QACjE,mCAAmC;QACnC,EAAE;QACF,iEAAiE;QACjE,iEAAiE;QACjE,QAAQ,EAAE,MAAM,CAAC,MAAM,CAAC;YACtB,WAAW,EAAE,IAAI,CAAC,WAAW,IAAI,MAAM;YACvC,GAAG,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,CAAC;YAChE,GAAG,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,YAAY,EAAE,IAAI,CAAC,YAAY,EAAE,CAAC;YAC7D,KAAK,EAAE,kBAAkB,CAAC,OAAO,EAAE,IAAI,CAAC,KAAK,CAAC;SAC/C,CAAC;KACH,CAAyB,CAAC;AAC7B,CAAC"}
@@ -10,7 +10,7 @@ export { projectActiveInjection } from './types.js';
10
10
  export { evaluateInjections } from './evaluator.js';
11
11
  export { buildInjectionEngineSubflow, type InjectionEngineConfig, } from './buildInjectionEngineSubflow.js';
12
12
  export { defineInstruction, type DefineInstructionOptions } from './factories/defineInstruction.js';
13
- export { defineRelevanceHint, type RelevanceHintOptions } from './factories/defineRelevanceHint.js';
13
+ export { defineRelevanceHint, READS_ENTRY_SCORES_METADATA_KEY, type RelevanceHintOptions, } from './factories/defineRelevanceHint.js';
14
14
  export { defineSkill, resolveSurfaceMode, type DefineSkillOptions, type SurfaceMode, type RefreshPolicy, type AutoActivateMode, } from './factories/defineSkill.js';
15
15
  export { SkillRegistry, type SkillRegistryOptions } from './SkillRegistry.js';
16
16
  export { skillsFromDir, type SkillsFromDirOptions } from './skillsFromDir.js';
@@ -18,6 +18,6 @@ export { buildListSkillsTool, buildReadSkillTool, type SkillToolPair } from './s
18
18
  export { defineSteering, type DefineSteeringOptions } from './factories/defineSteering.js';
19
19
  export { defineFact, type DefineFactOptions } from './factories/defineFact.js';
20
20
  export { defineInjection, type DefineInjectionOptions, type InjectionFlavor, } from './factories/defineInjection.js';
21
- export { skillGraph, decideSkill, 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 GraphCheckMode, type GraphCheckup, type GraphProblem, type GraphProblemCode, } from './skillGraph.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
22
  export { keywordScorer, embeddingScorer, rankEntries, type EntryScorer, type EntryScorerInput, type EntryCandidate, } from './entryScorer.js';
23
- export { checkSkillContract, checkSkillContracts, skillToolNames } from './skillContract.js';
23
+ export { checkSkillContract, checkSkillContracts, skillToolNames, type SkillContractOptions, } from './skillContract.js';
@@ -12,7 +12,7 @@ export { evaluateInjections } from './evaluator.js';
12
12
  export { buildInjectionEngineSubflow, } from './buildInjectionEngineSubflow.js';
13
13
  // Sugar factories — Ships four; more flavors planned (RAG / Memory / Guardrail)
14
14
  export { defineInstruction } from './factories/defineInstruction.js';
15
- export { defineRelevanceHint } from './factories/defineRelevanceHint.js';
15
+ export { defineRelevanceHint, READS_ENTRY_SCORES_METADATA_KEY, } from './factories/defineRelevanceHint.js';
16
16
  export { defineSkill, resolveSurfaceMode, } from './factories/defineSkill.js';
17
17
  export { SkillRegistry } from './SkillRegistry.js';
18
18
  // File-authored skills — a loader over `defineSkill`, not a second mechanism.
@@ -32,7 +32,12 @@ export { defineFact } from './factories/defineFact.js';
32
32
  export { defineInjection, } from './factories/defineInjection.js';
33
33
  // Declarative skill graph (proposal 002) — declare skills + routing edges →
34
34
  // graph-derived triggers + a drawable topology. Sugar over the trigger model.
35
- export { skillGraph, decideSkill, SKILL_GRAPH_METADATA_KEY, } from './skillGraph.js';
35
+ export { skillGraph, decideSkill,
36
+ // 8.7.0 — render a `graph.checkup()` for a log line or a CI failure. The formatter
37
+ // the library itself uses; without it every consumer wrote their own. `checkupGraph`
38
+ // stays private: its input is the graph's internal wiring shape, and `graph.checkup()`
39
+ // is already the door to it.
40
+ formatCheckup, SKILL_GRAPH_METADATA_KEY, } from './skillGraph.js';
36
41
  export { keywordScorer, embeddingScorer, rankEntries, } from './entryScorer.js';
37
- export { checkSkillContract, checkSkillContracts, skillToolNames } from './skillContract.js';
42
+ export { checkSkillContract, checkSkillContracts, skillToolNames, } from './skillContract.js';
38
43
  //# 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,EAAE,mBAAmB,EAA6B,MAAM,oCAAoC,CAAC;AAEpG,OAAO,EACL,WAAW,EACX,kBAAkB,GAKn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AM,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,CAAC;AAE3F,OAAO,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,GA6BzB,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"}
@@ -16,6 +16,27 @@ import type { Injection } from './types.js';
16
16
  import type { GraphProblem } from './skillGraphCheckup.js';
17
17
  /** The tool names a skill unlocks (`inject.tools[].schema.name`). */
18
18
  export declare function skillToolNames(skill: Injection): readonly string[];
19
+ /**
20
+ * Tools that are callable from EVERY skill — the agent's baseline (`.tool()` /
21
+ * `.tools()` registrations, an always-on `ToolProvider`). Both checks below need
22
+ * them, and need them differently, which is why they are a third set rather than
23
+ * more entries in `knownToolNames` (8.7.0):
24
+ *
25
+ * • `body-unknown-tool` must treat them as KNOWN — `lookup_order(id)` in a body is
26
+ * not a typo when the agent really registers `lookup_order`;
27
+ * • `body-foreign-tool` must EXCLUDE them — that check means "a tool that belongs
28
+ * to another skill and is therefore not callable here", and a baseline tool is
29
+ * callable here. Folding them into `knownToolNames` alone would have swapped one
30
+ * false warning for another.
31
+ */
32
+ export interface SkillContractOptions {
33
+ /**
34
+ * Tool names the agent exposes to every skill (`.tool()`, `.tools()`, a baseline
35
+ * provider). Pass `agent`-level names when checking a graph whose skills rely on
36
+ * them: `graph.checkup({ knownTools: ['lookup_order'] })`.
37
+ */
38
+ readonly knownTools?: readonly string[];
39
+ }
19
40
  /**
20
41
  * Check ONE skill's body against its tool contract. Pure + side-effect-free.
21
42
  *
@@ -23,7 +44,9 @@ export declare function skillToolNames(skill: Injection): readonly string[];
23
44
  * @param knownToolNames every tool name reachable in the wider graph/agent (lets
24
45
  * the check tell a cross-skill HANDOFF from a typo). Omit to
25
46
  * check a skill in isolation (only its own tools are "known").
47
+ * @param options `knownTools` — baseline tools callable from every skill.
48
+ * See {@link SkillContractOptions}.
26
49
  */
27
- export declare function checkSkillContract(skill: Injection, knownToolNames?: ReadonlySet<string>): GraphProblem[];
50
+ export declare function checkSkillContract(skill: Injection, knownToolNames?: ReadonlySet<string>, options?: SkillContractOptions): GraphProblem[];
28
51
  /** Run the contract check across many skills with a shared known-tool set. Pure. */
29
- export declare function checkSkillContracts(skills: readonly Injection[]): GraphProblem[];
52
+ export declare function checkSkillContracts(skills: readonly Injection[], options?: SkillContractOptions): GraphProblem[];
@@ -30,12 +30,15 @@ export function skillToolNames(skill) {
30
30
  * @param knownToolNames every tool name reachable in the wider graph/agent (lets
31
31
  * the check tell a cross-skill HANDOFF from a typo). Omit to
32
32
  * check a skill in isolation (only its own tools are "known").
33
+ * @param options `knownTools` — baseline tools callable from every skill.
34
+ * See {@link SkillContractOptions}.
33
35
  */
34
- export function checkSkillContract(skill, knownToolNames) {
36
+ export function checkSkillContract(skill, knownToolNames, options = {}) {
35
37
  const id = skill.id;
36
38
  const body = skill.inject?.systemPrompt ?? '';
37
39
  if (body.length === 0)
38
40
  return [];
41
+ const baseline = new Set(options.knownTools ?? []);
39
42
  const own = new Set(skillToolNames(skill));
40
43
  const known = knownToolNames ?? own;
41
44
  const problems = [];
@@ -46,6 +49,8 @@ export function checkSkillContract(skill, knownToolNames) {
46
49
  for (const name of known) {
47
50
  if (own.has(name))
48
51
  continue;
52
+ if (baseline.has(name))
53
+ continue; // callable from every skill — not foreign
49
54
  if (new RegExp(`\\b${escapeRegExp(name)}\\b`).test(body)) {
50
55
  problems.push({
51
56
  kind: 'warning',
@@ -63,7 +68,7 @@ export function checkSkillContract(skill, knownToolNames) {
63
68
  const seen = new Set();
64
69
  for (const m of body.matchAll(TOOL_CALL_RE)) {
65
70
  const name = m[1];
66
- if (seen.has(name) || own.has(name) || known.has(name))
71
+ if (seen.has(name) || own.has(name) || known.has(name) || baseline.has(name))
67
72
  continue;
68
73
  seen.add(name);
69
74
  problems.push({
@@ -78,11 +83,13 @@ export function checkSkillContract(skill, knownToolNames) {
78
83
  return problems;
79
84
  }
80
85
  /** Run the contract check across many skills with a shared known-tool set. Pure. */
81
- export function checkSkillContracts(skills) {
86
+ export function checkSkillContracts(skills, options = {}) {
82
87
  const known = new Set();
83
88
  for (const s of skills)
84
89
  for (const n of skillToolNames(s))
85
90
  known.add(n);
86
- return skills.flatMap((s) => checkSkillContract(s, known));
91
+ for (const n of options.knownTools ?? [])
92
+ known.add(n);
93
+ return skills.flatMap((s) => checkSkillContract(s, known, options));
87
94
  }
88
95
  //# sourceMappingURL=skillContract.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"skillContract.js","sourceRoot":"","sources":["../../../../src/lib/injection-engine/skillContract.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,wFAAwF;AACxF,MAAM,YAAY,GAAG,yCAAyC,CAAC;AAE/D,SAAS,YAAY,CAAC,CAAS;IAC7B,OAAO,CAAC,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC;AAClD,CAAC;AAED,qEAA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