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.
Files changed (405) hide show
  1. package/CAPABILITIES.md +1 -0
  2. package/dist/adapters/code/output.js +8 -29
  3. package/dist/adapters/code/output.js.map +1 -1
  4. package/dist/adapters/observability/audit.js +151 -159
  5. package/dist/adapters/observability/audit.js.map +1 -1
  6. package/dist/adapters/observability/auditBounding.js +411 -0
  7. package/dist/adapters/observability/auditBounding.js.map +1 -0
  8. package/dist/adapters/observability/auditKeptByContract.js +107 -0
  9. package/dist/adapters/observability/auditKeptByContract.js.map +1 -0
  10. package/dist/adapters/observability/auditShapes.js +1731 -0
  11. package/dist/adapters/observability/auditShapes.js.map +1 -0
  12. package/dist/answer-account/account.js +92 -15
  13. package/dist/answer-account/account.js.map +1 -1
  14. package/dist/answer-account/facts/calls.js +7 -9
  15. package/dist/answer-account/facts/calls.js.map +1 -1
  16. package/dist/answer-account/facts/checked.js +2 -2
  17. package/dist/answer-account/facts/checked.js.map +1 -1
  18. package/dist/answer-account/facts/common.js +40 -7
  19. package/dist/answer-account/facts/common.js.map +1 -1
  20. package/dist/answer-account/facts/found.js +1 -1
  21. package/dist/answer-account/facts/found.js.map +1 -1
  22. package/dist/answer-account/facts/howSure.js +21 -3
  23. package/dist/answer-account/facts/howSure.js.map +1 -1
  24. package/dist/answer-account/facts/inView.js +3 -4
  25. package/dist/answer-account/facts/inView.js.map +1 -1
  26. package/dist/answer-account/facts/pausedLeg.js +1 -1
  27. package/dist/answer-account/facts/pausedLeg.js.map +1 -1
  28. package/dist/answer-account/facts/scripts.js +222 -0
  29. package/dist/answer-account/facts/scripts.js.map +1 -0
  30. package/dist/answer-account/facts/understood.js +5 -5
  31. package/dist/answer-account/facts/understood.js.map +1 -1
  32. package/dist/answer-account/pointerKey.js +1 -1
  33. package/dist/answer-account/shown.js +25 -7
  34. package/dist/answer-account/shown.js.map +1 -1
  35. package/dist/answer-account/signals.js +1 -1
  36. package/dist/answer-account/signals.js.map +1 -1
  37. package/dist/answer-account/size.js +152 -0
  38. package/dist/answer-account/size.js.map +1 -0
  39. package/dist/answer-account/templates.js +39 -1
  40. package/dist/answer-account/templates.js.map +1 -1
  41. package/dist/core/Agent.js +25 -1
  42. package/dist/core/Agent.js.map +1 -1
  43. package/dist/core/agent/AgentBuilder.js +85 -1
  44. package/dist/core/agent/AgentBuilder.js.map +1 -1
  45. package/dist/core/agent/arguments/ask.js +85 -2
  46. package/dist/core/agent/arguments/ask.js.map +1 -1
  47. package/dist/core/agent/arguments/partialWindow.js +120 -0
  48. package/dist/core/agent/arguments/partialWindow.js.map +1 -0
  49. package/dist/core/agent/assessment/assess.js +37 -0
  50. package/dist/core/agent/assessment/assess.js.map +1 -1
  51. package/dist/core/agent/assessment/compose.js +5 -1
  52. package/dist/core/agent/assessment/compose.js.map +1 -1
  53. package/dist/core/agent/assessment/reasons.js +7 -0
  54. package/dist/core/agent/assessment/reasons.js.map +1 -1
  55. package/dist/core/agent/assessment/witness.js +37 -4
  56. package/dist/core/agent/assessment/witness.js.map +1 -1
  57. package/dist/core/agent/buildAgentChart.js.map +1 -1
  58. package/dist/core/agent/evidence/codeRegions.js +279 -0
  59. package/dist/core/agent/evidence/codeRegions.js.map +1 -0
  60. package/dist/core/agent/evidence/gate.js +13 -2
  61. package/dist/core/agent/evidence/gate.js.map +1 -1
  62. package/dist/core/agent/evidence/recovery.js +11 -2
  63. package/dist/core/agent/evidence/recovery.js.map +1 -1
  64. package/dist/core/agent/findings/types.js.map +1 -1
  65. package/dist/core/agent/scripts/attachment.js +375 -0
  66. package/dist/core/agent/scripts/attachment.js.map +1 -0
  67. package/dist/core/agent/scripts/inert.js +88 -0
  68. package/dist/core/agent/scripts/inert.js.map +1 -0
  69. package/dist/core/agent/scripts/judge.js +41 -0
  70. package/dist/core/agent/scripts/judge.js.map +1 -0
  71. package/dist/core/agent/scripts/label.js +143 -0
  72. package/dist/core/agent/scripts/label.js.map +1 -0
  73. package/dist/core/agent/scripts/match.js +233 -0
  74. package/dist/core/agent/scripts/match.js.map +1 -0
  75. package/dist/core/agent/scripts/recovery.js +81 -0
  76. package/dist/core/agent/scripts/recovery.js.map +1 -0
  77. package/dist/core/agent/scripts/rows.js +221 -0
  78. package/dist/core/agent/scripts/rows.js.map +1 -0
  79. package/dist/core/agent/scripts/types.js +22 -0
  80. package/dist/core/agent/scripts/types.js.map +1 -0
  81. package/dist/core/agent/scripts/wrapper.js +63 -0
  82. package/dist/core/agent/scripts/wrapper.js.map +1 -0
  83. package/dist/core/agent/stages/argumentAsk.js +161 -19
  84. package/dist/core/agent/stages/argumentAsk.js.map +1 -1
  85. package/dist/core/agent/stages/evidenceRecheck.js +4 -1
  86. package/dist/core/agent/stages/evidenceRecheck.js.map +1 -1
  87. package/dist/core/agent/stages/prepareFinal.js +65 -10
  88. package/dist/core/agent/stages/prepareFinal.js.map +1 -1
  89. package/dist/core/agent/stages/route.js +53 -3
  90. package/dist/core/agent/stages/route.js.map +1 -1
  91. package/dist/core/agent/stages/seed.js +14 -1
  92. package/dist/core/agent/stages/seed.js.map +1 -1
  93. package/dist/core/agent/stages/toolCalls.js +339 -18
  94. package/dist/core/agent/stages/toolCalls.js.map +1 -1
  95. package/dist/core/codeRunnerTool.js +32 -3
  96. package/dist/core/codeRunnerTool.js.map +1 -1
  97. package/dist/core/runCheckpoint.js +19 -6
  98. package/dist/core/runCheckpoint.js.map +1 -1
  99. package/dist/esm/adapters/code/output.d.ts +1 -4
  100. package/dist/esm/adapters/code/output.js +3 -24
  101. package/dist/esm/adapters/code/output.js.map +1 -1
  102. package/dist/esm/adapters/observability/audit.d.ts +79 -12
  103. package/dist/esm/adapters/observability/audit.js +132 -142
  104. package/dist/esm/adapters/observability/audit.js.map +1 -1
  105. package/dist/esm/adapters/observability/auditBounding.d.ts +215 -0
  106. package/dist/esm/adapters/observability/auditBounding.js +390 -0
  107. package/dist/esm/adapters/observability/auditBounding.js.map +1 -0
  108. package/dist/esm/adapters/observability/auditKeptByContract.d.ts +65 -0
  109. package/dist/esm/adapters/observability/auditKeptByContract.js +103 -0
  110. package/dist/esm/adapters/observability/auditKeptByContract.js.map +1 -0
  111. package/dist/esm/adapters/observability/auditShapes.d.ts +78 -0
  112. package/dist/esm/adapters/observability/auditShapes.js +1726 -0
  113. package/dist/esm/adapters/observability/auditShapes.js.map +1 -0
  114. package/dist/esm/answer-account/account.js +91 -14
  115. package/dist/esm/answer-account/account.js.map +1 -1
  116. package/dist/esm/answer-account/facts/calls.d.ts +0 -2
  117. package/dist/esm/answer-account/facts/calls.js +1 -3
  118. package/dist/esm/answer-account/facts/calls.js.map +1 -1
  119. package/dist/esm/answer-account/facts/checked.js +2 -2
  120. package/dist/esm/answer-account/facts/checked.js.map +1 -1
  121. package/dist/esm/answer-account/facts/common.d.ts +16 -4
  122. package/dist/esm/answer-account/facts/common.js +38 -6
  123. package/dist/esm/answer-account/facts/common.js.map +1 -1
  124. package/dist/esm/answer-account/facts/found.js +2 -2
  125. package/dist/esm/answer-account/facts/found.js.map +1 -1
  126. package/dist/esm/answer-account/facts/howSure.d.ts +1 -1
  127. package/dist/esm/answer-account/facts/howSure.js +22 -4
  128. package/dist/esm/answer-account/facts/howSure.js.map +1 -1
  129. package/dist/esm/answer-account/facts/inView.js +1 -2
  130. package/dist/esm/answer-account/facts/inView.js.map +1 -1
  131. package/dist/esm/answer-account/facts/pausedLeg.js +2 -2
  132. package/dist/esm/answer-account/facts/pausedLeg.js.map +1 -1
  133. package/dist/esm/answer-account/facts/scripts.d.ts +34 -0
  134. package/dist/esm/answer-account/facts/scripts.js +218 -0
  135. package/dist/esm/answer-account/facts/scripts.js.map +1 -0
  136. package/dist/esm/answer-account/facts/understood.js +2 -2
  137. package/dist/esm/answer-account/facts/understood.js.map +1 -1
  138. package/dist/esm/answer-account/pointerKey.d.ts +1 -1
  139. package/dist/esm/answer-account/pointerKey.js +1 -1
  140. package/dist/esm/answer-account/shown.d.ts +9 -2
  141. package/dist/esm/answer-account/shown.js +25 -7
  142. package/dist/esm/answer-account/shown.js.map +1 -1
  143. package/dist/esm/answer-account/signals.js +2 -2
  144. package/dist/esm/answer-account/signals.js.map +1 -1
  145. package/dist/esm/answer-account/size.d.ts +59 -0
  146. package/dist/esm/answer-account/size.js +147 -0
  147. package/dist/esm/answer-account/size.js.map +1 -0
  148. package/dist/esm/answer-account/templates.d.ts +29 -1
  149. package/dist/esm/answer-account/templates.js +39 -1
  150. package/dist/esm/answer-account/templates.js.map +1 -1
  151. package/dist/esm/core/Agent.d.ts +8 -1
  152. package/dist/esm/core/Agent.js +25 -1
  153. package/dist/esm/core/Agent.js.map +1 -1
  154. package/dist/esm/core/agent/AgentBuilder.d.ts +52 -0
  155. package/dist/esm/core/agent/AgentBuilder.js +85 -1
  156. package/dist/esm/core/agent/AgentBuilder.js.map +1 -1
  157. package/dist/esm/core/agent/arguments/ask.d.ts +11 -0
  158. package/dist/esm/core/agent/arguments/ask.js +83 -1
  159. package/dist/esm/core/agent/arguments/ask.js.map +1 -1
  160. package/dist/esm/core/agent/arguments/partialWindow.d.ts +42 -0
  161. package/dist/esm/core/agent/arguments/partialWindow.js +111 -0
  162. package/dist/esm/core/agent/arguments/partialWindow.js.map +1 -0
  163. package/dist/esm/core/agent/assessment/assess.js +37 -0
  164. package/dist/esm/core/agent/assessment/assess.js.map +1 -1
  165. package/dist/esm/core/agent/assessment/compose.d.ts +3 -1
  166. package/dist/esm/core/agent/assessment/compose.js +5 -1
  167. package/dist/esm/core/agent/assessment/compose.js.map +1 -1
  168. package/dist/esm/core/agent/assessment/reasons.js +7 -0
  169. package/dist/esm/core/agent/assessment/reasons.js.map +1 -1
  170. package/dist/esm/core/agent/assessment/types.d.ts +12 -2
  171. package/dist/esm/core/agent/assessment/witness.d.ts +44 -4
  172. package/dist/esm/core/agent/assessment/witness.js +35 -3
  173. package/dist/esm/core/agent/assessment/witness.js.map +1 -1
  174. package/dist/esm/core/agent/buildAgentChart.d.ts +9 -0
  175. package/dist/esm/core/agent/buildAgentChart.js.map +1 -1
  176. package/dist/esm/core/agent/evidence/codeRegions.d.ts +130 -0
  177. package/dist/esm/core/agent/evidence/codeRegions.js +275 -0
  178. package/dist/esm/core/agent/evidence/codeRegions.js.map +1 -0
  179. package/dist/esm/core/agent/evidence/gate.d.ts +3 -0
  180. package/dist/esm/core/agent/evidence/gate.js +12 -2
  181. package/dist/esm/core/agent/evidence/gate.js.map +1 -1
  182. package/dist/esm/core/agent/evidence/recovery.d.ts +5 -1
  183. package/dist/esm/core/agent/evidence/recovery.js +11 -2
  184. package/dist/esm/core/agent/evidence/recovery.js.map +1 -1
  185. package/dist/esm/core/agent/evidence/types.d.ts +35 -0
  186. package/dist/esm/core/agent/findings/types.d.ts +3 -2
  187. package/dist/esm/core/agent/findings/types.js.map +1 -1
  188. package/dist/esm/core/agent/scripts/attachment.d.ts +179 -0
  189. package/dist/esm/core/agent/scripts/attachment.js +361 -0
  190. package/dist/esm/core/agent/scripts/attachment.js.map +1 -0
  191. package/dist/esm/core/agent/scripts/inert.d.ts +38 -0
  192. package/dist/esm/core/agent/scripts/inert.js +84 -0
  193. package/dist/esm/core/agent/scripts/inert.js.map +1 -0
  194. package/dist/esm/core/agent/scripts/judge.d.ts +36 -0
  195. package/dist/esm/core/agent/scripts/judge.js +37 -0
  196. package/dist/esm/core/agent/scripts/judge.js.map +1 -0
  197. package/dist/esm/core/agent/scripts/label.d.ts +103 -0
  198. package/dist/esm/core/agent/scripts/label.js +136 -0
  199. package/dist/esm/core/agent/scripts/label.js.map +1 -0
  200. package/dist/esm/core/agent/scripts/match.d.ts +99 -0
  201. package/dist/esm/core/agent/scripts/match.js +226 -0
  202. package/dist/esm/core/agent/scripts/match.js.map +1 -0
  203. package/dist/esm/core/agent/scripts/recovery.d.ts +54 -0
  204. package/dist/esm/core/agent/scripts/recovery.js +77 -0
  205. package/dist/esm/core/agent/scripts/recovery.js.map +1 -0
  206. package/dist/esm/core/agent/scripts/rows.d.ts +143 -0
  207. package/dist/esm/core/agent/scripts/rows.js +211 -0
  208. package/dist/esm/core/agent/scripts/rows.js.map +1 -0
  209. package/dist/esm/core/agent/scripts/types.d.ts +91 -0
  210. package/dist/esm/core/agent/scripts/types.js +21 -0
  211. package/dist/esm/core/agent/scripts/types.js.map +1 -0
  212. package/dist/esm/core/agent/scripts/wrapper.d.ts +36 -0
  213. package/dist/esm/core/agent/scripts/wrapper.js +58 -0
  214. package/dist/esm/core/agent/scripts/wrapper.js.map +1 -0
  215. package/dist/esm/core/agent/stages/argumentAsk.d.ts +4 -1
  216. package/dist/esm/core/agent/stages/argumentAsk.js +164 -22
  217. package/dist/esm/core/agent/stages/argumentAsk.js.map +1 -1
  218. package/dist/esm/core/agent/stages/evidenceRecheck.js +4 -1
  219. package/dist/esm/core/agent/stages/evidenceRecheck.js.map +1 -1
  220. package/dist/esm/core/agent/stages/prepareFinal.d.ts +11 -0
  221. package/dist/esm/core/agent/stages/prepareFinal.js +65 -10
  222. package/dist/esm/core/agent/stages/prepareFinal.js.map +1 -1
  223. package/dist/esm/core/agent/stages/route.js +53 -3
  224. package/dist/esm/core/agent/stages/route.js.map +1 -1
  225. package/dist/esm/core/agent/stages/seed.js +14 -1
  226. package/dist/esm/core/agent/stages/seed.js.map +1 -1
  227. package/dist/esm/core/agent/stages/toolCalls.d.ts +14 -0
  228. package/dist/esm/core/agent/stages/toolCalls.js +337 -16
  229. package/dist/esm/core/agent/stages/toolCalls.js.map +1 -1
  230. package/dist/esm/core/agent/types.d.ts +41 -0
  231. package/dist/esm/core/codeRunnerTool.d.ts +23 -0
  232. package/dist/esm/core/codeRunnerTool.js +31 -2
  233. package/dist/esm/core/codeRunnerTool.js.map +1 -1
  234. package/dist/esm/core/runCheckpoint.js +16 -3
  235. package/dist/esm/core/runCheckpoint.js.map +1 -1
  236. package/dist/esm/events/payloads.d.ts +46 -1
  237. package/dist/esm/hosting/answerAccounts.js +4 -2
  238. package/dist/esm/hosting/answerAccounts.js.map +1 -1
  239. package/dist/esm/hosting/artifactWire.d.ts +3 -2
  240. package/dist/esm/hosting/artifactWire.js.map +1 -1
  241. package/dist/esm/index.d.ts +3 -1
  242. package/dist/esm/index.js.map +1 -1
  243. package/dist/esm/lib/boundedJson.d.ts +24 -0
  244. package/dist/esm/lib/boundedJson.js +45 -2
  245. package/dist/esm/lib/boundedJson.js.map +1 -1
  246. package/dist/esm/lib/scriptRecord.d.ts +139 -0
  247. package/dist/esm/lib/scriptRecord.js +18 -0
  248. package/dist/esm/lib/scriptRecord.js.map +1 -0
  249. package/dist/esm/lib/utf8.d.ts +36 -0
  250. package/dist/esm/lib/utf8.js +70 -0
  251. package/dist/esm/lib/utf8.js.map +1 -0
  252. package/dist/esm/mcp/toolExtras.d.ts +9 -0
  253. package/dist/esm/mcp/toolExtras.js +6 -0
  254. package/dist/esm/mcp/toolExtras.js.map +1 -1
  255. package/dist/esm/redaction/conversation.js +10 -0
  256. package/dist/esm/redaction/conversation.js.map +1 -1
  257. package/dist/esm/redaction/knownStrings.js +34 -0
  258. package/dist/esm/redaction/knownStrings.js.map +1 -1
  259. package/dist/esm/semantics/coverage/answer.d.ts +12 -1
  260. package/dist/esm/semantics/coverage/answer.js +26 -3
  261. package/dist/esm/semantics/coverage/answer.js.map +1 -1
  262. package/dist/esm/tools/script.d.ts +85 -0
  263. package/dist/esm/tools/script.js +157 -0
  264. package/dist/esm/tools/script.js.map +1 -0
  265. package/dist/esm/tools/tools.d.ts +30 -0
  266. package/dist/esm/tools/tools.js +4 -0
  267. package/dist/esm/tools/tools.js.map +1 -1
  268. package/dist/hosting/answerAccounts.js +4 -2
  269. package/dist/hosting/answerAccounts.js.map +1 -1
  270. package/dist/hosting/artifactWire.js.map +1 -1
  271. package/dist/index.js.map +1 -1
  272. package/dist/lib/boundedJson.js +48 -3
  273. package/dist/lib/boundedJson.js.map +1 -1
  274. package/dist/lib/scriptRecord.js +19 -0
  275. package/dist/lib/scriptRecord.js.map +1 -0
  276. package/dist/lib/utf8.js +77 -0
  277. package/dist/lib/utf8.js.map +1 -0
  278. package/dist/mcp/toolExtras.js +6 -0
  279. package/dist/mcp/toolExtras.js.map +1 -1
  280. package/dist/redaction/conversation.js +10 -0
  281. package/dist/redaction/conversation.js.map +1 -1
  282. package/dist/redaction/knownStrings.js +34 -0
  283. package/dist/redaction/knownStrings.js.map +1 -1
  284. package/dist/semantics/coverage/answer.js +26 -3
  285. package/dist/semantics/coverage/answer.js.map +1 -1
  286. package/dist/tools/script.js +163 -0
  287. package/dist/tools/script.js.map +1 -0
  288. package/dist/tools/tools.js +4 -0
  289. package/dist/tools/tools.js.map +1 -1
  290. package/dist/types/adapters/code/output.d.ts +1 -4
  291. package/dist/types/adapters/code/output.d.ts.map +1 -1
  292. package/dist/types/adapters/observability/audit.d.ts +79 -12
  293. package/dist/types/adapters/observability/audit.d.ts.map +1 -1
  294. package/dist/types/adapters/observability/auditBounding.d.ts +216 -0
  295. package/dist/types/adapters/observability/auditBounding.d.ts.map +1 -0
  296. package/dist/types/adapters/observability/auditKeptByContract.d.ts +66 -0
  297. package/dist/types/adapters/observability/auditKeptByContract.d.ts.map +1 -0
  298. package/dist/types/adapters/observability/auditShapes.d.ts +79 -0
  299. package/dist/types/adapters/observability/auditShapes.d.ts.map +1 -0
  300. package/dist/types/answer-account/account.d.ts.map +1 -1
  301. package/dist/types/answer-account/facts/calls.d.ts +0 -2
  302. package/dist/types/answer-account/facts/calls.d.ts.map +1 -1
  303. package/dist/types/answer-account/facts/checked.d.ts.map +1 -1
  304. package/dist/types/answer-account/facts/common.d.ts +16 -4
  305. package/dist/types/answer-account/facts/common.d.ts.map +1 -1
  306. package/dist/types/answer-account/facts/found.d.ts.map +1 -1
  307. package/dist/types/answer-account/facts/howSure.d.ts +1 -1
  308. package/dist/types/answer-account/facts/howSure.d.ts.map +1 -1
  309. package/dist/types/answer-account/facts/inView.d.ts.map +1 -1
  310. package/dist/types/answer-account/facts/pausedLeg.d.ts.map +1 -1
  311. package/dist/types/answer-account/facts/scripts.d.ts +35 -0
  312. package/dist/types/answer-account/facts/scripts.d.ts.map +1 -0
  313. package/dist/types/answer-account/facts/understood.d.ts.map +1 -1
  314. package/dist/types/answer-account/pointerKey.d.ts +1 -1
  315. package/dist/types/answer-account/shown.d.ts +9 -2
  316. package/dist/types/answer-account/shown.d.ts.map +1 -1
  317. package/dist/types/answer-account/signals.d.ts.map +1 -1
  318. package/dist/types/answer-account/size.d.ts +60 -0
  319. package/dist/types/answer-account/size.d.ts.map +1 -0
  320. package/dist/types/answer-account/templates.d.ts +29 -1
  321. package/dist/types/answer-account/templates.d.ts.map +1 -1
  322. package/dist/types/core/Agent.d.ts +8 -1
  323. package/dist/types/core/Agent.d.ts.map +1 -1
  324. package/dist/types/core/agent/AgentBuilder.d.ts +52 -0
  325. package/dist/types/core/agent/AgentBuilder.d.ts.map +1 -1
  326. package/dist/types/core/agent/arguments/ask.d.ts +11 -0
  327. package/dist/types/core/agent/arguments/ask.d.ts.map +1 -1
  328. package/dist/types/core/agent/arguments/partialWindow.d.ts +43 -0
  329. package/dist/types/core/agent/arguments/partialWindow.d.ts.map +1 -0
  330. package/dist/types/core/agent/assessment/assess.d.ts.map +1 -1
  331. package/dist/types/core/agent/assessment/compose.d.ts +3 -1
  332. package/dist/types/core/agent/assessment/compose.d.ts.map +1 -1
  333. package/dist/types/core/agent/assessment/reasons.d.ts.map +1 -1
  334. package/dist/types/core/agent/assessment/types.d.ts +12 -2
  335. package/dist/types/core/agent/assessment/types.d.ts.map +1 -1
  336. package/dist/types/core/agent/assessment/witness.d.ts +44 -4
  337. package/dist/types/core/agent/assessment/witness.d.ts.map +1 -1
  338. package/dist/types/core/agent/buildAgentChart.d.ts +9 -0
  339. package/dist/types/core/agent/buildAgentChart.d.ts.map +1 -1
  340. package/dist/types/core/agent/evidence/codeRegions.d.ts +131 -0
  341. package/dist/types/core/agent/evidence/codeRegions.d.ts.map +1 -0
  342. package/dist/types/core/agent/evidence/gate.d.ts +3 -0
  343. package/dist/types/core/agent/evidence/gate.d.ts.map +1 -1
  344. package/dist/types/core/agent/evidence/recovery.d.ts +5 -1
  345. package/dist/types/core/agent/evidence/recovery.d.ts.map +1 -1
  346. package/dist/types/core/agent/evidence/types.d.ts +35 -0
  347. package/dist/types/core/agent/evidence/types.d.ts.map +1 -1
  348. package/dist/types/core/agent/findings/types.d.ts +3 -2
  349. package/dist/types/core/agent/findings/types.d.ts.map +1 -1
  350. package/dist/types/core/agent/scripts/attachment.d.ts +180 -0
  351. package/dist/types/core/agent/scripts/attachment.d.ts.map +1 -0
  352. package/dist/types/core/agent/scripts/inert.d.ts +39 -0
  353. package/dist/types/core/agent/scripts/inert.d.ts.map +1 -0
  354. package/dist/types/core/agent/scripts/judge.d.ts +37 -0
  355. package/dist/types/core/agent/scripts/judge.d.ts.map +1 -0
  356. package/dist/types/core/agent/scripts/label.d.ts +104 -0
  357. package/dist/types/core/agent/scripts/label.d.ts.map +1 -0
  358. package/dist/types/core/agent/scripts/match.d.ts +100 -0
  359. package/dist/types/core/agent/scripts/match.d.ts.map +1 -0
  360. package/dist/types/core/agent/scripts/recovery.d.ts +55 -0
  361. package/dist/types/core/agent/scripts/recovery.d.ts.map +1 -0
  362. package/dist/types/core/agent/scripts/rows.d.ts +144 -0
  363. package/dist/types/core/agent/scripts/rows.d.ts.map +1 -0
  364. package/dist/types/core/agent/scripts/types.d.ts +92 -0
  365. package/dist/types/core/agent/scripts/types.d.ts.map +1 -0
  366. package/dist/types/core/agent/scripts/wrapper.d.ts +37 -0
  367. package/dist/types/core/agent/scripts/wrapper.d.ts.map +1 -0
  368. package/dist/types/core/agent/stages/argumentAsk.d.ts +4 -1
  369. package/dist/types/core/agent/stages/argumentAsk.d.ts.map +1 -1
  370. package/dist/types/core/agent/stages/evidenceRecheck.d.ts.map +1 -1
  371. package/dist/types/core/agent/stages/prepareFinal.d.ts +11 -0
  372. package/dist/types/core/agent/stages/prepareFinal.d.ts.map +1 -1
  373. package/dist/types/core/agent/stages/route.d.ts.map +1 -1
  374. package/dist/types/core/agent/stages/seed.d.ts.map +1 -1
  375. package/dist/types/core/agent/stages/toolCalls.d.ts +14 -0
  376. package/dist/types/core/agent/stages/toolCalls.d.ts.map +1 -1
  377. package/dist/types/core/agent/types.d.ts +41 -0
  378. package/dist/types/core/agent/types.d.ts.map +1 -1
  379. package/dist/types/core/codeRunnerTool.d.ts +23 -0
  380. package/dist/types/core/codeRunnerTool.d.ts.map +1 -1
  381. package/dist/types/core/runCheckpoint.d.ts.map +1 -1
  382. package/dist/types/events/payloads.d.ts +46 -1
  383. package/dist/types/events/payloads.d.ts.map +1 -1
  384. package/dist/types/hosting/answerAccounts.d.ts.map +1 -1
  385. package/dist/types/hosting/artifactWire.d.ts +3 -2
  386. package/dist/types/hosting/artifactWire.d.ts.map +1 -1
  387. package/dist/types/index.d.ts +3 -1
  388. package/dist/types/index.d.ts.map +1 -1
  389. package/dist/types/lib/boundedJson.d.ts +24 -0
  390. package/dist/types/lib/boundedJson.d.ts.map +1 -1
  391. package/dist/types/lib/scriptRecord.d.ts +140 -0
  392. package/dist/types/lib/scriptRecord.d.ts.map +1 -0
  393. package/dist/types/lib/utf8.d.ts +37 -0
  394. package/dist/types/lib/utf8.d.ts.map +1 -0
  395. package/dist/types/mcp/toolExtras.d.ts +9 -0
  396. package/dist/types/mcp/toolExtras.d.ts.map +1 -1
  397. package/dist/types/redaction/conversation.d.ts.map +1 -1
  398. package/dist/types/redaction/knownStrings.d.ts.map +1 -1
  399. package/dist/types/semantics/coverage/answer.d.ts +12 -1
  400. package/dist/types/semantics/coverage/answer.d.ts.map +1 -1
  401. package/dist/types/tools/script.d.ts +86 -0
  402. package/dist/types/tools/script.d.ts.map +1 -0
  403. package/dist/types/tools/tools.d.ts +30 -0
  404. package/dist/types/tools/tools.d.ts.map +1 -1
  405. package/package.json +2 -1
@@ -0,0 +1,1726 @@
1
+ /**
2
+ * auditShapes — WHAT the audit chain's bounded mode keeps of each event: one
3
+ * shape per registered event type, every field of its payload ruled.
4
+ *
5
+ * Pattern: a declarative table, total over the registry
6
+ * (`{ [T in keyof AgentfootprintEventMap]-?: BoundRule }`), built from
7
+ * the combinators in `auditBounding.ts`.
8
+ * Role: the bounding layer's data. `audit.ts` asks it for every event in
9
+ * `payloadMode: 'bounded'`; an event type it does not know is
10
+ * `unknownEventShape` — every field a marker.
11
+ * Emits: N/A.
12
+ *
13
+ * A new event type, or a new field on a payload, does not compile until it is
14
+ * classified here. Content (what a person, the model, a tool or the data
15
+ * wrote, or a message composed from it) is a marker; structure (ids, names,
16
+ * kinds, codes, verdicts, counts, the library's own sentences, the words the
17
+ * app declared up front) is kept — and every kept value is CHECKED at runtime
18
+ * as the kind its type declares: `num`, `bool`, `str` (an open string: an id,
19
+ * a name, a label), `oneOf` (a closed union: exactly its words). No container
20
+ * is kept whole; each is spelled out field by field, so a child its type does
21
+ * not declare is a marker. The type walker
22
+ * (`test/type-regressions/AuditBoundingDepth.test.ts`) holds every rule here
23
+ * to the type beneath it; the runtime sweep
24
+ * (`test/observability-providers/audit-bounded-sweep.test.ts`) hands every rule
25
+ * what its kind forbids.
26
+ *
27
+ * The positions a record keeps although their value may come from the run —
28
+ * meta's who, decision evidence, a policy's tag, an app's reason word, a seen
29
+ * tool's name — are the rules `auditKeptByContract.ts` names, placed here.
30
+ *
31
+ * `audit.ts` looks an event's shape up in `eventShapeTable` — a `Map`, so an
32
+ * event NAME is never a key into a plain object (`constructor`, `__proto__`).
33
+ */
34
+ import { blocksMarker, bool, charsMarker, either, keysMarker, listOf, messagesMarker, nullOr, num, oneOf, orList, recordOf, shapeOf, str, summariesMarker, typeMarker, } from './auditBounding.js';
35
+ import { appReasonWord, decisionSummary, declaredValue, metaIdentity, policyReasonTag, routeEvidence, seenToolName, } from './auditKeptByContract.js';
36
+ const SCRIPT_LABELS = [
37
+ 'submitted',
38
+ 'returned',
39
+ 'reported-success',
40
+ 'reported-failure',
41
+ 'completed',
42
+ 'completed-with-failure',
43
+ 'outcome-unknown',
44
+ ];
45
+ /** A submitted program's attached record: only its text is content. */
46
+ const boundShownScript = shapeOf({
47
+ toolCallId: str,
48
+ dispatch: num,
49
+ tool: str,
50
+ language: str,
51
+ label: oneOf(...SCRIPT_LABELS),
52
+ exitCode: num,
53
+ resultWithheld: oneOf('over-ceiling'),
54
+ rewritten: oneOf(true),
55
+ bytes: num,
56
+ lines: num,
57
+ truncated: shapeOf({ shownBytes: num }),
58
+ text: charsMarker,
59
+ });
60
+ /** Attachment summary: preserve every declared field, check every runtime child. */
61
+ export const boundScripts = shapeOf({
62
+ shown: listOf(boundShownScript),
63
+ omitted: num,
64
+ closedFence: shapeOf({
65
+ char: oneOf('backtick', 'tilde'),
66
+ length: num,
67
+ }),
68
+ withheldFromText: oneOf(true),
69
+ });
70
+ /** Match verdicts contain labels and references, never the program. */
71
+ const boundScriptsVerdict = shapeOf({
72
+ blocks: listOf(shapeOf({
73
+ block: num,
74
+ label: oneOf(...SCRIPT_LABELS, 'unmatched'),
75
+ exitCode: num,
76
+ toolCallId: str,
77
+ tool: str,
78
+ dispatch: num,
79
+ alsoMatches: num,
80
+ reason: oneOf('no-submission-this-turn', 'over-size', 'kept-out'),
81
+ })),
82
+ earlierTurnRows: num,
83
+ regionsDropped: num,
84
+ scriptsDropped: num,
85
+ });
86
+ // ─── Shared pieces: coverage, periods, witnesses ─────────────────────
87
+ /** One coverage item: the tool author's prose (`what`, `why`, `short`), and its `kind`. */
88
+ const boundCoverageItem = shapeOf({
89
+ what: charsMarker,
90
+ why: charsMarker,
91
+ short: charsMarker,
92
+ kind: oneOf('existence', 'scope'),
93
+ });
94
+ /** What a read found still running: the tool author's prose, and how many things it stands for. */
95
+ const boundInProgressItem = shapeOf({
96
+ what: charsMarker,
97
+ why: charsMarker,
98
+ short: charsMarker,
99
+ count: num,
100
+ });
101
+ /** A declared window: both instants are the tool's own values. */
102
+ const boundInstants = shapeOf({
103
+ from: charsMarker,
104
+ to: charsMarker,
105
+ });
106
+ /** What the store holds — a window, or the library's word `'unknown'` (the tool
107
+ * said it cannot vouch for the store), which stays. */
108
+ const boundHeld = either(oneOf('unknown'), boundInstants);
109
+ /** A declared period: its instants are the tool's values. */
110
+ const boundPeriod = shapeOf({
111
+ queried: boundInstants,
112
+ held: boundHeld,
113
+ readAt: charsMarker,
114
+ });
115
+ /** An absence's source and its clock, as the tool declared them. */
116
+ const boundProvenance = shapeOf({
117
+ measuredAt: charsMarker,
118
+ source: charsMarker,
119
+ ageSeconds: num,
120
+ sourceExportDate: charsMarker,
121
+ });
122
+ /**
123
+ * What the library composed for a `search` tool. Kept: facets ride BY
124
+ * REFERENCE, and a gap's words name arguments and verdicts, never a value
125
+ * (`CoverageGapPayload`'s contract) — a `'prose'` gap's words are the ones
126
+ * the search declaration states up front.
127
+ */
128
+ /** What a gap bears on: a facet word, or the filter and values the search declaration states. */
129
+ const boundBearsFilter = shapeOf({
130
+ filter: str,
131
+ values: listOf(either(str, num, bool)),
132
+ });
133
+ const boundBears = either(oneOf('completeness', 'period', 'population', 'source'), boundBearsFilter);
134
+ const boundComposition = shapeOf({
135
+ origin: oneOf('local', 'remote'),
136
+ resultId: str,
137
+ complete: bool,
138
+ facets: listOf(shapeOf({
139
+ facet: oneOf('filter', 'names', 'period', 'population', 'source', 'subject'),
140
+ from: oneOf('call', 'default', 'host', 'result'),
141
+ ref: shapeOf({ resultId: str, argument: str }),
142
+ any: bool,
143
+ })),
144
+ gaps: listOf(shapeOf({
145
+ kind: oneOf('argument-unsent', 'cap-reached', 'credential-limited', 'match', 'paged', 'partial', 'period', 'prose', 'ranking', 'scope'),
146
+ what: str,
147
+ why: str,
148
+ bears: boundBears,
149
+ argument: str,
150
+ })),
151
+ });
152
+ /**
153
+ * A skill guard's evaluation: the edge, the call, the verdict, and per
154
+ * condition the key, operator and value the app DECLARED — and the engine's
155
+ * summary of the value it read (`actualSummary`), the decision evidence the
156
+ * chain keeps by contract (redaction-aware).
157
+ */
158
+ const boundGuard = shapeOf({
159
+ from: str,
160
+ to: str,
161
+ toolName: str,
162
+ toolCallId: str,
163
+ verdict: bool,
164
+ conditions: listOf(shapeOf({
165
+ key: str,
166
+ op: str,
167
+ value: orList(declaredValue),
168
+ // The engine's decision evidence: a summary of the value a guard read.
169
+ actualSummary: decisionSummary,
170
+ passed: bool,
171
+ })),
172
+ });
173
+ /** What an integrity finding is about: a kind and an id. */
174
+ const boundSubject = shapeOf({ kind: str, id: str });
175
+ /** What a message said that won a routing match: the text is the person's; the
176
+ * keyword is the app's declared vocabulary. */
177
+ const boundWitness = shapeOf({
178
+ text: charsMarker,
179
+ keyword: str,
180
+ });
181
+ /**
182
+ * A typed answer's limits: the three lists, the declared periods, what a read
183
+ * found still running and the values an `assume` rule filled. Every sentence
184
+ * and value is a marker; the tool and argument NAMES, the call ids, counts,
185
+ * kinds and the library's `'unknown'` stay.
186
+ */
187
+ export const boundAnswerCoverage = shapeOf({
188
+ checked: listOf(boundCoverageItem),
189
+ notChecked: listOf(boundCoverageItem),
190
+ cannotCover: listOf(boundCoverageItem),
191
+ periods: listOf(shapeOf({
192
+ toolName: str,
193
+ toolCallId: str,
194
+ queried: boundInstants,
195
+ held: boundHeld,
196
+ readAt: charsMarker,
197
+ })),
198
+ inProgress: listOf(shapeOf({
199
+ toolName: str,
200
+ toolCallId: str,
201
+ items: listOf(boundInProgressItem),
202
+ })),
203
+ assumed: listOf(shapeOf({
204
+ toolName: str,
205
+ argument: str,
206
+ value: charsMarker,
207
+ hidden: bool,
208
+ })),
209
+ });
210
+ /**
211
+ * A typed answer's negatives: each statement and the population it is about
212
+ * are markers; the answer field's declared name, the codes, verdicts, ids,
213
+ * tool names and counts stay.
214
+ */
215
+ export const boundAnswerNegatives = shapeOf({
216
+ field: str,
217
+ version: str,
218
+ delivery: oneOf('as-checked', 'fallback', 'recorded'),
219
+ claims: listOf(shapeOf({
220
+ kind: oneOf('complete', 'none', 'not-found', 'unknown'),
221
+ about: charsMarker,
222
+ restsOn: listOf(str),
223
+ statement: charsMarker,
224
+ delivery: oneOf('record-composed'),
225
+ version: str,
226
+ })),
227
+ checks: listOf(shapeOf({
228
+ id: str,
229
+ path: str,
230
+ index: num,
231
+ kind: oneOf('complete', 'none', 'not-found', 'unknown'),
232
+ notes: listOf(oneOf('absence-kind-normalized')),
233
+ // The payload declares any string: a checker's code.
234
+ code: str,
235
+ disposition: oneOf('checked-fail', 'not-applicable', 'unreachable'),
236
+ tools: listOf(str),
237
+ results: listOf(str),
238
+ staleSince: shapeOf({
239
+ turn: num,
240
+ readAt: str,
241
+ }),
242
+ })),
243
+ coverage: listOf(shapeOf({ tool: str, checked: num })),
244
+ actions: listOf(shapeOf({
245
+ tool: str,
246
+ outcome: oneOf('error', 'not-run', 'ok'),
247
+ })),
248
+ });
249
+ /** A shape for one event's whole payload, exhaustive over that event's payload type. */
250
+ const eventShape = (rules) => shapeOf(rules);
251
+ /** The pause reason the library writes itself — its own words, kept. */
252
+ const FIXED_PAUSE_REASON = 'stage requested pause';
253
+ /** Why a turn's answer stands where it does — the assessment's own words. */
254
+ const boundAssessmentReasons = listOf(oneOf('answer-check-failed', 'argument-asked', 'argument-assumed', 'argument-read', 'argument-unverified', 'asked', 'check-unreachable', 'claim-exceeds-search', 'coverage-gap', 'declaration-overclaimed', 'declared-absent', 'derived-from-reading', 'empty-undeclared', 'negative-prose-unverified', 'period-beyond-retention', 'period-differs-from-asked', 'period-not-held', 'period-partly-held', 'period-undeclared', 'period-unknown', 'script-unmatched', 'sources-conflict', 'steps-unfinished', 'stopped-early', 'value-contingent', 'value-survived-revision', 'value-unsupported'));
255
+ /** Which honesty checks ran, and over how much. */
256
+ const boundAssessmentChecks = listOf(shapeOf({
257
+ layer: oneOf(1, 2, 3, 4),
258
+ check: oneOf('answer-checks', 'argument-rules', 'argument-sources', 'names-and-numbers', 'result-period', 'result-shape', 'script-match', 'tool-coverage'),
259
+ ran: num,
260
+ of: num,
261
+ }));
262
+ /** A turn's answer assessment: verdict words, reason codes and check counts. */
263
+ const boundAnswerAssessment = shapeOf({
264
+ assessment: oneOf('known', 'not-applicable', 'unknown', 'unrefuted'),
265
+ standing: oneOf('ask', 'consistent', 'known', 'not-assessed', 'not-sure'),
266
+ reasons: boundAssessmentReasons,
267
+ checked: boundAssessmentChecks,
268
+ });
269
+ /** One context source's share of a slot: characters and pieces. */
270
+ const boundSourceShare = shapeOf({ chars: num, count: num });
271
+ /** A slot's share by context source — every source the library declares, by name. */
272
+ const boundSourceBreakdown = shapeOf({
273
+ assistant: boundSourceShare,
274
+ base: boundSourceShare,
275
+ custom: boundSourceShare,
276
+ 'evidence-recovery': boundSourceShare,
277
+ fact: boundSourceShare,
278
+ findings: boundSourceShare,
279
+ instructions: boundSourceShare,
280
+ memory: boundSourceShare,
281
+ ontology: boundSourceShare,
282
+ rag: boundSourceShare,
283
+ registry: boundSourceShare,
284
+ skill: boundSourceShare,
285
+ steering: boundSourceShare,
286
+ 'tool-result': boundSourceShare,
287
+ user: boundSourceShare,
288
+ });
289
+ const requestReason = oneOf('answered', 'cancelled', 'changes-without-key', 'exhausted', 'no-time-left', 'not-permitted', 'not-replayable', 'not-retryable', 'retryable', 'wait-limit');
290
+ const requestFailure = oneOf('auth', 'network', 'permanent', 'rate-limited', 'server', 'timeout', 'unknown');
291
+ const requestRefusalKind = oneOf('session-busy', 'throttle');
292
+ const requestEffect = oneOf('applied', 'none', 'unknown');
293
+ /** A request's error: one of the library's two fixed sentences, and a category — never the error itself. */
294
+ const requestError = shapeOf({
295
+ message: oneOf('The call ran out of time before an answer arrived.', 'The request failed before an answer arrived. Its error is not kept.'),
296
+ code: requestFailure,
297
+ });
298
+ /** One try of a tool's request: outcome, reason, timing and the library's categories. */
299
+ const boundRequestAttempt = shapeOf({
300
+ attempt: num,
301
+ outcome: oneOf('answered', 'cut', 'failed', 'refused', 'timed-out'),
302
+ reason: requestReason,
303
+ status: num,
304
+ kind: requestRefusalKind,
305
+ failure: requestFailure,
306
+ waitMs: num,
307
+ retryAfterMs: num,
308
+ error: requestError,
309
+ remote: oneOf('unknown'),
310
+ effect: requestEffect,
311
+ permission: shapeOf({
312
+ by: oneOf('adapter', 'compatibility', 'declaration'),
313
+ on: oneOf('network', 'throttle'),
314
+ assumes: oneOf('refused-before-execution'),
315
+ deduplicated: bool,
316
+ }),
317
+ durationMs: num,
318
+ });
319
+ /** How a tool's request ended. */
320
+ const boundRequestEnd = shapeOf({
321
+ outcome: oneOf('answered', 'cancelled', 'cut', 'failed', 'refused', 'timed-out'),
322
+ reason: requestReason,
323
+ status: num,
324
+ kind: requestRefusalKind,
325
+ failure: requestFailure,
326
+ during: oneOf('request', 'wait'),
327
+ error: requestError,
328
+ remote: oneOf('unknown'),
329
+ attempts: num,
330
+ effect: requestEffect,
331
+ mayHaveRun: bool,
332
+ });
333
+ /**
334
+ * Each record's meta: the run and stage ids, paths, indices and engine
335
+ * coordinates the dispatcher stamps — and the who the caller named
336
+ * (`sessionId`, `principal`, `tenant`), kept by contract. A field `EventMeta`
337
+ * does not declare, or a value of another kind, is a marker. (`wallClockMs` is
338
+ * the record's `timestamp`; `runId` its run anchor — `audit.ts` lifts both.)
339
+ */
340
+ export const boundMeta = shapeOf({
341
+ wallClockMs: num,
342
+ runOffsetMs: num,
343
+ sourcePosition: shapeOf({
344
+ engineRunId: str,
345
+ logRunId: str,
346
+ drillPath: listOf(str),
347
+ committedThroughIdx: num,
348
+ }),
349
+ runtimeStageId: str,
350
+ subflowPath: listOf(str),
351
+ compositionPath: listOf(str),
352
+ turnIndex: num,
353
+ iterIndex: num,
354
+ traceId: str,
355
+ spanId: str,
356
+ correlationId: str,
357
+ runId: str,
358
+ sessionId: metaIdentity,
359
+ principal: metaIdentity,
360
+ tenant: metaIdentity,
361
+ });
362
+ /** What a tool returned, as `describedResult()` declared it: the data is content;
363
+ * its kinds, field and column names, counts and the library's static note stay. */
364
+ const boundSemantics = shapeOf({
365
+ af_semantics: bool,
366
+ series: listOf(shapeOf({
367
+ t: charsMarker,
368
+ entity: charsMarker,
369
+ metric: str,
370
+ value: charsMarker,
371
+ })),
372
+ // An open record: `entity` and every other value is the data; the keys stay.
373
+ facts: listOf(shapeOf({ entity: charsMarker })),
374
+ edges: listOf(shapeOf({ from: charsMarker, to: charsMarker, kind: str })),
375
+ grain: shapeOf({
376
+ interval: str,
377
+ aggregation: str,
378
+ is_counter: bool,
379
+ collapsed: charsMarker,
380
+ }),
381
+ provenance: shapeOf({
382
+ measured_at: charsMarker,
383
+ age_seconds: num,
384
+ source: charsMarker,
385
+ source_export_date: charsMarker,
386
+ }),
387
+ period: shapeOf({ queried: boundInstants, held: boundHeld, read_at: charsMarker }),
388
+ resolved: listOf(shapeOf({
389
+ argument: str,
390
+ id: charsMarker,
391
+ name: charsMarker,
392
+ aliases: listOf(charsMarker),
393
+ })),
394
+ // `null` says there is no next page; a cursor or page number is a value.
395
+ paging: shapeOf({ next: nullOr(charsMarker) }),
396
+ coverage: shapeOf({
397
+ checked: listOf(boundCoverageItem),
398
+ not_checked: listOf(boundCoverageItem),
399
+ cannot_cover: listOf(boundCoverageItem),
400
+ }),
401
+ not_covered: listOf(charsMarker),
402
+ clarify: nullOr(shapeOf({ question: charsMarker, candidates: listOf(charsMarker) })),
403
+ render: shapeOf({
404
+ default: str,
405
+ columns: listOf(str),
406
+ sort: str,
407
+ filter_note: charsMarker,
408
+ chart_hint: charsMarker,
409
+ }),
410
+ // "The static sentence. Never interpolated."
411
+ note: str,
412
+ });
413
+ /**
414
+ * The whole-event shapes as a `Map`, by event type — what `audit.ts` looks an
415
+ * event up in. An event's name is the emitter's to choose (`agent.emit()`
416
+ * takes any string), so it is never a key into a plain object: a name
417
+ * `Object.prototype` holds (`constructor`, `toString`, `__proto__`) finds no
418
+ * shape here, and that event is bounded as unknown — every field a marker.
419
+ */
420
+ export function eventShapeTable(toolRan) {
421
+ return new Map(Object.entries(eventShapes(toolRan)));
422
+ }
423
+ /**
424
+ * The whole-event shapes, by event type. `toolRan` answers whether this
425
+ * strategy has seen a tool of that name run (`createToolRunTracker`): a
426
+ * `tryInsteadTool` names another tool, and that name is kept only then —
427
+ * otherwise it is the tool author's word for a tool this agent may not hold
428
+ * (`otel.ts` · `coverageAttrs`, the same rule).
429
+ */
430
+ export function eventShapes(toolRan) {
431
+ return {
432
+ // ── The seven a tool, the model or the person writes into ──────────
433
+ 'agentfootprint.tools.absent': eventShape({
434
+ toolName: str,
435
+ toolCallId: str,
436
+ iteration: num,
437
+ lookedFor: charsMarker,
438
+ checked: listOf(boundCoverageItem),
439
+ notChecked: listOf(boundCoverageItem),
440
+ cannotCover: listOf(boundCoverageItem),
441
+ tryInstead: charsMarker,
442
+ tryInsteadTool: shapeOf({
443
+ tool: seenToolName(toolRan),
444
+ why: charsMarker,
445
+ }),
446
+ provenance: boundProvenance,
447
+ period: boundPeriod,
448
+ composition: boundComposition,
449
+ lookedForRef: shapeOf({
450
+ resultId: str,
451
+ field: oneOf('lookedFor'),
452
+ }),
453
+ }),
454
+ 'agentfootprint.tools.coverage_declared': eventShape({
455
+ toolName: str,
456
+ toolCallId: str,
457
+ iteration: num,
458
+ checked: listOf(boundCoverageItem),
459
+ notChecked: listOf(boundCoverageItem),
460
+ cannotCover: listOf(boundCoverageItem),
461
+ period: boundPeriod,
462
+ inProgress: listOf(boundInProgressItem),
463
+ composition: boundComposition,
464
+ }),
465
+ 'agentfootprint.tools.semantics_declared': eventShape({
466
+ toolName: str,
467
+ toolCallId: str,
468
+ iteration: num,
469
+ semantics: boundSemantics,
470
+ }),
471
+ 'agentfootprint.agent.evidence_checked': eventShape({
472
+ iteration: num,
473
+ posture: oneOf('assist', 'guard', 'rails'),
474
+ candidates: num,
475
+ lookedUp: num,
476
+ unsupported: listOf(shapeOf({
477
+ value: charsMarker,
478
+ shape: str,
479
+ region: oneOf('prose', 'code'),
480
+ })),
481
+ action: oneOf('flagged', 'grounded', 'refused', 'revision-asked'),
482
+ afterRevision: bool,
483
+ evidenceTruncated: bool,
484
+ carriedBy: listOf(shapeOf({
485
+ toolCallId: str,
486
+ values: num,
487
+ only: num,
488
+ })),
489
+ stagedRefs: listOf(shapeOf({
490
+ ref: str,
491
+ kind: str,
492
+ })),
493
+ spenderTools: listOf(str),
494
+ // `from` names the operands — and a unit-scaled figure's source value.
495
+ computed: listOf(shapeOf({
496
+ value: charsMarker,
497
+ shape: str,
498
+ derivation: str,
499
+ from: charsMarker,
500
+ })),
501
+ scripts: boundScriptsVerdict,
502
+ }),
503
+ 'agentfootprint.integrity.external_ground_used': eventShape({
504
+ toolName: str,
505
+ toolCallId: str,
506
+ path: str,
507
+ value: charsMarker,
508
+ source: str,
509
+ iteration: num,
510
+ }),
511
+ 'agentfootprint.map.engaged': eventShape({
512
+ mapId: str,
513
+ iteration: num,
514
+ by: oneOf('assumed', 'explicit', 'lexical', 'semantic', 'structural'),
515
+ witness: charsMarker,
516
+ reengaged: bool,
517
+ upgraded: bool,
518
+ foundedBy: oneOf('assumed', 'explicit', 'lexical', 'semantic', 'structural'),
519
+ tenantChanged: bool,
520
+ at: str,
521
+ }),
522
+ 'agentfootprint.skill.turn_routed': eventShape({
523
+ by: oneOf('continuity', 'decider', 'entry', 'intent', 'menu', 'none'),
524
+ from: str,
525
+ to: str,
526
+ scorer: str,
527
+ scores: listOf(shapeOf({
528
+ id: str,
529
+ score: num,
530
+ relevance: num,
531
+ })),
532
+ runnerUp: shapeOf({
533
+ id: str,
534
+ gap: num,
535
+ }),
536
+ decisive: bool,
537
+ witness: boundWitness,
538
+ offered: listOf(str),
539
+ stayOffered: bool,
540
+ policy: shapeOf({
541
+ nearTieMargin: num,
542
+ menuSize: num,
543
+ floor: num,
544
+ }),
545
+ window: num,
546
+ droppedResume: shapeOf({
547
+ id: str,
548
+ reason: oneOf('unknown-skill'),
549
+ }),
550
+ decider: shapeOf({
551
+ provider: str,
552
+ model: str,
553
+ picked: str,
554
+ }),
555
+ }),
556
+ // ── The same rule, everywhere else the run's words ride ────────────
557
+ 'agentfootprint.map.parked': eventShape({
558
+ mapId: str,
559
+ iteration: num,
560
+ by: oneOf('assumed', 'explicit', 'lexical', 'semantic', 'structural'),
561
+ idleCalls: num,
562
+ witness: charsMarker,
563
+ }),
564
+ // A guard's conditions are the engine's decision evidence (kept, see audit.ts).
565
+ 'agentfootprint.context.evaluated': eventShape({
566
+ iteration: num,
567
+ activeCount: num,
568
+ skippedCount: num,
569
+ evaluatedTotal: num,
570
+ activeIds: listOf(str),
571
+ skippedDetails: listOf(shapeOf({
572
+ id: str,
573
+ reason: oneOf('hidden', 'parked', 'predicate-threw', 'unknown-fact', 'unknown-trigger-kind'),
574
+ error: charsMarker,
575
+ })),
576
+ triggerKindCounts: recordOf(num),
577
+ // The catalog and the routing provenance are what the app declared.
578
+ skillCatalog: listOf(shapeOf({
579
+ id: str,
580
+ description: str,
581
+ })),
582
+ routing: listOf(shapeOf({
583
+ injectionId: str,
584
+ flavor: str,
585
+ via: str,
586
+ path: listOf(shapeOf({ label: str, branch: str })),
587
+ label: str,
588
+ from: str,
589
+ triggerKind: str,
590
+ tools: listOf(str),
591
+ })),
592
+ cursorMove: shapeOf({
593
+ from: str,
594
+ to: str,
595
+ by: str,
596
+ offered: listOf(str),
597
+ declinedOffer: bool,
598
+ witness: boundWitness,
599
+ guard: boundGuard,
600
+ guardsClosed: listOf(boundGuard),
601
+ reachable: listOf(str),
602
+ }),
603
+ supersededIds: listOf(str),
604
+ }),
605
+ 'agentfootprint.validation.args_invalid': eventShape({
606
+ toolName: str,
607
+ toolCallId: str,
608
+ iteration: num,
609
+ issues: listOf(shapeOf({
610
+ path: str,
611
+ expected: str,
612
+ got: str,
613
+ value: charsMarker,
614
+ hint: str,
615
+ })),
616
+ enforced: bool,
617
+ }),
618
+ 'agentfootprint.agent.output_schema_validation_failed': eventShape({
619
+ message: charsMarker,
620
+ stage: oneOf('json-parse', 'schema-validate'),
621
+ path: str,
622
+ rawOutput: charsMarker,
623
+ draftWithheld: bool,
624
+ attempt: num,
625
+ cumulativeRetries: num,
626
+ }),
627
+ 'agentfootprint.resilience.output_fallback_triggered': eventShape({
628
+ stage: oneOf('json-parse', 'schema-validate'),
629
+ rawOutputPreview: charsMarker,
630
+ primaryErrorMessage: charsMarker,
631
+ retriesSpent: num,
632
+ }),
633
+ 'agentfootprint.resilience.output_canned_used': eventShape({
634
+ rawOutputPreview: charsMarker,
635
+ fallbackErrorMessage: charsMarker,
636
+ retriesSpent: num,
637
+ }),
638
+ 'agentfootprint.stream.tool_progress': eventShape({
639
+ toolCallId: str,
640
+ toolName: str,
641
+ iteration: num,
642
+ payload: keysMarker,
643
+ }),
644
+ 'agentfootprint.checkin.request': eventShape({
645
+ toolName: str,
646
+ toolCallId: str,
647
+ iteration: num,
648
+ request: keysMarker,
649
+ }),
650
+ 'agentfootprint.checkin.decision': eventShape({
651
+ toolName: str,
652
+ toolCallId: str,
653
+ iteration: num,
654
+ requestId: str,
655
+ approved: bool,
656
+ by: str,
657
+ note: charsMarker,
658
+ componentId: str,
659
+ }),
660
+ 'agentfootprint.middleware.decision': eventShape({
661
+ middleware: str,
662
+ moment: oneOf('after-tool', 'before-tool', 'input', 'output', 'window'),
663
+ at: oneOf('message', 'tool'),
664
+ phase: oneOf('input', 'output'),
665
+ toolName: str,
666
+ toolCallId: str,
667
+ iteration: num,
668
+ outcome: oneOf('allow', 'ask', 'deny'),
669
+ changed: bool,
670
+ why: charsMarker,
671
+ componentId: str,
672
+ }),
673
+ 'agentfootprint.skill.step_skipped': eventShape({
674
+ skillId: str,
675
+ // The step the app declared — its tool and note.
676
+ step: shapeOf({
677
+ index: num,
678
+ total: num,
679
+ tool: str,
680
+ note: str,
681
+ }),
682
+ reason: charsMarker,
683
+ policy: oneOf('advance', 'hold'),
684
+ iteration: num,
685
+ toolCallId: str,
686
+ }),
687
+ 'agentfootprint.stream.llm_start': eventShape({
688
+ iteration: num,
689
+ provider: str,
690
+ model: str,
691
+ systemPromptChars: num,
692
+ systemPromptText: charsMarker,
693
+ messagesCount: num,
694
+ toolsCount: num,
695
+ // The catalog the model saw: names and the descriptions the tools declared.
696
+ tools: listOf(shapeOf({
697
+ name: str,
698
+ description: str,
699
+ })),
700
+ estimatedPromptTokens: num,
701
+ temperature: num,
702
+ providerRequestRef: str,
703
+ brain: shapeOf({
704
+ via: oneOf('escalation', 'skill'),
705
+ skillId: str,
706
+ }),
707
+ }),
708
+ 'agentfootprint.credential.failed': eventShape({
709
+ service: str,
710
+ reason: charsMarker,
711
+ tool: str,
712
+ errorClass: str,
713
+ toolCallId: str,
714
+ iteration: num,
715
+ }),
716
+ 'agentfootprint.fallback.triggered': eventShape({
717
+ kind: oneOf('provider', 'skill', 'tool'),
718
+ primary: str,
719
+ fallback: str,
720
+ reason: charsMarker,
721
+ }),
722
+ 'agentfootprint.memory.retrieved': eventShape({
723
+ strategy: str,
724
+ queryHash: str,
725
+ k: num,
726
+ threshold: num,
727
+ maxChars: num,
728
+ charsUsed: num,
729
+ embedderId: str,
730
+ dimensions: num,
731
+ consideredCount: num,
732
+ admittedCount: num,
733
+ rejectedCount: num,
734
+ candidates: listOf(shapeOf({
735
+ id: str,
736
+ score: num,
737
+ rank: num,
738
+ admitted: bool,
739
+ reason: oneOf('below-threshold', 'over-budget', 'over-char-budget', 'over-max-entries'),
740
+ docUri: str,
741
+ page: num,
742
+ heading: charsMarker,
743
+ })),
744
+ candidatesComplete: bool,
745
+ candidatesOmittedReason: str,
746
+ corpusEmpty: bool,
747
+ namespace: str,
748
+ }),
749
+ 'agentfootprint.integrity.context_error': eventShape({
750
+ kind: oneOf('column-type-mismatch', 'dangling-reference', 'duplicate-execution', 'empty-lookup', 'invariant-violation', 'missing-column', 'prior-turn-evidence', 'unsupported-argument', 'unsupported-claim'),
751
+ seam: oneOf('choice', 'claim', 'compose', 'wire', 'write'),
752
+ subjects: listOf(boundSubject),
753
+ witnesses: listOf(shapeOf({
754
+ subject: boundSubject,
755
+ predicate: str,
756
+ value: charsMarker,
757
+ epoch: num,
758
+ stratum: oneOf('asserted', 'quoted'),
759
+ provenance: charsMarker,
760
+ runtimeStageId: str,
761
+ synthetic: bool,
762
+ })),
763
+ predicate: str,
764
+ epoch: num,
765
+ synthetic: bool,
766
+ advisory: bool,
767
+ message: charsMarker,
768
+ iteration: num,
769
+ }),
770
+ 'agentfootprint.tools.effect': eventShape({
771
+ kind: oneOf('propose-transition', 'require-instruction'),
772
+ outcome: oneOf('accepted', 'refused', 'superseded'),
773
+ stay: bool,
774
+ toolName: str,
775
+ toolCallId: str,
776
+ iteration: num,
777
+ targetSkillId: str,
778
+ reason: charsMarker,
779
+ instructionId: str,
780
+ deliveryLease: oneOf('next-call', 'until-skill-exit'),
781
+ refusalReason: str,
782
+ supersededBy: oneOf('earlier-proposal'),
783
+ }),
784
+ // `reason` is `pauseData.reason` — the same words `questionPayload` hides.
785
+ 'agentfootprint.pause.request': eventShape({
786
+ // The library's own pause sentence stays; a pause's own reason is its data.
787
+ reason: oneOf(FIXED_PAUSE_REASON),
788
+ questionPayload: keysMarker,
789
+ }),
790
+ 'agentfootprint.artifacts.minted': eventShape({
791
+ ref: str,
792
+ kind: str,
793
+ mediaType: str,
794
+ bytes: num,
795
+ label: charsMarker,
796
+ digest: str,
797
+ expiresAt: num,
798
+ origin: shapeOf({
799
+ runId: str,
800
+ toolCallId: str,
801
+ }),
802
+ parentRefs: listOf(str),
803
+ // The column, zone and interval the rows declare.
804
+ timeAxis: shapeOf({
805
+ column: str,
806
+ unit: oneOf('epoch-ms', 'epoch-s', 'iso'),
807
+ zone: str,
808
+ interval: str,
809
+ // One aggregate for every column, or one per column.
810
+ aggregate: either(oneOf('avg', 'count', 'last', 'max', 'min', 'raw', 'sum'), recordOf(oneOf('avg', 'count', 'last', 'max', 'min', 'sum'))),
811
+ }),
812
+ tool: str,
813
+ }),
814
+ 'agentfootprint.artifacts.presented': eventShape({
815
+ ref: str,
816
+ as: str,
817
+ snapshot: shapeOf({
818
+ kind: str,
819
+ mediaType: str,
820
+ bytes: num,
821
+ label: charsMarker,
822
+ }),
823
+ toolCallId: str,
824
+ iteration: num,
825
+ }),
826
+ 'agentfootprint.artifacts.refused': eventShape({
827
+ op: oneOf('delete', 'dispatch', 'get', 'head', 'list', 'put'),
828
+ reason: oneOf('digest-mismatch', 'invalid-input', 'kind-mismatch', 'missing-or-expired', 'no-store', 'unknown-parent'),
829
+ ref: str,
830
+ detail: charsMarker,
831
+ tool: str,
832
+ }),
833
+ 'agentfootprint.reliability.fail_fast': eventShape({
834
+ phase: oneOf('post-decide', 'pre-check'),
835
+ kind: str,
836
+ attempt: num,
837
+ label: str,
838
+ reason: charsMarker,
839
+ providerUsed: str,
840
+ errorKind: str,
841
+ errorMessage: charsMarker,
842
+ }),
843
+ 'agentfootprint.agent.handoff': eventShape({
844
+ fromAgentId: str,
845
+ toAgentId: str,
846
+ reason: charsMarker,
847
+ viaProtocol: oneOf('http', 'mcp', 'native'),
848
+ }),
849
+ // A policy's `reason` is its telemetry tag; its `rationale` is prose per decision.
850
+ 'agentfootprint.permission.check': eventShape({
851
+ capability: oneOf('external_net', 'memory_read', 'memory_write', 'skill_read', 'tool_call', 'user_data'),
852
+ actor: str,
853
+ target: str,
854
+ result: oneOf('allow', 'deny', 'gate_open', 'halt'),
855
+ policyEngine: oneOf('cerbos', 'custom', 'opa'),
856
+ policyRuleId: str,
857
+ rationale: charsMarker,
858
+ reason: policyReasonTag,
859
+ toolCallId: str,
860
+ iteration: num,
861
+ }),
862
+ // `tellLLM` is the tool result the model read in place of the call.
863
+ 'agentfootprint.permission.halt': eventShape({
864
+ checkerId: str,
865
+ target: str,
866
+ reason: policyReasonTag,
867
+ tellLLM: charsMarker,
868
+ iteration: num,
869
+ sequenceLength: num,
870
+ toolCallId: str,
871
+ }),
872
+ // A router's `{ reason }` is the routing model's own words; `decide()`
873
+ // evidence is the engine's, kept (see audit.ts).
874
+ 'agentfootprint.composition.route_decided': eventShape({
875
+ conditionalId: str,
876
+ chosen: str,
877
+ rationale: str,
878
+ evidence: routeEvidence,
879
+ }),
880
+ // ── Every other event: structure, and the fields bounded whole ─────
881
+ 'agentfootprint.composition.enter': eventShape({
882
+ kind: oneOf('Conditional', 'Loop', 'Parallel', 'Sequence'),
883
+ id: str,
884
+ name: str,
885
+ childCount: num,
886
+ }),
887
+ 'agentfootprint.composition.exit': eventShape({
888
+ kind: oneOf('Conditional', 'Loop', 'Parallel', 'Sequence'),
889
+ id: str,
890
+ name: str,
891
+ status: oneOf('break', 'budget_exhausted', 'err', 'ok'),
892
+ durationMs: num,
893
+ }),
894
+ 'agentfootprint.composition.fork_start': eventShape({
895
+ parentId: str,
896
+ branches: listOf(shapeOf({
897
+ id: str,
898
+ name: str,
899
+ })),
900
+ }),
901
+ 'agentfootprint.composition.branch_complete': eventShape({
902
+ parentId: str,
903
+ branchId: str,
904
+ status: oneOf('err', 'ok'),
905
+ durationMs: num,
906
+ }),
907
+ 'agentfootprint.composition.merge_end': eventShape({
908
+ parentId: str,
909
+ strategy: oneOf('fn', 'llm', 'outcomes-fn'),
910
+ resultSummary: charsMarker,
911
+ mergedBranchCount: num,
912
+ totalBranchCount: num,
913
+ }),
914
+ 'agentfootprint.composition.iteration_start': eventShape({
915
+ loopId: str,
916
+ iteration: num,
917
+ }),
918
+ 'agentfootprint.composition.iteration_exit': eventShape({
919
+ loopId: str,
920
+ iteration: num,
921
+ reason: oneOf('body_complete', 'break', 'budget', 'guard_false'),
922
+ }),
923
+ 'agentfootprint.agent.turn_start': eventShape({
924
+ turnIndex: num,
925
+ userPrompt: charsMarker,
926
+ }),
927
+ 'agentfootprint.agent.turn_end': eventShape({
928
+ turnIndex: num,
929
+ finalContent: charsMarker,
930
+ totalInputTokens: num,
931
+ totalOutputTokens: num,
932
+ iterationCount: num,
933
+ durationMs: num,
934
+ stoppedEarly: shapeOf({
935
+ reason: oneOf('cost-budget', 'max-iterations'),
936
+ iteration: num,
937
+ pendingToolCalls: num,
938
+ wrappedUp: bool,
939
+ }),
940
+ answerCoverage: boundAnswerCoverage,
941
+ answerAssessment: boundAnswerAssessment,
942
+ standingLineNames: recordOf(str),
943
+ answerNegatives: boundAnswerNegatives,
944
+ scripts: boundScripts,
945
+ refused: shapeOf({
946
+ by: oneOf('evidence-rails'),
947
+ }),
948
+ }),
949
+ 'agentfootprint.agent.iteration_start': eventShape({
950
+ turnIndex: num,
951
+ iterIndex: num,
952
+ }),
953
+ 'agentfootprint.agent.iteration_end': eventShape({
954
+ turnIndex: num,
955
+ iterIndex: num,
956
+ toolCallCount: num,
957
+ history: messagesMarker,
958
+ }),
959
+ 'agentfootprint.agent.route_decided': eventShape({
960
+ turnIndex: num,
961
+ iterIndex: num,
962
+ chosen: oneOf('evidence-recheck', 'final', 'negative-recheck', 'output-retry', 'step-nudge', 'tool-calls', 'wrap-up'),
963
+ // A fixed sentence, or one the library composes (a count, a skill's name).
964
+ rationale: str,
965
+ }),
966
+ 'agentfootprint.agent.output_contract_unmet': eventShape({
967
+ stage: oneOf('json-parse', 'schema-validate'),
968
+ error: charsMarker,
969
+ path: str,
970
+ attempts: num,
971
+ retriesSpent: num,
972
+ fallbackConfigured: bool,
973
+ iteration: num,
974
+ brokenBy: str,
975
+ }),
976
+ 'agentfootprint.agent.output_schema_retry': eventShape({
977
+ attempt: num,
978
+ retriesRemaining: num,
979
+ iteration: num,
980
+ stage: oneOf('json-parse', 'schema-validate'),
981
+ error: charsMarker,
982
+ path: str,
983
+ correctiveMessageHash: str,
984
+ }),
985
+ 'agentfootprint.agent.grounding_nudged': eventShape({
986
+ iteration: num,
987
+ refs: listOf(shapeOf({
988
+ ref: str,
989
+ kind: str,
990
+ })),
991
+ refsOmitted: num,
992
+ tools: listOf(str),
993
+ }),
994
+ 'agentfootprint.agent.run_configured': eventShape({
995
+ agentId: str,
996
+ llm: shapeOf({
997
+ provider: str,
998
+ model: str,
999
+ modelOverrides: listOf(oneOf('configure', 'skill-brains')),
1000
+ }),
1001
+ cache: shapeOf({
1002
+ requested: oneOf('default', 'explicit'),
1003
+ strategy: oneOf('none'),
1004
+ status: oneOf('not-applicable'),
1005
+ }),
1006
+ reactMode: oneOf('classic', 'dynamic', 'dynamic-grouped'),
1007
+ memories: listOf(shapeOf({
1008
+ id: str,
1009
+ type: oneOf('causal', 'episodic', 'narrative', 'semantic'),
1010
+ strategy: oneOf('budget', 'decay', 'extract', 'hybrid', 'summarize', 'topK', 'window'),
1011
+ retrieval: str,
1012
+ embedderId: str,
1013
+ flavor: oneOf('memory', 'rag'),
1014
+ })),
1015
+ window: str,
1016
+ skillGraph: shapeOf({
1017
+ routing: oneOf('assist', 'guard', 'rails'),
1018
+ continuity: oneOf('conversation', 'turn'),
1019
+ scorer: str,
1020
+ }),
1021
+ evidenceGate: oneOf('assist', 'guard', 'rails'),
1022
+ artifacts: shapeOf({
1023
+ placement: bool,
1024
+ recordings: bool,
1025
+ }),
1026
+ recipes: listOf(shapeOf({
1027
+ id: str,
1028
+ version: str,
1029
+ })),
1030
+ }),
1031
+ 'agentfootprint.agent.thinking_parse_failed': eventShape({
1032
+ providerName: str,
1033
+ subflowId: str,
1034
+ error: charsMarker,
1035
+ errorName: str,
1036
+ iteration: num,
1037
+ }),
1038
+ 'agentfootprint.agent.thinking_omitted': eventShape({
1039
+ providerName: str,
1040
+ model: str,
1041
+ messageIndex: num,
1042
+ blockIndex: num,
1043
+ reason: oneOf('content-changed', 'missing-signature', 'prefix-changed', 'sequence-changed', 'thinking-retired'),
1044
+ phase: oneOf('prepared'),
1045
+ }),
1046
+ 'agentfootprint.agent.budget_exhausted': eventShape({
1047
+ reason: oneOf('cost-budget', 'max-iterations'),
1048
+ iteration: num,
1049
+ limit: num,
1050
+ pendingToolCalls: num,
1051
+ action: oneOf('cut-short', 'wrapped-up'),
1052
+ }),
1053
+ 'agentfootprint.stream.llm_end': eventShape({
1054
+ iteration: num,
1055
+ content: charsMarker,
1056
+ contentWithheld: bool,
1057
+ toolCallCount: num,
1058
+ // A provider's counts. Its usage object can carry more than these (structural
1059
+ // typing lets it): a child the type does not declare is a marker.
1060
+ usage: shapeOf({
1061
+ input: num,
1062
+ output: num,
1063
+ cacheRead: num,
1064
+ cacheWrite: num,
1065
+ thinking: num,
1066
+ }),
1067
+ stopReason: str,
1068
+ durationMs: num,
1069
+ providerResponseRef: str,
1070
+ }),
1071
+ 'agentfootprint.stream.token': eventShape({
1072
+ iteration: num,
1073
+ tokenIndex: num,
1074
+ content: charsMarker,
1075
+ }),
1076
+ 'agentfootprint.stream.tool_start': eventShape({
1077
+ toolName: str,
1078
+ toolCallId: str,
1079
+ args: keysMarker,
1080
+ parallelCount: num,
1081
+ protocol: oneOf('http', 'mcp', 'native', 'python-fn'),
1082
+ notDispatched: shapeOf({
1083
+ pausedCall: shapeOf({
1084
+ toolCallId: str,
1085
+ toolName: str,
1086
+ }),
1087
+ }),
1088
+ }),
1089
+ 'agentfootprint.stream.tool_end': eventShape({
1090
+ toolCallId: str,
1091
+ result: typeMarker,
1092
+ error: bool,
1093
+ durationMs: num,
1094
+ status: oneOf('absent', 'denied', 'failure', 'invalid', 'partial', 'pending', 'success'),
1095
+ notDispatched: shapeOf({
1096
+ pausedCall: shapeOf({
1097
+ toolCallId: str,
1098
+ toolName: str,
1099
+ }),
1100
+ }),
1101
+ modelResult: typeMarker,
1102
+ changedArgKeys: listOf(str),
1103
+ notExecuted: bool,
1104
+ }),
1105
+ 'agentfootprint.stream.thinking_delta': eventShape({
1106
+ iteration: num,
1107
+ tokenIndex: num,
1108
+ content: charsMarker,
1109
+ }),
1110
+ 'agentfootprint.stream.thinking_end': eventShape({
1111
+ iteration: num,
1112
+ blockCount: num,
1113
+ totalChars: num,
1114
+ tokens: num,
1115
+ blocks: blocksMarker,
1116
+ }),
1117
+ 'agentfootprint.context.injected': eventShape({
1118
+ contentSummary: charsMarker,
1119
+ contentHash: str,
1120
+ rawContent: charsMarker,
1121
+ slot: oneOf('messages', 'system-prompt', 'tools'),
1122
+ asRole: oneOf('assistant', 'system', 'tool', 'user'),
1123
+ asRecency: oneOf('earlier', 'latest'),
1124
+ position: num,
1125
+ sectionTag: str,
1126
+ source: oneOf('assistant', 'base', 'custom', 'evidence-recovery', 'fact', 'findings', 'instructions', 'memory', 'ontology', 'rag', 'registry', 'skill', 'steering', 'tool-result', 'user'),
1127
+ sourceId: str,
1128
+ upstreamRef: str,
1129
+ reason: str,
1130
+ retrievalScore: num,
1131
+ rankPosition: num,
1132
+ threshold: num,
1133
+ budgetSpent: shapeOf({
1134
+ tokens: num,
1135
+ fractionOfCap: num,
1136
+ }),
1137
+ expiresAfter: oneOf('iteration', 'persistent', 'run', 'turn'),
1138
+ }),
1139
+ 'agentfootprint.context.evicted': eventShape({
1140
+ slot: oneOf('messages', 'system-prompt', 'tools'),
1141
+ contentHash: str,
1142
+ reason: oneOf('budget', 'low_score', 'policy', 'stale', 'user_revoked'),
1143
+ survivalMs: num,
1144
+ }),
1145
+ 'agentfootprint.context.slot_composed': eventShape({
1146
+ slot: oneOf('messages', 'system-prompt', 'tools'),
1147
+ iteration: num,
1148
+ budget: shapeOf({
1149
+ cap: num,
1150
+ used: num,
1151
+ headroomChars: num,
1152
+ }),
1153
+ sourceBreakdown: boundSourceBreakdown,
1154
+ orderingStrategy: str,
1155
+ droppedCount: num,
1156
+ droppedSummaries: summariesMarker,
1157
+ }),
1158
+ 'agentfootprint.context.budget_pressure': eventShape({
1159
+ slot: oneOf('messages', 'system-prompt', 'tools'),
1160
+ overflowBy: num,
1161
+ planAction: oneOf('abort', 'evict', 'none', 'summarize'),
1162
+ unit: oneOf('chars', 'tokens'),
1163
+ cap: num,
1164
+ projected: num,
1165
+ }),
1166
+ 'agentfootprint.memory.strategy_applied': eventShape({
1167
+ strategyId: str,
1168
+ strategyKind: oneOf('fact-extraction', 'hybrid', 'semantic', 'sliding-window', 'summarizing'),
1169
+ reason: str,
1170
+ scoreEvidence: keysMarker,
1171
+ inputMemoryCount: num,
1172
+ outputMemoryCount: num,
1173
+ droppedIds: listOf(str),
1174
+ addedIds: listOf(str),
1175
+ }),
1176
+ 'agentfootprint.memory.attached': eventShape({
1177
+ memoryId: str,
1178
+ contentSummary: charsMarker,
1179
+ score: num,
1180
+ rank: num,
1181
+ source: oneOf('auto-extract', 'manual', 'store'),
1182
+ retriever: oneOf('chroma', 'custom', 'pinecone', 'qdrant', 'weaviate'),
1183
+ }),
1184
+ 'agentfootprint.memory.detached': eventShape({
1185
+ memoryId: str,
1186
+ reason: oneOf('budget', 'policy', 'score_low', 'stale'),
1187
+ }),
1188
+ 'agentfootprint.memory.written': eventShape({
1189
+ memoryId: str,
1190
+ contentSummary: charsMarker,
1191
+ source: oneOf('auto', 'manual'),
1192
+ actor: str,
1193
+ }),
1194
+ 'agentfootprint.tools.offered': eventShape({
1195
+ availableIds: listOf(str),
1196
+ withheldIds: listOf(str),
1197
+ withheldReasons: recordOf(oneOf('cost_guard', 'gated', 'permission', 'skill_inactive')),
1198
+ reason: appReasonWord,
1199
+ }),
1200
+ 'agentfootprint.tools.activated': eventShape({
1201
+ toolId: str,
1202
+ reason: oneOf('autoActivate', 'permission_granted', 'skill_activated'),
1203
+ source: str,
1204
+ }),
1205
+ 'agentfootprint.tools.deactivated': eventShape({
1206
+ toolId: str,
1207
+ reason: oneOf('permission_revoked', 'skill_deactivated'),
1208
+ }),
1209
+ 'agentfootprint.tools.discovery_started': eventShape({
1210
+ providerId: str,
1211
+ iteration: num,
1212
+ }),
1213
+ 'agentfootprint.tools.discovery_completed': eventShape({
1214
+ providerId: str,
1215
+ iteration: num,
1216
+ durationMs: num,
1217
+ toolCount: num,
1218
+ }),
1219
+ 'agentfootprint.tools.discovery_failed': eventShape({
1220
+ providerId: str,
1221
+ error: charsMarker,
1222
+ errorName: str,
1223
+ iteration: num,
1224
+ durationMs: num,
1225
+ }),
1226
+ 'agentfootprint.tools.shadowed': eventShape({
1227
+ toolName: str,
1228
+ iteration: num,
1229
+ schemaFrom: oneOf('framework', 'provider', 'registry', 'skill'),
1230
+ schemaFromId: str,
1231
+ dispatchTo: oneOf('framework', 'provider', 'registry', 'skill'),
1232
+ dispatchToId: str,
1233
+ }),
1234
+ 'agentfootprint.tools.claim_swallowed': eventShape({
1235
+ toolName: str,
1236
+ iteration: num,
1237
+ lostBy: oneOf('framework', 'provider', 'registry', 'skill'),
1238
+ lostById: str,
1239
+ wonBy: oneOf('framework', 'provider', 'registry', 'skill'),
1240
+ wonById: str,
1241
+ }),
1242
+ 'agentfootprint.tools.answered_off_wire': eventShape({
1243
+ toolName: str,
1244
+ toolCallId: str,
1245
+ iteration: num,
1246
+ answeredBy: oneOf('framework', 'provider', 'registry', 'skill'),
1247
+ answeredById: str,
1248
+ }),
1249
+ 'agentfootprint.tools.session_started': eventShape({
1250
+ tool: str,
1251
+ scope: oneOf('call', 'run', 'session', 'shutdown'),
1252
+ keyHash: str,
1253
+ runnerId: str,
1254
+ label: str,
1255
+ }),
1256
+ 'agentfootprint.tools.session_reused': eventShape({
1257
+ calls: num,
1258
+ tool: str,
1259
+ scope: oneOf('call', 'run', 'session', 'shutdown'),
1260
+ keyHash: str,
1261
+ runnerId: str,
1262
+ label: str,
1263
+ }),
1264
+ 'agentfootprint.tools.session_closed': eventShape({
1265
+ reason: oneOf('call-end', 'evicted', 'idle', 'run-end', 'session-end', 'shutdown'),
1266
+ durationMs: num,
1267
+ tool: str,
1268
+ scope: oneOf('call', 'run', 'session', 'shutdown'),
1269
+ keyHash: str,
1270
+ runnerId: str,
1271
+ label: str,
1272
+ }),
1273
+ 'agentfootprint.tools.result_refused': eventShape({
1274
+ toolName: str,
1275
+ toolCallId: str,
1276
+ iteration: num,
1277
+ sizeChars: num,
1278
+ maxChars: num,
1279
+ narrowBy: listOf(str),
1280
+ declaredStatus: oneOf('absent', 'denied', 'failure', 'invalid', 'partial', 'pending', 'success'),
1281
+ }),
1282
+ 'agentfootprint.tools.repeated_call': eventShape({
1283
+ toolName: str,
1284
+ toolCallId: str,
1285
+ iteration: num,
1286
+ occurrences: num,
1287
+ argsFingerprint: str,
1288
+ resultFingerprint: str,
1289
+ mode: oneOf('arguments'),
1290
+ }),
1291
+ 'agentfootprint.tools.code_run': eventShape({
1292
+ tool: str,
1293
+ language: str,
1294
+ stagedInputs: num,
1295
+ outputChars: num,
1296
+ truncated: bool,
1297
+ ok: bool,
1298
+ exitCode: num,
1299
+ serviceError: bool,
1300
+ terminatedBy: str,
1301
+ shapeHash: str,
1302
+ }),
1303
+ // One use of an MCP client pool: "ids, digests, evidence and outcomes only" —
1304
+ // never an identity value, a session handle, an argument, a result or a server's text.
1305
+ 'agentfootprint.tools.mcp_client': eventShape({
1306
+ server: str,
1307
+ at: oneOf('call', 'list'),
1308
+ toolCallId: str,
1309
+ keyHash: str,
1310
+ clientId: str,
1311
+ generation: num,
1312
+ client: oneOf('expired', 'handle-lost', 'joined', 'not-needed', 'opened', 'refused', 'reused'),
1313
+ previous: oneOf('evicted', 'expired', 'handle-lost', 'idle', 'terminated'),
1314
+ evidence: oneOf('server-404', 'transport-forgot-handle'),
1315
+ refusal: oneOf('binding-changed', 'closed', 'ending-full', 'identity-mismatch', 'incomplete-identity', 'init-failed', 'init-timeout', 'lease-expired', 'no-identity', 'operations-full', 'pool-full', 'principal-full', 'request-unmatched', 'stale-tools'),
1316
+ initMs: num,
1317
+ definitions: oneOf('listed', 'shared'),
1318
+ definitionsAgeMs: num,
1319
+ revalidated: oneOf('kept', 'refused'),
1320
+ }),
1321
+ 'agentfootprint.tools.request_attempts': eventShape({
1322
+ toolCallId: str,
1323
+ toolName: str,
1324
+ iteration: num,
1325
+ endpoint: str,
1326
+ origin: str,
1327
+ attempts: listOf(boundRequestAttempt),
1328
+ omitted: num,
1329
+ end: boundRequestEnd,
1330
+ }),
1331
+ 'agentfootprint.tools.session_close_failed': eventShape({
1332
+ reason: oneOf('call-end', 'evicted', 'idle', 'run-end', 'session-end', 'shutdown'),
1333
+ durationMs: num,
1334
+ error: charsMarker,
1335
+ errorClass: str,
1336
+ tool: str,
1337
+ scope: oneOf('call', 'run', 'session', 'shutdown'),
1338
+ keyHash: str,
1339
+ runnerId: str,
1340
+ label: str,
1341
+ }),
1342
+ 'agentfootprint.skill.activated': eventShape({
1343
+ skillId: str,
1344
+ reason: oneOf('autoActivate', 'manual', 'read_skill_result'),
1345
+ injectedTools: listOf(str),
1346
+ injectedSystemPromptChars: num,
1347
+ }),
1348
+ 'agentfootprint.skill.graph_declared': eventShape({
1349
+ nodes: listOf(shapeOf({
1350
+ id: str,
1351
+ kind: str,
1352
+ description: str,
1353
+ label: str,
1354
+ title: str,
1355
+ })),
1356
+ edges: listOf(shapeOf({
1357
+ from: nullOr(str),
1358
+ to: str,
1359
+ kind: str,
1360
+ label: str,
1361
+ guard: shapeOf({
1362
+ conditions: listOf(shapeOf({
1363
+ key: str,
1364
+ op: str,
1365
+ // The value the app declared to compare against: one, or a list.
1366
+ value: orList(declaredValue),
1367
+ })),
1368
+ }),
1369
+ })),
1370
+ }),
1371
+ 'agentfootprint.skill.deactivated': eventShape({
1372
+ skillId: str,
1373
+ reason: appReasonWord,
1374
+ }),
1375
+ 'agentfootprint.skill.rejected': eventShape({
1376
+ requestedId: str,
1377
+ currentSkillId: str,
1378
+ allowed: listOf(str),
1379
+ iteration: num,
1380
+ posture: oneOf('guard', 'rails'),
1381
+ reason: oneOf('posture', 'self-call', 'unreachable'),
1382
+ }),
1383
+ 'agentfootprint.skill.reroute_superseded': eventShape({
1384
+ volunteeredId: str,
1385
+ wonId: str,
1386
+ fromSkillId: str,
1387
+ iteration: num,
1388
+ source: oneOf('tool-proposal'),
1389
+ }),
1390
+ 'agentfootprint.skill.route_conflict': eventShape({
1391
+ iteration: num,
1392
+ fromSkillId: str,
1393
+ winner: shapeOf({
1394
+ toolCallId: str,
1395
+ toolName: str,
1396
+ target: str,
1397
+ }),
1398
+ losers: listOf(shapeOf({
1399
+ toolCallId: str,
1400
+ toolName: str,
1401
+ target: str,
1402
+ })),
1403
+ source: oneOf('tool-proposal'),
1404
+ }),
1405
+ 'agentfootprint.skill.step_advanced': eventShape({
1406
+ skillId: str,
1407
+ step: shapeOf({
1408
+ index: num,
1409
+ total: num,
1410
+ tool: str,
1411
+ note: str,
1412
+ }),
1413
+ iteration: num,
1414
+ toolCallId: str,
1415
+ completed: bool,
1416
+ }),
1417
+ 'agentfootprint.skill.steps_unfinished': eventShape({
1418
+ skillId: str,
1419
+ remaining: listOf(shapeOf({
1420
+ index: num,
1421
+ tool: str,
1422
+ note: str,
1423
+ })),
1424
+ total: num,
1425
+ action: oneOf('accepted', 'cut-short', 'nudged'),
1426
+ iteration: num,
1427
+ }),
1428
+ 'agentfootprint.skill.escalated': eventShape({
1429
+ iteration: num,
1430
+ afterRefusals: num,
1431
+ refusals: num,
1432
+ from: shapeOf({
1433
+ provider: str,
1434
+ model: str,
1435
+ }),
1436
+ to: shapeOf({
1437
+ provider: str,
1438
+ model: str,
1439
+ }),
1440
+ }),
1441
+ 'agentfootprint.permission.gate_opened': eventShape({
1442
+ gateId: str,
1443
+ openedBy: str,
1444
+ expiresAt: num,
1445
+ }),
1446
+ 'agentfootprint.permission.gate_closed': eventShape({
1447
+ gateId: str,
1448
+ reason: appReasonWord,
1449
+ }),
1450
+ 'agentfootprint.credential.requested': eventShape({
1451
+ service: str,
1452
+ mode: oneOf('machine', 'user'),
1453
+ toolCallId: str,
1454
+ iteration: num,
1455
+ }),
1456
+ 'agentfootprint.credential.acquired': eventShape({
1457
+ service: str,
1458
+ kind: str,
1459
+ expiresAt: num,
1460
+ toolCallId: str,
1461
+ iteration: num,
1462
+ }),
1463
+ 'agentfootprint.credential.authorization_required': eventShape({
1464
+ service: str,
1465
+ sessionId: str,
1466
+ toolCallId: str,
1467
+ iteration: num,
1468
+ }),
1469
+ 'agentfootprint.cost.tick': eventShape({
1470
+ scope: oneOf('iteration', 'run', 'turn'),
1471
+ model: str,
1472
+ provider: str,
1473
+ tokensInput: num,
1474
+ tokensOutput: num,
1475
+ estimatedUsd: num,
1476
+ cumulative: shapeOf({
1477
+ tokensInput: num,
1478
+ tokensOutput: num,
1479
+ estimatedUsd: num,
1480
+ }),
1481
+ }),
1482
+ 'agentfootprint.cost.limit_hit': eventShape({
1483
+ kind: oneOf('max_cost', 'max_iterations', 'max_tokens', 'max_wallclock'),
1484
+ limit: num,
1485
+ actual: num,
1486
+ action: oneOf('abort', 'degrade', 'warn'),
1487
+ }),
1488
+ 'agentfootprint.eval.score': eventShape({
1489
+ metricId: str,
1490
+ value: num,
1491
+ threshold: num,
1492
+ target: oneOf('iteration', 'run', 'toolCall', 'turn'),
1493
+ targetRef: str,
1494
+ evaluator: oneOf('fn', 'heuristic', 'llm'),
1495
+ evidence: keysMarker,
1496
+ label: str,
1497
+ explanation: charsMarker,
1498
+ }),
1499
+ 'agentfootprint.eval.threshold_crossed': eventShape({
1500
+ metricId: str,
1501
+ direction: oneOf('above', 'below'),
1502
+ value: num,
1503
+ threshold: num,
1504
+ actionTaken: str,
1505
+ }),
1506
+ 'agentfootprint.error.retried': eventShape({
1507
+ attempt: num,
1508
+ maxAttempts: num,
1509
+ lastError: charsMarker,
1510
+ backoffMs: num,
1511
+ reason: str,
1512
+ statedWaitMs: num,
1513
+ }),
1514
+ 'agentfootprint.error.recovered': eventShape({
1515
+ attempt: num,
1516
+ totalDurationMs: num,
1517
+ }),
1518
+ 'agentfootprint.error.fatal': eventShape({
1519
+ error: charsMarker,
1520
+ stage: str,
1521
+ scope: str,
1522
+ }),
1523
+ 'agentfootprint.error.circuit_changed': eventShape({
1524
+ state: oneOf('closed', 'half-open', 'open'),
1525
+ reason: str,
1526
+ providerName: str,
1527
+ }),
1528
+ 'agentfootprint.reliability.retried': eventShape({
1529
+ attempt: num,
1530
+ action: oneOf('retry', 'retry-other'),
1531
+ errorKind: str,
1532
+ errorMessage: charsMarker,
1533
+ fromProvider: str,
1534
+ toProvider: str,
1535
+ }),
1536
+ 'agentfootprint.reliability.recovered': eventShape({
1537
+ attempt: num,
1538
+ recoveredVia: oneOf('fallback', 'retry', 'retry-other'),
1539
+ priorFailures: num,
1540
+ errorKind: str,
1541
+ }),
1542
+ 'agentfootprint.pause.resume': eventShape({
1543
+ resumeInput: keysMarker,
1544
+ pausedDurationMs: num,
1545
+ componentId: str,
1546
+ }),
1547
+ 'agentfootprint.findings.declared': eventShape({
1548
+ toolName: str,
1549
+ toolCallId: str,
1550
+ iteration: num,
1551
+ basis: oneOf('direct', 'exploratory'),
1552
+ expect: oneOf('high', 'low', 'medium'),
1553
+ hasProposition: bool,
1554
+ malformed: num,
1555
+ }),
1556
+ 'agentfootprint.findings.standing': eventShape({
1557
+ toolCallId: str,
1558
+ toolName: str,
1559
+ iteration: num,
1560
+ standing: oneOf('fact', 'noise', 'open', 'ruled-out'),
1561
+ declaredOn: oneOf('answer', 'tool-call'),
1562
+ assertionCount: num,
1563
+ conflictKeys: listOf(str),
1564
+ unknownId: bool,
1565
+ agrees: bool,
1566
+ }),
1567
+ 'agentfootprint.findings.judged': eventShape({
1568
+ toolCallId: str,
1569
+ toolName: str,
1570
+ iteration: num,
1571
+ against: oneOf('proposition', 'question'),
1572
+ standing: oneOf('fact', 'noise', 'open', 'ruled-out'),
1573
+ confidence: num,
1574
+ latencyMs: num,
1575
+ inputTokens: num,
1576
+ outputTokens: num,
1577
+ }),
1578
+ 'agentfootprint.findings.judge_failed': eventShape({
1579
+ toolCallId: str,
1580
+ toolName: str,
1581
+ iteration: num,
1582
+ status: num,
1583
+ latencyMs: num,
1584
+ }),
1585
+ 'agentfootprint.findings.contingent': eventShape({
1586
+ iteration: num,
1587
+ declaredOn: oneOf('answer', 'tool-call'),
1588
+ toolCallId: str,
1589
+ carriers: num,
1590
+ standings: listOf(oneOf('fact', 'noise', 'open', 'ruled-out')),
1591
+ valueChars: num,
1592
+ }),
1593
+ 'agentfootprint.findings.argument': eventShape({
1594
+ toolCallId: str,
1595
+ toolName: str,
1596
+ iteration: num,
1597
+ turn: num,
1598
+ argument: str,
1599
+ rule: oneOf('ask', 'assume'),
1600
+ period: bool,
1601
+ source: oneOf('answered', 'app', 'default', 'model', 'result', 'said'),
1602
+ asked: oneOf('invalid-answer', 'missing', 'unverified'),
1603
+ claimed: oneOf('app', 'assumed', 'none', 'result', 'turn', 'user'),
1604
+ matched: oneOf('mention', 'phrase', 'quote', 'spelling'),
1605
+ reading: bool,
1606
+ earlier: bool,
1607
+ setAside: oneOf('noise', 'open', 'ruled-out'),
1608
+ argumentsFrom: oneOf('listed', 'unlisted'),
1609
+ coincides: oneOf('app', 'person', 'result'),
1610
+ free: bool,
1611
+ failed: oneOf('composed-message', 'no-earlier-turn', 'not-in-app-text', 'not-in-earlier-turns', 'not-in-result', 'only-in-model-answer', 'placed-result', 'quote-not-found', 'uncheckable', 'unknown-result'),
1612
+ malformed: num,
1613
+ valueChars: num,
1614
+ }),
1615
+ 'agentfootprint.findings.period': eventShape({
1616
+ toolCallId: str,
1617
+ toolName: str,
1618
+ iteration: num,
1619
+ turn: num,
1620
+ verdict: oneOf('covered', 'not-held', 'partly-held', 'undeclared', 'unknown'),
1621
+ timeChecks: listOf(oneOf('partly-beyond-retention', 'period-beyond-retention', 'period-differs-from-asked', 'period-shifted')),
1622
+ }),
1623
+ 'agentfootprint.findings.negative_claim': eventShape({
1624
+ iteration: num,
1625
+ turn: num,
1626
+ field: str,
1627
+ span: shapeOf({
1628
+ start: num,
1629
+ end: num,
1630
+ }),
1631
+ packVersion: str,
1632
+ phraseId: str,
1633
+ truncated: bool,
1634
+ kind: oneOf('negative-claim', 'negative-claim-note'),
1635
+ // A claim row's checker codes and native result ids; a note row's code.
1636
+ claim: oneOf('complete', 'none'),
1637
+ notes: listOf(str),
1638
+ results: listOf(str),
1639
+ code: str,
1640
+ }),
1641
+ 'agentfootprint.tool_choice.picked': eventShape({
1642
+ iteration: num,
1643
+ chosen: str,
1644
+ confidence: num,
1645
+ offered: num,
1646
+ served: num,
1647
+ narrowed: bool,
1648
+ narrowedSkipped: oneOf('after-miss', 'evidence-revision', 'too-few', 'unavailable', 'wrap-up'),
1649
+ latencyMs: num,
1650
+ inputTokens: num,
1651
+ outputTokens: num,
1652
+ }),
1653
+ 'agentfootprint.tool_choice.outcome': eventShape({
1654
+ iteration: num,
1655
+ called: listOf(str),
1656
+ firstAgrees: bool,
1657
+ missed: listOf(str),
1658
+ }),
1659
+ 'agentfootprint.tool_choice.failed': eventShape({
1660
+ iteration: num,
1661
+ status: num,
1662
+ latencyMs: num,
1663
+ }),
1664
+ 'agentfootprint.ontology.served': eventShape({
1665
+ iteration: num,
1666
+ id: str,
1667
+ version: str,
1668
+ hash: str,
1669
+ nodes: num,
1670
+ sources: num,
1671
+ edges: num,
1672
+ }),
1673
+ 'agentfootprint.answer.assessed': eventShape({
1674
+ turn: num,
1675
+ iteration: num,
1676
+ assessment: oneOf('known', 'not-applicable', 'unknown', 'unrefuted'),
1677
+ standing: oneOf('ask', 'consistent', 'known', 'not-assessed', 'not-sure'),
1678
+ reasons: boundAssessmentReasons,
1679
+ checked: boundAssessmentChecks,
1680
+ }),
1681
+ 'agentfootprint.embedding.generated': eventShape({
1682
+ model: str,
1683
+ provider: oneOf('cohere', 'custom', 'local', 'openai', 'voyage'),
1684
+ inputKind: oneOf('document', 'query'),
1685
+ dimension: num,
1686
+ count: num,
1687
+ durationMs: num,
1688
+ tokensSpent: num,
1689
+ }),
1690
+ 'agentfootprint.artifacts.resolved': eventShape({
1691
+ ref: str,
1692
+ via: oneOf('get', 'head'),
1693
+ kind: str,
1694
+ bytes: num,
1695
+ tool: str,
1696
+ }),
1697
+ 'agentfootprint.artifacts.expired': eventShape({
1698
+ ref: str,
1699
+ reason: oneOf('max-bytes', 'max-count', 'ttl'),
1700
+ kind: str,
1701
+ bytes: num,
1702
+ tool: str,
1703
+ }),
1704
+ 'agentfootprint.artifacts.hand_over_failed': eventShape({
1705
+ cause: oneOf('abort', 'expired', 'hook', 'operation', 'timeout'),
1706
+ op: oneOf('delete', 'dispatch', 'get', 'head', 'list', 'put'),
1707
+ errorClass: str,
1708
+ errorCode: str,
1709
+ }),
1710
+ 'agentfootprint.integrity.disposition': eventShape({
1711
+ posture: oneOf('dev', 'observe'),
1712
+ workExisted: bool,
1713
+ rows: listOf(shapeOf({
1714
+ check: str,
1715
+ seam: oneOf('choice', 'claim', 'compose', 'wire', 'write'),
1716
+ checked: num,
1717
+ findings: num,
1718
+ notApplicable: num,
1719
+ unreachable: num,
1720
+ lastFiredAt: num,
1721
+ synthetic: num,
1722
+ })),
1723
+ }),
1724
+ };
1725
+ }
1726
+ //# sourceMappingURL=auditShapes.js.map