@provos/ironcurtain 0.9.1 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (502) hide show
  1. package/README.md +69 -10
  2. package/dist/auth/oauth-provider.js +1 -4
  3. package/dist/auth/oauth-provider.js.map +1 -1
  4. package/dist/cli.js +40 -2
  5. package/dist/cli.js.map +1 -1
  6. package/dist/config/config-command.js +174 -10
  7. package/dist/config/config-command.js.map +1 -1
  8. package/dist/config/first-start.js +61 -0
  9. package/dist/config/first-start.js.map +1 -1
  10. package/dist/config/generated/compiled-policy.json +528 -161
  11. package/dist/config/generated/test-scenarios.json +4810 -170
  12. package/dist/config/generated/tool-annotations.json +34 -47
  13. package/dist/config/index.d.ts +58 -0
  14. package/dist/config/index.js +97 -15
  15. package/dist/config/index.js.map +1 -1
  16. package/dist/config/mcp-servers.json +2 -2
  17. package/dist/config/model-provider.d.ts +8 -2
  18. package/dist/config/model-provider.js +52 -9
  19. package/dist/config/model-provider.js.map +1 -1
  20. package/dist/config/paths.d.ts +181 -0
  21. package/dist/config/paths.js +326 -23
  22. package/dist/config/paths.js.map +1 -1
  23. package/dist/config/types.d.ts +7 -1
  24. package/dist/config/user-config.d.ts +61 -4
  25. package/dist/config/user-config.js +108 -21
  26. package/dist/config/user-config.js.map +1 -1
  27. package/dist/config/validate-policy-dir.d.ts +10 -0
  28. package/dist/config/validate-policy-dir.js +59 -0
  29. package/dist/config/validate-policy-dir.js.map +1 -0
  30. package/dist/cron/compile-task-policy.js +1 -0
  31. package/dist/cron/compile-task-policy.js.map +1 -1
  32. package/dist/cron/job-commands.js +22 -2
  33. package/dist/cron/job-commands.js.map +1 -1
  34. package/dist/cron/types.d.ts +16 -2
  35. package/dist/cron/types.js +1 -3
  36. package/dist/cron/types.js.map +1 -1
  37. package/dist/daemon/daemon-command.js +16 -2
  38. package/dist/daemon/daemon-command.js.map +1 -1
  39. package/dist/daemon/ironcurtain-daemon.d.ts +44 -1
  40. package/dist/daemon/ironcurtain-daemon.js +210 -8
  41. package/dist/daemon/ironcurtain-daemon.js.map +1 -1
  42. package/dist/docker/adapters/claude-code.d.ts +2 -1
  43. package/dist/docker/adapters/claude-code.js +320 -131
  44. package/dist/docker/adapters/claude-code.js.map +1 -1
  45. package/dist/docker/adapters/goose.d.ts +12 -11
  46. package/dist/docker/adapters/goose.js +80 -27
  47. package/dist/docker/adapters/goose.js.map +1 -1
  48. package/dist/docker/agent-adapter.d.ts +178 -4
  49. package/dist/docker/agent-adapter.js +14 -0
  50. package/dist/docker/agent-adapter.js.map +1 -1
  51. package/dist/docker/agent-registry.js +3 -2
  52. package/dist/docker/agent-registry.js.map +1 -1
  53. package/dist/docker/code-mode-proxy.d.ts +27 -0
  54. package/dist/docker/code-mode-proxy.js +3 -0
  55. package/dist/docker/code-mode-proxy.js.map +1 -1
  56. package/dist/docker/container-lifecycle.d.ts +15 -0
  57. package/dist/docker/container-lifecycle.js +32 -0
  58. package/dist/docker/container-lifecycle.js.map +1 -0
  59. package/dist/docker/docker-agent-session.d.ts +113 -62
  60. package/dist/docker/docker-agent-session.js +241 -300
  61. package/dist/docker/docker-agent-session.js.map +1 -1
  62. package/dist/docker/docker-infrastructure.d.ts +256 -21
  63. package/dist/docker/docker-infrastructure.js +585 -30
  64. package/dist/docker/docker-infrastructure.js.map +1 -1
  65. package/dist/docker/docker-manager.d.ts +36 -1
  66. package/dist/docker/docker-manager.js +168 -26
  67. package/dist/docker/docker-manager.js.map +1 -1
  68. package/dist/docker/docker-progress-sink.d.ts +43 -0
  69. package/dist/docker/docker-progress-sink.js +299 -0
  70. package/dist/docker/docker-progress-sink.js.map +1 -0
  71. package/dist/docker/mitm-proxy.d.ts +90 -1
  72. package/dist/docker/mitm-proxy.js +720 -40
  73. package/dist/docker/mitm-proxy.js.map +1 -1
  74. package/dist/docker/oauth-credentials.d.ts +46 -3
  75. package/dist/docker/oauth-credentials.js +56 -14
  76. package/dist/docker/oauth-credentials.js.map +1 -1
  77. package/dist/docker/oauth-token-manager.js +2 -2
  78. package/dist/docker/oauth-token-manager.js.map +1 -1
  79. package/dist/docker/orientation.d.ts +1 -1
  80. package/dist/docker/provider-config.d.ts +81 -2
  81. package/dist/docker/provider-config.js +222 -28
  82. package/dist/docker/provider-config.js.map +1 -1
  83. package/dist/docker/proxy-tools.d.ts +0 -2
  84. package/dist/docker/proxy-tools.js +2 -7
  85. package/dist/docker/proxy-tools.js.map +1 -1
  86. package/dist/docker/pty-session.d.ts +49 -1
  87. package/dist/docker/pty-session.js +212 -90
  88. package/dist/docker/pty-session.js.map +1 -1
  89. package/dist/docker/pty-types.d.ts +0 -2
  90. package/dist/docker/pty-types.js +0 -2
  91. package/dist/docker/pty-types.js.map +1 -1
  92. package/dist/docker/resource-limits.d.ts +125 -0
  93. package/dist/docker/resource-limits.js +200 -0
  94. package/dist/docker/resource-limits.js.map +1 -0
  95. package/dist/docker/spawn-with-idle-timeout.d.ts +39 -0
  96. package/dist/docker/spawn-with-idle-timeout.js +152 -0
  97. package/dist/docker/spawn-with-idle-timeout.js.map +1 -0
  98. package/dist/docker/sse-extractor.d.ts +51 -0
  99. package/dist/docker/sse-extractor.js +303 -0
  100. package/dist/docker/sse-extractor.js.map +1 -0
  101. package/dist/docker/token-stream-bus.d.ts +83 -0
  102. package/dist/docker/token-stream-bus.js +98 -0
  103. package/dist/docker/token-stream-bus.js.map +1 -0
  104. package/dist/docker/token-stream-types.d.ts +71 -0
  105. package/dist/docker/token-stream-types.js +8 -0
  106. package/dist/docker/token-stream-types.js.map +1 -0
  107. package/dist/docker/types.d.ts +61 -6
  108. package/dist/doctor/checks.d.ts +138 -0
  109. package/dist/doctor/checks.js +511 -0
  110. package/dist/doctor/checks.js.map +1 -0
  111. package/dist/doctor/doctor-command.d.ts +29 -0
  112. package/dist/doctor/doctor-command.js +160 -0
  113. package/dist/doctor/doctor-command.js.map +1 -0
  114. package/dist/doctor/mcp-liveness.d.ts +28 -0
  115. package/dist/doctor/mcp-liveness.js +84 -0
  116. package/dist/doctor/mcp-liveness.js.map +1 -0
  117. package/dist/doctor/oauth-checks.d.ts +23 -0
  118. package/dist/doctor/oauth-checks.js +157 -0
  119. package/dist/doctor/oauth-checks.js.map +1 -0
  120. package/dist/doctor/output.d.ts +26 -0
  121. package/dist/doctor/output.js +82 -0
  122. package/dist/doctor/output.js.map +1 -0
  123. package/dist/escalation/listener-command.js +0 -3
  124. package/dist/escalation/listener-command.js.map +1 -1
  125. package/dist/event-bus/typed-event-bus.d.ts +26 -0
  126. package/dist/event-bus/typed-event-bus.js +35 -0
  127. package/dist/event-bus/typed-event-bus.js.map +1 -0
  128. package/dist/index.js +32 -9
  129. package/dist/index.js.map +1 -1
  130. package/dist/logger.js +31 -2
  131. package/dist/logger.js.map +1 -1
  132. package/dist/memory/auto-save.d.ts +18 -4
  133. package/dist/memory/auto-save.js +46 -6
  134. package/dist/memory/auto-save.js.map +1 -1
  135. package/dist/memory/memory-policy.d.ts +41 -0
  136. package/dist/memory/memory-policy.js +36 -0
  137. package/dist/memory/memory-policy.js.map +1 -0
  138. package/dist/mux/mux-app.d.ts +2 -0
  139. package/dist/mux/mux-app.js +30 -34
  140. package/dist/mux/mux-app.js.map +1 -1
  141. package/dist/mux/mux-command.d.ts +10 -1
  142. package/dist/mux/mux-command.js +62 -35
  143. package/dist/mux/mux-command.js.map +1 -1
  144. package/dist/mux/mux-renderer.js +22 -17
  145. package/dist/mux/mux-renderer.js.map +1 -1
  146. package/dist/mux/pty-bridge.d.ts +2 -0
  147. package/dist/mux/pty-bridge.js +3 -0
  148. package/dist/mux/pty-bridge.js.map +1 -1
  149. package/dist/mux/session-scanner.d.ts +7 -0
  150. package/dist/mux/session-scanner.js +21 -2
  151. package/dist/mux/session-scanner.js.map +1 -1
  152. package/dist/mux/types.d.ts +0 -4
  153. package/dist/mux/types.js.map +1 -1
  154. package/dist/{pipeline → observability}/llm-logger.d.ts +9 -3
  155. package/dist/{pipeline → observability}/llm-logger.js +16 -4
  156. package/dist/observability/llm-logger.js.map +1 -0
  157. package/dist/observe/observe-command.d.ts +12 -0
  158. package/dist/observe/observe-command.js +298 -0
  159. package/dist/observe/observe-command.js.map +1 -0
  160. package/dist/observe/observe-renderer.d.ts +24 -0
  161. package/dist/observe/observe-renderer.js +87 -0
  162. package/dist/observe/observe-renderer.js.map +1 -0
  163. package/dist/observe/observe-tui-rain.d.ts +42 -0
  164. package/dist/observe/observe-tui-rain.js +531 -0
  165. package/dist/observe/observe-tui-rain.js.map +1 -0
  166. package/dist/observe/observe-tui-text-panel.d.ts +46 -0
  167. package/dist/observe/observe-tui-text-panel.js +525 -0
  168. package/dist/observe/observe-tui-text-panel.js.map +1 -0
  169. package/dist/observe/observe-tui-types.d.ts +270 -0
  170. package/dist/observe/observe-tui-types.js +200 -0
  171. package/dist/observe/observe-tui-types.js.map +1 -0
  172. package/dist/observe/observe-tui-word-scorer.d.ts +143 -0
  173. package/dist/observe/observe-tui-word-scorer.js +572 -0
  174. package/dist/observe/observe-tui-word-scorer.js.map +1 -0
  175. package/dist/observe/observe-tui.d.ts +59 -0
  176. package/dist/observe/observe-tui.js +592 -0
  177. package/dist/observe/observe-tui.js.map +1 -0
  178. package/dist/persona/compile-persona-policy.js +1 -0
  179. package/dist/persona/compile-persona-policy.js.map +1 -1
  180. package/dist/persona/memory-gate.d.ts +19 -0
  181. package/dist/persona/memory-gate.js +33 -0
  182. package/dist/persona/memory-gate.js.map +1 -0
  183. package/dist/persona/persona-command.js +41 -6
  184. package/dist/persona/persona-command.js.map +1 -1
  185. package/dist/persona/resolve.d.ts +22 -0
  186. package/dist/persona/resolve.js +45 -2
  187. package/dist/persona/resolve.js.map +1 -1
  188. package/dist/persona/types.d.ts +16 -0
  189. package/dist/pipeline/annotate.d.ts +7 -1
  190. package/dist/pipeline/annotate.js +92 -2
  191. package/dist/pipeline/annotate.js.map +1 -1
  192. package/dist/pipeline/compile.js +2 -0
  193. package/dist/pipeline/compile.js.map +1 -1
  194. package/dist/pipeline/constitution-compiler.d.ts +25 -14
  195. package/dist/pipeline/constitution-compiler.js +107 -38
  196. package/dist/pipeline/constitution-compiler.js.map +1 -1
  197. package/dist/pipeline/dynamic-list-types.d.ts +3 -6
  198. package/dist/pipeline/dynamic-list-types.js +3 -16
  199. package/dist/pipeline/dynamic-list-types.js.map +1 -1
  200. package/dist/pipeline/parallel-progress.d.ts +59 -0
  201. package/dist/pipeline/parallel-progress.js +263 -0
  202. package/dist/pipeline/parallel-progress.js.map +1 -0
  203. package/dist/pipeline/pipeline-runner.d.ts +49 -8
  204. package/dist/pipeline/pipeline-runner.js +419 -231
  205. package/dist/pipeline/pipeline-runner.js.map +1 -1
  206. package/dist/pipeline/pipeline-shared.d.ts +59 -1
  207. package/dist/pipeline/pipeline-shared.js +127 -12
  208. package/dist/pipeline/pipeline-shared.js.map +1 -1
  209. package/dist/pipeline/policy-verifier.js +16 -3
  210. package/dist/pipeline/policy-verifier.js.map +1 -1
  211. package/dist/pipeline/proxy-mcp-connections.js +17 -2
  212. package/dist/pipeline/proxy-mcp-connections.js.map +1 -1
  213. package/dist/pipeline/scenario-generator.d.ts +4 -8
  214. package/dist/pipeline/scenario-generator.js +13 -46
  215. package/dist/pipeline/scenario-generator.js.map +1 -1
  216. package/dist/pipeline/server-prefilter.d.ts +31 -0
  217. package/dist/pipeline/server-prefilter.js +115 -0
  218. package/dist/pipeline/server-prefilter.js.map +1 -0
  219. package/dist/pipeline/types.d.ts +5 -0
  220. package/dist/sandbox/index.d.ts +14 -0
  221. package/dist/sandbox/index.js +335 -116
  222. package/dist/sandbox/index.js.map +1 -1
  223. package/dist/sandbox/ironcurtain-protocol.d.ts +52 -0
  224. package/dist/sandbox/ironcurtain-protocol.js +185 -0
  225. package/dist/sandbox/ironcurtain-protocol.js.map +1 -0
  226. package/dist/session/agent-session.d.ts +6 -0
  227. package/dist/session/agent-session.js +16 -5
  228. package/dist/session/agent-session.js.map +1 -1
  229. package/dist/session/cli-transport.js +0 -6
  230. package/dist/session/cli-transport.js.map +1 -1
  231. package/dist/session/index.d.ts +35 -14
  232. package/dist/session/index.js +324 -130
  233. package/dist/session/index.js.map +1 -1
  234. package/dist/session/preflight.d.ts +50 -13
  235. package/dist/session/preflight.js +252 -80
  236. package/dist/session/preflight.js.map +1 -1
  237. package/dist/session/prompts.d.ts +2 -5
  238. package/dist/session/prompts.js.map +1 -1
  239. package/dist/session/session-manager.d.ts +61 -6
  240. package/dist/session/session-manager.js +72 -10
  241. package/dist/session/session-manager.js.map +1 -1
  242. package/dist/session/session-metadata.d.ts +21 -5
  243. package/dist/session/session-metadata.js +34 -12
  244. package/dist/session/session-metadata.js.map +1 -1
  245. package/dist/session/types.d.ts +311 -5
  246. package/dist/session/types.js +57 -1
  247. package/dist/session/types.js.map +1 -1
  248. package/dist/signal/setup-signal.js +13 -21
  249. package/dist/signal/setup-signal.js.map +1 -1
  250. package/dist/signal/signal-bot-daemon.d.ts +16 -1
  251. package/dist/signal/signal-bot-daemon.js +39 -27
  252. package/dist/signal/signal-bot-daemon.js.map +1 -1
  253. package/dist/signal/signal-container.js +7 -1
  254. package/dist/signal/signal-container.js.map +1 -1
  255. package/dist/skills/discovery.d.ts +77 -0
  256. package/dist/skills/discovery.js +206 -0
  257. package/dist/skills/discovery.js.map +1 -0
  258. package/dist/skills/index.d.ts +4 -0
  259. package/dist/skills/index.js +3 -0
  260. package/dist/skills/index.js.map +1 -0
  261. package/dist/skills/staging.d.ts +28 -0
  262. package/dist/skills/staging.js +68 -0
  263. package/dist/skills/staging.js.map +1 -0
  264. package/dist/skills/types.d.ts +46 -0
  265. package/dist/skills/types.js +2 -0
  266. package/dist/skills/types.js.map +1 -0
  267. package/dist/trusted-process/approval-whitelist.d.ts +0 -2
  268. package/dist/trusted-process/approval-whitelist.js +17 -17
  269. package/dist/trusted-process/approval-whitelist.js.map +1 -1
  270. package/dist/trusted-process/async-mutex.d.ts +32 -0
  271. package/dist/trusted-process/async-mutex.js +50 -0
  272. package/dist/trusted-process/async-mutex.js.map +1 -0
  273. package/dist/trusted-process/audit-log.d.ts +38 -1
  274. package/dist/trusted-process/audit-log.js +82 -13
  275. package/dist/trusted-process/audit-log.js.map +1 -1
  276. package/dist/trusted-process/call-circuit-breaker.js +2 -1
  277. package/dist/trusted-process/call-circuit-breaker.js.map +1 -1
  278. package/dist/trusted-process/control-server.d.ts +101 -0
  279. package/dist/trusted-process/control-server.js +282 -0
  280. package/dist/trusted-process/control-server.js.map +1 -0
  281. package/dist/trusted-process/domain-utils.d.ts +6 -6
  282. package/dist/trusted-process/domain-utils.js +7 -23
  283. package/dist/trusted-process/domain-utils.js.map +1 -1
  284. package/dist/trusted-process/error-prefixes.d.ts +16 -0
  285. package/dist/trusted-process/error-prefixes.js +17 -0
  286. package/dist/trusted-process/error-prefixes.js.map +1 -0
  287. package/dist/trusted-process/index.d.ts +40 -23
  288. package/dist/trusted-process/index.js +131 -225
  289. package/dist/trusted-process/index.js.map +1 -1
  290. package/dist/trusted-process/list-matcher.d.ts +17 -0
  291. package/dist/trusted-process/list-matcher.js +31 -0
  292. package/dist/trusted-process/list-matcher.js.map +1 -0
  293. package/dist/trusted-process/mcp-client-manager.d.ts +35 -6
  294. package/dist/trusted-process/mcp-client-manager.js +40 -45
  295. package/dist/trusted-process/mcp-client-manager.js.map +1 -1
  296. package/dist/trusted-process/mcp-proxy-server.d.ts +31 -120
  297. package/dist/trusted-process/mcp-proxy-server.js +166 -657
  298. package/dist/trusted-process/mcp-proxy-server.js.map +1 -1
  299. package/dist/trusted-process/policy-engine.d.ts +16 -4
  300. package/dist/trusted-process/policy-engine.js +90 -45
  301. package/dist/trusted-process/policy-engine.js.map +1 -1
  302. package/dist/trusted-process/policy-roots.d.ts +6 -0
  303. package/dist/trusted-process/policy-roots.js +20 -0
  304. package/dist/trusted-process/policy-roots.js.map +1 -1
  305. package/dist/trusted-process/sandbox-integration.d.ts +12 -0
  306. package/dist/trusted-process/sandbox-integration.js +26 -0
  307. package/dist/trusted-process/sandbox-integration.js.map +1 -1
  308. package/dist/trusted-process/tool-call-coordinator.d.ts +269 -0
  309. package/dist/trusted-process/tool-call-coordinator.js +508 -0
  310. package/dist/trusted-process/tool-call-coordinator.js.map +1 -0
  311. package/dist/trusted-process/tool-call-pipeline.d.ts +205 -0
  312. package/dist/trusted-process/tool-call-pipeline.js +798 -0
  313. package/dist/trusted-process/tool-call-pipeline.js.map +1 -0
  314. package/dist/trusted-process/tool-description-hints.d.ts +1 -1
  315. package/dist/types/argument-roles.d.ts +1 -1
  316. package/dist/types/argument-roles.js +14 -1
  317. package/dist/types/argument-roles.js.map +1 -1
  318. package/dist/types/audit.d.ts +9 -0
  319. package/dist/{session → types}/errors.d.ts +8 -2
  320. package/dist/{session → types}/errors.js +8 -2
  321. package/dist/types/errors.js.map +1 -0
  322. package/dist/types/reserved-servers.d.ts +11 -0
  323. package/dist/types/reserved-servers.js +12 -0
  324. package/dist/types/reserved-servers.js.map +1 -0
  325. package/dist/types/server-listing.d.ts +14 -0
  326. package/dist/types/server-listing.js +2 -0
  327. package/dist/types/server-listing.js.map +1 -0
  328. package/dist/types/slug.d.ts +2 -0
  329. package/dist/types/slug.js +2 -0
  330. package/dist/types/slug.js.map +1 -1
  331. package/dist/types/url-normalize.d.ts +16 -0
  332. package/dist/types/url-normalize.js +33 -0
  333. package/dist/types/url-normalize.js.map +1 -0
  334. package/dist/utils/error-message.d.ts +8 -0
  335. package/dist/utils/error-message.js +11 -0
  336. package/dist/utils/error-message.js.map +1 -0
  337. package/dist/utils/exec-error.d.ts +19 -0
  338. package/dist/utils/exec-error.js +16 -0
  339. package/dist/utils/exec-error.js.map +1 -0
  340. package/dist/utils/is-plain-object.d.ts +7 -0
  341. package/dist/utils/is-plain-object.js +12 -0
  342. package/dist/utils/is-plain-object.js.map +1 -0
  343. package/dist/utils/preflight-checks.d.ts +16 -0
  344. package/dist/utils/preflight-checks.js +178 -0
  345. package/dist/utils/preflight-checks.js.map +1 -0
  346. package/dist/web-ui/__tests__/json-rpc-dispatch.test.d.ts +7 -0
  347. package/dist/web-ui/__tests__/json-rpc-dispatch.test.js +725 -0
  348. package/dist/web-ui/__tests__/json-rpc-dispatch.test.js.map +1 -0
  349. package/dist/web-ui/dispatch/escalation-dispatch.d.ts +7 -0
  350. package/dist/web-ui/dispatch/escalation-dispatch.js +52 -0
  351. package/dist/web-ui/dispatch/escalation-dispatch.js.map +1 -0
  352. package/dist/web-ui/dispatch/job-dispatch.d.ts +8 -0
  353. package/dist/web-ui/dispatch/job-dispatch.js +83 -0
  354. package/dist/web-ui/dispatch/job-dispatch.js.map +1 -0
  355. package/dist/web-ui/dispatch/persona-dispatch.d.ts +6 -0
  356. package/dist/web-ui/dispatch/persona-dispatch.js +116 -0
  357. package/dist/web-ui/dispatch/persona-dispatch.js.map +1 -0
  358. package/dist/web-ui/dispatch/session-dispatch.d.ts +9 -0
  359. package/dist/web-ui/dispatch/session-dispatch.js +201 -0
  360. package/dist/web-ui/dispatch/session-dispatch.js.map +1 -0
  361. package/dist/web-ui/dispatch/token-stream-dispatch.d.ts +15 -0
  362. package/dist/web-ui/dispatch/token-stream-dispatch.js +55 -0
  363. package/dist/web-ui/dispatch/token-stream-dispatch.js.map +1 -0
  364. package/dist/web-ui/dispatch/types.d.ts +31 -0
  365. package/dist/web-ui/dispatch/types.js +68 -0
  366. package/dist/web-ui/dispatch/types.js.map +1 -0
  367. package/dist/web-ui/dispatch/workflow-dispatch.d.ts +103 -0
  368. package/dist/web-ui/dispatch/workflow-dispatch.js +925 -0
  369. package/dist/web-ui/dispatch/workflow-dispatch.js.map +1 -0
  370. package/dist/web-ui/json-rpc-dispatch.d.ts +12 -0
  371. package/dist/web-ui/json-rpc-dispatch.js +34 -0
  372. package/dist/web-ui/json-rpc-dispatch.js.map +1 -0
  373. package/dist/web-ui/state-graph.d.ts +13 -0
  374. package/dist/web-ui/state-graph.js +82 -0
  375. package/dist/web-ui/state-graph.js.map +1 -0
  376. package/dist/web-ui/token-stream-bridge.d.ts +76 -0
  377. package/dist/web-ui/token-stream-bridge.js +265 -0
  378. package/dist/web-ui/token-stream-bridge.js.map +1 -0
  379. package/dist/web-ui/web-event-bus.d.ts +152 -0
  380. package/dist/web-ui/web-event-bus.js +19 -0
  381. package/dist/web-ui/web-event-bus.js.map +1 -0
  382. package/dist/web-ui/web-session-transport.d.ts +31 -0
  383. package/dist/web-ui/web-session-transport.js +109 -0
  384. package/dist/web-ui/web-session-transport.js.map +1 -0
  385. package/dist/web-ui/web-ui-server.d.ts +76 -0
  386. package/dist/web-ui/web-ui-server.js +461 -0
  387. package/dist/web-ui/web-ui-server.js.map +1 -0
  388. package/dist/web-ui/web-ui-types.d.ts +290 -0
  389. package/dist/web-ui/web-ui-types.js +32 -0
  390. package/dist/web-ui/web-ui-types.js.map +1 -0
  391. package/dist/web-ui/ws-utils.d.ts +5 -0
  392. package/dist/web-ui/ws-utils.js +12 -0
  393. package/dist/web-ui/ws-utils.js.map +1 -0
  394. package/dist/web-ui-static/assets/index-BFO5z1js.js +76 -0
  395. package/dist/web-ui-static/assets/index-CCUwrkIL.css +1 -0
  396. package/dist/web-ui-static/assets/orbitron-latin-700-normal-4jsRXGGJ.woff2 +0 -0
  397. package/dist/web-ui-static/assets/orbitron-latin-700-normal-DmYOh-W9.woff +0 -0
  398. package/dist/web-ui-static/index.html +14 -0
  399. package/dist/workflow/artifacts.d.ts +59 -0
  400. package/dist/workflow/artifacts.js +188 -0
  401. package/dist/workflow/artifacts.js.map +1 -0
  402. package/dist/workflow/checkpoint-selection.d.ts +34 -0
  403. package/dist/workflow/checkpoint-selection.js +48 -0
  404. package/dist/workflow/checkpoint-selection.js.map +1 -0
  405. package/dist/workflow/checkpoint.d.ts +35 -0
  406. package/dist/workflow/checkpoint.js +84 -0
  407. package/dist/workflow/checkpoint.js.map +1 -0
  408. package/dist/workflow/cli-support.d.ts +92 -0
  409. package/dist/workflow/cli-support.js +423 -0
  410. package/dist/workflow/cli-support.js.map +1 -0
  411. package/dist/workflow/definition-loader.d.ts +32 -0
  412. package/dist/workflow/definition-loader.js +56 -0
  413. package/dist/workflow/definition-loader.js.map +1 -0
  414. package/dist/workflow/discovery.d.ts +78 -0
  415. package/dist/workflow/discovery.js +203 -0
  416. package/dist/workflow/discovery.js.map +1 -0
  417. package/dist/workflow/errors.d.ts +66 -0
  418. package/dist/workflow/errors.js +49 -0
  419. package/dist/workflow/errors.js.map +1 -0
  420. package/dist/workflow/guards.d.ts +8 -0
  421. package/dist/workflow/guards.js +38 -0
  422. package/dist/workflow/guards.js.map +1 -0
  423. package/dist/workflow/lint-integration.d.ts +64 -0
  424. package/dist/workflow/lint-integration.js +56 -0
  425. package/dist/workflow/lint-integration.js.map +1 -0
  426. package/dist/workflow/lint.d.ts +66 -0
  427. package/dist/workflow/lint.js +410 -0
  428. package/dist/workflow/lint.js.map +1 -0
  429. package/dist/workflow/machine-builder.d.ts +90 -0
  430. package/dist/workflow/machine-builder.js +485 -0
  431. package/dist/workflow/machine-builder.js.map +1 -0
  432. package/dist/workflow/message-log.d.ts +85 -0
  433. package/dist/workflow/message-log.js +40 -0
  434. package/dist/workflow/message-log.js.map +1 -0
  435. package/dist/workflow/orchestrator.d.ts +450 -0
  436. package/dist/workflow/orchestrator.js +1941 -0
  437. package/dist/workflow/orchestrator.js.map +1 -0
  438. package/dist/workflow/prompt-builder.d.ts +39 -0
  439. package/dist/workflow/prompt-builder.js +242 -0
  440. package/dist/workflow/prompt-builder.js.map +1 -0
  441. package/dist/workflow/run-state-command.d.ts +9 -0
  442. package/dist/workflow/run-state-command.js +414 -0
  443. package/dist/workflow/run-state-command.js.map +1 -0
  444. package/dist/workflow/run-state-debug-capture.d.ts +40 -0
  445. package/dist/workflow/run-state-debug-capture.js +101 -0
  446. package/dist/workflow/run-state-debug-capture.js.map +1 -0
  447. package/dist/workflow/status-parser.d.ts +68 -0
  448. package/dist/workflow/status-parser.js +259 -0
  449. package/dist/workflow/status-parser.js.map +1 -0
  450. package/dist/workflow/types.d.ts +498 -0
  451. package/dist/workflow/types.js +83 -0
  452. package/dist/workflow/types.js.map +1 -0
  453. package/dist/workflow/validate.d.ts +58 -0
  454. package/dist/workflow/validate.js +499 -0
  455. package/dist/workflow/validate.js.map +1 -0
  456. package/dist/workflow/workflow-command.d.ts +26 -0
  457. package/dist/workflow/workflow-command.js +648 -0
  458. package/dist/workflow/workflow-command.js.map +1 -0
  459. package/dist/workflow/workflow-discovery.d.ts +25 -0
  460. package/dist/workflow/workflow-discovery.js +100 -0
  461. package/dist/workflow/workflow-discovery.js.map +1 -0
  462. package/dist/workflow/workflow-manager.d.ts +122 -0
  463. package/dist/workflow/workflow-manager.js +308 -0
  464. package/dist/workflow/workflow-manager.js.map +1 -0
  465. package/dist/workflow/workflows/design-and-code/workflow.yaml +169 -0
  466. package/dist/workflow/workflows/test-email-summary/skills/email-formatting/SKILL.md +55 -0
  467. package/dist/workflow/workflows/test-email-summary/skills/gmail-query-syntax/SKILL.md +63 -0
  468. package/dist/workflow/workflows/test-email-summary/skills/json-schema-emails/SKILL.md +41 -0
  469. package/dist/workflow/workflows/test-email-summary/skills/json-schema-emails/schema.json +34 -0
  470. package/dist/workflow/workflows/test-email-summary/skills/summary-style-guide/SKILL.md +51 -0
  471. package/dist/workflow/workflows/test-email-summary/workflow.yaml +89 -0
  472. package/dist/workflow/workflows/vuln-discovery/skills/harness-design-fuzzing/SKILL.md +201 -0
  473. package/dist/workflow/workflows/vuln-discovery/skills/memory-safety-c-cpp/SKILL.md +166 -0
  474. package/dist/workflow/workflows/vuln-discovery/skills/vulnerability-triage/SKILL.md +185 -0
  475. package/dist/workflow/workflows/vuln-discovery/workflow.yaml +920 -0
  476. package/dist/workflow/worktree.d.ts +43 -0
  477. package/dist/workflow/worktree.js +106 -0
  478. package/dist/workflow/worktree.js.map +1 -0
  479. package/docker/Dockerfile.base +12 -1
  480. package/docker/Dockerfile.base.arm64 +17 -1
  481. package/docker/entrypoint-claude-code.sh +46 -0
  482. package/docker/entrypoint-goose.sh +25 -0
  483. package/package.json +22 -8
  484. package/packages/web-ui/README.md +113 -0
  485. package/packages/web-ui/docs/workflow-state-machine.png +0 -0
  486. package/src/config/generated/compiled-policy.json +528 -161
  487. package/src/config/generated/test-scenarios.json +4810 -170
  488. package/src/config/generated/tool-annotations.json +34 -47
  489. package/src/config/mcp-servers.json +2 -2
  490. package/src/workflow/workflows/design-and-code/workflow.yaml +169 -0
  491. package/src/workflow/workflows/test-email-summary/skills/email-formatting/SKILL.md +55 -0
  492. package/src/workflow/workflows/test-email-summary/skills/gmail-query-syntax/SKILL.md +63 -0
  493. package/src/workflow/workflows/test-email-summary/skills/json-schema-emails/SKILL.md +41 -0
  494. package/src/workflow/workflows/test-email-summary/skills/json-schema-emails/schema.json +34 -0
  495. package/src/workflow/workflows/test-email-summary/skills/summary-style-guide/SKILL.md +51 -0
  496. package/src/workflow/workflows/test-email-summary/workflow.yaml +89 -0
  497. package/src/workflow/workflows/vuln-discovery/skills/harness-design-fuzzing/SKILL.md +201 -0
  498. package/src/workflow/workflows/vuln-discovery/skills/memory-safety-c-cpp/SKILL.md +166 -0
  499. package/src/workflow/workflows/vuln-discovery/skills/vulnerability-triage/SKILL.md +185 -0
  500. package/src/workflow/workflows/vuln-discovery/workflow.yaml +920 -0
  501. package/dist/pipeline/llm-logger.js.map +0 -1
  502. package/dist/session/errors.js.map +0 -1
@@ -0,0 +1,169 @@
1
+ name: design-and-code
2
+ description: "Plan -> Design -> Implement -> Review workflow with human gates and coder-critic loop"
3
+ initial: plan
4
+
5
+ settings:
6
+ mode: docker
7
+ dockerAgent: claude-code
8
+ maxRounds: 3
9
+ systemPrompt: "Workflow artifacts (plan, spec, reviews) go in `.workflow/`. Code goes directly at the workspace root."
10
+
11
+ states:
12
+ plan:
13
+ type: agent
14
+ description: Breaks down the task into implementation steps
15
+ persona: global
16
+ prompt: |
17
+ You are a project planner.
18
+
19
+ Your responsibilities:
20
+ - Analyze the task requirements
21
+ - If there is existing code in the workspace, read it to understand the current architecture
22
+ - Identify components, dependencies, and implementation order
23
+ - Note key design decisions and trade-offs
24
+
25
+ Output: Create a `.workflow/plan/` directory with a `plan.md` file.
26
+ Write a structured markdown document with numbered steps.
27
+ Do NOT write any code -- only the plan.
28
+ inputs: []
29
+ outputs:
30
+ - plan
31
+ transitions:
32
+ - to: plan_review
33
+
34
+ plan_review:
35
+ type: human_gate
36
+ description: Human review of the plan
37
+ acceptedEvents:
38
+ - APPROVE
39
+ - FORCE_REVISION
40
+ - ABORT
41
+ present:
42
+ - plan
43
+ transitions:
44
+ - to: design
45
+ event: APPROVE
46
+ - to: plan
47
+ event: FORCE_REVISION
48
+ - to: aborted
49
+ event: ABORT
50
+
51
+ design:
52
+ type: agent
53
+ description: Produces technical design specification with interfaces and types
54
+ persona: global
55
+ prompt: |
56
+ You are a software architect. Produce a technical design specification.
57
+
58
+ Your responsibilities:
59
+ - Define module structure, interfaces, and data flow
60
+ - Specify function signatures with TypeScript types
61
+ - Document key design decisions and rationale
62
+ - If there is existing code, design around it
63
+
64
+ Output: Create a `.workflow/spec/` directory with a `spec.md` file.
65
+ Do NOT write implementation code.
66
+ inputs:
67
+ - plan
68
+ outputs:
69
+ - spec
70
+ transitions:
71
+ - to: design_review
72
+
73
+ design_review:
74
+ type: human_gate
75
+ description: Human review of the design specification
76
+ acceptedEvents:
77
+ - APPROVE
78
+ - FORCE_REVISION
79
+ - ABORT
80
+ present:
81
+ - spec
82
+ transitions:
83
+ - to: implement
84
+ event: APPROVE
85
+ - to: design
86
+ event: FORCE_REVISION
87
+ - to: aborted
88
+ event: ABORT
89
+
90
+ implement:
91
+ type: agent
92
+ description: Implements all modules per the design spec
93
+ freshSession: false
94
+ persona: global
95
+ prompt: |
96
+ You are an implementation engineer.
97
+
98
+ Your responsibilities:
99
+ - Implement all modules described in the spec
100
+ - Write clean, well-typed TypeScript
101
+ - Create unit tests
102
+ - Run the tests to verify they pass
103
+
104
+ Write code directly at the workspace root (e.g., `src/`, `package.json`, `tests/`).
105
+ Do NOT create a separate output directory for code.
106
+ Run all tests to verify everything works.
107
+ inputs:
108
+ - plan
109
+ - spec
110
+ outputs: []
111
+ transitions:
112
+ - to: review
113
+
114
+ review:
115
+ type: agent
116
+ description: Reviews code against the spec for correctness and quality
117
+ persona: global
118
+ prompt: |
119
+ You are a code reviewer.
120
+
121
+ Your responsibilities:
122
+ - Verify correctness: does the code at the workspace root match the spec?
123
+ - Check edge cases and error handling
124
+ - Evaluate code quality, naming, and structure
125
+ - Assess test coverage and test quality
126
+
127
+ Output: Create a `.workflow/reviews/` directory with a `review.md` file.
128
+ If issues are found, set verdict to "rejected" with specific, actionable feedback.
129
+ If the code is solid, set verdict to "approved".
130
+ inputs:
131
+ - spec
132
+ outputs:
133
+ - reviews
134
+ transitions:
135
+ - to: done
136
+ when:
137
+ verdict: approved
138
+ - to: escalate_gate
139
+ guard: isRoundLimitReached
140
+ - to: implement
141
+ when:
142
+ verdict: rejected
143
+
144
+ escalate_gate:
145
+ type: human_gate
146
+ description: Human review when coder-critic loop reaches round limit
147
+ acceptedEvents:
148
+ - APPROVE
149
+ - FORCE_REVISION
150
+ - ABORT
151
+ present:
152
+ - reviews
153
+ transitions:
154
+ - to: done
155
+ event: APPROVE
156
+ - to: implement
157
+ event: FORCE_REVISION
158
+ - to: aborted
159
+ event: ABORT
160
+
161
+ done:
162
+ type: terminal
163
+ description: Workflow complete
164
+ outputs:
165
+ - reviews
166
+
167
+ aborted:
168
+ type: terminal
169
+ description: Workflow aborted
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: email-formatting
3
+ description: Markdown formatting conventions for email summary documents — heading depth, list style, line length, emoji policy, and a mandatory provenance footer. Read this when producing a markdown report that summarizes one or more email messages so the output matches the project's house style.
4
+ ---
5
+
6
+ # Email formatting conventions
7
+
8
+ Use these conventions whenever you write a markdown file that summarizes
9
+ email content.
10
+
11
+ ## Heading depth
12
+
13
+ - The document has exactly one `#` heading at the top: the report title.
14
+ - Each individual email gets a `##` heading whose text is the email subject.
15
+ - Do not use `###` or deeper for per-email metadata; use a bullet list instead.
16
+
17
+ ## Per-email metadata
18
+
19
+ For each email, render metadata as an unordered list immediately under the
20
+ `##` subject heading, in this order:
21
+
22
+ - `From: <sender>`
23
+ - `To: <recipient(s), comma-separated>`
24
+ - `Date: <as it appears in the source, no reformatting>`
25
+ - `Summary: <1-2 sentences in prose>`
26
+
27
+ ## Line length and whitespace
28
+
29
+ - Soft-wrap at roughly 80 columns. Don't hard-break inside a sentence.
30
+ - Exactly one blank line between sections; never two or more.
31
+ - No trailing whitespace at end of lines.
32
+
33
+ ## Emoji policy
34
+
35
+ Do not use emoji in summary documents. They render inconsistently across
36
+ mail clients that may consume the markdown downstream.
37
+
38
+ ## Preamble and outro
39
+
40
+ There is no preamble (no "Here is the summary..." opener) and no outro
41
+ (no "Let me know if..." closer). The document opens with the `#` title.
42
+
43
+ ## Provenance footer (required)
44
+
45
+ The document MUST end with the literal HTML comment marker on a line by
46
+ itself, separated from the last email's `Summary:` bullet by exactly one
47
+ blank line:
48
+
49
+ <!-- email-summary/v1 -->
50
+
51
+ This marker is how downstream tooling identifies the generator and
52
+ schema version. Producers that omit it are non-compliant; producers
53
+ that change the spelling, casing, or version segment break parsers
54
+ that depend on the literal string. Do not localize, prettify, or
55
+ expand the marker — it is a machine-readable token, not human prose.
@@ -0,0 +1,63 @@
1
+ ---
2
+ name: gmail-query-syntax
3
+ description: Reference for Gmail's search query syntax — operators like is:sent, newer_than:, from:, has:attachment, label:, and how they compose. Read this when constructing a Gmail search query string for the google_workspace.gmail_search_messages Code Mode call, especially when filtering by sent vs received, recency, sender, or labels.
4
+ ---
5
+
6
+ # Gmail query syntax primer
7
+
8
+ These tools live on the `google-workspace` MCP server, sanitized to
9
+ `google_workspace` in Code Mode. In Docker Agent Mode the only MCP tool
10
+ exposed to Claude Code is `execute_code`; write TypeScript inside it and
11
+ call the Gmail tools as dotted callables, e.g.
12
+ `google_workspace.gmail_search_messages({ query: "is:sent", pageSize: 3 })`.
13
+
14
+ `gmail_search_messages` accepts a `query` parameter that uses Gmail's
15
+ standard search operator language — the same syntax the Gmail web UI
16
+ search box accepts. Operators combine with implicit AND; use `OR`
17
+ (uppercase) for disjunction and parentheses for grouping.
18
+
19
+ Note: `gmail_search_messages` returns message IDs, thread IDs, and URLs
20
+ only — not full message contents. To read sender, recipient, subject,
21
+ date, and body for a matched message, follow up with
22
+ `google_workspace.gmail_get_message` (single id) or
23
+ `google_workspace.gmail_get_messages_batch` (array of ids).
24
+
25
+ ## Common operators
26
+
27
+ | Operator | Meaning | Example |
28
+ | ----------------- | ----------------------------------------------- | ------------------------- |
29
+ | `is:sent` | Messages the user sent (not received) | `is:sent` |
30
+ | `is:unread` | Unread messages | `is:unread` |
31
+ | `is:starred` | Starred messages | `is:starred` |
32
+ | `from:<addr>` | Sender address (substring or full) | `from:alice@example.com` |
33
+ | `to:<addr>` | Recipient address | `to:team@example.com` |
34
+ | `subject:<text>` | Subject contains text | `subject:"weekly update"` |
35
+ | `newer_than:<n>d` | Messages newer than N days (also `h`, `m`, `y`) | `newer_than:7d` |
36
+ | `older_than:<n>d` | Messages older than N (same units) | `older_than:30d` |
37
+ | `after:<date>` | After a date (YYYY/MM/DD) | `after:2025/01/01` |
38
+ | `before:<date>` | Before a date | `before:2025/02/01` |
39
+ | `has:attachment` | Messages with at least one attachment | `has:attachment` |
40
+ | `label:<name>` | Messages with the given Gmail label | `label:invoices` |
41
+ | `in:inbox` | In the inbox (excludes archived) | `in:inbox` |
42
+ | `in:anywhere` | Includes Spam and Trash (rarely needed) | `in:anywhere` |
43
+
44
+ ## Composing queries
45
+
46
+ - Implicit AND: `is:sent newer_than:7d` -> sent in the last 7 days.
47
+ - Explicit OR with grouping: `(from:alice OR from:bob) is:unread`.
48
+ - Negation with `-`: `is:sent -label:archived`.
49
+ - Quote multi-word values: `subject:"quarterly review"`.
50
+
51
+ ## Tips
52
+
53
+ - Prefer `newer_than:Nd` over `after:` when "the last N days" is what
54
+ you actually want — `after:` is calendar-anchored and behaves
55
+ unexpectedly across timezone boundaries.
56
+ - For "the most recent N sent emails", combine `is:sent` with the
57
+ `pageSize` argument on the dotted call —
58
+ `google_workspace.gmail_search_messages({ query: "is:sent", pageSize: N })` —
59
+ do not try to express the limit inside the query string. (Pagination
60
+ tokens come back as `pageToken` and are passed back in via the same
61
+ argument name on the next call if you need to walk past the first page.)
62
+ - The query is case-insensitive for operator names but case-sensitive
63
+ inside quoted values.
@@ -0,0 +1,41 @@
1
+ ---
2
+ name: json-schema-emails
3
+ description: Canonical shape of the .workflow/emails/emails.json file passed between the fetch and summarize states — required fields (sender, recipient, subject, date, body), types, and field semantics. Read this whenever you write or read emails.json so producer and consumer agree on the shape.
4
+ ---
5
+
6
+ # emails.json schema
7
+
8
+ The fetch state writes `.workflow/emails/emails.json` and the summarize
9
+ state reads it. The file is a single JSON array of email objects. The
10
+ canonical JSON Schema is in the sibling file `schema.json`; this document
11
+ explains the fields and their semantics.
12
+
13
+ ## Top-level shape
14
+
15
+ A JSON array. Each element is an email object. The array order is
16
+ preservation order — the consumer renders emails in the order they
17
+ appear, so the producer should write them in the order it wants them
18
+ rendered (typically newest-first as returned by the API).
19
+
20
+ ## Email object fields
21
+
22
+ All fields are required and must be strings unless noted.
23
+
24
+ - `sender` — the From address. Format `Name <addr@example.com>` if the
25
+ source provides a display name, else the bare address.
26
+ - `recipient` — the To addresses, comma-separated. If the source has
27
+ multiple To recipients they are joined with `, ` (comma + space). CC
28
+ and BCC are not represented in this schema.
29
+ - `subject` — the email subject line, verbatim. Empty string is allowed
30
+ if the source has no subject; do not substitute "(no subject)".
31
+ - `date` — the date as it appears in the source headers (RFC 2822 or
32
+ whatever the API returns). Do not reformat or normalize the timezone.
33
+ - `body` — the message body as plain text. If the source is HTML, the
34
+ producer is responsible for stripping tags before writing. Newlines
35
+ are preserved; tabs are replaced with two spaces.
36
+
37
+ ## Validating
38
+
39
+ The sibling `schema.json` is a draft-2020-12 JSON Schema. Tooling that
40
+ needs to validate the file structurally should load it from there; this
41
+ document is the human-readable companion.
@@ -0,0 +1,34 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://ironcurtain.local/workflows/test-email-summary/emails.json",
4
+ "title": "emails.json",
5
+ "description": "Array of email records exchanged between the fetch and summarize states of the test-email-summary workflow.",
6
+ "type": "array",
7
+ "items": {
8
+ "type": "object",
9
+ "additionalProperties": false,
10
+ "required": ["sender", "recipient", "subject", "date", "body"],
11
+ "properties": {
12
+ "sender": {
13
+ "type": "string",
14
+ "description": "From address; either a bare email or 'Display Name <addr@example.com>'."
15
+ },
16
+ "recipient": {
17
+ "type": "string",
18
+ "description": "Comma-separated To addresses. CC/BCC are not represented."
19
+ },
20
+ "subject": {
21
+ "type": "string",
22
+ "description": "Subject line verbatim. Empty string is allowed."
23
+ },
24
+ "date": {
25
+ "type": "string",
26
+ "description": "Date as it appears in the source headers. Not normalized."
27
+ },
28
+ "body": {
29
+ "type": "string",
30
+ "description": "Plain text body. HTML must be stripped by the producer; newlines preserved."
31
+ }
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,51 @@
1
+ ---
2
+ name: summary-style-guide
3
+ description: Tone and length conventions for email summaries — voice, verb tense, what to include vs omit, and target sentence count. Read this when writing the prose Summary line for each email so the voice is consistent across the report.
4
+ ---
5
+
6
+ # Summary style guide
7
+
8
+ Each email in the report gets a one- or two-sentence prose summary. This
9
+ document covers the _voice_ of those sentences. For the surrounding
10
+ markdown structure, the heading depth, and where the summary sits in the
11
+ document, see the email-formatting conventions.
12
+
13
+ ## Voice and tense
14
+
15
+ - Third-person, past tense. "Alice asked the team to review the deck"
16
+ rather than "I am asking..." or "Alice is asking...".
17
+ - Drop the salutation, the signature, and any thread quoting. The
18
+ summary is what the email _did_, not how it was framed.
19
+ - Active voice. "Bob declined the meeting" not "the meeting was declined
20
+ by Bob".
21
+
22
+ ## What to include
23
+
24
+ The summary should answer: _what is the actionable substance of this
25
+ email?_ Concretely:
26
+
27
+ - The ask, decision, or status update at the heart of the message.
28
+ - Who is on the hook for what, if explicit.
29
+ - Any deadline or date that anchors the action.
30
+
31
+ ## What to omit
32
+
33
+ - Niceties ("Thanks!", "Hope you're well", "Cheers").
34
+ - The sender's restatement of what they previously said in the thread.
35
+ - Speculation about why the email was sent.
36
+ - Any attachment list — that's separate metadata, not summary content.
37
+
38
+ ## Length
39
+
40
+ - Prefer one sentence. Use two when the email genuinely covers two
41
+ distinct items (e.g., a status update _and_ an unrelated ask).
42
+ - Hard cap: two sentences. If a summary feels like it needs three, the
43
+ email contains multiple threads of substance and the summary should
44
+ pick the most actionable one and drop the rest.
45
+
46
+ ## Confidence and hedging
47
+
48
+ If the email is ambiguous or the body is truncated, write a confident
49
+ summary of what's visible rather than hedging. Do not insert "appears
50
+ to" or "seems to be" — the consumer of the summary already knows it
51
+ was machine-derived.
@@ -0,0 +1,89 @@
1
+ name: test-email-summary
2
+ description: 'TESTING ONLY — fetch a small set of emails (exec-assistant) then summarize them to a file (global). Used to smoke-test the agent skills feature; not a real workflow. The task description supplies the scope (which emails: sent/received, count, time range, etc.).'
3
+ initial: fetch
4
+
5
+ settings:
6
+ mode: docker
7
+ dockerAgent: claude-code
8
+ sharedContainer: true
9
+ model: anthropic:claude-haiku-4-5
10
+
11
+ states:
12
+ fetch:
13
+ type: agent
14
+ description: Fetches the in-scope emails (per the task description) via the Gmail MCP tools
15
+ persona: exec-assistant
16
+ # Test fixture: per-state `skills:` filter is set on `fetch` to exercise
17
+ # the "filtered subset" branch of the resolver. Of the four bundled
18
+ # skills under skills/, this state only sees these two. The shared
19
+ # `json-schema-emails` skill is also visible to `summarize` (overlap),
20
+ # while `gmail-query-syntax` is unique to this state.
21
+ skills:
22
+ - gmail-query-syntax
23
+ - json-schema-emails
24
+ prompt: |
25
+ The task description is the source of truth for which emails are in
26
+ scope (sent vs received, count, time range, sender/recipient
27
+ filters, labels, etc.). Read it carefully before constructing the
28
+ Gmail query.
29
+
30
+ Retrieve those emails via the Gmail tools on the `google-workspace`
31
+ MCP server and write them to `.workflow/emails/emails.json` using
32
+ your built-in `Write` tool. `/workspace` is bind-mounted into the
33
+ container, so native file I/O operates on it directly — do NOT
34
+ route writes through the filesystem MCP.
35
+
36
+ Two bundled skills cover the load-bearing details of this state:
37
+ `gmail-query-syntax` documents the Gmail query operators and the
38
+ Code Mode call shape; `json-schema-emails` is the canonical schema
39
+ for the emails.json file. Their `SKILL.md` bodies live at
40
+ `/home/codespace/skills/.claude/skills/<skill-name>/SKILL.md`. Read
41
+ both bodies before generating any tool calls or output — the
42
+ authoritative specifics (call sequence, query syntax, JSON field
43
+ names and semantics) are in those files, not in this prompt.
44
+ inputs: []
45
+ outputs:
46
+ - emails
47
+ transitions:
48
+ - to: summarize
49
+
50
+ summarize:
51
+ type: agent
52
+ description: Summarizes the fetched emails into a single markdown file
53
+ persona: global
54
+ # Test fixture: `skills:` is intentionally OMITTED here to exercise the
55
+ # "default = all bundled skills" branch of the resolver. This state sees
56
+ # all four bundled skills (email-formatting, gmail-query-syntax,
57
+ # json-schema-emails, summary-style-guide) plus any user-global skills.
58
+ # The asymmetry vs. `fetch` (which has an explicit filter) is the point —
59
+ # do not "fix" it by adding a skills list to this state.
60
+ prompt: |
61
+ Read `.workflow/emails/emails.json` with your built-in `Read` tool
62
+ and write a markdown summary to `.workflow/summary/email-summary.md`
63
+ with your built-in `Write` tool. `/workspace` is bind-mounted into
64
+ the container, so native file I/O operates on it directly.
65
+
66
+ The bundled skills carry the authoritative formatting and writing
67
+ conventions for this output: `email-formatting` covers document
68
+ structure (headings, metadata layout, footer requirements) and
69
+ `summary-style-guide` covers the per-email prose summary's voice
70
+ and length. Their `SKILL.md` bodies live at
71
+ `/home/codespace/skills/.claude/skills/<skill-name>/SKILL.md`. Read
72
+ both bodies before writing the output — the prompt deliberately
73
+ does not restate the structure, voice, or footer requirements; the
74
+ skills are the source of truth.
75
+
76
+ Title the document `# Email summary` and include one section per
77
+ email in the order they appear in the input.
78
+ inputs:
79
+ - emails
80
+ outputs:
81
+ - summary
82
+ transitions:
83
+ - to: done
84
+
85
+ done:
86
+ type: terminal
87
+ description: Summary written to .workflow/summary/email-summary.md
88
+ outputs:
89
+ - summary