@jstn-sdk/rcs 0.1.0 → 0.1.1

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 (1736) hide show
  1. package/README.md +142 -102
  2. package/dist/agents/definitions.d.ts.map +1 -1
  3. package/dist/agents/definitions.js +0 -101
  4. package/dist/agents/definitions.js.map +1 -1
  5. package/dist/blueprint/runtime.d.ts +52 -0
  6. package/dist/blueprint/runtime.d.ts.map +1 -0
  7. package/dist/{ralplan → blueprint}/runtime.js +19 -19
  8. package/dist/blueprint/runtime.js.map +1 -0
  9. package/dist/catalog/reader.d.ts.map +1 -1
  10. package/dist/catalog/reader.js +8 -2
  11. package/dist/catalog/reader.js.map +1 -1
  12. package/dist/catalog/schema.js +1 -1
  13. package/dist/catalog/schema.js.map +1 -1
  14. package/dist/cli/forge.d.ts +17 -0
  15. package/dist/cli/{ralph.d.ts.map → forge.d.ts.map} +1 -1
  16. package/dist/cli/{ralph.js → forge.js} +82 -82
  17. package/dist/cli/{ralph.js.map → forge.js.map} +1 -1
  18. package/dist/cli/index.d.ts +1 -1
  19. package/dist/cli/index.js +15 -15
  20. package/dist/cli/setup.d.ts.map +1 -1
  21. package/dist/cli/setup.js +2 -3
  22. package/dist/cli/setup.js.map +1 -1
  23. package/dist/cli/star-prompt.js +2 -2
  24. package/dist/cli/star-prompt.js.map +1 -1
  25. package/dist/cli/state.js +1 -1
  26. package/dist/cli/team.d.ts.map +1 -1
  27. package/dist/cli/team.js +3 -2
  28. package/dist/cli/team.js.map +1 -1
  29. package/dist/cli/tmux-hook.d.ts.map +1 -1
  30. package/dist/cli/tmux-hook.js +9 -1
  31. package/dist/cli/tmux-hook.js.map +1 -1
  32. package/dist/config/generator.d.ts +1 -1
  33. package/dist/config/generator.d.ts.map +1 -1
  34. package/dist/config/generator.js +1 -1
  35. package/dist/config/generator.js.map +1 -1
  36. package/dist/forge/contract.d.ts +17 -0
  37. package/dist/{ralph → forge}/contract.d.ts.map +1 -1
  38. package/dist/{ralph → forge}/contract.js +16 -16
  39. package/dist/{ralph → forge}/contract.js.map +1 -1
  40. package/dist/{ralph → forge}/persistence.d.ts +5 -5
  41. package/dist/{ralph → forge}/persistence.d.ts.map +1 -1
  42. package/dist/{ralph → forge}/persistence.js +7 -6
  43. package/dist/forge/persistence.js.map +1 -0
  44. package/dist/hooks/agents-overlay.d.ts +1 -1
  45. package/dist/hooks/agents-overlay.d.ts.map +1 -1
  46. package/dist/hooks/agents-overlay.js +37 -31
  47. package/dist/hooks/agents-overlay.js.map +1 -1
  48. package/dist/hooks/extensibility/dispatcher.d.ts.map +1 -1
  49. package/dist/hooks/extensibility/dispatcher.js +82 -14
  50. package/dist/hooks/extensibility/dispatcher.js.map +1 -1
  51. package/dist/hooks/keyword-detector.d.ts +8 -8
  52. package/dist/hooks/keyword-detector.d.ts.map +1 -1
  53. package/dist/hooks/keyword-detector.js +94 -64
  54. package/dist/hooks/keyword-detector.js.map +1 -1
  55. package/dist/hooks/keyword-registry.d.ts.map +1 -1
  56. package/dist/hooks/keyword-registry.js +9 -11
  57. package/dist/hooks/keyword-registry.js.map +1 -1
  58. package/dist/hooks/prompt-guidance-contract.d.ts.map +1 -1
  59. package/dist/hooks/prompt-guidance-contract.js +10 -21
  60. package/dist/hooks/prompt-guidance-contract.js.map +1 -1
  61. package/dist/hooks/task-size-detector.js +2 -2
  62. package/dist/hooks/task-size-detector.js.map +1 -1
  63. package/dist/hooks/triage-state.d.ts +1 -1
  64. package/dist/hooks/triage-state.js +1 -1
  65. package/dist/hud/colors.d.ts +2 -2
  66. package/dist/hud/colors.js +2 -2
  67. package/dist/hud/render.js +21 -21
  68. package/dist/hud/render.js.map +1 -1
  69. package/dist/hud/state.d.ts +3 -3
  70. package/dist/hud/state.d.ts.map +1 -1
  71. package/dist/hud/state.js +18 -15
  72. package/dist/hud/state.js.map +1 -1
  73. package/dist/hud/types.d.ts +6 -6
  74. package/dist/hud/types.d.ts.map +1 -1
  75. package/dist/mcp/bootstrap.d.ts.map +1 -1
  76. package/dist/mcp/bootstrap.js +36 -2
  77. package/dist/mcp/bootstrap.js.map +1 -1
  78. package/dist/mcp/state-paths.d.ts +1 -0
  79. package/dist/mcp/state-paths.d.ts.map +1 -1
  80. package/dist/mcp/state-paths.js +4 -1
  81. package/dist/mcp/state-paths.js.map +1 -1
  82. package/dist/mcp/state-server.d.ts +4 -4
  83. package/dist/mcp/state-server.js +2 -2
  84. package/dist/mcp/state-server.js.map +1 -1
  85. package/dist/modes/base.d.ts +2 -2
  86. package/dist/modes/base.d.ts.map +1 -1
  87. package/dist/modes/base.js +29 -26
  88. package/dist/modes/base.js.map +1 -1
  89. package/dist/notifications/reply-listener.d.ts.map +1 -1
  90. package/dist/notifications/reply-listener.js +7 -1
  91. package/dist/notifications/reply-listener.js.map +1 -1
  92. package/dist/notifications/tmux.d.ts.map +1 -1
  93. package/dist/notifications/tmux.js +39 -6
  94. package/dist/notifications/tmux.js.map +1 -1
  95. package/dist/pipeline/index.d.ts +7 -6
  96. package/dist/pipeline/index.d.ts.map +1 -1
  97. package/dist/pipeline/index.js +5 -4
  98. package/dist/pipeline/index.js.map +1 -1
  99. package/dist/pipeline/orchestrator.d.ts +5 -5
  100. package/dist/pipeline/orchestrator.js +25 -25
  101. package/dist/pipeline/orchestrator.js.map +1 -1
  102. package/dist/pipeline/stages/blueprint.d.ts +25 -0
  103. package/dist/pipeline/stages/blueprint.d.ts.map +1 -0
  104. package/dist/pipeline/stages/{ralplan.js → blueprint.js} +16 -16
  105. package/dist/pipeline/stages/blueprint.js.map +1 -0
  106. package/dist/pipeline/stages/code-review.d.ts +2 -2
  107. package/dist/pipeline/stages/code-review.js +6 -6
  108. package/dist/pipeline/stages/code-review.js.map +1 -1
  109. package/dist/pipeline/stages/forge-verify.d.ts +50 -0
  110. package/dist/pipeline/stages/forge-verify.d.ts.map +1 -0
  111. package/dist/pipeline/stages/{ralph-verify.js → forge-verify.js} +21 -24
  112. package/dist/pipeline/stages/forge-verify.js.map +1 -0
  113. package/dist/pipeline/stages/team-exec.d.ts +1 -1
  114. package/dist/pipeline/stages/team-exec.js +19 -19
  115. package/dist/pipeline/stages/team-exec.js.map +1 -1
  116. package/dist/pipeline/types.d.ts +12 -12
  117. package/dist/pipeline/types.d.ts.map +1 -1
  118. package/dist/pipeline/types.js +1 -1
  119. package/dist/planning/artifacts.d.ts +3 -4
  120. package/dist/planning/artifacts.d.ts.map +1 -1
  121. package/dist/planning/artifacts.js +2 -3
  122. package/dist/planning/artifacts.js.map +1 -1
  123. package/dist/question/policy.js +1 -1
  124. package/dist/runtime/bridge.d.ts.map +1 -1
  125. package/dist/runtime/bridge.js +70 -13
  126. package/dist/runtime/bridge.js.map +1 -1
  127. package/dist/scripts/codex-native-hook.js +30 -30
  128. package/dist/scripts/codex-native-hook.js.map +1 -1
  129. package/dist/scripts/eval/eval-cross-server-party-flow.d.ts +3 -0
  130. package/dist/scripts/eval/eval-cross-server-party-flow.d.ts.map +1 -0
  131. package/dist/scripts/eval/eval-cross-server-party-flow.js +12 -0
  132. package/dist/scripts/eval/eval-cross-server-party-flow.js.map +1 -0
  133. package/dist/scripts/eval/eval-gui-onboarding-clarity.d.ts +3 -0
  134. package/dist/scripts/eval/eval-gui-onboarding-clarity.d.ts.map +1 -0
  135. package/dist/scripts/eval/eval-gui-onboarding-clarity.js +17 -0
  136. package/dist/scripts/eval/eval-gui-onboarding-clarity.js.map +1 -0
  137. package/dist/scripts/eval/eval-liveops-reward-loop-balance.d.ts +3 -0
  138. package/dist/scripts/eval/eval-liveops-reward-loop-balance.d.ts.map +1 -0
  139. package/dist/scripts/eval/eval-liveops-reward-loop-balance.js +12 -0
  140. package/dist/scripts/eval/eval-liveops-reward-loop-balance.js.map +1 -0
  141. package/dist/scripts/eval/eval-profile-datastore-recovery.d.ts +3 -0
  142. package/dist/scripts/eval/eval-profile-datastore-recovery.d.ts.map +1 -0
  143. package/dist/scripts/eval/eval-profile-datastore-recovery.js +17 -0
  144. package/dist/scripts/eval/eval-profile-datastore-recovery.js.map +1 -0
  145. package/dist/scripts/eval/eval-remote-contract-hardening.d.ts +3 -0
  146. package/dist/scripts/eval/eval-remote-contract-hardening.d.ts.map +1 -0
  147. package/dist/scripts/eval/eval-remote-contract-hardening.js +17 -0
  148. package/dist/scripts/eval/eval-remote-contract-hardening.js.map +1 -0
  149. package/dist/scripts/notify-fallback-watcher.js +140 -139
  150. package/dist/scripts/notify-fallback-watcher.js.map +1 -1
  151. package/dist/scripts/notify-hook/forge-session-resume.d.ts +23 -0
  152. package/dist/scripts/notify-hook/{ralph-session-resume.d.ts.map → forge-session-resume.d.ts.map} +1 -1
  153. package/dist/scripts/notify-hook/{ralph-session-resume.js → forge-session-resume.js} +37 -36
  154. package/dist/scripts/notify-hook/{ralph-session-resume.js.map → forge-session-resume.js.map} +1 -1
  155. package/dist/scripts/notify-hook/team-dispatch.d.ts.map +1 -1
  156. package/dist/scripts/notify-hook/team-dispatch.js +34 -4
  157. package/dist/scripts/notify-hook/team-dispatch.js.map +1 -1
  158. package/dist/scripts/notify-hook/visual-verdict.js +3 -3
  159. package/dist/scripts/notify-hook.js +9 -9
  160. package/dist/scripts/run-test-files.js +1 -1
  161. package/dist/scripts/run-test-files.js.map +1 -1
  162. package/dist/scripts/surface-taxonomy.d.ts +23 -0
  163. package/dist/scripts/surface-taxonomy.d.ts.map +1 -0
  164. package/dist/scripts/surface-taxonomy.js +271 -0
  165. package/dist/scripts/surface-taxonomy.js.map +1 -0
  166. package/dist/scripts/sync-plugin-mirror.d.ts.map +1 -1
  167. package/dist/scripts/sync-plugin-mirror.js +5 -4
  168. package/dist/scripts/sync-plugin-mirror.js.map +1 -1
  169. package/dist/scripts/tmux-hook-engine.d.ts +1 -1
  170. package/dist/scripts/tmux-hook-engine.d.ts.map +1 -1
  171. package/dist/scripts/tmux-hook-engine.js +29 -20
  172. package/dist/scripts/tmux-hook-engine.js.map +1 -1
  173. package/dist/state/operations.d.ts +1 -1
  174. package/dist/state/operations.d.ts.map +1 -1
  175. package/dist/state/operations.js +18 -18
  176. package/dist/state/operations.js.map +1 -1
  177. package/dist/state/skill-active.d.ts +13 -1
  178. package/dist/state/skill-active.d.ts.map +1 -1
  179. package/dist/state/skill-active.js +38 -17
  180. package/dist/state/skill-active.js.map +1 -1
  181. package/dist/state/workflow-transition.d.ts +6 -5
  182. package/dist/state/workflow-transition.d.ts.map +1 -1
  183. package/dist/state/workflow-transition.js +27 -15
  184. package/dist/state/workflow-transition.js.map +1 -1
  185. package/dist/team/contracts.d.ts +1 -1
  186. package/dist/team/contracts.js +2 -2
  187. package/dist/team/followup-planner.d.ts +2 -2
  188. package/dist/team/followup-planner.d.ts.map +1 -1
  189. package/dist/team/followup-planner.js +16 -14
  190. package/dist/team/followup-planner.js.map +1 -1
  191. package/dist/team/idle-nudge.d.ts.map +1 -1
  192. package/dist/team/idle-nudge.js +3 -2
  193. package/dist/team/idle-nudge.js.map +1 -1
  194. package/dist/team/leader-activity.js +1 -1
  195. package/dist/team/model-contract.d.ts.map +1 -1
  196. package/dist/team/model-contract.js +4 -1
  197. package/dist/team/model-contract.js.map +1 -1
  198. package/dist/team/orchestrator.js +4 -4
  199. package/dist/team/orchestrator.js.map +1 -1
  200. package/dist/team/role-router.js +3 -3
  201. package/dist/team/role-router.js.map +1 -1
  202. package/dist/team/state/dispatch.d.ts.map +1 -1
  203. package/dist/team/state/dispatch.js +4 -1
  204. package/dist/team/state/dispatch.js.map +1 -1
  205. package/dist/team/tmux-session.d.ts +4 -0
  206. package/dist/team/tmux-session.d.ts.map +1 -1
  207. package/dist/team/tmux-session.js +42 -9
  208. package/dist/team/tmux-session.js.map +1 -1
  209. package/dist/team/worktree.d.ts +1 -1
  210. package/dist/utils/platform-command.d.ts.map +1 -1
  211. package/dist/utils/platform-command.js +9 -0
  212. package/dist/utils/platform-command.js.map +1 -1
  213. package/dist/verification/verifier.d.ts +1 -1
  214. package/dist/verification/verifier.js +2 -2
  215. package/docs/STATE_MODEL.md +24 -24
  216. package/docs/agents.html +8 -16
  217. package/docs/archive/README.md +15 -0
  218. package/docs/{prompt-migration-changelog.md → archive/prompt-migration-changelog.md} +0 -11
  219. package/docs/{release-body-0.9.0.md → archive/release-body-0.9.0.md} +6 -24
  220. package/docs/{release-body-0.9.1.md → archive/release-body-0.9.1.md} +3 -3
  221. package/docs/codex-native-hooks.md +4 -4
  222. package/docs/contracts/forge-cancel-contract.md +20 -0
  223. package/docs/contracts/forge-state-contract.md +52 -0
  224. package/docs/contracts/multi-state-transition-contract.md +5 -5
  225. package/docs/contracts/multi-state-transition-review.md +3 -3
  226. package/docs/contracts/repo-aware-team-dag-decomposition.md +1 -1
  227. package/docs/contracts/rust-runtime-thin-adapter-contract.md +1 -1
  228. package/docs/contracts/team-startup-dispatch-latency.md +1 -1
  229. package/docs/getting-started.html +6 -1
  230. package/docs/guidance-schema.md +6 -3
  231. package/docs/index.html +55 -4
  232. package/docs/integrations.html +4 -3
  233. package/docs/issues/team-forge-followup-team.md +38 -0
  234. package/docs/openclaw-integration.md +2 -2
  235. package/docs/prompt-guidance-contract.md +11 -11
  236. package/docs/prs/{dev-deprecate-team-ralph.md → dev-deprecate-team-forge.md} +27 -27
  237. package/docs/prs/{dev-fix-ralph-live-pane-invariant.md → dev-fix-forge-live-pane-invariant.md} +7 -7
  238. package/docs/prs/{dev-team-ralph-workflow-positioning.md → dev-team-forge-workflow-positioning.md} +7 -7
  239. package/docs/qa/forge-persistence-gate.md +20 -0
  240. package/docs/qa/rust-runtime-thin-adapter-gate.md +31 -40
  241. package/docs/readme/README.de.md +13 -0
  242. package/docs/readme/README.el.md +13 -0
  243. package/docs/readme/README.es.md +13 -0
  244. package/docs/readme/README.fr.md +13 -0
  245. package/docs/readme/README.it.md +13 -0
  246. package/docs/readme/README.ja.md +13 -0
  247. package/docs/readme/README.ko.md +13 -0
  248. package/docs/readme/README.pl.md +13 -0
  249. package/docs/readme/README.pt.md +13 -0
  250. package/docs/readme/README.ru.md +13 -0
  251. package/docs/readme/README.tr.md +13 -0
  252. package/docs/readme/README.uk.md +13 -0
  253. package/docs/readme/README.vi.md +13 -0
  254. package/docs/readme/README.zh-TW.md +13 -0
  255. package/docs/readme/README.zh.md +13 -0
  256. package/docs/readme/rcs-cover.svg +75 -0
  257. package/docs/reference/canonical-vocabulary.md +106 -0
  258. package/docs/reference/forge-parity-matrix.md +26 -0
  259. package/docs/reference/forge-upstream-baseline.md +32 -0
  260. package/docs/reference/rcs-config-schema-routing.md +5 -5
  261. package/docs/reference/roblox-pre-action-protocol.md +4 -0
  262. package/docs/reference/roblox-taxonomy-migration-plan.md +46 -0
  263. package/docs/reference/roblox-workspace-standard.md +83 -0
  264. package/docs/reference/robloxstudio-mcp-compatibility.md +117 -0
  265. package/docs/reference/semantic-design-system.md +110 -0
  266. package/docs/reference/surface-map.md +131 -0
  267. package/docs/reference/team-allocation-rebalance-policy.md +1 -1
  268. package/docs/release-notes-v0.1.0.md +1 -1
  269. package/docs/release-notes-v0.1.1.md +49 -0
  270. package/docs/reports/open-prs-dev-readiness-2026-04-09.md +2 -2
  271. package/docs/shared/agent-tiers.md +3 -3
  272. package/docs/skills.html +10 -12
  273. package/docs/troubleshooting.md +1 -1
  274. package/package.json +20 -13
  275. package/plugins/roblox-ai-os-creator-skills/.codex-plugin/plugin.json +1 -1
  276. package/plugins/roblox-ai-os-creator-skills/docs/reference/roblox-pre-action-protocol.md +4 -0
  277. package/plugins/roblox-ai-os-creator-skills/skills/ai-slop-cleaner/SKILL.md +14 -7
  278. package/plugins/roblox-ai-os-creator-skills/skills/analyze/SKILL.md +9 -2
  279. package/plugins/roblox-ai-os-creator-skills/skills/ask-claude/SKILL.md +7 -0
  280. package/plugins/roblox-ai-os-creator-skills/skills/ask-gemini/SKILL.md +7 -0
  281. package/plugins/roblox-ai-os-creator-skills/skills/autoforge/SKILL.md +7 -0
  282. package/plugins/roblox-ai-os-creator-skills/skills/autopilot/SKILL.md +48 -41
  283. package/plugins/roblox-ai-os-creator-skills/skills/autoresearch/SKILL.md +8 -1
  284. package/plugins/roblox-ai-os-creator-skills/skills/blueprint/SKILL.md +227 -9
  285. package/plugins/roblox-ai-os-creator-skills/skills/blueprint-loop/SKILL.md +7 -0
  286. package/plugins/roblox-ai-os-creator-skills/skills/blueprint-psych/SKILL.md +7 -0
  287. package/plugins/roblox-ai-os-creator-skills/skills/blueprint-retention/SKILL.md +7 -0
  288. package/plugins/roblox-ai-os-creator-skills/skills/blueprint-social/SKILL.md +7 -0
  289. package/plugins/roblox-ai-os-creator-skills/skills/brief/SKILL.md +7 -0
  290. package/plugins/roblox-ai-os-creator-skills/skills/brief-audience/SKILL.md +7 -0
  291. package/plugins/roblox-ai-os-creator-skills/skills/brief-motivation/SKILL.md +7 -0
  292. package/plugins/roblox-ai-os-creator-skills/skills/cancel/SKILL.md +59 -52
  293. package/plugins/roblox-ai-os-creator-skills/skills/code-review/SKILL.md +30 -24
  294. package/plugins/roblox-ai-os-creator-skills/skills/configure-notifications/SKILL.md +7 -0
  295. package/plugins/roblox-ai-os-creator-skills/skills/crew/SKILL.md +7 -0
  296. package/plugins/roblox-ai-os-creator-skills/skills/deep-interview/SKILL.md +25 -18
  297. package/plugins/roblox-ai-os-creator-skills/skills/doctor/SKILL.md +7 -0
  298. package/plugins/roblox-ai-os-creator-skills/skills/forge/SKILL.md +174 -11
  299. package/plugins/roblox-ai-os-creator-skills/skills/forge-community/SKILL.md +7 -0
  300. package/plugins/roblox-ai-os-creator-skills/skills/forge-daily-loop/SKILL.md +7 -0
  301. package/plugins/roblox-ai-os-creator-skills/skills/forge-event-loop/SKILL.md +7 -0
  302. package/plugins/roblox-ai-os-creator-skills/skills/forge-fomo/SKILL.md +7 -0
  303. package/plugins/roblox-ai-os-creator-skills/skills/forge-mastery/SKILL.md +7 -0
  304. package/plugins/roblox-ai-os-creator-skills/skills/forge-progression/SKILL.md +7 -0
  305. package/plugins/roblox-ai-os-creator-skills/skills/forge-reward-loop/SKILL.md +7 -0
  306. package/plugins/roblox-ai-os-creator-skills/skills/forge-status/SKILL.md +7 -0
  307. package/plugins/roblox-ai-os-creator-skills/skills/help/SKILL.md +8 -1
  308. package/plugins/roblox-ai-os-creator-skills/skills/hud/SKILL.md +16 -9
  309. package/plugins/roblox-ai-os-creator-skills/skills/note/SKILL.md +8 -1
  310. package/plugins/roblox-ai-os-creator-skills/skills/pipeline/SKILL.md +18 -11
  311. package/plugins/roblox-ai-os-creator-skills/skills/plan/SKILL.md +36 -29
  312. package/plugins/roblox-ai-os-creator-skills/skills/rcs-setup/SKILL.md +8 -1
  313. package/plugins/roblox-ai-os-creator-skills/skills/security-review/SKILL.md +120 -236
  314. package/plugins/roblox-ai-os-creator-skills/skills/skill/SKILL.md +20 -13
  315. package/plugins/roblox-ai-os-creator-skills/skills/team/SKILL.md +17 -11
  316. package/plugins/roblox-ai-os-creator-skills/skills/trace/SKILL.md +7 -0
  317. package/plugins/roblox-ai-os-creator-skills/skills/ultraqa/SKILL.md +10 -3
  318. package/plugins/roblox-ai-os-creator-skills/skills/ultrawork/SKILL.md +19 -12
  319. package/plugins/roblox-ai-os-creator-skills/skills/{visual-ralph → visual-forge}/SKILL.md +36 -27
  320. package/plugins/roblox-ai-os-creator-skills/skills/visual-verdict/SKILL.md +9 -2
  321. package/plugins/roblox-ai-os-creator-skills/skills/wiki/SKILL.md +10 -3
  322. package/plugins/roblox-ai-os-creator-skills/skills/worker/SKILL.md +16 -7
  323. package/plugins/roblox-ai-os-creator-skills/templates/roblox/pre-action-plan.md +1 -0
  324. package/prompts/analyst.md +7 -0
  325. package/prompts/architect.md +11 -4
  326. package/prompts/build-fixer.md +7 -0
  327. package/prompts/code-reviewer.md +9 -2
  328. package/prompts/code-simplifier.md +4 -0
  329. package/prompts/critic.md +13 -6
  330. package/prompts/debugger.md +8 -1
  331. package/prompts/dependency-expert.md +8 -1
  332. package/prompts/designer.md +20 -10
  333. package/prompts/executor.md +7 -0
  334. package/prompts/explore-harness.md +7 -0
  335. package/prompts/explore.md +7 -0
  336. package/prompts/git-master.md +8 -1
  337. package/prompts/planner.md +10 -3
  338. package/prompts/researcher.md +7 -0
  339. package/prompts/security-reviewer.md +76 -92
  340. package/prompts/sisyphus-lite.md +7 -0
  341. package/prompts/team-executor.md +7 -0
  342. package/prompts/team-orchestrator.md +9 -2
  343. package/prompts/test-engineer.md +11 -3
  344. package/prompts/verifier.md +7 -0
  345. package/prompts/vision.md +9 -2
  346. package/prompts/writer.md +11 -4
  347. package/skills/.agents/skills/roblox-animations/SKILL.md +220 -0
  348. package/skills/.agents/skills/roblox-datastores/SKILL.md +219 -0
  349. package/skills/.agents/skills/roblox-gui/SKILL.md +192 -0
  350. package/skills/.agents/skills/roblox-monetization/SKILL.md +208 -0
  351. package/skills/.agents/skills/roblox-performance/SKILL.md +230 -0
  352. package/skills/.agents/skills/roblox-remote-events/SKILL.md +199 -0
  353. package/skills/.agents/skills/roblox-security/SKILL.md +236 -0
  354. package/skills/ai-slop-cleaner/SKILL.md +14 -7
  355. package/skills/analyze/SKILL.md +9 -2
  356. package/skills/ask-claude/SKILL.md +7 -0
  357. package/skills/ask-gemini/SKILL.md +7 -0
  358. package/skills/autoforge/SKILL.md +7 -0
  359. package/skills/autopilot/SKILL.md +48 -41
  360. package/skills/autoresearch/SKILL.md +8 -1
  361. package/skills/blueprint/SKILL.md +227 -9
  362. package/skills/blueprint-loop/SKILL.md +7 -0
  363. package/skills/blueprint-psych/SKILL.md +7 -0
  364. package/skills/blueprint-retention/SKILL.md +7 -0
  365. package/skills/blueprint-social/SKILL.md +7 -0
  366. package/skills/brief/SKILL.md +7 -0
  367. package/skills/brief-audience/SKILL.md +7 -0
  368. package/skills/brief-motivation/SKILL.md +7 -0
  369. package/skills/build-fix/SKILL.md +9 -2
  370. package/skills/cancel/SKILL.md +59 -52
  371. package/skills/code-review/SKILL.md +30 -24
  372. package/skills/configure-notifications/SKILL.md +7 -0
  373. package/skills/crew/SKILL.md +7 -0
  374. package/skills/deep-interview/SKILL.md +25 -18
  375. package/skills/deepsearch/SKILL.md +7 -0
  376. package/skills/doctor/SKILL.md +7 -0
  377. package/skills/ecomode/SKILL.md +9 -2
  378. package/skills/forge/SKILL.md +174 -11
  379. package/skills/forge-community/SKILL.md +7 -0
  380. package/skills/forge-daily-loop/SKILL.md +7 -0
  381. package/skills/forge-event-loop/SKILL.md +7 -0
  382. package/skills/forge-fomo/SKILL.md +7 -0
  383. package/skills/{ralph-init → forge-init}/SKILL.md +20 -13
  384. package/skills/forge-mastery/SKILL.md +7 -0
  385. package/skills/forge-progression/SKILL.md +7 -0
  386. package/skills/forge-reward-loop/SKILL.md +7 -0
  387. package/skills/forge-status/SKILL.md +7 -0
  388. package/skills/git-master/SKILL.md +7 -0
  389. package/skills/help/SKILL.md +8 -1
  390. package/skills/hud/SKILL.md +16 -9
  391. package/skills/note/SKILL.md +8 -1
  392. package/skills/pipeline/SKILL.md +18 -11
  393. package/skills/plan/SKILL.md +36 -29
  394. package/skills/rcs-setup/SKILL.md +8 -1
  395. package/skills/review/SKILL.md +7 -0
  396. package/skills/security-review/SKILL.md +120 -236
  397. package/skills/skill/SKILL.md +20 -13
  398. package/skills/skills-lock.json +47 -0
  399. package/skills/swarm/SKILL.md +8 -1
  400. package/skills/tdd/SKILL.md +7 -0
  401. package/skills/team/SKILL.md +17 -11
  402. package/skills/trace/SKILL.md +7 -0
  403. package/skills/ultraqa/SKILL.md +10 -3
  404. package/skills/ultrawork/SKILL.md +19 -12
  405. package/skills/{visual-ralph → visual-forge}/SKILL.md +36 -27
  406. package/skills/visual-verdict/SKILL.md +9 -2
  407. package/skills/web-clone/SKILL.md +14 -7
  408. package/skills/wiki/SKILL.md +10 -3
  409. package/skills/worker/SKILL.md +16 -7
  410. package/src/scripts/__tests__/codex-native-hook.test.ts +386 -319
  411. package/src/scripts/__tests__/run-test-files.test.ts +6 -4
  412. package/src/scripts/__tests__/verify-native-agents.test.ts +16 -16
  413. package/src/scripts/codex-native-hook.ts +34 -34
  414. package/src/scripts/eval/eval-cross-server-party-flow.ts +14 -0
  415. package/src/scripts/eval/eval-gui-onboarding-clarity.ts +20 -0
  416. package/src/scripts/eval/eval-liveops-reward-loop-balance.ts +14 -0
  417. package/src/scripts/eval/eval-profile-datastore-recovery.ts +20 -0
  418. package/src/scripts/eval/eval-remote-contract-hardening.ts +20 -0
  419. package/src/scripts/notify-fallback-watcher.ts +147 -146
  420. package/src/scripts/notify-hook/__tests__/team-worker-posttooluse.test.ts +24 -10
  421. package/src/scripts/notify-hook/{ralph-session-resume.ts → forge-session-resume.ts} +45 -43
  422. package/src/scripts/notify-hook/team-dispatch.ts +31 -4
  423. package/src/scripts/notify-hook/visual-verdict.ts +3 -3
  424. package/src/scripts/notify-hook.ts +10 -10
  425. package/src/scripts/run-test-files.ts +1 -1
  426. package/src/scripts/surface-taxonomy.ts +316 -0
  427. package/src/scripts/sync-plugin-mirror.ts +5 -4
  428. package/src/scripts/tmux-hook-engine.ts +31 -19
  429. package/templates/AGENTS.md +24 -15
  430. package/templates/catalog-manifest.json +5 -88
  431. package/templates/roblox/pre-action-plan.md +1 -0
  432. package/templates/roblox/robloxstudio-mcp.codex.json +18 -0
  433. package/templates/roblox/robloxstudio-mcp.windows.json +22 -0
  434. package/dist/adapt/__tests__/foundation.test.d.ts +0 -2
  435. package/dist/adapt/__tests__/foundation.test.d.ts.map +0 -1
  436. package/dist/adapt/__tests__/foundation.test.js +0 -171
  437. package/dist/adapt/__tests__/foundation.test.js.map +0 -1
  438. package/dist/adapt/__tests__/hermes.test.d.ts +0 -2
  439. package/dist/adapt/__tests__/hermes.test.d.ts.map +0 -1
  440. package/dist/adapt/__tests__/hermes.test.js +0 -137
  441. package/dist/adapt/__tests__/hermes.test.js.map +0 -1
  442. package/dist/agents/__tests__/definitions.test.d.ts +0 -2
  443. package/dist/agents/__tests__/definitions.test.d.ts.map +0 -1
  444. package/dist/agents/__tests__/definitions.test.js +0 -62
  445. package/dist/agents/__tests__/definitions.test.js.map +0 -1
  446. package/dist/agents/__tests__/native-config.test.d.ts +0 -2
  447. package/dist/agents/__tests__/native-config.test.d.ts.map +0 -1
  448. package/dist/agents/__tests__/native-config.test.js +0 -278
  449. package/dist/agents/__tests__/native-config.test.js.map +0 -1
  450. package/dist/autoresearch/__tests__/contracts.test.d.ts +0 -2
  451. package/dist/autoresearch/__tests__/contracts.test.d.ts.map +0 -1
  452. package/dist/autoresearch/__tests__/contracts.test.js +0 -127
  453. package/dist/autoresearch/__tests__/contracts.test.js.map +0 -1
  454. package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts +0 -2
  455. package/dist/autoresearch/__tests__/runtime-parity-extra.test.d.ts.map +0 -1
  456. package/dist/autoresearch/__tests__/runtime-parity-extra.test.js +0 -356
  457. package/dist/autoresearch/__tests__/runtime-parity-extra.test.js.map +0 -1
  458. package/dist/autoresearch/__tests__/runtime.test.d.ts +0 -2
  459. package/dist/autoresearch/__tests__/runtime.test.d.ts.map +0 -1
  460. package/dist/autoresearch/__tests__/runtime.test.js +0 -218
  461. package/dist/autoresearch/__tests__/runtime.test.js.map +0 -1
  462. package/dist/autoresearch/__tests__/skill-validation.test.d.ts +0 -2
  463. package/dist/autoresearch/__tests__/skill-validation.test.d.ts.map +0 -1
  464. package/dist/autoresearch/__tests__/skill-validation.test.js +0 -91
  465. package/dist/autoresearch/__tests__/skill-validation.test.js.map +0 -1
  466. package/dist/catalog/__tests__/generator.test.d.ts +0 -2
  467. package/dist/catalog/__tests__/generator.test.d.ts.map +0 -1
  468. package/dist/catalog/__tests__/generator.test.js +0 -49
  469. package/dist/catalog/__tests__/generator.test.js.map +0 -1
  470. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts +0 -2
  471. package/dist/catalog/__tests__/plugin-bundle-ssot.test.d.ts.map +0 -1
  472. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js +0 -83
  473. package/dist/catalog/__tests__/plugin-bundle-ssot.test.js.map +0 -1
  474. package/dist/catalog/__tests__/schema.test.d.ts +0 -2
  475. package/dist/catalog/__tests__/schema.test.d.ts.map +0 -1
  476. package/dist/catalog/__tests__/schema.test.js +0 -91
  477. package/dist/catalog/__tests__/schema.test.js.map +0 -1
  478. package/dist/cli/__tests__/adapt-help.test.d.ts +0 -2
  479. package/dist/cli/__tests__/adapt-help.test.d.ts.map +0 -1
  480. package/dist/cli/__tests__/adapt-help.test.js +0 -37
  481. package/dist/cli/__tests__/adapt-help.test.js.map +0 -1
  482. package/dist/cli/__tests__/adapt.test.d.ts +0 -2
  483. package/dist/cli/__tests__/adapt.test.d.ts.map +0 -1
  484. package/dist/cli/__tests__/adapt.test.js +0 -62
  485. package/dist/cli/__tests__/adapt.test.js.map +0 -1
  486. package/dist/cli/__tests__/agents-init.test.d.ts +0 -2
  487. package/dist/cli/__tests__/agents-init.test.d.ts.map +0 -1
  488. package/dist/cli/__tests__/agents-init.test.js +0 -184
  489. package/dist/cli/__tests__/agents-init.test.js.map +0 -1
  490. package/dist/cli/__tests__/agents.test.d.ts +0 -2
  491. package/dist/cli/__tests__/agents.test.d.ts.map +0 -1
  492. package/dist/cli/__tests__/agents.test.js +0 -137
  493. package/dist/cli/__tests__/agents.test.js.map +0 -1
  494. package/dist/cli/__tests__/ask.test.d.ts +0 -2
  495. package/dist/cli/__tests__/ask.test.d.ts.map +0 -1
  496. package/dist/cli/__tests__/ask.test.js +0 -265
  497. package/dist/cli/__tests__/ask.test.js.map +0 -1
  498. package/dist/cli/__tests__/autoresearch-guided.test.d.ts +0 -2
  499. package/dist/cli/__tests__/autoresearch-guided.test.d.ts.map +0 -1
  500. package/dist/cli/__tests__/autoresearch-guided.test.js +0 -365
  501. package/dist/cli/__tests__/autoresearch-guided.test.js.map +0 -1
  502. package/dist/cli/__tests__/autoresearch.test.d.ts +0 -2
  503. package/dist/cli/__tests__/autoresearch.test.d.ts.map +0 -1
  504. package/dist/cli/__tests__/autoresearch.test.js +0 -203
  505. package/dist/cli/__tests__/autoresearch.test.js.map +0 -1
  506. package/dist/cli/__tests__/catalog-contract.test.d.ts +0 -2
  507. package/dist/cli/__tests__/catalog-contract.test.d.ts.map +0 -1
  508. package/dist/cli/__tests__/catalog-contract.test.js +0 -18
  509. package/dist/cli/__tests__/catalog-contract.test.js.map +0 -1
  510. package/dist/cli/__tests__/cleanup.test.d.ts +0 -2
  511. package/dist/cli/__tests__/cleanup.test.d.ts.map +0 -1
  512. package/dist/cli/__tests__/cleanup.test.js +0 -419
  513. package/dist/cli/__tests__/cleanup.test.js.map +0 -1
  514. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts +0 -2
  515. package/dist/cli/__tests__/codex-plugin-layout.test.d.ts.map +0 -1
  516. package/dist/cli/__tests__/codex-plugin-layout.test.js +0 -210
  517. package/dist/cli/__tests__/codex-plugin-layout.test.js.map +0 -1
  518. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts +0 -2
  519. package/dist/cli/__tests__/doctor-context-window-warning.test.d.ts.map +0 -1
  520. package/dist/cli/__tests__/doctor-context-window-warning.test.js +0 -122
  521. package/dist/cli/__tests__/doctor-context-window-warning.test.js.map +0 -1
  522. package/dist/cli/__tests__/doctor-invalid-config.test.d.ts +0 -2
  523. package/dist/cli/__tests__/doctor-invalid-config.test.d.ts.map +0 -1
  524. package/dist/cli/__tests__/doctor-invalid-config.test.js +0 -52
  525. package/dist/cli/__tests__/doctor-invalid-config.test.js.map +0 -1
  526. package/dist/cli/__tests__/doctor-team.test.d.ts +0 -2
  527. package/dist/cli/__tests__/doctor-team.test.d.ts.map +0 -1
  528. package/dist/cli/__tests__/doctor-team.test.js +0 -299
  529. package/dist/cli/__tests__/doctor-team.test.js.map +0 -1
  530. package/dist/cli/__tests__/doctor-warning-copy.test.d.ts +0 -2
  531. package/dist/cli/__tests__/doctor-warning-copy.test.d.ts.map +0 -1
  532. package/dist/cli/__tests__/doctor-warning-copy.test.js +0 -438
  533. package/dist/cli/__tests__/doctor-warning-copy.test.js.map +0 -1
  534. package/dist/cli/__tests__/error-handling-warnings.test.d.ts +0 -2
  535. package/dist/cli/__tests__/error-handling-warnings.test.d.ts.map +0 -1
  536. package/dist/cli/__tests__/error-handling-warnings.test.js +0 -52
  537. package/dist/cli/__tests__/error-handling-warnings.test.js.map +0 -1
  538. package/dist/cli/__tests__/exec.test.d.ts +0 -2
  539. package/dist/cli/__tests__/exec.test.d.ts.map +0 -1
  540. package/dist/cli/__tests__/exec.test.js +0 -213
  541. package/dist/cli/__tests__/exec.test.js.map +0 -1
  542. package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts +0 -2
  543. package/dist/cli/__tests__/explore-windows-diagnostics.test.d.ts.map +0 -1
  544. package/dist/cli/__tests__/explore-windows-diagnostics.test.js +0 -17
  545. package/dist/cli/__tests__/explore-windows-diagnostics.test.js.map +0 -1
  546. package/dist/cli/__tests__/explore.test.d.ts +0 -2
  547. package/dist/cli/__tests__/explore.test.d.ts.map +0 -1
  548. package/dist/cli/__tests__/explore.test.js +0 -1090
  549. package/dist/cli/__tests__/explore.test.js.map +0 -1
  550. package/dist/cli/__tests__/hooks.test.d.ts +0 -2
  551. package/dist/cli/__tests__/hooks.test.d.ts.map +0 -1
  552. package/dist/cli/__tests__/hooks.test.js +0 -55
  553. package/dist/cli/__tests__/hooks.test.js.map +0 -1
  554. package/dist/cli/__tests__/index.test.d.ts +0 -2
  555. package/dist/cli/__tests__/index.test.d.ts.map +0 -1
  556. package/dist/cli/__tests__/index.test.js +0 -2259
  557. package/dist/cli/__tests__/index.test.js.map +0 -1
  558. package/dist/cli/__tests__/launch-fallback.test.d.ts +0 -2
  559. package/dist/cli/__tests__/launch-fallback.test.d.ts.map +0 -1
  560. package/dist/cli/__tests__/launch-fallback.test.js +0 -661
  561. package/dist/cli/__tests__/launch-fallback.test.js.map +0 -1
  562. package/dist/cli/__tests__/lifecycle-notifications.test.d.ts +0 -2
  563. package/dist/cli/__tests__/lifecycle-notifications.test.d.ts.map +0 -1
  564. package/dist/cli/__tests__/lifecycle-notifications.test.js +0 -48
  565. package/dist/cli/__tests__/lifecycle-notifications.test.js.map +0 -1
  566. package/dist/cli/__tests__/list.test.d.ts +0 -2
  567. package/dist/cli/__tests__/list.test.d.ts.map +0 -1
  568. package/dist/cli/__tests__/list.test.js +0 -38
  569. package/dist/cli/__tests__/list.test.js.map +0 -1
  570. package/dist/cli/__tests__/mcp-parity.test.d.ts +0 -2
  571. package/dist/cli/__tests__/mcp-parity.test.d.ts.map +0 -1
  572. package/dist/cli/__tests__/mcp-parity.test.js +0 -228
  573. package/dist/cli/__tests__/mcp-parity.test.js.map +0 -1
  574. package/dist/cli/__tests__/mcp-serve.test.d.ts +0 -2
  575. package/dist/cli/__tests__/mcp-serve.test.d.ts.map +0 -1
  576. package/dist/cli/__tests__/mcp-serve.test.js +0 -64
  577. package/dist/cli/__tests__/mcp-serve.test.js.map +0 -1
  578. package/dist/cli/__tests__/native-assets.test.d.ts +0 -2
  579. package/dist/cli/__tests__/native-assets.test.d.ts.map +0 -1
  580. package/dist/cli/__tests__/native-assets.test.js +0 -308
  581. package/dist/cli/__tests__/native-assets.test.js.map +0 -1
  582. package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts +0 -2
  583. package/dist/cli/__tests__/native-hook-dispatch-contract.test.d.ts.map +0 -1
  584. package/dist/cli/__tests__/native-hook-dispatch-contract.test.js +0 -11
  585. package/dist/cli/__tests__/native-hook-dispatch-contract.test.js.map +0 -1
  586. package/dist/cli/__tests__/nested-help-routing.test.d.ts +0 -2
  587. package/dist/cli/__tests__/nested-help-routing.test.d.ts.map +0 -1
  588. package/dist/cli/__tests__/nested-help-routing.test.js +0 -96
  589. package/dist/cli/__tests__/nested-help-routing.test.js.map +0 -1
  590. package/dist/cli/__tests__/package-bin-contract.test.d.ts +0 -2
  591. package/dist/cli/__tests__/package-bin-contract.test.d.ts.map +0 -1
  592. package/dist/cli/__tests__/package-bin-contract.test.js +0 -177
  593. package/dist/cli/__tests__/package-bin-contract.test.js.map +0 -1
  594. package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts +0 -3
  595. package/dist/cli/__tests__/packaged-explore-harness-lock.d.ts.map +0 -1
  596. package/dist/cli/__tests__/packaged-explore-harness-lock.js +0 -67
  597. package/dist/cli/__tests__/packaged-explore-harness-lock.js.map +0 -1
  598. package/dist/cli/__tests__/packaged-script-resolution.test.d.ts +0 -2
  599. package/dist/cli/__tests__/packaged-script-resolution.test.d.ts.map +0 -1
  600. package/dist/cli/__tests__/packaged-script-resolution.test.js +0 -19
  601. package/dist/cli/__tests__/packaged-script-resolution.test.js.map +0 -1
  602. package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts +0 -2
  603. package/dist/cli/__tests__/prompt-skill-sanitization.test.d.ts.map +0 -1
  604. package/dist/cli/__tests__/prompt-skill-sanitization.test.js +0 -48
  605. package/dist/cli/__tests__/prompt-skill-sanitization.test.js.map +0 -1
  606. package/dist/cli/__tests__/question.test.d.ts +0 -2
  607. package/dist/cli/__tests__/question.test.d.ts.map +0 -1
  608. package/dist/cli/__tests__/question.test.js +0 -633
  609. package/dist/cli/__tests__/question.test.js.map +0 -1
  610. package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts +0 -2
  611. package/dist/cli/__tests__/ralph-deslop-contract.test.d.ts.map +0 -1
  612. package/dist/cli/__tests__/ralph-deslop-contract.test.js +0 -28
  613. package/dist/cli/__tests__/ralph-deslop-contract.test.js.map +0 -1
  614. package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts +0 -2
  615. package/dist/cli/__tests__/ralph-prd-deep-interview.test.d.ts.map +0 -1
  616. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js +0 -24
  617. package/dist/cli/__tests__/ralph-prd-deep-interview.test.js.map +0 -1
  618. package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts +0 -2
  619. package/dist/cli/__tests__/ralph-prd-smoke.test.d.ts.map +0 -1
  620. package/dist/cli/__tests__/ralph-prd-smoke.test.js +0 -167
  621. package/dist/cli/__tests__/ralph-prd-smoke.test.js.map +0 -1
  622. package/dist/cli/__tests__/ralph.test.d.ts +0 -2
  623. package/dist/cli/__tests__/ralph.test.d.ts.map +0 -1
  624. package/dist/cli/__tests__/ralph.test.js +0 -256
  625. package/dist/cli/__tests__/ralph.test.js.map +0 -1
  626. package/dist/cli/__tests__/resume.test.d.ts +0 -2
  627. package/dist/cli/__tests__/resume.test.d.ts.map +0 -1
  628. package/dist/cli/__tests__/resume.test.js +0 -84
  629. package/dist/cli/__tests__/resume.test.js.map +0 -1
  630. package/dist/cli/__tests__/session-scoped-runtime.test.d.ts +0 -2
  631. package/dist/cli/__tests__/session-scoped-runtime.test.d.ts.map +0 -1
  632. package/dist/cli/__tests__/session-scoped-runtime.test.js +0 -146
  633. package/dist/cli/__tests__/session-scoped-runtime.test.js.map +0 -1
  634. package/dist/cli/__tests__/session-search-help.test.d.ts +0 -2
  635. package/dist/cli/__tests__/session-search-help.test.d.ts.map +0 -1
  636. package/dist/cli/__tests__/session-search-help.test.js +0 -76
  637. package/dist/cli/__tests__/session-search-help.test.js.map +0 -1
  638. package/dist/cli/__tests__/session-search.test.d.ts +0 -2
  639. package/dist/cli/__tests__/session-search.test.d.ts.map +0 -1
  640. package/dist/cli/__tests__/session-search.test.js +0 -77
  641. package/dist/cli/__tests__/session-search.test.js.map +0 -1
  642. package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts +0 -2
  643. package/dist/cli/__tests__/setup-agents-overwrite.test.d.ts.map +0 -1
  644. package/dist/cli/__tests__/setup-agents-overwrite.test.js +0 -457
  645. package/dist/cli/__tests__/setup-agents-overwrite.test.js.map +0 -1
  646. package/dist/cli/__tests__/setup-gh-star.test.d.ts +0 -2
  647. package/dist/cli/__tests__/setup-gh-star.test.d.ts.map +0 -1
  648. package/dist/cli/__tests__/setup-gh-star.test.js +0 -67
  649. package/dist/cli/__tests__/setup-gh-star.test.js.map +0 -1
  650. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts +0 -2
  651. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.d.ts.map +0 -1
  652. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js +0 -189
  653. package/dist/cli/__tests__/setup-hooks-shared-ownership.test.js.map +0 -1
  654. package/dist/cli/__tests__/setup-install-mode.test.d.ts +0 -2
  655. package/dist/cli/__tests__/setup-install-mode.test.d.ts.map +0 -1
  656. package/dist/cli/__tests__/setup-install-mode.test.js +0 -873
  657. package/dist/cli/__tests__/setup-install-mode.test.js.map +0 -1
  658. package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts +0 -2
  659. package/dist/cli/__tests__/setup-prompts-overwrite.test.d.ts.map +0 -1
  660. package/dist/cli/__tests__/setup-prompts-overwrite.test.js +0 -191
  661. package/dist/cli/__tests__/setup-prompts-overwrite.test.js.map +0 -1
  662. package/dist/cli/__tests__/setup-refresh.test.d.ts +0 -2
  663. package/dist/cli/__tests__/setup-refresh.test.d.ts.map +0 -1
  664. package/dist/cli/__tests__/setup-refresh.test.js +0 -591
  665. package/dist/cli/__tests__/setup-refresh.test.js.map +0 -1
  666. package/dist/cli/__tests__/setup-scope.test.d.ts +0 -2
  667. package/dist/cli/__tests__/setup-scope.test.d.ts.map +0 -1
  668. package/dist/cli/__tests__/setup-scope.test.js +0 -340
  669. package/dist/cli/__tests__/setup-scope.test.js.map +0 -1
  670. package/dist/cli/__tests__/setup-skill-validation.test.d.ts +0 -2
  671. package/dist/cli/__tests__/setup-skill-validation.test.d.ts.map +0 -1
  672. package/dist/cli/__tests__/setup-skill-validation.test.js +0 -44
  673. package/dist/cli/__tests__/setup-skill-validation.test.js.map +0 -1
  674. package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts +0 -2
  675. package/dist/cli/__tests__/setup-skills-overwrite.test.d.ts.map +0 -1
  676. package/dist/cli/__tests__/setup-skills-overwrite.test.js +0 -295
  677. package/dist/cli/__tests__/setup-skills-overwrite.test.js.map +0 -1
  678. package/dist/cli/__tests__/sidecar.test.d.ts +0 -2
  679. package/dist/cli/__tests__/sidecar.test.d.ts.map +0 -1
  680. package/dist/cli/__tests__/sidecar.test.js +0 -24
  681. package/dist/cli/__tests__/sidecar.test.js.map +0 -1
  682. package/dist/cli/__tests__/sparkshell-cli.test.d.ts +0 -2
  683. package/dist/cli/__tests__/sparkshell-cli.test.d.ts.map +0 -1
  684. package/dist/cli/__tests__/sparkshell-cli.test.js +0 -400
  685. package/dist/cli/__tests__/sparkshell-cli.test.js.map +0 -1
  686. package/dist/cli/__tests__/sparkshell-packaging.test.d.ts +0 -2
  687. package/dist/cli/__tests__/sparkshell-packaging.test.d.ts.map +0 -1
  688. package/dist/cli/__tests__/sparkshell-packaging.test.js +0 -74
  689. package/dist/cli/__tests__/sparkshell-packaging.test.js.map +0 -1
  690. package/dist/cli/__tests__/star-prompt.test.d.ts +0 -2
  691. package/dist/cli/__tests__/star-prompt.test.d.ts.map +0 -1
  692. package/dist/cli/__tests__/star-prompt.test.js +0 -172
  693. package/dist/cli/__tests__/star-prompt.test.js.map +0 -1
  694. package/dist/cli/__tests__/state.test.d.ts +0 -2
  695. package/dist/cli/__tests__/state.test.d.ts.map +0 -1
  696. package/dist/cli/__tests__/state.test.js +0 -46
  697. package/dist/cli/__tests__/state.test.js.map +0 -1
  698. package/dist/cli/__tests__/team-decompose.test.d.ts +0 -2
  699. package/dist/cli/__tests__/team-decompose.test.d.ts.map +0 -1
  700. package/dist/cli/__tests__/team-decompose.test.js +0 -133
  701. package/dist/cli/__tests__/team-decompose.test.js.map +0 -1
  702. package/dist/cli/__tests__/team.test.d.ts +0 -2
  703. package/dist/cli/__tests__/team.test.d.ts.map +0 -1
  704. package/dist/cli/__tests__/team.test.js +0 -1820
  705. package/dist/cli/__tests__/team.test.js.map +0 -1
  706. package/dist/cli/__tests__/uninstall.test.d.ts +0 -2
  707. package/dist/cli/__tests__/uninstall.test.d.ts.map +0 -1
  708. package/dist/cli/__tests__/uninstall.test.js +0 -766
  709. package/dist/cli/__tests__/uninstall.test.js.map +0 -1
  710. package/dist/cli/__tests__/update.test.d.ts +0 -2
  711. package/dist/cli/__tests__/update.test.d.ts.map +0 -1
  712. package/dist/cli/__tests__/update.test.js +0 -589
  713. package/dist/cli/__tests__/update.test.js.map +0 -1
  714. package/dist/cli/__tests__/version-sync-contract.test.d.ts +0 -2
  715. package/dist/cli/__tests__/version-sync-contract.test.d.ts.map +0 -1
  716. package/dist/cli/__tests__/version-sync-contract.test.js +0 -41
  717. package/dist/cli/__tests__/version-sync-contract.test.js.map +0 -1
  718. package/dist/cli/__tests__/version.test.d.ts +0 -2
  719. package/dist/cli/__tests__/version.test.d.ts.map +0 -1
  720. package/dist/cli/__tests__/version.test.js +0 -21
  721. package/dist/cli/__tests__/version.test.js.map +0 -1
  722. package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts +0 -2
  723. package/dist/cli/__tests__/windows-popup-loop-contract.test.d.ts.map +0 -1
  724. package/dist/cli/__tests__/windows-popup-loop-contract.test.js +0 -31
  725. package/dist/cli/__tests__/windows-popup-loop-contract.test.js.map +0 -1
  726. package/dist/cli/ralph.d.ts +0 -17
  727. package/dist/compat/__tests__/doctor-contract.test.d.ts +0 -2
  728. package/dist/compat/__tests__/doctor-contract.test.d.ts.map +0 -1
  729. package/dist/compat/__tests__/doctor-contract.test.js +0 -108
  730. package/dist/compat/__tests__/doctor-contract.test.js.map +0 -1
  731. package/dist/compat/__tests__/rust-runtime-compat.test.d.ts +0 -2
  732. package/dist/compat/__tests__/rust-runtime-compat.test.d.ts.map +0 -1
  733. package/dist/compat/__tests__/rust-runtime-compat.test.js +0 -218
  734. package/dist/compat/__tests__/rust-runtime-compat.test.js.map +0 -1
  735. package/dist/config/__tests__/codex-hooks.test.d.ts +0 -2
  736. package/dist/config/__tests__/codex-hooks.test.d.ts.map +0 -1
  737. package/dist/config/__tests__/codex-hooks.test.js +0 -77
  738. package/dist/config/__tests__/codex-hooks.test.js.map +0 -1
  739. package/dist/config/__tests__/generator-idempotent.test.d.ts +0 -2
  740. package/dist/config/__tests__/generator-idempotent.test.d.ts.map +0 -1
  741. package/dist/config/__tests__/generator-idempotent.test.js +0 -882
  742. package/dist/config/__tests__/generator-idempotent.test.js.map +0 -1
  743. package/dist/config/__tests__/generator-notify.test.d.ts +0 -2
  744. package/dist/config/__tests__/generator-notify.test.d.ts.map +0 -1
  745. package/dist/config/__tests__/generator-notify.test.js +0 -343
  746. package/dist/config/__tests__/generator-notify.test.js.map +0 -1
  747. package/dist/config/__tests__/generator-status-line-presets.test.d.ts +0 -2
  748. package/dist/config/__tests__/generator-status-line-presets.test.d.ts.map +0 -1
  749. package/dist/config/__tests__/generator-status-line-presets.test.js +0 -203
  750. package/dist/config/__tests__/generator-status-line-presets.test.js.map +0 -1
  751. package/dist/config/__tests__/mcp-registry.test.d.ts +0 -2
  752. package/dist/config/__tests__/mcp-registry.test.d.ts.map +0 -1
  753. package/dist/config/__tests__/mcp-registry.test.js +0 -190
  754. package/dist/config/__tests__/mcp-registry.test.js.map +0 -1
  755. package/dist/config/__tests__/models.test.d.ts +0 -2
  756. package/dist/config/__tests__/models.test.d.ts.map +0 -1
  757. package/dist/config/__tests__/models.test.js +0 -224
  758. package/dist/config/__tests__/models.test.js.map +0 -1
  759. package/dist/config/__tests__/wiki-config-contract.test.d.ts +0 -2
  760. package/dist/config/__tests__/wiki-config-contract.test.d.ts.map +0 -1
  761. package/dist/config/__tests__/wiki-config-contract.test.js +0 -19
  762. package/dist/config/__tests__/wiki-config-contract.test.js.map +0 -1
  763. package/dist/document-refresh/__tests__/enforcer.test.d.ts +0 -2
  764. package/dist/document-refresh/__tests__/enforcer.test.d.ts.map +0 -1
  765. package/dist/document-refresh/__tests__/enforcer.test.js +0 -128
  766. package/dist/document-refresh/__tests__/enforcer.test.js.map +0 -1
  767. package/dist/hooks/__tests__/agents-overlay.test.d.ts +0 -8
  768. package/dist/hooks/__tests__/agents-overlay.test.d.ts.map +0 -1
  769. package/dist/hooks/__tests__/agents-overlay.test.js +0 -644
  770. package/dist/hooks/__tests__/agents-overlay.test.js.map +0 -1
  771. package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts +0 -2
  772. package/dist/hooks/__tests__/analyze-routing-contract.test.d.ts.map +0 -1
  773. package/dist/hooks/__tests__/analyze-routing-contract.test.js +0 -45
  774. package/dist/hooks/__tests__/analyze-routing-contract.test.js.map +0 -1
  775. package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts +0 -2
  776. package/dist/hooks/__tests__/analyze-skill-contract.test.d.ts.map +0 -1
  777. package/dist/hooks/__tests__/analyze-skill-contract.test.js +0 -48
  778. package/dist/hooks/__tests__/analyze-skill-contract.test.js.map +0 -1
  779. package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts +0 -2
  780. package/dist/hooks/__tests__/anti-slop-workflow.test.d.ts.map +0 -1
  781. package/dist/hooks/__tests__/anti-slop-workflow.test.js +0 -146
  782. package/dist/hooks/__tests__/anti-slop-workflow.test.js.map +0 -1
  783. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts +0 -2
  784. package/dist/hooks/__tests__/autopilot-skill-contract.test.d.ts.map +0 -1
  785. package/dist/hooks/__tests__/autopilot-skill-contract.test.js +0 -37
  786. package/dist/hooks/__tests__/autopilot-skill-contract.test.js.map +0 -1
  787. package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts +0 -2
  788. package/dist/hooks/__tests__/clawhip-event-contract.test.d.ts.map +0 -1
  789. package/dist/hooks/__tests__/clawhip-event-contract.test.js +0 -37
  790. package/dist/hooks/__tests__/clawhip-event-contract.test.js.map +0 -1
  791. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts +0 -2
  792. package/dist/hooks/__tests__/code-review-skill-contract.test.d.ts.map +0 -1
  793. package/dist/hooks/__tests__/code-review-skill-contract.test.js +0 -56
  794. package/dist/hooks/__tests__/code-review-skill-contract.test.js.map +0 -1
  795. package/dist/hooks/__tests__/codebase-map.test.d.ts +0 -8
  796. package/dist/hooks/__tests__/codebase-map.test.d.ts.map +0 -1
  797. package/dist/hooks/__tests__/codebase-map.test.js +0 -218
  798. package/dist/hooks/__tests__/codebase-map.test.js.map +0 -1
  799. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts +0 -18
  800. package/dist/hooks/__tests__/consensus-execution-handoff.test.d.ts.map +0 -1
  801. package/dist/hooks/__tests__/consensus-execution-handoff.test.js +0 -234
  802. package/dist/hooks/__tests__/consensus-execution-handoff.test.js.map +0 -1
  803. package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts +0 -2
  804. package/dist/hooks/__tests__/debugger-log-recency-contract.test.d.ts.map +0 -1
  805. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js +0 -20
  806. package/dist/hooks/__tests__/debugger-log-recency-contract.test.js.map +0 -1
  807. package/dist/hooks/__tests__/deep-interview-contract.test.d.ts +0 -2
  808. package/dist/hooks/__tests__/deep-interview-contract.test.d.ts.map +0 -1
  809. package/dist/hooks/__tests__/deep-interview-contract.test.js +0 -213
  810. package/dist/hooks/__tests__/deep-interview-contract.test.js.map +0 -1
  811. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts +0 -2
  812. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.d.ts.map +0 -1
  813. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js +0 -43
  814. package/dist/hooks/__tests__/explicit-terminal-stop-docs-contract.test.js.map +0 -1
  815. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts +0 -2
  816. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.d.ts.map +0 -1
  817. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js +0 -38
  818. package/dist/hooks/__tests__/explicit-terminal-stop-model-docs-contract.test.js.map +0 -1
  819. package/dist/hooks/__tests__/explore-routing.test.d.ts +0 -2
  820. package/dist/hooks/__tests__/explore-routing.test.d.ts.map +0 -1
  821. package/dist/hooks/__tests__/explore-routing.test.js +0 -43
  822. package/dist/hooks/__tests__/explore-routing.test.js.map +0 -1
  823. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts +0 -2
  824. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.d.ts.map +0 -1
  825. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js +0 -69
  826. package/dist/hooks/__tests__/explore-sparkshell-guidance-contract.test.js.map +0 -1
  827. package/dist/hooks/__tests__/keyword-detector.test.d.ts +0 -2
  828. package/dist/hooks/__tests__/keyword-detector.test.d.ts.map +0 -1
  829. package/dist/hooks/__tests__/keyword-detector.test.js +0 -1716
  830. package/dist/hooks/__tests__/keyword-detector.test.js.map +0 -1
  831. package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts +0 -2
  832. package/dist/hooks/__tests__/notify-fallback-watcher.test.d.ts.map +0 -1
  833. package/dist/hooks/__tests__/notify-fallback-watcher.test.js +0 -3898
  834. package/dist/hooks/__tests__/notify-fallback-watcher.test.js.map +0 -1
  835. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts +0 -2
  836. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.d.ts.map +0 -1
  837. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js +0 -786
  838. package/dist/hooks/__tests__/notify-hook-all-workers-idle.test.js.map +0 -1
  839. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts +0 -2
  840. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.d.ts.map +0 -1
  841. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js +0 -2397
  842. package/dist/hooks/__tests__/notify-hook-auto-nudge.test.js.map +0 -1
  843. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts +0 -2
  844. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.d.ts.map +0 -1
  845. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js +0 -160
  846. package/dist/hooks/__tests__/notify-hook-cross-worktree-heartbeat.test.js.map +0 -1
  847. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts +0 -2
  848. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.d.ts.map +0 -1
  849. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js +0 -1178
  850. package/dist/hooks/__tests__/notify-hook-managed-tmux.test.js.map +0 -1
  851. package/dist/hooks/__tests__/notify-hook-modules.test.d.ts +0 -9
  852. package/dist/hooks/__tests__/notify-hook-modules.test.d.ts.map +0 -1
  853. package/dist/hooks/__tests__/notify-hook-modules.test.js +0 -529
  854. package/dist/hooks/__tests__/notify-hook-modules.test.js.map +0 -1
  855. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts +0 -2
  856. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.d.ts.map +0 -1
  857. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js +0 -14
  858. package/dist/hooks/__tests__/notify-hook-native-dispatch-contract.test.js.map +0 -1
  859. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts +0 -2
  860. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.d.ts.map +0 -1
  861. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js +0 -682
  862. package/dist/hooks/__tests__/notify-hook-ralph-resume.test.js.map +0 -1
  863. package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts +0 -9
  864. package/dist/hooks/__tests__/notify-hook-regression-205.test.d.ts.map +0 -1
  865. package/dist/hooks/__tests__/notify-hook-regression-205.test.js +0 -255
  866. package/dist/hooks/__tests__/notify-hook-regression-205.test.js.map +0 -1
  867. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts +0 -2
  868. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.d.ts.map +0 -1
  869. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js +0 -162
  870. package/dist/hooks/__tests__/notify-hook-session-idle-dedupe.test.js.map +0 -1
  871. package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts +0 -2
  872. package/dist/hooks/__tests__/notify-hook-session-scope.test.d.ts.map +0 -1
  873. package/dist/hooks/__tests__/notify-hook-session-scope.test.js +0 -301
  874. package/dist/hooks/__tests__/notify-hook-session-scope.test.js.map +0 -1
  875. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts +0 -2
  876. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.d.ts.map +0 -1
  877. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js +0 -1510
  878. package/dist/hooks/__tests__/notify-hook-team-dispatch.test.js.map +0 -1
  879. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts +0 -2
  880. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.d.ts.map +0 -1
  881. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js +0 -2879
  882. package/dist/hooks/__tests__/notify-hook-team-leader-nudge.test.js.map +0 -1
  883. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts +0 -2
  884. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.d.ts.map +0 -1
  885. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js +0 -228
  886. package/dist/hooks/__tests__/notify-hook-team-tmux-guard.test.js.map +0 -1
  887. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts +0 -2
  888. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.d.ts.map +0 -1
  889. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js +0 -35
  890. package/dist/hooks/__tests__/notify-hook-team-worker-fail-closed.test.js.map +0 -1
  891. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts +0 -2
  892. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.d.ts.map +0 -1
  893. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js +0 -1589
  894. package/dist/hooks/__tests__/notify-hook-tmux-heal.test.js.map +0 -1
  895. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts +0 -10
  896. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.d.ts.map +0 -1
  897. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js +0 -0
  898. package/dist/hooks/__tests__/notify-hook-tmux-scrollback.test.js.map +0 -1
  899. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts +0 -11
  900. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.d.ts.map +0 -1
  901. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js +0 -266
  902. package/dist/hooks/__tests__/notify-hook-visual-verdict.test.js.map +0 -1
  903. package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts +0 -2
  904. package/dist/hooks/__tests__/notify-hook-worker-idle.test.d.ts.map +0 -1
  905. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js +0 -895
  906. package/dist/hooks/__tests__/notify-hook-worker-idle.test.js.map +0 -1
  907. package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts +0 -2
  908. package/dist/hooks/__tests__/openclaw-setup-contract.test.d.ts.map +0 -1
  909. package/dist/hooks/__tests__/openclaw-setup-contract.test.js +0 -61
  910. package/dist/hooks/__tests__/openclaw-setup-contract.test.js.map +0 -1
  911. package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts +0 -2
  912. package/dist/hooks/__tests__/pre-context-gate-skills.test.d.ts.map +0 -1
  913. package/dist/hooks/__tests__/pre-context-gate-skills.test.js +0 -40
  914. package/dist/hooks/__tests__/pre-context-gate-skills.test.js.map +0 -1
  915. package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts +0 -2
  916. package/dist/hooks/__tests__/prompt-guidance-catalog.test.d.ts.map +0 -1
  917. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js +0 -11
  918. package/dist/hooks/__tests__/prompt-guidance-catalog.test.js.map +0 -1
  919. package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts +0 -2
  920. package/dist/hooks/__tests__/prompt-guidance-contract.test.d.ts.map +0 -1
  921. package/dist/hooks/__tests__/prompt-guidance-contract.test.js +0 -38
  922. package/dist/hooks/__tests__/prompt-guidance-contract.test.js.map +0 -1
  923. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts +0 -2
  924. package/dist/hooks/__tests__/prompt-guidance-fragments.test.d.ts.map +0 -1
  925. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js +0 -48
  926. package/dist/hooks/__tests__/prompt-guidance-fragments.test.js.map +0 -1
  927. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts +0 -2
  928. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.d.ts.map +0 -1
  929. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js +0 -11
  930. package/dist/hooks/__tests__/prompt-guidance-scenarios.test.js.map +0 -1
  931. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts +0 -5
  932. package/dist/hooks/__tests__/prompt-guidance-test-helpers.d.ts.map +0 -1
  933. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js +0 -34
  934. package/dist/hooks/__tests__/prompt-guidance-test-helpers.js.map +0 -1
  935. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts +0 -2
  936. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.d.ts.map +0 -1
  937. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js +0 -65
  938. package/dist/hooks/__tests__/prompt-guidance-wave-two.test.js.map +0 -1
  939. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts +0 -2
  940. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.d.ts.map +0 -1
  941. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js +0 -38
  942. package/dist/hooks/__tests__/prompt-orchestration-boundary.test.js.map +0 -1
  943. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts +0 -2
  944. package/dist/hooks/__tests__/prompt-refactor-contract.test.d.ts.map +0 -1
  945. package/dist/hooks/__tests__/prompt-refactor-contract.test.js +0 -22
  946. package/dist/hooks/__tests__/prompt-refactor-contract.test.js.map +0 -1
  947. package/dist/hooks/__tests__/prompt-team-routing.test.d.ts +0 -2
  948. package/dist/hooks/__tests__/prompt-team-routing.test.d.ts.map +0 -1
  949. package/dist/hooks/__tests__/prompt-team-routing.test.js +0 -49
  950. package/dist/hooks/__tests__/prompt-team-routing.test.js.map +0 -1
  951. package/dist/hooks/__tests__/session.test.d.ts +0 -2
  952. package/dist/hooks/__tests__/session.test.d.ts.map +0 -1
  953. package/dist/hooks/__tests__/session.test.js +0 -322
  954. package/dist/hooks/__tests__/session.test.js.map +0 -1
  955. package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts +0 -2
  956. package/dist/hooks/__tests__/skill-guidance-contract.test.d.ts.map +0 -1
  957. package/dist/hooks/__tests__/skill-guidance-contract.test.js +0 -29
  958. package/dist/hooks/__tests__/skill-guidance-contract.test.js.map +0 -1
  959. package/dist/hooks/__tests__/task-size-detector.test.d.ts +0 -2
  960. package/dist/hooks/__tests__/task-size-detector.test.d.ts.map +0 -1
  961. package/dist/hooks/__tests__/task-size-detector.test.js +0 -330
  962. package/dist/hooks/__tests__/task-size-detector.test.js.map +0 -1
  963. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts +0 -2
  964. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.d.ts.map +0 -1
  965. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js +0 -28
  966. package/dist/hooks/__tests__/team-runtime-gating-docs-contract.test.js.map +0 -1
  967. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts +0 -2
  968. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.d.ts.map +0 -1
  969. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js +0 -24
  970. package/dist/hooks/__tests__/tmux-hook-engine-types-sync.test.js.map +0 -1
  971. package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts +0 -2
  972. package/dist/hooks/__tests__/tmux-hook-engine.test.d.ts.map +0 -1
  973. package/dist/hooks/__tests__/tmux-hook-engine.test.js +0 -403
  974. package/dist/hooks/__tests__/tmux-hook-engine.test.js.map +0 -1
  975. package/dist/hooks/__tests__/triage-config.test.d.ts +0 -2
  976. package/dist/hooks/__tests__/triage-config.test.d.ts.map +0 -1
  977. package/dist/hooks/__tests__/triage-config.test.js +0 -211
  978. package/dist/hooks/__tests__/triage-config.test.js.map +0 -1
  979. package/dist/hooks/__tests__/triage-heuristic.test.d.ts +0 -2
  980. package/dist/hooks/__tests__/triage-heuristic.test.d.ts.map +0 -1
  981. package/dist/hooks/__tests__/triage-heuristic.test.js +0 -285
  982. package/dist/hooks/__tests__/triage-heuristic.test.js.map +0 -1
  983. package/dist/hooks/__tests__/triage-state.test.d.ts +0 -2
  984. package/dist/hooks/__tests__/triage-state.test.d.ts.map +0 -1
  985. package/dist/hooks/__tests__/triage-state.test.js +0 -426
  986. package/dist/hooks/__tests__/triage-state.test.js.map +0 -1
  987. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts +0 -2
  988. package/dist/hooks/__tests__/visual-ralph-skill.test.d.ts.map +0 -1
  989. package/dist/hooks/__tests__/visual-ralph-skill.test.js +0 -44
  990. package/dist/hooks/__tests__/visual-ralph-skill.test.js.map +0 -1
  991. package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts +0 -2
  992. package/dist/hooks/__tests__/visual-verdict-loop.test.d.ts.map +0 -1
  993. package/dist/hooks/__tests__/visual-verdict-loop.test.js +0 -35
  994. package/dist/hooks/__tests__/visual-verdict-loop.test.js.map +0 -1
  995. package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts +0 -2
  996. package/dist/hooks/__tests__/wiki-docs-contract.test.d.ts.map +0 -1
  997. package/dist/hooks/__tests__/wiki-docs-contract.test.js +0 -34
  998. package/dist/hooks/__tests__/wiki-docs-contract.test.js.map +0 -1
  999. package/dist/hooks/code-simplifier/__tests__/index.test.d.ts +0 -2
  1000. package/dist/hooks/code-simplifier/__tests__/index.test.d.ts.map +0 -1
  1001. package/dist/hooks/code-simplifier/__tests__/index.test.js +0 -187
  1002. package/dist/hooks/code-simplifier/__tests__/index.test.js.map +0 -1
  1003. package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts +0 -2
  1004. package/dist/hooks/extensibility/__tests__/dispatcher.test.d.ts.map +0 -1
  1005. package/dist/hooks/extensibility/__tests__/dispatcher.test.js +0 -242
  1006. package/dist/hooks/extensibility/__tests__/dispatcher.test.js.map +0 -1
  1007. package/dist/hooks/extensibility/__tests__/events.test.d.ts +0 -2
  1008. package/dist/hooks/extensibility/__tests__/events.test.d.ts.map +0 -1
  1009. package/dist/hooks/extensibility/__tests__/events.test.js +0 -125
  1010. package/dist/hooks/extensibility/__tests__/events.test.js.map +0 -1
  1011. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts +0 -2
  1012. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.d.ts.map +0 -1
  1013. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js +0 -153
  1014. package/dist/hooks/extensibility/__tests__/example-hook-plugins.test.js.map +0 -1
  1015. package/dist/hooks/extensibility/__tests__/loader.test.d.ts +0 -2
  1016. package/dist/hooks/extensibility/__tests__/loader.test.d.ts.map +0 -1
  1017. package/dist/hooks/extensibility/__tests__/loader.test.js +0 -254
  1018. package/dist/hooks/extensibility/__tests__/loader.test.js.map +0 -1
  1019. package/dist/hooks/extensibility/__tests__/logging.test.d.ts +0 -2
  1020. package/dist/hooks/extensibility/__tests__/logging.test.d.ts.map +0 -1
  1021. package/dist/hooks/extensibility/__tests__/logging.test.js +0 -74
  1022. package/dist/hooks/extensibility/__tests__/logging.test.js.map +0 -1
  1023. package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts +0 -2
  1024. package/dist/hooks/extensibility/__tests__/plugin-runner.test.d.ts.map +0 -1
  1025. package/dist/hooks/extensibility/__tests__/plugin-runner.test.js +0 -202
  1026. package/dist/hooks/extensibility/__tests__/plugin-runner.test.js.map +0 -1
  1027. package/dist/hooks/extensibility/__tests__/runtime.test.d.ts +0 -2
  1028. package/dist/hooks/extensibility/__tests__/runtime.test.d.ts.map +0 -1
  1029. package/dist/hooks/extensibility/__tests__/runtime.test.js +0 -198
  1030. package/dist/hooks/extensibility/__tests__/runtime.test.js.map +0 -1
  1031. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts +0 -2
  1032. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.d.ts.map +0 -1
  1033. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js +0 -32
  1034. package/dist/hooks/extensibility/__tests__/sdk-public-surface.test.js.map +0 -1
  1035. package/dist/hooks/extensibility/__tests__/sdk.test.d.ts +0 -2
  1036. package/dist/hooks/extensibility/__tests__/sdk.test.d.ts.map +0 -1
  1037. package/dist/hooks/extensibility/__tests__/sdk.test.js +0 -479
  1038. package/dist/hooks/extensibility/__tests__/sdk.test.js.map +0 -1
  1039. package/dist/hud/__tests__/authority.test.d.ts +0 -2
  1040. package/dist/hud/__tests__/authority.test.d.ts.map +0 -1
  1041. package/dist/hud/__tests__/authority.test.js +0 -56
  1042. package/dist/hud/__tests__/authority.test.js.map +0 -1
  1043. package/dist/hud/__tests__/colors.test.d.ts +0 -2
  1044. package/dist/hud/__tests__/colors.test.d.ts.map +0 -1
  1045. package/dist/hud/__tests__/colors.test.js +0 -92
  1046. package/dist/hud/__tests__/colors.test.js.map +0 -1
  1047. package/dist/hud/__tests__/hud-tmux-injection.test.d.ts +0 -10
  1048. package/dist/hud/__tests__/hud-tmux-injection.test.d.ts.map +0 -1
  1049. package/dist/hud/__tests__/hud-tmux-injection.test.js +0 -150
  1050. package/dist/hud/__tests__/hud-tmux-injection.test.js.map +0 -1
  1051. package/dist/hud/__tests__/index.test.d.ts +0 -2
  1052. package/dist/hud/__tests__/index.test.d.ts.map +0 -1
  1053. package/dist/hud/__tests__/index.test.js +0 -180
  1054. package/dist/hud/__tests__/index.test.js.map +0 -1
  1055. package/dist/hud/__tests__/reconcile.test.d.ts +0 -2
  1056. package/dist/hud/__tests__/reconcile.test.d.ts.map +0 -1
  1057. package/dist/hud/__tests__/reconcile.test.js +0 -125
  1058. package/dist/hud/__tests__/reconcile.test.js.map +0 -1
  1059. package/dist/hud/__tests__/render.test.d.ts +0 -2
  1060. package/dist/hud/__tests__/render.test.d.ts.map +0 -1
  1061. package/dist/hud/__tests__/render.test.js +0 -573
  1062. package/dist/hud/__tests__/render.test.js.map +0 -1
  1063. package/dist/hud/__tests__/state.test.d.ts +0 -2
  1064. package/dist/hud/__tests__/state.test.d.ts.map +0 -1
  1065. package/dist/hud/__tests__/state.test.js +0 -618
  1066. package/dist/hud/__tests__/state.test.js.map +0 -1
  1067. package/dist/hud/__tests__/types.test.d.ts +0 -2
  1068. package/dist/hud/__tests__/types.test.d.ts.map +0 -1
  1069. package/dist/hud/__tests__/types.test.js +0 -79
  1070. package/dist/hud/__tests__/types.test.js.map +0 -1
  1071. package/dist/hud/__tests__/watch.test.d.ts +0 -2
  1072. package/dist/hud/__tests__/watch.test.d.ts.map +0 -1
  1073. package/dist/hud/__tests__/watch.test.js +0 -63
  1074. package/dist/hud/__tests__/watch.test.js.map +0 -1
  1075. package/dist/mcp/__tests__/bootstrap.test.d.ts +0 -2
  1076. package/dist/mcp/__tests__/bootstrap.test.d.ts.map +0 -1
  1077. package/dist/mcp/__tests__/bootstrap.test.js +0 -207
  1078. package/dist/mcp/__tests__/bootstrap.test.js.map +0 -1
  1079. package/dist/mcp/__tests__/code-intel-server.test.d.ts +0 -2
  1080. package/dist/mcp/__tests__/code-intel-server.test.d.ts.map +0 -1
  1081. package/dist/mcp/__tests__/code-intel-server.test.js +0 -70
  1082. package/dist/mcp/__tests__/code-intel-server.test.js.map +0 -1
  1083. package/dist/mcp/__tests__/memory-server.test.d.ts +0 -2
  1084. package/dist/mcp/__tests__/memory-server.test.d.ts.map +0 -1
  1085. package/dist/mcp/__tests__/memory-server.test.js +0 -36
  1086. package/dist/mcp/__tests__/memory-server.test.js.map +0 -1
  1087. package/dist/mcp/__tests__/memory-validation.test.d.ts +0 -2
  1088. package/dist/mcp/__tests__/memory-validation.test.d.ts.map +0 -1
  1089. package/dist/mcp/__tests__/memory-validation.test.js +0 -29
  1090. package/dist/mcp/__tests__/memory-validation.test.js.map +0 -1
  1091. package/dist/mcp/__tests__/path-traversal.test.d.ts +0 -2
  1092. package/dist/mcp/__tests__/path-traversal.test.d.ts.map +0 -1
  1093. package/dist/mcp/__tests__/path-traversal.test.js +0 -83
  1094. package/dist/mcp/__tests__/path-traversal.test.js.map +0 -1
  1095. package/dist/mcp/__tests__/server-lifecycle.test.d.ts +0 -2
  1096. package/dist/mcp/__tests__/server-lifecycle.test.d.ts.map +0 -1
  1097. package/dist/mcp/__tests__/server-lifecycle.test.js +0 -260
  1098. package/dist/mcp/__tests__/server-lifecycle.test.js.map +0 -1
  1099. package/dist/mcp/__tests__/state-paths.test.d.ts +0 -2
  1100. package/dist/mcp/__tests__/state-paths.test.d.ts.map +0 -1
  1101. package/dist/mcp/__tests__/state-paths.test.js +0 -209
  1102. package/dist/mcp/__tests__/state-paths.test.js.map +0 -1
  1103. package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts +0 -2
  1104. package/dist/mcp/__tests__/state-server-ralph-phase.test.d.ts.map +0 -1
  1105. package/dist/mcp/__tests__/state-server-ralph-phase.test.js +0 -109
  1106. package/dist/mcp/__tests__/state-server-ralph-phase.test.js.map +0 -1
  1107. package/dist/mcp/__tests__/state-server-schema.test.d.ts +0 -2
  1108. package/dist/mcp/__tests__/state-server-schema.test.d.ts.map +0 -1
  1109. package/dist/mcp/__tests__/state-server-schema.test.js +0 -29
  1110. package/dist/mcp/__tests__/state-server-schema.test.js.map +0 -1
  1111. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts +0 -2
  1112. package/dist/mcp/__tests__/state-server-team-tools.test.d.ts.map +0 -1
  1113. package/dist/mcp/__tests__/state-server-team-tools.test.js +0 -35
  1114. package/dist/mcp/__tests__/state-server-team-tools.test.js.map +0 -1
  1115. package/dist/mcp/__tests__/state-server.test.d.ts +0 -2
  1116. package/dist/mcp/__tests__/state-server.test.d.ts.map +0 -1
  1117. package/dist/mcp/__tests__/state-server.test.js +0 -965
  1118. package/dist/mcp/__tests__/state-server.test.js.map +0 -1
  1119. package/dist/mcp/__tests__/trace-server.test.d.ts +0 -2
  1120. package/dist/mcp/__tests__/trace-server.test.d.ts.map +0 -1
  1121. package/dist/mcp/__tests__/trace-server.test.js +0 -119
  1122. package/dist/mcp/__tests__/trace-server.test.js.map +0 -1
  1123. package/dist/mcp/__tests__/wiki-server.test.d.ts +0 -2
  1124. package/dist/mcp/__tests__/wiki-server.test.d.ts.map +0 -1
  1125. package/dist/mcp/__tests__/wiki-server.test.js +0 -30
  1126. package/dist/mcp/__tests__/wiki-server.test.js.map +0 -1
  1127. package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts +0 -2
  1128. package/dist/modes/__tests__/base-autoresearch-contract.test.d.ts.map +0 -1
  1129. package/dist/modes/__tests__/base-autoresearch-contract.test.js +0 -123
  1130. package/dist/modes/__tests__/base-autoresearch-contract.test.js.map +0 -1
  1131. package/dist/modes/__tests__/base-multi-state-compat.test.d.ts +0 -2
  1132. package/dist/modes/__tests__/base-multi-state-compat.test.d.ts.map +0 -1
  1133. package/dist/modes/__tests__/base-multi-state-compat.test.js +0 -38
  1134. package/dist/modes/__tests__/base-multi-state-compat.test.js.map +0 -1
  1135. package/dist/modes/__tests__/base-ralph-contract.test.d.ts +0 -2
  1136. package/dist/modes/__tests__/base-ralph-contract.test.d.ts.map +0 -1
  1137. package/dist/modes/__tests__/base-ralph-contract.test.js +0 -64
  1138. package/dist/modes/__tests__/base-ralph-contract.test.js.map +0 -1
  1139. package/dist/modes/__tests__/base-session-scope.test.d.ts +0 -2
  1140. package/dist/modes/__tests__/base-session-scope.test.d.ts.map +0 -1
  1141. package/dist/modes/__tests__/base-session-scope.test.js +0 -98
  1142. package/dist/modes/__tests__/base-session-scope.test.js.map +0 -1
  1143. package/dist/modes/__tests__/base-tmux-pane.test.d.ts +0 -2
  1144. package/dist/modes/__tests__/base-tmux-pane.test.d.ts.map +0 -1
  1145. package/dist/modes/__tests__/base-tmux-pane.test.js +0 -39
  1146. package/dist/modes/__tests__/base-tmux-pane.test.js.map +0 -1
  1147. package/dist/notifications/__tests__/config.test.d.ts +0 -2
  1148. package/dist/notifications/__tests__/config.test.d.ts.map +0 -1
  1149. package/dist/notifications/__tests__/config.test.js +0 -269
  1150. package/dist/notifications/__tests__/config.test.js.map +0 -1
  1151. package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts +0 -2
  1152. package/dist/notifications/__tests__/custom-alias-enablement.test.d.ts.map +0 -1
  1153. package/dist/notifications/__tests__/custom-alias-enablement.test.js +0 -84
  1154. package/dist/notifications/__tests__/custom-alias-enablement.test.js.map +0 -1
  1155. package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts +0 -5
  1156. package/dist/notifications/__tests__/dispatch-cooldown.test.d.ts.map +0 -1
  1157. package/dist/notifications/__tests__/dispatch-cooldown.test.js +0 -100
  1158. package/dist/notifications/__tests__/dispatch-cooldown.test.js.map +0 -1
  1159. package/dist/notifications/__tests__/dispatcher.test.d.ts +0 -2
  1160. package/dist/notifications/__tests__/dispatcher.test.d.ts.map +0 -1
  1161. package/dist/notifications/__tests__/dispatcher.test.js +0 -202
  1162. package/dist/notifications/__tests__/dispatcher.test.js.map +0 -1
  1163. package/dist/notifications/__tests__/formatter.test.d.ts +0 -2
  1164. package/dist/notifications/__tests__/formatter.test.d.ts.map +0 -1
  1165. package/dist/notifications/__tests__/formatter.test.js +0 -270
  1166. package/dist/notifications/__tests__/formatter.test.js.map +0 -1
  1167. package/dist/notifications/__tests__/hook-config.test.d.ts +0 -5
  1168. package/dist/notifications/__tests__/hook-config.test.d.ts.map +0 -1
  1169. package/dist/notifications/__tests__/hook-config.test.js +0 -139
  1170. package/dist/notifications/__tests__/hook-config.test.js.map +0 -1
  1171. package/dist/notifications/__tests__/idle-cooldown.test.d.ts +0 -5
  1172. package/dist/notifications/__tests__/idle-cooldown.test.d.ts.map +0 -1
  1173. package/dist/notifications/__tests__/idle-cooldown.test.js +0 -209
  1174. package/dist/notifications/__tests__/idle-cooldown.test.js.map +0 -1
  1175. package/dist/notifications/__tests__/index.test.d.ts +0 -2
  1176. package/dist/notifications/__tests__/index.test.d.ts.map +0 -1
  1177. package/dist/notifications/__tests__/index.test.js +0 -188
  1178. package/dist/notifications/__tests__/index.test.js.map +0 -1
  1179. package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts +0 -2
  1180. package/dist/notifications/__tests__/lifecycle-dedupe.test.d.ts.map +0 -1
  1181. package/dist/notifications/__tests__/lifecycle-dedupe.test.js +0 -86
  1182. package/dist/notifications/__tests__/lifecycle-dedupe.test.js.map +0 -1
  1183. package/dist/notifications/__tests__/notifier.test.d.ts +0 -2
  1184. package/dist/notifications/__tests__/notifier.test.d.ts.map +0 -1
  1185. package/dist/notifications/__tests__/notifier.test.js +0 -239
  1186. package/dist/notifications/__tests__/notifier.test.js.map +0 -1
  1187. package/dist/notifications/__tests__/profiles.test.d.ts +0 -2
  1188. package/dist/notifications/__tests__/profiles.test.d.ts.map +0 -1
  1189. package/dist/notifications/__tests__/profiles.test.js +0 -404
  1190. package/dist/notifications/__tests__/profiles.test.js.map +0 -1
  1191. package/dist/notifications/__tests__/reply-config.test.d.ts +0 -2
  1192. package/dist/notifications/__tests__/reply-config.test.d.ts.map +0 -1
  1193. package/dist/notifications/__tests__/reply-config.test.js +0 -79
  1194. package/dist/notifications/__tests__/reply-config.test.js.map +0 -1
  1195. package/dist/notifications/__tests__/reply-listener.test.d.ts +0 -2
  1196. package/dist/notifications/__tests__/reply-listener.test.d.ts.map +0 -1
  1197. package/dist/notifications/__tests__/reply-listener.test.js +0 -723
  1198. package/dist/notifications/__tests__/reply-listener.test.js.map +0 -1
  1199. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts +0 -2
  1200. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.d.ts.map +0 -1
  1201. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js +0 -93
  1202. package/dist/notifications/__tests__/session-idle-tail-dedupe.test.js.map +0 -1
  1203. package/dist/notifications/__tests__/session-registry.test.d.ts +0 -2
  1204. package/dist/notifications/__tests__/session-registry.test.d.ts.map +0 -1
  1205. package/dist/notifications/__tests__/session-registry.test.js +0 -234
  1206. package/dist/notifications/__tests__/session-registry.test.js.map +0 -1
  1207. package/dist/notifications/__tests__/session-status.test.d.ts +0 -2
  1208. package/dist/notifications/__tests__/session-status.test.d.ts.map +0 -1
  1209. package/dist/notifications/__tests__/session-status.test.js +0 -249
  1210. package/dist/notifications/__tests__/session-status.test.js.map +0 -1
  1211. package/dist/notifications/__tests__/temp-mode.test.d.ts +0 -2
  1212. package/dist/notifications/__tests__/temp-mode.test.d.ts.map +0 -1
  1213. package/dist/notifications/__tests__/temp-mode.test.js +0 -172
  1214. package/dist/notifications/__tests__/temp-mode.test.js.map +0 -1
  1215. package/dist/notifications/__tests__/template-engine.test.d.ts +0 -5
  1216. package/dist/notifications/__tests__/template-engine.test.d.ts.map +0 -1
  1217. package/dist/notifications/__tests__/template-engine.test.js +0 -158
  1218. package/dist/notifications/__tests__/template-engine.test.js.map +0 -1
  1219. package/dist/notifications/__tests__/tmux-detector.test.d.ts +0 -2
  1220. package/dist/notifications/__tests__/tmux-detector.test.d.ts.map +0 -1
  1221. package/dist/notifications/__tests__/tmux-detector.test.js +0 -208
  1222. package/dist/notifications/__tests__/tmux-detector.test.js.map +0 -1
  1223. package/dist/notifications/__tests__/tmux.test.d.ts +0 -2
  1224. package/dist/notifications/__tests__/tmux.test.d.ts.map +0 -1
  1225. package/dist/notifications/__tests__/tmux.test.js +0 -285
  1226. package/dist/notifications/__tests__/tmux.test.js.map +0 -1
  1227. package/dist/notifications/__tests__/verbosity.test.d.ts +0 -2
  1228. package/dist/notifications/__tests__/verbosity.test.d.ts.map +0 -1
  1229. package/dist/notifications/__tests__/verbosity.test.js +0 -237
  1230. package/dist/notifications/__tests__/verbosity.test.js.map +0 -1
  1231. package/dist/openclaw/__tests__/config.test.d.ts +0 -6
  1232. package/dist/openclaw/__tests__/config.test.d.ts.map +0 -1
  1233. package/dist/openclaw/__tests__/config.test.js +0 -344
  1234. package/dist/openclaw/__tests__/config.test.js.map +0 -1
  1235. package/dist/openclaw/__tests__/dispatcher.test.d.ts +0 -5
  1236. package/dist/openclaw/__tests__/dispatcher.test.d.ts.map +0 -1
  1237. package/dist/openclaw/__tests__/dispatcher.test.js +0 -169
  1238. package/dist/openclaw/__tests__/dispatcher.test.js.map +0 -1
  1239. package/dist/openclaw/__tests__/index.test.d.ts +0 -6
  1240. package/dist/openclaw/__tests__/index.test.d.ts.map +0 -1
  1241. package/dist/openclaw/__tests__/index.test.js +0 -382
  1242. package/dist/openclaw/__tests__/index.test.js.map +0 -1
  1243. package/dist/pipeline/__tests__/orchestrator.test.d.ts +0 -2
  1244. package/dist/pipeline/__tests__/orchestrator.test.d.ts.map +0 -1
  1245. package/dist/pipeline/__tests__/orchestrator.test.js +0 -505
  1246. package/dist/pipeline/__tests__/orchestrator.test.js.map +0 -1
  1247. package/dist/pipeline/__tests__/stages.test.d.ts +0 -2
  1248. package/dist/pipeline/__tests__/stages.test.d.ts.map +0 -1
  1249. package/dist/pipeline/__tests__/stages.test.js +0 -754
  1250. package/dist/pipeline/__tests__/stages.test.js.map +0 -1
  1251. package/dist/pipeline/stages/ralph-verify.d.ts +0 -53
  1252. package/dist/pipeline/stages/ralph-verify.d.ts.map +0 -1
  1253. package/dist/pipeline/stages/ralph-verify.js.map +0 -1
  1254. package/dist/pipeline/stages/ralplan.d.ts +0 -25
  1255. package/dist/pipeline/stages/ralplan.d.ts.map +0 -1
  1256. package/dist/pipeline/stages/ralplan.js.map +0 -1
  1257. package/dist/planning/__tests__/artifacts.test.d.ts +0 -2
  1258. package/dist/planning/__tests__/artifacts.test.d.ts.map +0 -1
  1259. package/dist/planning/__tests__/artifacts.test.js +0 -544
  1260. package/dist/planning/__tests__/artifacts.test.js.map +0 -1
  1261. package/dist/question/__tests__/client.test.d.ts +0 -2
  1262. package/dist/question/__tests__/client.test.d.ts.map +0 -1
  1263. package/dist/question/__tests__/client.test.js +0 -90
  1264. package/dist/question/__tests__/client.test.js.map +0 -1
  1265. package/dist/question/__tests__/deep-interview.test.d.ts +0 -2
  1266. package/dist/question/__tests__/deep-interview.test.d.ts.map +0 -1
  1267. package/dist/question/__tests__/deep-interview.test.js +0 -209
  1268. package/dist/question/__tests__/deep-interview.test.js.map +0 -1
  1269. package/dist/question/__tests__/policy.test.d.ts +0 -2
  1270. package/dist/question/__tests__/policy.test.d.ts.map +0 -1
  1271. package/dist/question/__tests__/policy.test.js +0 -107
  1272. package/dist/question/__tests__/policy.test.js.map +0 -1
  1273. package/dist/question/__tests__/renderer.test.d.ts +0 -2
  1274. package/dist/question/__tests__/renderer.test.d.ts.map +0 -1
  1275. package/dist/question/__tests__/renderer.test.js +0 -707
  1276. package/dist/question/__tests__/renderer.test.js.map +0 -1
  1277. package/dist/question/__tests__/state.test.d.ts +0 -2
  1278. package/dist/question/__tests__/state.test.d.ts.map +0 -1
  1279. package/dist/question/__tests__/state.test.js +0 -102
  1280. package/dist/question/__tests__/state.test.js.map +0 -1
  1281. package/dist/question/__tests__/types.test.d.ts +0 -2
  1282. package/dist/question/__tests__/types.test.d.ts.map +0 -1
  1283. package/dist/question/__tests__/types.test.js +0 -65
  1284. package/dist/question/__tests__/types.test.js.map +0 -1
  1285. package/dist/question/__tests__/ui.test.d.ts +0 -2
  1286. package/dist/question/__tests__/ui.test.d.ts.map +0 -1
  1287. package/dist/question/__tests__/ui.test.js +0 -446
  1288. package/dist/question/__tests__/ui.test.js.map +0 -1
  1289. package/dist/ralph/__tests__/persistence.test.d.ts +0 -2
  1290. package/dist/ralph/__tests__/persistence.test.d.ts.map +0 -1
  1291. package/dist/ralph/__tests__/persistence.test.js +0 -116
  1292. package/dist/ralph/__tests__/persistence.test.js.map +0 -1
  1293. package/dist/ralph/contract.d.ts +0 -17
  1294. package/dist/ralph/persistence.js.map +0 -1
  1295. package/dist/ralplan/__tests__/runtime.test.d.ts +0 -2
  1296. package/dist/ralplan/__tests__/runtime.test.d.ts.map +0 -1
  1297. package/dist/ralplan/__tests__/runtime.test.js +0 -165
  1298. package/dist/ralplan/__tests__/runtime.test.js.map +0 -1
  1299. package/dist/ralplan/runtime.d.ts +0 -52
  1300. package/dist/ralplan/runtime.d.ts.map +0 -1
  1301. package/dist/ralplan/runtime.js.map +0 -1
  1302. package/dist/runtime/__tests__/bridge.test.d.ts +0 -2
  1303. package/dist/runtime/__tests__/bridge.test.d.ts.map +0 -1
  1304. package/dist/runtime/__tests__/bridge.test.js +0 -194
  1305. package/dist/runtime/__tests__/bridge.test.js.map +0 -1
  1306. package/dist/runtime/__tests__/run-loop.test.d.ts +0 -2
  1307. package/dist/runtime/__tests__/run-loop.test.d.ts.map +0 -1
  1308. package/dist/runtime/__tests__/run-loop.test.js +0 -35
  1309. package/dist/runtime/__tests__/run-loop.test.js.map +0 -1
  1310. package/dist/runtime/__tests__/run-outcome.test.d.ts +0 -2
  1311. package/dist/runtime/__tests__/run-outcome.test.d.ts.map +0 -1
  1312. package/dist/runtime/__tests__/run-outcome.test.js +0 -102
  1313. package/dist/runtime/__tests__/run-outcome.test.js.map +0 -1
  1314. package/dist/runtime/__tests__/run-state.test.d.ts +0 -2
  1315. package/dist/runtime/__tests__/run-state.test.d.ts.map +0 -1
  1316. package/dist/runtime/__tests__/run-state.test.js +0 -37
  1317. package/dist/runtime/__tests__/run-state.test.js.map +0 -1
  1318. package/dist/scripts/__tests__/codex-native-hook.test.d.ts +0 -2
  1319. package/dist/scripts/__tests__/codex-native-hook.test.d.ts.map +0 -1
  1320. package/dist/scripts/__tests__/codex-native-hook.test.js +0 -6788
  1321. package/dist/scripts/__tests__/codex-native-hook.test.js.map +0 -1
  1322. package/dist/scripts/__tests__/generate-release-body.test.d.ts +0 -2
  1323. package/dist/scripts/__tests__/generate-release-body.test.d.ts.map +0 -1
  1324. package/dist/scripts/__tests__/generate-release-body.test.js +0 -233
  1325. package/dist/scripts/__tests__/generate-release-body.test.js.map +0 -1
  1326. package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts +0 -2
  1327. package/dist/scripts/__tests__/hook-derived-watcher.test.d.ts.map +0 -1
  1328. package/dist/scripts/__tests__/hook-derived-watcher.test.js +0 -195
  1329. package/dist/scripts/__tests__/hook-derived-watcher.test.js.map +0 -1
  1330. package/dist/scripts/__tests__/postinstall.test.d.ts +0 -2
  1331. package/dist/scripts/__tests__/postinstall.test.d.ts.map +0 -1
  1332. package/dist/scripts/__tests__/postinstall.test.js +0 -92
  1333. package/dist/scripts/__tests__/postinstall.test.js.map +0 -1
  1334. package/dist/scripts/__tests__/prompt-inventory.test.d.ts +0 -2
  1335. package/dist/scripts/__tests__/prompt-inventory.test.d.ts.map +0 -1
  1336. package/dist/scripts/__tests__/prompt-inventory.test.js +0 -56
  1337. package/dist/scripts/__tests__/prompt-inventory.test.js.map +0 -1
  1338. package/dist/scripts/__tests__/run-test-files.test.d.ts +0 -2
  1339. package/dist/scripts/__tests__/run-test-files.test.d.ts.map +0 -1
  1340. package/dist/scripts/__tests__/run-test-files.test.js +0 -62
  1341. package/dist/scripts/__tests__/run-test-files.test.js.map +0 -1
  1342. package/dist/scripts/__tests__/smoke-packed-install.test.d.ts +0 -2
  1343. package/dist/scripts/__tests__/smoke-packed-install.test.d.ts.map +0 -1
  1344. package/dist/scripts/__tests__/smoke-packed-install.test.js +0 -135
  1345. package/dist/scripts/__tests__/smoke-packed-install.test.js.map +0 -1
  1346. package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts +0 -2
  1347. package/dist/scripts/__tests__/test-reply-listener-live.test.d.ts.map +0 -1
  1348. package/dist/scripts/__tests__/test-reply-listener-live.test.js +0 -82
  1349. package/dist/scripts/__tests__/test-reply-listener-live.test.js.map +0 -1
  1350. package/dist/scripts/__tests__/verify-native-agents.test.d.ts +0 -2
  1351. package/dist/scripts/__tests__/verify-native-agents.test.d.ts.map +0 -1
  1352. package/dist/scripts/__tests__/verify-native-agents.test.js +0 -166
  1353. package/dist/scripts/__tests__/verify-native-agents.test.js.map +0 -1
  1354. package/dist/scripts/eval/eval-candidate-handoff.d.ts +0 -2
  1355. package/dist/scripts/eval/eval-candidate-handoff.d.ts.map +0 -1
  1356. package/dist/scripts/eval/eval-candidate-handoff.js +0 -11
  1357. package/dist/scripts/eval/eval-candidate-handoff.js.map +0 -1
  1358. package/dist/scripts/eval/eval-cli-discoverability.d.ts +0 -3
  1359. package/dist/scripts/eval/eval-cli-discoverability.d.ts.map +0 -1
  1360. package/dist/scripts/eval/eval-cli-discoverability.js +0 -37
  1361. package/dist/scripts/eval/eval-cli-discoverability.js.map +0 -1
  1362. package/dist/scripts/eval/eval-fresh-run-tagging.d.ts +0 -2
  1363. package/dist/scripts/eval/eval-fresh-run-tagging.d.ts.map +0 -1
  1364. package/dist/scripts/eval/eval-fresh-run-tagging.js +0 -11
  1365. package/dist/scripts/eval/eval-fresh-run-tagging.js.map +0 -1
  1366. package/dist/scripts/eval/eval-help-consistency.d.ts +0 -2
  1367. package/dist/scripts/eval/eval-help-consistency.d.ts.map +0 -1
  1368. package/dist/scripts/eval/eval-help-consistency.js +0 -12
  1369. package/dist/scripts/eval/eval-help-consistency.js.map +0 -1
  1370. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts +0 -2
  1371. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.d.ts.map +0 -1
  1372. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js +0 -31
  1373. package/dist/scripts/eval/eval-in-action-cat-shellout-demo.js.map +0 -1
  1374. package/dist/scripts/eval/eval-parity-smoke.d.ts +0 -2
  1375. package/dist/scripts/eval/eval-parity-smoke.d.ts.map +0 -1
  1376. package/dist/scripts/eval/eval-parity-smoke.js +0 -23
  1377. package/dist/scripts/eval/eval-parity-smoke.js.map +0 -1
  1378. package/dist/scripts/eval/eval-parity-sweep.d.ts +0 -2
  1379. package/dist/scripts/eval/eval-parity-sweep.d.ts.map +0 -1
  1380. package/dist/scripts/eval/eval-parity-sweep.js +0 -29
  1381. package/dist/scripts/eval/eval-parity-sweep.js.map +0 -1
  1382. package/dist/scripts/eval/eval-resume-dirty-guard.d.ts +0 -2
  1383. package/dist/scripts/eval/eval-resume-dirty-guard.d.ts.map +0 -1
  1384. package/dist/scripts/eval/eval-resume-dirty-guard.js +0 -11
  1385. package/dist/scripts/eval/eval-resume-dirty-guard.js.map +0 -1
  1386. package/dist/scripts/eval/eval-security-path-traversal.d.ts +0 -3
  1387. package/dist/scripts/eval/eval-security-path-traversal.d.ts.map +0 -1
  1388. package/dist/scripts/eval/eval-security-path-traversal.js +0 -35
  1389. package/dist/scripts/eval/eval-security-path-traversal.js.map +0 -1
  1390. package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts +0 -2
  1391. package/dist/scripts/notify-hook/__tests__/operational-events.test.d.ts.map +0 -1
  1392. package/dist/scripts/notify-hook/__tests__/operational-events.test.js +0 -24
  1393. package/dist/scripts/notify-hook/__tests__/operational-events.test.js.map +0 -1
  1394. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts +0 -2
  1395. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.d.ts.map +0 -1
  1396. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js +0 -153
  1397. package/dist/scripts/notify-hook/__tests__/team-worker-posttooluse.test.js.map +0 -1
  1398. package/dist/scripts/notify-hook/ralph-session-resume.d.ts +0 -22
  1399. package/dist/session-history/__tests__/search.test.d.ts +0 -2
  1400. package/dist/session-history/__tests__/search.test.d.ts.map +0 -1
  1401. package/dist/session-history/__tests__/search.test.js +0 -150
  1402. package/dist/session-history/__tests__/search.test.js.map +0 -1
  1403. package/dist/sidecar/__tests__/boundary.test.d.ts +0 -2
  1404. package/dist/sidecar/__tests__/boundary.test.d.ts.map +0 -1
  1405. package/dist/sidecar/__tests__/boundary.test.js +0 -48
  1406. package/dist/sidecar/__tests__/boundary.test.js.map +0 -1
  1407. package/dist/sidecar/__tests__/collector.test.d.ts +0 -2
  1408. package/dist/sidecar/__tests__/collector.test.d.ts.map +0 -1
  1409. package/dist/sidecar/__tests__/collector.test.js +0 -162
  1410. package/dist/sidecar/__tests__/collector.test.js.map +0 -1
  1411. package/dist/sidecar/__tests__/render.test.d.ts +0 -2
  1412. package/dist/sidecar/__tests__/render.test.d.ts.map +0 -1
  1413. package/dist/sidecar/__tests__/render.test.js +0 -67
  1414. package/dist/sidecar/__tests__/render.test.js.map +0 -1
  1415. package/dist/sidecar/__tests__/tmux.test.d.ts +0 -2
  1416. package/dist/sidecar/__tests__/tmux.test.d.ts.map +0 -1
  1417. package/dist/sidecar/__tests__/tmux.test.js +0 -30
  1418. package/dist/sidecar/__tests__/tmux.test.js.map +0 -1
  1419. package/dist/sidecar/__tests__/watch.test.d.ts +0 -2
  1420. package/dist/sidecar/__tests__/watch.test.d.ts.map +0 -1
  1421. package/dist/sidecar/__tests__/watch.test.js +0 -42
  1422. package/dist/sidecar/__tests__/watch.test.js.map +0 -1
  1423. package/dist/state/__tests__/mode-state-context.test.d.ts +0 -2
  1424. package/dist/state/__tests__/mode-state-context.test.d.ts.map +0 -1
  1425. package/dist/state/__tests__/mode-state-context.test.js +0 -35
  1426. package/dist/state/__tests__/mode-state-context.test.js.map +0 -1
  1427. package/dist/state/__tests__/operations-ralph-phase.test.d.ts +0 -2
  1428. package/dist/state/__tests__/operations-ralph-phase.test.d.ts.map +0 -1
  1429. package/dist/state/__tests__/operations-ralph-phase.test.js +0 -103
  1430. package/dist/state/__tests__/operations-ralph-phase.test.js.map +0 -1
  1431. package/dist/state/__tests__/operations.test.d.ts +0 -2
  1432. package/dist/state/__tests__/operations.test.d.ts.map +0 -1
  1433. package/dist/state/__tests__/operations.test.js +0 -439
  1434. package/dist/state/__tests__/operations.test.js.map +0 -1
  1435. package/dist/state/__tests__/path-traversal.test.d.ts +0 -2
  1436. package/dist/state/__tests__/path-traversal.test.d.ts.map +0 -1
  1437. package/dist/state/__tests__/path-traversal.test.js +0 -49
  1438. package/dist/state/__tests__/path-traversal.test.js.map +0 -1
  1439. package/dist/state/__tests__/skill-active.test.d.ts +0 -2
  1440. package/dist/state/__tests__/skill-active.test.d.ts.map +0 -1
  1441. package/dist/state/__tests__/skill-active.test.js +0 -160
  1442. package/dist/state/__tests__/skill-active.test.js.map +0 -1
  1443. package/dist/state/__tests__/workflow-transition.test.d.ts +0 -2
  1444. package/dist/state/__tests__/workflow-transition.test.d.ts.map +0 -1
  1445. package/dist/state/__tests__/workflow-transition.test.js +0 -77
  1446. package/dist/state/__tests__/workflow-transition.test.js.map +0 -1
  1447. package/dist/subagents/__tests__/tracker.test.d.ts +0 -2
  1448. package/dist/subagents/__tests__/tracker.test.d.ts.map +0 -1
  1449. package/dist/subagents/__tests__/tracker.test.js +0 -47
  1450. package/dist/subagents/__tests__/tracker.test.js.map +0 -1
  1451. package/dist/team/__tests__/allocation-policy.test.d.ts +0 -2
  1452. package/dist/team/__tests__/allocation-policy.test.d.ts.map +0 -1
  1453. package/dist/team/__tests__/allocation-policy.test.js +0 -111
  1454. package/dist/team/__tests__/allocation-policy.test.js.map +0 -1
  1455. package/dist/team/__tests__/api-interop.test.d.ts +0 -2
  1456. package/dist/team/__tests__/api-interop.test.d.ts.map +0 -1
  1457. package/dist/team/__tests__/api-interop.test.js +0 -2262
  1458. package/dist/team/__tests__/api-interop.test.js.map +0 -1
  1459. package/dist/team/__tests__/commit-hygiene.test.d.ts +0 -2
  1460. package/dist/team/__tests__/commit-hygiene.test.d.ts.map +0 -1
  1461. package/dist/team/__tests__/commit-hygiene.test.js +0 -93
  1462. package/dist/team/__tests__/commit-hygiene.test.js.map +0 -1
  1463. package/dist/team/__tests__/cross-rebase-smoke.test.d.ts +0 -2
  1464. package/dist/team/__tests__/cross-rebase-smoke.test.d.ts.map +0 -1
  1465. package/dist/team/__tests__/cross-rebase-smoke.test.js +0 -161
  1466. package/dist/team/__tests__/cross-rebase-smoke.test.js.map +0 -1
  1467. package/dist/team/__tests__/current-task-baseline.test.d.ts +0 -2
  1468. package/dist/team/__tests__/current-task-baseline.test.d.ts.map +0 -1
  1469. package/dist/team/__tests__/current-task-baseline.test.js +0 -87
  1470. package/dist/team/__tests__/current-task-baseline.test.js.map +0 -1
  1471. package/dist/team/__tests__/delegation-policy.test.d.ts +0 -2
  1472. package/dist/team/__tests__/delegation-policy.test.d.ts.map +0 -1
  1473. package/dist/team/__tests__/delegation-policy.test.js +0 -69
  1474. package/dist/team/__tests__/delegation-policy.test.js.map +0 -1
  1475. package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts +0 -2
  1476. package/dist/team/__tests__/delivery-e2e-smoke.test.d.ts.map +0 -1
  1477. package/dist/team/__tests__/delivery-e2e-smoke.test.js +0 -679
  1478. package/dist/team/__tests__/delivery-e2e-smoke.test.js.map +0 -1
  1479. package/dist/team/__tests__/events.test.d.ts +0 -2
  1480. package/dist/team/__tests__/events.test.d.ts.map +0 -1
  1481. package/dist/team/__tests__/events.test.js +0 -313
  1482. package/dist/team/__tests__/events.test.js.map +0 -1
  1483. package/dist/team/__tests__/followup-planner.test.d.ts +0 -2
  1484. package/dist/team/__tests__/followup-planner.test.d.ts.map +0 -1
  1485. package/dist/team/__tests__/followup-planner.test.js +0 -84
  1486. package/dist/team/__tests__/followup-planner.test.js.map +0 -1
  1487. package/dist/team/__tests__/hardening-e2e.test.d.ts +0 -2
  1488. package/dist/team/__tests__/hardening-e2e.test.d.ts.map +0 -1
  1489. package/dist/team/__tests__/hardening-e2e.test.js +0 -98
  1490. package/dist/team/__tests__/hardening-e2e.test.js.map +0 -1
  1491. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts +0 -2
  1492. package/dist/team/__tests__/hook-primary-e2e-contract.test.d.ts.map +0 -1
  1493. package/dist/team/__tests__/hook-primary-e2e-contract.test.js +0 -78
  1494. package/dist/team/__tests__/hook-primary-e2e-contract.test.js.map +0 -1
  1495. package/dist/team/__tests__/idle-nudge.test.d.ts +0 -2
  1496. package/dist/team/__tests__/idle-nudge.test.d.ts.map +0 -1
  1497. package/dist/team/__tests__/idle-nudge.test.js +0 -230
  1498. package/dist/team/__tests__/idle-nudge.test.js.map +0 -1
  1499. package/dist/team/__tests__/leader-activity.test.d.ts +0 -2
  1500. package/dist/team/__tests__/leader-activity.test.d.ts.map +0 -1
  1501. package/dist/team/__tests__/leader-activity.test.js +0 -261
  1502. package/dist/team/__tests__/leader-activity.test.js.map +0 -1
  1503. package/dist/team/__tests__/mcp-comm.test.d.ts +0 -2
  1504. package/dist/team/__tests__/mcp-comm.test.d.ts.map +0 -1
  1505. package/dist/team/__tests__/mcp-comm.test.js +0 -289
  1506. package/dist/team/__tests__/mcp-comm.test.js.map +0 -1
  1507. package/dist/team/__tests__/model-contract.test.d.ts +0 -2
  1508. package/dist/team/__tests__/model-contract.test.d.ts.map +0 -1
  1509. package/dist/team/__tests__/model-contract.test.js +0 -171
  1510. package/dist/team/__tests__/model-contract.test.js.map +0 -1
  1511. package/dist/team/__tests__/orchestrator.test.d.ts +0 -2
  1512. package/dist/team/__tests__/orchestrator.test.d.ts.map +0 -1
  1513. package/dist/team/__tests__/orchestrator.test.js +0 -111
  1514. package/dist/team/__tests__/orchestrator.test.js.map +0 -1
  1515. package/dist/team/__tests__/phase-controller.test.d.ts +0 -2
  1516. package/dist/team/__tests__/phase-controller.test.d.ts.map +0 -1
  1517. package/dist/team/__tests__/phase-controller.test.js +0 -50
  1518. package/dist/team/__tests__/phase-controller.test.js.map +0 -1
  1519. package/dist/team/__tests__/rebalance-policy.test.d.ts +0 -2
  1520. package/dist/team/__tests__/rebalance-policy.test.d.ts.map +0 -1
  1521. package/dist/team/__tests__/rebalance-policy.test.js +0 -168
  1522. package/dist/team/__tests__/rebalance-policy.test.js.map +0 -1
  1523. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts +0 -2
  1524. package/dist/team/__tests__/repo-aware-decomposition.test.d.ts.map +0 -1
  1525. package/dist/team/__tests__/repo-aware-decomposition.test.js +0 -136
  1526. package/dist/team/__tests__/repo-aware-decomposition.test.js.map +0 -1
  1527. package/dist/team/__tests__/role-router.test.d.ts +0 -2
  1528. package/dist/team/__tests__/role-router.test.d.ts.map +0 -1
  1529. package/dist/team/__tests__/role-router.test.js +0 -263
  1530. package/dist/team/__tests__/role-router.test.js.map +0 -1
  1531. package/dist/team/__tests__/runtime-cli.test.d.ts +0 -2
  1532. package/dist/team/__tests__/runtime-cli.test.d.ts.map +0 -1
  1533. package/dist/team/__tests__/runtime-cli.test.js +0 -304
  1534. package/dist/team/__tests__/runtime-cli.test.js.map +0 -1
  1535. package/dist/team/__tests__/runtime.test.d.ts +0 -2
  1536. package/dist/team/__tests__/runtime.test.d.ts.map +0 -1
  1537. package/dist/team/__tests__/runtime.test.js +0 -5734
  1538. package/dist/team/__tests__/runtime.test.js.map +0 -1
  1539. package/dist/team/__tests__/scaling.test.d.ts +0 -2
  1540. package/dist/team/__tests__/scaling.test.d.ts.map +0 -1
  1541. package/dist/team/__tests__/scaling.test.js +0 -1005
  1542. package/dist/team/__tests__/scaling.test.js.map +0 -1
  1543. package/dist/team/__tests__/shutdown-fallback.test.d.ts +0 -2
  1544. package/dist/team/__tests__/shutdown-fallback.test.d.ts.map +0 -1
  1545. package/dist/team/__tests__/shutdown-fallback.test.js +0 -125
  1546. package/dist/team/__tests__/shutdown-fallback.test.js.map +0 -1
  1547. package/dist/team/__tests__/state-root.test.d.ts +0 -2
  1548. package/dist/team/__tests__/state-root.test.d.ts.map +0 -1
  1549. package/dist/team/__tests__/state-root.test.js +0 -195
  1550. package/dist/team/__tests__/state-root.test.js.map +0 -1
  1551. package/dist/team/__tests__/state.test.d.ts +0 -2
  1552. package/dist/team/__tests__/state.test.d.ts.map +0 -1
  1553. package/dist/team/__tests__/state.test.js +0 -1859
  1554. package/dist/team/__tests__/state.test.js.map +0 -1
  1555. package/dist/team/__tests__/team-identity.test.d.ts +0 -2
  1556. package/dist/team/__tests__/team-identity.test.d.ts.map +0 -1
  1557. package/dist/team/__tests__/team-identity.test.js +0 -166
  1558. package/dist/team/__tests__/team-identity.test.js.map +0 -1
  1559. package/dist/team/__tests__/team-ops-contract.test.d.ts +0 -2
  1560. package/dist/team/__tests__/team-ops-contract.test.d.ts.map +0 -1
  1561. package/dist/team/__tests__/team-ops-contract.test.js +0 -96
  1562. package/dist/team/__tests__/team-ops-contract.test.js.map +0 -1
  1563. package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts +0 -2
  1564. package/dist/team/__tests__/tmux-claude-workers-demo.test.d.ts.map +0 -1
  1565. package/dist/team/__tests__/tmux-claude-workers-demo.test.js +0 -191
  1566. package/dist/team/__tests__/tmux-claude-workers-demo.test.js.map +0 -1
  1567. package/dist/team/__tests__/tmux-session.test.d.ts +0 -2
  1568. package/dist/team/__tests__/tmux-session.test.d.ts.map +0 -1
  1569. package/dist/team/__tests__/tmux-session.test.js +0 -3785
  1570. package/dist/team/__tests__/tmux-session.test.js.map +0 -1
  1571. package/dist/team/__tests__/tmux-test-fixture.d.ts +0 -20
  1572. package/dist/team/__tests__/tmux-test-fixture.d.ts.map +0 -1
  1573. package/dist/team/__tests__/tmux-test-fixture.js +0 -152
  1574. package/dist/team/__tests__/tmux-test-fixture.js.map +0 -1
  1575. package/dist/team/__tests__/tmux-test-fixture.test.d.ts +0 -2
  1576. package/dist/team/__tests__/tmux-test-fixture.test.d.ts.map +0 -1
  1577. package/dist/team/__tests__/tmux-test-fixture.test.js +0 -113
  1578. package/dist/team/__tests__/tmux-test-fixture.test.js.map +0 -1
  1579. package/dist/team/__tests__/worker-bootstrap.test.d.ts +0 -2
  1580. package/dist/team/__tests__/worker-bootstrap.test.d.ts.map +0 -1
  1581. package/dist/team/__tests__/worker-bootstrap.test.js +0 -685
  1582. package/dist/team/__tests__/worker-bootstrap.test.js.map +0 -1
  1583. package/dist/team/__tests__/worker-runtime-identity.test.d.ts +0 -2
  1584. package/dist/team/__tests__/worker-runtime-identity.test.d.ts.map +0 -1
  1585. package/dist/team/__tests__/worker-runtime-identity.test.js +0 -250
  1586. package/dist/team/__tests__/worker-runtime-identity.test.js.map +0 -1
  1587. package/dist/team/__tests__/worktree.test.d.ts +0 -2
  1588. package/dist/team/__tests__/worktree.test.d.ts.map +0 -1
  1589. package/dist/team/__tests__/worktree.test.js +0 -317
  1590. package/dist/team/__tests__/worktree.test.js.map +0 -1
  1591. package/dist/utils/__tests__/agents-md.test.d.ts +0 -2
  1592. package/dist/utils/__tests__/agents-md.test.d.ts.map +0 -1
  1593. package/dist/utils/__tests__/agents-md.test.js +0 -52
  1594. package/dist/utils/__tests__/agents-md.test.js.map +0 -1
  1595. package/dist/utils/__tests__/agents-model-table.test.d.ts +0 -2
  1596. package/dist/utils/__tests__/agents-model-table.test.d.ts.map +0 -1
  1597. package/dist/utils/__tests__/agents-model-table.test.js +0 -104
  1598. package/dist/utils/__tests__/agents-model-table.test.js.map +0 -1
  1599. package/dist/utils/__tests__/dep-versions.test.d.ts +0 -2
  1600. package/dist/utils/__tests__/dep-versions.test.d.ts.map +0 -1
  1601. package/dist/utils/__tests__/dep-versions.test.js +0 -46
  1602. package/dist/utils/__tests__/dep-versions.test.js.map +0 -1
  1603. package/dist/utils/__tests__/package.test.d.ts +0 -2
  1604. package/dist/utils/__tests__/package.test.d.ts.map +0 -1
  1605. package/dist/utils/__tests__/package.test.js +0 -21
  1606. package/dist/utils/__tests__/package.test.js.map +0 -1
  1607. package/dist/utils/__tests__/paths.test.d.ts +0 -2
  1608. package/dist/utils/__tests__/paths.test.d.ts.map +0 -1
  1609. package/dist/utils/__tests__/paths.test.js +0 -541
  1610. package/dist/utils/__tests__/paths.test.js.map +0 -1
  1611. package/dist/utils/__tests__/platform-command.test.d.ts +0 -2
  1612. package/dist/utils/__tests__/platform-command.test.d.ts.map +0 -1
  1613. package/dist/utils/__tests__/platform-command.test.js +0 -410
  1614. package/dist/utils/__tests__/platform-command.test.js.map +0 -1
  1615. package/dist/utils/__tests__/repo-deps.test.d.ts +0 -2
  1616. package/dist/utils/__tests__/repo-deps.test.d.ts.map +0 -1
  1617. package/dist/utils/__tests__/repo-deps.test.js +0 -71
  1618. package/dist/utils/__tests__/repo-deps.test.js.map +0 -1
  1619. package/dist/verification/__tests__/ci-rust-gates.test.d.ts +0 -2
  1620. package/dist/verification/__tests__/ci-rust-gates.test.d.ts.map +0 -1
  1621. package/dist/verification/__tests__/ci-rust-gates.test.js +0 -89
  1622. package/dist/verification/__tests__/ci-rust-gates.test.js.map +0 -1
  1623. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts +0 -2
  1624. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.d.ts.map +0 -1
  1625. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js +0 -54
  1626. package/dist/verification/__tests__/dev-merge-issue-close-workflow.test.js.map +0 -1
  1627. package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts +0 -2
  1628. package/dist/verification/__tests__/explore-harness-release-workflow.test.d.ts.map +0 -1
  1629. package/dist/verification/__tests__/explore-harness-release-workflow.test.js +0 -73
  1630. package/dist/verification/__tests__/explore-harness-release-workflow.test.js.map +0 -1
  1631. package/dist/verification/__tests__/native-release-manifest.test.d.ts +0 -2
  1632. package/dist/verification/__tests__/native-release-manifest.test.d.ts.map +0 -1
  1633. package/dist/verification/__tests__/native-release-manifest.test.js +0 -80
  1634. package/dist/verification/__tests__/native-release-manifest.test.js.map +0 -1
  1635. package/dist/verification/__tests__/pr-check-workflow.test.d.ts +0 -2
  1636. package/dist/verification/__tests__/pr-check-workflow.test.d.ts.map +0 -1
  1637. package/dist/verification/__tests__/pr-check-workflow.test.js +0 -27
  1638. package/dist/verification/__tests__/pr-check-workflow.test.js.map +0 -1
  1639. package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts +0 -2
  1640. package/dist/verification/__tests__/ralph-persistence-gate.test.d.ts.map +0 -1
  1641. package/dist/verification/__tests__/ralph-persistence-gate.test.js +0 -55
  1642. package/dist/verification/__tests__/ralph-persistence-gate.test.js.map +0 -1
  1643. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts +0 -2
  1644. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.d.ts.map +0 -1
  1645. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js +0 -32
  1646. package/dist/verification/__tests__/rust-runtime-thin-adapter-gate.test.js.map +0 -1
  1647. package/dist/verification/__tests__/verifier.test.d.ts +0 -2
  1648. package/dist/verification/__tests__/verifier.test.d.ts.map +0 -1
  1649. package/dist/verification/__tests__/verifier.test.js +0 -113
  1650. package/dist/verification/__tests__/verifier.test.js.map +0 -1
  1651. package/dist/visual/__tests__/verdict.test.d.ts +0 -2
  1652. package/dist/visual/__tests__/verdict.test.d.ts.map +0 -1
  1653. package/dist/visual/__tests__/verdict.test.js +0 -81
  1654. package/dist/visual/__tests__/verdict.test.js.map +0 -1
  1655. package/dist/wiki/__tests__/cjk-tokenize.test.d.ts +0 -12
  1656. package/dist/wiki/__tests__/cjk-tokenize.test.d.ts.map +0 -1
  1657. package/dist/wiki/__tests__/cjk-tokenize.test.js +0 -139
  1658. package/dist/wiki/__tests__/cjk-tokenize.test.js.map +0 -1
  1659. package/dist/wiki/__tests__/crlf-parse.test.d.ts +0 -2
  1660. package/dist/wiki/__tests__/crlf-parse.test.d.ts.map +0 -1
  1661. package/dist/wiki/__tests__/crlf-parse.test.js +0 -24
  1662. package/dist/wiki/__tests__/crlf-parse.test.js.map +0 -1
  1663. package/dist/wiki/__tests__/escape-newline.test.d.ts +0 -2
  1664. package/dist/wiki/__tests__/escape-newline.test.d.ts.map +0 -1
  1665. package/dist/wiki/__tests__/escape-newline.test.js +0 -45
  1666. package/dist/wiki/__tests__/escape-newline.test.js.map +0 -1
  1667. package/dist/wiki/__tests__/ingest.test.d.ts +0 -5
  1668. package/dist/wiki/__tests__/ingest.test.d.ts.map +0 -1
  1669. package/dist/wiki/__tests__/ingest.test.js +0 -181
  1670. package/dist/wiki/__tests__/ingest.test.js.map +0 -1
  1671. package/dist/wiki/__tests__/lint.test.d.ts +0 -5
  1672. package/dist/wiki/__tests__/lint.test.d.ts.map +0 -1
  1673. package/dist/wiki/__tests__/lint.test.js +0 -163
  1674. package/dist/wiki/__tests__/lint.test.js.map +0 -1
  1675. package/dist/wiki/__tests__/query.test.d.ts +0 -5
  1676. package/dist/wiki/__tests__/query.test.d.ts.map +0 -1
  1677. package/dist/wiki/__tests__/query.test.js +0 -141
  1678. package/dist/wiki/__tests__/query.test.js.map +0 -1
  1679. package/dist/wiki/__tests__/reserved-file-guard.test.d.ts +0 -2
  1680. package/dist/wiki/__tests__/reserved-file-guard.test.d.ts.map +0 -1
  1681. package/dist/wiki/__tests__/reserved-file-guard.test.js +0 -44
  1682. package/dist/wiki/__tests__/reserved-file-guard.test.js.map +0 -1
  1683. package/dist/wiki/__tests__/session-hooks.test.d.ts +0 -5
  1684. package/dist/wiki/__tests__/session-hooks.test.d.ts.map +0 -1
  1685. package/dist/wiki/__tests__/session-hooks.test.js +0 -36
  1686. package/dist/wiki/__tests__/session-hooks.test.js.map +0 -1
  1687. package/dist/wiki/__tests__/slug-nonascii.test.d.ts +0 -2
  1688. package/dist/wiki/__tests__/slug-nonascii.test.d.ts.map +0 -1
  1689. package/dist/wiki/__tests__/slug-nonascii.test.js +0 -30
  1690. package/dist/wiki/__tests__/slug-nonascii.test.js.map +0 -1
  1691. package/dist/wiki/__tests__/storage.test.d.ts +0 -5
  1692. package/dist/wiki/__tests__/storage.test.d.ts.map +0 -1
  1693. package/dist/wiki/__tests__/storage.test.js +0 -278
  1694. package/dist/wiki/__tests__/storage.test.js.map +0 -1
  1695. package/dist/wiki/__tests__/test-helpers.d.ts +0 -31
  1696. package/dist/wiki/__tests__/test-helpers.d.ts.map +0 -1
  1697. package/dist/wiki/__tests__/test-helpers.js +0 -108
  1698. package/dist/wiki/__tests__/test-helpers.js.map +0 -1
  1699. package/docs/contracts/ralph-cancel-contract.md +0 -23
  1700. package/docs/contracts/ralph-state-contract.md +0 -95
  1701. package/docs/issues/team-ralph-followup-team.md +0 -38
  1702. package/docs/qa/ralph-persistence-gate.md +0 -59
  1703. package/docs/reference/ralph-parity-matrix.md +0 -25
  1704. package/docs/reference/ralph-upstream-baseline.md +0 -34
  1705. package/plugins/roblox-ai-os-creator-skills/skills/ralph/SKILL.md +0 -269
  1706. package/plugins/roblox-ai-os-creator-skills/skills/ralplan/SKILL.md +0 -162
  1707. package/prompts/api-reviewer.md +0 -113
  1708. package/prompts/information-architect.md +0 -226
  1709. package/prompts/performance-reviewer.md +0 -109
  1710. package/prompts/product-analyst.md +0 -304
  1711. package/prompts/product-manager.md +0 -245
  1712. package/prompts/qa-tester.md +0 -124
  1713. package/prompts/quality-reviewer.md +0 -123
  1714. package/prompts/quality-strategist.md +0 -274
  1715. package/prompts/style-reviewer.md +0 -102
  1716. package/prompts/ux-researcher.md +0 -327
  1717. package/skills/frontend-ui-ux/SKILL.md +0 -34
  1718. package/skills/ralph/SKILL.md +0 -269
  1719. package/skills/ralplan/SKILL.md +0 -162
  1720. package/src/scripts/eval/eval-adaptive-sort-optimization.py +0 -24
  1721. package/src/scripts/eval/eval-candidate-handoff.ts +0 -8
  1722. package/src/scripts/eval/eval-cli-discoverability.ts +0 -40
  1723. package/src/scripts/eval/eval-fresh-run-tagging.ts +0 -8
  1724. package/src/scripts/eval/eval-help-consistency.ts +0 -11
  1725. package/src/scripts/eval/eval-in-action-cat-shellout-demo.ts +0 -31
  1726. package/src/scripts/eval/eval-ml-kaggle-model-optimization.py +0 -29
  1727. package/src/scripts/eval/eval-noisy-bayesopt-highdim.py +0 -44
  1728. package/src/scripts/eval/eval-noisy-latent-subspace-discovery.py +0 -44
  1729. package/src/scripts/eval/eval-parity-smoke.ts +0 -20
  1730. package/src/scripts/eval/eval-parity-sweep.ts +0 -26
  1731. package/src/scripts/eval/eval-resume-dirty-guard.ts +0 -8
  1732. package/src/scripts/eval/eval-security-path-traversal.ts +0 -38
  1733. package/src/scripts/run-autoresearch-showcase.sh +0 -75
  1734. /package/docs/{migration-mainline-post-v0.4.4.md → archive/migration-mainline-post-v0.4.4.md} +0 -0
  1735. /package/docs/{qa-plan-0.4.2.md → archive/qa-plan-0.4.2.md} +0 -0
  1736. /package/docs/{qa-report-0.4.2.md → archive/qa-report-0.4.2.md} +0 -0
@@ -1,2262 +0,0 @@
1
- import { describe, it } from 'node:test';
2
- import assert from 'node:assert/strict';
3
- import { chmod, mkdtemp, rm, mkdir, readFile, writeFile } from 'node:fs/promises';
4
- import { join } from 'node:path';
5
- import { tmpdir } from 'node:os';
6
- import { resolveTeamApiOperation, buildLegacyTeamDeprecationHint, executeTeamApiOperation, LEGACY_TEAM_MCP_TOOLS, TEAM_API_OPERATIONS, } from '../api-interop.js';
7
- import { initTeamState, createTask, readTeamLeaderAttention, readTeamManifestV2, readTask, writeTeamLeaderAttention, writeTeamManifestV2, writeTeamPhase, sendDirectMessage, enqueueDispatchRequest, readDispatchRequest, listDispatchRequests, appendTeamEvent, markOwnedTeamsLeaderStopObserved, markOwnedTeamsLeaderSessionStopped, updateWorkerHeartbeat, writeMonitorSnapshot, writeWorkerStatus, } from '../state.js';
8
- async function setupTeam(name) {
9
- const cwd = await mkdtemp(join(tmpdir(), `rcs-interop-${name}-`));
10
- const previousTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
11
- delete process.env.RCS_TEAM_STATE_ROOT;
12
- await initTeamState(name, 'test task', 'executor', 2, cwd);
13
- return {
14
- cwd,
15
- cleanup: async () => {
16
- if (typeof previousTeamStateRoot === 'string')
17
- process.env.RCS_TEAM_STATE_ROOT = previousTeamStateRoot;
18
- else
19
- delete process.env.RCS_TEAM_STATE_ROOT;
20
- await rm(cwd, { recursive: true, force: true });
21
- },
22
- };
23
- }
24
- async function setupDisplayTeam(internalName, displayName, sessionId, workerCount = 2) {
25
- const cwd = await mkdtemp(join(tmpdir(), `rcs-interop-${internalName}-`));
26
- const previousTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
27
- const previousSessionId = process.env.RCS_SESSION_ID;
28
- delete process.env.RCS_TEAM_STATE_ROOT;
29
- process.env.RCS_SESSION_ID = sessionId;
30
- await initTeamState(internalName, 'display-name API test', 'executor', workerCount, cwd, undefined, {
31
- RCS_SESSION_ID: sessionId,
32
- }, {
33
- display_name: displayName,
34
- requested_name: displayName,
35
- identity_source: 'env-session',
36
- });
37
- return {
38
- cwd,
39
- cleanup: async () => {
40
- if (typeof previousTeamStateRoot === 'string')
41
- process.env.RCS_TEAM_STATE_ROOT = previousTeamStateRoot;
42
- else
43
- delete process.env.RCS_TEAM_STATE_ROOT;
44
- if (typeof previousSessionId === 'string')
45
- process.env.RCS_SESSION_ID = previousSessionId;
46
- else
47
- delete process.env.RCS_SESSION_ID;
48
- await rm(cwd, { recursive: true, force: true });
49
- },
50
- };
51
- }
52
- async function withMailboxCompatHoleRuntime(cwd, fn) {
53
- const fakeBin = join(cwd, 'runtime-bin');
54
- const runtimePath = join(fakeBin, 'rcs-runtime');
55
- const previousPath = process.env.PATH;
56
- const previousBinary = process.env.RCS_RUNTIME_BINARY;
57
- const previousBridge = process.env.RCS_RUNTIME_BRIDGE;
58
- await mkdir(fakeBin, { recursive: true });
59
- await writeFile(runtimePath, `#!/usr/bin/env node
60
- const fs = require('fs');
61
- const path = require('path');
62
- const argv = process.argv.slice(2);
63
- function argValue(prefix) {
64
- const entry = argv.find((value) => value.startsWith(prefix));
65
- return entry ? entry.slice(prefix.length) : null;
66
- }
67
- function stateDir() {
68
- return argValue('--state-dir=') || process.cwd();
69
- }
70
- function readJson(file, fallback) {
71
- try { return JSON.parse(fs.readFileSync(file, 'utf8')); } catch { return fallback; }
72
- }
73
- function writeJson(file, value) {
74
- fs.mkdirSync(path.dirname(file), { recursive: true });
75
- fs.writeFileSync(file, JSON.stringify(value, null, 2) + '\\n');
76
- }
77
- if (argv[0] === 'schema') {
78
- process.stdout.write(JSON.stringify({ schema_version: 1, commands: [], events: [], transport: 'tmux' }) + '\\n');
79
- process.exit(0);
80
- }
81
- if (argv[0] !== 'exec') process.exit(1);
82
- const command = JSON.parse(argv[1] || '{}');
83
- const dir = stateDir();
84
- if (command.command === 'CreateMailboxMessage') {
85
- writeJson(path.join(dir, 'mailbox.json'), readJson(path.join(dir, 'mailbox.json'), { records: [] }));
86
- process.stdout.write(JSON.stringify({ event: 'MailboxMessageCreated', message_id: command.message_id, from_worker: command.from_worker, to_worker: command.to_worker }) + '\\n');
87
- process.exit(0);
88
- }
89
- process.stdout.write(JSON.stringify({ event: 'ok' }) + '\\n');
90
- `, 'utf8');
91
- await chmod(runtimePath, 0o755);
92
- process.env.PATH = `${fakeBin}:${previousPath || ''}`;
93
- process.env.RCS_RUNTIME_BINARY = runtimePath;
94
- process.env.RCS_RUNTIME_BRIDGE = '1';
95
- try {
96
- return await fn();
97
- }
98
- finally {
99
- if (typeof previousPath === 'string')
100
- process.env.PATH = previousPath;
101
- else
102
- delete process.env.PATH;
103
- if (typeof previousBinary === 'string')
104
- process.env.RCS_RUNTIME_BINARY = previousBinary;
105
- else
106
- delete process.env.RCS_RUNTIME_BINARY;
107
- if (typeof previousBridge === 'string')
108
- process.env.RCS_RUNTIME_BRIDGE = previousBridge;
109
- else
110
- delete process.env.RCS_RUNTIME_BRIDGE;
111
- }
112
- }
113
- async function readTeamDeliveryLog(cwd) {
114
- const path = join(cwd, '.rcs', 'logs', `team-delivery-${new Date().toISOString().slice(0, 10)}.jsonl`);
115
- const raw = await readFile(path, 'utf-8').catch(() => '');
116
- return raw
117
- .split('\n')
118
- .map((line) => line.trim())
119
- .filter(Boolean)
120
- .map((line) => JSON.parse(line));
121
- }
122
- // ─── resolveTeamApiOperation ──────────────────────────────────────────────
123
- describe('resolveTeamApiOperation', () => {
124
- it('resolves a valid kebab-case operation', () => {
125
- assert.equal(resolveTeamApiOperation('send-message'), 'send-message');
126
- });
127
- it('normalizes legacy team_ prefix to kebab-case', () => {
128
- assert.equal(resolveTeamApiOperation('team_send_message'), 'send-message');
129
- });
130
- it('normalizes underscores to hyphens', () => {
131
- assert.equal(resolveTeamApiOperation('claim_task'), 'claim-task');
132
- });
133
- it('returns null for unknown operations', () => {
134
- assert.equal(resolveTeamApiOperation('nonexistent-op'), null);
135
- });
136
- it('returns null for empty string', () => {
137
- assert.equal(resolveTeamApiOperation(''), null);
138
- });
139
- it('handles whitespace and casing', () => {
140
- assert.equal(resolveTeamApiOperation(' SEND_MESSAGE '), 'send-message');
141
- });
142
- it('resolves all 33 operations from the operation list', () => {
143
- for (const op of TEAM_API_OPERATIONS) {
144
- assert.equal(resolveTeamApiOperation(op), op);
145
- }
146
- });
147
- });
148
- // ─── buildLegacyTeamDeprecationHint ───────────────────────────────────────
149
- describe('buildLegacyTeamDeprecationHint', () => {
150
- it('produces CLI hint with resolved operation name', () => {
151
- const hint = buildLegacyTeamDeprecationHint('team_send_message', { team_name: 'alpha' });
152
- assert.match(hint, /rcs team api send-message/);
153
- assert.match(hint, /"team_name":"alpha"/);
154
- });
155
- it('falls back to generic hint for unresolvable legacy name', () => {
156
- const hint = buildLegacyTeamDeprecationHint('team_nonexistent', { foo: 'bar' });
157
- assert.match(hint, /rcs team api <operation>/);
158
- });
159
- it('uses empty JSON when no args provided', () => {
160
- const hint = buildLegacyTeamDeprecationHint('team_list_tasks');
161
- assert.match(hint, /\{\}/);
162
- });
163
- });
164
- // ─── constants ────────────────────────────────────────────────────────────
165
- describe('LEGACY_TEAM_MCP_TOOLS', () => {
166
- it('contains 29 legacy tool names', () => {
167
- assert.equal(LEGACY_TEAM_MCP_TOOLS.length, 29);
168
- });
169
- it('all start with team_', () => {
170
- for (const name of LEGACY_TEAM_MCP_TOOLS) {
171
- assert.match(name, /^team_/);
172
- }
173
- });
174
- });
175
- describe('TEAM_API_OPERATIONS', () => {
176
- it('contains 33 operations', () => {
177
- assert.equal(TEAM_API_OPERATIONS.length, 33);
178
- });
179
- it('all use kebab-case', () => {
180
- for (const op of TEAM_API_OPERATIONS) {
181
- assert.doesNotMatch(op, /_/);
182
- }
183
- });
184
- });
185
- // ─── validateCommonFields (via executeTeamApiOperation) ───────────────────
186
- describe('validateCommonFields', () => {
187
- it('rejects invalid team_name pattern', async () => {
188
- const result = await executeTeamApiOperation('list-tasks', { team_name: 'INVALID CAPS!' }, '/tmp');
189
- assert.equal(result.ok, false);
190
- if (!result.ok) {
191
- assert.equal(result.error.code, 'operation_failed');
192
- assert.match(result.error.message, /Invalid team_name/);
193
- }
194
- });
195
- it('resolves a long display team_name before applying internal key validation', async () => {
196
- const cwd = await mkdtemp(join(tmpdir(), 'rcs-api-long-display-'));
197
- try {
198
- await initTeamState('long-display-aaaaaaaa', 'test task', 'executor', 1, cwd, undefined, { RCS_SESSION_ID: 'session-long' }, {
199
- display_name: 'this-is-a-long-display-name-that-exceeds-thirty-chars',
200
- requested_name: 'this-is-a-long-display-name-that-exceeds-thirty-chars',
201
- identity_source: 'env-session',
202
- });
203
- const previousSessionId = process.env.RCS_SESSION_ID;
204
- try {
205
- process.env.RCS_SESSION_ID = 'session-long';
206
- const result = await executeTeamApiOperation('list-tasks', {
207
- team_name: 'this-is-a-long-display-name-that-exceeds-thirty-chars',
208
- }, cwd);
209
- assert.equal(result.ok, true);
210
- if (result.ok)
211
- assert.equal(result.data.count, 0);
212
- }
213
- finally {
214
- if (previousSessionId === undefined)
215
- delete process.env.RCS_SESSION_ID;
216
- else
217
- process.env.RCS_SESSION_ID = previousSessionId;
218
- }
219
- }
220
- finally {
221
- await rm(cwd, { recursive: true, force: true });
222
- }
223
- });
224
- it('rejects invalid worker name pattern', async () => {
225
- const { cwd, cleanup } = await setupTeam('validate-worker');
226
- try {
227
- const result = await executeTeamApiOperation('read-worker-status', {
228
- team_name: 'validate-worker',
229
- worker: 'CAPS NOT ALLOWED!',
230
- }, cwd);
231
- assert.equal(result.ok, false);
232
- if (!result.ok) {
233
- assert.match(result.error.message, /Invalid worker/);
234
- }
235
- }
236
- finally {
237
- await cleanup();
238
- }
239
- });
240
- it('rejects invalid task_id pattern', async () => {
241
- const { cwd, cleanup } = await setupTeam('validate-task-id');
242
- try {
243
- const result = await executeTeamApiOperation('read-task', {
244
- team_name: 'validate-task-id',
245
- task_id: 'not-a-number',
246
- }, cwd);
247
- assert.equal(result.ok, false);
248
- if (!result.ok) {
249
- assert.match(result.error.message, /Invalid task_id/);
250
- }
251
- }
252
- finally {
253
- await cleanup();
254
- }
255
- });
256
- });
257
- // ─── send-message ─────────────────────────────────────────────────────────
258
- describe('executeTeamApiOperation: send-message', () => {
259
- it('sends a message successfully and enqueues mailbox dispatch delivery', async () => {
260
- const { cwd, cleanup } = await setupTeam('msg-team');
261
- try {
262
- const result = await executeTeamApiOperation('send-message', {
263
- team_name: 'msg-team',
264
- from_worker: 'worker-1',
265
- to_worker: 'worker-2',
266
- body: 'hello',
267
- }, cwd);
268
- assert.equal(result.ok, true);
269
- if (!result.ok)
270
- throw new Error('expected successful send-message result');
271
- assert.ok(result.data.message);
272
- const message = result.data.message;
273
- const messageId = String(message.message_id ?? '');
274
- assert.ok(messageId, 'message should include a message_id');
275
- const parsedRequests = await listDispatchRequests('msg-team', cwd, { kind: 'mailbox' });
276
- const mailboxRequest = parsedRequests.find((request) => request.message_id === messageId);
277
- assert.ok(mailboxRequest, 'send-message should enqueue a mailbox dispatch request');
278
- assert.equal(mailboxRequest?.to_worker, 'worker-2');
279
- const deliveryLog = await readTeamDeliveryLog(cwd);
280
- assert.ok(deliveryLog.some((entry) => entry.event === 'mailbox_created'
281
- && entry.message_id === messageId
282
- && entry.from_worker === 'worker-1'
283
- && entry.to_worker === 'worker-2'));
284
- assert.ok(deliveryLog.some((entry) => entry.event === 'dispatch_attempted'
285
- && entry.request_id === mailboxRequest?.request_id
286
- && entry.message_id === messageId
287
- && entry.to_worker === 'worker-2'));
288
- }
289
- finally {
290
- await cleanup();
291
- }
292
- });
293
- it('returns the persisted leader mailbox message when hook-targeted sends are deduped from a worker worktree', async () => {
294
- const teamName = 'msg-team-leader-dedupe';
295
- const repoCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-send-root-'));
296
- const workerCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-send-worktree-'));
297
- const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
298
- delete process.env.RCS_TEAM_STATE_ROOT;
299
- try {
300
- await initTeamState(teamName, 'leader mailbox dedupe', 'executor', 2, repoCwd);
301
- const configPath = join(repoCwd, '.rcs', 'state', 'team', teamName, 'config.json');
302
- const config = JSON.parse(await readFile(configPath, 'utf-8'));
303
- config.leader_pane_id = '%55';
304
- await writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
305
- const manifestPath = join(repoCwd, '.rcs', 'state', 'team', teamName, 'manifest.v2.json');
306
- const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
307
- manifest.leader_pane_id = '%55';
308
- await writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
309
- process.env.RCS_TEAM_STATE_ROOT = join(repoCwd, '.rcs', 'state');
310
- const first = await executeTeamApiOperation('send-message', {
311
- team_name: teamName,
312
- from_worker: 'worker-1',
313
- to_worker: 'leader-fixed',
314
- body: 'ACK: worker-1 initialized',
315
- }, workerCwd);
316
- assert.equal(first.ok, true);
317
- if (!first.ok)
318
- throw new Error('expected first send-message call to succeed');
319
- const second = await executeTeamApiOperation('send-message', {
320
- team_name: teamName,
321
- from_worker: 'worker-1',
322
- to_worker: 'leader-fixed',
323
- body: 'ACK: worker-1 initialized',
324
- }, workerCwd);
325
- assert.equal(second.ok, true);
326
- if (!second.ok)
327
- throw new Error('expected duplicate send-message call to succeed');
328
- const firstMessage = first.data.message;
329
- const secondMessage = second.data.message;
330
- assert.equal(secondMessage.message_id, firstMessage.message_id);
331
- assert.equal(secondMessage.to_worker, 'leader-fixed');
332
- assert.equal(secondMessage.body, 'ACK: worker-1 initialized');
333
- const mailbox = JSON.parse(await readFile(join(repoCwd, '.rcs', 'state', 'team', teamName, 'mailbox', 'leader-fixed.json'), 'utf-8'));
334
- const workerMessages = (mailbox.messages ?? []).filter((message) => message.from_worker === 'worker-1' && message.to_worker === 'leader-fixed');
335
- assert.equal(workerMessages.length, 1, 'deduped leader sends should not append duplicate worker mailbox rows');
336
- const deliveryLog = [
337
- ...(await readTeamDeliveryLog(repoCwd)),
338
- ...(await readTeamDeliveryLog(workerCwd)),
339
- ];
340
- const createdEvents = deliveryLog.filter((entry) => entry.event === 'mailbox_created'
341
- && entry.from_worker === 'worker-1'
342
- && entry.to_worker === 'leader-fixed'
343
- && entry.message_id === firstMessage.message_id);
344
- assert.equal(createdEvents.length, 1, 'deduped leader sends should only emit one mailbox_created event');
345
- }
346
- finally {
347
- if (typeof prevTeamStateRoot === 'string')
348
- process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
349
- else
350
- delete process.env.RCS_TEAM_STATE_ROOT;
351
- await rm(repoCwd, { recursive: true, force: true });
352
- await rm(workerCwd, { recursive: true, force: true });
353
- }
354
- });
355
- it('returns the persisted mailbox message when bridge compat omits the mailbox row under an explicit shared state root', async () => {
356
- const teamName = 'msg-team-shared-root';
357
- const root = await mkdtemp(join(tmpdir(), 'rcs-interop-shared-root-'));
358
- const leaderCwd = join(root, 'leader');
359
- const workerCwd = join(root, 'worker-worktree');
360
- const sharedStateRoot = join(root, 'shared-state');
361
- const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
362
- try {
363
- await mkdir(leaderCwd, { recursive: true });
364
- await mkdir(workerCwd, { recursive: true });
365
- process.env.RCS_TEAM_STATE_ROOT = sharedStateRoot;
366
- await initTeamState(teamName, 'shared state root mailbox fallback', 'executor', 2, leaderCwd);
367
- await withMailboxCompatHoleRuntime(root, async () => {
368
- const result = await executeTeamApiOperation('send-message', {
369
- team_name: teamName,
370
- from_worker: 'worker-1',
371
- to_worker: 'leader-fixed',
372
- body: 'shared-root hello',
373
- }, workerCwd);
374
- assert.equal(result.ok, true);
375
- if (!result.ok)
376
- throw new Error('expected send-message call to succeed');
377
- const message = result.data.message;
378
- assert.equal(message.body, 'shared-root hello');
379
- assert.equal(message.to_worker, 'leader-fixed');
380
- const mailbox = JSON.parse(await readFile(join(sharedStateRoot, 'team', teamName, 'mailbox', 'leader-fixed.json'), 'utf8'));
381
- assert.equal(mailbox.messages?.length, 1);
382
- });
383
- }
384
- finally {
385
- if (typeof prevTeamStateRoot === 'string')
386
- process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
387
- else
388
- delete process.env.RCS_TEAM_STATE_ROOT;
389
- await rm(root, { recursive: true, force: true });
390
- }
391
- });
392
- it('returns error when from_worker missing', async () => {
393
- const result = await executeTeamApiOperation('send-message', {
394
- team_name: 'any', to_worker: 'w2', body: 'hi',
395
- }, '/tmp');
396
- assert.equal(result.ok, false);
397
- if (!result.ok)
398
- assert.match(result.error.message, /from_worker is required/);
399
- });
400
- it('returns error when team_name, to_worker, or body missing', async () => {
401
- const result = await executeTeamApiOperation('send-message', {
402
- from_worker: 'w1',
403
- }, '/tmp');
404
- assert.equal(result.ok, false);
405
- if (!result.ok)
406
- assert.match(result.error.message, /team_name.*from_worker.*to_worker.*body/);
407
- });
408
- });
409
- // ─── broadcast ────────────────────────────────────────────────────────────
410
- describe('executeTeamApiOperation: broadcast', () => {
411
- it('broadcasts a message successfully', async () => {
412
- const { cwd, cleanup } = await setupTeam('bc-team');
413
- try {
414
- const result = await executeTeamApiOperation('broadcast', {
415
- team_name: 'bc-team',
416
- from_worker: 'worker-1',
417
- body: 'hello everyone',
418
- }, cwd);
419
- assert.equal(result.ok, true);
420
- if (result.ok) {
421
- assert.ok('count' in result.data);
422
- }
423
- }
424
- finally {
425
- await cleanup();
426
- }
427
- });
428
- it('returns error when required fields missing', async () => {
429
- const result = await executeTeamApiOperation('broadcast', {
430
- team_name: 'x',
431
- }, '/tmp');
432
- assert.equal(result.ok, false);
433
- });
434
- });
435
- // ─── mailbox-list ─────────────────────────────────────────────────────────
436
- describe('executeTeamApiOperation: mailbox-list', () => {
437
- it('lists mailbox messages (empty initially)', async () => {
438
- const { cwd, cleanup } = await setupTeam('mbox-team');
439
- try {
440
- const result = await executeTeamApiOperation('mailbox-list', {
441
- team_name: 'mbox-team',
442
- worker: 'worker-1',
443
- }, cwd);
444
- assert.equal(result.ok, true);
445
- if (result.ok) {
446
- assert.equal(result.data.count, 0);
447
- }
448
- }
449
- finally {
450
- await cleanup();
451
- }
452
- });
453
- it('filters out delivered messages when include_delivered is false', async () => {
454
- const { cwd, cleanup } = await setupTeam('mbox-filter');
455
- try {
456
- const result = await executeTeamApiOperation('mailbox-list', {
457
- team_name: 'mbox-filter',
458
- worker: 'worker-1',
459
- include_delivered: false,
460
- }, cwd);
461
- assert.equal(result.ok, true);
462
- }
463
- finally {
464
- await cleanup();
465
- }
466
- });
467
- it('returns error when required fields missing', async () => {
468
- const result = await executeTeamApiOperation('mailbox-list', { team_name: 'x' }, '/tmp');
469
- assert.equal(result.ok, false);
470
- });
471
- });
472
- // ─── mailbox-mark-delivered ───────────────────────────────────────────────
473
- describe('executeTeamApiOperation: mailbox-mark-delivered', () => {
474
- it('marks a message delivered after sending and promotes matching dispatch receipt', async () => {
475
- const { cwd, cleanup } = await setupTeam('mark-dlv');
476
- try {
477
- // Ensure the worker-2 mailbox directory exists so sendDirectMessage can write
478
- await mkdir(join(cwd, '.rcs', 'state', 'team', 'mark-dlv', 'mailbox', 'worker-2'), { recursive: true });
479
- const sendResult = await executeTeamApiOperation('send-message', {
480
- team_name: 'mark-dlv', from_worker: 'worker-1', to_worker: 'worker-2', body: 'ack',
481
- }, cwd);
482
- assert.equal(sendResult.ok, true);
483
- const msg = sendResult.data.message;
484
- const msgId = String(msg?.message_id ?? '');
485
- assert.ok(msgId, 'message should have a message_id');
486
- const dispatch = await enqueueDispatchRequest('mark-dlv', {
487
- kind: 'mailbox',
488
- to_worker: 'worker-2',
489
- worker_index: 2,
490
- message_id: msgId,
491
- trigger_message: 'check mailbox',
492
- }, cwd);
493
- const result = await executeTeamApiOperation('mailbox-mark-delivered', {
494
- team_name: 'mark-dlv', worker: 'worker-2', message_id: msgId,
495
- }, cwd);
496
- assert.equal(result.ok, true);
497
- if (!result.ok)
498
- throw new Error('expected successful mailbox-mark-delivered result');
499
- assert.equal(result.data.dispatch_request_id, dispatch.request.request_id);
500
- assert.equal(result.data.dispatch_updated, true);
501
- const updatedDispatch = await readDispatchRequest('mark-dlv', dispatch.request.request_id, cwd);
502
- assert.equal(updatedDispatch?.status, 'delivered');
503
- const deliveryLog = await readTeamDeliveryLog(cwd);
504
- assert.ok(deliveryLog.some((entry) => entry.event === 'delivered'
505
- && entry.message_id === msgId
506
- && entry.to_worker === 'worker-2'));
507
- assert.ok(deliveryLog.some((entry) => entry.event === 'mark_delivered'
508
- && entry.message_id === msgId
509
- && entry.request_id === dispatch.request.request_id
510
- && entry.dispatch_updated === true));
511
- }
512
- finally {
513
- await cleanup();
514
- }
515
- });
516
- it('marks leader-fixed mailbox delivery from a worker worktree and resolves the matching dispatch receipt', async () => {
517
- const teamName = 'mark-dlv-leader-worktree';
518
- const repoCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-mark-dlv-root-'));
519
- const workerCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-mark-dlv-worktree-'));
520
- const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
521
- delete process.env.RCS_TEAM_STATE_ROOT;
522
- try {
523
- await initTeamState(teamName, 'leader mailbox delivery receipt', 'executor', 2, repoCwd);
524
- process.env.RCS_TEAM_STATE_ROOT = join(repoCwd, '.rcs', 'state');
525
- const sendResult = await executeTeamApiOperation('send-message', {
526
- team_name: teamName,
527
- from_worker: 'worker-1',
528
- to_worker: 'leader-fixed',
529
- body: 'DONE: worker-1 finished a mailbox integrity probe',
530
- }, workerCwd);
531
- assert.equal(sendResult.ok, true);
532
- if (!sendResult.ok)
533
- throw new Error('expected successful leader send-message result');
534
- const message = sendResult.data.message;
535
- const messageId = String(message.message_id ?? '');
536
- assert.ok(messageId, 'leader mailbox message should include a message_id');
537
- const pendingRequests = await listDispatchRequests(teamName, repoCwd, { kind: 'mailbox', to_worker: 'leader-fixed' });
538
- const pendingDispatch = pendingRequests.find((request) => request.message_id === messageId);
539
- assert.ok(pendingDispatch, 'leader mailbox send should enqueue a matching dispatch request');
540
- const result = await executeTeamApiOperation('mailbox-mark-delivered', {
541
- team_name: teamName,
542
- worker: 'leader-fixed',
543
- message_id: messageId,
544
- }, workerCwd);
545
- assert.equal(result.ok, true);
546
- if (!result.ok)
547
- throw new Error('expected successful leader mailbox-mark-delivered result');
548
- assert.equal(result.data.updated, true);
549
- assert.equal(result.data.dispatch_request_id, pendingDispatch?.request_id);
550
- assert.equal(result.data.dispatch_updated, true);
551
- const updatedDispatch = await readDispatchRequest(teamName, pendingDispatch.request_id, repoCwd);
552
- assert.equal(updatedDispatch?.status, 'delivered');
553
- assert.ok(updatedDispatch?.delivered_at, 'leader dispatch receipt should record delivered_at');
554
- const leaderMailbox = JSON.parse(await readFile(join(repoCwd, '.rcs', 'state', 'team', teamName, 'mailbox', 'leader-fixed.json'), 'utf-8'));
555
- const deliveredMessage = (leaderMailbox.messages ?? []).find((entry) => entry.message_id === messageId);
556
- assert.equal(typeof deliveredMessage?.delivered_at, 'string');
557
- }
558
- finally {
559
- if (typeof prevTeamStateRoot === 'string')
560
- process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
561
- else
562
- delete process.env.RCS_TEAM_STATE_ROOT;
563
- await rm(repoCwd, { recursive: true, force: true });
564
- await rm(workerCwd, { recursive: true, force: true });
565
- }
566
- });
567
- it('reports when no matching mailbox dispatch request exists', async () => {
568
- const { cwd, cleanup } = await setupTeam('mark-dlv-no-dispatch');
569
- try {
570
- const message = await sendDirectMessage('mark-dlv-no-dispatch', 'worker-1', 'worker-2', 'ack', cwd);
571
- const result = await executeTeamApiOperation('mailbox-mark-delivered', {
572
- team_name: 'mark-dlv-no-dispatch',
573
- worker: 'worker-2',
574
- message_id: message.message_id,
575
- }, cwd);
576
- assert.equal(result.ok, true);
577
- if (!result.ok)
578
- throw new Error('expected success envelope');
579
- assert.equal(result.data.dispatch_request_id, null);
580
- assert.equal(result.data.dispatch_updated, false);
581
- }
582
- finally {
583
- await cleanup();
584
- }
585
- });
586
- it('returns error when required fields missing', async () => {
587
- const result = await executeTeamApiOperation('mailbox-mark-delivered', {
588
- team_name: 'x', worker: 'w',
589
- }, '/tmp');
590
- assert.equal(result.ok, false);
591
- });
592
- });
593
- // ─── mailbox-mark-notified ────────────────────────────────────────────────
594
- describe('executeTeamApiOperation: mailbox-mark-notified', () => {
595
- it('marks a message notified after sending', async () => {
596
- const { cwd, cleanup } = await setupTeam('mark-ntf');
597
- try {
598
- // Ensure the worker-2 mailbox directory exists so sendDirectMessage can write
599
- await mkdir(join(cwd, '.rcs', 'state', 'team', 'mark-ntf', 'mailbox', 'worker-2'), { recursive: true });
600
- const sendResult = await executeTeamApiOperation('send-message', {
601
- team_name: 'mark-ntf', from_worker: 'worker-1', to_worker: 'worker-2', body: 'notify me',
602
- }, cwd);
603
- // Send must succeed to test mark-notified
604
- assert.equal(sendResult.ok, true);
605
- const msg = sendResult.data.message;
606
- const msgId = String(msg?.message_id ?? '');
607
- assert.ok(msgId, 'message should have a message_id');
608
- const result = await executeTeamApiOperation('mailbox-mark-notified', {
609
- team_name: 'mark-ntf', worker: 'worker-2', message_id: msgId,
610
- }, cwd);
611
- // Mark operation returns a valid envelope (pass or fail based on state layer)
612
- assert.ok(typeof result.ok === 'boolean');
613
- }
614
- finally {
615
- await cleanup();
616
- }
617
- });
618
- it('returns error when required fields missing', async () => {
619
- const result = await executeTeamApiOperation('mailbox-mark-notified', {
620
- team_name: 'x',
621
- }, '/tmp');
622
- assert.equal(result.ok, false);
623
- });
624
- });
625
- // ─── create-task ──────────────────────────────────────────────────────────
626
- describe('executeTeamApiOperation: create-task', () => {
627
- it('creates a task successfully', async () => {
628
- const { cwd, cleanup } = await setupTeam('create-tsk');
629
- try {
630
- const result = await executeTeamApiOperation('create-task', {
631
- team_name: 'create-tsk',
632
- subject: 'My task',
633
- description: 'Description here',
634
- }, cwd);
635
- assert.equal(result.ok, true);
636
- if (result.ok) {
637
- assert.ok(result.data.task);
638
- }
639
- }
640
- finally {
641
- await cleanup();
642
- }
643
- });
644
- it('creates a task with optional fields', async () => {
645
- const { cwd, cleanup } = await setupTeam('create-tsk-opt');
646
- try {
647
- const result = await executeTeamApiOperation('create-task', {
648
- team_name: 'create-tsk-opt',
649
- subject: 'Owned task',
650
- description: 'Has owner',
651
- owner: 'worker-1',
652
- blocked_by: ['999'],
653
- requires_code_change: true,
654
- }, cwd);
655
- assert.equal(result.ok, true);
656
- }
657
- finally {
658
- await cleanup();
659
- }
660
- });
661
- it('returns error when required fields missing', async () => {
662
- const result = await executeTeamApiOperation('create-task', {
663
- team_name: 'x', subject: 'only subject',
664
- }, '/tmp');
665
- assert.equal(result.ok, false);
666
- });
667
- });
668
- // ─── read-task ────────────────────────────────────────────────────────────
669
- describe('executeTeamApiOperation: read-task', () => {
670
- it('reads an existing task', async () => {
671
- const { cwd, cleanup } = await setupTeam('read-tsk');
672
- try {
673
- const task = await createTask('read-tsk', {
674
- subject: 'Readable', description: 'A task to read', status: 'pending',
675
- }, cwd);
676
- const result = await executeTeamApiOperation('read-task', {
677
- team_name: 'read-tsk', task_id: task.id,
678
- }, cwd);
679
- assert.equal(result.ok, true);
680
- if (result.ok)
681
- assert.ok(result.data.task);
682
- }
683
- finally {
684
- await cleanup();
685
- }
686
- });
687
- it('returns task_not_found for nonexistent task', async () => {
688
- const { cwd, cleanup } = await setupTeam('read-tsk-nf');
689
- try {
690
- const result = await executeTeamApiOperation('read-task', {
691
- team_name: 'read-tsk-nf', task_id: '9999',
692
- }, cwd);
693
- assert.equal(result.ok, false);
694
- if (!result.ok)
695
- assert.equal(result.error.code, 'task_not_found');
696
- }
697
- finally {
698
- await cleanup();
699
- }
700
- });
701
- it('returns error when required fields missing', async () => {
702
- const result = await executeTeamApiOperation('read-task', { team_name: 'x' }, '/tmp');
703
- assert.equal(result.ok, false);
704
- });
705
- });
706
- // ─── list-tasks ───────────────────────────────────────────────────────────
707
- describe('executeTeamApiOperation: list-tasks', () => {
708
- it('lists tasks for a team', async () => {
709
- const { cwd, cleanup } = await setupTeam('list-tsk');
710
- try {
711
- await createTask('list-tsk', { subject: 'T1', description: 'D1', status: 'pending' }, cwd);
712
- const result = await executeTeamApiOperation('list-tasks', {
713
- team_name: 'list-tsk',
714
- }, cwd);
715
- assert.equal(result.ok, true);
716
- if (result.ok) {
717
- assert.ok(result.data.count >= 1);
718
- }
719
- }
720
- finally {
721
- await cleanup();
722
- }
723
- });
724
- it('resolves team working directory from manifest metadata over worker identity/config fallbacks', async () => {
725
- const teamName = 'list-tsk-meta';
726
- const cwdA = await mkdtemp(join(tmpdir(), 'rcs-interop-meta-a-'));
727
- const cwdB = await mkdtemp(join(tmpdir(), 'rcs-interop-meta-b-'));
728
- const prevTeamWorker = process.env.RCS_TEAM_WORKER;
729
- const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
730
- delete process.env.RCS_TEAM_STATE_ROOT;
731
- process.env.RCS_TEAM_WORKER = `${teamName}/worker-1`;
732
- try {
733
- await initTeamState(teamName, 'metadata precedence', 'executor', 2, cwdA);
734
- await initTeamState(teamName, 'metadata precedence', 'executor', 2, cwdB);
735
- await createTask(teamName, { subject: 'From manifest root', description: 'B lane', status: 'pending' }, cwdB);
736
- const teamRootA = join(cwdA, '.rcs', 'state', 'team', teamName);
737
- const configPath = join(teamRootA, 'config.json');
738
- const manifestPath = join(teamRootA, 'manifest.v2.json');
739
- const config = JSON.parse(await readFile(configPath, 'utf-8'));
740
- const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
741
- config.team_state_root = join(cwdA, '.rcs', 'state');
742
- manifest.team_state_root = join(cwdB, '.rcs', 'state');
743
- await writeFile(configPath, `${JSON.stringify(config, null, 2)}\n`, 'utf8');
744
- await writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
745
- const result = await executeTeamApiOperation('list-tasks', { team_name: teamName }, cwdA);
746
- assert.equal(result.ok, true);
747
- if (!result.ok)
748
- throw new Error('expected list-tasks to succeed');
749
- assert.equal(result.data.count, 1);
750
- }
751
- finally {
752
- if (typeof prevTeamWorker === 'string')
753
- process.env.RCS_TEAM_WORKER = prevTeamWorker;
754
- else
755
- delete process.env.RCS_TEAM_WORKER;
756
- if (typeof prevTeamStateRoot === 'string')
757
- process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
758
- else
759
- delete process.env.RCS_TEAM_STATE_ROOT;
760
- await rm(cwdA, { recursive: true, force: true });
761
- await rm(cwdB, { recursive: true, force: true });
762
- }
763
- });
764
- it('resolves display team names from RCS_TEAM_STATE_ROOT when API calls run outside the leader cwd', async () => {
765
- const { cwd: leaderCwd, cleanup } = await setupDisplayTeam('api-root-display-11111111', 'api-root-display', 'session-api-root-display');
766
- const workerCwd = await mkdtemp(join(tmpdir(), 'rcs-interop-api-root-worker-'));
767
- try {
768
- process.env.RCS_TEAM_STATE_ROOT = join(leaderCwd, '.rcs', 'state');
769
- await createTask('api-root-display-11111111', { subject: 'From shared root', description: 'D', status: 'pending' }, leaderCwd);
770
- const event = await appendTeamEvent('api-root-display-11111111', {
771
- type: 'task_completed',
772
- worker: 'worker-1',
773
- task_id: '1',
774
- }, leaderCwd);
775
- await writeMonitorSnapshot('api-root-display-11111111', {
776
- taskStatusById: { '1': 'pending' },
777
- workerAliveByName: { 'worker-1': true, 'worker-2': true },
778
- workerStateByName: { 'worker-1': 'idle', 'worker-2': 'working' },
779
- workerTurnCountByName: { 'worker-1': 1, 'worker-2': 1 },
780
- workerTaskIdByName: { 'worker-1': '1', 'worker-2': '1' },
781
- mailboxNotifiedByMessageId: {},
782
- completedEventTaskIds: {},
783
- }, leaderCwd);
784
- const listResult = await executeTeamApiOperation('list-tasks', { team_name: 'api-root-display' }, workerCwd);
785
- assert.equal(listResult.ok, true);
786
- if (!listResult.ok)
787
- throw new Error('expected list-tasks to succeed');
788
- assert.equal(listResult.data.count, 1);
789
- assert.equal(listResult.data.tasks[0]?.subject, 'From shared root');
790
- const eventsResult = await executeTeamApiOperation('read-events', {
791
- team_name: 'api-root-display',
792
- type: 'task_completed',
793
- }, workerCwd);
794
- assert.equal(eventsResult.ok, true);
795
- if (!eventsResult.ok)
796
- throw new Error('expected read-events to succeed');
797
- assert.equal(eventsResult.data.count, 1);
798
- assert.equal(eventsResult.data.events[0]?.event_id, event.event_id);
799
- const idleResult = await executeTeamApiOperation('read-idle-state', { team_name: 'api-root-display' }, workerCwd);
800
- assert.equal(idleResult.ok, true);
801
- if (!idleResult.ok)
802
- throw new Error('expected read-idle-state to succeed');
803
- assert.equal(idleResult.data.team_name, 'api-root-display-11111111');
804
- assert.deepEqual(idleResult.data.idle_workers, ['worker-1']);
805
- }
806
- finally {
807
- await rm(workerCwd, { recursive: true, force: true });
808
- await cleanup();
809
- }
810
- });
811
- it('prefers RCS_TEAM_STATE_ROOT over manifest metadata when resolving the team working directory', async () => {
812
- const teamName = 'list-tsk-env-root';
813
- const cwdA = await mkdtemp(join(tmpdir(), 'rcs-interop-env-a-'));
814
- const cwdB = await mkdtemp(join(tmpdir(), 'rcs-interop-env-b-'));
815
- const prevTeamWorker = process.env.RCS_TEAM_WORKER;
816
- const prevTeamStateRoot = process.env.RCS_TEAM_STATE_ROOT;
817
- delete process.env.RCS_TEAM_STATE_ROOT;
818
- process.env.RCS_TEAM_WORKER = `${teamName}/worker-1`;
819
- try {
820
- await initTeamState(teamName, 'env root precedence', 'executor', 2, cwdA);
821
- await initTeamState(teamName, 'env root precedence', 'executor', 2, cwdB);
822
- await createTask(teamName, { subject: 'From env root', description: 'A lane', status: 'pending' }, cwdA);
823
- await createTask(teamName, { subject: 'From manifest root', description: 'B lane', status: 'pending' }, cwdB);
824
- const teamRootA = join(cwdA, '.rcs', 'state', 'team', teamName);
825
- const manifestPath = join(teamRootA, 'manifest.v2.json');
826
- const manifest = JSON.parse(await readFile(manifestPath, 'utf-8'));
827
- manifest.team_state_root = join(cwdB, '.rcs', 'state');
828
- await writeFile(manifestPath, `${JSON.stringify(manifest, null, 2)}\n`, 'utf8');
829
- process.env.RCS_TEAM_STATE_ROOT = join(cwdA, '.rcs', 'state');
830
- const result = await executeTeamApiOperation('list-tasks', { team_name: teamName }, cwdB);
831
- assert.equal(result.ok, true);
832
- if (!result.ok)
833
- throw new Error('expected list-tasks to succeed');
834
- assert.equal(result.data.count, 1);
835
- const tasks = result.data.tasks;
836
- assert.equal(tasks[0]?.subject, 'From env root');
837
- }
838
- finally {
839
- if (typeof prevTeamWorker === 'string')
840
- process.env.RCS_TEAM_WORKER = prevTeamWorker;
841
- else
842
- delete process.env.RCS_TEAM_WORKER;
843
- if (typeof prevTeamStateRoot === 'string')
844
- process.env.RCS_TEAM_STATE_ROOT = prevTeamStateRoot;
845
- else
846
- delete process.env.RCS_TEAM_STATE_ROOT;
847
- await rm(cwdA, { recursive: true, force: true });
848
- await rm(cwdB, { recursive: true, force: true });
849
- }
850
- });
851
- it('returns error when team_name missing', async () => {
852
- const result = await executeTeamApiOperation('list-tasks', {}, '/tmp');
853
- assert.equal(result.ok, false);
854
- });
855
- });
856
- // ─── update-task ──────────────────────────────────────────────────────────
857
- describe('executeTeamApiOperation: update-task', () => {
858
- it('updates task subject and description', async () => {
859
- const { cwd, cleanup } = await setupTeam('upd-tsk');
860
- try {
861
- const task = await createTask('upd-tsk', { subject: 'Old', description: 'Old desc', status: 'pending' }, cwd);
862
- const result = await executeTeamApiOperation('update-task', {
863
- team_name: 'upd-tsk', task_id: task.id,
864
- subject: 'New subject', description: 'New desc',
865
- }, cwd);
866
- assert.equal(result.ok, true);
867
- }
868
- finally {
869
- await cleanup();
870
- }
871
- });
872
- it('rejects lifecycle fields (status, owner, result, error)', async () => {
873
- const { cwd, cleanup } = await setupTeam('upd-tsk-lc');
874
- try {
875
- const task = await createTask('upd-tsk-lc', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
876
- const result = await executeTeamApiOperation('update-task', {
877
- team_name: 'upd-tsk-lc', task_id: task.id, status: 'completed',
878
- }, cwd);
879
- assert.equal(result.ok, false);
880
- if (!result.ok)
881
- assert.match(result.error.message, /lifecycle fields/);
882
- }
883
- finally {
884
- await cleanup();
885
- }
886
- });
887
- it('rejects unexpected fields', async () => {
888
- const { cwd, cleanup } = await setupTeam('upd-tsk-uf');
889
- try {
890
- const task = await createTask('upd-tsk-uf', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
891
- const result = await executeTeamApiOperation('update-task', {
892
- team_name: 'upd-tsk-uf', task_id: task.id, random_field: 'bad',
893
- }, cwd);
894
- assert.equal(result.ok, false);
895
- if (!result.ok)
896
- assert.match(result.error.message, /unsupported fields/);
897
- }
898
- finally {
899
- await cleanup();
900
- }
901
- });
902
- it('rejects non-string subject', async () => {
903
- const { cwd, cleanup } = await setupTeam('upd-tsk-ns');
904
- try {
905
- const task = await createTask('upd-tsk-ns', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
906
- const result = await executeTeamApiOperation('update-task', {
907
- team_name: 'upd-tsk-ns', task_id: task.id, subject: 123,
908
- }, cwd);
909
- assert.equal(result.ok, false);
910
- if (!result.ok)
911
- assert.match(result.error.message, /subject must be a string/);
912
- }
913
- finally {
914
- await cleanup();
915
- }
916
- });
917
- it('rejects non-string description', async () => {
918
- const { cwd, cleanup } = await setupTeam('upd-tsk-nd');
919
- try {
920
- const task = await createTask('upd-tsk-nd', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
921
- const result = await executeTeamApiOperation('update-task', {
922
- team_name: 'upd-tsk-nd', task_id: task.id, description: 42,
923
- }, cwd);
924
- assert.equal(result.ok, false);
925
- if (!result.ok)
926
- assert.match(result.error.message, /description must be a string/);
927
- }
928
- finally {
929
- await cleanup();
930
- }
931
- });
932
- it('rejects non-boolean requires_code_change', async () => {
933
- const { cwd, cleanup } = await setupTeam('upd-tsk-rcc');
934
- try {
935
- const task = await createTask('upd-tsk-rcc', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
936
- const result = await executeTeamApiOperation('update-task', {
937
- team_name: 'upd-tsk-rcc', task_id: task.id, requires_code_change: 'yes',
938
- }, cwd);
939
- assert.equal(result.ok, false);
940
- if (!result.ok)
941
- assert.match(result.error.message, /requires_code_change must be a boolean/);
942
- }
943
- finally {
944
- await cleanup();
945
- }
946
- });
947
- it('validates blocked_by as array of valid task IDs', async () => {
948
- const { cwd, cleanup } = await setupTeam('upd-tsk-bb');
949
- try {
950
- const task = await createTask('upd-tsk-bb', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
951
- const result = await executeTeamApiOperation('update-task', {
952
- team_name: 'upd-tsk-bb', task_id: task.id, blocked_by: 'not-an-array',
953
- }, cwd);
954
- assert.equal(result.ok, false);
955
- if (!result.ok)
956
- assert.match(result.error.message, /must be an array/);
957
- }
958
- finally {
959
- await cleanup();
960
- }
961
- });
962
- it('rejects blocked_by with non-string entries', async () => {
963
- const { cwd, cleanup } = await setupTeam('upd-tsk-bbns');
964
- try {
965
- const task = await createTask('upd-tsk-bbns', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
966
- const result = await executeTeamApiOperation('update-task', {
967
- team_name: 'upd-tsk-bbns', task_id: task.id, blocked_by: [123],
968
- }, cwd);
969
- assert.equal(result.ok, false);
970
- if (!result.ok)
971
- assert.match(result.error.message, /entries must be strings/);
972
- }
973
- finally {
974
- await cleanup();
975
- }
976
- });
977
- it('rejects blocked_by with invalid task ID format', async () => {
978
- const { cwd, cleanup } = await setupTeam('upd-tsk-bbid');
979
- try {
980
- const task = await createTask('upd-tsk-bbid', { subject: 'X', description: 'Y', status: 'pending' }, cwd);
981
- const result = await executeTeamApiOperation('update-task', {
982
- team_name: 'upd-tsk-bbid', task_id: task.id, blocked_by: ['abc'],
983
- }, cwd);
984
- assert.equal(result.ok, false);
985
- if (!result.ok)
986
- assert.match(result.error.message, /invalid task ID/);
987
- }
988
- finally {
989
- await cleanup();
990
- }
991
- });
992
- it('returns task_not_found when task does not exist', async () => {
993
- const { cwd, cleanup } = await setupTeam('upd-tsk-nf');
994
- try {
995
- const result = await executeTeamApiOperation('update-task', {
996
- team_name: 'upd-tsk-nf', task_id: '9999', subject: 'New',
997
- }, cwd);
998
- assert.equal(result.ok, false);
999
- if (!result.ok)
1000
- assert.equal(result.error.code, 'task_not_found');
1001
- }
1002
- finally {
1003
- await cleanup();
1004
- }
1005
- });
1006
- });
1007
- // ─── claim-task ───────────────────────────────────────────────────────────
1008
- describe('executeTeamApiOperation: claim-task', () => {
1009
- it('claims a task successfully', async () => {
1010
- const { cwd, cleanup } = await setupTeam('claim-tsk');
1011
- try {
1012
- const task = await createTask('claim-tsk', { subject: 'Claim me', description: 'D', status: 'pending' }, cwd);
1013
- const result = await executeTeamApiOperation('claim-task', {
1014
- team_name: 'claim-tsk', task_id: task.id, worker: 'worker-1',
1015
- }, cwd);
1016
- assert.equal(result.ok, true);
1017
- }
1018
- finally {
1019
- await cleanup();
1020
- }
1021
- });
1022
- it('rejects non-integer expected_version', async () => {
1023
- const result = await executeTeamApiOperation('claim-task', {
1024
- team_name: 'x', task_id: '1', worker: 'w1', expected_version: 'abc',
1025
- }, '/tmp');
1026
- assert.equal(result.ok, false);
1027
- if (!result.ok)
1028
- assert.match(result.error.message, /expected_version must be a positive integer/);
1029
- });
1030
- it('rejects zero expected_version', async () => {
1031
- const result = await executeTeamApiOperation('claim-task', {
1032
- team_name: 'x', task_id: '1', worker: 'w1', expected_version: 0,
1033
- }, '/tmp');
1034
- assert.equal(result.ok, false);
1035
- if (!result.ok)
1036
- assert.match(result.error.message, /expected_version must be a positive integer/);
1037
- });
1038
- it('returns error when required fields missing', async () => {
1039
- const result = await executeTeamApiOperation('claim-task', {
1040
- team_name: 'x', task_id: '1',
1041
- }, '/tmp');
1042
- assert.equal(result.ok, false);
1043
- });
1044
- });
1045
- // ─── transition-task-status ───────────────────────────────────────────────
1046
- describe('executeTeamApiOperation: transition-task-status', () => {
1047
- it('returns error when required fields missing', async () => {
1048
- const result = await executeTeamApiOperation('transition-task-status', {
1049
- team_name: 'x', task_id: '1', from: 'in_progress',
1050
- }, '/tmp');
1051
- assert.equal(result.ok, false);
1052
- });
1053
- it('rejects invalid status values', async () => {
1054
- const result = await executeTeamApiOperation('transition-task-status', {
1055
- team_name: 'x', task_id: '1', from: 'invalid', to: 'completed', claim_token: 'tok',
1056
- }, '/tmp');
1057
- assert.equal(result.ok, false);
1058
- if (!result.ok)
1059
- assert.match(result.error.message, /valid task statuses/);
1060
- });
1061
- it('persists optional result and error payloads', async () => {
1062
- const { cwd, cleanup } = await setupTeam('transition-payload');
1063
- try {
1064
- const completedTask = await createTask('transition-payload', { subject: 'done', description: 'd', status: 'pending' }, cwd);
1065
- const claimCompleted = await executeTeamApiOperation('claim-task', {
1066
- team_name: 'transition-payload', task_id: completedTask.id, worker: 'worker-1',
1067
- }, cwd);
1068
- assert.equal(claimCompleted.ok, true);
1069
- if (!claimCompleted.ok)
1070
- return;
1071
- const completedClaimToken = String(claimCompleted.data.claimToken);
1072
- const completedResult = 'Verification:\nPASS - transition evidence stored';
1073
- const completedTransition = await executeTeamApiOperation('transition-task-status', {
1074
- team_name: 'transition-payload',
1075
- task_id: completedTask.id,
1076
- from: 'in_progress',
1077
- to: 'completed',
1078
- claim_token: completedClaimToken,
1079
- result: completedResult,
1080
- }, cwd);
1081
- assert.equal(completedTransition.ok, true);
1082
- const completedReread = await readTask('transition-payload', completedTask.id, cwd);
1083
- assert.equal(completedReread?.result, completedResult);
1084
- assert.equal(completedReread?.error, undefined);
1085
- const failedTask = await createTask('transition-payload', { subject: 'fail', description: 'd', status: 'pending' }, cwd);
1086
- const claimFailed = await executeTeamApiOperation('claim-task', {
1087
- team_name: 'transition-payload', task_id: failedTask.id, worker: 'worker-1',
1088
- }, cwd);
1089
- assert.equal(claimFailed.ok, true);
1090
- if (!claimFailed.ok)
1091
- return;
1092
- const failedClaimToken = String(claimFailed.data.claimToken);
1093
- const failedError = 'Verification failed';
1094
- const failedTransition = await executeTeamApiOperation('transition-task-status', {
1095
- team_name: 'transition-payload',
1096
- task_id: failedTask.id,
1097
- from: 'in_progress',
1098
- to: 'failed',
1099
- claim_token: failedClaimToken,
1100
- error: failedError,
1101
- }, cwd);
1102
- assert.equal(failedTransition.ok, true);
1103
- const failedReread = await readTask('transition-payload', failedTask.id, cwd);
1104
- assert.equal(failedReread?.error, failedError);
1105
- assert.equal(failedReread?.result, undefined);
1106
- }
1107
- finally {
1108
- await cleanup();
1109
- }
1110
- });
1111
- it('rejects non-string result and error payloads', async () => {
1112
- const badResult = await executeTeamApiOperation('transition-task-status', {
1113
- team_name: 'x', task_id: '1', from: 'in_progress', to: 'completed', claim_token: 'tok', result: true,
1114
- }, '/tmp');
1115
- assert.equal(badResult.ok, false);
1116
- if (!badResult.ok)
1117
- assert.match(badResult.error.message, /result must be a string/);
1118
- const badError = await executeTeamApiOperation('transition-task-status', {
1119
- team_name: 'x', task_id: '1', from: 'in_progress', to: 'failed', claim_token: 'tok', error: 42,
1120
- }, '/tmp');
1121
- assert.equal(badError.ok, false);
1122
- if (!badError.ok)
1123
- assert.match(badError.error.message, /error must be a string/);
1124
- });
1125
- });
1126
- // ─── release-task-claim ───────────────────────────────────────────────────
1127
- describe('executeTeamApiOperation: release-task-claim', () => {
1128
- it('returns error when required fields missing', async () => {
1129
- const result = await executeTeamApiOperation('release-task-claim', {
1130
- team_name: 'x', task_id: '1',
1131
- }, '/tmp');
1132
- assert.equal(result.ok, false);
1133
- });
1134
- });
1135
- // ─── read-config ──────────────────────────────────────────────────────────
1136
- describe('executeTeamApiOperation: read-config', () => {
1137
- it('reads team config successfully', async () => {
1138
- const { cwd, cleanup } = await setupTeam('rd-cfg');
1139
- try {
1140
- const result = await executeTeamApiOperation('read-config', {
1141
- team_name: 'rd-cfg',
1142
- }, cwd);
1143
- assert.equal(result.ok, true);
1144
- if (result.ok)
1145
- assert.ok(result.data.config);
1146
- }
1147
- finally {
1148
- await cleanup();
1149
- }
1150
- });
1151
- it('returns team_not_found for nonexistent team', async () => {
1152
- const cwd = await mkdtemp(join(tmpdir(), 'rcs-interop-cfg-nf-'));
1153
- try {
1154
- const result = await executeTeamApiOperation('read-config', {
1155
- team_name: 'nonexistent-cfg',
1156
- }, cwd);
1157
- assert.equal(result.ok, false);
1158
- if (!result.ok)
1159
- assert.equal(result.error.code, 'team_not_found');
1160
- }
1161
- finally {
1162
- await rm(cwd, { recursive: true, force: true });
1163
- }
1164
- });
1165
- it('returns error when team_name missing', async () => {
1166
- const result = await executeTeamApiOperation('read-config', {}, '/tmp');
1167
- assert.equal(result.ok, false);
1168
- });
1169
- });
1170
- // ─── read-manifest ────────────────────────────────────────────────────────
1171
- describe('executeTeamApiOperation: read-manifest', () => {
1172
- it('returns manifest_not_found when manifest does not exist', async () => {
1173
- const { cwd, cleanup } = await setupTeam('rd-mfst');
1174
- try {
1175
- const result = await executeTeamApiOperation('read-manifest', {
1176
- team_name: 'rd-mfst',
1177
- }, cwd);
1178
- assert.ok(result.ok === true || (result.ok === false && result.error.code === 'manifest_not_found'));
1179
- }
1180
- finally {
1181
- await cleanup();
1182
- }
1183
- });
1184
- it('returns error when team_name missing', async () => {
1185
- const result = await executeTeamApiOperation('read-manifest', {}, '/tmp');
1186
- assert.equal(result.ok, false);
1187
- });
1188
- });
1189
- // ─── read-worker-status ───────────────────────────────────────────────────
1190
- describe('executeTeamApiOperation: read-worker-status', () => {
1191
- it('reads worker status', async () => {
1192
- const { cwd, cleanup } = await setupTeam('rd-ws');
1193
- try {
1194
- const result = await executeTeamApiOperation('read-worker-status', {
1195
- team_name: 'rd-ws', worker: 'worker-1',
1196
- }, cwd);
1197
- assert.equal(result.ok, true);
1198
- }
1199
- finally {
1200
- await cleanup();
1201
- }
1202
- });
1203
- it('returns error when required fields missing', async () => {
1204
- const result = await executeTeamApiOperation('read-worker-status', {
1205
- team_name: 'x',
1206
- }, '/tmp');
1207
- assert.equal(result.ok, false);
1208
- });
1209
- });
1210
- // ─── read-worker-heartbeat ────────────────────────────────────────────────
1211
- describe('executeTeamApiOperation: read-worker-heartbeat', () => {
1212
- it('reads worker heartbeat', async () => {
1213
- const { cwd, cleanup } = await setupTeam('rd-hb');
1214
- try {
1215
- const result = await executeTeamApiOperation('read-worker-heartbeat', {
1216
- team_name: 'rd-hb', worker: 'worker-1',
1217
- }, cwd);
1218
- assert.equal(result.ok, true);
1219
- }
1220
- finally {
1221
- await cleanup();
1222
- }
1223
- });
1224
- it('returns error when required fields missing', async () => {
1225
- const result = await executeTeamApiOperation('read-worker-heartbeat', {
1226
- team_name: 'x',
1227
- }, '/tmp');
1228
- assert.equal(result.ok, false);
1229
- });
1230
- });
1231
- // ─── update-worker-heartbeat ──────────────────────────────────────────────
1232
- describe('executeTeamApiOperation: update-worker-heartbeat', () => {
1233
- it('updates worker heartbeat successfully', async () => {
1234
- const { cwd, cleanup } = await setupTeam('upd-hb');
1235
- try {
1236
- const result = await executeTeamApiOperation('update-worker-heartbeat', {
1237
- team_name: 'upd-hb', worker: 'worker-1', pid: 12345, turn_count: 5, alive: true,
1238
- }, cwd);
1239
- assert.equal(result.ok, true);
1240
- }
1241
- finally {
1242
- await cleanup();
1243
- }
1244
- });
1245
- it('returns error when required fields missing or wrong types', async () => {
1246
- const result = await executeTeamApiOperation('update-worker-heartbeat', {
1247
- team_name: 'x', worker: 'w1', pid: 'not-a-number', turn_count: 1, alive: true,
1248
- }, '/tmp');
1249
- assert.equal(result.ok, false);
1250
- });
1251
- });
1252
- // ─── write-worker-inbox ───────────────────────────────────────────────────
1253
- describe('executeTeamApiOperation: write-worker-inbox', () => {
1254
- it('writes to worker inbox', async () => {
1255
- const { cwd, cleanup } = await setupTeam('wr-inbox');
1256
- try {
1257
- const result = await executeTeamApiOperation('write-worker-inbox', {
1258
- team_name: 'wr-inbox', worker: 'worker-1', content: 'Hello worker!',
1259
- }, cwd);
1260
- assert.equal(result.ok, true);
1261
- }
1262
- finally {
1263
- await cleanup();
1264
- }
1265
- });
1266
- it('returns error when required fields missing', async () => {
1267
- const result = await executeTeamApiOperation('write-worker-inbox', {
1268
- team_name: 'x', worker: 'w1',
1269
- }, '/tmp');
1270
- assert.equal(result.ok, false);
1271
- });
1272
- });
1273
- // ─── write-worker-identity ────────────────────────────────────────────────
1274
- describe('executeTeamApiOperation: write-worker-identity', () => {
1275
- it('writes worker identity', async () => {
1276
- const { cwd, cleanup } = await setupTeam('wr-id');
1277
- try {
1278
- const result = await executeTeamApiOperation('write-worker-identity', {
1279
- team_name: 'wr-id', worker: 'worker-1', index: 1, role: 'executor',
1280
- }, cwd);
1281
- assert.equal(result.ok, true);
1282
- }
1283
- finally {
1284
- await cleanup();
1285
- }
1286
- });
1287
- it('writes worker identity with optional fields', async () => {
1288
- const { cwd, cleanup } = await setupTeam('wr-id-opt');
1289
- try {
1290
- const result = await executeTeamApiOperation('write-worker-identity', {
1291
- team_name: 'wr-id-opt', worker: 'worker-1', index: 1, role: 'executor',
1292
- assigned_tasks: ['1', '2'], pid: 9999, pane_id: '%10',
1293
- working_dir: '/tmp', worktree_path: '/wt', worktree_branch: 'main',
1294
- worktree_detached: false, team_state_root: '/state',
1295
- }, cwd);
1296
- assert.equal(result.ok, true);
1297
- }
1298
- finally {
1299
- await cleanup();
1300
- }
1301
- });
1302
- it('returns error when required fields missing', async () => {
1303
- const result = await executeTeamApiOperation('write-worker-identity', {
1304
- team_name: 'x', worker: 'w1',
1305
- }, '/tmp');
1306
- assert.equal(result.ok, false);
1307
- });
1308
- });
1309
- // ─── append-event ─────────────────────────────────────────────────────────
1310
- describe('executeTeamApiOperation: append-event', () => {
1311
- it('appends a valid event', async () => {
1312
- const { cwd, cleanup } = await setupTeam('evt-team');
1313
- try {
1314
- const result = await executeTeamApiOperation('append-event', {
1315
- team_name: 'evt-team', type: 'task_completed', worker: 'worker-1', task_id: '1',
1316
- }, cwd);
1317
- assert.equal(result.ok, true);
1318
- }
1319
- finally {
1320
- await cleanup();
1321
- }
1322
- });
1323
- it('rejects invalid event type', async () => {
1324
- const result = await executeTeamApiOperation('append-event', {
1325
- team_name: 'x', type: 'invalid_type', worker: 'w1',
1326
- }, '/tmp');
1327
- assert.equal(result.ok, false);
1328
- if (!result.ok)
1329
- assert.match(result.error.message, /type must be one of/);
1330
- });
1331
- it('returns error when required fields missing', async () => {
1332
- const result = await executeTeamApiOperation('append-event', {
1333
- team_name: 'x',
1334
- }, '/tmp');
1335
- assert.equal(result.ok, false);
1336
- });
1337
- });
1338
- // ─── read-events ──────────────────────────────────────────────────────────
1339
- describe('executeTeamApiOperation: read-events', () => {
1340
- it('returns canonical filtered events', async () => {
1341
- const { cwd, cleanup } = await setupTeam('evt-read');
1342
- try {
1343
- const first = await appendTeamEvent('evt-read', {
1344
- type: 'task_completed',
1345
- worker: 'worker-2',
1346
- task_id: '2',
1347
- }, cwd);
1348
- const second = await appendTeamEvent('evt-read', {
1349
- type: 'worker_idle',
1350
- worker: 'worker-1',
1351
- task_id: '1',
1352
- prev_state: 'working',
1353
- }, cwd);
1354
- await appendTeamEvent('evt-read', {
1355
- type: 'task_failed',
1356
- worker: 'worker-1',
1357
- task_id: '1',
1358
- }, cwd);
1359
- const result = await executeTeamApiOperation('read-events', {
1360
- team_name: 'evt-read',
1361
- after_event_id: first.event_id,
1362
- worker: 'worker-1',
1363
- task_id: '1',
1364
- type: 'worker_idle',
1365
- }, cwd);
1366
- assert.equal(result.ok, true);
1367
- if (result.ok) {
1368
- assert.equal(result.data.count, 1);
1369
- assert.equal(result.data.cursor, second.event_id);
1370
- const events = result.data.events;
1371
- assert.equal(events.length, 1);
1372
- assert.equal(events[0]?.type, 'worker_state_changed');
1373
- assert.equal(events[0]?.source_type, 'worker_idle');
1374
- assert.equal(events[0]?.worker, 'worker-1');
1375
- assert.equal(events[0]?.task_id, '1');
1376
- }
1377
- }
1378
- finally {
1379
- await cleanup();
1380
- }
1381
- });
1382
- it('resolves display team names before reading events', async () => {
1383
- const { cwd, cleanup } = await setupDisplayTeam('evt-display-11111111', 'evt-display', 'session-events-display');
1384
- try {
1385
- const event = await appendTeamEvent('evt-display-11111111', {
1386
- type: 'task_completed',
1387
- worker: 'worker-1',
1388
- task_id: '1',
1389
- }, cwd);
1390
- const result = await executeTeamApiOperation('read-events', {
1391
- team_name: 'evt-display',
1392
- type: 'task_completed',
1393
- }, cwd);
1394
- assert.equal(result.ok, true);
1395
- if (result.ok) {
1396
- assert.equal(result.data.count, 1);
1397
- assert.equal(result.data.cursor, event.event_id);
1398
- const events = result.data.events;
1399
- assert.equal(events[0]?.event_id, event.event_id);
1400
- assert.equal(events[0]?.type, 'task_completed');
1401
- assert.equal(events[0]?.worker, 'worker-1');
1402
- }
1403
- }
1404
- finally {
1405
- await cleanup();
1406
- }
1407
- });
1408
- it('rejects invalid event filters', async () => {
1409
- const result = await executeTeamApiOperation('read-events', {
1410
- team_name: 'evt-read-invalid',
1411
- type: 'not_an_event',
1412
- }, '/tmp');
1413
- assert.equal(result.ok, false);
1414
- if (!result.ok) {
1415
- assert.match(result.error.message, /type must be one of/);
1416
- }
1417
- });
1418
- });
1419
- // ─── await-event ──────────────────────────────────────────────────────────
1420
- describe('executeTeamApiOperation: await-event', () => {
1421
- it('waits for the next matching event', async () => {
1422
- const { cwd, cleanup } = await setupTeam('evt-await');
1423
- try {
1424
- const waitPromise = executeTeamApiOperation('await-event', {
1425
- team_name: 'evt-await',
1426
- worker: 'worker-1',
1427
- task_id: '1',
1428
- type: 'task_completed',
1429
- timeout_ms: 500,
1430
- poll_ms: 25,
1431
- }, cwd);
1432
- setTimeout(() => {
1433
- void appendTeamEvent('evt-await', {
1434
- type: 'worker_state_changed',
1435
- worker: 'worker-2',
1436
- task_id: '2',
1437
- state: 'working',
1438
- }, cwd);
1439
- }, 25);
1440
- setTimeout(() => {
1441
- void appendTeamEvent('evt-await', {
1442
- type: 'task_completed',
1443
- worker: 'worker-1',
1444
- task_id: '1',
1445
- }, cwd);
1446
- }, 60);
1447
- const result = await waitPromise;
1448
- assert.equal(result.ok, true);
1449
- if (result.ok) {
1450
- assert.equal(result.data.status, 'event');
1451
- assert.equal(typeof result.data.cursor, 'string');
1452
- const event = result.data.event;
1453
- assert.equal(event?.type, 'task_completed');
1454
- assert.equal(event?.worker, 'worker-1');
1455
- assert.equal(event?.task_id, '1');
1456
- }
1457
- }
1458
- finally {
1459
- await cleanup();
1460
- }
1461
- });
1462
- it('rejects invalid timeout values', async () => {
1463
- const result = await executeTeamApiOperation('await-event', {
1464
- team_name: 'evt-await-invalid',
1465
- timeout_ms: -1,
1466
- }, '/tmp');
1467
- assert.equal(result.ok, false);
1468
- if (!result.ok) {
1469
- assert.match(result.error.message, /timeout_ms must be a non-negative integer/);
1470
- }
1471
- });
1472
- it('resolves display team names before awaiting events', async () => {
1473
- const { cwd, cleanup } = await setupDisplayTeam('evt-await-display-111111', 'evt-await-display', 'session-await-display');
1474
- try {
1475
- const waitPromise = executeTeamApiOperation('await-event', {
1476
- team_name: 'evt-await-display',
1477
- type: 'task_completed',
1478
- timeout_ms: 500,
1479
- poll_ms: 25,
1480
- }, cwd);
1481
- setTimeout(() => {
1482
- void appendTeamEvent('evt-await-display-111111', {
1483
- type: 'task_completed',
1484
- worker: 'worker-1',
1485
- task_id: '1',
1486
- }, cwd);
1487
- }, 25);
1488
- const result = await waitPromise;
1489
- assert.equal(result.ok, true);
1490
- if (result.ok) {
1491
- assert.equal(result.data.status, 'event');
1492
- const event = result.data.event;
1493
- assert.equal(event?.type, 'task_completed');
1494
- assert.equal(event?.worker, 'worker-1');
1495
- assert.equal(event?.task_id, '1');
1496
- }
1497
- }
1498
- finally {
1499
- await cleanup();
1500
- }
1501
- });
1502
- });
1503
- // ─── read-idle-state ────────────────────────────────────────────────────────
1504
- describe('executeTeamApiOperation: read-idle-state', () => {
1505
- it('returns structured idle state from summary, snapshot, and recent events', async () => {
1506
- const { cwd, cleanup } = await setupTeam('idle-state-team');
1507
- try {
1508
- await writeMonitorSnapshot('idle-state-team', {
1509
- taskStatusById: { '1': 'pending' },
1510
- workerAliveByName: { 'worker-1': true, 'worker-2': true },
1511
- workerStateByName: { 'worker-1': 'idle', 'worker-2': 'working' },
1512
- workerTurnCountByName: { 'worker-1': 3, 'worker-2': 5 },
1513
- workerTaskIdByName: { 'worker-1': '1', 'worker-2': '1' },
1514
- mailboxNotifiedByMessageId: {},
1515
- completedEventTaskIds: {},
1516
- }, cwd);
1517
- await appendTeamEvent('idle-state-team', {
1518
- type: 'worker_idle',
1519
- worker: 'worker-1',
1520
- task_id: '1',
1521
- prev_state: 'working',
1522
- }, cwd);
1523
- const allIdleEvent = await appendTeamEvent('idle-state-team', {
1524
- type: 'all_workers_idle',
1525
- worker: 'worker-1',
1526
- worker_count: 2,
1527
- }, cwd);
1528
- const result = await executeTeamApiOperation('read-idle-state', {
1529
- team_name: 'idle-state-team',
1530
- }, cwd);
1531
- assert.equal(result.ok, true);
1532
- if (result.ok) {
1533
- assert.equal(result.data.team_name, 'idle-state-team');
1534
- assert.equal(result.data.worker_count, 2);
1535
- assert.equal(result.data.idle_worker_count, 1);
1536
- assert.deepEqual(result.data.idle_workers, ['worker-1']);
1537
- assert.deepEqual(result.data.non_idle_workers, ['worker-2']);
1538
- assert.equal(result.data.all_workers_idle, false);
1539
- const byWorker = result.data.last_idle_transition_by_worker;
1540
- assert.equal(byWorker['worker-1']?.source_type, 'worker_idle');
1541
- assert.equal(byWorker['worker-2'], null);
1542
- const lastAllIdle = result.data.last_all_workers_idle_event;
1543
- assert.equal(lastAllIdle?.event_id, allIdleEvent.event_id);
1544
- assert.equal(lastAllIdle?.type, 'all_workers_idle');
1545
- assert.equal(lastAllIdle?.worker_count, 2);
1546
- }
1547
- }
1548
- finally {
1549
- await cleanup();
1550
- }
1551
- });
1552
- it('resolves display team names before reading idle state', async () => {
1553
- const { cwd, cleanup } = await setupDisplayTeam('idle-display-11111111', 'idle-display', 'session-idle-display');
1554
- try {
1555
- await writeMonitorSnapshot('idle-display-11111111', {
1556
- taskStatusById: {},
1557
- workerAliveByName: { 'worker-1': true, 'worker-2': true },
1558
- workerStateByName: { 'worker-1': 'idle', 'worker-2': 'idle' },
1559
- workerTurnCountByName: { 'worker-1': 1, 'worker-2': 1 },
1560
- workerTaskIdByName: { 'worker-1': '', 'worker-2': '' },
1561
- mailboxNotifiedByMessageId: {},
1562
- completedEventTaskIds: {},
1563
- }, cwd);
1564
- const result = await executeTeamApiOperation('read-idle-state', {
1565
- team_name: 'idle-display',
1566
- }, cwd);
1567
- assert.equal(result.ok, true);
1568
- if (result.ok) {
1569
- assert.equal(result.data.team_name, 'idle-display-11111111');
1570
- assert.equal(result.data.all_workers_idle, true);
1571
- assert.deepEqual(result.data.idle_workers, ['worker-1', 'worker-2']);
1572
- }
1573
- }
1574
- finally {
1575
- await cleanup();
1576
- }
1577
- });
1578
- });
1579
- // ─── read-stall-state ───────────────────────────────────────────────────────
1580
- describe('executeTeamApiOperation: read-stall-state', () => {
1581
- it('returns structured stall state from authoritative leader attention state', async () => {
1582
- const { cwd, cleanup } = await setupTeam('stall-state-team');
1583
- try {
1584
- const task = await createTask('stall-state-team', {
1585
- subject: 'Pending work',
1586
- description: 'Needs attention',
1587
- status: 'pending',
1588
- }, cwd);
1589
- await writeWorkerStatus('stall-state-team', 'worker-1', {
1590
- state: 'working',
1591
- current_task_id: task.id,
1592
- updated_at: '2026-03-10T10:00:00.000Z',
1593
- }, cwd);
1594
- await writeWorkerStatus('stall-state-team', 'worker-2', {
1595
- state: 'idle',
1596
- updated_at: '2026-03-10T10:00:00.000Z',
1597
- }, cwd);
1598
- await updateWorkerHeartbeat('stall-state-team', 'worker-1', {
1599
- alive: true,
1600
- pid: 101,
1601
- turn_count: 1,
1602
- last_turn_at: '2026-03-10T10:00:00.000Z',
1603
- }, cwd);
1604
- await updateWorkerHeartbeat('stall-state-team', 'worker-2', {
1605
- alive: true,
1606
- pid: 102,
1607
- turn_count: 1,
1608
- last_turn_at: '2026-03-10T10:00:00.000Z',
1609
- }, cwd);
1610
- const primed = await executeTeamApiOperation('get-summary', {
1611
- team_name: 'stall-state-team',
1612
- }, cwd);
1613
- assert.equal(primed.ok, true);
1614
- await updateWorkerHeartbeat('stall-state-team', 'worker-1', {
1615
- alive: true,
1616
- pid: 101,
1617
- turn_count: 8,
1618
- last_turn_at: '2026-03-10T10:05:00.000Z',
1619
- }, cwd);
1620
- await writeMonitorSnapshot('stall-state-team', {
1621
- taskStatusById: { [task.id]: 'pending' },
1622
- workerAliveByName: { 'worker-1': true, 'worker-2': true },
1623
- workerStateByName: { 'worker-1': 'idle', 'worker-2': 'idle' },
1624
- workerTurnCountByName: { 'worker-1': 8, 'worker-2': 1 },
1625
- workerTaskIdByName: { 'worker-1': task.id, 'worker-2': '' },
1626
- mailboxNotifiedByMessageId: {},
1627
- completedEventTaskIds: {},
1628
- }, cwd);
1629
- await writeTeamLeaderAttention('stall-state-team', {
1630
- team_name: 'stall-state-team',
1631
- updated_at: '2026-03-10T10:05:00.000Z',
1632
- source: 'native_stop',
1633
- leader_decision_state: 'still_actionable',
1634
- leader_attention_pending: true,
1635
- leader_attention_reason: 'leader_session_stopped',
1636
- attention_reasons: ['leader_session_stopped'],
1637
- leader_stale: false,
1638
- leader_session_active: false,
1639
- leader_session_id: 'leader-session-1',
1640
- leader_session_stopped_at: '2026-03-10T10:05:00.000Z',
1641
- unread_leader_message_count: 1,
1642
- work_remaining: true,
1643
- stalled_for_ms: null,
1644
- }, cwd);
1645
- const result = await executeTeamApiOperation('read-stall-state', {
1646
- team_name: 'stall-state-team',
1647
- }, cwd);
1648
- assert.equal(result.ok, true);
1649
- if (result.ok) {
1650
- assert.equal(result.data.team_name, 'stall-state-team');
1651
- assert.equal(result.data.team_stalled, true);
1652
- assert.equal(result.data.leader_stale, true);
1653
- assert.deepEqual(result.data.stalled_workers, ['worker-1']);
1654
- assert.deepEqual(result.data.dead_workers, []);
1655
- assert.equal(result.data.pending_task_count, 1);
1656
- assert.equal(result.data.all_workers_idle, true);
1657
- assert.match(result.data.reasons.join(' '), /workers_non_reporting:worker-1/);
1658
- assert.match(result.data.reasons.join(' '), /leader_attention_pending:leader_session_stopped/);
1659
- const attention = result.data.leader_attention_state;
1660
- assert.equal(attention?.leader_session_active, false);
1661
- assert.equal(attention?.source, 'native_stop');
1662
- }
1663
- }
1664
- finally {
1665
- await cleanup();
1666
- }
1667
- });
1668
- it('resolves display team names before reading stall state', async () => {
1669
- const { cwd, cleanup } = await setupDisplayTeam('stall-display-1111111', 'stall-display', 'session-stall-display');
1670
- try {
1671
- await sendDirectMessage('stall-display-1111111', 'worker-1', 'leader-fixed', 'please review', cwd);
1672
- const result = await executeTeamApiOperation('read-stall-state', {
1673
- team_name: 'stall-display',
1674
- }, cwd);
1675
- assert.equal(result.ok, true);
1676
- if (result.ok) {
1677
- assert.equal(result.data.team_name, 'stall-display-1111111');
1678
- assert.equal(result.data.leader_attention_pending, true);
1679
- assert.equal(result.data.unread_leader_message_count, 1);
1680
- }
1681
- }
1682
- finally {
1683
- await cleanup();
1684
- }
1685
- });
1686
- it('uses unread leader mailbox state even without recent nudge events', async () => {
1687
- const { cwd, cleanup } = await setupTeam('stall-state-mailbox');
1688
- try {
1689
- await sendDirectMessage('stall-state-mailbox', 'worker-1', 'leader-fixed', 'please review', cwd);
1690
- const result = await executeTeamApiOperation('read-stall-state', {
1691
- team_name: 'stall-state-mailbox',
1692
- }, cwd);
1693
- assert.equal(result.ok, true);
1694
- if (result.ok) {
1695
- assert.equal(result.data.leader_attention_pending, true);
1696
- assert.equal(result.data.leader_stale, false);
1697
- assert.equal(result.data.unread_leader_message_count, 1);
1698
- assert.match(result.data.reasons.join(' '), /leader_attention_pending:unread_leader_mailbox/);
1699
- }
1700
- }
1701
- finally {
1702
- await cleanup();
1703
- }
1704
- });
1705
- it('suppresses stale native-stop attention after newer leader activity', async () => {
1706
- const { cwd, cleanup } = await setupTeam('stall-state-resume');
1707
- try {
1708
- await writeTeamLeaderAttention('stall-state-resume', {
1709
- team_name: 'stall-state-resume',
1710
- updated_at: '2026-03-10T10:05:00.000Z',
1711
- source: 'native_stop',
1712
- leader_decision_state: 'still_actionable',
1713
- leader_attention_pending: true,
1714
- leader_attention_reason: 'leader_session_stopped',
1715
- attention_reasons: ['leader_session_stopped'],
1716
- leader_stale: false,
1717
- leader_session_active: false,
1718
- leader_session_id: 'leader-session-1',
1719
- leader_session_stopped_at: '2026-03-10T10:05:00.000Z',
1720
- unread_leader_message_count: 0,
1721
- work_remaining: false,
1722
- stalled_for_ms: null,
1723
- }, cwd);
1724
- await writeFile(join(cwd, '.rcs', 'state', 'leader-runtime-activity.json'), JSON.stringify({
1725
- last_activity_at: '2026-03-10T10:06:00.000Z',
1726
- last_source: 'team_status',
1727
- last_team_name: 'stall-state-resume',
1728
- }, null, 2));
1729
- const result = await executeTeamApiOperation('read-stall-state', {
1730
- team_name: 'stall-state-resume',
1731
- }, cwd);
1732
- assert.equal(result.ok, true);
1733
- if (result.ok) {
1734
- assert.equal(result.data.leader_attention_pending, false);
1735
- assert.equal(result.data.leader_stale, false);
1736
- assert.doesNotMatch(result.data.reasons.join(' '), /leader_attention_pending:leader_session_stopped/);
1737
- }
1738
- }
1739
- finally {
1740
- await cleanup();
1741
- }
1742
- });
1743
- it('suppresses stale native-stop attention after newer detached worktree progress', async () => {
1744
- const { cwd, cleanup } = await setupTeam('stall-state-detached-progress');
1745
- try {
1746
- const workerWorktree = join(cwd, 'worktrees', 'worker-1');
1747
- await mkdir(join(workerWorktree, '.rcs', 'state'), { recursive: true });
1748
- const manifest = await readTeamManifestV2('stall-state-detached-progress', cwd);
1749
- assert.ok(manifest);
1750
- await writeTeamManifestV2({
1751
- ...manifest,
1752
- workers: (manifest.workers ?? []).map((worker) => (worker.name === 'worker-1'
1753
- ? { ...worker, worktree_path: workerWorktree }
1754
- : worker)),
1755
- }, cwd);
1756
- await writeTeamLeaderAttention('stall-state-detached-progress', {
1757
- team_name: 'stall-state-detached-progress',
1758
- updated_at: '2026-03-10T10:05:00.000Z',
1759
- source: 'native_stop',
1760
- leader_decision_state: 'still_actionable',
1761
- leader_attention_pending: true,
1762
- leader_attention_reason: 'leader_session_stopped',
1763
- attention_reasons: ['leader_session_stopped'],
1764
- leader_stale: false,
1765
- leader_session_active: false,
1766
- leader_session_id: 'leader-session-1',
1767
- leader_session_stopped_at: '2026-03-10T10:05:00.000Z',
1768
- unread_leader_message_count: 0,
1769
- work_remaining: false,
1770
- stalled_for_ms: null,
1771
- }, cwd);
1772
- await writeFile(join(workerWorktree, '.rcs', 'state', 'current-task-baseline.json'), JSON.stringify({
1773
- version: 1,
1774
- tasks: [],
1775
- }, null, 2));
1776
- const result = await executeTeamApiOperation('read-stall-state', {
1777
- team_name: 'stall-state-detached-progress',
1778
- }, cwd);
1779
- assert.equal(result.ok, true);
1780
- if (result.ok) {
1781
- assert.equal(result.data.leader_attention_pending, false);
1782
- assert.equal(result.data.leader_stale, false);
1783
- assert.doesNotMatch(result.data.reasons.join(' '), /leader_attention_pending:leader_session_stopped/);
1784
- }
1785
- }
1786
- finally {
1787
- await cleanup();
1788
- }
1789
- });
1790
- it('marks only active leader-owned teams as stopped on session end', async () => {
1791
- const { cwd, cleanup } = await setupTeam('owned-team');
1792
- try {
1793
- await initTeamState('other-team', 'Other', 'executor', 1, cwd);
1794
- const ownedManifest = await readTeamManifestV2('owned-team', cwd);
1795
- const otherManifest = await readTeamManifestV2('other-team', cwd);
1796
- assert.ok(ownedManifest);
1797
- assert.ok(otherManifest);
1798
- await writeTeamManifestV2({
1799
- ...ownedManifest,
1800
- leader: {
1801
- ...ownedManifest.leader,
1802
- session_id: 'leader-session-1',
1803
- },
1804
- }, cwd);
1805
- await writeTeamManifestV2({
1806
- ...otherManifest,
1807
- leader: {
1808
- ...otherManifest.leader,
1809
- session_id: 'leader-session-2',
1810
- },
1811
- }, cwd);
1812
- await writeTeamLeaderAttention('owned-team', {
1813
- team_name: 'owned-team',
1814
- updated_at: '2026-03-10T10:12:00.000Z',
1815
- source: 'notify_hook',
1816
- leader_decision_state: 'still_actionable',
1817
- leader_attention_pending: true,
1818
- leader_attention_reason: 'stale_leader_with_messages',
1819
- attention_reasons: ['stale_leader_with_messages'],
1820
- leader_stale: true,
1821
- leader_session_active: true,
1822
- leader_session_id: 'leader-session-1',
1823
- leader_session_stopped_at: null,
1824
- unread_leader_message_count: 1,
1825
- work_remaining: true,
1826
- stalled_for_ms: null,
1827
- }, cwd);
1828
- await writeTeamPhase('other-team', {
1829
- current_phase: 'complete',
1830
- max_fix_attempts: 3,
1831
- current_fix_attempt: 0,
1832
- transitions: [],
1833
- updated_at: '2026-03-10T10:10:00.000Z',
1834
- }, cwd);
1835
- const updatedTeams = await markOwnedTeamsLeaderSessionStopped(cwd, 'leader-session-1', '2026-03-10T10:15:00.000Z');
1836
- assert.deepEqual(updatedTeams, ['owned-team']);
1837
- const ownedAttention = await readTeamLeaderAttention('owned-team', cwd);
1838
- const otherAttention = await readTeamLeaderAttention('other-team', cwd);
1839
- assert.equal(ownedAttention?.leader_session_active, false);
1840
- assert.equal(ownedAttention?.leader_attention_pending, true);
1841
- assert.equal(ownedAttention?.leader_attention_reason, 'stale_leader_with_messages');
1842
- assert.deepEqual(ownedAttention?.attention_reasons, ['stale_leader_with_messages', 'leader_session_stopped']);
1843
- assert.equal(otherAttention, null);
1844
- }
1845
- finally {
1846
- await cleanup();
1847
- }
1848
- });
1849
- it('marks only active leader-owned teams from the native stop hook', async () => {
1850
- const { cwd, cleanup } = await setupTeam('owned-stop-team');
1851
- try {
1852
- const ownedManifest = await readTeamManifestV2('owned-stop-team', cwd);
1853
- assert.ok(ownedManifest);
1854
- await writeTeamManifestV2({
1855
- ...ownedManifest,
1856
- leader: {
1857
- ...ownedManifest.leader,
1858
- session_id: 'leader-session-stop',
1859
- },
1860
- }, cwd);
1861
- const updatedTeams = await markOwnedTeamsLeaderStopObserved(cwd, 'leader-session-stop', '2026-03-10T10:15:00.000Z');
1862
- assert.deepEqual(updatedTeams, ['owned-stop-team']);
1863
- const ownedAttention = await readTeamLeaderAttention('owned-stop-team', cwd);
1864
- assert.equal(ownedAttention?.source, 'native_stop');
1865
- assert.equal(ownedAttention?.leader_session_active, false);
1866
- }
1867
- finally {
1868
- await cleanup();
1869
- }
1870
- });
1871
- });
1872
- // ─── get-summary ──────────────────────────────────────────────────────────
1873
- describe('executeTeamApiOperation: get-summary', () => {
1874
- it('returns summary for existing team', async () => {
1875
- const { cwd, cleanup } = await setupTeam('sum-team');
1876
- try {
1877
- const result = await executeTeamApiOperation('get-summary', {
1878
- team_name: 'sum-team',
1879
- }, cwd);
1880
- assert.equal(result.ok, true);
1881
- }
1882
- finally {
1883
- await cleanup();
1884
- }
1885
- });
1886
- it('returns team_not_found for nonexistent team', async () => {
1887
- const cwd = await mkdtemp(join(tmpdir(), 'rcs-interop-sum-nf-'));
1888
- try {
1889
- const result = await executeTeamApiOperation('get-summary', {
1890
- team_name: 'nonexistent-sum',
1891
- }, cwd);
1892
- assert.equal(result.ok, false);
1893
- if (!result.ok)
1894
- assert.equal(result.error.code, 'team_not_found');
1895
- }
1896
- finally {
1897
- await rm(cwd, { recursive: true, force: true });
1898
- }
1899
- });
1900
- it('returns error when team_name missing', async () => {
1901
- const result = await executeTeamApiOperation('get-summary', {}, '/tmp');
1902
- assert.equal(result.ok, false);
1903
- });
1904
- });
1905
- // ─── cleanup ──────────────────────────────────────────────────────────────
1906
- describe('executeTeamApiOperation: cleanup', () => {
1907
- it('routes normal cleanup through shutdownTeam', async () => {
1908
- const { cwd, cleanup } = await setupTeam('cleanup-team');
1909
- try {
1910
- const result = await executeTeamApiOperation('cleanup', {
1911
- team_name: 'cleanup-team',
1912
- }, cwd);
1913
- assert.equal(result.ok, true);
1914
- if (result.ok) {
1915
- assert.equal(result.data.team_name, 'cleanup-team');
1916
- assert.equal(result.data.cleanup_mode, 'shutdown');
1917
- }
1918
- }
1919
- finally {
1920
- await cleanup();
1921
- }
1922
- });
1923
- it('deactivates lingering team mode state after cleanup removes canonical team state', async () => {
1924
- const { cwd, cleanup } = await setupTeam('cleanup-mode-sync');
1925
- try {
1926
- const stateDir = join(cwd, '.rcs', 'state');
1927
- const sessionId = 'sess-cleanup-mode-sync';
1928
- await mkdir(join(stateDir, 'sessions', sessionId), { recursive: true });
1929
- await writeFile(join(stateDir, 'session.json'), JSON.stringify({ session_id: sessionId }, null, 2));
1930
- const manifest = await readTeamManifestV2('cleanup-mode-sync', cwd);
1931
- assert.ok(manifest);
1932
- if (!manifest)
1933
- throw new Error('manifest missing');
1934
- await writeTeamManifestV2({
1935
- ...manifest,
1936
- leader: {
1937
- ...(manifest.leader ?? {}),
1938
- session_id: sessionId,
1939
- },
1940
- }, cwd);
1941
- const activeState = {
1942
- active: true,
1943
- current_phase: 'starting',
1944
- team_name: 'cleanup-mode-sync',
1945
- session_id: sessionId,
1946
- };
1947
- await writeFile(join(stateDir, 'team-state.json'), JSON.stringify(activeState, null, 2));
1948
- await writeFile(join(stateDir, 'sessions', sessionId, 'team-state.json'), JSON.stringify(activeState, null, 2));
1949
- const result = await executeTeamApiOperation('cleanup', {
1950
- team_name: 'cleanup-mode-sync',
1951
- }, cwd);
1952
- assert.equal(result.ok, true);
1953
- const rootState = JSON.parse(await readFile(join(stateDir, 'team-state.json'), 'utf-8'));
1954
- assert.equal(rootState.active, false);
1955
- assert.equal(rootState.current_phase, 'cancelled');
1956
- assert.ok(typeof rootState.completed_at === 'string' && rootState.completed_at.length > 0);
1957
- const scopedState = JSON.parse(await readFile(join(stateDir, 'sessions', sessionId, 'team-state.json'), 'utf-8'));
1958
- assert.equal(scopedState.active, false);
1959
- assert.equal(scopedState.current_phase, 'cancelled');
1960
- assert.ok(typeof scopedState.completed_at === 'string' && scopedState.completed_at.length > 0);
1961
- }
1962
- finally {
1963
- await cleanup();
1964
- }
1965
- });
1966
- it('does not bypass shutdown gate for pending work', async () => {
1967
- const { cwd, cleanup } = await setupTeam('cleanup-gated');
1968
- try {
1969
- await createTask('cleanup-gated', {
1970
- subject: 'pending task',
1971
- description: 'should block normal cleanup',
1972
- status: 'pending',
1973
- }, cwd);
1974
- const result = await executeTeamApiOperation('cleanup', {
1975
- team_name: 'cleanup-gated',
1976
- }, cwd);
1977
- assert.equal(result.ok, false);
1978
- if (!result.ok)
1979
- assert.match(result.error.message, /shutdown_gate_blocked/);
1980
- }
1981
- finally {
1982
- await cleanup();
1983
- }
1984
- });
1985
- it('returns error when team_name missing', async () => {
1986
- const result = await executeTeamApiOperation('cleanup', {}, '/tmp');
1987
- assert.equal(result.ok, false);
1988
- });
1989
- it('requires confirm_issues for failed-task cleanup on normal teams', async () => {
1990
- const { cwd, cleanup } = await setupTeam('cleanup-gate');
1991
- try {
1992
- await createTask('cleanup-gate', {
1993
- subject: 'failed task',
1994
- description: 'must keep team state when gate blocks cleanup',
1995
- status: 'failed',
1996
- }, cwd);
1997
- const result = await executeTeamApiOperation('cleanup', {
1998
- team_name: 'cleanup-gate',
1999
- }, cwd);
2000
- assert.equal(result.ok, false);
2001
- if (!result.ok) {
2002
- assert.match(result.error.message, /shutdown_confirm_issues_required:failed=1/);
2003
- }
2004
- const summary = await executeTeamApiOperation('get-summary', {
2005
- team_name: 'cleanup-gate',
2006
- }, cwd);
2007
- assert.equal(summary.ok, true);
2008
- }
2009
- finally {
2010
- await cleanup();
2011
- }
2012
- });
2013
- it('allows cleanup with confirm_issues when failed tasks remain', async () => {
2014
- const { cwd, cleanup } = await setupTeam('cleanup-confirm-issues');
2015
- try {
2016
- await createTask('cleanup-confirm-issues', {
2017
- subject: 'failed task',
2018
- description: 'requires explicit confirmation',
2019
- status: 'failed',
2020
- }, cwd);
2021
- const result = await executeTeamApiOperation('cleanup', {
2022
- team_name: 'cleanup-confirm-issues',
2023
- confirm_issues: true,
2024
- }, cwd);
2025
- assert.equal(result.ok, true);
2026
- if (result.ok) {
2027
- assert.equal(result.data.team_name, 'cleanup-confirm-issues');
2028
- assert.equal(result.data.cleanup_mode, 'shutdown');
2029
- }
2030
- }
2031
- finally {
2032
- await cleanup();
2033
- }
2034
- });
2035
- });
2036
- describe('executeTeamApiOperation: orphan-cleanup', () => {
2037
- it('uses destructive orphan cleanup explicitly', async () => {
2038
- const { cwd } = await setupTeam('cleanup-orphan');
2039
- const result = await executeTeamApiOperation('orphan-cleanup', {
2040
- team_name: 'cleanup-orphan',
2041
- }, cwd);
2042
- assert.equal(result.ok, true);
2043
- if (result.ok) {
2044
- assert.equal(result.data.team_name, 'cleanup-orphan');
2045
- assert.equal(result.data.cleanup_mode, 'orphan_cleanup');
2046
- }
2047
- });
2048
- it('resolves display team names before orphan cleanup', async () => {
2049
- const { cwd, cleanup } = await setupDisplayTeam('orphan-display-111111', 'orphan-display', 'session-orphan-display');
2050
- try {
2051
- const result = await executeTeamApiOperation('orphan-cleanup', {
2052
- team_name: 'orphan-display',
2053
- }, cwd);
2054
- assert.equal(result.ok, true);
2055
- if (result.ok) {
2056
- assert.equal(result.data.team_name, 'orphan-display-111111');
2057
- assert.equal(result.data.cleanup_mode, 'orphan_cleanup');
2058
- }
2059
- }
2060
- finally {
2061
- await cleanup();
2062
- }
2063
- });
2064
- it('returns error when team_name missing', async () => {
2065
- const result = await executeTeamApiOperation('orphan-cleanup', {}, '/tmp');
2066
- assert.equal(result.ok, false);
2067
- });
2068
- });
2069
- // ─── write-shutdown-request ───────────────────────────────────────────────
2070
- describe('executeTeamApiOperation: write-shutdown-request', () => {
2071
- it('writes a shutdown request', async () => {
2072
- const { cwd, cleanup } = await setupTeam('sd-req');
2073
- try {
2074
- const result = await executeTeamApiOperation('write-shutdown-request', {
2075
- team_name: 'sd-req', worker: 'worker-1', requested_by: 'leader-fixed',
2076
- }, cwd);
2077
- assert.equal(result.ok, true);
2078
- }
2079
- finally {
2080
- await cleanup();
2081
- }
2082
- });
2083
- it('returns error when required fields missing', async () => {
2084
- const result = await executeTeamApiOperation('write-shutdown-request', {
2085
- team_name: 'x', worker: 'w1',
2086
- }, '/tmp');
2087
- assert.equal(result.ok, false);
2088
- });
2089
- });
2090
- // ─── read-shutdown-ack ────────────────────────────────────────────────────
2091
- describe('executeTeamApiOperation: read-shutdown-ack', () => {
2092
- it('reads shutdown ack (null when not present)', async () => {
2093
- const { cwd, cleanup } = await setupTeam('sd-ack');
2094
- try {
2095
- const result = await executeTeamApiOperation('read-shutdown-ack', {
2096
- team_name: 'sd-ack', worker: 'worker-1',
2097
- }, cwd);
2098
- assert.equal(result.ok, true);
2099
- }
2100
- finally {
2101
- await cleanup();
2102
- }
2103
- });
2104
- it('supports min_updated_at parameter', async () => {
2105
- const { cwd, cleanup } = await setupTeam('sd-ack-min');
2106
- try {
2107
- const result = await executeTeamApiOperation('read-shutdown-ack', {
2108
- team_name: 'sd-ack-min', worker: 'worker-1', min_updated_at: new Date().toISOString(),
2109
- }, cwd);
2110
- assert.equal(result.ok, true);
2111
- }
2112
- finally {
2113
- await cleanup();
2114
- }
2115
- });
2116
- it('returns error when required fields missing', async () => {
2117
- const result = await executeTeamApiOperation('read-shutdown-ack', {
2118
- team_name: 'x',
2119
- }, '/tmp');
2120
- assert.equal(result.ok, false);
2121
- });
2122
- });
2123
- // ─── read-monitor-snapshot ────────────────────────────────────────────────
2124
- describe('executeTeamApiOperation: read-monitor-snapshot', () => {
2125
- it('reads monitor snapshot', async () => {
2126
- const { cwd, cleanup } = await setupTeam('rd-mon');
2127
- try {
2128
- const result = await executeTeamApiOperation('read-monitor-snapshot', {
2129
- team_name: 'rd-mon',
2130
- }, cwd);
2131
- assert.equal(result.ok, true);
2132
- }
2133
- finally {
2134
- await cleanup();
2135
- }
2136
- });
2137
- it('returns error when team_name missing', async () => {
2138
- const result = await executeTeamApiOperation('read-monitor-snapshot', {}, '/tmp');
2139
- assert.equal(result.ok, false);
2140
- });
2141
- });
2142
- // ─── write-monitor-snapshot ───────────────────────────────────────────────
2143
- describe('executeTeamApiOperation: write-monitor-snapshot', () => {
2144
- it('writes monitor snapshot', async () => {
2145
- const { cwd, cleanup } = await setupTeam('wr-mon');
2146
- try {
2147
- const result = await executeTeamApiOperation('write-monitor-snapshot', {
2148
- team_name: 'wr-mon',
2149
- snapshot: {
2150
- teamName: 'wr-mon',
2151
- phase: 'team-exec',
2152
- workers: [],
2153
- tasks: { total: 0, pending: 0, blocked: 0, in_progress: 0, completed: 0, failed: 0 },
2154
- deadWorkers: [],
2155
- nonReportingWorkers: [],
2156
- },
2157
- }, cwd);
2158
- assert.equal(result.ok, true);
2159
- }
2160
- finally {
2161
- await cleanup();
2162
- }
2163
- });
2164
- it('returns error when snapshot missing', async () => {
2165
- const result = await executeTeamApiOperation('write-monitor-snapshot', {
2166
- team_name: 'x',
2167
- }, '/tmp');
2168
- assert.equal(result.ok, false);
2169
- });
2170
- });
2171
- // ─── read-task-approval ───────────────────────────────────────────────────
2172
- describe('executeTeamApiOperation: read-task-approval', () => {
2173
- it('reads task approval (null when not set)', async () => {
2174
- const { cwd, cleanup } = await setupTeam('rd-appr');
2175
- try {
2176
- const task = await createTask('rd-appr', { subject: 'A', description: 'B', status: 'pending' }, cwd);
2177
- const result = await executeTeamApiOperation('read-task-approval', {
2178
- team_name: 'rd-appr', task_id: task.id,
2179
- }, cwd);
2180
- assert.equal(result.ok, true);
2181
- }
2182
- finally {
2183
- await cleanup();
2184
- }
2185
- });
2186
- it('returns error when required fields missing', async () => {
2187
- const result = await executeTeamApiOperation('read-task-approval', {
2188
- team_name: 'x',
2189
- }, '/tmp');
2190
- assert.equal(result.ok, false);
2191
- });
2192
- });
2193
- // ─── write-task-approval ──────────────────────────────────────────────────
2194
- describe('executeTeamApiOperation: write-task-approval', () => {
2195
- it('writes task approval successfully', async () => {
2196
- const { cwd, cleanup } = await setupTeam('wr-appr');
2197
- try {
2198
- const task = await createTask('wr-appr', { subject: 'A', description: 'B', status: 'pending' }, cwd);
2199
- const result = await executeTeamApiOperation('write-task-approval', {
2200
- team_name: 'wr-appr', task_id: task.id, status: 'approved',
2201
- reviewer: 'leader-fixed', decision_reason: 'Looks good',
2202
- }, cwd);
2203
- assert.equal(result.ok, true);
2204
- }
2205
- finally {
2206
- await cleanup();
2207
- }
2208
- });
2209
- it('rejects invalid approval status', async () => {
2210
- const result = await executeTeamApiOperation('write-task-approval', {
2211
- team_name: 'x', task_id: '1', status: 'maybe',
2212
- reviewer: 'r', decision_reason: 'reason',
2213
- }, '/tmp');
2214
- assert.equal(result.ok, false);
2215
- if (!result.ok)
2216
- assert.match(result.error.message, /status must be one of/);
2217
- });
2218
- it('rejects non-boolean required field', async () => {
2219
- const result = await executeTeamApiOperation('write-task-approval', {
2220
- team_name: 'x', task_id: '1', status: 'approved',
2221
- reviewer: 'r', decision_reason: 'reason', required: 'yes',
2222
- }, '/tmp');
2223
- assert.equal(result.ok, false);
2224
- if (!result.ok)
2225
- assert.match(result.error.message, /required must be a boolean/);
2226
- });
2227
- it('returns error when required fields missing', async () => {
2228
- const result = await executeTeamApiOperation('write-task-approval', {
2229
- team_name: 'x', task_id: '1',
2230
- }, '/tmp');
2231
- assert.equal(result.ok, false);
2232
- });
2233
- });
2234
- // ─── error envelope (catch block) ─────────────────────────────────────────
2235
- describe('executeTeamApiOperation: error handling', () => {
2236
- it('wraps thrown errors in an error envelope', async () => {
2237
- const cwd = await mkdtemp(join(tmpdir(), 'rcs-interop-err-'));
2238
- try {
2239
- await mkdir(join(cwd, '.rcs', 'state', 'team', 'err-team'), { recursive: true });
2240
- await writeFile(join(cwd, '.rcs', 'state', 'team', 'err-team', 'config.json'), '{}', 'utf8');
2241
- const result = await executeTeamApiOperation('claim-task', {
2242
- team_name: 'err-team', task_id: '1', worker: 'w1',
2243
- }, cwd);
2244
- assert.ok(result.ok === true || result.ok === false);
2245
- if (!result.ok) {
2246
- assert.equal(result.operation, 'claim-task');
2247
- assert.ok(result.error.code);
2248
- assert.ok(result.error.message);
2249
- }
2250
- }
2251
- finally {
2252
- await rm(cwd, { recursive: true, force: true });
2253
- }
2254
- });
2255
- it('resolves team cwd from empty team_name using fallback', async () => {
2256
- const result = await executeTeamApiOperation('list-tasks', {
2257
- team_name: '',
2258
- }, '/tmp');
2259
- assert.equal(result.ok, false);
2260
- });
2261
- });
2262
- //# sourceMappingURL=api-interop.test.js.map