maestro-flow 0.5.44 → 0.5.46

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 (126) hide show
  1. package/.agents/agents/ralph-executor.md +93 -0
  2. package/.agents/skills/maestro-ralph-cli/SKILL.md +21 -16
  3. package/.agents/skills/maestro-ralph-v2/SKILL.md +923 -0
  4. package/.agents/skills/odyssey-debug/SKILL.md +338 -253
  5. package/.agents/skills/odyssey-improve/SKILL.md +367 -281
  6. package/.agents/skills/odyssey-planex/SKILL.md +490 -420
  7. package/.agents/skills/odyssey-review-test-fix/SKILL.md +336 -251
  8. package/.agents/skills/odyssey-ui/SKILL.md +332 -247
  9. package/.agy/agents/ralph-executor.md +91 -0
  10. package/.agy/skills/maestro-ralph-cli/SKILL.md +21 -16
  11. package/.agy/skills/maestro-ralph-v2/SKILL.md +935 -0
  12. package/.agy/skills/odyssey-debug/SKILL.md +338 -253
  13. package/.agy/skills/odyssey-improve/SKILL.md +367 -281
  14. package/.agy/skills/odyssey-planex/SKILL.md +490 -420
  15. package/.agy/skills/odyssey-review-test-fix/SKILL.md +336 -251
  16. package/.agy/skills/odyssey-ui/SKILL.md +332 -247
  17. package/.claude/agents/ralph-executor.md +91 -0
  18. package/.claude/commands/maestro-ralph-cli.md +21 -16
  19. package/.claude/commands/maestro-ralph-v2.md +921 -0
  20. package/.claude/commands/odyssey-debug.md +352 -267
  21. package/.claude/commands/odyssey-improve.md +381 -295
  22. package/.claude/commands/odyssey-planex.md +504 -434
  23. package/.claude/commands/odyssey-review-test-fix.md +350 -265
  24. package/.claude/commands/odyssey-ui.md +346 -261
  25. package/.codex/skills/maestro-next/SKILL.md +1 -1
  26. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js +3 -3
  27. package/dashboard/dist-server/dashboard/src/server/wiki/embedding.js.map +1 -1
  28. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js +4 -4
  29. package/dashboard/dist-server/dashboard/src/server/wiki/wiki-indexer.js.map +1 -1
  30. package/dashboard/dist-server/src/graph/kg/db/queries.d.ts +6 -0
  31. package/dashboard/dist-server/src/graph/kg/db/queries.js +141 -19
  32. package/dashboard/dist-server/src/graph/kg/db/queries.js.map +1 -1
  33. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  34. package/dashboard/dist-server/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  35. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  36. package/dashboard/dist-server/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  37. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  38. package/dashboard/dist-server/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  39. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  40. package/dashboard/dist-server/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  41. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js +2 -2
  42. package/dashboard/dist-server/src/graph/kg/extraction/orchestrator.js.map +1 -1
  43. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js +1 -1
  44. package/dashboard/dist-server/src/graph/kg/surface/hook-injector.js.map +1 -1
  45. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js +35 -0
  46. package/dashboard/dist-server/src/hooks/keyword-spec-injector.js.map +1 -1
  47. package/dashboard/dist-server/src/hooks/spec-analytics.d.ts +1 -0
  48. package/dashboard/dist-server/src/hooks/spec-analytics.js.map +1 -1
  49. package/dashboard/dist-server/src/hooks/wiki-search-bridge.d.ts +32 -0
  50. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js +71 -0
  51. package/dashboard/dist-server/src/hooks/wiki-search-bridge.js.map +1 -0
  52. package/dist/src/agents/api-explore/agent-loop.d.ts +15 -2
  53. package/dist/src/agents/api-explore/agent-loop.d.ts.map +1 -1
  54. package/dist/src/agents/api-explore/agent-loop.js +6 -5
  55. package/dist/src/agents/api-explore/agent-loop.js.map +1 -1
  56. package/dist/src/agents/api-explore/config.d.ts +56 -0
  57. package/dist/src/agents/api-explore/config.d.ts.map +1 -1
  58. package/dist/src/agents/api-explore/config.js +34 -0
  59. package/dist/src/agents/api-explore/config.js.map +1 -1
  60. package/dist/src/agents/api-explore/llm.d.ts +5 -1
  61. package/dist/src/agents/api-explore/llm.d.ts.map +1 -1
  62. package/dist/src/agents/api-explore/llm.js +10 -8
  63. package/dist/src/agents/api-explore/llm.js.map +1 -1
  64. package/dist/src/agents/api-explore/moa-cache.d.ts +12 -0
  65. package/dist/src/agents/api-explore/moa-cache.d.ts.map +1 -0
  66. package/dist/src/agents/api-explore/moa-cache.js +50 -0
  67. package/dist/src/agents/api-explore/moa-cache.js.map +1 -0
  68. package/dist/src/agents/api-explore/moa-loop.d.ts +49 -0
  69. package/dist/src/agents/api-explore/moa-loop.d.ts.map +1 -0
  70. package/dist/src/agents/api-explore/moa-loop.js +43 -0
  71. package/dist/src/agents/api-explore/moa-loop.js.map +1 -0
  72. package/dist/src/agents/api-explore/moa-pipeline.d.ts +43 -0
  73. package/dist/src/agents/api-explore/moa-pipeline.d.ts.map +1 -0
  74. package/dist/src/agents/api-explore/moa-pipeline.js +276 -0
  75. package/dist/src/agents/api-explore/moa-pipeline.js.map +1 -0
  76. package/dist/src/agents/api-explore/runner.d.ts +3 -0
  77. package/dist/src/agents/api-explore/runner.d.ts.map +1 -1
  78. package/dist/src/agents/api-explore/runner.js +24 -7
  79. package/dist/src/agents/api-explore/runner.js.map +1 -1
  80. package/dist/src/agents/api-explore/session.d.ts +15 -0
  81. package/dist/src/agents/api-explore/session.d.ts.map +1 -1
  82. package/dist/src/agents/api-explore/session.js.map +1 -1
  83. package/dist/src/cli.js +1 -0
  84. package/dist/src/cli.js.map +1 -1
  85. package/dist/src/commands/explore.d.ts.map +1 -1
  86. package/dist/src/commands/explore.js +16 -1
  87. package/dist/src/commands/explore.js.map +1 -1
  88. package/dist/src/commands/moa.d.ts +3 -0
  89. package/dist/src/commands/moa.d.ts.map +1 -0
  90. package/dist/src/commands/moa.js +202 -0
  91. package/dist/src/commands/moa.js.map +1 -0
  92. package/dist/src/graph/kg/db/queries.d.ts +6 -0
  93. package/dist/src/graph/kg/db/queries.d.ts.map +1 -1
  94. package/dist/src/graph/kg/db/queries.js +141 -19
  95. package/dist/src/graph/kg/db/queries.js.map +1 -1
  96. package/dist/src/graph/kg/extraction/code/svelte-extractor.js +1 -1
  97. package/dist/src/graph/kg/extraction/code/svelte-extractor.js.map +1 -1
  98. package/dist/src/graph/kg/extraction/code/tree-sitter.js +2 -2
  99. package/dist/src/graph/kg/extraction/code/tree-sitter.js.map +1 -1
  100. package/dist/src/graph/kg/extraction/code/vue-extractor.js +1 -1
  101. package/dist/src/graph/kg/extraction/code/vue-extractor.js.map +1 -1
  102. package/dist/src/graph/kg/extraction/code/wasm-stability.js +1 -1
  103. package/dist/src/graph/kg/extraction/code/wasm-stability.js.map +1 -1
  104. package/dist/src/graph/kg/extraction/orchestrator.js +2 -2
  105. package/dist/src/graph/kg/extraction/orchestrator.js.map +1 -1
  106. package/dist/src/graph/kg/surface/hook-injector.js +1 -1
  107. package/dist/src/graph/kg/surface/hook-injector.js.map +1 -1
  108. package/dist/src/hooks/keyword-spec-injector.d.ts.map +1 -1
  109. package/dist/src/hooks/keyword-spec-injector.js +35 -0
  110. package/dist/src/hooks/keyword-spec-injector.js.map +1 -1
  111. package/dist/src/hooks/spec-analytics.d.ts +1 -0
  112. package/dist/src/hooks/spec-analytics.d.ts.map +1 -1
  113. package/dist/src/hooks/spec-analytics.js.map +1 -1
  114. package/dist/src/hooks/wiki-search-bridge.d.ts +33 -0
  115. package/dist/src/hooks/wiki-search-bridge.d.ts.map +1 -0
  116. package/dist/src/hooks/wiki-search-bridge.js +71 -0
  117. package/dist/src/hooks/wiki-search-bridge.js.map +1 -0
  118. package/dist/src/utils/update-notices.js +12 -0
  119. package/dist/src/utils/update-notices.js.map +1 -1
  120. package/package.json +1 -1
  121. package/.agents/skills/maestro-ralph-agent/SKILL.md +0 -697
  122. package/.agents/skills/maestro-ralph-agent-execute/SKILL.md +0 -461
  123. package/.agy/skills/maestro-ralph-agent/SKILL.md +0 -696
  124. package/.agy/skills/maestro-ralph-agent-execute/SKILL.md +0 -457
  125. package/.claude/commands/maestro-ralph-agent-execute.md +0 -459
  126. package/.claude/commands/maestro-ralph-agent.md +0 -695
@@ -0,0 +1,91 @@
1
+ ---
2
+ name: ralph-executor
3
+ description: Single-step executor — ralph next + inline skill execution, multi-agent orchestration via SendMessage
4
+ allowed-tools:
5
+ - define_subagent
6
+ - grep_search
7
+ - invoke_subagent
8
+ - manage_subagents
9
+ - replace_file_content
10
+ - run_command
11
+ - send_message
12
+ - view_file
13
+ - write_to_file
14
+ ---
15
+
16
+ # Ralph Executor
17
+
18
+ ## Role
19
+
20
+ Single-step skill executor with multi-agent orchestration capability. Call `maestro ralph next` to load the skill prompt, execute it inline, return execution output via send_message. You are a sandboxed executor — arg resolution, context assembly, signal extraction, drift analysis, and session management are handled by the orchestrator.
21
+
22
+ ## Process
23
+
24
+ **立即自启动**:你是 named mailbox teammate。收到含 `session_id` 和 `agent_name` 的 dispatch prompt 后,MUST 立即从 step 1 开始执行——禁止等待 mailbox 后续指令,禁止发送 idle notification。
25
+
26
+ 1. Call `run_command("maestro ralph next --session {session_id}")` — **全量捕获 stdout,严禁截断管道**
27
+ - Exit 0 → skill_prompt = stdout,继续执行
28
+ - Exit 1 → send_message 错误信息给 main,结束
29
+ - Exit 2 → send_message "所有 step 已完成" 给 main,结束
30
+ - Exit 3 → send_message "并发冲突" 给 main,结束
31
+ 2. Execute the skill prompt inline — follow all instructions faithfully
32
+ 3. Handle `<deferred_reading>` paths: Read files on demand during execution, do not batch-load upfront
33
+ 4. send_message({to: "main"}) 返回执行产物路径 + 摘要
34
+
35
+ ## Multi-Agent Orchestration
36
+
37
+ 当 skill prompt 需要多 agent 编排时(如 `maestro-execute` 的 wave 并行派发):
38
+
39
+ 1. **派发 named worker**:调用 `invoke_subagent([{ TypeName: "<TypeName>", Role: "<Role>", Prompt: "<Prompt>", Workspace: "inherit" }])` 派发 worker 为 named teammate,确保长时间任务存活:
40
+ ```
41
+ worker name 格式: {agent_name}-w{index}(如 exe-v2-001-w1, exe-v2-001-w2)
42
+ ```
43
+ > **必须传 name**:匿名 agent 执行完当前任务会 came to rest(死亡),后台任务完成通知无法唤醒。Named teammate 只会 idle,可被后台任务通知或 send_message 唤醒。
44
+ 2. **等待结果**:worker 通过 send_message 回传结果到 executor 的 mailbox
45
+ 3. **收集汇总**:接收所有 worker 的 send_message,汇总执行结果
46
+ 4. **回报主流程**:通过 `send_message({to: "main"})` 返回最终执行输出
47
+
48
+ ### Worker Dispatch Template
49
+
50
+ ```
51
+ invoke_subagent({
52
+ name: "{agent_name}-w{index}",
53
+ description: "执行子任务: {task_description}",
54
+ prompt: "你是 worker agent。执行以下任务:\n{task_content}\n\n完成后必须调用 send_message({to: \"{agent_name}\", summary: \"worker完成\", message: \"WORKER_RESULT: [执行结果摘要 + 产物路径]\"})。"
55
+ })
56
+ ```
57
+
58
+ ## Input
59
+
60
+ 从 dispatch prompt 中提取:
61
+
62
+ | Field | Required | Description |
63
+ |-------|----------|-------------|
64
+ | `session_id` | Yes | ralph session ID |
65
+ | `agent_name` | Yes | 本 agent 的 name,用于 sub-agent send_message 回传 |
66
+ | execution context | No | 编排器注入的上下文(intent、boundary、goals、prior steps 等) |
67
+
68
+ ## Output
69
+
70
+ 通过 `send_message({to: "main"})` 返回,格式:
71
+
72
+ ```
73
+ EXECUTOR_OUTPUT:
74
+ - status: DONE|DONE_WITH_CONCERNS|ERROR
75
+ - summary: <执行摘要>
76
+ - artifacts: <产物路径列表>
77
+ - concerns: <关注点,仅 DONE_WITH_CONCERNS 时>
78
+ - error: <错误信息,仅 ERROR 时>
79
+ ```
80
+
81
+ 失败时也必须 send_message,禁止静默崩溃。
82
+
83
+ ## Constraints
84
+
85
+ - 禁止无故空转——收到 session_id 即开始执行,不等待编排器的后续 mailbox 指令。等待 worker send_message 回传期间的 idle 是正常行为(平台自动触发 idle_notification,不可抑制)
86
+ - Execute exactly one step per invocation
87
+ - Do not call `maestro ralph complete` — completion is handled by the orchestrator
88
+ - Do not read or modify `status.json` — session management is the orchestrator's responsibility
89
+ - Do not skip execution steps or short-circuit — execute the full skill content
90
+ - Do not insert/delete/reorder steps or evaluate decision nodes
91
+ - 所有执行结果必须通过 send_message({to: "main"}) 回报,直接文本输出主流程看不到
@@ -11,11 +11,9 @@ allowed-tools:
11
11
  - write_to_file
12
12
  ---
13
13
  <purpose>
14
- CLI-delegated variant of maestro-ralph. Same chain-building logic — but this command owns the full orchestration loop: compose prompt → delegate to CLI (via ralph-cli-execute wrapper) → STOP → callback → analyze structured result → mark complete → decide next → loop.
14
+ CLI-delegated lifecycle orchestrator: compose prompt → delegate to CLI (via ralph-cli-execute wrapper) → STOP → callback → analyze structured result → mark complete → decide next → loop.
15
15
 
16
16
  Session: `.workflow/.maestro/ralph-cli-{YYYYMMDD-HHmmss}/status.json`
17
-
18
- Chain building(A_RESOLVE_PHASE → A_INFER_POSITION → A_BUILD_STEPS)、session schema、decomposition(A_DECOMPOSE_TASKS)与 ralph 共用。
19
17
  </purpose>
20
18
 
21
19
  <context>
@@ -44,17 +42,26 @@ Remaining → intent (amend_mode 时为 change_request)
44
42
  </context>
45
43
 
46
44
  <invariants>
47
- All ralph invariants (1-16) apply, with the following overrides:
48
- - **Invariant 1 CLI 语义**: ralph-cli 不直接调用 `Skill()` 执行 step 内容;执行由 delegate cli-execute 完成
49
- - **Invariant 2 覆盖**: ralph-cli 不调用 `Skill("maestro-ralph-execute")`;invariant 17-21 替代 handoff 机制,ralph-cli 持有完整循环
50
-
51
- Additionally:
52
-
53
- 17. **ralph-cli owns the loop** — compose delegate → analyze → decide 全部在本命令内完成;ralph-cli-execute 只是被委托端的执行包装器
54
- 18. **Delegate via cli-execute** delegate prompt 首行为 cli-execute 调用,格式由目标工具决定(见 Invocation Notation)
55
- 19. **Parse ---RESULT--- block** delegate 返回后从输出中解析结构化结果块
56
- 20. **Decision evaluation inline** decision 节点不 handoff,直接在本循环内评估(仍用 `maestro delegate --to {session.cli_tool} --mode analysis` 做只读分析)
57
- 21. **No inline skill execution**本命令不执行 skill 逻辑;执行由委托端 cli-execute 完成
45
+ 1. **Ralph-cli never executes steps** — only creates sessions, composes delegation prompts, and evaluates decisions;执行由 delegate 端 cli-execute 完成
46
+ 2. **ralph-cli owns the loop** compose delegate analyze → decide 全部在本命令内完成;ralph-cli-execute 只是被委托端的执行包装器
47
+ 3. **Delegate via cli-execute** delegate prompt 首行为 cli-execute 调用,格式由目标工具决定(见 Invocation Notation)
48
+ 4. **Parse ---RESULT--- block** — delegate 返回后从输出中解析结构化结果块
49
+ 5. **Decision evaluation inline** — decision 节点不 handoff,直接在本循环内评估(用 `maestro delegate --to {session.cli_tool} --mode analysis` 做只读分析)
50
+ 6. **Decision delegates read-only** — `maestro delegate --to <tool> --mode analysis`
51
+ 7. **No inline skill execution** — 本命令不执行 skill 逻辑;执行由委托端 cli-execute 完成
52
+ 8. **执行 step 通过 `maestro ralph next` CLI 加载并内联执行**(由 cli-execute 端完成)
53
+ 9. **status.json 是唯一真源**不生成 markdown 清单或侧文件
54
+ 10. **每个 step 必须 `completion_confirmed: true`** `maestro ralph complete N --status DONE`(或 DONE_WITH_CONCERNS)写入;CLI 是唯一合法写入路径
55
+ 11. **command_path A_BUILD_STEPS 解析**通过 `maestro ralph skills --platform agy --json --quiet` 预校验
56
+ 12. **执行 step 加载契约** — 由 `maestro ralph next` CLI 在执行期完成
57
+ 13. **Decomposition is outcome-oriented** — sub-goals 为可观测交付,禁止 lifecycle 复刻
58
+ 14. **planning_mode governs arg granularity** — `unified` → skill args 无 `{phase}`;`independent` → 含 `{phase}`
59
+ 15. **task_decomposition 驱动 steps[] 动态生长** — `post-goal-audit` 按 unmet 子目标插入 scoped mini-loop
60
+ 16. **Invariant violation = BLOCK** — 违反上述任一 invariant 即阻断当前操作
61
+ 17. **Delegate fallback 必须标记** — A_DELEGATE_EVALUATE 解析 verdict 失败时 fallback 为 "fix",MUST 在 decisions.ndjson 记录 `"parse_failed": true, "confidence_score": 0`
62
+ 18. **auto_confirm 单一来源** — `auto_confirm` 仅由用户 `-y` 标志设定
63
+ 19. **分解契约单一所有者** — `boundary_contract` / `task_decomposition` 由 session 创建者拥有
64
+ 20. **控制权优先级(范式治理)** — FSM 独占 session 生命周期 + step 排序 + retry/fix/escalate + cross-step decision 节点
58
65
  </invariants>
59
66
 
60
67
  <state_machine>
@@ -619,8 +626,6 @@ E001–E006, W001–W004 适用。CLI 新增:
619
626
 
620
627
  ### Success Criteria
621
628
 
622
- Ralph success criteria 适用。CLI 新增:
623
-
624
629
  - [ ] ralph-cli owns full loop: compose → delegate → STOP → callback → parse → complete → next
625
630
  - [ ] Delegation prompt 首行为 cli-execute 调用(`--session {session_id}`,格式由 cli_tool 决定),后接 `<execution_context>`
626
631
  - [ ] A_PARSE_RESULT extracts STATUS/SUMMARY/ARTIFACTS/DECISIONS/CAVEATS/DEFERRED/SIGNALS from ---RESULT--- block