agentfootprint 12.2.0 → 13.0.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/CAPABILITIES.md +1 -0
- package/dist/adapters/code/output.js +8 -29
- package/dist/adapters/code/output.js.map +1 -1
- package/dist/adapters/observability/audit.js +151 -159
- package/dist/adapters/observability/audit.js.map +1 -1
- package/dist/adapters/observability/auditBounding.js +411 -0
- package/dist/adapters/observability/auditBounding.js.map +1 -0
- package/dist/adapters/observability/auditKeptByContract.js +107 -0
- package/dist/adapters/observability/auditKeptByContract.js.map +1 -0
- package/dist/adapters/observability/auditShapes.js +1731 -0
- package/dist/adapters/observability/auditShapes.js.map +1 -0
- package/dist/answer-account/account.js +92 -15
- package/dist/answer-account/account.js.map +1 -1
- package/dist/answer-account/facts/calls.js +7 -9
- package/dist/answer-account/facts/calls.js.map +1 -1
- package/dist/answer-account/facts/checked.js +2 -2
- package/dist/answer-account/facts/checked.js.map +1 -1
- package/dist/answer-account/facts/common.js +40 -7
- package/dist/answer-account/facts/common.js.map +1 -1
- package/dist/answer-account/facts/found.js +1 -1
- package/dist/answer-account/facts/found.js.map +1 -1
- package/dist/answer-account/facts/howSure.js +21 -3
- package/dist/answer-account/facts/howSure.js.map +1 -1
- package/dist/answer-account/facts/inView.js +3 -4
- package/dist/answer-account/facts/inView.js.map +1 -1
- package/dist/answer-account/facts/pausedLeg.js +1 -1
- package/dist/answer-account/facts/pausedLeg.js.map +1 -1
- package/dist/answer-account/facts/scripts.js +222 -0
- package/dist/answer-account/facts/scripts.js.map +1 -0
- package/dist/answer-account/facts/understood.js +5 -5
- package/dist/answer-account/facts/understood.js.map +1 -1
- package/dist/answer-account/pointerKey.js +1 -1
- package/dist/answer-account/shown.js +25 -7
- package/dist/answer-account/shown.js.map +1 -1
- package/dist/answer-account/signals.js +1 -1
- package/dist/answer-account/signals.js.map +1 -1
- package/dist/answer-account/size.js +152 -0
- package/dist/answer-account/size.js.map +1 -0
- package/dist/answer-account/templates.js +39 -1
- package/dist/answer-account/templates.js.map +1 -1
- package/dist/core/Agent.js +25 -1
- package/dist/core/Agent.js.map +1 -1
- package/dist/core/agent/AgentBuilder.js +85 -1
- package/dist/core/agent/AgentBuilder.js.map +1 -1
- package/dist/core/agent/arguments/ask.js +85 -2
- package/dist/core/agent/arguments/ask.js.map +1 -1
- package/dist/core/agent/arguments/partialWindow.js +120 -0
- package/dist/core/agent/arguments/partialWindow.js.map +1 -0
- package/dist/core/agent/assessment/assess.js +37 -0
- package/dist/core/agent/assessment/assess.js.map +1 -1
- package/dist/core/agent/assessment/compose.js +5 -1
- package/dist/core/agent/assessment/compose.js.map +1 -1
- package/dist/core/agent/assessment/reasons.js +7 -0
- package/dist/core/agent/assessment/reasons.js.map +1 -1
- package/dist/core/agent/assessment/witness.js +37 -4
- package/dist/core/agent/assessment/witness.js.map +1 -1
- package/dist/core/agent/buildAgentChart.js.map +1 -1
- package/dist/core/agent/evidence/codeRegions.js +279 -0
- package/dist/core/agent/evidence/codeRegions.js.map +1 -0
- package/dist/core/agent/evidence/gate.js +13 -2
- package/dist/core/agent/evidence/gate.js.map +1 -1
- package/dist/core/agent/evidence/recovery.js +11 -2
- package/dist/core/agent/evidence/recovery.js.map +1 -1
- package/dist/core/agent/findings/types.js.map +1 -1
- package/dist/core/agent/scripts/attachment.js +375 -0
- package/dist/core/agent/scripts/attachment.js.map +1 -0
- package/dist/core/agent/scripts/inert.js +88 -0
- package/dist/core/agent/scripts/inert.js.map +1 -0
- package/dist/core/agent/scripts/judge.js +41 -0
- package/dist/core/agent/scripts/judge.js.map +1 -0
- package/dist/core/agent/scripts/label.js +143 -0
- package/dist/core/agent/scripts/label.js.map +1 -0
- package/dist/core/agent/scripts/match.js +233 -0
- package/dist/core/agent/scripts/match.js.map +1 -0
- package/dist/core/agent/scripts/recovery.js +81 -0
- package/dist/core/agent/scripts/recovery.js.map +1 -0
- package/dist/core/agent/scripts/rows.js +221 -0
- package/dist/core/agent/scripts/rows.js.map +1 -0
- package/dist/core/agent/scripts/types.js +22 -0
- package/dist/core/agent/scripts/types.js.map +1 -0
- package/dist/core/agent/scripts/wrapper.js +63 -0
- package/dist/core/agent/scripts/wrapper.js.map +1 -0
- package/dist/core/agent/stages/argumentAsk.js +161 -19
- package/dist/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/core/agent/stages/evidenceRecheck.js +4 -1
- package/dist/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/core/agent/stages/prepareFinal.js +65 -10
- package/dist/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/core/agent/stages/route.js +53 -3
- package/dist/core/agent/stages/route.js.map +1 -1
- package/dist/core/agent/stages/seed.js +14 -1
- package/dist/core/agent/stages/seed.js.map +1 -1
- package/dist/core/agent/stages/toolCalls.js +339 -18
- package/dist/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/core/codeRunnerTool.js +32 -3
- package/dist/core/codeRunnerTool.js.map +1 -1
- package/dist/core/runCheckpoint.js +19 -6
- package/dist/core/runCheckpoint.js.map +1 -1
- package/dist/esm/adapters/code/output.d.ts +1 -4
- package/dist/esm/adapters/code/output.js +3 -24
- package/dist/esm/adapters/code/output.js.map +1 -1
- package/dist/esm/adapters/observability/audit.d.ts +79 -12
- package/dist/esm/adapters/observability/audit.js +132 -142
- package/dist/esm/adapters/observability/audit.js.map +1 -1
- package/dist/esm/adapters/observability/auditBounding.d.ts +215 -0
- package/dist/esm/adapters/observability/auditBounding.js +390 -0
- package/dist/esm/adapters/observability/auditBounding.js.map +1 -0
- package/dist/esm/adapters/observability/auditKeptByContract.d.ts +65 -0
- package/dist/esm/adapters/observability/auditKeptByContract.js +103 -0
- package/dist/esm/adapters/observability/auditKeptByContract.js.map +1 -0
- package/dist/esm/adapters/observability/auditShapes.d.ts +78 -0
- package/dist/esm/adapters/observability/auditShapes.js +1726 -0
- package/dist/esm/adapters/observability/auditShapes.js.map +1 -0
- package/dist/esm/answer-account/account.js +91 -14
- package/dist/esm/answer-account/account.js.map +1 -1
- package/dist/esm/answer-account/facts/calls.d.ts +0 -2
- package/dist/esm/answer-account/facts/calls.js +1 -3
- package/dist/esm/answer-account/facts/calls.js.map +1 -1
- package/dist/esm/answer-account/facts/checked.js +2 -2
- package/dist/esm/answer-account/facts/checked.js.map +1 -1
- package/dist/esm/answer-account/facts/common.d.ts +16 -4
- package/dist/esm/answer-account/facts/common.js +38 -6
- package/dist/esm/answer-account/facts/common.js.map +1 -1
- package/dist/esm/answer-account/facts/found.js +2 -2
- package/dist/esm/answer-account/facts/found.js.map +1 -1
- package/dist/esm/answer-account/facts/howSure.d.ts +1 -1
- package/dist/esm/answer-account/facts/howSure.js +22 -4
- package/dist/esm/answer-account/facts/howSure.js.map +1 -1
- package/dist/esm/answer-account/facts/inView.js +1 -2
- package/dist/esm/answer-account/facts/inView.js.map +1 -1
- package/dist/esm/answer-account/facts/pausedLeg.js +2 -2
- package/dist/esm/answer-account/facts/pausedLeg.js.map +1 -1
- package/dist/esm/answer-account/facts/scripts.d.ts +34 -0
- package/dist/esm/answer-account/facts/scripts.js +218 -0
- package/dist/esm/answer-account/facts/scripts.js.map +1 -0
- package/dist/esm/answer-account/facts/understood.js +2 -2
- package/dist/esm/answer-account/facts/understood.js.map +1 -1
- package/dist/esm/answer-account/pointerKey.d.ts +1 -1
- package/dist/esm/answer-account/pointerKey.js +1 -1
- package/dist/esm/answer-account/shown.d.ts +9 -2
- package/dist/esm/answer-account/shown.js +25 -7
- package/dist/esm/answer-account/shown.js.map +1 -1
- package/dist/esm/answer-account/signals.js +2 -2
- package/dist/esm/answer-account/signals.js.map +1 -1
- package/dist/esm/answer-account/size.d.ts +59 -0
- package/dist/esm/answer-account/size.js +147 -0
- package/dist/esm/answer-account/size.js.map +1 -0
- package/dist/esm/answer-account/templates.d.ts +29 -1
- package/dist/esm/answer-account/templates.js +39 -1
- package/dist/esm/answer-account/templates.js.map +1 -1
- package/dist/esm/core/Agent.d.ts +8 -1
- package/dist/esm/core/Agent.js +25 -1
- package/dist/esm/core/Agent.js.map +1 -1
- package/dist/esm/core/agent/AgentBuilder.d.ts +52 -0
- package/dist/esm/core/agent/AgentBuilder.js +85 -1
- package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
- package/dist/esm/core/agent/arguments/ask.d.ts +11 -0
- package/dist/esm/core/agent/arguments/ask.js +83 -1
- package/dist/esm/core/agent/arguments/ask.js.map +1 -1
- package/dist/esm/core/agent/arguments/partialWindow.d.ts +42 -0
- package/dist/esm/core/agent/arguments/partialWindow.js +111 -0
- package/dist/esm/core/agent/arguments/partialWindow.js.map +1 -0
- package/dist/esm/core/agent/assessment/assess.js +37 -0
- package/dist/esm/core/agent/assessment/assess.js.map +1 -1
- package/dist/esm/core/agent/assessment/compose.d.ts +3 -1
- package/dist/esm/core/agent/assessment/compose.js +5 -1
- package/dist/esm/core/agent/assessment/compose.js.map +1 -1
- package/dist/esm/core/agent/assessment/reasons.js +7 -0
- package/dist/esm/core/agent/assessment/reasons.js.map +1 -1
- package/dist/esm/core/agent/assessment/types.d.ts +12 -2
- package/dist/esm/core/agent/assessment/witness.d.ts +44 -4
- package/dist/esm/core/agent/assessment/witness.js +35 -3
- package/dist/esm/core/agent/assessment/witness.js.map +1 -1
- package/dist/esm/core/agent/buildAgentChart.d.ts +9 -0
- package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
- package/dist/esm/core/agent/evidence/codeRegions.d.ts +130 -0
- package/dist/esm/core/agent/evidence/codeRegions.js +275 -0
- package/dist/esm/core/agent/evidence/codeRegions.js.map +1 -0
- package/dist/esm/core/agent/evidence/gate.d.ts +3 -0
- package/dist/esm/core/agent/evidence/gate.js +12 -2
- package/dist/esm/core/agent/evidence/gate.js.map +1 -1
- package/dist/esm/core/agent/evidence/recovery.d.ts +5 -1
- package/dist/esm/core/agent/evidence/recovery.js +11 -2
- package/dist/esm/core/agent/evidence/recovery.js.map +1 -1
- package/dist/esm/core/agent/evidence/types.d.ts +35 -0
- package/dist/esm/core/agent/findings/types.d.ts +3 -2
- package/dist/esm/core/agent/findings/types.js.map +1 -1
- package/dist/esm/core/agent/scripts/attachment.d.ts +179 -0
- package/dist/esm/core/agent/scripts/attachment.js +361 -0
- package/dist/esm/core/agent/scripts/attachment.js.map +1 -0
- package/dist/esm/core/agent/scripts/inert.d.ts +38 -0
- package/dist/esm/core/agent/scripts/inert.js +84 -0
- package/dist/esm/core/agent/scripts/inert.js.map +1 -0
- package/dist/esm/core/agent/scripts/judge.d.ts +36 -0
- package/dist/esm/core/agent/scripts/judge.js +37 -0
- package/dist/esm/core/agent/scripts/judge.js.map +1 -0
- package/dist/esm/core/agent/scripts/label.d.ts +103 -0
- package/dist/esm/core/agent/scripts/label.js +136 -0
- package/dist/esm/core/agent/scripts/label.js.map +1 -0
- package/dist/esm/core/agent/scripts/match.d.ts +99 -0
- package/dist/esm/core/agent/scripts/match.js +226 -0
- package/dist/esm/core/agent/scripts/match.js.map +1 -0
- package/dist/esm/core/agent/scripts/recovery.d.ts +54 -0
- package/dist/esm/core/agent/scripts/recovery.js +77 -0
- package/dist/esm/core/agent/scripts/recovery.js.map +1 -0
- package/dist/esm/core/agent/scripts/rows.d.ts +143 -0
- package/dist/esm/core/agent/scripts/rows.js +211 -0
- package/dist/esm/core/agent/scripts/rows.js.map +1 -0
- package/dist/esm/core/agent/scripts/types.d.ts +91 -0
- package/dist/esm/core/agent/scripts/types.js +21 -0
- package/dist/esm/core/agent/scripts/types.js.map +1 -0
- package/dist/esm/core/agent/scripts/wrapper.d.ts +36 -0
- package/dist/esm/core/agent/scripts/wrapper.js +58 -0
- package/dist/esm/core/agent/scripts/wrapper.js.map +1 -0
- package/dist/esm/core/agent/stages/argumentAsk.d.ts +4 -1
- package/dist/esm/core/agent/stages/argumentAsk.js +164 -22
- package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.js +4 -1
- package/dist/esm/core/agent/stages/evidenceRecheck.js.map +1 -1
- package/dist/esm/core/agent/stages/prepareFinal.d.ts +11 -0
- package/dist/esm/core/agent/stages/prepareFinal.js +65 -10
- package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
- package/dist/esm/core/agent/stages/route.js +53 -3
- package/dist/esm/core/agent/stages/route.js.map +1 -1
- package/dist/esm/core/agent/stages/seed.js +14 -1
- package/dist/esm/core/agent/stages/seed.js.map +1 -1
- package/dist/esm/core/agent/stages/toolCalls.d.ts +14 -0
- package/dist/esm/core/agent/stages/toolCalls.js +337 -16
- package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
- package/dist/esm/core/agent/types.d.ts +41 -0
- package/dist/esm/core/codeRunnerTool.d.ts +23 -0
- package/dist/esm/core/codeRunnerTool.js +31 -2
- package/dist/esm/core/codeRunnerTool.js.map +1 -1
- package/dist/esm/core/runCheckpoint.js +16 -3
- package/dist/esm/core/runCheckpoint.js.map +1 -1
- package/dist/esm/events/payloads.d.ts +46 -1
- package/dist/esm/hosting/answerAccounts.js +4 -2
- package/dist/esm/hosting/answerAccounts.js.map +1 -1
- package/dist/esm/hosting/artifactWire.d.ts +3 -2
- package/dist/esm/hosting/artifactWire.js.map +1 -1
- package/dist/esm/index.d.ts +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/lib/boundedJson.d.ts +24 -0
- package/dist/esm/lib/boundedJson.js +45 -2
- package/dist/esm/lib/boundedJson.js.map +1 -1
- package/dist/esm/lib/scriptRecord.d.ts +139 -0
- package/dist/esm/lib/scriptRecord.js +18 -0
- package/dist/esm/lib/scriptRecord.js.map +1 -0
- package/dist/esm/lib/utf8.d.ts +36 -0
- package/dist/esm/lib/utf8.js +70 -0
- package/dist/esm/lib/utf8.js.map +1 -0
- package/dist/esm/mcp/toolExtras.d.ts +9 -0
- package/dist/esm/mcp/toolExtras.js +6 -0
- package/dist/esm/mcp/toolExtras.js.map +1 -1
- package/dist/esm/redaction/conversation.js +10 -0
- package/dist/esm/redaction/conversation.js.map +1 -1
- package/dist/esm/redaction/knownStrings.js +34 -0
- package/dist/esm/redaction/knownStrings.js.map +1 -1
- package/dist/esm/semantics/coverage/answer.d.ts +12 -1
- package/dist/esm/semantics/coverage/answer.js +26 -3
- package/dist/esm/semantics/coverage/answer.js.map +1 -1
- package/dist/esm/tools/script.d.ts +85 -0
- package/dist/esm/tools/script.js +157 -0
- package/dist/esm/tools/script.js.map +1 -0
- package/dist/esm/tools/tools.d.ts +30 -0
- package/dist/esm/tools/tools.js +4 -0
- package/dist/esm/tools/tools.js.map +1 -1
- package/dist/hosting/answerAccounts.js +4 -2
- package/dist/hosting/answerAccounts.js.map +1 -1
- package/dist/hosting/artifactWire.js.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/boundedJson.js +48 -3
- package/dist/lib/boundedJson.js.map +1 -1
- package/dist/lib/scriptRecord.js +19 -0
- package/dist/lib/scriptRecord.js.map +1 -0
- package/dist/lib/utf8.js +77 -0
- package/dist/lib/utf8.js.map +1 -0
- package/dist/mcp/toolExtras.js +6 -0
- package/dist/mcp/toolExtras.js.map +1 -1
- package/dist/redaction/conversation.js +10 -0
- package/dist/redaction/conversation.js.map +1 -1
- package/dist/redaction/knownStrings.js +34 -0
- package/dist/redaction/knownStrings.js.map +1 -1
- package/dist/semantics/coverage/answer.js +26 -3
- package/dist/semantics/coverage/answer.js.map +1 -1
- package/dist/tools/script.js +163 -0
- package/dist/tools/script.js.map +1 -0
- package/dist/tools/tools.js +4 -0
- package/dist/tools/tools.js.map +1 -1
- package/dist/types/adapters/code/output.d.ts +1 -4
- package/dist/types/adapters/code/output.d.ts.map +1 -1
- package/dist/types/adapters/observability/audit.d.ts +79 -12
- package/dist/types/adapters/observability/audit.d.ts.map +1 -1
- package/dist/types/adapters/observability/auditBounding.d.ts +216 -0
- package/dist/types/adapters/observability/auditBounding.d.ts.map +1 -0
- package/dist/types/adapters/observability/auditKeptByContract.d.ts +66 -0
- package/dist/types/adapters/observability/auditKeptByContract.d.ts.map +1 -0
- package/dist/types/adapters/observability/auditShapes.d.ts +79 -0
- package/dist/types/adapters/observability/auditShapes.d.ts.map +1 -0
- package/dist/types/answer-account/account.d.ts.map +1 -1
- package/dist/types/answer-account/facts/calls.d.ts +0 -2
- package/dist/types/answer-account/facts/calls.d.ts.map +1 -1
- package/dist/types/answer-account/facts/checked.d.ts.map +1 -1
- package/dist/types/answer-account/facts/common.d.ts +16 -4
- package/dist/types/answer-account/facts/common.d.ts.map +1 -1
- package/dist/types/answer-account/facts/found.d.ts.map +1 -1
- package/dist/types/answer-account/facts/howSure.d.ts +1 -1
- package/dist/types/answer-account/facts/howSure.d.ts.map +1 -1
- package/dist/types/answer-account/facts/inView.d.ts.map +1 -1
- package/dist/types/answer-account/facts/pausedLeg.d.ts.map +1 -1
- package/dist/types/answer-account/facts/scripts.d.ts +35 -0
- package/dist/types/answer-account/facts/scripts.d.ts.map +1 -0
- package/dist/types/answer-account/facts/understood.d.ts.map +1 -1
- package/dist/types/answer-account/pointerKey.d.ts +1 -1
- package/dist/types/answer-account/shown.d.ts +9 -2
- package/dist/types/answer-account/shown.d.ts.map +1 -1
- package/dist/types/answer-account/signals.d.ts.map +1 -1
- package/dist/types/answer-account/size.d.ts +60 -0
- package/dist/types/answer-account/size.d.ts.map +1 -0
- package/dist/types/answer-account/templates.d.ts +29 -1
- package/dist/types/answer-account/templates.d.ts.map +1 -1
- package/dist/types/core/Agent.d.ts +8 -1
- package/dist/types/core/Agent.d.ts.map +1 -1
- package/dist/types/core/agent/AgentBuilder.d.ts +52 -0
- package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/ask.d.ts +11 -0
- package/dist/types/core/agent/arguments/ask.d.ts.map +1 -1
- package/dist/types/core/agent/arguments/partialWindow.d.ts +43 -0
- package/dist/types/core/agent/arguments/partialWindow.d.ts.map +1 -0
- package/dist/types/core/agent/assessment/assess.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/compose.d.ts +3 -1
- package/dist/types/core/agent/assessment/compose.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/reasons.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/types.d.ts +12 -2
- package/dist/types/core/agent/assessment/types.d.ts.map +1 -1
- package/dist/types/core/agent/assessment/witness.d.ts +44 -4
- package/dist/types/core/agent/assessment/witness.d.ts.map +1 -1
- package/dist/types/core/agent/buildAgentChart.d.ts +9 -0
- package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/codeRegions.d.ts +131 -0
- package/dist/types/core/agent/evidence/codeRegions.d.ts.map +1 -0
- package/dist/types/core/agent/evidence/gate.d.ts +3 -0
- package/dist/types/core/agent/evidence/gate.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/recovery.d.ts +5 -1
- package/dist/types/core/agent/evidence/recovery.d.ts.map +1 -1
- package/dist/types/core/agent/evidence/types.d.ts +35 -0
- package/dist/types/core/agent/evidence/types.d.ts.map +1 -1
- package/dist/types/core/agent/findings/types.d.ts +3 -2
- package/dist/types/core/agent/findings/types.d.ts.map +1 -1
- package/dist/types/core/agent/scripts/attachment.d.ts +180 -0
- package/dist/types/core/agent/scripts/attachment.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/inert.d.ts +39 -0
- package/dist/types/core/agent/scripts/inert.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/judge.d.ts +37 -0
- package/dist/types/core/agent/scripts/judge.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/label.d.ts +104 -0
- package/dist/types/core/agent/scripts/label.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/match.d.ts +100 -0
- package/dist/types/core/agent/scripts/match.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/recovery.d.ts +55 -0
- package/dist/types/core/agent/scripts/recovery.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/rows.d.ts +144 -0
- package/dist/types/core/agent/scripts/rows.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/types.d.ts +92 -0
- package/dist/types/core/agent/scripts/types.d.ts.map +1 -0
- package/dist/types/core/agent/scripts/wrapper.d.ts +37 -0
- package/dist/types/core/agent/scripts/wrapper.d.ts.map +1 -0
- package/dist/types/core/agent/stages/argumentAsk.d.ts +4 -1
- package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
- package/dist/types/core/agent/stages/evidenceRecheck.d.ts.map +1 -1
- package/dist/types/core/agent/stages/prepareFinal.d.ts +11 -0
- package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
- package/dist/types/core/agent/stages/route.d.ts.map +1 -1
- package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
- package/dist/types/core/agent/stages/toolCalls.d.ts +14 -0
- package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
- package/dist/types/core/agent/types.d.ts +41 -0
- package/dist/types/core/agent/types.d.ts.map +1 -1
- package/dist/types/core/codeRunnerTool.d.ts +23 -0
- package/dist/types/core/codeRunnerTool.d.ts.map +1 -1
- package/dist/types/core/runCheckpoint.d.ts.map +1 -1
- package/dist/types/events/payloads.d.ts +46 -1
- package/dist/types/events/payloads.d.ts.map +1 -1
- package/dist/types/hosting/answerAccounts.d.ts.map +1 -1
- package/dist/types/hosting/artifactWire.d.ts +3 -2
- package/dist/types/hosting/artifactWire.d.ts.map +1 -1
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/lib/boundedJson.d.ts +24 -0
- package/dist/types/lib/boundedJson.d.ts.map +1 -1
- package/dist/types/lib/scriptRecord.d.ts +140 -0
- package/dist/types/lib/scriptRecord.d.ts.map +1 -0
- package/dist/types/lib/utf8.d.ts +37 -0
- package/dist/types/lib/utf8.d.ts.map +1 -0
- package/dist/types/mcp/toolExtras.d.ts +9 -0
- package/dist/types/mcp/toolExtras.d.ts.map +1 -1
- package/dist/types/redaction/conversation.d.ts.map +1 -1
- package/dist/types/redaction/knownStrings.d.ts.map +1 -1
- package/dist/types/semantics/coverage/answer.d.ts +12 -1
- package/dist/types/semantics/coverage/answer.d.ts.map +1 -1
- package/dist/types/tools/script.d.ts +86 -0
- package/dist/types/tools/script.d.ts.map +1 -0
- package/dist/types/tools/tools.d.ts +30 -0
- package/dist/types/tools/tools.d.ts.map +1 -1
- package/package.json +2 -1
|
@@ -51,7 +51,9 @@ import { findingsReferenceRefusal } from '../findings/admission.js';
|
|
|
51
51
|
* calls it with a valid Skill id, the next InjectionEngine pass
|
|
52
52
|
* activates that Skill (lifetime: turn).
|
|
53
53
|
*/
|
|
54
|
-
import { codeRunsOf } from '../../codeRunnerTool.js';
|
|
54
|
+
import { CODE_RUN_SLOT, codeRunsOf, } from '../../codeRunnerTool.js';
|
|
55
|
+
import { scriptOf } from '../../../tools/script.js';
|
|
56
|
+
import { programIn, recordScriptRow, scriptRowFor } from '../scripts/rows.js';
|
|
55
57
|
import { isDevMode } from 'footprintjs';
|
|
56
58
|
import { checkerGoverns } from '../../../provider-contract/types.js';
|
|
57
59
|
import { typedEmit } from '../../../recorders/core/typedEmit.js';
|
|
@@ -1882,6 +1884,153 @@ export function buildToolCallsHandler(deps) {
|
|
|
1882
1884
|
if (next !== prior)
|
|
1883
1885
|
scope.toolCallLedger = next;
|
|
1884
1886
|
};
|
|
1887
|
+
/**
|
|
1888
|
+
* THE ONE DOOR for a call's `script` row (`deps.scriptRecord`) — asked
|
|
1889
|
+
* where each call of a declared code-running tool settles or pauses. A tool
|
|
1890
|
+
* that declares no `script` (or one the dispatch door refuses,
|
|
1891
|
+
* `tools/script.ts` · `scriptOf`) files nothing; an unarmed agent never
|
|
1892
|
+
* reaches the declaration at all.
|
|
1893
|
+
*/
|
|
1894
|
+
const fileScript = (scope, call) => {
|
|
1895
|
+
if (deps.scriptRecord !== true)
|
|
1896
|
+
return undefined;
|
|
1897
|
+
const script = scriptOf(call.tool);
|
|
1898
|
+
if (script === undefined)
|
|
1899
|
+
return undefined;
|
|
1900
|
+
const row = scriptRowFor({
|
|
1901
|
+
script,
|
|
1902
|
+
tool: call.toolName,
|
|
1903
|
+
toolCallId: call.toolCallId,
|
|
1904
|
+
iteration: call.iteration,
|
|
1905
|
+
turn: scope.turnNumber,
|
|
1906
|
+
proposed: call.proposed,
|
|
1907
|
+
...(call.submitted !== undefined && { submitted: call.submitted }),
|
|
1908
|
+
settlement: call.settlement,
|
|
1909
|
+
...(call.facts !== undefined && { facts: call.facts }),
|
|
1910
|
+
...(call.withheld === true && { withheld: true }),
|
|
1911
|
+
...(call.paused === true && { paused: true }),
|
|
1912
|
+
});
|
|
1913
|
+
if (row === undefined)
|
|
1914
|
+
return undefined;
|
|
1915
|
+
const dispatch = recordScriptRow(scope, row, {
|
|
1916
|
+
paused: call.paused === true,
|
|
1917
|
+
...(call.dispatch !== undefined && { dispatch: call.dispatch }),
|
|
1918
|
+
});
|
|
1919
|
+
// A paused call keeps its dispatch across the checkpoint: the row that
|
|
1920
|
+
// settles it on resume joins the same dispatch, never a new one.
|
|
1921
|
+
if (call.paused === true && dispatch !== undefined) {
|
|
1922
|
+
scope.pausedScriptDispatch = { dispatch, toolCallId: call.toolCallId, turn: row.turn };
|
|
1923
|
+
}
|
|
1924
|
+
return dispatch;
|
|
1925
|
+
};
|
|
1926
|
+
/**
|
|
1927
|
+
* The declared argument's VALUE in `args`, read now — `undefined` when the
|
|
1928
|
+
* agent is unarmed or the tool declares no `script`. Asked at the boundary
|
|
1929
|
+
* each value belongs to (as the call arrives; just before `execute`) and
|
|
1930
|
+
* kept: a string cannot be edited afterwards, the arguments object can.
|
|
1931
|
+
*/
|
|
1932
|
+
const programOfCall = (tool, args) => {
|
|
1933
|
+
if (deps.scriptRecord !== true)
|
|
1934
|
+
return undefined;
|
|
1935
|
+
const script = scriptOf(tool);
|
|
1936
|
+
return script === undefined ? undefined : programIn(script, args);
|
|
1937
|
+
};
|
|
1938
|
+
/**
|
|
1939
|
+
* The arguments the model PROPOSED for a call, read back from the assistant
|
|
1940
|
+
* turn that carried it (`_findings` peeled) — what a resumed call's script
|
|
1941
|
+
* row compares the program it ran with. `undefined` when the turn is gone.
|
|
1942
|
+
*/
|
|
1943
|
+
const proposedArgsOf = (scope, toolCallId) => {
|
|
1944
|
+
const history = scope.history;
|
|
1945
|
+
for (let i = history.length - 1; i >= 0; i--) {
|
|
1946
|
+
const call = history[i]?.toolCalls?.find((c) => c.id === toolCallId);
|
|
1947
|
+
if (call !== undefined)
|
|
1948
|
+
return peelCall(call).args;
|
|
1949
|
+
}
|
|
1950
|
+
return undefined;
|
|
1951
|
+
};
|
|
1952
|
+
/**
|
|
1953
|
+
* A RESUMED call's script row — the four resume doors settle the paused call
|
|
1954
|
+
* here. `carried` is the pause carrier (the arguments the person approved,
|
|
1955
|
+
* or the call was paused with); `seen` is what `resolveCredentialAndExecute`
|
|
1956
|
+
* saw when the call ran. The tool is resolved as the resume resolved it.
|
|
1957
|
+
*/
|
|
1958
|
+
const fileResumedScript = (scope, call) => {
|
|
1959
|
+
if (deps.scriptRecord !== true)
|
|
1960
|
+
return;
|
|
1961
|
+
const tool = resolveTool(call.toolName, scope.pausedToolParty).tool;
|
|
1962
|
+
// The dispatch the pause filed this call under — when it is THIS call's.
|
|
1963
|
+
const held = scope.pausedScriptDispatch;
|
|
1964
|
+
const dispatch = held !== undefined &&
|
|
1965
|
+
held.toolCallId === call.toolCallId &&
|
|
1966
|
+
held.turn === scope.turnNumber
|
|
1967
|
+
? held.dispatch
|
|
1968
|
+
: undefined;
|
|
1969
|
+
if (held !== undefined)
|
|
1970
|
+
scope.pausedScriptDispatch = undefined;
|
|
1971
|
+
// A call that paused from inside `execute` carried the values read before
|
|
1972
|
+
// it ran (`pausedScriptPrograms`) — this call's, when the dispatch is.
|
|
1973
|
+
const carried = scope.pausedScriptPrograms;
|
|
1974
|
+
if (carried !== undefined)
|
|
1975
|
+
scope.pausedScriptPrograms = undefined;
|
|
1976
|
+
const own = dispatch !== undefined ? carried : undefined;
|
|
1977
|
+
// Read before `execute` ran (`seen`), or carried from before it ran; a
|
|
1978
|
+
// call that never got there reads its carrier now — no tool code ran on it.
|
|
1979
|
+
const proposed = call.seen.entered === true
|
|
1980
|
+
? call.seen.proposed
|
|
1981
|
+
: own?.proposed ??
|
|
1982
|
+
programOfCall(tool, proposedArgsOf(scope, call.toolCallId) ?? call.carried);
|
|
1983
|
+
const submitted = call.seen.entered === true
|
|
1984
|
+
? call.seen.submitted
|
|
1985
|
+
: own?.submitted ?? programOfCall(tool, call.carried);
|
|
1986
|
+
fileScript(scope, {
|
|
1987
|
+
tool,
|
|
1988
|
+
toolName: call.toolName,
|
|
1989
|
+
toolCallId: call.toolCallId,
|
|
1990
|
+
iteration: call.iteration,
|
|
1991
|
+
proposed,
|
|
1992
|
+
...(submitted !== undefined && { submitted }),
|
|
1993
|
+
settlement: !call.entered ? 'not-entered' : call.seen.threw === true ? 'threw' : 'returned',
|
|
1994
|
+
...(call.seen.codeRun !== undefined && { facts: call.seen.codeRun }),
|
|
1995
|
+
withheld: call.seen.overCeiling === true,
|
|
1996
|
+
...(dispatch !== undefined && { dispatch }),
|
|
1997
|
+
});
|
|
1998
|
+
};
|
|
1999
|
+
/**
|
|
2000
|
+
* THIS dispatch's code-run facts, taken from its own slot (`CODE_RUN_SLOT`)
|
|
2001
|
+
* — what the script row attests, whichever runner filed them (a wrapper that
|
|
2002
|
+
* hands its context to a code runner included). Asked at BOTH execute
|
|
2003
|
+
* boundaries — the batch loop and `resolveCredentialAndExecute` — right
|
|
2004
|
+
* after `tool.execute` returns. Only the slot is ever attested from.
|
|
2005
|
+
*
|
|
2006
|
+
* The published surfaces are kept exactly as they were. The map
|
|
2007
|
+
* (`codeRunsOf`): at the batch boundary (`takeListed`) the dispatched tool's
|
|
2008
|
+
* entry for this call id is taken off it; the resume boundary leaves it.
|
|
2009
|
+
* The event fires when the dispatched tool is itself a code runner, as it
|
|
2010
|
+
* always did, carrying the dispatch's own facts. When the slot is empty
|
|
2011
|
+
* there — a decorator kept the runner's map but handed the runner a context
|
|
2012
|
+
* of its own, so the runner filed by the call id alone — it fires as it
|
|
2013
|
+
* always did, from the map's entry: the one case the slot cannot reach, and
|
|
2014
|
+
* the facts it carries are the map's, never attested. The code itself is
|
|
2015
|
+
* never on this channel: generated code quotes the data it was handed.
|
|
2016
|
+
*/
|
|
2017
|
+
const takeCodeRun = (scope, tool, slot, call) => {
|
|
2018
|
+
const facts = slot.facts;
|
|
2019
|
+
slot.facts = undefined;
|
|
2020
|
+
const listed = codeRunsOf(tool);
|
|
2021
|
+
const filed = call.takeListed ? listed?.get(call.toolCallId) : undefined;
|
|
2022
|
+
if (filed !== undefined)
|
|
2023
|
+
listed?.delete(call.toolCallId);
|
|
2024
|
+
const told = facts ?? filed;
|
|
2025
|
+
if (told !== undefined && listed !== undefined) {
|
|
2026
|
+
// `tool` is the name the model CALLED, not the one the runner's closure
|
|
2027
|
+
// was built with: a runner re-exposed under another schema name must be
|
|
2028
|
+
// recognizable by the name its calls carry (a content exporter withholds
|
|
2029
|
+
// that tool's arguments — the program). Same bytes whenever they agree.
|
|
2030
|
+
typedEmit(scope, 'agentfootprint.tools.code_run', { ...told, tool: call.toolName });
|
|
2031
|
+
}
|
|
2032
|
+
return facts;
|
|
2033
|
+
};
|
|
1885
2034
|
/** `emitToolEnd`'s twin: the call is open in the ledger until its `tool_end` lands. */
|
|
1886
2035
|
const emitToolStart = (scope, payload) => {
|
|
1887
2036
|
// A listener sees the call's frozen copy — the dispatch loop's shared one
|
|
@@ -2723,6 +2872,19 @@ export function buildToolCallsHandler(deps) {
|
|
|
2723
2872
|
*/
|
|
2724
2873
|
const bracketSettled = (scope, settlement) => {
|
|
2725
2874
|
for (const { call, result } of settlement.settled) {
|
|
2875
|
+
// Never dispatched: the program is on the record as proposed, `submitted`.
|
|
2876
|
+
// Guarded here — the arguments read the scope, and an unarmed agent reads
|
|
2877
|
+
// nothing new.
|
|
2878
|
+
if (deps.scriptRecord === true) {
|
|
2879
|
+
fileScript(scope, {
|
|
2880
|
+
tool: resolveTool(call.name).tool,
|
|
2881
|
+
toolName: call.name,
|
|
2882
|
+
toolCallId: call.id,
|
|
2883
|
+
iteration: scope.iteration,
|
|
2884
|
+
proposed: programOfCall(resolveTool(call.name).tool, peelCall(call).args),
|
|
2885
|
+
settlement: 'not-entered',
|
|
2886
|
+
});
|
|
2887
|
+
}
|
|
2726
2888
|
emitToolStart(scope, {
|
|
2727
2889
|
toolName: call.name,
|
|
2728
2890
|
toolCallId: call.id,
|
|
@@ -2752,7 +2914,10 @@ export function buildToolCallsHandler(deps) {
|
|
|
2752
2914
|
// copies every app callback is handed (`lib/frozenCopy.ts`): arguments that
|
|
2753
2915
|
// no longer re-derive the request's id (`runsAsAsked`, the one rule that
|
|
2754
2916
|
// binds a decision to its call) do not run (`callChanged`).
|
|
2755
|
-
const resolveCredentialAndExecute = async (scope, resolved, toolName, args, toolCallId, iteration, env, heldTo
|
|
2917
|
+
const resolveCredentialAndExecute = async (scope, resolved, toolName, args, toolCallId, iteration, env, heldTo,
|
|
2918
|
+
/** Filled for the call's script row (`deps.scriptRecord`): what `execute`
|
|
2919
|
+
* was handed, the runner's facts, a ceiling refusal, a throw. */
|
|
2920
|
+
seen) => {
|
|
2756
2921
|
const tool = resolved.tool;
|
|
2757
2922
|
/** What the approval covers — the arguments as handed in, before any
|
|
2758
2923
|
* `wants` resolution or clock redraw derives the ones `execute` gets. */
|
|
@@ -2860,7 +3025,12 @@ export function buildToolCallsHandler(deps) {
|
|
|
2860
3025
|
args = dispatched.args;
|
|
2861
3026
|
// `let`, not `const`: the semantic projection below replaces the value
|
|
2862
3027
|
// on the non-envelope path exactly as the batch loop does.
|
|
3028
|
+
// This dispatch's own slot for the runner's facts (`CODE_RUN_SLOT`):
|
|
3029
|
+
// facts reach the exact dispatch that ran, never another run's call
|
|
3030
|
+
// that happens to reuse the provider's id.
|
|
3031
|
+
const codeRunSlot = {};
|
|
2863
3032
|
const executionContext = {
|
|
3033
|
+
[CODE_RUN_SLOT]: codeRunSlot,
|
|
2864
3034
|
toolCallId,
|
|
2865
3035
|
iteration,
|
|
2866
3036
|
...(callTime !== undefined && { time: callTime }),
|
|
@@ -2917,7 +3087,22 @@ export function buildToolCallsHandler(deps) {
|
|
|
2917
3087
|
})
|
|
2918
3088
|
: undefined;
|
|
2919
3089
|
executed = true;
|
|
3090
|
+
if (seen !== undefined) {
|
|
3091
|
+
// Read now, before any tool code runs: what the call proposed and
|
|
3092
|
+
// what `execute` is handed — values, never the arguments object.
|
|
3093
|
+
seen.entered = true;
|
|
3094
|
+
seen.proposed = programOfCall(tool, proposedArgsOf(scope, toolCallId) ?? args);
|
|
3095
|
+
seen.submitted = programOfCall(tool, args);
|
|
3096
|
+
}
|
|
2920
3097
|
let result = await tool.execute(args, executionContext);
|
|
3098
|
+
// The runner's facts, at this execute boundary as at the batch loop's.
|
|
3099
|
+
const codeRun = takeCodeRun(scope, tool, codeRunSlot, {
|
|
3100
|
+
toolName,
|
|
3101
|
+
toolCallId,
|
|
3102
|
+
takeListed: false,
|
|
3103
|
+
});
|
|
3104
|
+
if (seen !== undefined && codeRun !== undefined)
|
|
3105
|
+
seen.codeRun = codeRun;
|
|
2921
3106
|
if (negativeDispatch !== undefined)
|
|
2922
3107
|
result = captureNegativeResult(scope, negativeDispatch, result, tool);
|
|
2923
3108
|
await endCall(toolCallId);
|
|
@@ -2961,6 +3146,8 @@ export function buildToolCallsHandler(deps) {
|
|
|
2961
3146
|
if (refusal !== undefined) {
|
|
2962
3147
|
if (negativeDispatch !== undefined)
|
|
2963
3148
|
keepNegativeResultOut(scope, negativeDispatch.resultId);
|
|
3149
|
+
if (seen !== undefined)
|
|
3150
|
+
seen.overCeiling = true;
|
|
2964
3151
|
return {
|
|
2965
3152
|
result: refusal,
|
|
2966
3153
|
executed: true,
|
|
@@ -3014,6 +3201,8 @@ export function buildToolCallsHandler(deps) {
|
|
|
3014
3201
|
if (refusal !== undefined) {
|
|
3015
3202
|
if (negativeDispatch !== undefined)
|
|
3016
3203
|
keepNegativeResultOut(scope, negativeDispatch.resultId);
|
|
3204
|
+
if (seen !== undefined)
|
|
3205
|
+
seen.overCeiling = true;
|
|
3017
3206
|
// Synthesized empty-effects envelope: the resume paths read the
|
|
3018
3207
|
// routing status off `envelope.status`, and this is how a refused
|
|
3019
3208
|
// NON-envelope result carries `'invalid'` there without every path
|
|
@@ -3071,6 +3260,8 @@ export function buildToolCallsHandler(deps) {
|
|
|
3071
3260
|
// Settled by throwing is still settled — a tool that opened a session and
|
|
3072
3261
|
// then failed must not keep it.
|
|
3073
3262
|
await endCall(toolCallId);
|
|
3263
|
+
if (seen !== undefined && executed)
|
|
3264
|
+
seen.threw = true;
|
|
3074
3265
|
if (isPauseRequest(err)) {
|
|
3075
3266
|
return {
|
|
3076
3267
|
result: `tool '${toolName}' requested a pause while resuming an approved check-in, which is not supported`,
|
|
@@ -3169,11 +3360,16 @@ export function buildToolCallsHandler(deps) {
|
|
|
3169
3360
|
let askedLayer;
|
|
3170
3361
|
if (inputs !== undefined &&
|
|
3171
3362
|
resolutions !== undefined &&
|
|
3172
|
-
[...resolutions.values()].some((r) => r.ask !== undefined)
|
|
3363
|
+
([...resolutions.values()].some((r) => r.ask !== undefined) ||
|
|
3364
|
+
deps.time?.reader !== undefined)) {
|
|
3173
3365
|
// Loaded on first use — the optional-family law: a plain agent's
|
|
3174
3366
|
// graph never carries the ask (`test/trace-toolpack/browserGraph`).
|
|
3175
3367
|
const { askBeforeDispatch } = await import('./argumentAsk.js');
|
|
3176
3368
|
const asked = askBeforeDispatch(scope, resolutions, {
|
|
3369
|
+
excludedCallIds: toolCalls
|
|
3370
|
+
.filter((_, index) => findingsRefusals[index] !== undefined)
|
|
3371
|
+
.map((call) => call.id),
|
|
3372
|
+
...(deps.argumentSources === true && { argumentSources: true }),
|
|
3177
3373
|
toolOf: (toolName) => resolveTool(toolName).tool,
|
|
3178
3374
|
runId: () => runFactsOf(scope)?.runId,
|
|
3179
3375
|
...(deps.argumentAskContext !== undefined && { hostContext: deps.argumentAskContext }),
|
|
@@ -3314,6 +3510,10 @@ export function buildToolCallsHandler(deps) {
|
|
|
3314
3510
|
// same reference — `tc.args` — and not one byte moves.
|
|
3315
3511
|
const peeled = peelCall(tc);
|
|
3316
3512
|
const args = peeled.args;
|
|
3513
|
+
// The script record's proposal (`deps.scriptRecord`): the declared
|
|
3514
|
+
// argument's value, read as the call arrives — before any rule or tool
|
|
3515
|
+
// code runs. `undefined` unarmed.
|
|
3516
|
+
const proposedProgram = programOfCall(tool, args);
|
|
3317
3517
|
// ── THE BASIS ROW — immediately, so it precedes `tool_start` in the
|
|
3318
3518
|
// event log and every pause `return` in program order (a paused
|
|
3319
3519
|
// call's row is on the pre-pause partial commit; a denied call keeps
|
|
@@ -3422,6 +3622,14 @@ export function buildToolCallsHandler(deps) {
|
|
|
3422
3622
|
let denied = findingsRefusal !== undefined;
|
|
3423
3623
|
/** True once `tool.execute` has been entered — see `afterMoment`. */
|
|
3424
3624
|
let executed = false;
|
|
3625
|
+
/** The declared argument's value handed to `execute`, read just before it ran. */
|
|
3626
|
+
let submittedProgram;
|
|
3627
|
+
/** `execute` was entered and threw — a settlement the script row reads. */
|
|
3628
|
+
let executeThrew = false;
|
|
3629
|
+
/** The code-run facts a code-runner tool left for this call (`takeCodeRun`). */
|
|
3630
|
+
let ranCode;
|
|
3631
|
+
/** The tool's own `resultCeiling` (not the column contract) refused the result. */
|
|
3632
|
+
let withheldOverCeiling = false;
|
|
3425
3633
|
let negativeDispatch;
|
|
3426
3634
|
/** The tool's own `resultCeiling` refused this call's result (9.20.0)
|
|
3427
3635
|
* — the call ran, but it must not complete a procedure step: the
|
|
@@ -3761,6 +3969,18 @@ export function buildToolCallsHandler(deps) {
|
|
|
3761
3969
|
// checkpoint stays byte-identical.
|
|
3762
3970
|
if (askComponent !== undefined)
|
|
3763
3971
|
scope.pausedComponentId = askComponent.componentId;
|
|
3972
|
+
// The call is open, waiting on a person: its script row says
|
|
3973
|
+
// `submitted`, without the text — the settled row carries it.
|
|
3974
|
+
fileScript(scope, {
|
|
3975
|
+
tool,
|
|
3976
|
+
toolName: tc.name,
|
|
3977
|
+
toolCallId: tc.id,
|
|
3978
|
+
iteration,
|
|
3979
|
+
proposed: proposedProgram,
|
|
3980
|
+
submitted: programOfCall(tool, bound.args),
|
|
3981
|
+
settlement: 'not-entered',
|
|
3982
|
+
paused: true,
|
|
3983
|
+
});
|
|
3764
3984
|
// A defined return value triggers the footprintjs pause; this
|
|
3765
3985
|
// object becomes the checkpoint's pauseData, and detectPause
|
|
3766
3986
|
// surfaces `pauseData.ask` as `outcome.ask`.
|
|
@@ -3970,6 +4190,17 @@ export function buildToolCallsHandler(deps) {
|
|
|
3970
4190
|
// only when one exists (byte-identical otherwise).
|
|
3971
4191
|
if (gateComponent !== undefined)
|
|
3972
4192
|
scope.pausedComponentId = gateComponent.componentId;
|
|
4193
|
+
// Open until a person decides: `submitted`, without the text.
|
|
4194
|
+
fileScript(scope, {
|
|
4195
|
+
tool,
|
|
4196
|
+
toolName: tc.name,
|
|
4197
|
+
toolCallId: tc.id,
|
|
4198
|
+
iteration,
|
|
4199
|
+
proposed: proposedProgram,
|
|
4200
|
+
submitted: programOfCall(tool, bound.args),
|
|
4201
|
+
settlement: 'not-entered',
|
|
4202
|
+
paused: true,
|
|
4203
|
+
});
|
|
3973
4204
|
// Returning a defined value triggers the footprintjs pause; the
|
|
3974
4205
|
// returned object becomes the checkpoint's pauseData. detectPause
|
|
3975
4206
|
// surfaces `pauseData.checkIn` as `outcome.checkIn`.
|
|
@@ -4064,6 +4295,17 @@ export function buildToolCallsHandler(deps) {
|
|
|
4064
4295
|
// Same carrier as the middleware-ask pause (9.92.0).
|
|
4065
4296
|
if (resolved.party !== undefined)
|
|
4066
4297
|
scope.pausedToolParty = resolved.party;
|
|
4298
|
+
// Open until the person consents: `submitted`, without the text.
|
|
4299
|
+
fileScript(scope, {
|
|
4300
|
+
tool,
|
|
4301
|
+
toolName: tc.name,
|
|
4302
|
+
toolCallId: tc.id,
|
|
4303
|
+
iteration,
|
|
4304
|
+
proposed: proposedProgram,
|
|
4305
|
+
submitted: programOfCall(tool, callArgs),
|
|
4306
|
+
settlement: 'not-entered',
|
|
4307
|
+
paused: true,
|
|
4308
|
+
});
|
|
4067
4309
|
// A defined return value triggers the footprintjs pause; this
|
|
4068
4310
|
// object becomes the checkpoint's pauseData, and standingAgent's
|
|
4069
4311
|
// describePause hands it to the caller as `PendingAsk`.
|
|
@@ -4137,7 +4379,11 @@ export function buildToolCallsHandler(deps) {
|
|
|
4137
4379
|
// Set BEFORE the await: a tool that throws has still run, and a
|
|
4138
4380
|
// tool that does not exist has not. This flag is the entire
|
|
4139
4381
|
// precondition of the after-tool moment below.
|
|
4382
|
+
// This dispatch's own slot for the runner's facts — see the
|
|
4383
|
+
// resume path's twin in `resolveCredentialAndExecute`.
|
|
4384
|
+
const codeRunSlot = {};
|
|
4140
4385
|
const executionContext = {
|
|
4386
|
+
[CODE_RUN_SLOT]: codeRunSlot,
|
|
4141
4387
|
toolCallId: tc.id,
|
|
4142
4388
|
iteration,
|
|
4143
4389
|
...(callTime !== undefined && { time: callTime }),
|
|
@@ -4175,6 +4421,7 @@ export function buildToolCallsHandler(deps) {
|
|
|
4175
4421
|
})
|
|
4176
4422
|
: undefined;
|
|
4177
4423
|
executed = true;
|
|
4424
|
+
submittedProgram = programOfCall(tool, callArgs);
|
|
4178
4425
|
result = await tool.execute(callArgs, executionContext);
|
|
4179
4426
|
if (negativeDispatch !== undefined)
|
|
4180
4427
|
result = captureNegativeResult(scope, negativeDispatch, result, tool);
|
|
@@ -4187,16 +4434,11 @@ export function buildToolCallsHandler(deps) {
|
|
|
4187
4434
|
// session events follow with `keyHash`, never the key. Generated
|
|
4188
4435
|
// code quotes the data it was handed, so the program is the one
|
|
4189
4436
|
// part of a code run that must not reach an exporter.
|
|
4190
|
-
|
|
4191
|
-
|
|
4192
|
-
|
|
4193
|
-
|
|
4194
|
-
|
|
4195
|
-
// schema name must be recognizable by the name its calls carry
|
|
4196
|
-
// (a content exporter withholds that tool's arguments — the
|
|
4197
|
-
// program). Same bytes whenever the two names agree.
|
|
4198
|
-
typedEmit(scope, 'agentfootprint.tools.code_run', { ...ranCode, tool: tc.name });
|
|
4199
|
-
}
|
|
4437
|
+
ranCode = takeCodeRun(scope, tool, codeRunSlot, {
|
|
4438
|
+
toolName: tc.name,
|
|
4439
|
+
toolCallId: tc.id,
|
|
4440
|
+
takeListed: true,
|
|
4441
|
+
});
|
|
4200
4442
|
// The typed effects channel (9.19.0): a recognized envelope is
|
|
4201
4443
|
// unwrapped HERE, at the one boundary the raw return crosses —
|
|
4202
4444
|
// everything downstream (governance rules, the cap, history,
|
|
@@ -4264,6 +4506,7 @@ export function buildToolCallsHandler(deps) {
|
|
|
4264
4506
|
if (negativeDispatch !== undefined)
|
|
4265
4507
|
keepNegativeResultOut(scope, negativeDispatch.resultId);
|
|
4266
4508
|
ceilingRefused = true;
|
|
4509
|
+
withheldOverCeiling = true;
|
|
4267
4510
|
result = overflowRefusal;
|
|
4268
4511
|
toolStatus = 'invalid';
|
|
4269
4512
|
}
|
|
@@ -4362,6 +4605,28 @@ export function buildToolCallsHandler(deps) {
|
|
|
4362
4605
|
// person, and the resources it opened are what the resume
|
|
4363
4606
|
// needs. No `'call'` teardown here, deliberately.
|
|
4364
4607
|
writePause();
|
|
4608
|
+
// The tool asked from INSIDE `execute`: its program is the
|
|
4609
|
+
// value read before it ran, never the arguments as it left them.
|
|
4610
|
+
const pausedDispatch = fileScript(scope, {
|
|
4611
|
+
tool,
|
|
4612
|
+
toolName: tc.name,
|
|
4613
|
+
toolCallId: tc.id,
|
|
4614
|
+
iteration,
|
|
4615
|
+
proposed: proposedProgram,
|
|
4616
|
+
submitted: submittedProgram,
|
|
4617
|
+
settlement: 'not-entered',
|
|
4618
|
+
paused: true,
|
|
4619
|
+
});
|
|
4620
|
+
// The resume settles this call without running it again, so
|
|
4621
|
+
// the values read before it ran ride the checkpoint.
|
|
4622
|
+
if (pausedDispatch !== undefined) {
|
|
4623
|
+
scope.pausedScriptPrograms = {
|
|
4624
|
+
...(typeof proposedProgram === 'string' && { proposed: proposedProgram }),
|
|
4625
|
+
...(typeof submittedProgram === 'string' && {
|
|
4626
|
+
submitted: submittedProgram,
|
|
4627
|
+
}),
|
|
4628
|
+
};
|
|
4629
|
+
}
|
|
4365
4630
|
const stamped = declaration === undefined
|
|
4366
4631
|
? undefined
|
|
4367
4632
|
: declared ?? validateInputDeclaration(declaration);
|
|
@@ -4399,6 +4664,7 @@ export function buildToolCallsHandler(deps) {
|
|
|
4399
4664
|
// settled here too — the returned path's error, not a pause.
|
|
4400
4665
|
await endCall(tc.id);
|
|
4401
4666
|
error = true;
|
|
4667
|
+
executeThrew = executed;
|
|
4402
4668
|
result =
|
|
4403
4669
|
raisedMissError ??
|
|
4404
4670
|
(askedLayer !== undefined && isPauseRequest(err)
|
|
@@ -4716,6 +4982,20 @@ export function buildToolCallsHandler(deps) {
|
|
|
4716
4982
|
const capped = capResults(tc.name, placedValues);
|
|
4717
4983
|
const modelResult = capped.modelResult;
|
|
4718
4984
|
const durationMs = Date.now() - startMs;
|
|
4985
|
+
// The call has settled: its script row, read from the runner's facts
|
|
4986
|
+
// first, then from how the call settled — never from the delivery
|
|
4987
|
+
// (`ceilingRefused` rides the row as `resultWithheld`).
|
|
4988
|
+
fileScript(scope, {
|
|
4989
|
+
tool,
|
|
4990
|
+
toolName: tc.name,
|
|
4991
|
+
toolCallId: tc.id,
|
|
4992
|
+
iteration,
|
|
4993
|
+
proposed: proposedProgram,
|
|
4994
|
+
submitted: executed ? submittedProgram : programOfCall(tool, callArgs),
|
|
4995
|
+
settlement: !executed ? 'not-entered' : executeThrew ? 'threw' : 'returned',
|
|
4996
|
+
...(ranCode !== undefined && { facts: ranCode }),
|
|
4997
|
+
withheld: withheldOverCeiling,
|
|
4998
|
+
});
|
|
4719
4999
|
emitToolEnd(scope, tc.name, {
|
|
4720
5000
|
toolCallId: tc.id,
|
|
4721
5001
|
result: capped.result,
|
|
@@ -5086,6 +5366,8 @@ export function buildToolCallsHandler(deps) {
|
|
|
5086
5366
|
/** The tool ran (any outcome) — the judge's gate (9.104.0). */
|
|
5087
5367
|
let toolRan = false;
|
|
5088
5368
|
let negativeResultId;
|
|
5369
|
+
/** What the approved call's `execute` saw — its script row reads it. */
|
|
5370
|
+
const scriptSeen = {};
|
|
5089
5371
|
if (!decision.approved) {
|
|
5090
5372
|
result = declinedResult(decision.note);
|
|
5091
5373
|
recordDecisions(scope, [
|
|
@@ -5254,7 +5536,7 @@ export function buildToolCallsHandler(deps) {
|
|
|
5254
5536
|
}
|
|
5255
5537
|
else {
|
|
5256
5538
|
const env = scope.$getEnv();
|
|
5257
|
-
const dispatched = await resolveCredentialAndExecute(scope, resolved, toolName, runArgs, toolCallId, iteration, env, 'ask');
|
|
5539
|
+
const dispatched = await resolveCredentialAndExecute(scope, resolved, toolName, runArgs, toolCallId, iteration, env, 'ask', scriptSeen);
|
|
5258
5540
|
negativeResultId = dispatched.negativeResultId;
|
|
5259
5541
|
result = dispatched.result;
|
|
5260
5542
|
error = dispatched.error;
|
|
@@ -5386,6 +5668,14 @@ export function buildToolCallsHandler(deps) {
|
|
|
5386
5668
|
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
5387
5669
|
});
|
|
5388
5670
|
await judgeLanded(scope, deps.findingsJudge, toolRan, { toolName, result: askResultStr, toolCallId }, iteration, turnStampOf(scope));
|
|
5671
|
+
fileResumedScript(scope, {
|
|
5672
|
+
toolName,
|
|
5673
|
+
toolCallId,
|
|
5674
|
+
iteration,
|
|
5675
|
+
carried: args,
|
|
5676
|
+
entered: toolRan,
|
|
5677
|
+
seen: scriptSeen,
|
|
5678
|
+
});
|
|
5389
5679
|
emitToolEnd(scope, toolName, {
|
|
5390
5680
|
toolCallId,
|
|
5391
5681
|
result: askCapped.result,
|
|
@@ -5475,12 +5765,14 @@ export function buildToolCallsHandler(deps) {
|
|
|
5475
5765
|
/** The tool ran (any outcome) — the judge's gate (9.104.0). */
|
|
5476
5766
|
let toolRan = false;
|
|
5477
5767
|
let negativeResultId;
|
|
5768
|
+
/** What the approved call's `execute` saw — its script row reads it. */
|
|
5769
|
+
const scriptSeen = {};
|
|
5478
5770
|
if (decision.approved) {
|
|
5479
5771
|
const env = scope.$getEnv();
|
|
5480
5772
|
// Resolved against the party the checkpoint carries (9.92.0).
|
|
5481
5773
|
const resolved = resolveTool(toolName, scope.pausedToolParty);
|
|
5482
5774
|
const tool = resolved.tool;
|
|
5483
|
-
const dispatched = await resolveCredentialAndExecute(scope, resolved, toolName, args, toolCallId, iteration, env, 'checkIn');
|
|
5775
|
+
const dispatched = await resolveCredentialAndExecute(scope, resolved, toolName, args, toolCallId, iteration, env, 'checkIn', scriptSeen);
|
|
5484
5776
|
negativeResultId = dispatched.negativeResultId;
|
|
5485
5777
|
result = dispatched.result;
|
|
5486
5778
|
error = dispatched.error;
|
|
@@ -5562,6 +5854,14 @@ export function buildToolCallsHandler(deps) {
|
|
|
5562
5854
|
...(resumeEnvelope?.status !== undefined && { status: resumeEnvelope.status }),
|
|
5563
5855
|
});
|
|
5564
5856
|
await judgeLanded(scope, deps.findingsJudge, toolRan, { toolName, result: decisionResultStr, toolCallId }, iteration, turnStampOf(scope));
|
|
5857
|
+
fileResumedScript(scope, {
|
|
5858
|
+
toolName,
|
|
5859
|
+
toolCallId,
|
|
5860
|
+
iteration,
|
|
5861
|
+
carried: args,
|
|
5862
|
+
entered: toolRan,
|
|
5863
|
+
seen: scriptSeen,
|
|
5864
|
+
});
|
|
5565
5865
|
emitToolEnd(scope, toolName, {
|
|
5566
5866
|
toolCallId,
|
|
5567
5867
|
result: decisionCapped.result,
|
|
@@ -5619,7 +5919,9 @@ export function buildToolCallsHandler(deps) {
|
|
|
5619
5919
|
// Resolved against the party the checkpoint carries (9.92.0).
|
|
5620
5920
|
const resolved = resolveTool(toolName, scope.pausedToolParty);
|
|
5621
5921
|
const tool = resolved.tool;
|
|
5622
|
-
|
|
5922
|
+
/** What the call's `execute` saw — its script row reads it. */
|
|
5923
|
+
const scriptSeen = {};
|
|
5924
|
+
const dispatched = await resolveCredentialAndExecute(scope, resolved, toolName, args, toolCallId, iteration, env, undefined, scriptSeen);
|
|
5623
5925
|
const result = dispatched.result;
|
|
5624
5926
|
const error = dispatched.error;
|
|
5625
5927
|
let modelResult;
|
|
@@ -5692,6 +5994,14 @@ export function buildToolCallsHandler(deps) {
|
|
|
5692
5994
|
...(consentEnvelope?.status !== undefined && { status: consentEnvelope.status }),
|
|
5693
5995
|
});
|
|
5694
5996
|
await judgeLanded(scope, deps.findingsJudge, dispatched.executed === true, { toolName, result: consentResultStr, toolCallId }, iteration, turnStampOf(scope));
|
|
5997
|
+
fileResumedScript(scope, {
|
|
5998
|
+
toolName,
|
|
5999
|
+
toolCallId,
|
|
6000
|
+
iteration,
|
|
6001
|
+
carried: args,
|
|
6002
|
+
entered: dispatched.executed === true,
|
|
6003
|
+
seen: scriptSeen,
|
|
6004
|
+
});
|
|
5695
6005
|
emitToolEnd(scope, toolName, {
|
|
5696
6006
|
toolCallId,
|
|
5697
6007
|
result: consentCapped.result,
|
|
@@ -5806,6 +6116,17 @@ export function buildToolCallsHandler(deps) {
|
|
|
5806
6116
|
// The person's answer IS the tool's result (the handler's contract
|
|
5807
6117
|
// above), so it ran by definition.
|
|
5808
6118
|
await judgeLanded(scope, deps.findingsJudge, true, { toolName, result: resultStr, toolCallId }, iteration, turnStampOf(scope));
|
|
6119
|
+
// The tool asked a person from inside `execute`, and the answer IS its
|
|
6120
|
+
// result (the handler's contract): the call returned, and no runner
|
|
6121
|
+
// reported an execution — `returned`, never `completed`.
|
|
6122
|
+
fileResumedScript(scope, {
|
|
6123
|
+
toolName,
|
|
6124
|
+
toolCallId,
|
|
6125
|
+
iteration,
|
|
6126
|
+
carried: args,
|
|
6127
|
+
entered: true,
|
|
6128
|
+
seen: {},
|
|
6129
|
+
});
|
|
5809
6130
|
emitToolEnd(scope, toolName, {
|
|
5810
6131
|
toolCallId,
|
|
5811
6132
|
// The REAL value the pause returned, not what a rule let the model read
|