@evalops/maestro 0.10.23 → 0.10.25

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 (376) hide show
  1. package/README.md +4 -4
  2. package/dist/agent/agent.d.ts +2 -2
  3. package/dist/agent/agent.d.ts.map +1 -1
  4. package/dist/agent/agent.js +1 -1
  5. package/dist/agent/agent.js.map +1 -1
  6. package/dist/agent/keys.d.ts +2 -5
  7. package/dist/agent/keys.d.ts.map +1 -1
  8. package/dist/agent/keys.js +4 -5
  9. package/dist/agent/keys.js.map +1 -1
  10. package/dist/agent/modes.d.ts +2 -2
  11. package/dist/agent/modes.d.ts.map +1 -1
  12. package/dist/agent/modes.js +6 -7
  13. package/dist/agent/modes.js.map +1 -1
  14. package/dist/agent/providers/anthropic.d.ts.map +1 -1
  15. package/dist/agent/providers/anthropic.js +4 -4
  16. package/dist/agent/providers/anthropic.js.map +1 -1
  17. package/dist/agent/providers/google.js +1 -1
  18. package/dist/agent/swarm/executor.d.ts +2 -0
  19. package/dist/agent/swarm/executor.d.ts.map +1 -1
  20. package/dist/agent/swarm/executor.js +208 -35
  21. package/dist/agent/swarm/executor.js.map +1 -1
  22. package/dist/agent/swarm/types.d.ts +2 -0
  23. package/dist/agent/swarm/types.d.ts.map +1 -1
  24. package/dist/agent/swarm/types.js.map +1 -1
  25. package/dist/agent/tool-capability-types.d.ts +36 -0
  26. package/dist/agent/tool-capability-types.d.ts.map +1 -0
  27. package/dist/agent/tool-capability-types.js +2 -0
  28. package/dist/agent/tool-capability-types.js.map +1 -0
  29. package/dist/agent/transport/tool-execution-bridge.d.ts +13 -0
  30. package/dist/agent/transport/tool-execution-bridge.d.ts.map +1 -1
  31. package/dist/agent/transport/tool-execution-bridge.js +28 -15
  32. package/dist/agent/transport/tool-execution-bridge.js.map +1 -1
  33. package/dist/agent/transport/transport-utils.d.ts.map +1 -1
  34. package/dist/agent/transport/transport-utils.js +2 -3
  35. package/dist/agent/transport/transport-utils.js.map +1 -1
  36. package/dist/agent/transport.js +1 -1
  37. package/dist/agent/transport.js.map +1 -1
  38. package/dist/agent/type-guards.d.ts +1 -1
  39. package/dist/agent/type-guards.js +1 -1
  40. package/dist/agent/type-guards.js.map +1 -1
  41. package/dist/agent/types.d.ts +5 -3
  42. package/dist/agent/types.d.ts.map +1 -1
  43. package/dist/agent/types.js +2 -2
  44. package/dist/agent/types.js.map +1 -1
  45. package/dist/app-server/daemon-lifecycle-api.d.ts +31 -0
  46. package/dist/app-server/daemon-lifecycle-api.d.ts.map +1 -0
  47. package/dist/app-server/daemon-lifecycle-api.js +259 -0
  48. package/dist/app-server/daemon-lifecycle-api.js.map +1 -0
  49. package/dist/app-server/external-agent-import-api.d.ts +30 -0
  50. package/dist/app-server/external-agent-import-api.d.ts.map +1 -0
  51. package/dist/app-server/external-agent-import-api.js +553 -0
  52. package/dist/app-server/external-agent-import-api.js.map +1 -0
  53. package/dist/app-server/host-control-api.d.ts +30 -0
  54. package/dist/app-server/host-control-api.d.ts.map +1 -0
  55. package/dist/app-server/host-control-api.js +343 -0
  56. package/dist/app-server/host-control-api.js.map +1 -0
  57. package/dist/app-server/in-process-client.d.ts +2 -2
  58. package/dist/app-server/in-process-client.d.ts.map +1 -1
  59. package/dist/app-server/in-process-client.js.map +1 -1
  60. package/dist/app-server/network-governance-api.d.ts +26 -0
  61. package/dist/app-server/network-governance-api.d.ts.map +1 -0
  62. package/dist/app-server/network-governance-api.js +476 -0
  63. package/dist/app-server/network-governance-api.js.map +1 -0
  64. package/dist/app-server/plugin-bundle-api.d.ts +17 -0
  65. package/dist/app-server/plugin-bundle-api.d.ts.map +1 -0
  66. package/dist/app-server/plugin-bundle-api.js +219 -0
  67. package/dist/app-server/plugin-bundle-api.js.map +1 -0
  68. package/dist/app-server/policy-control-api.d.ts +14 -0
  69. package/dist/app-server/policy-control-api.d.ts.map +1 -0
  70. package/dist/app-server/policy-control-api.js +200 -0
  71. package/dist/app-server/policy-control-api.js.map +1 -0
  72. package/dist/app-server/protocol-modes-api.d.ts +22 -0
  73. package/dist/app-server/protocol-modes-api.d.ts.map +1 -0
  74. package/dist/app-server/protocol-modes-api.js +124 -0
  75. package/dist/app-server/protocol-modes-api.js.map +1 -0
  76. package/dist/app-server/sandbox-proof-api.d.ts +21 -0
  77. package/dist/app-server/sandbox-proof-api.d.ts.map +1 -0
  78. package/dist/app-server/sandbox-proof-api.js +127 -0
  79. package/dist/app-server/sandbox-proof-api.js.map +1 -0
  80. package/dist/app-server/session-api.d.ts +93 -3
  81. package/dist/app-server/session-api.d.ts.map +1 -1
  82. package/dist/app-server/session-api.js +706 -18
  83. package/dist/app-server/session-api.js.map +1 -1
  84. package/dist/audit/logger.d.ts +1 -1
  85. package/dist/bootstrap/auth-setup.d.ts.map +1 -1
  86. package/dist/bootstrap/auth-setup.js +17 -2
  87. package/dist/bootstrap/auth-setup.js.map +1 -1
  88. package/dist/bootstrap/model-resolution-setup.d.ts.map +1 -1
  89. package/dist/bootstrap/model-resolution-setup.js +19 -4
  90. package/dist/bootstrap/model-resolution-setup.js.map +1 -1
  91. package/dist/cli/args.d.ts +2 -2
  92. package/dist/cli/args.d.ts.map +1 -1
  93. package/dist/cli/args.js +2 -2
  94. package/dist/cli/args.js.map +1 -1
  95. package/dist/cli/commands/a2a.d.ts.map +1 -1
  96. package/dist/cli/commands/a2a.js +226 -14
  97. package/dist/cli/commands/a2a.js.map +1 -1
  98. package/dist/cli/commands/anthropic.d.ts +1 -1
  99. package/dist/cli/commands/anthropic.d.ts.map +1 -1
  100. package/dist/cli/commands/anthropic.js +3 -68
  101. package/dist/cli/commands/anthropic.js.map +1 -1
  102. package/dist/cli/commands/modes.js +1 -1
  103. package/dist/cli/commands/modes.js.map +1 -1
  104. package/dist/cli/help.d.ts.map +1 -1
  105. package/dist/cli/help.js +5 -7
  106. package/dist/cli/help.js.map +1 -1
  107. package/dist/cli/rpc-mode.d.ts +1 -1
  108. package/dist/cli/rpc-mode.js +1 -1
  109. package/dist/cli/rpc-mode.js.map +1 -1
  110. package/dist/cli/session.js +1 -1
  111. package/dist/cli/session.js.map +1 -1
  112. package/dist/cli-tui/commands/command-catalog.d.ts.map +1 -1
  113. package/dist/cli-tui/commands/command-catalog.js +7 -12
  114. package/dist/cli-tui/commands/command-catalog.js.map +1 -1
  115. package/dist/cli-tui/commands/subcommands/auth-commands.d.ts +1 -1
  116. package/dist/cli-tui/commands/subcommands/auth-commands.d.ts.map +1 -1
  117. package/dist/cli-tui/commands/subcommands/auth-commands.js +4 -12
  118. package/dist/cli-tui/commands/subcommands/auth-commands.js.map +1 -1
  119. package/dist/cli-tui/custom-editor.d.ts +1 -1
  120. package/dist/cli-tui/custom-editor.js +2 -2
  121. package/dist/cli-tui/custom-editor.js.map +1 -1
  122. package/dist/cli-tui/oauth/oauth-flow-controller.d.ts.map +1 -1
  123. package/dist/cli-tui/oauth/oauth-flow-controller.js +19 -23
  124. package/dist/cli-tui/oauth/oauth-flow-controller.js.map +1 -1
  125. package/dist/cli-tui/selectors/model-selector.d.ts.map +1 -1
  126. package/dist/cli-tui/selectors/model-selector.js +0 -1
  127. package/dist/cli-tui/selectors/model-selector.js.map +1 -1
  128. package/dist/cli-tui/selectors/oauth-selector-view.d.ts +2 -2
  129. package/dist/cli-tui/selectors/oauth-selector-view.d.ts.map +1 -1
  130. package/dist/cli-tui/selectors/oauth-selector-view.js.map +1 -1
  131. package/dist/cli-tui/selectors/oauth-selector.d.ts +2 -2
  132. package/dist/cli-tui/selectors/oauth-selector.d.ts.map +1 -1
  133. package/dist/cli-tui/selectors/oauth-selector.js +3 -4
  134. package/dist/cli-tui/selectors/oauth-selector.js.map +1 -1
  135. package/dist/cli-tui/tui-renderer/mcp-events-setup.js +1 -1
  136. package/dist/cli-tui/tui-renderer/mcp-events-setup.js.map +1 -1
  137. package/dist/cli-tui/tui-renderer.js +2 -2
  138. package/dist/cli-tui/tui-renderer.js.map +1 -1
  139. package/dist/cli-tui/utils/footer-utils.d.ts +1 -1
  140. package/dist/cli-tui/utils/footer-utils.js +1 -1
  141. package/dist/cli-tui/utils/footer-utils.js.map +1 -1
  142. package/dist/cli.js +15156 -14232
  143. package/dist/commands/prompts.d.ts +1 -1
  144. package/dist/commands/prompts.js +1 -1
  145. package/dist/commands/prompts.js.map +1 -1
  146. package/dist/config/constants.d.ts +2 -2
  147. package/dist/config/constants.d.ts.map +1 -1
  148. package/dist/config/constants.js +2 -2
  149. package/dist/config/constants.js.map +1 -1
  150. package/dist/config/index.d.ts +1 -1
  151. package/dist/config/index.js +1 -1
  152. package/dist/config/index.js.map +1 -1
  153. package/dist/config/toml-config.js +3 -3
  154. package/dist/config/toml-config.js.map +1 -1
  155. package/dist/db/client.d.ts +2 -2
  156. package/dist/db/client.js +2 -2
  157. package/dist/db/client.js.map +1 -1
  158. package/dist/db/migrate.d.ts +1 -1
  159. package/dist/db/migrate.js +1 -1
  160. package/dist/db/migrate.js.map +1 -1
  161. package/dist/db/schema.d.ts +2 -2
  162. package/dist/db/schema.js +1 -1
  163. package/dist/db/schema.js.map +1 -1
  164. package/dist/errors/index.d.ts +2 -2
  165. package/dist/errors/index.js +2 -2
  166. package/dist/errors/index.js.map +1 -1
  167. package/dist/main.d.ts +4 -5
  168. package/dist/main.d.ts.map +1 -1
  169. package/dist/main.js +17 -14
  170. package/dist/main.js.map +1 -1
  171. package/dist/mcp/config.d.ts +15 -2
  172. package/dist/mcp/config.d.ts.map +1 -1
  173. package/dist/mcp/config.js +50 -26
  174. package/dist/mcp/config.js.map +1 -1
  175. package/dist/mcp/fathom-cua.d.ts.map +1 -1
  176. package/dist/mcp/fathom-cua.js +10 -0
  177. package/dist/mcp/fathom-cua.js.map +1 -1
  178. package/dist/mcp/manager.d.ts.map +1 -1
  179. package/dist/mcp/manager.js +32 -1
  180. package/dist/mcp/manager.js.map +1 -1
  181. package/dist/mcp/tool-bridge.d.ts.map +1 -1
  182. package/dist/mcp/tool-bridge.js +12 -3
  183. package/dist/mcp/tool-bridge.js.map +1 -1
  184. package/dist/mcp/tool-capabilities.d.ts +5 -0
  185. package/dist/mcp/tool-capabilities.d.ts.map +1 -0
  186. package/dist/mcp/tool-capabilities.js +271 -0
  187. package/dist/mcp/tool-capabilities.js.map +1 -0
  188. package/dist/mcp/types.d.ts +6 -1
  189. package/dist/mcp/types.d.ts.map +1 -1
  190. package/dist/mcp/types.js.map +1 -1
  191. package/dist/models/config-loader.d.ts +1 -1
  192. package/dist/models/factory-integration.d.ts +1 -1
  193. package/dist/models/factory-integration.js +1 -1
  194. package/dist/models/factory-integration.js.map +1 -1
  195. package/dist/node_modules/@evalops/contracts/dist/index.d.ts +3 -3
  196. package/dist/node_modules/@evalops/contracts/dist/index.js +2 -2
  197. package/dist/node_modules/@evalops/contracts/dist/index.js.map +1 -1
  198. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts +1182 -14
  199. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.d.ts.map +1 -1
  200. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.js +450 -1
  201. package/dist/node_modules/@evalops/contracts/dist/maestro-app-server.js.map +1 -1
  202. package/dist/node_modules/@evalops/contracts/package.json +1 -1
  203. package/dist/node_modules/@evalops/tui/package.json +1 -1
  204. package/dist/oauth/connectors.d.ts +2 -2
  205. package/dist/oauth/connectors.d.ts.map +1 -1
  206. package/dist/oauth/connectors.js +3 -5
  207. package/dist/oauth/connectors.js.map +1 -1
  208. package/dist/oauth/github-copilot.d.ts +1 -1
  209. package/dist/oauth/github-copilot.js +1 -1
  210. package/dist/oauth/github-copilot.js.map +1 -1
  211. package/dist/oauth/index.d.ts +10 -8
  212. package/dist/oauth/index.d.ts.map +1 -1
  213. package/dist/oauth/index.js +54 -31
  214. package/dist/oauth/index.js.map +1 -1
  215. package/dist/oauth/openai.d.ts +1 -1
  216. package/dist/oauth/openai.js +2 -2
  217. package/dist/oauth/openai.js.map +1 -1
  218. package/dist/platform/a2a-completion-audit.d.ts +41 -0
  219. package/dist/platform/a2a-completion-audit.d.ts.map +1 -0
  220. package/dist/platform/a2a-completion-audit.js +177 -0
  221. package/dist/platform/a2a-completion-audit.js.map +1 -0
  222. package/dist/platform/a2a-task-ledger.d.ts.map +1 -1
  223. package/dist/platform/a2a-task-ledger.js +17 -0
  224. package/dist/platform/a2a-task-ledger.js.map +1 -1
  225. package/dist/platform/a2a-telemetry-inspect.d.ts +58 -0
  226. package/dist/platform/a2a-telemetry-inspect.d.ts.map +1 -0
  227. package/dist/platform/a2a-telemetry-inspect.js +224 -0
  228. package/dist/platform/a2a-telemetry-inspect.js.map +1 -0
  229. package/dist/platform/agent-registry-client.d.ts +8 -0
  230. package/dist/platform/agent-registry-client.d.ts.map +1 -1
  231. package/dist/platform/agent-registry-client.js +9 -1
  232. package/dist/platform/agent-registry-client.js.map +1 -1
  233. package/dist/providers/api-keys.d.ts +2 -2
  234. package/dist/providers/api-keys.js +2 -2
  235. package/dist/providers/api-keys.js.map +1 -1
  236. package/dist/providers/auth.d.ts +3 -6
  237. package/dist/providers/auth.d.ts.map +1 -1
  238. package/dist/providers/auth.js +1 -40
  239. package/dist/providers/auth.js.map +1 -1
  240. package/dist/rpc/index.d.ts +2 -2
  241. package/dist/rpc/index.js +2 -2
  242. package/dist/rpc/index.js.map +1 -1
  243. package/dist/rpc/rpc-types.d.ts +1 -1
  244. package/dist/rpc/rpc-types.js +1 -1
  245. package/dist/rpc/rpc-types.js.map +1 -1
  246. package/dist/safety/nested-agent-guard.js +1 -1
  247. package/dist/safety/nested-agent-guard.js.map +1 -1
  248. package/dist/safety/policy.d.ts +2 -2
  249. package/dist/safety/policy.js +2 -2
  250. package/dist/safety/policy.js.map +1 -1
  251. package/dist/safety/validators/network-policy-validator.d.ts +8 -0
  252. package/dist/safety/validators/network-policy-validator.d.ts.map +1 -1
  253. package/dist/safety/validators/network-policy-validator.js +29 -4
  254. package/dist/safety/validators/network-policy-validator.js.map +1 -1
  255. package/dist/sandbox/local-sandbox.d.ts +1 -1
  256. package/dist/sandbox/local-sandbox.js +1 -1
  257. package/dist/sandbox/local-sandbox.js.map +1 -1
  258. package/dist/server/app-context.d.ts +2 -0
  259. package/dist/server/app-context.d.ts.map +1 -1
  260. package/dist/server/app-context.js.map +1 -1
  261. package/dist/server/handlers/attachments.d.ts.map +1 -1
  262. package/dist/server/handlers/attachments.js +1 -0
  263. package/dist/server/handlers/attachments.js.map +1 -1
  264. package/dist/server/handlers/models.d.ts.map +1 -1
  265. package/dist/server/handlers/models.js +3 -1
  266. package/dist/server/handlers/models.js.map +1 -1
  267. package/dist/server/handlers/session-attachments.d.ts.map +1 -1
  268. package/dist/server/handlers/session-attachments.js +2 -0
  269. package/dist/server/handlers/session-attachments.js.map +1 -1
  270. package/dist/server/handlers/sessions.js +1 -1
  271. package/dist/server/handlers/sessions.js.map +1 -1
  272. package/dist/server/handlers/status.d.ts +2 -0
  273. package/dist/server/handlers/status.d.ts.map +1 -1
  274. package/dist/server/handlers/status.js +3 -2
  275. package/dist/server/handlers/status.js.map +1 -1
  276. package/dist/server/headless-runtime-service.d.ts.map +1 -1
  277. package/dist/server/headless-runtime-service.js +32 -3
  278. package/dist/server/headless-runtime-service.js.map +1 -1
  279. package/dist/server/hosted-session-manager.d.ts +2 -0
  280. package/dist/server/hosted-session-manager.d.ts.map +1 -1
  281. package/dist/server/hosted-session-manager.js +9 -0
  282. package/dist/server/hosted-session-manager.js.map +1 -1
  283. package/dist/server/model-selection.d.ts.map +1 -1
  284. package/dist/server/model-selection.js +9 -1
  285. package/dist/server/model-selection.js.map +1 -1
  286. package/dist/server/rate-limiter.d.ts +1 -1
  287. package/dist/server/rate-limiter.js +1 -1
  288. package/dist/server/rate-limiter.js.map +1 -1
  289. package/dist/server/router.d.ts +2 -2
  290. package/dist/server/router.js.map +1 -1
  291. package/dist/server/session-serialization.d.ts +9 -9
  292. package/dist/server/session-serialization.js +15 -15
  293. package/dist/server/session-serialization.js.map +1 -1
  294. package/dist/session/manager.d.ts +5 -0
  295. package/dist/session/manager.d.ts.map +1 -1
  296. package/dist/session/manager.js +56 -8
  297. package/dist/session/manager.js.map +1 -1
  298. package/dist/session/session-catalog.d.ts +2 -0
  299. package/dist/session/session-catalog.d.ts.map +1 -1
  300. package/dist/session/session-catalog.js +6 -0
  301. package/dist/session/session-catalog.js.map +1 -1
  302. package/dist/session/session-context.d.ts +2 -0
  303. package/dist/session/session-context.d.ts.map +1 -1
  304. package/dist/session/session-context.js +15 -0
  305. package/dist/session/session-context.js.map +1 -1
  306. package/dist/session/types.d.ts +7 -0
  307. package/dist/session/types.d.ts.map +1 -1
  308. package/dist/session/types.js.map +1 -1
  309. package/dist/session/wire-format.generated.d.ts +1 -0
  310. package/dist/session/wire-format.generated.d.ts.map +1 -1
  311. package/dist/session/wire-format.generated.js +1 -0
  312. package/dist/session/wire-format.generated.js.map +1 -1
  313. package/dist/shared-memory/contract.d.ts +4 -4
  314. package/dist/shared-memory/contract.js +2 -2
  315. package/dist/shared-memory/contract.js.map +1 -1
  316. package/dist/telemetry/index.d.ts +2 -2
  317. package/dist/telemetry/index.d.ts.map +1 -1
  318. package/dist/telemetry/index.js +2 -2
  319. package/dist/telemetry/index.js.map +1 -1
  320. package/dist/telemetry/maestro-event-bus.d.ts +57 -0
  321. package/dist/telemetry/maestro-event-bus.d.ts.map +1 -1
  322. package/dist/telemetry/maestro-event-bus.js +59 -1
  323. package/dist/telemetry/maestro-event-bus.js.map +1 -1
  324. package/dist/telemetry/maestro-event-catalog.d.ts +17 -1
  325. package/dist/telemetry/maestro-event-catalog.d.ts.map +1 -1
  326. package/dist/telemetry/maestro-event-catalog.js +24 -0
  327. package/dist/telemetry/maestro-event-catalog.js.map +1 -1
  328. package/dist/telemetry/mcp-beacon.d.ts +2 -0
  329. package/dist/telemetry/mcp-beacon.d.ts.map +1 -1
  330. package/dist/telemetry/mcp-beacon.js +15 -0
  331. package/dist/telemetry/mcp-beacon.js.map +1 -1
  332. package/dist/telemetry/metrics.d.ts +62 -0
  333. package/dist/telemetry/metrics.d.ts.map +1 -1
  334. package/dist/telemetry/metrics.js +84 -0
  335. package/dist/telemetry/metrics.js.map +1 -1
  336. package/dist/telemetry.d.ts +44 -0
  337. package/dist/telemetry.d.ts.map +1 -1
  338. package/dist/telemetry.js +84 -2
  339. package/dist/telemetry.js.map +1 -1
  340. package/dist/theme/theme-loader.js +2 -2
  341. package/dist/theme/theme-loader.js.map +1 -1
  342. package/dist/theme/theme-schema.json +2 -2
  343. package/dist/theme/theme.d.ts +1 -1
  344. package/dist/theme/theme.js.map +1 -1
  345. package/dist/tools/background/task-types.d.ts +1 -1
  346. package/dist/tools/extract-document.d.ts +1 -0
  347. package/dist/tools/extract-document.d.ts.map +1 -1
  348. package/dist/tools/extract-document.js +2 -1
  349. package/dist/tools/extract-document.js.map +1 -1
  350. package/dist/tools/index.d.ts +55 -55
  351. package/dist/tools/index.js +1 -1
  352. package/dist/tools/index.js.map +1 -1
  353. package/dist/tools/tool-dsl.d.ts +1 -1
  354. package/dist/tools/tool-dsl.js +1 -1
  355. package/dist/tools/tool-dsl.js.map +1 -1
  356. package/dist/utils/document-extractor.d.ts +1 -0
  357. package/dist/utils/document-extractor.d.ts.map +1 -1
  358. package/dist/utils/document-extractor.js +320 -40
  359. package/dist/utils/document-extractor.js.map +1 -1
  360. package/dist/utils/logger.d.ts +1 -1
  361. package/dist/utils/logger.js +1 -1
  362. package/dist/utils/logger.js.map +1 -1
  363. package/dist/version.json +2 -2
  364. package/dist/web-server.d.ts +1 -1
  365. package/dist/web-server.d.ts.map +1 -1
  366. package/dist/web-server.js +12 -8
  367. package/dist/web-server.js.map +1 -1
  368. package/package.json +4 -2
  369. package/dist/oauth/anthropic.d.ts +0 -17
  370. package/dist/oauth/anthropic.d.ts.map +0 -1
  371. package/dist/oauth/anthropic.js +0 -81
  372. package/dist/oauth/anthropic.js.map +0 -1
  373. package/dist/providers/anthropic-auth.d.ts +0 -75
  374. package/dist/providers/anthropic-auth.d.ts.map +0 -1
  375. package/dist/providers/anthropic-auth.js +0 -221
  376. package/dist/providers/anthropic-auth.js.map +0 -1
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @fileoverview Type Guards for Composer Agent Messages and Content
2
+ * @fileoverview Type Guards for Maestro Agent Messages and Content
3
3
  *
4
4
  * This module provides type guard functions for safely narrowing message
5
5
  * and content types at runtime. Use these guards when working with the
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @fileoverview Type Guards for Composer Agent Messages and Content
2
+ * @fileoverview Type Guards for Maestro Agent Messages and Content
3
3
  *
4
4
  * This module provides type guard functions for safely narrowing message
5
5
  * and content types at runtime. Use these guards when working with the
@@ -1 +1 @@
1
- {"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../../src/agent/type-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAkBH,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAC5B,GAAmC;IAEnC,OAAO,CACN,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,MAAM,IAAI,GAAG;QACZ,GAAwB,CAAC,IAAI,KAAK,MAAM,CACzC,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,kBAAkB,CACjC,GAAmC;IAEnC,OAAO,CACN,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,MAAM,IAAI,GAAG;QACZ,GAAwB,CAAC,IAAI,KAAK,WAAW,CAC9C,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,mBAAmB,CAClC,GAAmC;IAEnC,OAAO,CACN,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,MAAM,IAAI,GAAG;QACZ,GAAwB,CAAC,IAAI,KAAK,YAAY,CAC/C,CAAC;AACH,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAAC,GAAyB;IACtD,OAAO,CAC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Type Guards for Composer Agent Messages and Content\n *\n * This module provides type guard functions for safely narrowing message\n * and content types at runtime. Use these guards when working with the\n * discriminated union types to get proper TypeScript type inference.\n *\n * @example\n * ```typescript\n * import { isUserMessage, isToolCall } from \"./type-guards.js\";\n *\n * function processMessage(msg: AppMessage) {\n * if (isUserMessage(msg)) {\n * // TypeScript knows msg is UserMessage here\n * console.log(\"User said:\", msg.content);\n * }\n * }\n * ```\n *\n * @module agent/type-guards\n */\n\nimport type {\n\tAppMessage,\n\tAssistantMessage,\n\tBranchSummaryMessage,\n\tCompactionSummaryMessage,\n\tHookMessage,\n\tImageContent,\n\tMessage,\n\tTextContent,\n\tThinkingContent,\n\tToolCall,\n\tToolResultMessage,\n\tUserMessage,\n\tUserMessageWithAttachments,\n} from \"./types.js\";\n\n// ============================================================================\n// Message Type Guards\n// ============================================================================\n\n/**\n * Check if a message is a UserMessage.\n *\n * @example\n * ```typescript\n * if (isUserMessage(msg)) {\n * // msg is UserMessage - can access msg.content safely\n * }\n * ```\n */\nexport function isUserMessage(\n\tmsg: AppMessage | Message | unknown,\n): msg is UserMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"user\"\n\t);\n}\n\n/**\n * Check if a message is an AssistantMessage.\n *\n * @example\n * ```typescript\n * if (isAssistantMessage(msg)) {\n * // msg is AssistantMessage - can access msg.content, msg.usage, etc.\n * }\n * ```\n */\nexport function isAssistantMessage(\n\tmsg: AppMessage | Message | unknown,\n): msg is AssistantMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"assistant\"\n\t);\n}\n\n/**\n * Check if a message is a ToolResultMessage.\n *\n * @example\n * ```typescript\n * if (isToolResultMessage(msg)) {\n * // msg is ToolResultMessage - can access msg.toolCallId, msg.toolName, etc.\n * }\n * ```\n */\nexport function isToolResultMessage(\n\tmsg: AppMessage | Message | unknown,\n): msg is ToolResultMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"toolResult\"\n\t);\n}\n\n/**\n * Check if a message is a HookMessage.\n *\n * @example\n * ```typescript\n * if (isHookMessage(msg)) {\n * // msg is HookMessage - can access msg.customType, msg.display, etc.\n * }\n * ```\n */\nexport function isHookMessage(msg: AppMessage | unknown): msg is HookMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"hookMessage\"\n\t);\n}\n\n/**\n * Check if a message is a BranchSummaryMessage.\n *\n * @example\n * ```typescript\n * if (isBranchSummaryMessage(msg)) {\n * // msg is BranchSummaryMessage - can access msg.summary, msg.fromId\n * }\n * ```\n */\nexport function isBranchSummaryMessage(\n\tmsg: AppMessage | unknown,\n): msg is BranchSummaryMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"branchSummary\"\n\t);\n}\n\n/**\n * Check if a message is a CompactionSummaryMessage.\n *\n * @example\n * ```typescript\n * if (isCompactionSummaryMessage(msg)) {\n * // msg is CompactionSummaryMessage - can access msg.summary, msg.tokensBefore\n * }\n * ```\n */\nexport function isCompactionSummaryMessage(\n\tmsg: AppMessage | unknown,\n): msg is CompactionSummaryMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"compactionSummary\"\n\t);\n}\n\n/**\n * Check if a message is a UserMessageWithAttachments.\n *\n * Note: This returns true for any UserMessage. To check specifically\n * for attachments, use `isUserMessageWithAttachments(msg) && msg.attachments?.length`.\n *\n * @example\n * ```typescript\n * if (isUserMessageWithAttachments(msg) && msg.attachments?.length) {\n * // msg has attachments\n * }\n * ```\n */\nexport function isUserMessageWithAttachments(\n\tmsg: AppMessage | unknown,\n): msg is UserMessageWithAttachments {\n\treturn isUserMessage(msg);\n}\n\n/**\n * Check if a message has attachments (is a UserMessage with non-empty attachments array).\n *\n * @example\n * ```typescript\n * if (hasAttachments(msg)) {\n * // msg.attachments is guaranteed to be a non-empty array\n * }\n * ```\n */\nexport function hasAttachments(\n\tmsg: AppMessage | unknown,\n): msg is UserMessageWithAttachments & {\n\tattachments: NonNullable<UserMessageWithAttachments[\"attachments\"]>;\n} {\n\tif (!isUserMessage(msg) || !(\"attachments\" in msg)) {\n\t\treturn false;\n\t}\n\tconst attachments = (msg as UserMessageWithAttachments).attachments;\n\treturn Array.isArray(attachments) && attachments.length > 0;\n}\n\n/**\n * Check if a message is a core LLM message type (user, assistant, or toolResult).\n *\n * @example\n * ```typescript\n * if (isLLMMessage(msg)) {\n * // msg is Message (UserMessage | AssistantMessage | ToolResultMessage)\n * }\n * ```\n */\nexport function isLLMMessage(msg: AppMessage | unknown): msg is Message {\n\treturn (\n\t\tisUserMessage(msg) || isAssistantMessage(msg) || isToolResultMessage(msg)\n\t);\n}\n\n// ============================================================================\n// Content Type Guards\n// ============================================================================\n\n/**\n * Check if content is TextContent.\n *\n * @example\n * ```typescript\n * for (const block of assistantMsg.content) {\n * if (isTextContent(block)) {\n * console.log(block.text);\n * }\n * }\n * ```\n */\nexport function isTextContent(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is TextContent {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"text\"\n\t);\n}\n\n/**\n * Check if content is ThinkingContent.\n *\n * @example\n * ```typescript\n * for (const block of assistantMsg.content) {\n * if (isThinkingContent(block)) {\n * console.log(\"Thinking:\", block.thinking);\n * }\n * }\n * ```\n */\nexport function isThinkingContent(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is ThinkingContent {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"thinking\"\n\t);\n}\n\n/**\n * Check if content is ImageContent.\n *\n * @example\n * ```typescript\n * for (const block of toolResult.content) {\n * if (isImageContent(block)) {\n * console.log(\"Image:\", block.mimeType);\n * }\n * }\n * ```\n */\nexport function isImageContent(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is ImageContent {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"image\"\n\t);\n}\n\n/**\n * Check if content is a ToolCall.\n *\n * @example\n * ```typescript\n * for (const block of assistantMsg.content) {\n * if (isToolCall(block)) {\n * console.log(\"Tool:\", block.name, \"Args:\", block.arguments);\n * }\n * }\n * ```\n */\nexport function isToolCall(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is ToolCall {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"toolCall\"\n\t);\n}\n\n// ============================================================================\n// Utility Type Guards\n// ============================================================================\n\n/**\n * Get all tool calls from an AssistantMessage.\n *\n * @example\n * ```typescript\n * const toolCalls = getToolCalls(assistantMsg);\n * for (const call of toolCalls) {\n * console.log(`Calling ${call.name} with`, call.arguments);\n * }\n * ```\n */\nexport function getToolCalls(msg: AssistantMessage): ToolCall[] {\n\treturn msg.content.filter(isToolCall);\n}\n\n/**\n * Get all text content from an AssistantMessage, concatenated.\n *\n * @example\n * ```typescript\n * const text = getTextContent(assistantMsg);\n * console.log(\"Assistant said:\", text);\n * ```\n */\nexport function getTextContent(msg: AssistantMessage): string {\n\treturn msg.content\n\t\t.filter(isTextContent)\n\t\t.map((block) => block.text)\n\t\t.join(\"\");\n}\n\n/**\n * Get all thinking content from an AssistantMessage, concatenated.\n *\n * @example\n * ```typescript\n * const thinking = getThinkingContent(assistantMsg);\n * if (thinking) {\n * console.log(\"Assistant thought:\", thinking);\n * }\n * ```\n */\nexport function getThinkingContent(msg: AssistantMessage): string {\n\treturn msg.content\n\t\t.filter(isThinkingContent)\n\t\t.map((block) => block.thinking)\n\t\t.join(\"\");\n}\n\n/**\n * Check if an AssistantMessage contains any tool calls.\n *\n * @example\n * ```typescript\n * if (hasToolCalls(assistantMsg)) {\n * // Message contains tool invocations\n * }\n * ```\n */\nexport function hasToolCalls(msg: AssistantMessage): boolean {\n\treturn msg.content.some(isToolCall);\n}\n\n/**\n * Get the plain text content from a UserMessage.\n *\n * Handles both string content and array content formats.\n *\n * @example\n * ```typescript\n * const text = getUserMessageText(userMsg);\n * console.log(\"User said:\", text);\n * ```\n */\nexport function getUserMessageText(msg: UserMessage): string {\n\tif (typeof msg.content === \"string\") {\n\t\treturn msg.content;\n\t}\n\treturn msg.content\n\t\t.filter(isTextContent)\n\t\t.map((block) => block.text)\n\t\t.join(\"\");\n}\n\n/**\n * Get the first tool call from an AssistantMessage, if any.\n *\n * @example\n * ```typescript\n * const firstCall = getFirstToolCall(assistantMsg);\n * if (firstCall) {\n * console.log(\"First tool:\", firstCall.name);\n * }\n * ```\n */\nexport function getFirstToolCall(msg: AssistantMessage): ToolCall | undefined {\n\treturn msg.content.find(isToolCall);\n}\n\n/**\n * Check if a ToolResultMessage represents an error.\n *\n * @example\n * ```typescript\n * if (isErrorResult(toolResult)) {\n * console.error(\"Tool failed:\", toolResult.toolName);\n * }\n * ```\n */\nexport function isErrorResult(msg: ToolResultMessage): boolean {\n\treturn msg.isError === true;\n}\n\n/**\n * Get the last AssistantMessage from a message array.\n *\n * @example\n * ```typescript\n * const lastAssistant = getLastAssistantMessage(messages);\n * if (lastAssistant) {\n * console.log(\"Last response:\", getTextContent(lastAssistant));\n * }\n * ```\n */\nexport function getLastAssistantMessage(\n\tmessages: AppMessage[],\n): AssistantMessage | undefined {\n\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\tconst msg = messages[i];\n\t\tif (isAssistantMessage(msg)) {\n\t\t\treturn msg;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Get the last UserMessage from a message array.\n *\n * @example\n * ```typescript\n * const lastUser = getLastUserMessage(messages);\n * if (lastUser) {\n * console.log(\"Last user input:\", getUserMessageText(lastUser));\n * }\n * ```\n */\nexport function getLastUserMessage(\n\tmessages: AppMessage[],\n): UserMessage | undefined {\n\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\tconst msg = messages[i];\n\t\tif (isUserMessage(msg)) {\n\t\t\treturn msg;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Count messages by role type.\n *\n * @example\n * ```typescript\n * const counts = countMessagesByRole(messages);\n * console.log(`${counts.user} user, ${counts.assistant} assistant messages`);\n * ```\n */\nexport function countMessagesByRole(messages: AppMessage[]): {\n\tuser: number;\n\tassistant: number;\n\ttoolResult: number;\n\tother: number;\n} {\n\tconst counts = { user: 0, assistant: 0, toolResult: 0, other: 0 };\n\tfor (const msg of messages) {\n\t\tif (isUserMessage(msg)) counts.user++;\n\t\telse if (isAssistantMessage(msg)) counts.assistant++;\n\t\telse if (isToolResultMessage(msg)) counts.toolResult++;\n\t\telse counts.other++;\n\t}\n\treturn counts;\n}\n\n/**\n * Extract all image content from any message content array.\n *\n * @example\n * ```typescript\n * const images = getImageContent(toolResult.content);\n * console.log(`Found ${images.length} images`);\n * ```\n */\nexport function getImageContent(\n\tcontent: Array<TextContent | ThinkingContent | ImageContent | ToolCall>,\n): ImageContent[] {\n\treturn content.filter(isImageContent);\n}\n"]}
1
+ {"version":3,"file":"type-guards.js","sourceRoot":"","sources":["../../src/agent/type-guards.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAkBH,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAC5B,GAAmC;IAEnC,OAAO,CACN,OAAO,G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,GAAG,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,EAAE,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAClE,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE,CAAC;QAC5B,IAAI,aAAa,CAAC,GAAG,CAAC;YAAE,MAAM,CAAC,IAAI,EAAE,CAAC;aACjC,IAAI,kBAAkB,CAAC,GAAG,CAAC;YAAE,MAAM,CAAC,SAAS,EAAE,CAAC;aAChD,IAAI,mBAAmB,CAAC,GAAG,CAAC;YAAE,MAAM,CAAC,UAAU,EAAE,CAAC;;YAClD,MAAM,CAAC,KAAK,EAAE,CAAC;IACrB,CAAC;IACD,OAAO,MAAM,CAAC;AACf,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAC9B,OAAuE;IAEvE,OAAO,OAAO,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;AACvC,CAAC","sourcesContent":["/**\n * @fileoverview Type Guards for Maestro Agent Messages and Content\n *\n * This module provides type guard functions for safely narrowing message\n * and content types at runtime. Use these guards when working with the\n * discriminated union types to get proper TypeScript type inference.\n *\n * @example\n * ```typescript\n * import { isUserMessage, isToolCall } from \"./type-guards.js\";\n *\n * function processMessage(msg: AppMessage) {\n * if (isUserMessage(msg)) {\n * // TypeScript knows msg is UserMessage here\n * console.log(\"User said:\", msg.content);\n * }\n * }\n * ```\n *\n * @module agent/type-guards\n */\n\nimport type {\n\tAppMessage,\n\tAssistantMessage,\n\tBranchSummaryMessage,\n\tCompactionSummaryMessage,\n\tHookMessage,\n\tImageContent,\n\tMessage,\n\tTextContent,\n\tThinkingContent,\n\tToolCall,\n\tToolResultMessage,\n\tUserMessage,\n\tUserMessageWithAttachments,\n} from \"./types.js\";\n\n// ============================================================================\n// Message Type Guards\n// ============================================================================\n\n/**\n * Check if a message is a UserMessage.\n *\n * @example\n * ```typescript\n * if (isUserMessage(msg)) {\n * // msg is UserMessage - can access msg.content safely\n * }\n * ```\n */\nexport function isUserMessage(\n\tmsg: AppMessage | Message | unknown,\n): msg is UserMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"user\"\n\t);\n}\n\n/**\n * Check if a message is an AssistantMessage.\n *\n * @example\n * ```typescript\n * if (isAssistantMessage(msg)) {\n * // msg is AssistantMessage - can access msg.content, msg.usage, etc.\n * }\n * ```\n */\nexport function isAssistantMessage(\n\tmsg: AppMessage | Message | unknown,\n): msg is AssistantMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"assistant\"\n\t);\n}\n\n/**\n * Check if a message is a ToolResultMessage.\n *\n * @example\n * ```typescript\n * if (isToolResultMessage(msg)) {\n * // msg is ToolResultMessage - can access msg.toolCallId, msg.toolName, etc.\n * }\n * ```\n */\nexport function isToolResultMessage(\n\tmsg: AppMessage | Message | unknown,\n): msg is ToolResultMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"toolResult\"\n\t);\n}\n\n/**\n * Check if a message is a HookMessage.\n *\n * @example\n * ```typescript\n * if (isHookMessage(msg)) {\n * // msg is HookMessage - can access msg.customType, msg.display, etc.\n * }\n * ```\n */\nexport function isHookMessage(msg: AppMessage | unknown): msg is HookMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"hookMessage\"\n\t);\n}\n\n/**\n * Check if a message is a BranchSummaryMessage.\n *\n * @example\n * ```typescript\n * if (isBranchSummaryMessage(msg)) {\n * // msg is BranchSummaryMessage - can access msg.summary, msg.fromId\n * }\n * ```\n */\nexport function isBranchSummaryMessage(\n\tmsg: AppMessage | unknown,\n): msg is BranchSummaryMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"branchSummary\"\n\t);\n}\n\n/**\n * Check if a message is a CompactionSummaryMessage.\n *\n * @example\n * ```typescript\n * if (isCompactionSummaryMessage(msg)) {\n * // msg is CompactionSummaryMessage - can access msg.summary, msg.tokensBefore\n * }\n * ```\n */\nexport function isCompactionSummaryMessage(\n\tmsg: AppMessage | unknown,\n): msg is CompactionSummaryMessage {\n\treturn (\n\t\ttypeof msg === \"object\" &&\n\t\tmsg !== null &&\n\t\t\"role\" in msg &&\n\t\t(msg as { role: string }).role === \"compactionSummary\"\n\t);\n}\n\n/**\n * Check if a message is a UserMessageWithAttachments.\n *\n * Note: This returns true for any UserMessage. To check specifically\n * for attachments, use `isUserMessageWithAttachments(msg) && msg.attachments?.length`.\n *\n * @example\n * ```typescript\n * if (isUserMessageWithAttachments(msg) && msg.attachments?.length) {\n * // msg has attachments\n * }\n * ```\n */\nexport function isUserMessageWithAttachments(\n\tmsg: AppMessage | unknown,\n): msg is UserMessageWithAttachments {\n\treturn isUserMessage(msg);\n}\n\n/**\n * Check if a message has attachments (is a UserMessage with non-empty attachments array).\n *\n * @example\n * ```typescript\n * if (hasAttachments(msg)) {\n * // msg.attachments is guaranteed to be a non-empty array\n * }\n * ```\n */\nexport function hasAttachments(\n\tmsg: AppMessage | unknown,\n): msg is UserMessageWithAttachments & {\n\tattachments: NonNullable<UserMessageWithAttachments[\"attachments\"]>;\n} {\n\tif (!isUserMessage(msg) || !(\"attachments\" in msg)) {\n\t\treturn false;\n\t}\n\tconst attachments = (msg as UserMessageWithAttachments).attachments;\n\treturn Array.isArray(attachments) && attachments.length > 0;\n}\n\n/**\n * Check if a message is a core LLM message type (user, assistant, or toolResult).\n *\n * @example\n * ```typescript\n * if (isLLMMessage(msg)) {\n * // msg is Message (UserMessage | AssistantMessage | ToolResultMessage)\n * }\n * ```\n */\nexport function isLLMMessage(msg: AppMessage | unknown): msg is Message {\n\treturn (\n\t\tisUserMessage(msg) || isAssistantMessage(msg) || isToolResultMessage(msg)\n\t);\n}\n\n// ============================================================================\n// Content Type Guards\n// ============================================================================\n\n/**\n * Check if content is TextContent.\n *\n * @example\n * ```typescript\n * for (const block of assistantMsg.content) {\n * if (isTextContent(block)) {\n * console.log(block.text);\n * }\n * }\n * ```\n */\nexport function isTextContent(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is TextContent {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"text\"\n\t);\n}\n\n/**\n * Check if content is ThinkingContent.\n *\n * @example\n * ```typescript\n * for (const block of assistantMsg.content) {\n * if (isThinkingContent(block)) {\n * console.log(\"Thinking:\", block.thinking);\n * }\n * }\n * ```\n */\nexport function isThinkingContent(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is ThinkingContent {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"thinking\"\n\t);\n}\n\n/**\n * Check if content is ImageContent.\n *\n * @example\n * ```typescript\n * for (const block of toolResult.content) {\n * if (isImageContent(block)) {\n * console.log(\"Image:\", block.mimeType);\n * }\n * }\n * ```\n */\nexport function isImageContent(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is ImageContent {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"image\"\n\t);\n}\n\n/**\n * Check if content is a ToolCall.\n *\n * @example\n * ```typescript\n * for (const block of assistantMsg.content) {\n * if (isToolCall(block)) {\n * console.log(\"Tool:\", block.name, \"Args:\", block.arguments);\n * }\n * }\n * ```\n */\nexport function isToolCall(\n\tcontent: TextContent | ThinkingContent | ImageContent | ToolCall | unknown,\n): content is ToolCall {\n\treturn (\n\t\ttypeof content === \"object\" &&\n\t\tcontent !== null &&\n\t\t\"type\" in content &&\n\t\t(content as { type: string }).type === \"toolCall\"\n\t);\n}\n\n// ============================================================================\n// Utility Type Guards\n// ============================================================================\n\n/**\n * Get all tool calls from an AssistantMessage.\n *\n * @example\n * ```typescript\n * const toolCalls = getToolCalls(assistantMsg);\n * for (const call of toolCalls) {\n * console.log(`Calling ${call.name} with`, call.arguments);\n * }\n * ```\n */\nexport function getToolCalls(msg: AssistantMessage): ToolCall[] {\n\treturn msg.content.filter(isToolCall);\n}\n\n/**\n * Get all text content from an AssistantMessage, concatenated.\n *\n * @example\n * ```typescript\n * const text = getTextContent(assistantMsg);\n * console.log(\"Assistant said:\", text);\n * ```\n */\nexport function getTextContent(msg: AssistantMessage): string {\n\treturn msg.content\n\t\t.filter(isTextContent)\n\t\t.map((block) => block.text)\n\t\t.join(\"\");\n}\n\n/**\n * Get all thinking content from an AssistantMessage, concatenated.\n *\n * @example\n * ```typescript\n * const thinking = getThinkingContent(assistantMsg);\n * if (thinking) {\n * console.log(\"Assistant thought:\", thinking);\n * }\n * ```\n */\nexport function getThinkingContent(msg: AssistantMessage): string {\n\treturn msg.content\n\t\t.filter(isThinkingContent)\n\t\t.map((block) => block.thinking)\n\t\t.join(\"\");\n}\n\n/**\n * Check if an AssistantMessage contains any tool calls.\n *\n * @example\n * ```typescript\n * if (hasToolCalls(assistantMsg)) {\n * // Message contains tool invocations\n * }\n * ```\n */\nexport function hasToolCalls(msg: AssistantMessage): boolean {\n\treturn msg.content.some(isToolCall);\n}\n\n/**\n * Get the plain text content from a UserMessage.\n *\n * Handles both string content and array content formats.\n *\n * @example\n * ```typescript\n * const text = getUserMessageText(userMsg);\n * console.log(\"User said:\", text);\n * ```\n */\nexport function getUserMessageText(msg: UserMessage): string {\n\tif (typeof msg.content === \"string\") {\n\t\treturn msg.content;\n\t}\n\treturn msg.content\n\t\t.filter(isTextContent)\n\t\t.map((block) => block.text)\n\t\t.join(\"\");\n}\n\n/**\n * Get the first tool call from an AssistantMessage, if any.\n *\n * @example\n * ```typescript\n * const firstCall = getFirstToolCall(assistantMsg);\n * if (firstCall) {\n * console.log(\"First tool:\", firstCall.name);\n * }\n * ```\n */\nexport function getFirstToolCall(msg: AssistantMessage): ToolCall | undefined {\n\treturn msg.content.find(isToolCall);\n}\n\n/**\n * Check if a ToolResultMessage represents an error.\n *\n * @example\n * ```typescript\n * if (isErrorResult(toolResult)) {\n * console.error(\"Tool failed:\", toolResult.toolName);\n * }\n * ```\n */\nexport function isErrorResult(msg: ToolResultMessage): boolean {\n\treturn msg.isError === true;\n}\n\n/**\n * Get the last AssistantMessage from a message array.\n *\n * @example\n * ```typescript\n * const lastAssistant = getLastAssistantMessage(messages);\n * if (lastAssistant) {\n * console.log(\"Last response:\", getTextContent(lastAssistant));\n * }\n * ```\n */\nexport function getLastAssistantMessage(\n\tmessages: AppMessage[],\n): AssistantMessage | undefined {\n\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\tconst msg = messages[i];\n\t\tif (isAssistantMessage(msg)) {\n\t\t\treturn msg;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Get the last UserMessage from a message array.\n *\n * @example\n * ```typescript\n * const lastUser = getLastUserMessage(messages);\n * if (lastUser) {\n * console.log(\"Last user input:\", getUserMessageText(lastUser));\n * }\n * ```\n */\nexport function getLastUserMessage(\n\tmessages: AppMessage[],\n): UserMessage | undefined {\n\tfor (let i = messages.length - 1; i >= 0; i--) {\n\t\tconst msg = messages[i];\n\t\tif (isUserMessage(msg)) {\n\t\t\treturn msg;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Count messages by role type.\n *\n * @example\n * ```typescript\n * const counts = countMessagesByRole(messages);\n * console.log(`${counts.user} user, ${counts.assistant} assistant messages`);\n * ```\n */\nexport function countMessagesByRole(messages: AppMessage[]): {\n\tuser: number;\n\tassistant: number;\n\ttoolResult: number;\n\tother: number;\n} {\n\tconst counts = { user: 0, assistant: 0, toolResult: 0, other: 0 };\n\tfor (const msg of messages) {\n\t\tif (isUserMessage(msg)) counts.user++;\n\t\telse if (isAssistantMessage(msg)) counts.assistant++;\n\t\telse if (isToolResultMessage(msg)) counts.toolResult++;\n\t\telse counts.other++;\n\t}\n\treturn counts;\n}\n\n/**\n * Extract all image content from any message content array.\n *\n * @example\n * ```typescript\n * const images = getImageContent(toolResult.content);\n * console.log(`Found ${images.length} images`);\n * ```\n */\nexport function getImageContent(\n\tcontent: Array<TextContent | ThinkingContent | ImageContent | ToolCall>,\n): ImageContent[] {\n\treturn content.filter(isImageContent);\n}\n"]}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @fileoverview Core Type Definitions for Composer Agent
2
+ * @fileoverview Core Type Definitions for Maestro Agent
3
3
  *
4
- * This module defines the fundamental types used throughout the Composer AI system,
4
+ * This module defines the fundamental types used throughout the Maestro AI system,
5
5
  * including message formats, tool definitions, model configurations, and agent state.
6
6
  *
7
7
  * ## Type Categories
@@ -38,6 +38,7 @@ import type { PromptMetadata } from "../prompts/types.js";
38
38
  import type { SkillArtifactMetadata } from "../skills/artifact-metadata.js";
39
39
  import type { CheckpointProfiler } from "../utils/checkpoint-profiler.js";
40
40
  import type { ActionApprovalDecision, ActionApprovalRequest } from "./action-approval.js";
41
+ import type { ToolCapabilityMetadata } from "./tool-capability-types.js";
41
42
  import type { ToolRetryDecision, ToolRetryRequest } from "./tool-retry.js";
42
43
  /**
43
44
  * API format identifier for different LLM provider APIs.
@@ -537,6 +538,7 @@ export interface McpToolSourceMetadata {
537
538
  type: "mcp";
538
539
  server: string;
539
540
  tool: string;
541
+ capability?: ToolCapabilityMetadata;
540
542
  supportsParallelToolCalls?: boolean;
541
543
  parallelSafetyProvenance?: "static_config" | "server_capability" | "none";
542
544
  parallelMaxConcurrency?: number;
@@ -1488,7 +1490,7 @@ export interface StreamOptions {
1488
1490
  /** Current working directory for local provider runtimes. */
1489
1491
  cwd?: string;
1490
1492
  /** Authentication type for the request */
1491
- authType?: "api-key" | "anthropic-oauth";
1493
+ authType?: "api-key" | "bearer-token";
1492
1494
  /** Optional Anthropic API-side task budget for the current turn */
1493
1495
  taskBudget?: {
1494
1496
  total: number;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEH,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,8BAA8B,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAC5E,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,KAAK,EACX,sBAAsB,EACtB,qBAAqB,EACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,KAAK,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAE3E;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,GAAG,GACZ,oBAAoB,GACpB,kBAAkB,GAClB,wBAAwB,GACxB,yBAAyB,GACzB,oBAAoB,GACpB,sBAAsB,GACtB,mBAAmB,GACnB,kBAAkB,GAClB,WAAW,GACX,iBAAiB,CAAC;AAErB,MAAM,WAAW,qBAAqB;IACrC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,6EAA6E;IAC7E,oBAAoB,CAAC,EAAE,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c,EACtB,MAAM,CAAC,EAAE,WAAW,GAClB,aAAa,CAAC,UAAU,CAAC,CAAC;IAE7B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED;;;;;GAKG;AACH,MAAM,WAAW,aAAa;IAC7B,iEAAiE;IACjE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gDAAgD;IAChD,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,sEAAsE;IACtE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtC,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,QAAQ,CAAC,EAAE,SAAS,GAAG,cAAc,CAAC;IACtC,mEAAmE;IACnE,UAAU,CAAC,EAAE;QACZ,KAAK,EAAE,MAAM,CAAC;QACd,SAAS,CAAC,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,6EAA6E;IAC7E,kBAAkB,CAAC,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,OAAO,CAAC,eAAe,CAAC,CAAC;CACtE;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IAClC,2DAA2D;IAC3D,IAAI,EAAE,WAAW,CAAC;CAClB"}
@@ -1,7 +1,7 @@
1
1
  /**
2
- * @fileoverview Core Type Definitions for Composer Agent
2
+ * @fileoverview Core Type Definitions for Maestro Agent
3
3
  *
4
- * This module defines the fundamental types used throughout the Composer AI system,
4
+ * This module defines the fundamental types used throughout the Maestro AI system,
5
5
  * including message formats, tool definitions, model configurations, and agent state.
6
6
  *
7
7
  * ## Type Categories
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG","sourcesContent":["/**\n * @fileoverview Core Type Definitions for Composer Agent\n *\n * This module defines the fundamental types used throughout the Composer AI system,\n * including message formats, tool definitions, model configurations, and agent state.\n *\n * ## Type Categories\n *\n * ### Message Types\n * - {@link UserMessage} - Messages from the human user\n * - {@link AssistantMessage} - Responses from the AI assistant\n * - {@link ToolResultMessage} - Results from tool executions\n * - {@link Message} - Union of all message types\n *\n * ### Content Types\n * - {@link TextContent} - Plain text content blocks\n * - {@link ImageContent} - Base64-encoded images\n * - {@link ThinkingContent} - Extended reasoning traces\n * - {@link ToolCall} - Tool invocation requests\n *\n * ### Tool Types\n * - {@link Tool} - Tool definition schema (for API)\n * - {@link AgentTool} - Tool with execute function (for runtime)\n * - {@link AgentToolResult} - Return value from tool execution\n *\n * ### Configuration Types\n * - {@link Model} - LLM model configuration\n * - {@link AgentState} - Current state of an agent\n * - {@link AgentRunConfig} - Runtime configuration\n *\n * @module agent/types\n */\n\nimport type { GuardedFilesPolicySettings } from \"@evalops/contracts\";\nimport type { TSchema } from \"@sinclair/typebox\";\nimport type { PromptProjectDocManifest } from \"../config/index.js\";\nimport type { UnifiedContextManifest } from \"../context/manifest-types.js\";\nimport type { PromptMetadata } from \"../prompts/types.js\";\nimport type { SkillArtifactMetadata } from \"../skills/artifact-metadata.js\";\nimport type { CheckpointProfiler } from \"../utils/checkpoint-profiler.js\";\nimport type {\n\tActionApprovalDecision,\n\tActionApprovalRequest,\n} from \"./action-approval.js\";\nimport type { ToolRetryDecision, ToolRetryRequest } from \"./tool-retry.js\";\n\n/**\n * API format identifier for different LLM provider APIs.\n *\n * Each provider may support different API formats:\n * - `openai-completions` - OpenAI Chat Completions API\n * - `openai-responses` - OpenAI Responses API (newer format)\n * - `openai-codex-responses` - ChatGPT Codex Responses backend\n * - `openai-codex-app-server` - Local Codex app-server with ChatGPT sign-in\n * - `anthropic-messages` - Anthropic Messages API\n * - `google-generative-ai` - Google Generative AI (Gemini)\n * - `google-gemini-cli` - Google Cloud Code Assist (Gemini CLI)\n * - `bedrock-converse` - AWS Bedrock Converse API\n * - `scripted-replay` - Deterministic local scenario replay provider\n */\nexport type Api =\n\t| \"openai-completions\"\n\t| \"openai-responses\"\n\t| \"openai-codex-responses\"\n\t| \"openai-codex-app-server\"\n\t| \"anthropic-messages\"\n\t| \"google-generative-ai\"\n\t| \"google-gemini-cli\"\n\t| \"bedrock-converse\"\n\t| \"vertex-ai\"\n\t| \"scripted-replay\";\n\nexport interface OpenAICompatOverrides {\n\tsupportsStore?: boolean;\n\tsupportsDeveloperRole?: boolean;\n\tsupportsReasoningEffort?: boolean;\n\tsupportsResponsesApi?: boolean;\n\t/** Supports Anthropic-style cache_control (OpenRouter with Claude models) */\n\tsupportsCacheControl?: boolean;\n\tmaxTokensField?: \"max_tokens\" | \"max_completion_tokens\";\n\trequiresToolResultName?: boolean;\n\trequiresAssistantAfterToolResult?: boolean;\n\trequiresThinkingAsText?: boolean;\n\trequiresMistralToolIds?: boolean;\n}\n\n/**\n * Well-known LLM provider identifiers.\n *\n * These are the officially supported providers with built-in configurations:\n * - `anthropic` - Anthropic (Claude models)\n * - `bedrock` - AWS Bedrock\n * - `google` - Google AI (Gemini models)\n * - `openai` - OpenAI (GPT models)\n * - `azure-openai` - Azure OpenAI\n * - `writer` - Writer.com\n * - `xai` - xAI (Grok models)\n * - `groq` - Groq\n * - `cerebras` - Cerebras\n * - `openrouter` - OpenRouter (aggregator)\n * - `zai` - ZAI\n */\nexport type KnownProvider =\n\t| \"anthropic\"\n\t| \"bedrock\"\n\t| \"google\"\n\t| \"openai\"\n\t| \"openai-codex\"\n\t| \"azure-openai\"\n\t| \"writer\"\n\t| \"xai\"\n\t| \"groq\"\n\t| \"cerebras\"\n\t| \"openrouter\"\n\t| \"zai\";\n\n/**\n * Provider identifier - either a known provider or a custom string.\n * Custom providers can be used with OpenAI-compatible APIs.\n */\nexport type Provider = KnownProvider | string;\n\n/**\n * Reasoning effort level for models that support extended thinking.\n *\n * Higher levels produce more detailed reasoning at increased latency:\n * - `minimal` - Brief chain-of-thought hints\n * - `low` - Short reasoning steps\n * - `medium` - Moderate reasoning depth (recommended default)\n * - `high` - Thorough step-by-step reasoning\n * - `ultra` - Maximum reasoning depth (for complex problems)\n *\n * Note: Claude Code uses keywords \"think\", \"think hard\", \"think harder\", \"ultrathink\"\n * which map to low, medium, high, ultra respectively.\n */\nexport type ReasoningEffort = \"minimal\" | \"low\" | \"medium\" | \"high\" | \"ultra\";\n\n/**\n * Plain text content block within a message.\n *\n * @example\n * ```typescript\n * const content: TextContent = {\n * type: \"text\",\n * text: \"Hello, how can I help you today?\"\n * };\n * ```\n */\nexport interface TextContent {\n\t/** Discriminator for content block type */\n\ttype: \"text\";\n\t/** The text content */\n\ttext: string;\n\t/** Optional signature for content verification */\n\ttextSignature?: string;\n}\n\n/**\n * Extended thinking/reasoning content block.\n *\n * Contains the model's internal reasoning process when extended\n * thinking is enabled. This is typically hidden from end users\n * but useful for debugging and understanding model behavior.\n */\nexport interface ThinkingContent {\n\t/** Discriminator for content block type */\n\ttype: \"thinking\";\n\t/** The thinking/reasoning trace */\n\tthinking: string;\n\t/** Optional signature for content verification */\n\tthinkingSignature?: string;\n}\n\n/**\n * Base64-encoded image content block.\n *\n * Used for including images in user messages (vision input)\n * or tool results (screenshots, generated images).\n *\n * @example\n * ```typescript\n * const image: ImageContent = {\n * type: \"image\",\n * data: \"iVBORw0KGgo...\", // base64 encoded\n * mimeType: \"image/png\"\n * };\n * ```\n */\nexport interface ImageContent {\n\t/** Discriminator for content block type */\n\ttype: \"image\";\n\t/** Base64-encoded image data */\n\tdata: string;\n\t/** MIME type (e.g., \"image/png\", \"image/jpeg\") */\n\tmimeType: string;\n}\n\n/**\n * Tool invocation request within an assistant message.\n *\n * When the model decides to use a tool, it emits a ToolCall\n * content block specifying which tool to call and with what arguments.\n *\n * @example\n * ```typescript\n * const toolCall: ToolCall = {\n * type: \"toolCall\",\n * id: \"call_abc123\",\n * name: \"read\",\n * arguments: { file_path: \"/src/index.ts\" }\n * };\n * ```\n */\nexport interface ToolCall {\n\t/** Discriminator for content block type */\n\ttype: \"toolCall\";\n\t/** Unique identifier for this tool call (used to match results) */\n\tid: string;\n\t/** Name of the tool to invoke */\n\tname: string;\n\t/** Arguments to pass to the tool */\n\targuments: Record<string, unknown>;\n\t/**\n\t * Provider-specific signature used by some APIs (notably Gemini 3) to\n\t * associate tool calls with preceding thoughts. If present, it must be\n\t * preserved across turns when replaying the message history back to the provider.\n\t */\n\tthoughtSignature?: string;\n}\n\nexport type ToolSchedulingDecisionKind =\n\t| \"scheduled\"\n\t| \"parallelized\"\n\t| \"delayed\"\n\t| \"serialized\"\n\t| \"cached\"\n\t| \"skipped\";\n\nexport interface ToolSchedulingDecision {\n\t/** Tool call identifier; duplicated here for standalone telemetry use. */\n\tcallId: string;\n\t/** Tool name, never arguments. */\n\ttoolName: string;\n\t/** Zero-based order from the model-emitted tool-call list. */\n\temittedIndex: number;\n\t/** Scheduler wave number when the call entered an execution wave. */\n\twaveIndex?: number;\n\t/** Scheduler outcome for this call. */\n\tdecision: ToolSchedulingDecisionKind;\n\t/** Stable reason code; intentionally avoids raw paths and arguments. */\n\treason: string;\n\t/** Time spent waiting inside the scheduler after model emission. */\n\tschedulerWaitMs?: number;\n\t/** True when an MCP server opt-in made the call parallel-safe. */\n\tmcpOptIn?: boolean;\n\t/** True when execution was served from reusable tool-result state. */\n\tcacheHit?: boolean;\n\t/** True when an in-flight mutation forced a wait or serialization. */\n\tblockedByMutation?: boolean;\n}\n\nexport type ToolPhaseDecisionOutcome =\n\t| \"parallelized\"\n\t| \"serialized\"\n\t| \"delayed\"\n\t| \"cached\"\n\t| \"skipped\";\n\nexport interface ToolPhaseDecision {\n\ttoolCallId: string;\n\ttoolName: string;\n\temittedIndex: number;\n\toutcome: ToolPhaseDecisionOutcome;\n\tdecision: ToolPhaseDecisionOutcome;\n\treason: string;\n\twaveIndex?: number;\n\twaitMs: number;\n\tschedulerWaitMs: number;\n\tmcpOptIn?: boolean;\n\tcacheHit?: boolean;\n\tblockedByMutation?: boolean;\n}\n\nexport interface ToolPhaseBatchShapingFeedback {\n\tavoidableSingleton: boolean;\n\treason: string;\n\thint: string;\n}\n\nexport interface ToolPhaseSummary {\n\ttype: \"tool_phase_summary\";\n\tmodelToolCallCount: number;\n\tmodelEmittedToolCallCount: number;\n\tschedulableWaveCount: number;\n\tparallelizedCallCount: number;\n\tactuallyParallelizedCallCount: number;\n\tserializedCallCount: number;\n\tdelayedCallCount: number;\n\tblockedByMutationCount: number;\n\tmcpOptInCallCount: number;\n\tmcpOptInUseCount: number;\n\tcacheHitCount: number;\n\ttotalToolWaitMs: number;\n\ttoolWaitTimeMs: number;\n\tserializationReasons: Record<string, number>;\n\tdecisions: ToolPhaseDecision[];\n\tbatchShapingFeedback?: ToolPhaseBatchShapingFeedback;\n}\n\n/**\n * Token usage and cost information for a message or request.\n *\n * Tracks input/output tokens and cache utilization for cost monitoring\n * and context window management.\n */\nexport interface Usage {\n\t/** Number of input tokens consumed */\n\tinput: number;\n\t/** Number of output tokens generated */\n\toutput: number;\n\t/** Tokens served from prompt cache (reduces cost) */\n\tcacheRead: number;\n\t/** Tokens written to prompt cache */\n\tcacheWrite: number;\n\t/** Calculated cost breakdown in USD */\n\tcost: {\n\t\t/** Cost for input tokens */\n\t\tinput: number;\n\t\t/** Cost for output tokens */\n\t\toutput: number;\n\t\t/** Cost savings from cache reads */\n\t\tcacheRead: number;\n\t\t/** Cost for cache writes */\n\t\tcacheWrite: number;\n\t\t/** Total cost for this message/request */\n\t\ttotal: number;\n\t};\n}\n\n/**\n * Reason why the model stopped generating.\n *\n * - `stop` - Natural completion (end of response)\n * - `length` - Hit max_tokens limit\n * - `toolUse` - Model wants to use a tool (generation paused)\n * - `error` - An error occurred during generation\n * - `aborted` - Request was cancelled by the user\n */\nexport type StopReason = \"stop\" | \"length\" | \"toolUse\" | \"error\" | \"aborted\";\n\n/**\n * Message from the human user.\n *\n * User messages can contain plain text or an array of content blocks\n * (for multi-modal input with images).\n *\n * @example\n * ```typescript\n * // Simple text message\n * const msg: UserMessage = {\n * role: \"user\",\n * content: \"What is this code doing?\",\n * timestamp: Date.now()\n * };\n *\n * // Message with image\n * const multiModal: UserMessage = {\n * role: \"user\",\n * content: [\n * { type: \"text\", text: \"What's in this screenshot?\" },\n * { type: \"image\", data: base64Data, mimeType: \"image/png\" }\n * ],\n * timestamp: Date.now()\n * };\n * ```\n */\nexport interface UserMessage {\n\t/** Message role discriminator */\n\trole: \"user\";\n\t/** Message content - string or array of content blocks */\n\tcontent: string | (TextContent | ImageContent)[];\n\t/** Optional non-LLM metadata for runtime bookkeeping */\n\tmetadata?: Record<string, unknown>;\n\t/** Unix timestamp in milliseconds when message was created */\n\ttimestamp: number;\n}\n\n/**\n * Response message from the AI assistant.\n *\n * Contains the model's response along with metadata about the generation\n * including token usage, stop reason, and provider information.\n *\n * The content array may contain:\n * - {@link TextContent} - The actual response text\n * - {@link ThinkingContent} - Extended reasoning (if enabled)\n * - {@link ToolCall} - Tool invocation requests\n */\nexport interface AssistantMessage {\n\t/** Message role discriminator */\n\trole: \"assistant\";\n\t/** Array of content blocks (text, thinking, tool calls) */\n\tcontent: (TextContent | ThinkingContent | ToolCall)[];\n\t/** API format used for this response */\n\tapi: Api;\n\t/** Provider that generated this response */\n\tprovider: Provider;\n\t/** Model ID that generated this response */\n\tmodel: string;\n\t/** Token usage and cost information */\n\tusage: Usage;\n\t/** Reason why generation stopped */\n\tstopReason: StopReason;\n\t/** Error message if stopReason is \"error\" */\n\terrorMessage?: string;\n\t/** Unix timestamp in milliseconds when message was created */\n\ttimestamp: number;\n}\n\n/**\n * Result message from a tool execution.\n *\n * After a tool is executed, the result is sent back to the model\n * as a ToolResultMessage so it can incorporate the information\n * into its response.\n *\n * @typeParam TDetails - Type of additional details attached to the result\n *\n * @example\n * ```typescript\n * const result: ToolResultMessage = {\n * role: \"toolResult\",\n * toolCallId: \"call_abc123\",\n * toolName: \"read\",\n * content: [{ type: \"text\", text: \"file contents...\" }],\n * isError: false,\n * timestamp: Date.now()\n * };\n * ```\n */\nexport interface ToolResultMessage<TDetails = unknown> {\n\t/** Message role discriminator */\n\trole: \"toolResult\";\n\t/** ID of the tool call this result corresponds to */\n\ttoolCallId: string;\n\t/** Name of the tool that was executed */\n\ttoolName: string;\n\t/** Result content (text or images) */\n\tcontent: (TextContent | ImageContent)[];\n\t/** Optional additional details about the execution */\n\tdetails?: TDetails;\n\t/** Whether the tool execution resulted in an error */\n\tisError: boolean;\n\t/** Unix timestamp in milliseconds when result was created */\n\ttimestamp: number;\n}\n\n/**\n * Message type for hook-injected messages.\n *\n * Hooks can inject these into the conversation. They are converted to user\n * messages for LLM context and can optionally be hidden from the UI.\n */\nexport interface HookMessage<T = unknown> {\n\t/** Message role discriminator */\n\trole: \"hookMessage\";\n\t/** Hook-defined message category */\n\tcustomType: string;\n\t/** Message content - string or array of content blocks */\n\tcontent: string | (TextContent | ImageContent)[];\n\t/** Whether to render this message in the UI */\n\tdisplay: boolean;\n\t/** Optional hook-specific metadata (not sent to the LLM) */\n\tdetails?: T;\n\t/** Unix timestamp in milliseconds when message was created */\n\ttimestamp: number;\n}\n\n/**\n * Message type for branch summaries when navigating session trees.\n */\nexport interface BranchSummaryMessage {\n\t/** Message role discriminator */\n\trole: \"branchSummary\";\n\t/** Summary text */\n\tsummary: string;\n\t/** ID of the branch point this summary came from */\n\tfromId: string;\n\t/** Unix timestamp in milliseconds when summary was created */\n\ttimestamp: number;\n}\n\n/**\n * Message type for compaction summaries.\n */\nexport interface CompactionSummaryMessage {\n\t/** Message role discriminator */\n\trole: \"compactionSummary\";\n\t/** Summary text */\n\tsummary: string;\n\t/** Token count before compaction (for diagnostics) */\n\ttokensBefore: number;\n\t/** Unix timestamp in milliseconds when summary was created */\n\ttimestamp: number;\n}\n\n/**\n * Union type representing LLM-native messages that can be sent to the model.\n *\n * A conversation with the LLM consists of user input, assistant responses,\n * and tool results.\n */\nexport type Message = UserMessage | AssistantMessage | ToolResultMessage;\n\n/**\n * Empty interface for declaration merging to add custom message types.\n *\n * Consumers can extend this interface to add their own message types:\n *\n * @example\n * ```typescript\n * declare module \"@evalops/maestro\" {\n * interface CustomAgentMessages {\n * notification: { role: \"notification\"; text: string; timestamp: number };\n * }\n * }\n * ```\n */\n// biome-ignore lint/suspicious/noEmptyInterface: Required for declaration merging\nexport interface CustomAgentMessages {}\n\n/**\n * Union type representing all messages in the agent conversation history.\n *\n * Includes both LLM-native messages (user, assistant, toolResult) and\n * custom message types (hookMessage, branchSummary, compactionSummary,\n * plus any types added via declaration merging).\n *\n * Custom messages are preserved in session history but filtered out\n * before being sent to the LLM via {@link convertToLlm}.\n */\nexport type AgentMessage =\n\t| Message\n\t| HookMessage\n\t| BranchSummaryMessage\n\t| CompactionSummaryMessage\n\t| CustomAgentMessages[keyof CustomAgentMessages];\n\n/**\n * Tool definition schema for API serialization.\n *\n * This interface defines a tool's metadata and parameter schema\n * for transmission to the LLM. The actual execution logic is in\n * {@link AgentTool}.\n *\n * @typeParam TParameters - TypeBox schema for the tool's parameters\n *\n * @example\n * ```typescript\n * import { Type } from \"@sinclair/typebox\";\n *\n * const readTool: Tool = {\n * name: \"read\",\n * description: \"Read a file from the filesystem\",\n * parameters: Type.Object({\n * file_path: Type.String({ description: \"Path to the file\" })\n * })\n * };\n * ```\n */\nexport interface Tool<TParameters extends TSchema = TSchema> {\n\t/** Unique tool identifier */\n\tname: string;\n\t/** Human-readable description of what the tool does */\n\tdescription: string;\n\t/** TypeBox schema defining the tool's parameters */\n\tparameters: TParameters;\n\t/** Optional categorization (e.g., \"file\", \"shell\", \"web\") */\n\ttoolType?: string;\n\t/** Example inputs for documentation/few-shot prompting */\n\tinputExamples?: unknown[];\n\t/** List of caller identifiers allowed to use this tool */\n\tallowedCallers?: string[];\n\t/** If true, don't send tool definition to API (used for internal tools) */\n\tdeferApiDefinition?: boolean;\n}\n\n/**\n * Behavioral hints for tools (from MCP annotations).\n *\n * These hints help the model and UI understand the tool's behavior\n * for better decision-making and user feedback.\n */\nexport interface ToolAnnotations {\n\t/** If true, the tool does not modify its environment (safe to retry) */\n\treadOnlyHint?: boolean;\n\t/** If true, the tool may perform destructive/irreversible updates */\n\tdestructiveHint?: boolean;\n\t/** If true, mutating calls are scoped to explicit path arguments */\n\tpathScopedMutationHint?: boolean;\n\t/** If true, calling repeatedly with same args has no additional effect */\n\tidempotentHint?: boolean;\n\t/** If true, the tool interacts with external systems (network, APIs) */\n\topenWorldHint?: boolean;\n}\n\nexport interface McpToolSourceMetadata {\n\ttype: \"mcp\";\n\tserver: string;\n\ttool: string;\n\tsupportsParallelToolCalls?: boolean;\n\tparallelSafetyProvenance?: \"static_config\" | \"server_capability\" | \"none\";\n\tparallelMaxConcurrency?: number;\n}\n\nexport type ToolSourceMetadata = McpToolSourceMetadata;\n\n/**\n * Complete tool definition with execute function.\n *\n * This is the runtime representation of a tool, including both\n * the schema (for the LLM) and the execute function (for the runtime).\n *\n * @typeParam TParameters - TypeBox schema for the tool's parameters\n * @typeParam TDetails - Type of additional details returned with results\n *\n * @example\n * ```typescript\n * import { Type } from \"@sinclair/typebox\";\n *\n * const readTool: AgentTool = {\n * name: \"read\",\n * description: \"Read a file from the filesystem\",\n * parameters: Type.Object({\n * file_path: Type.String()\n * }),\n * execute: async (toolCallId, params) => {\n * const content = await fs.readFile(params.file_path, \"utf-8\");\n * return { content: [{ type: \"text\", text: content }] };\n * }\n * };\n * ```\n */\nexport interface AgentTool<\n\tTParameters extends TSchema = TSchema,\n\tTDetails = unknown,\n> {\n\t/** Unique tool identifier */\n\tname: string;\n\t/** Display label for UI (defaults to name) */\n\tlabel?: string;\n\t/** Human-readable description of what the tool does */\n\tdescription: string;\n\t/** TypeBox schema defining the tool's parameters */\n\tparameters: TParameters;\n\t/** Tool behavior hints from MCP annotations */\n\tannotations?: ToolAnnotations;\n\t/** Exact runtime provenance for bridged or remote tool sources */\n\tsource?: ToolSourceMetadata;\n\t/** Optional categorization (e.g., \"file\", \"shell\", \"web\") */\n\ttoolType?: string;\n\t/**\n\t * Where the tool should be executed.\n\t * - `\"server\"`: (default) Executed by the backend agent\n\t * - `\"client\"`: Executed by the client (VS Code, browser) via callback\n\t */\n\texecutionLocation?: \"server\" | \"client\";\n\t/** Example inputs for documentation/few-shot prompting */\n\tinputExamples?: unknown[];\n\t/** List of caller identifiers allowed to use this tool */\n\tallowedCallers?: string[];\n\t/** If true, don't send tool definition to API */\n\tdeferApiDefinition?: boolean;\n\t/** Optional max retries configured by the tool itself */\n\tmaxRetries?: number;\n\t/** Optional retry delay configured by the tool itself */\n\tretryDelayMs?: number;\n\t/** Optional tool-level retry predicate */\n\tshouldRetry?: (error: unknown) => boolean;\n\t/** Optional compact summary used after a tool finishes. */\n\tgetToolUseSummary?: (params: Record<string, unknown>) => string | null;\n\t/** Optional human-facing label used for live tool UI. */\n\tgetDisplayName?: (params: Record<string, unknown>) => string | null;\n\t/** Optional present-tense activity label used while a tool is running. */\n\tgetActivityDescription?: (params: Record<string, unknown>) => string | null;\n\t/**\n\t * Execute the tool with the given parameters.\n\t *\n\t * @param toolCallId - Unique identifier for this tool call\n\t * @param params - Parameters matching the tool's schema\n\t * @param signal - Optional AbortSignal for cancellation\n\t * @param context - Optional execution context (sandbox, etc.)\n\t * @param onUpdate - Optional callback for partial tool output streaming\n\t * @returns Tool result with content and optional details\n\t */\n\texecute: (\n\t\ttoolCallId: string,\n\t\tparams: Record<string, unknown>,\n\t\tsignal?: AbortSignal,\n\t\tcontext?: { sandbox?: import(\"../sandbox/types.js\").Sandbox },\n\t\tonUpdate?: AgentToolUpdateCallback<TDetails>,\n\t) => AgentToolResult<TDetails> | Promise<AgentToolResult<TDetails>>;\n}\n\nexport type AgentToolUpdateCallback<TDetails = unknown> = (\n\tpartial: AgentToolResult<TDetails>,\n) => void;\n\n/**\n * Result returned from tool execution.\n *\n * @typeParam TDetails - Type of additional details attached to the result\n */\nexport interface AgentToolResult<TDetails = unknown> {\n\t/** Result content (text or images) */\n\tcontent: (TextContent | ImageContent)[];\n\t/** Optional additional details about the execution */\n\tdetails?: TDetails;\n\t/** Whether the execution resulted in an error */\n\tisError?: boolean;\n\t/** Optional Platform ToolExecution identifier used for audit joins */\n\ttoolExecutionId?: string;\n\t/** Optional Platform approval request identifier correlated to ToolExecution */\n\tapprovalRequestId?: string;\n}\n\n/**\n * Conversation context for LLM requests.\n *\n * Contains the system prompt, conversation history, and available tools\n * for a single LLM request.\n */\nexport interface Context {\n\t/** System prompt providing instructions and context */\n\tsystemPrompt?: string;\n\t/** Conversation history */\n\tmessages: Message[];\n\t/** Tools available for the model to use */\n\ttools?: Tool[];\n}\n\n/**\n * Streaming events during assistant message construction.\n *\n * These events are emitted as the LLM generates its response, enabling\n * real-time UI updates and progress tracking.\n *\n * ## Event Types\n *\n * | Type | Description |\n * |------|-------------|\n * | `start` | Message generation started |\n * | `text_start` | New text content block started |\n * | `text_delta` | Incremental text content |\n * | `text_end` | Text content block completed |\n * | `thinking_start` | Extended thinking block started |\n * | `thinking_delta` | Incremental thinking content |\n * | `thinking_end` | Thinking block completed |\n * | `toolcall_start` | Tool call started |\n * | `toolcall_delta` | Incremental tool call args |\n * | `toolcall_end` | Tool call completed |\n * | `done` | Generation completed successfully |\n * | `error` | Generation failed or was aborted |\n */\nexport type AssistantMessageEvent =\n\t| {\n\t\t\t/** Message generation started */\n\t\t\ttype: \"start\";\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** New text content block started */\n\t\t\ttype: \"text_start\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Incremental text content received */\n\t\t\ttype: \"text_delta\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** New text to append */\n\t\t\tdelta: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Text content block completed */\n\t\t\ttype: \"text_end\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Final text content */\n\t\t\tcontent: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Extended thinking block started */\n\t\t\ttype: \"thinking_start\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Incremental thinking content received */\n\t\t\ttype: \"thinking_delta\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** New thinking text to append */\n\t\t\tdelta: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Thinking content block completed */\n\t\t\ttype: \"thinking_end\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Final thinking content */\n\t\t\tcontent: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Tool call started */\n\t\t\ttype: \"toolcall_start\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Incremental tool call arguments received */\n\t\t\ttype: \"toolcall_delta\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** New JSON fragment to append to arguments */\n\t\t\tdelta: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Tool call completed */\n\t\t\ttype: \"toolcall_end\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Completed tool call */\n\t\t\ttoolCall: ToolCall;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Provider-owned tool execution started outside Maestro's local executor */\n\t\t\ttype: \"provider_tool_execution_start\";\n\t\t\t/** Provider tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Provider tool name */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Provider tool arguments */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Provider-owned tool execution produced an incremental update */\n\t\t\ttype: \"provider_tool_execution_update\";\n\t\t\t/** Provider tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Provider tool name */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Provider tool arguments */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Partial provider result */\n\t\t\tpartialResult: AgentToolResult;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Provider-owned tool execution completed outside Maestro's local executor */\n\t\t\ttype: \"provider_tool_execution_end\";\n\t\t\t/** Provider tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Provider tool name */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Provider tool result */\n\t\t\tresult: ToolResultMessage;\n\t\t\t/** Whether the provider tool returned an error */\n\t\t\tisError: boolean;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Optional Platform approval request identifier correlated to ToolExecution */\n\t\t\tapprovalRequestId?: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Generation completed successfully */\n\t\t\ttype: \"done\";\n\t\t\t/** Reason for completion */\n\t\t\treason: Extract<StopReason, \"stop\" | \"length\" | \"toolUse\">;\n\t\t\t/** Final assistant message */\n\t\t\tmessage: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Generation failed or was aborted */\n\t\t\ttype: \"error\";\n\t\t\t/** Reason for failure */\n\t\t\treason: Extract<StopReason, \"aborted\" | \"error\">;\n\t\t\t/** Error message details */\n\t\t\terror: AssistantMessage;\n\t };\n\n/**\n * LLM model configuration.\n *\n * Contains all the information needed to use a model, including\n * API endpoints, capabilities, and pricing.\n *\n * @typeParam TApi - The API format this model uses\n *\n * @example\n * ```typescript\n * const claude: Model<\"anthropic-messages\"> = {\n * id: \"claude-sonnet-4-5-20250929\",\n * name: \"Claude Sonnet 4.5\",\n * api: \"anthropic-messages\",\n * provider: \"anthropic\",\n * baseUrl: \"https://api.anthropic.com/v1\",\n * reasoning: true,\n * input: [\"text\", \"image\"],\n * cost: { input: 3.00, output: 15.00, cacheRead: 0.30, cacheWrite: 3.75 },\n * contextWindow: 200000,\n * maxTokens: 8192\n * };\n * ```\n */\nexport interface Model<TApi extends Api> {\n\t/** Unique model identifier (e.g., \"claude-sonnet-4-5-20250929\") */\n\tid: string;\n\t/** Human-readable model name (e.g., \"Claude Sonnet 4.5\") */\n\tname: string;\n\t/** API format used for requests */\n\tapi: TApi;\n\t/** Provider serving this model */\n\tprovider: Provider;\n\t/** Base URL for API requests */\n\tbaseUrl: string;\n\t/** Optional custom headers to include in API requests */\n\theaders?: Record<string, string>;\n\t/** Optional OpenAI-compatibility overrides for vendor quirks */\n\tcompat?: OpenAICompatOverrides;\n\t/** Whether the model supports extended thinking */\n\treasoning: boolean;\n\t/** Whether the model supports tool use */\n\ttoolUse?: boolean;\n\t/** Supported input modalities */\n\tinput: (\"text\" | \"image\")[];\n\t/** Cost per million tokens in USD */\n\tcost: {\n\t\t/** Input token cost */\n\t\tinput: number;\n\t\t/** Output token cost */\n\t\toutput: number;\n\t\t/** Cache read cost (typically discounted) */\n\t\tcacheRead: number;\n\t\t/** Cache write cost */\n\t\tcacheWrite: number;\n\t};\n\t/** Maximum context window in tokens */\n\tcontextWindow: number;\n\t/** Maximum output tokens per response */\n\tmaxTokens: number;\n}\n\n/**\n * File attachment for messages.\n *\n * Represents an uploaded file (image or document) that can be\n * included in a user message.\n */\nexport interface Attachment {\n\t/** Unique identifier for this attachment */\n\tid: string;\n\t/** Type of attachment */\n\ttype: \"image\" | \"document\";\n\t/** Original filename */\n\tfileName: string;\n\t/** MIME type of the file */\n\tmimeType: string;\n\t/** File size in bytes */\n\tsize: number;\n\t/** Base64-encoded file content */\n\tcontent: string;\n\t/** Extracted text content (for documents) */\n\textractedText?: string;\n\t/** Preview image (for documents) */\n\tpreview?: string;\n}\n\n/**\n * User-configurable thinking level for extended reasoning.\n *\n * Controls how much computational effort the model spends on\n * reasoning before generating a response.\n *\n * - `off` - No extended thinking\n * - `minimal` - Brief reasoning hints\n * - `low` - Short reasoning steps\n * - `medium` - Moderate reasoning (default)\n * - `high` - Thorough step-by-step reasoning\n * - `max` - Maximum reasoning depth\n */\nexport type ThinkingLevel =\n\t| \"off\"\n\t| \"minimal\"\n\t| \"low\"\n\t| \"medium\"\n\t| \"high\"\n\t| \"ultra\"\n\t| \"max\";\n\n/**\n * User message with optional file attachments.\n *\n * Extends the base UserMessage to support file attachments\n * for rich multi-modal interactions.\n */\nexport type UserMessageWithAttachments = UserMessage & {\n\t/** Optional file attachments */\n\tattachments?: Attachment[];\n};\n\n/**\n * Placeholder for custom message types.\n * Can be extended to add application-specific message types.\n */\nexport interface CustomMessages {\n\thookMessage: HookMessage;\n\tbranchSummary: BranchSummaryMessage;\n\tcompactionSummary: CompactionSummaryMessage;\n}\n\n/**\n * Application-level message type.\n *\n * Union of all message types that can appear in the UI,\n * including user messages with attachments.\n */\nexport type AppMessage =\n\t| AssistantMessage\n\t| UserMessageWithAttachments\n\t| Message\n\t| CustomMessages[keyof CustomMessages];\n\n/**\n * Information about a tool call currently being executed.\n */\nexport interface PendingToolCall {\n\t/** Name of the tool being executed */\n\ttoolName: string;\n\t/** Original arguments passed to the tool */\n\targs?: Record<string, unknown>;\n\t/** Tool metadata captured when execution started */\n\ttool?: Pick<\n\t\tAgentTool,\n\t\t\"label\" | \"getDisplayName\" | \"getToolUseSummary\" | \"getActivityDescription\"\n\t>;\n\t/** Stable display name for live UI */\n\tdisplayName?: string;\n\t/** Stable compact summary for live UI */\n\tsummaryLabel?: string;\n}\n\n/**\n * Current state of an agent instance.\n *\n * This is the central state object managed by the Agent class,\n * containing all information about the current conversation,\n * configuration, and execution status.\n */\nexport interface AgentState {\n\t/** System prompt providing instructions and context */\n\tsystemPrompt: string;\n\t/** Version/hash metadata for the base system prompt instructions */\n\tpromptMetadata?: PromptMetadata;\n\t/** Exact prompt source files layered into the current system prompt */\n\tsystemPromptSourcePaths?: string[];\n\t/** Manifest of project instruction files layered into the current system prompt */\n\tpromptContextManifest?: PromptProjectDocManifest;\n\t/** Full filesystem and MCP context provenance captured for this run */\n\tunifiedContextManifest?: UnifiedContextManifest;\n\t/** Current model configuration */\n\tmodel: Model<Api>;\n\t/** Current thinking level for extended reasoning */\n\tthinkingLevel: ThinkingLevel;\n\t/** Optional reasoning summary preference for Responses API */\n\treasoningSummary?: \"auto\" | \"detailed\" | \"concise\" | null;\n\t/** Available tools for this agent */\n\ttools: AgentTool[];\n\t/**\n\t * Controls how queued steering messages are sent between turns.\n\t * - `\"all\"` - Send all queued messages at once\n\t * - `\"one\"` - Send one message at a time\n\t */\n\tsteeringMode: \"all\" | \"one\";\n\t/**\n\t * Controls how queued follow-up messages are sent between turns.\n\t * - `\"all\"` - Send all queued messages at once\n\t * - `\"one\"` - Send one message at a time\n\t */\n\tfollowUpMode: \"all\" | \"one\";\n\t/**\n\t * @deprecated Use steeringMode/followUpMode instead.\n\t */\n\tqueueMode: \"all\" | \"one\";\n\t/** Conversation history */\n\tmessages: AppMessage[];\n\t/** Whether the agent is currently streaming a response */\n\tisStreaming: boolean;\n\t/** Current streaming message (partial response) */\n\tstreamMessage: Message | null;\n\t/** Tool calls currently being executed */\n\tpendingToolCalls: Map<string, PendingToolCall>;\n\t/** Current error message, if any */\n\terror?: string;\n\t/** Optional sandbox for isolated tool execution */\n\tsandbox?: import(\"../sandbox/types.js\").Sandbox;\n\t/** Current sandbox mode (e.g., \"docker\", \"local\") */\n\tsandboxMode?: string | null;\n\t/** Whether sandboxing is enabled */\n\tsandboxEnabled?: boolean;\n\t/** User identification for tracking */\n\tuser?: {\n\t\t/** User UUID */\n\t\tid: string;\n\t\t/** Organization UUID */\n\t\torgId: string;\n\t};\n\t/** Session information for persistence */\n\tsession?: {\n\t\t/** Session UUID */\n\t\tid: string;\n\t\t/** When the session started */\n\t\tstartedAt: Date;\n\t};\n\t/** Sampling temperature override (0.0-2.0, lower = more deterministic) */\n\ttemperature?: number;\n\t/** Top-p sampling override (0.0-1.0) */\n\ttopP?: number;\n}\n\n/**\n * Events emitted during agent execution.\n *\n * These events provide real-time updates about agent activity,\n * enabling UI updates, logging, and progress tracking.\n *\n * ## Lifecycle Events\n * - `agent_start` - Agent execution started\n * - `agent_end` - Agent execution completed\n * - `turn_start` - New conversation turn started\n * - `turn_end` - Conversation turn completed\n *\n * ## Message Events\n * - `message_start` - New message being constructed\n * - `message_update` - Incremental message update\n * - `message_end` - Message completed\n *\n * ## Tool Events\n * - `tool_execution_start` - Tool execution started\n * - `tool_execution_update` - Tool execution produced partial output\n * - `tool_execution_end` - Tool execution completed\n * - `tool_batch_summary` - Tool batch completed with a transient summary label\n * - `client_tool_request` - Client-side tool invocation needed\n *\n * ## Approval Events\n * - `action_approval_required` - User approval needed\n * - `action_approval_resolved` - User made approval decision\n *\n * ## Tool Retry Events\n * - `tool_retry_required` - Tool failed and retry decision needed\n * - `tool_retry_resolved` - Tool retry decision resolved\n *\n * ## Status Events\n * - `status` - Status update\n * - `error` - Error occurred\n * - `compaction` - Context was compacted\n */\nexport interface ToolSchedulingMetadata {\n\tclassification:\n\t\t| \"read_only\"\n\t\t| \"path_scoped_mutation\"\n\t\t| \"parallel_safe_mutation\"\n\t\t| \"serialized_mutation\"\n\t\t| \"workflow_serialized\"\n\t\t| \"cache_reuse\"\n\t\t| \"unknown\";\n\treason:\n\t\t| \"read_only_tool\"\n\t\t| \"mcp_parallel_opt_in\"\n\t\t| \"path_scope_available\"\n\t\t| \"path_scope_disjoint\"\n\t\t| \"path_scope_overlap\"\n\t\t| \"pending_mutation\"\n\t\t| \"mutating_tool\"\n\t\t| \"workflow_state_tracker\"\n\t\t| \"cache_hit\"\n\t\t| \"cache_pending\"\n\t\t| \"unknown_tool\";\n\tconcurrencyLimit?: number;\n\tqueueDepth?: number;\n\tpendingMutations?: number;\n\tpathScope?: string[];\n\tpathScopeSource?: \"annotation\" | \"known_tool\";\n\tpathArgumentKeys?: string[];\n\tcache?: \"disabled\" | \"miss\" | \"candidate\" | \"pending_hit\" | \"hit\";\n}\n\nexport type AgentEvent =\n\t| {\n\t\t\t/** Agent execution started */\n\t\t\ttype: \"agent_start\";\n\t\t\t/** Whether this execution is an automatic continuation of the current turn */\n\t\t\tcontinuation?: boolean;\n\t }\n\t| {\n\t\t\t/** Agent execution completed */\n\t\t\ttype: \"agent_end\";\n\t\t\t/** Final messages from this execution */\n\t\t\tmessages: AppMessage[];\n\t\t\t/** Whether execution was aborted */\n\t\t\taborted?: boolean;\n\t\t\t/** If aborted with partial acceptance, contains the saved partial message */\n\t\t\tpartialAccepted?: AppMessage;\n\t\t\t/** Final stop reason from the LLM - \"length\" indicates output hit the max token limit */\n\t\t\tstopReason?: StopReason;\n\t }\n\t| {\n\t\t\t/** Status update during execution */\n\t\t\ttype: \"status\";\n\t\t\t/** Status message */\n\t\t\tstatus: string;\n\t\t\t/** Additional details */\n\t\t\tdetails: Record<string, unknown>;\n\t }\n\t| {\n\t\t\t/** Error occurred during execution */\n\t\t\ttype: \"error\";\n\t\t\t/** Error message */\n\t\t\tmessage: string;\n\t }\n\t| {\n\t\t\t/** New conversation turn started */\n\t\t\ttype: \"turn_start\";\n\t }\n\t| {\n\t\t\t/** Conversation turn completed */\n\t\t\ttype: \"turn_end\";\n\t\t\t/** Assistant message from this turn */\n\t\t\tmessage: AppMessage;\n\t\t\t/** Tool results from this turn */\n\t\t\ttoolResults: AppMessage[];\n\t }\n\t| {\n\t\t\t/** New message being constructed */\n\t\t\ttype: \"message_start\";\n\t\t\t/** The message being built */\n\t\t\tmessage: AppMessage;\n\t }\n\t| {\n\t\t\t/** Incremental update to current message */\n\t\t\ttype: \"message_update\";\n\t\t\t/** Updated message state */\n\t\t\tmessage: AppMessage;\n\t\t\t/** The streaming event that triggered this update */\n\t\t\tassistantMessageEvent: AssistantMessageEvent;\n\t }\n\t| {\n\t\t\t/** Message completed */\n\t\t\ttype: \"message_end\";\n\t\t\t/** Final message */\n\t\t\tmessage: AppMessage;\n\t }\n\t| {\n\t\t\t/** Tool execution started */\n\t\t\ttype: \"tool_execution_start\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Arguments passed to the tool */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Scheduler classification and serialization reason for this call */\n\t\t\tscheduling?: ToolSchedulingMetadata;\n\t }\n\t| {\n\t\t\t/** Tool execution completed */\n\t\t\ttype: \"tool_execution_end\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Optional approval request identifier correlated to Platform ToolExecution */\n\t\t\tapprovalRequestId?: string;\n\t\t\t/** Optional stable error or outcome code for telemetry and clients */\n\t\t\terrorCode?: string;\n\t\t\t/** Optional governed outcome classification surfaced by the tool result */\n\t\t\tgovernedOutcome?:\n\t\t\t\t| \"approval_required\"\n\t\t\t\t| \"approval_pending\"\n\t\t\t\t| \"authentication_required\"\n\t\t\t\t| \"denied\"\n\t\t\t\t| \"rate_limited\";\n\t\t\t/** Optional selected skill artifact metadata surfaced by the tool result */\n\t\t\tskillMetadata?: SkillArtifactMetadata;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Result from the tool */\n\t\t\tresult: ToolResultMessage;\n\t\t\t/** Whether the tool returned an error */\n\t\t\tisError: boolean;\n\t\t\t/** Scheduler classification and final reuse/serialization reason */\n\t\t\tscheduling?: ToolSchedulingMetadata;\n\t }\n\t| {\n\t\t\t/** LSP diagnostic delta produced by an edit/write tool call */\n\t\t\ttype: \"diagnostic_delta\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** File affected by the diagnostic delta */\n\t\t\tfile: string;\n\t\t\t/** User-facing file path from the tool call */\n\t\t\tdisplayPath: string;\n\t\t\t/** Whether a pre-edit baseline was available */\n\t\t\tusedDelta: boolean;\n\t\t\t/** Newly introduced diagnostic count */\n\t\t\tintroducedCount: number;\n\t\t\t/** Diagnostics repaired by the tool call */\n\t\t\trepairedCount: number;\n\t\t\t/** Remaining diagnostics for the affected file */\n\t\t\tremainingCount: number;\n\t\t\t/** Stable fingerprint for introduced diagnostics */\n\t\t\tfingerprint: string;\n\t\t\t/** Repair attempt number for this fingerprint */\n\t\t\trepairAttempt?: number;\n\t\t\t/** Maximum automatic repair attempts for this fingerprint */\n\t\t\tmaxRepairAttempts?: number;\n\t\t\t/** Whether Agent queued a follow-up repair turn */\n\t\t\twillAutoFollowUp: boolean;\n\t\t\t/** Why a repair follow-up was or was not queued */\n\t\t\treason: string;\n\t }\n\t| {\n\t\t\t/** Summary emitted after the final tool in a batch completes */\n\t\t\ttype: \"tool_batch_summary\";\n\t\t\t/** Stable one-line summary of what the completed tool batch did */\n\t\t\tsummary: string;\n\t\t\t/** Underlying per-tool summary labels used to build the summary */\n\t\t\tsummaryLabels: string[];\n\t\t\t/** Tool call identifiers included in this batch */\n\t\t\ttoolCallIds: string[];\n\t\t\t/** Tool names included in this batch */\n\t\t\ttoolNames: string[];\n\t\t\t/** Successful tool calls in the batch */\n\t\t\tcallsSucceeded: number;\n\t\t\t/** Failed tool calls in the batch */\n\t\t\tcallsFailed: number;\n\t }\n\t| ToolPhaseSummary\n\t| {\n\t\t\t/** Tool execution produced partial output */\n\t\t\ttype: \"tool_execution_update\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Arguments passed to the tool */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Partial tool result */\n\t\t\tpartialResult: AgentToolResult;\n\t }\n\t| {\n\t\t\t/** User approval required for an action */\n\t\t\ttype: \"action_approval_required\";\n\t\t\t/** Details of the approval request */\n\t\t\trequest: ActionApprovalRequest;\n\t }\n\t| {\n\t\t\t/** User made approval decision */\n\t\t\ttype: \"action_approval_resolved\";\n\t\t\t/** The original request */\n\t\t\trequest: ActionApprovalRequest;\n\t\t\t/** User's decision */\n\t\t\tdecision: ActionApprovalDecision;\n\t }\n\t| {\n\t\t\t/** Tool failed and requires a retry decision */\n\t\t\ttype: \"tool_retry_required\";\n\t\t\t/** Details of the retry request */\n\t\t\trequest: ToolRetryRequest;\n\t }\n\t| {\n\t\t\t/** Tool retry decision resolved */\n\t\t\ttype: \"tool_retry_resolved\";\n\t\t\t/** The original request */\n\t\t\trequest: ToolRetryRequest;\n\t\t\t/** User or policy decision */\n\t\t\tdecision: ToolRetryDecision;\n\t }\n\t| {\n\t\t\t/** Client-side tool invocation needed */\n\t\t\ttype: \"client_tool_request\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Arguments for the tool */\n\t\t\targs: unknown;\n\t }\n\t| {\n\t\t\t/** Context was compacted (older messages summarized) */\n\t\t\ttype: \"compaction\";\n\t\t\t/** Generated summary of compacted messages */\n\t\t\tsummary: string;\n\t\t\t/** Index of first entry to keep (entries before were summarized) */\n\t\t\tfirstKeptEntryIndex: number;\n\t\t\t/** Token count before compaction */\n\t\t\ttokensBefore: number;\n\t\t\t/** Whether this was auto-triggered vs manual /compact */\n\t\t\tauto?: boolean;\n\t\t\t/** Custom instructions used for summarization */\n\t\t\tcustomInstructions?: string;\n\t\t\t/** Timestamp of compaction */\n\t\t\ttimestamp: string;\n\t }\n\t| {\n\t\t\t/** Auto-retry started for transient error (rate limit, overload, 5xx) */\n\t\t\ttype: \"auto_retry_start\";\n\t\t\t/** Current retry attempt (1-based) */\n\t\t\tattempt: number;\n\t\t\t/** Maximum number of retry attempts */\n\t\t\tmaxAttempts: number;\n\t\t\t/** Delay in milliseconds before retry */\n\t\t\tdelayMs: number;\n\t\t\t/** The error message that triggered the retry */\n\t\t\terrorMessage: string;\n\t }\n\t| {\n\t\t\t/** Auto-retry completed (success or final failure) */\n\t\t\ttype: \"auto_retry_end\";\n\t\t\t/** Whether the retry eventually succeeded */\n\t\t\tsuccess: boolean;\n\t\t\t/** Final attempt number */\n\t\t\tattempt: number;\n\t\t\t/** If failed, the final error message */\n\t\t\tfinalError?: string;\n\t };\n\n/**\n * Events emitted over streaming transports (SSE/WebSocket).\n *\n * Includes core agent events plus transport-level signals.\n */\nexport type AgentStreamEvent =\n\t| AgentEvent\n\t| { type: \"session_update\"; sessionId: string }\n\t| { type: \"heartbeat\" }\n\t| { type: \"aborted\" }\n\t| { type: \"done\" };\n\n/**\n * Message queued for sending to the LLM.\n *\n * Wraps the original message with an optional LLM-formatted version,\n * allowing for message transformation before sending.\n *\n * @typeParam TOriginal - Type of the original message\n */\nexport interface QueuedMessage<TOriginal = AppMessage> {\n\t/** Stable identifier for queue operations */\n\tid: number;\n\t/** When the message was queued */\n\tcreatedAt: number;\n\t/** Original message as received */\n\toriginal: TOriginal;\n\t/** Optional LLM-formatted version of the message */\n\tllm?: Message;\n}\n\n/**\n * Runtime configuration for agent execution.\n *\n * Passed to the transport layer when starting a new agent run,\n * containing all the configuration needed to execute a conversation turn.\n */\nexport interface AgentRunConfig {\n\t/** System prompt providing instructions and context */\n\tsystemPrompt: string;\n\t/** Tools available for this run */\n\ttools: AgentTool[];\n\t/** Model to use for generation */\n\tmodel: Model<Api>;\n\t/** Optional reasoning effort level */\n\treasoning?: ReasoningEffort;\n\t/** Optional reasoning summary preference for Responses API */\n\treasoningSummary?: \"auto\" | \"detailed\" | \"concise\" | null;\n\t/** Emit message_end for the initial user message (defaults to true). */\n\temitUserMessageEnd?: boolean;\n\t/** Function to retrieve steering messages for batch sending */\n\tgetSteeringMessages?: <T>() => Promise<QueuedMessage<T>[]>;\n\t/** Function to retrieve follow-up messages for batch sending */\n\tgetFollowUpMessages?: <T>() => Promise<QueuedMessage<T>[]>;\n\t/** Function to retrieve prompt-only messages for the next turn. */\n\tgetPromptOnlyMessages?: () => Promise<Message[]>;\n\t/** @deprecated Use getSteeringMessages/getFollowUpMessages instead */\n\tgetQueuedMessages?: <T>() => Promise<QueuedMessage<T>[]>;\n\t/**\n\t * Optional message preprocessor applied immediately before calling the LLM provider.\n\t *\n\t * Use this to implement provider-specific compatibility transforms (e.g., image limits,\n\t * signature preservation, prompt caching markers) without polluting the core tools.\n\t *\n\t * Note: This is a pure preprocessing hook. It should not execute tools or perform I/O.\n\t */\n\tpreprocessMessages?: (\n\t\tmessages: Message[],\n\t\tcontext: {\n\t\t\tsystemPrompt: string;\n\t\t\ttools: AgentTool[];\n\t\t\tmodel: Model<Api>;\n\t\t\tuserMessage?: Message;\n\t\t},\n\t\tsignal?: AbortSignal,\n\t) => Message[] | Promise<Message[]>;\n\t/** User identification for tracking */\n\tuser?: {\n\t\t/** User UUID */\n\t\tid: string;\n\t\t/** Organization UUID */\n\t\torgId: string;\n\t};\n\t/** Session information for persistence */\n\tsession?: {\n\t\t/** Session UUID */\n\t\tid: string;\n\t\t/** When the session started */\n\t\tstartedAt: Date;\n\t};\n\t/** User/org guarded-files override policy for this run */\n\tguardedFiles?: GuardedFilesPolicySettings;\n\t/** Optional helper function for running LLM queries (e.g., for summarization) */\n\trunLLM?: (systemPrompt: string, userPrompt: string) => Promise<string>;\n\t/** Optional debug checkpoint profiler for local query latency diagnostics. */\n\tqueryProfiler?: CheckpointProfiler;\n\t/** Optional sandbox for isolated tool execution */\n\tsandbox?: import(\"../sandbox/types.js\").Sandbox;\n\t/** Sampling temperature override (0.0-2.0, lower = more deterministic) */\n\ttemperature?: number;\n\t/** Top-p sampling override (0.0-1.0) */\n\ttopP?: number;\n\t/** Optional Anthropic API-side task budget for the current turn */\n\ttaskBudget?: {\n\t\ttotal: number;\n\t\tremaining?: number;\n\t};\n}\n\n/**\n * Transport interface for LLM communication.\n *\n * Implementors of this interface handle the actual communication\n * with the LLM provider, including streaming and tool execution.\n */\nexport interface AgentTransport {\n\t/**\n\t * Execute a conversation turn with a new user message.\n\t *\n\t * @param messages - Conversation history\n\t * @param userMessage - New user message\n\t * @param config - Runtime configuration\n\t * @param signal - Optional abort signal for cancellation\n\t * @returns Async iterable of agent events\n\t */\n\trun(\n\t\tmessages: Message[],\n\t\tuserMessage: Message,\n\t\tconfig: AgentRunConfig,\n\t\tsignal?: AbortSignal,\n\t): AsyncIterable<AgentEvent>;\n\n\t/**\n\t * Continue from current context without a new user message.\n\t *\n\t * Used for:\n\t * - Retrying after transient errors (rate limits, overload)\n\t * - Continuing after context compaction\n\t * - Resuming interrupted tool execution\n\t *\n\t * @param messages - Current conversation history\n\t * @param config - Runtime configuration\n\t * @param signal - Optional abort signal for cancellation\n\t * @returns Async iterable of agent events\n\t */\n\tcontinue(\n\t\tmessages: Message[],\n\t\tconfig: AgentRunConfig,\n\t\tsignal?: AbortSignal,\n\t): AsyncIterable<AgentEvent>;\n\n\t/**\n\t * Optional lightweight connectivity probe for UI health checks.\n\t */\n\tping?: () => Promise<void>;\n}\n\n/**\n * Options for streaming LLM requests.\n *\n * These options are passed to the transport layer when making\n * streaming requests to the LLM provider.\n */\nexport interface StreamOptions {\n\t/** Sampling temperature (0.0-2.0, lower = more deterministic) */\n\ttemperature?: number;\n\t/** Maximum tokens to generate */\n\tmaxTokens?: number;\n\t/** Abort signal for cancellation */\n\tsignal?: AbortSignal;\n\t/** API key for authentication */\n\tapiKey?: string;\n\t/** Additional headers to include in requests */\n\theaders?: Record<string, string>;\n\t/** Additional request body fields for provider-specific extensions */\n\trequestBody?: Record<string, unknown>;\n\t/** Stable session id for provider-side request grouping/cache keys */\n\tsessionId?: string;\n\t/** Current working directory for local provider runtimes. */\n\tcwd?: string;\n\t/** Authentication type for the request */\n\tauthType?: \"api-key\" | \"anthropic-oauth\";\n\t/** Optional Anthropic API-side task budget for the current turn */\n\ttaskBudget?: {\n\t\ttotal: number;\n\t\tremaining?: number;\n\t};\n\t/** Optional governed executor for provider-native dynamic tool callbacks. */\n\texecuteDynamicTool?: (toolCall: ToolCall) => Promise<AgentToolResult>;\n}\n\n/**\n * Cache control hint for prompt caching.\n *\n * Used to mark content that should be cached for faster\n * subsequent requests.\n */\nexport interface PromptCacheControl {\n\t/** Cache type - currently only \"ephemeral\" is supported */\n\ttype: \"ephemeral\";\n}\n"]}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/agent/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG","sourcesContent":["/**\n * @fileoverview Core Type Definitions for Maestro Agent\n *\n * This module defines the fundamental types used throughout the Maestro AI system,\n * including message formats, tool definitions, model configurations, and agent state.\n *\n * ## Type Categories\n *\n * ### Message Types\n * - {@link UserMessage} - Messages from the human user\n * - {@link AssistantMessage} - Responses from the AI assistant\n * - {@link ToolResultMessage} - Results from tool executions\n * - {@link Message} - Union of all message types\n *\n * ### Content Types\n * - {@link TextContent} - Plain text content blocks\n * - {@link ImageContent} - Base64-encoded images\n * - {@link ThinkingContent} - Extended reasoning traces\n * - {@link ToolCall} - Tool invocation requests\n *\n * ### Tool Types\n * - {@link Tool} - Tool definition schema (for API)\n * - {@link AgentTool} - Tool with execute function (for runtime)\n * - {@link AgentToolResult} - Return value from tool execution\n *\n * ### Configuration Types\n * - {@link Model} - LLM model configuration\n * - {@link AgentState} - Current state of an agent\n * - {@link AgentRunConfig} - Runtime configuration\n *\n * @module agent/types\n */\n\nimport type { GuardedFilesPolicySettings } from \"@evalops/contracts\";\nimport type { TSchema } from \"@sinclair/typebox\";\nimport type { PromptProjectDocManifest } from \"../config/index.js\";\nimport type { UnifiedContextManifest } from \"../context/manifest-types.js\";\nimport type { PromptMetadata } from \"../prompts/types.js\";\nimport type { SkillArtifactMetadata } from \"../skills/artifact-metadata.js\";\nimport type { CheckpointProfiler } from \"../utils/checkpoint-profiler.js\";\nimport type {\n\tActionApprovalDecision,\n\tActionApprovalRequest,\n} from \"./action-approval.js\";\nimport type { ToolCapabilityMetadata } from \"./tool-capability-types.js\";\nimport type { ToolRetryDecision, ToolRetryRequest } from \"./tool-retry.js\";\n\n/**\n * API format identifier for different LLM provider APIs.\n *\n * Each provider may support different API formats:\n * - `openai-completions` - OpenAI Chat Completions API\n * - `openai-responses` - OpenAI Responses API (newer format)\n * - `openai-codex-responses` - ChatGPT Codex Responses backend\n * - `openai-codex-app-server` - Local Codex app-server with ChatGPT sign-in\n * - `anthropic-messages` - Anthropic Messages API\n * - `google-generative-ai` - Google Generative AI (Gemini)\n * - `google-gemini-cli` - Google Cloud Code Assist (Gemini CLI)\n * - `bedrock-converse` - AWS Bedrock Converse API\n * - `scripted-replay` - Deterministic local scenario replay provider\n */\nexport type Api =\n\t| \"openai-completions\"\n\t| \"openai-responses\"\n\t| \"openai-codex-responses\"\n\t| \"openai-codex-app-server\"\n\t| \"anthropic-messages\"\n\t| \"google-generative-ai\"\n\t| \"google-gemini-cli\"\n\t| \"bedrock-converse\"\n\t| \"vertex-ai\"\n\t| \"scripted-replay\";\n\nexport interface OpenAICompatOverrides {\n\tsupportsStore?: boolean;\n\tsupportsDeveloperRole?: boolean;\n\tsupportsReasoningEffort?: boolean;\n\tsupportsResponsesApi?: boolean;\n\t/** Supports Anthropic-style cache_control (OpenRouter with Claude models) */\n\tsupportsCacheControl?: boolean;\n\tmaxTokensField?: \"max_tokens\" | \"max_completion_tokens\";\n\trequiresToolResultName?: boolean;\n\trequiresAssistantAfterToolResult?: boolean;\n\trequiresThinkingAsText?: boolean;\n\trequiresMistralToolIds?: boolean;\n}\n\n/**\n * Well-known LLM provider identifiers.\n *\n * These are the officially supported providers with built-in configurations:\n * - `anthropic` - Anthropic (Claude models)\n * - `bedrock` - AWS Bedrock\n * - `google` - Google AI (Gemini models)\n * - `openai` - OpenAI (GPT models)\n * - `azure-openai` - Azure OpenAI\n * - `writer` - Writer.com\n * - `xai` - xAI (Grok models)\n * - `groq` - Groq\n * - `cerebras` - Cerebras\n * - `openrouter` - OpenRouter (aggregator)\n * - `zai` - ZAI\n */\nexport type KnownProvider =\n\t| \"anthropic\"\n\t| \"bedrock\"\n\t| \"google\"\n\t| \"openai\"\n\t| \"openai-codex\"\n\t| \"azure-openai\"\n\t| \"writer\"\n\t| \"xai\"\n\t| \"groq\"\n\t| \"cerebras\"\n\t| \"openrouter\"\n\t| \"zai\";\n\n/**\n * Provider identifier - either a known provider or a custom string.\n * Custom providers can be used with OpenAI-compatible APIs.\n */\nexport type Provider = KnownProvider | string;\n\n/**\n * Reasoning effort level for models that support extended thinking.\n *\n * Higher levels produce more detailed reasoning at increased latency:\n * - `minimal` - Brief chain-of-thought hints\n * - `low` - Short reasoning steps\n * - `medium` - Moderate reasoning depth (recommended default)\n * - `high` - Thorough step-by-step reasoning\n * - `ultra` - Maximum reasoning depth (for complex problems)\n *\n * Note: Claude Code uses keywords \"think\", \"think hard\", \"think harder\", \"ultrathink\"\n * which map to low, medium, high, ultra respectively.\n */\nexport type ReasoningEffort = \"minimal\" | \"low\" | \"medium\" | \"high\" | \"ultra\";\n\n/**\n * Plain text content block within a message.\n *\n * @example\n * ```typescript\n * const content: TextContent = {\n * type: \"text\",\n * text: \"Hello, how can I help you today?\"\n * };\n * ```\n */\nexport interface TextContent {\n\t/** Discriminator for content block type */\n\ttype: \"text\";\n\t/** The text content */\n\ttext: string;\n\t/** Optional signature for content verification */\n\ttextSignature?: string;\n}\n\n/**\n * Extended thinking/reasoning content block.\n *\n * Contains the model's internal reasoning process when extended\n * thinking is enabled. This is typically hidden from end users\n * but useful for debugging and understanding model behavior.\n */\nexport interface ThinkingContent {\n\t/** Discriminator for content block type */\n\ttype: \"thinking\";\n\t/** The thinking/reasoning trace */\n\tthinking: string;\n\t/** Optional signature for content verification */\n\tthinkingSignature?: string;\n}\n\n/**\n * Base64-encoded image content block.\n *\n * Used for including images in user messages (vision input)\n * or tool results (screenshots, generated images).\n *\n * @example\n * ```typescript\n * const image: ImageContent = {\n * type: \"image\",\n * data: \"iVBORw0KGgo...\", // base64 encoded\n * mimeType: \"image/png\"\n * };\n * ```\n */\nexport interface ImageContent {\n\t/** Discriminator for content block type */\n\ttype: \"image\";\n\t/** Base64-encoded image data */\n\tdata: string;\n\t/** MIME type (e.g., \"image/png\", \"image/jpeg\") */\n\tmimeType: string;\n}\n\n/**\n * Tool invocation request within an assistant message.\n *\n * When the model decides to use a tool, it emits a ToolCall\n * content block specifying which tool to call and with what arguments.\n *\n * @example\n * ```typescript\n * const toolCall: ToolCall = {\n * type: \"toolCall\",\n * id: \"call_abc123\",\n * name: \"read\",\n * arguments: { file_path: \"/src/index.ts\" }\n * };\n * ```\n */\nexport interface ToolCall {\n\t/** Discriminator for content block type */\n\ttype: \"toolCall\";\n\t/** Unique identifier for this tool call (used to match results) */\n\tid: string;\n\t/** Name of the tool to invoke */\n\tname: string;\n\t/** Arguments to pass to the tool */\n\targuments: Record<string, unknown>;\n\t/**\n\t * Provider-specific signature used by some APIs (notably Gemini 3) to\n\t * associate tool calls with preceding thoughts. If present, it must be\n\t * preserved across turns when replaying the message history back to the provider.\n\t */\n\tthoughtSignature?: string;\n}\n\nexport type ToolSchedulingDecisionKind =\n\t| \"scheduled\"\n\t| \"parallelized\"\n\t| \"delayed\"\n\t| \"serialized\"\n\t| \"cached\"\n\t| \"skipped\";\n\nexport interface ToolSchedulingDecision {\n\t/** Tool call identifier; duplicated here for standalone telemetry use. */\n\tcallId: string;\n\t/** Tool name, never arguments. */\n\ttoolName: string;\n\t/** Zero-based order from the model-emitted tool-call list. */\n\temittedIndex: number;\n\t/** Scheduler wave number when the call entered an execution wave. */\n\twaveIndex?: number;\n\t/** Scheduler outcome for this call. */\n\tdecision: ToolSchedulingDecisionKind;\n\t/** Stable reason code; intentionally avoids raw paths and arguments. */\n\treason: string;\n\t/** Time spent waiting inside the scheduler after model emission. */\n\tschedulerWaitMs?: number;\n\t/** True when an MCP server opt-in made the call parallel-safe. */\n\tmcpOptIn?: boolean;\n\t/** True when execution was served from reusable tool-result state. */\n\tcacheHit?: boolean;\n\t/** True when an in-flight mutation forced a wait or serialization. */\n\tblockedByMutation?: boolean;\n}\n\nexport type ToolPhaseDecisionOutcome =\n\t| \"parallelized\"\n\t| \"serialized\"\n\t| \"delayed\"\n\t| \"cached\"\n\t| \"skipped\";\n\nexport interface ToolPhaseDecision {\n\ttoolCallId: string;\n\ttoolName: string;\n\temittedIndex: number;\n\toutcome: ToolPhaseDecisionOutcome;\n\tdecision: ToolPhaseDecisionOutcome;\n\treason: string;\n\twaveIndex?: number;\n\twaitMs: number;\n\tschedulerWaitMs: number;\n\tmcpOptIn?: boolean;\n\tcacheHit?: boolean;\n\tblockedByMutation?: boolean;\n}\n\nexport interface ToolPhaseBatchShapingFeedback {\n\tavoidableSingleton: boolean;\n\treason: string;\n\thint: string;\n}\n\nexport interface ToolPhaseSummary {\n\ttype: \"tool_phase_summary\";\n\tmodelToolCallCount: number;\n\tmodelEmittedToolCallCount: number;\n\tschedulableWaveCount: number;\n\tparallelizedCallCount: number;\n\tactuallyParallelizedCallCount: number;\n\tserializedCallCount: number;\n\tdelayedCallCount: number;\n\tblockedByMutationCount: number;\n\tmcpOptInCallCount: number;\n\tmcpOptInUseCount: number;\n\tcacheHitCount: number;\n\ttotalToolWaitMs: number;\n\ttoolWaitTimeMs: number;\n\tserializationReasons: Record<string, number>;\n\tdecisions: ToolPhaseDecision[];\n\tbatchShapingFeedback?: ToolPhaseBatchShapingFeedback;\n}\n\n/**\n * Token usage and cost information for a message or request.\n *\n * Tracks input/output tokens and cache utilization for cost monitoring\n * and context window management.\n */\nexport interface Usage {\n\t/** Number of input tokens consumed */\n\tinput: number;\n\t/** Number of output tokens generated */\n\toutput: number;\n\t/** Tokens served from prompt cache (reduces cost) */\n\tcacheRead: number;\n\t/** Tokens written to prompt cache */\n\tcacheWrite: number;\n\t/** Calculated cost breakdown in USD */\n\tcost: {\n\t\t/** Cost for input tokens */\n\t\tinput: number;\n\t\t/** Cost for output tokens */\n\t\toutput: number;\n\t\t/** Cost savings from cache reads */\n\t\tcacheRead: number;\n\t\t/** Cost for cache writes */\n\t\tcacheWrite: number;\n\t\t/** Total cost for this message/request */\n\t\ttotal: number;\n\t};\n}\n\n/**\n * Reason why the model stopped generating.\n *\n * - `stop` - Natural completion (end of response)\n * - `length` - Hit max_tokens limit\n * - `toolUse` - Model wants to use a tool (generation paused)\n * - `error` - An error occurred during generation\n * - `aborted` - Request was cancelled by the user\n */\nexport type StopReason = \"stop\" | \"length\" | \"toolUse\" | \"error\" | \"aborted\";\n\n/**\n * Message from the human user.\n *\n * User messages can contain plain text or an array of content blocks\n * (for multi-modal input with images).\n *\n * @example\n * ```typescript\n * // Simple text message\n * const msg: UserMessage = {\n * role: \"user\",\n * content: \"What is this code doing?\",\n * timestamp: Date.now()\n * };\n *\n * // Message with image\n * const multiModal: UserMessage = {\n * role: \"user\",\n * content: [\n * { type: \"text\", text: \"What's in this screenshot?\" },\n * { type: \"image\", data: base64Data, mimeType: \"image/png\" }\n * ],\n * timestamp: Date.now()\n * };\n * ```\n */\nexport interface UserMessage {\n\t/** Message role discriminator */\n\trole: \"user\";\n\t/** Message content - string or array of content blocks */\n\tcontent: string | (TextContent | ImageContent)[];\n\t/** Optional non-LLM metadata for runtime bookkeeping */\n\tmetadata?: Record<string, unknown>;\n\t/** Unix timestamp in milliseconds when message was created */\n\ttimestamp: number;\n}\n\n/**\n * Response message from the AI assistant.\n *\n * Contains the model's response along with metadata about the generation\n * including token usage, stop reason, and provider information.\n *\n * The content array may contain:\n * - {@link TextContent} - The actual response text\n * - {@link ThinkingContent} - Extended reasoning (if enabled)\n * - {@link ToolCall} - Tool invocation requests\n */\nexport interface AssistantMessage {\n\t/** Message role discriminator */\n\trole: \"assistant\";\n\t/** Array of content blocks (text, thinking, tool calls) */\n\tcontent: (TextContent | ThinkingContent | ToolCall)[];\n\t/** API format used for this response */\n\tapi: Api;\n\t/** Provider that generated this response */\n\tprovider: Provider;\n\t/** Model ID that generated this response */\n\tmodel: string;\n\t/** Token usage and cost information */\n\tusage: Usage;\n\t/** Reason why generation stopped */\n\tstopReason: StopReason;\n\t/** Error message if stopReason is \"error\" */\n\terrorMessage?: string;\n\t/** Unix timestamp in milliseconds when message was created */\n\ttimestamp: number;\n}\n\n/**\n * Result message from a tool execution.\n *\n * After a tool is executed, the result is sent back to the model\n * as a ToolResultMessage so it can incorporate the information\n * into its response.\n *\n * @typeParam TDetails - Type of additional details attached to the result\n *\n * @example\n * ```typescript\n * const result: ToolResultMessage = {\n * role: \"toolResult\",\n * toolCallId: \"call_abc123\",\n * toolName: \"read\",\n * content: [{ type: \"text\", text: \"file contents...\" }],\n * isError: false,\n * timestamp: Date.now()\n * };\n * ```\n */\nexport interface ToolResultMessage<TDetails = unknown> {\n\t/** Message role discriminator */\n\trole: \"toolResult\";\n\t/** ID of the tool call this result corresponds to */\n\ttoolCallId: string;\n\t/** Name of the tool that was executed */\n\ttoolName: string;\n\t/** Result content (text or images) */\n\tcontent: (TextContent | ImageContent)[];\n\t/** Optional additional details about the execution */\n\tdetails?: TDetails;\n\t/** Whether the tool execution resulted in an error */\n\tisError: boolean;\n\t/** Unix timestamp in milliseconds when result was created */\n\ttimestamp: number;\n}\n\n/**\n * Message type for hook-injected messages.\n *\n * Hooks can inject these into the conversation. They are converted to user\n * messages for LLM context and can optionally be hidden from the UI.\n */\nexport interface HookMessage<T = unknown> {\n\t/** Message role discriminator */\n\trole: \"hookMessage\";\n\t/** Hook-defined message category */\n\tcustomType: string;\n\t/** Message content - string or array of content blocks */\n\tcontent: string | (TextContent | ImageContent)[];\n\t/** Whether to render this message in the UI */\n\tdisplay: boolean;\n\t/** Optional hook-specific metadata (not sent to the LLM) */\n\tdetails?: T;\n\t/** Unix timestamp in milliseconds when message was created */\n\ttimestamp: number;\n}\n\n/**\n * Message type for branch summaries when navigating session trees.\n */\nexport interface BranchSummaryMessage {\n\t/** Message role discriminator */\n\trole: \"branchSummary\";\n\t/** Summary text */\n\tsummary: string;\n\t/** ID of the branch point this summary came from */\n\tfromId: string;\n\t/** Unix timestamp in milliseconds when summary was created */\n\ttimestamp: number;\n}\n\n/**\n * Message type for compaction summaries.\n */\nexport interface CompactionSummaryMessage {\n\t/** Message role discriminator */\n\trole: \"compactionSummary\";\n\t/** Summary text */\n\tsummary: string;\n\t/** Token count before compaction (for diagnostics) */\n\ttokensBefore: number;\n\t/** Unix timestamp in milliseconds when summary was created */\n\ttimestamp: number;\n}\n\n/**\n * Union type representing LLM-native messages that can be sent to the model.\n *\n * A conversation with the LLM consists of user input, assistant responses,\n * and tool results.\n */\nexport type Message = UserMessage | AssistantMessage | ToolResultMessage;\n\n/**\n * Empty interface for declaration merging to add custom message types.\n *\n * Consumers can extend this interface to add their own message types:\n *\n * @example\n * ```typescript\n * declare module \"@evalops/maestro\" {\n * interface CustomAgentMessages {\n * notification: { role: \"notification\"; text: string; timestamp: number };\n * }\n * }\n * ```\n */\n// biome-ignore lint/suspicious/noEmptyInterface: Required for declaration merging\nexport interface CustomAgentMessages {}\n\n/**\n * Union type representing all messages in the agent conversation history.\n *\n * Includes both LLM-native messages (user, assistant, toolResult) and\n * custom message types (hookMessage, branchSummary, compactionSummary,\n * plus any types added via declaration merging).\n *\n * Custom messages are preserved in session history but filtered out\n * before being sent to the LLM via {@link convertToLlm}.\n */\nexport type AgentMessage =\n\t| Message\n\t| HookMessage\n\t| BranchSummaryMessage\n\t| CompactionSummaryMessage\n\t| CustomAgentMessages[keyof CustomAgentMessages];\n\n/**\n * Tool definition schema for API serialization.\n *\n * This interface defines a tool's metadata and parameter schema\n * for transmission to the LLM. The actual execution logic is in\n * {@link AgentTool}.\n *\n * @typeParam TParameters - TypeBox schema for the tool's parameters\n *\n * @example\n * ```typescript\n * import { Type } from \"@sinclair/typebox\";\n *\n * const readTool: Tool = {\n * name: \"read\",\n * description: \"Read a file from the filesystem\",\n * parameters: Type.Object({\n * file_path: Type.String({ description: \"Path to the file\" })\n * })\n * };\n * ```\n */\nexport interface Tool<TParameters extends TSchema = TSchema> {\n\t/** Unique tool identifier */\n\tname: string;\n\t/** Human-readable description of what the tool does */\n\tdescription: string;\n\t/** TypeBox schema defining the tool's parameters */\n\tparameters: TParameters;\n\t/** Optional categorization (e.g., \"file\", \"shell\", \"web\") */\n\ttoolType?: string;\n\t/** Example inputs for documentation/few-shot prompting */\n\tinputExamples?: unknown[];\n\t/** List of caller identifiers allowed to use this tool */\n\tallowedCallers?: string[];\n\t/** If true, don't send tool definition to API (used for internal tools) */\n\tdeferApiDefinition?: boolean;\n}\n\n/**\n * Behavioral hints for tools (from MCP annotations).\n *\n * These hints help the model and UI understand the tool's behavior\n * for better decision-making and user feedback.\n */\nexport interface ToolAnnotations {\n\t/** If true, the tool does not modify its environment (safe to retry) */\n\treadOnlyHint?: boolean;\n\t/** If true, the tool may perform destructive/irreversible updates */\n\tdestructiveHint?: boolean;\n\t/** If true, mutating calls are scoped to explicit path arguments */\n\tpathScopedMutationHint?: boolean;\n\t/** If true, calling repeatedly with same args has no additional effect */\n\tidempotentHint?: boolean;\n\t/** If true, the tool interacts with external systems (network, APIs) */\n\topenWorldHint?: boolean;\n}\n\nexport interface McpToolSourceMetadata {\n\ttype: \"mcp\";\n\tserver: string;\n\ttool: string;\n\tcapability?: ToolCapabilityMetadata;\n\tsupportsParallelToolCalls?: boolean;\n\tparallelSafetyProvenance?: \"static_config\" | \"server_capability\" | \"none\";\n\tparallelMaxConcurrency?: number;\n}\n\nexport type ToolSourceMetadata = McpToolSourceMetadata;\n\n/**\n * Complete tool definition with execute function.\n *\n * This is the runtime representation of a tool, including both\n * the schema (for the LLM) and the execute function (for the runtime).\n *\n * @typeParam TParameters - TypeBox schema for the tool's parameters\n * @typeParam TDetails - Type of additional details returned with results\n *\n * @example\n * ```typescript\n * import { Type } from \"@sinclair/typebox\";\n *\n * const readTool: AgentTool = {\n * name: \"read\",\n * description: \"Read a file from the filesystem\",\n * parameters: Type.Object({\n * file_path: Type.String()\n * }),\n * execute: async (toolCallId, params) => {\n * const content = await fs.readFile(params.file_path, \"utf-8\");\n * return { content: [{ type: \"text\", text: content }] };\n * }\n * };\n * ```\n */\nexport interface AgentTool<\n\tTParameters extends TSchema = TSchema,\n\tTDetails = unknown,\n> {\n\t/** Unique tool identifier */\n\tname: string;\n\t/** Display label for UI (defaults to name) */\n\tlabel?: string;\n\t/** Human-readable description of what the tool does */\n\tdescription: string;\n\t/** TypeBox schema defining the tool's parameters */\n\tparameters: TParameters;\n\t/** Tool behavior hints from MCP annotations */\n\tannotations?: ToolAnnotations;\n\t/** Exact runtime provenance for bridged or remote tool sources */\n\tsource?: ToolSourceMetadata;\n\t/** Optional categorization (e.g., \"file\", \"shell\", \"web\") */\n\ttoolType?: string;\n\t/**\n\t * Where the tool should be executed.\n\t * - `\"server\"`: (default) Executed by the backend agent\n\t * - `\"client\"`: Executed by the client (VS Code, browser) via callback\n\t */\n\texecutionLocation?: \"server\" | \"client\";\n\t/** Example inputs for documentation/few-shot prompting */\n\tinputExamples?: unknown[];\n\t/** List of caller identifiers allowed to use this tool */\n\tallowedCallers?: string[];\n\t/** If true, don't send tool definition to API */\n\tdeferApiDefinition?: boolean;\n\t/** Optional max retries configured by the tool itself */\n\tmaxRetries?: number;\n\t/** Optional retry delay configured by the tool itself */\n\tretryDelayMs?: number;\n\t/** Optional tool-level retry predicate */\n\tshouldRetry?: (error: unknown) => boolean;\n\t/** Optional compact summary used after a tool finishes. */\n\tgetToolUseSummary?: (params: Record<string, unknown>) => string | null;\n\t/** Optional human-facing label used for live tool UI. */\n\tgetDisplayName?: (params: Record<string, unknown>) => string | null;\n\t/** Optional present-tense activity label used while a tool is running. */\n\tgetActivityDescription?: (params: Record<string, unknown>) => string | null;\n\t/**\n\t * Execute the tool with the given parameters.\n\t *\n\t * @param toolCallId - Unique identifier for this tool call\n\t * @param params - Parameters matching the tool's schema\n\t * @param signal - Optional AbortSignal for cancellation\n\t * @param context - Optional execution context (sandbox, etc.)\n\t * @param onUpdate - Optional callback for partial tool output streaming\n\t * @returns Tool result with content and optional details\n\t */\n\texecute: (\n\t\ttoolCallId: string,\n\t\tparams: Record<string, unknown>,\n\t\tsignal?: AbortSignal,\n\t\tcontext?: { sandbox?: import(\"../sandbox/types.js\").Sandbox },\n\t\tonUpdate?: AgentToolUpdateCallback<TDetails>,\n\t) => AgentToolResult<TDetails> | Promise<AgentToolResult<TDetails>>;\n}\n\nexport type AgentToolUpdateCallback<TDetails = unknown> = (\n\tpartial: AgentToolResult<TDetails>,\n) => void;\n\n/**\n * Result returned from tool execution.\n *\n * @typeParam TDetails - Type of additional details attached to the result\n */\nexport interface AgentToolResult<TDetails = unknown> {\n\t/** Result content (text or images) */\n\tcontent: (TextContent | ImageContent)[];\n\t/** Optional additional details about the execution */\n\tdetails?: TDetails;\n\t/** Whether the execution resulted in an error */\n\tisError?: boolean;\n\t/** Optional Platform ToolExecution identifier used for audit joins */\n\ttoolExecutionId?: string;\n\t/** Optional Platform approval request identifier correlated to ToolExecution */\n\tapprovalRequestId?: string;\n}\n\n/**\n * Conversation context for LLM requests.\n *\n * Contains the system prompt, conversation history, and available tools\n * for a single LLM request.\n */\nexport interface Context {\n\t/** System prompt providing instructions and context */\n\tsystemPrompt?: string;\n\t/** Conversation history */\n\tmessages: Message[];\n\t/** Tools available for the model to use */\n\ttools?: Tool[];\n}\n\n/**\n * Streaming events during assistant message construction.\n *\n * These events are emitted as the LLM generates its response, enabling\n * real-time UI updates and progress tracking.\n *\n * ## Event Types\n *\n * | Type | Description |\n * |------|-------------|\n * | `start` | Message generation started |\n * | `text_start` | New text content block started |\n * | `text_delta` | Incremental text content |\n * | `text_end` | Text content block completed |\n * | `thinking_start` | Extended thinking block started |\n * | `thinking_delta` | Incremental thinking content |\n * | `thinking_end` | Thinking block completed |\n * | `toolcall_start` | Tool call started |\n * | `toolcall_delta` | Incremental tool call args |\n * | `toolcall_end` | Tool call completed |\n * | `done` | Generation completed successfully |\n * | `error` | Generation failed or was aborted |\n */\nexport type AssistantMessageEvent =\n\t| {\n\t\t\t/** Message generation started */\n\t\t\ttype: \"start\";\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** New text content block started */\n\t\t\ttype: \"text_start\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Incremental text content received */\n\t\t\ttype: \"text_delta\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** New text to append */\n\t\t\tdelta: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Text content block completed */\n\t\t\ttype: \"text_end\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Final text content */\n\t\t\tcontent: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Extended thinking block started */\n\t\t\ttype: \"thinking_start\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Incremental thinking content received */\n\t\t\ttype: \"thinking_delta\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** New thinking text to append */\n\t\t\tdelta: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Thinking content block completed */\n\t\t\ttype: \"thinking_end\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Final thinking content */\n\t\t\tcontent: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Tool call started */\n\t\t\ttype: \"toolcall_start\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Incremental tool call arguments received */\n\t\t\ttype: \"toolcall_delta\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** New JSON fragment to append to arguments */\n\t\t\tdelta: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Tool call completed */\n\t\t\ttype: \"toolcall_end\";\n\t\t\t/** Index of the content block */\n\t\t\tcontentIndex: number;\n\t\t\t/** Completed tool call */\n\t\t\ttoolCall: ToolCall;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Provider-owned tool execution started outside Maestro's local executor */\n\t\t\ttype: \"provider_tool_execution_start\";\n\t\t\t/** Provider tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Provider tool name */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Provider tool arguments */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Provider-owned tool execution produced an incremental update */\n\t\t\ttype: \"provider_tool_execution_update\";\n\t\t\t/** Provider tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Provider tool name */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Provider tool arguments */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Partial provider result */\n\t\t\tpartialResult: AgentToolResult;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Provider-owned tool execution completed outside Maestro's local executor */\n\t\t\ttype: \"provider_tool_execution_end\";\n\t\t\t/** Provider tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Provider tool name */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Provider tool result */\n\t\t\tresult: ToolResultMessage;\n\t\t\t/** Whether the provider tool returned an error */\n\t\t\tisError: boolean;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Optional Platform approval request identifier correlated to ToolExecution */\n\t\t\tapprovalRequestId?: string;\n\t\t\t/** Partial message state */\n\t\t\tpartial: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Generation completed successfully */\n\t\t\ttype: \"done\";\n\t\t\t/** Reason for completion */\n\t\t\treason: Extract<StopReason, \"stop\" | \"length\" | \"toolUse\">;\n\t\t\t/** Final assistant message */\n\t\t\tmessage: AssistantMessage;\n\t }\n\t| {\n\t\t\t/** Generation failed or was aborted */\n\t\t\ttype: \"error\";\n\t\t\t/** Reason for failure */\n\t\t\treason: Extract<StopReason, \"aborted\" | \"error\">;\n\t\t\t/** Error message details */\n\t\t\terror: AssistantMessage;\n\t };\n\n/**\n * LLM model configuration.\n *\n * Contains all the information needed to use a model, including\n * API endpoints, capabilities, and pricing.\n *\n * @typeParam TApi - The API format this model uses\n *\n * @example\n * ```typescript\n * const claude: Model<\"anthropic-messages\"> = {\n * id: \"claude-sonnet-4-5-20250929\",\n * name: \"Claude Sonnet 4.5\",\n * api: \"anthropic-messages\",\n * provider: \"anthropic\",\n * baseUrl: \"https://api.anthropic.com/v1\",\n * reasoning: true,\n * input: [\"text\", \"image\"],\n * cost: { input: 3.00, output: 15.00, cacheRead: 0.30, cacheWrite: 3.75 },\n * contextWindow: 200000,\n * maxTokens: 8192\n * };\n * ```\n */\nexport interface Model<TApi extends Api> {\n\t/** Unique model identifier (e.g., \"claude-sonnet-4-5-20250929\") */\n\tid: string;\n\t/** Human-readable model name (e.g., \"Claude Sonnet 4.5\") */\n\tname: string;\n\t/** API format used for requests */\n\tapi: TApi;\n\t/** Provider serving this model */\n\tprovider: Provider;\n\t/** Base URL for API requests */\n\tbaseUrl: string;\n\t/** Optional custom headers to include in API requests */\n\theaders?: Record<string, string>;\n\t/** Optional OpenAI-compatibility overrides for vendor quirks */\n\tcompat?: OpenAICompatOverrides;\n\t/** Whether the model supports extended thinking */\n\treasoning: boolean;\n\t/** Whether the model supports tool use */\n\ttoolUse?: boolean;\n\t/** Supported input modalities */\n\tinput: (\"text\" | \"image\")[];\n\t/** Cost per million tokens in USD */\n\tcost: {\n\t\t/** Input token cost */\n\t\tinput: number;\n\t\t/** Output token cost */\n\t\toutput: number;\n\t\t/** Cache read cost (typically discounted) */\n\t\tcacheRead: number;\n\t\t/** Cache write cost */\n\t\tcacheWrite: number;\n\t};\n\t/** Maximum context window in tokens */\n\tcontextWindow: number;\n\t/** Maximum output tokens per response */\n\tmaxTokens: number;\n}\n\n/**\n * File attachment for messages.\n *\n * Represents an uploaded file (image or document) that can be\n * included in a user message.\n */\nexport interface Attachment {\n\t/** Unique identifier for this attachment */\n\tid: string;\n\t/** Type of attachment */\n\ttype: \"image\" | \"document\";\n\t/** Original filename */\n\tfileName: string;\n\t/** MIME type of the file */\n\tmimeType: string;\n\t/** File size in bytes */\n\tsize: number;\n\t/** Base64-encoded file content */\n\tcontent: string;\n\t/** Extracted text content (for documents) */\n\textractedText?: string;\n\t/** Preview image (for documents) */\n\tpreview?: string;\n}\n\n/**\n * User-configurable thinking level for extended reasoning.\n *\n * Controls how much computational effort the model spends on\n * reasoning before generating a response.\n *\n * - `off` - No extended thinking\n * - `minimal` - Brief reasoning hints\n * - `low` - Short reasoning steps\n * - `medium` - Moderate reasoning (default)\n * - `high` - Thorough step-by-step reasoning\n * - `max` - Maximum reasoning depth\n */\nexport type ThinkingLevel =\n\t| \"off\"\n\t| \"minimal\"\n\t| \"low\"\n\t| \"medium\"\n\t| \"high\"\n\t| \"ultra\"\n\t| \"max\";\n\n/**\n * User message with optional file attachments.\n *\n * Extends the base UserMessage to support file attachments\n * for rich multi-modal interactions.\n */\nexport type UserMessageWithAttachments = UserMessage & {\n\t/** Optional file attachments */\n\tattachments?: Attachment[];\n};\n\n/**\n * Placeholder for custom message types.\n * Can be extended to add application-specific message types.\n */\nexport interface CustomMessages {\n\thookMessage: HookMessage;\n\tbranchSummary: BranchSummaryMessage;\n\tcompactionSummary: CompactionSummaryMessage;\n}\n\n/**\n * Application-level message type.\n *\n * Union of all message types that can appear in the UI,\n * including user messages with attachments.\n */\nexport type AppMessage =\n\t| AssistantMessage\n\t| UserMessageWithAttachments\n\t| Message\n\t| CustomMessages[keyof CustomMessages];\n\n/**\n * Information about a tool call currently being executed.\n */\nexport interface PendingToolCall {\n\t/** Name of the tool being executed */\n\ttoolName: string;\n\t/** Original arguments passed to the tool */\n\targs?: Record<string, unknown>;\n\t/** Tool metadata captured when execution started */\n\ttool?: Pick<\n\t\tAgentTool,\n\t\t\"label\" | \"getDisplayName\" | \"getToolUseSummary\" | \"getActivityDescription\"\n\t>;\n\t/** Stable display name for live UI */\n\tdisplayName?: string;\n\t/** Stable compact summary for live UI */\n\tsummaryLabel?: string;\n}\n\n/**\n * Current state of an agent instance.\n *\n * This is the central state object managed by the Agent class,\n * containing all information about the current conversation,\n * configuration, and execution status.\n */\nexport interface AgentState {\n\t/** System prompt providing instructions and context */\n\tsystemPrompt: string;\n\t/** Version/hash metadata for the base system prompt instructions */\n\tpromptMetadata?: PromptMetadata;\n\t/** Exact prompt source files layered into the current system prompt */\n\tsystemPromptSourcePaths?: string[];\n\t/** Manifest of project instruction files layered into the current system prompt */\n\tpromptContextManifest?: PromptProjectDocManifest;\n\t/** Full filesystem and MCP context provenance captured for this run */\n\tunifiedContextManifest?: UnifiedContextManifest;\n\t/** Current model configuration */\n\tmodel: Model<Api>;\n\t/** Current thinking level for extended reasoning */\n\tthinkingLevel: ThinkingLevel;\n\t/** Optional reasoning summary preference for Responses API */\n\treasoningSummary?: \"auto\" | \"detailed\" | \"concise\" | null;\n\t/** Available tools for this agent */\n\ttools: AgentTool[];\n\t/**\n\t * Controls how queued steering messages are sent between turns.\n\t * - `\"all\"` - Send all queued messages at once\n\t * - `\"one\"` - Send one message at a time\n\t */\n\tsteeringMode: \"all\" | \"one\";\n\t/**\n\t * Controls how queued follow-up messages are sent between turns.\n\t * - `\"all\"` - Send all queued messages at once\n\t * - `\"one\"` - Send one message at a time\n\t */\n\tfollowUpMode: \"all\" | \"one\";\n\t/**\n\t * @deprecated Use steeringMode/followUpMode instead.\n\t */\n\tqueueMode: \"all\" | \"one\";\n\t/** Conversation history */\n\tmessages: AppMessage[];\n\t/** Whether the agent is currently streaming a response */\n\tisStreaming: boolean;\n\t/** Current streaming message (partial response) */\n\tstreamMessage: Message | null;\n\t/** Tool calls currently being executed */\n\tpendingToolCalls: Map<string, PendingToolCall>;\n\t/** Current error message, if any */\n\terror?: string;\n\t/** Optional sandbox for isolated tool execution */\n\tsandbox?: import(\"../sandbox/types.js\").Sandbox;\n\t/** Current sandbox mode (e.g., \"docker\", \"local\") */\n\tsandboxMode?: string | null;\n\t/** Whether sandboxing is enabled */\n\tsandboxEnabled?: boolean;\n\t/** User identification for tracking */\n\tuser?: {\n\t\t/** User UUID */\n\t\tid: string;\n\t\t/** Organization UUID */\n\t\torgId: string;\n\t};\n\t/** Session information for persistence */\n\tsession?: {\n\t\t/** Session UUID */\n\t\tid: string;\n\t\t/** When the session started */\n\t\tstartedAt: Date;\n\t};\n\t/** Sampling temperature override (0.0-2.0, lower = more deterministic) */\n\ttemperature?: number;\n\t/** Top-p sampling override (0.0-1.0) */\n\ttopP?: number;\n}\n\n/**\n * Events emitted during agent execution.\n *\n * These events provide real-time updates about agent activity,\n * enabling UI updates, logging, and progress tracking.\n *\n * ## Lifecycle Events\n * - `agent_start` - Agent execution started\n * - `agent_end` - Agent execution completed\n * - `turn_start` - New conversation turn started\n * - `turn_end` - Conversation turn completed\n *\n * ## Message Events\n * - `message_start` - New message being constructed\n * - `message_update` - Incremental message update\n * - `message_end` - Message completed\n *\n * ## Tool Events\n * - `tool_execution_start` - Tool execution started\n * - `tool_execution_update` - Tool execution produced partial output\n * - `tool_execution_end` - Tool execution completed\n * - `tool_batch_summary` - Tool batch completed with a transient summary label\n * - `client_tool_request` - Client-side tool invocation needed\n *\n * ## Approval Events\n * - `action_approval_required` - User approval needed\n * - `action_approval_resolved` - User made approval decision\n *\n * ## Tool Retry Events\n * - `tool_retry_required` - Tool failed and retry decision needed\n * - `tool_retry_resolved` - Tool retry decision resolved\n *\n * ## Status Events\n * - `status` - Status update\n * - `error` - Error occurred\n * - `compaction` - Context was compacted\n */\nexport interface ToolSchedulingMetadata {\n\tclassification:\n\t\t| \"read_only\"\n\t\t| \"path_scoped_mutation\"\n\t\t| \"parallel_safe_mutation\"\n\t\t| \"serialized_mutation\"\n\t\t| \"workflow_serialized\"\n\t\t| \"cache_reuse\"\n\t\t| \"unknown\";\n\treason:\n\t\t| \"read_only_tool\"\n\t\t| \"mcp_parallel_opt_in\"\n\t\t| \"path_scope_available\"\n\t\t| \"path_scope_disjoint\"\n\t\t| \"path_scope_overlap\"\n\t\t| \"pending_mutation\"\n\t\t| \"mutating_tool\"\n\t\t| \"workflow_state_tracker\"\n\t\t| \"cache_hit\"\n\t\t| \"cache_pending\"\n\t\t| \"unknown_tool\";\n\tconcurrencyLimit?: number;\n\tqueueDepth?: number;\n\tpendingMutations?: number;\n\tpathScope?: string[];\n\tpathScopeSource?: \"annotation\" | \"known_tool\";\n\tpathArgumentKeys?: string[];\n\tcache?: \"disabled\" | \"miss\" | \"candidate\" | \"pending_hit\" | \"hit\";\n}\n\nexport type AgentEvent =\n\t| {\n\t\t\t/** Agent execution started */\n\t\t\ttype: \"agent_start\";\n\t\t\t/** Whether this execution is an automatic continuation of the current turn */\n\t\t\tcontinuation?: boolean;\n\t }\n\t| {\n\t\t\t/** Agent execution completed */\n\t\t\ttype: \"agent_end\";\n\t\t\t/** Final messages from this execution */\n\t\t\tmessages: AppMessage[];\n\t\t\t/** Whether execution was aborted */\n\t\t\taborted?: boolean;\n\t\t\t/** If aborted with partial acceptance, contains the saved partial message */\n\t\t\tpartialAccepted?: AppMessage;\n\t\t\t/** Final stop reason from the LLM - \"length\" indicates output hit the max token limit */\n\t\t\tstopReason?: StopReason;\n\t }\n\t| {\n\t\t\t/** Status update during execution */\n\t\t\ttype: \"status\";\n\t\t\t/** Status message */\n\t\t\tstatus: string;\n\t\t\t/** Additional details */\n\t\t\tdetails: Record<string, unknown>;\n\t }\n\t| {\n\t\t\t/** Error occurred during execution */\n\t\t\ttype: \"error\";\n\t\t\t/** Error message */\n\t\t\tmessage: string;\n\t }\n\t| {\n\t\t\t/** New conversation turn started */\n\t\t\ttype: \"turn_start\";\n\t }\n\t| {\n\t\t\t/** Conversation turn completed */\n\t\t\ttype: \"turn_end\";\n\t\t\t/** Assistant message from this turn */\n\t\t\tmessage: AppMessage;\n\t\t\t/** Tool results from this turn */\n\t\t\ttoolResults: AppMessage[];\n\t }\n\t| {\n\t\t\t/** New message being constructed */\n\t\t\ttype: \"message_start\";\n\t\t\t/** The message being built */\n\t\t\tmessage: AppMessage;\n\t }\n\t| {\n\t\t\t/** Incremental update to current message */\n\t\t\ttype: \"message_update\";\n\t\t\t/** Updated message state */\n\t\t\tmessage: AppMessage;\n\t\t\t/** The streaming event that triggered this update */\n\t\t\tassistantMessageEvent: AssistantMessageEvent;\n\t }\n\t| {\n\t\t\t/** Message completed */\n\t\t\ttype: \"message_end\";\n\t\t\t/** Final message */\n\t\t\tmessage: AppMessage;\n\t }\n\t| {\n\t\t\t/** Tool execution started */\n\t\t\ttype: \"tool_execution_start\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Arguments passed to the tool */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Scheduler classification and serialization reason for this call */\n\t\t\tscheduling?: ToolSchedulingMetadata;\n\t }\n\t| {\n\t\t\t/** Tool execution completed */\n\t\t\ttype: \"tool_execution_end\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Optional approval request identifier correlated to Platform ToolExecution */\n\t\t\tapprovalRequestId?: string;\n\t\t\t/** Optional stable error or outcome code for telemetry and clients */\n\t\t\terrorCode?: string;\n\t\t\t/** Optional governed outcome classification surfaced by the tool result */\n\t\t\tgovernedOutcome?:\n\t\t\t\t| \"approval_required\"\n\t\t\t\t| \"approval_pending\"\n\t\t\t\t| \"authentication_required\"\n\t\t\t\t| \"denied\"\n\t\t\t\t| \"rate_limited\";\n\t\t\t/** Optional selected skill artifact metadata surfaced by the tool result */\n\t\t\tskillMetadata?: SkillArtifactMetadata;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Result from the tool */\n\t\t\tresult: ToolResultMessage;\n\t\t\t/** Whether the tool returned an error */\n\t\t\tisError: boolean;\n\t\t\t/** Scheduler classification and final reuse/serialization reason */\n\t\t\tscheduling?: ToolSchedulingMetadata;\n\t }\n\t| {\n\t\t\t/** LSP diagnostic delta produced by an edit/write tool call */\n\t\t\ttype: \"diagnostic_delta\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** File affected by the diagnostic delta */\n\t\t\tfile: string;\n\t\t\t/** User-facing file path from the tool call */\n\t\t\tdisplayPath: string;\n\t\t\t/** Whether a pre-edit baseline was available */\n\t\t\tusedDelta: boolean;\n\t\t\t/** Newly introduced diagnostic count */\n\t\t\tintroducedCount: number;\n\t\t\t/** Diagnostics repaired by the tool call */\n\t\t\trepairedCount: number;\n\t\t\t/** Remaining diagnostics for the affected file */\n\t\t\tremainingCount: number;\n\t\t\t/** Stable fingerprint for introduced diagnostics */\n\t\t\tfingerprint: string;\n\t\t\t/** Repair attempt number for this fingerprint */\n\t\t\trepairAttempt?: number;\n\t\t\t/** Maximum automatic repair attempts for this fingerprint */\n\t\t\tmaxRepairAttempts?: number;\n\t\t\t/** Whether Agent queued a follow-up repair turn */\n\t\t\twillAutoFollowUp: boolean;\n\t\t\t/** Why a repair follow-up was or was not queued */\n\t\t\treason: string;\n\t }\n\t| {\n\t\t\t/** Summary emitted after the final tool in a batch completes */\n\t\t\ttype: \"tool_batch_summary\";\n\t\t\t/** Stable one-line summary of what the completed tool batch did */\n\t\t\tsummary: string;\n\t\t\t/** Underlying per-tool summary labels used to build the summary */\n\t\t\tsummaryLabels: string[];\n\t\t\t/** Tool call identifiers included in this batch */\n\t\t\ttoolCallIds: string[];\n\t\t\t/** Tool names included in this batch */\n\t\t\ttoolNames: string[];\n\t\t\t/** Successful tool calls in the batch */\n\t\t\tcallsSucceeded: number;\n\t\t\t/** Failed tool calls in the batch */\n\t\t\tcallsFailed: number;\n\t }\n\t| ToolPhaseSummary\n\t| {\n\t\t\t/** Tool execution produced partial output */\n\t\t\ttype: \"tool_execution_update\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Optional Platform ToolExecution identifier */\n\t\t\ttoolExecutionId?: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Optional human-facing label for live UI */\n\t\t\tdisplayName?: string;\n\t\t\t/** Optional compact summary for live UI */\n\t\t\tsummaryLabel?: string;\n\t\t\t/** Arguments passed to the tool */\n\t\t\targs: Record<string, unknown>;\n\t\t\t/** Partial tool result */\n\t\t\tpartialResult: AgentToolResult;\n\t }\n\t| {\n\t\t\t/** User approval required for an action */\n\t\t\ttype: \"action_approval_required\";\n\t\t\t/** Details of the approval request */\n\t\t\trequest: ActionApprovalRequest;\n\t }\n\t| {\n\t\t\t/** User made approval decision */\n\t\t\ttype: \"action_approval_resolved\";\n\t\t\t/** The original request */\n\t\t\trequest: ActionApprovalRequest;\n\t\t\t/** User's decision */\n\t\t\tdecision: ActionApprovalDecision;\n\t }\n\t| {\n\t\t\t/** Tool failed and requires a retry decision */\n\t\t\ttype: \"tool_retry_required\";\n\t\t\t/** Details of the retry request */\n\t\t\trequest: ToolRetryRequest;\n\t }\n\t| {\n\t\t\t/** Tool retry decision resolved */\n\t\t\ttype: \"tool_retry_resolved\";\n\t\t\t/** The original request */\n\t\t\trequest: ToolRetryRequest;\n\t\t\t/** User or policy decision */\n\t\t\tdecision: ToolRetryDecision;\n\t }\n\t| {\n\t\t\t/** Client-side tool invocation needed */\n\t\t\ttype: \"client_tool_request\";\n\t\t\t/** Tool call identifier */\n\t\t\ttoolCallId: string;\n\t\t\t/** Name of the tool */\n\t\t\ttoolName: string;\n\t\t\t/** Arguments for the tool */\n\t\t\targs: unknown;\n\t }\n\t| {\n\t\t\t/** Context was compacted (older messages summarized) */\n\t\t\ttype: \"compaction\";\n\t\t\t/** Generated summary of compacted messages */\n\t\t\tsummary: string;\n\t\t\t/** Index of first entry to keep (entries before were summarized) */\n\t\t\tfirstKeptEntryIndex: number;\n\t\t\t/** Token count before compaction */\n\t\t\ttokensBefore: number;\n\t\t\t/** Whether this was auto-triggered vs manual /compact */\n\t\t\tauto?: boolean;\n\t\t\t/** Custom instructions used for summarization */\n\t\t\tcustomInstructions?: string;\n\t\t\t/** Timestamp of compaction */\n\t\t\ttimestamp: string;\n\t }\n\t| {\n\t\t\t/** Auto-retry started for transient error (rate limit, overload, 5xx) */\n\t\t\ttype: \"auto_retry_start\";\n\t\t\t/** Current retry attempt (1-based) */\n\t\t\tattempt: number;\n\t\t\t/** Maximum number of retry attempts */\n\t\t\tmaxAttempts: number;\n\t\t\t/** Delay in milliseconds before retry */\n\t\t\tdelayMs: number;\n\t\t\t/** The error message that triggered the retry */\n\t\t\terrorMessage: string;\n\t }\n\t| {\n\t\t\t/** Auto-retry completed (success or final failure) */\n\t\t\ttype: \"auto_retry_end\";\n\t\t\t/** Whether the retry eventually succeeded */\n\t\t\tsuccess: boolean;\n\t\t\t/** Final attempt number */\n\t\t\tattempt: number;\n\t\t\t/** If failed, the final error message */\n\t\t\tfinalError?: string;\n\t };\n\n/**\n * Events emitted over streaming transports (SSE/WebSocket).\n *\n * Includes core agent events plus transport-level signals.\n */\nexport type AgentStreamEvent =\n\t| AgentEvent\n\t| { type: \"session_update\"; sessionId: string }\n\t| { type: \"heartbeat\" }\n\t| { type: \"aborted\" }\n\t| { type: \"done\" };\n\n/**\n * Message queued for sending to the LLM.\n *\n * Wraps the original message with an optional LLM-formatted version,\n * allowing for message transformation before sending.\n *\n * @typeParam TOriginal - Type of the original message\n */\nexport interface QueuedMessage<TOriginal = AppMessage> {\n\t/** Stable identifier for queue operations */\n\tid: number;\n\t/** When the message was queued */\n\tcreatedAt: number;\n\t/** Original message as received */\n\toriginal: TOriginal;\n\t/** Optional LLM-formatted version of the message */\n\tllm?: Message;\n}\n\n/**\n * Runtime configuration for agent execution.\n *\n * Passed to the transport layer when starting a new agent run,\n * containing all the configuration needed to execute a conversation turn.\n */\nexport interface AgentRunConfig {\n\t/** System prompt providing instructions and context */\n\tsystemPrompt: string;\n\t/** Tools available for this run */\n\ttools: AgentTool[];\n\t/** Model to use for generation */\n\tmodel: Model<Api>;\n\t/** Optional reasoning effort level */\n\treasoning?: ReasoningEffort;\n\t/** Optional reasoning summary preference for Responses API */\n\treasoningSummary?: \"auto\" | \"detailed\" | \"concise\" | null;\n\t/** Emit message_end for the initial user message (defaults to true). */\n\temitUserMessageEnd?: boolean;\n\t/** Function to retrieve steering messages for batch sending */\n\tgetSteeringMessages?: <T>() => Promise<QueuedMessage<T>[]>;\n\t/** Function to retrieve follow-up messages for batch sending */\n\tgetFollowUpMessages?: <T>() => Promise<QueuedMessage<T>[]>;\n\t/** Function to retrieve prompt-only messages for the next turn. */\n\tgetPromptOnlyMessages?: () => Promise<Message[]>;\n\t/** @deprecated Use getSteeringMessages/getFollowUpMessages instead */\n\tgetQueuedMessages?: <T>() => Promise<QueuedMessage<T>[]>;\n\t/**\n\t * Optional message preprocessor applied immediately before calling the LLM provider.\n\t *\n\t * Use this to implement provider-specific compatibility transforms (e.g., image limits,\n\t * signature preservation, prompt caching markers) without polluting the core tools.\n\t *\n\t * Note: This is a pure preprocessing hook. It should not execute tools or perform I/O.\n\t */\n\tpreprocessMessages?: (\n\t\tmessages: Message[],\n\t\tcontext: {\n\t\t\tsystemPrompt: string;\n\t\t\ttools: AgentTool[];\n\t\t\tmodel: Model<Api>;\n\t\t\tuserMessage?: Message;\n\t\t},\n\t\tsignal?: AbortSignal,\n\t) => Message[] | Promise<Message[]>;\n\t/** User identification for tracking */\n\tuser?: {\n\t\t/** User UUID */\n\t\tid: string;\n\t\t/** Organization UUID */\n\t\torgId: string;\n\t};\n\t/** Session information for persistence */\n\tsession?: {\n\t\t/** Session UUID */\n\t\tid: string;\n\t\t/** When the session started */\n\t\tstartedAt: Date;\n\t};\n\t/** User/org guarded-files override policy for this run */\n\tguardedFiles?: GuardedFilesPolicySettings;\n\t/** Optional helper function for running LLM queries (e.g., for summarization) */\n\trunLLM?: (systemPrompt: string, userPrompt: string) => Promise<string>;\n\t/** Optional debug checkpoint profiler for local query latency diagnostics. */\n\tqueryProfiler?: CheckpointProfiler;\n\t/** Optional sandbox for isolated tool execution */\n\tsandbox?: import(\"../sandbox/types.js\").Sandbox;\n\t/** Sampling temperature override (0.0-2.0, lower = more deterministic) */\n\ttemperature?: number;\n\t/** Top-p sampling override (0.0-1.0) */\n\ttopP?: number;\n\t/** Optional Anthropic API-side task budget for the current turn */\n\ttaskBudget?: {\n\t\ttotal: number;\n\t\tremaining?: number;\n\t};\n}\n\n/**\n * Transport interface for LLM communication.\n *\n * Implementors of this interface handle the actual communication\n * with the LLM provider, including streaming and tool execution.\n */\nexport interface AgentTransport {\n\t/**\n\t * Execute a conversation turn with a new user message.\n\t *\n\t * @param messages - Conversation history\n\t * @param userMessage - New user message\n\t * @param config - Runtime configuration\n\t * @param signal - Optional abort signal for cancellation\n\t * @returns Async iterable of agent events\n\t */\n\trun(\n\t\tmessages: Message[],\n\t\tuserMessage: Message,\n\t\tconfig: AgentRunConfig,\n\t\tsignal?: AbortSignal,\n\t): AsyncIterable<AgentEvent>;\n\n\t/**\n\t * Continue from current context without a new user message.\n\t *\n\t * Used for:\n\t * - Retrying after transient errors (rate limits, overload)\n\t * - Continuing after context compaction\n\t * - Resuming interrupted tool execution\n\t *\n\t * @param messages - Current conversation history\n\t * @param config - Runtime configuration\n\t * @param signal - Optional abort signal for cancellation\n\t * @returns Async iterable of agent events\n\t */\n\tcontinue(\n\t\tmessages: Message[],\n\t\tconfig: AgentRunConfig,\n\t\tsignal?: AbortSignal,\n\t): AsyncIterable<AgentEvent>;\n\n\t/**\n\t * Optional lightweight connectivity probe for UI health checks.\n\t */\n\tping?: () => Promise<void>;\n}\n\n/**\n * Options for streaming LLM requests.\n *\n * These options are passed to the transport layer when making\n * streaming requests to the LLM provider.\n */\nexport interface StreamOptions {\n\t/** Sampling temperature (0.0-2.0, lower = more deterministic) */\n\ttemperature?: number;\n\t/** Maximum tokens to generate */\n\tmaxTokens?: number;\n\t/** Abort signal for cancellation */\n\tsignal?: AbortSignal;\n\t/** API key for authentication */\n\tapiKey?: string;\n\t/** Additional headers to include in requests */\n\theaders?: Record<string, string>;\n\t/** Additional request body fields for provider-specific extensions */\n\trequestBody?: Record<string, unknown>;\n\t/** Stable session id for provider-side request grouping/cache keys */\n\tsessionId?: string;\n\t/** Current working directory for local provider runtimes. */\n\tcwd?: string;\n\t/** Authentication type for the request */\n\tauthType?: \"api-key\" | \"bearer-token\";\n\t/** Optional Anthropic API-side task budget for the current turn */\n\ttaskBudget?: {\n\t\ttotal: number;\n\t\tremaining?: number;\n\t};\n\t/** Optional governed executor for provider-native dynamic tool callbacks. */\n\texecuteDynamicTool?: (toolCall: ToolCall) => Promise<AgentToolResult>;\n}\n\n/**\n * Cache control hint for prompt caching.\n *\n * Used to mark content that should be cached for faster\n * subsequent requests.\n */\nexport interface PromptCacheControl {\n\t/** Cache type - currently only \"ephemeral\" is supported */\n\ttype: \"ephemeral\";\n}\n"]}
@@ -0,0 +1,31 @@
1
+ import type { MaestroAppServerDaemonStatusResult, MaestroAppServerRemoteControlDrainResult, MaestroAppServerRemoteControlLeaseResult, MaestroAppServerRemoteControlStatusResult } from "@evalops/contracts";
2
+ import type { HostedRunnerContext } from "../server/app-context.js";
3
+ import { drainHostedRunner } from "../server/handlers/hosted-runner-drain.js";
4
+ type UnknownRecord = Record<string, unknown>;
5
+ type DrainRunner = typeof drainHostedRunner;
6
+ export declare class MaestroAppServerDaemonLifecycleError extends Error {
7
+ readonly code: number;
8
+ constructor(code: number, message: string);
9
+ }
10
+ export interface MaestroAppServerDaemonLifecycleCapabilities {
11
+ daemonStatus: boolean;
12
+ remoteControlStatus: boolean;
13
+ remoteControlLease: boolean;
14
+ remoteControlDrain: boolean;
15
+ }
16
+ export interface MaestroAppServerDaemonLifecycle {
17
+ capabilities(): MaestroAppServerDaemonLifecycleCapabilities;
18
+ status(params?: UnknownRecord): Promise<MaestroAppServerDaemonStatusResult>;
19
+ remoteControlStatus(params?: UnknownRecord): Promise<MaestroAppServerRemoteControlStatusResult>;
20
+ readLease(params?: UnknownRecord): Promise<MaestroAppServerRemoteControlLeaseResult>;
21
+ heartbeatLease(params?: UnknownRecord): Promise<MaestroAppServerRemoteControlLeaseResult>;
22
+ drain(params?: UnknownRecord): Promise<MaestroAppServerRemoteControlDrainResult>;
23
+ }
24
+ export interface MaestroAppServerDaemonLifecycleOptions {
25
+ hostedRunner?: HostedRunnerContext;
26
+ drainRunner?: DrainRunner;
27
+ now?: () => Date;
28
+ }
29
+ export declare function createMaestroAppServerDaemonLifecycle(options?: MaestroAppServerDaemonLifecycleOptions): MaestroAppServerDaemonLifecycle;
30
+ export {};
31
+ //# sourceMappingURL=daemon-lifecycle-api.d.ts.map