@zhixuan92/multi-model-agent 5.1.0 → 5.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (117) hide show
  1. package/dist/cli/serve.d.ts.map +1 -1
  2. package/dist/cli/serve.js +9 -34
  3. package/dist/cli/serve.js.map +1 -1
  4. package/dist/cli/status.js +1 -1
  5. package/dist/cli/status.js.map +1 -1
  6. package/dist/http/handler-deps.d.ts +3 -3
  7. package/dist/http/handler-deps.d.ts.map +1 -1
  8. package/dist/http/handlers/control/context-blocks.d.ts +1 -2
  9. package/dist/http/handlers/control/context-blocks.d.ts.map +1 -1
  10. package/dist/http/handlers/control/context-blocks.js +7 -30
  11. package/dist/http/handlers/control/context-blocks.js.map +1 -1
  12. package/dist/http/handlers/introspection/status.d.ts +3 -3
  13. package/dist/http/handlers/introspection/status.d.ts.map +1 -1
  14. package/dist/http/handlers/introspection/status.js +13 -31
  15. package/dist/http/handlers/introspection/status.js.map +1 -1
  16. package/dist/http/handlers/unified-task.d.ts +5 -0
  17. package/dist/http/handlers/unified-task.d.ts.map +1 -0
  18. package/dist/http/handlers/unified-task.js +520 -0
  19. package/dist/http/handlers/unified-task.js.map +1 -0
  20. package/dist/http/project-registry.d.ts +5 -4
  21. package/dist/http/project-registry.d.ts.map +1 -1
  22. package/dist/http/project-registry.js +5 -7
  23. package/dist/http/project-registry.js.map +1 -1
  24. package/dist/http/server.d.ts +4 -3
  25. package/dist/http/server.d.ts.map +1 -1
  26. package/dist/http/server.js +76 -134
  27. package/dist/http/server.js.map +1 -1
  28. package/dist/skill-install/discover.d.ts +1 -1
  29. package/dist/skill-install/discover.d.ts.map +1 -1
  30. package/dist/skill-install/discover.js +1 -0
  31. package/dist/skill-install/discover.js.map +1 -1
  32. package/dist/skills/_shared/error-handling.md +2 -2
  33. package/dist/skills/_shared/polling.md +7 -7
  34. package/dist/skills/_shared/response-shape.md +8 -8
  35. package/dist/skills/_shared/review-policy.md +1 -3
  36. package/dist/skills/mma-audit/SKILL.md +16 -15
  37. package/dist/skills/mma-context-blocks/SKILL.md +9 -9
  38. package/dist/skills/mma-debug/SKILL.md +9 -13
  39. package/dist/skills/mma-delegate/SKILL.md +14 -13
  40. package/dist/skills/mma-execute-plan/SKILL.md +15 -14
  41. package/dist/skills/mma-explore/SKILL.md +4 -3
  42. package/dist/skills/mma-investigate/SKILL.md +7 -6
  43. package/dist/skills/mma-journal-recall/SKILL.md +7 -6
  44. package/dist/skills/mma-journal-record/SKILL.md +10 -18
  45. package/dist/skills/mma-orchestrate/SKILL.md +74 -0
  46. package/dist/skills/mma-research/SKILL.md +7 -5
  47. package/dist/skills/mma-retry/SKILL.md +38 -37
  48. package/dist/skills/mma-review/SKILL.md +7 -6
  49. package/dist/skills/multi-model-agent/SKILL.md +7 -7
  50. package/dist/telemetry/flusher.d.ts.map +1 -1
  51. package/dist/telemetry/flusher.js +8 -11
  52. package/dist/telemetry/flusher.js.map +1 -1
  53. package/package.json +2 -2
  54. package/dist/http/async-dispatch.d.ts +0 -44
  55. package/dist/http/async-dispatch.d.ts.map +0 -1
  56. package/dist/http/async-dispatch.js +0 -175
  57. package/dist/http/async-dispatch.js.map +0 -1
  58. package/dist/http/canonicalize-file-paths.d.ts +0 -8
  59. package/dist/http/canonicalize-file-paths.d.ts.map +0 -1
  60. package/dist/http/canonicalize-file-paths.js +0 -43
  61. package/dist/http/canonicalize-file-paths.js.map +0 -1
  62. package/dist/http/execution-context.d.ts +0 -18
  63. package/dist/http/execution-context.d.ts.map +0 -1
  64. package/dist/http/execution-context.js +0 -61
  65. package/dist/http/execution-context.js.map +0 -1
  66. package/dist/http/handlers/control/batch-slice.d.ts +0 -4
  67. package/dist/http/handlers/control/batch-slice.d.ts.map +0 -1
  68. package/dist/http/handlers/control/batch-slice.js +0 -40
  69. package/dist/http/handlers/control/batch-slice.js.map +0 -1
  70. package/dist/http/handlers/control/batch.d.ts +0 -23
  71. package/dist/http/handlers/control/batch.d.ts.map +0 -1
  72. package/dist/http/handlers/control/batch.js +0 -332
  73. package/dist/http/handlers/control/batch.js.map +0 -1
  74. package/dist/http/handlers/tools/audit.d.ts +0 -4
  75. package/dist/http/handlers/tools/audit.d.ts.map +0 -1
  76. package/dist/http/handlers/tools/audit.js +0 -43
  77. package/dist/http/handlers/tools/audit.js.map +0 -1
  78. package/dist/http/handlers/tools/debug.d.ts +0 -4
  79. package/dist/http/handlers/tools/debug.d.ts.map +0 -1
  80. package/dist/http/handlers/tools/debug.js +0 -43
  81. package/dist/http/handlers/tools/debug.js.map +0 -1
  82. package/dist/http/handlers/tools/delegate.d.ts +0 -4
  83. package/dist/http/handlers/tools/delegate.d.ts.map +0 -1
  84. package/dist/http/handlers/tools/delegate.js +0 -43
  85. package/dist/http/handlers/tools/delegate.js.map +0 -1
  86. package/dist/http/handlers/tools/execute-plan.d.ts +0 -4
  87. package/dist/http/handlers/tools/execute-plan.d.ts.map +0 -1
  88. package/dist/http/handlers/tools/execute-plan.js +0 -45
  89. package/dist/http/handlers/tools/execute-plan.js.map +0 -1
  90. package/dist/http/handlers/tools/investigate.d.ts +0 -4
  91. package/dist/http/handlers/tools/investigate.d.ts.map +0 -1
  92. package/dist/http/handlers/tools/investigate.js +0 -64
  93. package/dist/http/handlers/tools/investigate.js.map +0 -1
  94. package/dist/http/handlers/tools/journal-recall.d.ts +0 -4
  95. package/dist/http/handlers/tools/journal-recall.d.ts.map +0 -1
  96. package/dist/http/handlers/tools/journal-recall.js +0 -40
  97. package/dist/http/handlers/tools/journal-recall.js.map +0 -1
  98. package/dist/http/handlers/tools/journal-record.d.ts +0 -12
  99. package/dist/http/handlers/tools/journal-record.d.ts.map +0 -1
  100. package/dist/http/handlers/tools/journal-record.js +0 -43
  101. package/dist/http/handlers/tools/journal-record.js.map +0 -1
  102. package/dist/http/handlers/tools/research.d.ts +0 -4
  103. package/dist/http/handlers/tools/research.d.ts.map +0 -1
  104. package/dist/http/handlers/tools/research.js +0 -64
  105. package/dist/http/handlers/tools/research.js.map +0 -1
  106. package/dist/http/handlers/tools/retry.d.ts +0 -4
  107. package/dist/http/handlers/tools/retry.d.ts.map +0 -1
  108. package/dist/http/handlers/tools/retry.js +0 -49
  109. package/dist/http/handlers/tools/retry.js.map +0 -1
  110. package/dist/http/handlers/tools/review.d.ts +0 -4
  111. package/dist/http/handlers/tools/review.d.ts.map +0 -1
  112. package/dist/http/handlers/tools/review.js +0 -43
  113. package/dist/http/handlers/tools/review.js.map +0 -1
  114. package/dist/http/request-observability.d.ts +0 -8
  115. package/dist/http/request-observability.d.ts.map +0 -1
  116. package/dist/http/request-observability.js +0 -20
  117. package/dist/http/request-observability.js.map +0 -1
@@ -12,7 +12,7 @@ when_to_use: >-
12
12
  Register once here, then pass the ID via `contextBlockIds` on mma-delegate /
13
13
  mma-execute-plan / mma-audit / mma-review / mma-debug / mma-investigate.
14
14
  Cheaper and faster than inlining the same content N times.
15
- version: 5.1.0
15
+ version: 5.2.0
16
16
  ---
17
17
 
18
18
  # mma-context-blocks
@@ -56,7 +56,7 @@ Store large documents once; reference them by ID in subsequent `mma-*` calls via
56
56
  | Field | Type | Required | Notes |
57
57
  |---|---|---|---|
58
58
  | `content` | string | yes | Document content (min 1 char, max 50 MiB) |
59
- | `ttlMs` | number | no | Time-to-live in ms; omit for idle-expiry (default 24 h idle). A block that is not referenced by any active batch for 24 h is eligible for eviction. |
59
+ | `ttlMs` | number | no | Time-to-live in ms; omit for idle-expiry (default 24 h idle). A block that is not referenced by any active task for 24 h is eligible for eviction. |
60
60
 
61
61
  #### Response (201)
62
62
 
@@ -70,7 +70,7 @@ Use this `id` as a `contextBlockIds` entry in any `mma-*` skill that supports it
70
70
 
71
71
  `DELETE /context-blocks/:id?cwd=<abs-path>`
72
72
 
73
- Returns `200 { ok: true }` on success. Returns `409 pinned` if the block is held by one or more active batches — wait for those batches to complete before deleting.
73
+ Returns `200 { ok: true }` on success. Returns `409 pinned` if the block is held by one or more active tasks — wait for those tasks to complete before deleting.
74
74
 
75
75
  ## Full example
76
76
 
@@ -90,11 +90,11 @@ curl -f --show-error -s -X POST \
90
90
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
91
91
  -H "Authorization: Bearer $TOKEN" \
92
92
  -H "Content-Type: application/json" \
93
- -d "{\"tasks\":[
93
+ -d "{\"type\":\"delegate\",\"tasks\":[
94
94
  {\"prompt\":\"Implement section 3 per spec\",\"contextBlockIds\":[\"$ID\"]},
95
95
  {\"prompt\":\"Implement section 4 per spec\",\"contextBlockIds\":[\"$ID\"]}
96
96
  ]}" \
97
- "http://localhost:$PORT/delegate?cwd=/project"
97
+ "http://localhost:$PORT/task?cwd=/project"
98
98
  ```
99
99
 
100
100
  ## v5 wire shape (register-context-block route)
@@ -125,7 +125,7 @@ This skill is the cross-cutting state mechanism described in `multi-model-agent`
125
125
  - **Recipe A — Audit-iterate-clean.** Register the doc once before round 1; pass round-N's findings block ID into round N+1.
126
126
  - **Recipe B — Debug-fix-verify.** Register the failing test output / reproduction log before the debug call; reuse on verify.
127
127
  - **Recipe C — Investigate-plan-execute.** Register the plan file before `mma-execute-plan`.
128
- - **Recipe D — Plan-execute-retry.** No new registration needed — `mma-retry` inherits the original batch's `contextBlockIds`.
128
+ - **Recipe D — Plan-execute-retry.** No new registration needed — `mma-retry` inherits the original task's `contextBlockIds`.
129
129
 
130
130
  Anti-pattern alert: **`re-inlined-shared-content`** (AP3). Pasting the same spec into 5 task prompts costs N× tokens. Register once; pass `contextBlockIds`.
131
131
 
@@ -137,12 +137,12 @@ Anti-pattern alert: **`re-inlined-shared-content`** (AP3). Pasting the same spec
137
137
  N×50KB transmissions; main context burns through tokens. **Fix:** register the spec once, pass `contextBlockIds: ["cb_xxx"]` to each task.
138
138
 
139
139
  ❌ **Forgetting to delete unused blocks**
140
- Blocks count against the project's context-block quota (`maxEntries` 500). **Fix:** explicitly `DELETE` after the dependent batches finish — or let idle expiry (24 h) evict them.
140
+ Blocks count against the project's context-block quota (`maxEntries` 500). **Fix:** explicitly `DELETE` after the dependent tasks finish — or let idle expiry (24 h) evict them.
141
141
 
142
142
  ❌ **Trying to update a block's content**
143
143
  Blocks are immutable. **Fix:** register a new block with the new content; switch the `contextBlockIds` to the new ID.
144
144
 
145
- ❌ **Deleting a block while a batch still references it**
146
- Returns `409 pinned`. **Fix:** poll the dependent batches to terminal first, then delete.
145
+ ❌ **Deleting a block while a task still references it**
146
+ Returns `409 pinned`. **Fix:** poll the dependent tasks to terminal first, then delete.
147
147
 
148
148
  @include _shared/error-handling.md
@@ -10,7 +10,7 @@ when_to_use: >-
10
10
  read files, reproduce, trace — OR a methodology skill
11
11
  (superpowers:systematic-debugging) points at the investigation step. Delegate
12
12
  the read/reproduce/trace; the main agent stays on the hypothesis and the fix.
13
- version: 5.1.0
13
+ version: 5.2.0
14
14
  ---
15
15
 
16
16
  # mma-debug
@@ -36,7 +36,7 @@ Submit a problem, context, and hypothesis to a worker for focused debugging. Unl
36
36
 
37
37
  ## Endpoint
38
38
 
39
- `POST /debug?cwd=<abs-path>`
39
+ `POST /task?cwd=<abs-path>`
40
40
 
41
41
  @include _shared/auth.md
42
42
 
@@ -44,10 +44,8 @@ Submit a problem, context, and hypothesis to a worker for focused debugging. Unl
44
44
 
45
45
  ```json
46
46
  {
47
- "problem": "POST /login returns 500 when password contains special characters",
48
- "context": "Regression introduced in commit abc123; only affects production config",
49
- "hypothesis": "The bcrypt binding fails on non-ASCII input in the Docker image",
50
- "subtype": "default",
47
+ "type": "debug",
48
+ "errorMessage": "POST /login returns 500 when password contains special characters",
51
49
  "filePaths": [
52
50
  "/project/src/auth/login.ts",
53
51
  "/project/src/auth/password.ts"
@@ -58,9 +56,7 @@ Submit a problem, context, and hypothesis to a worker for focused debugging. Unl
58
56
 
59
57
  | Field | Type | Required | Notes |
60
58
  |---|---|---|---|
61
- | `problem` | string | yes | What is broken (one sentence; concrete symptom) |
62
- | `context` | string | no | Background — what changed recently, what works, what doesn't |
63
- | `hypothesis` | string | no | Your initial theory; worker tests it first, then explores |
59
+ | `errorMessage` | string | yes | What is broken (one sentence; concrete symptom) |
64
60
  | `subtype` | `'default'` | no (defaults to `'default'`) | Reserved for future criteria sets; only `default` is wired today. |
65
61
  | `filePaths` | string[] | no | All files investigated together (cross-file reasoning) |
66
62
  | `contextBlockIds` | string[] | no | IDs from `mma-context-blocks` (e.g. error logs, traces) |
@@ -70,14 +66,14 @@ Submit a problem, context, and hypothesis to a worker for focused debugging. Unl
70
66
  ## Full example
71
67
 
72
68
  ```bash
73
- BATCH=$(curl -f --show-error -s -X POST \
69
+ RESULT=$(curl -f --show-error -s -X POST \
74
70
  -H "X-MMA-Client: $MMA_CLIENT" \
75
71
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
76
72
  -H "Authorization: Bearer $TOKEN" \
77
73
  -H "Content-Type: application/json" \
78
- -d '{"problem":"Tests fail on CI only","hypothesis":"Missing env var","filePaths":["/project/src/config.ts"]}' \
79
- "http://localhost:$PORT/debug?cwd=/project")
80
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
74
+ -d '{"type":"debug","errorMessage":"Tests fail on CI only","filePaths":["/project/src/config.ts"]}' \
75
+ "http://localhost:$PORT/task?cwd=/project")
76
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
81
77
  ```
82
78
 
83
79
  @include _shared/polling.md
@@ -11,7 +11,7 @@ when_to_use: >-
11
11
  and keep main context free. If a plan file exists → use mma-execute-plan. If
12
12
  the task is audit / review / verify / debug / investigate → use the matching
13
13
  specialized skill.
14
- version: 5.1.0
14
+ version: 5.2.0
15
15
  ---
16
16
 
17
17
  # mma-delegate
@@ -37,7 +37,7 @@ Dispatch one or more ad-hoc tasks to workers concurrently. Each task is an indep
37
37
 
38
38
  ## Endpoint
39
39
 
40
- `POST /delegate?cwd=<abs-path>`
40
+ `POST /task?cwd=<abs-path>`
41
41
 
42
42
  @include _shared/auth.md
43
43
 
@@ -45,6 +45,7 @@ Dispatch one or more ad-hoc tasks to workers concurrently. Each task is an indep
45
45
 
46
46
  ```json
47
47
  {
48
+ "type": "delegate",
48
49
  "tasks": [
49
50
  {
50
51
  "prompt": "Add input validation to the login handler",
@@ -65,46 +66,46 @@ Dispatch one or more ad-hoc tasks to workers concurrently. Each task is an indep
65
66
  | `tasks[].filePaths` | string[] | no | Files the worker focuses on |
66
67
  | `tasks[].done` | string | no | Acceptance criteria |
67
68
  | `tasks[].contextBlockIds` | string[] | no | IDs from `mma-context-blocks` |
68
- | `tasks[].reviewPolicy` | `"full"` / `"quality_only"` / `"diff_only"` / `"none"` | no | See review-policy snippet below. Default `"full"` |
69
+ | `tasks[].reviewPolicy` | `"reviewed"` / `"none"` | no | See review-policy snippet below. Default `"reviewed"` |
69
70
 
70
71
  @include _shared/review-policy.md
71
72
 
72
73
  ## Full example
73
74
 
74
75
  ```bash
75
- BATCH=$(curl -f --show-error -s -X POST \
76
+ RESULT=$(curl -f --show-error -s -X POST \
76
77
  -H "X-MMA-Client: $MMA_CLIENT" \
77
78
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
78
79
  -H "Authorization: Bearer $TOKEN" \
79
80
  -H "Content-Type: application/json" \
80
- -d '{"tasks":[{"prompt":"Refactor utils.ts to remove dead code","filePaths":["/project/src/utils.ts"]}]}' \
81
- "http://localhost:$PORT/delegate?cwd=/project")
82
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
81
+ -d '{"type":"delegate","tasks":[{"prompt":"Refactor utils.ts to remove dead code","filePaths":["/project/src/utils.ts"]}]}' \
82
+ "http://localhost:$PORT/task?cwd=/project")
83
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
83
84
  ```
84
85
 
85
86
  @include _shared/polling.md
86
87
 
87
88
  ## Response shapes
88
89
 
89
- ### POST /delegate?cwd=<abs> — dispatch response (202)
90
+ ### POST /task?cwd=<abs> — dispatch response (202)
90
91
 
91
92
  ```json
92
- { "batchId": "<uuid>", "statusUrl": "/batch/<uuid>" }
93
+ { "taskId": "<uuid>", "statusUrl": "/task/<uuid>" }
93
94
  ```
94
95
 
95
- Use `batchId` to poll. `statusUrl` is a convenience pointer.
96
+ Use `taskId` to poll. `statusUrl` is a convenience pointer.
96
97
 
97
- ### GET /batch/:id — polling response
98
+ ### GET /task/:taskId — polling response
98
99
 
99
100
  The HTTP status is the state discriminator:
100
101
 
101
102
  | Status | Meaning |
102
103
  |---|---|
103
104
  | `202 text/plain` | Still pending — body is the running headline string |
104
- | `200 application/json` | Terminal — body is the batch envelope below |
105
+ | `200 application/json` | Terminal — body is the task envelope below |
105
106
  | `404` / `401` / `5xx` | Error — see Error response below; stop polling |
106
107
 
107
- ### GET /batch/:id?taskIndex=N — single task slice
108
+ ### GET /task/:taskId?taskIndex=N — single task slice
108
109
 
109
110
  Same envelope. `results` contains exactly the task at index `N`. Returns `404 unknown_task_index` if `N` is out of range.
110
111
 
@@ -10,7 +10,7 @@ when_to_use: >-
10
10
  superpowers:subagent-driven-development / superpowers:executing-plans —
11
11
  workers are cheaper and don't pollute main context. Task descriptors must
12
12
  match plan headings verbatim.
13
- version: 5.1.0
13
+ version: 5.2.0
14
14
  ---
15
15
 
16
16
  # mma-execute-plan
@@ -35,7 +35,7 @@ Dispatch named tasks from a plan file to workers. Each `taskDescriptors` string
35
35
 
36
36
  ## Endpoint
37
37
 
38
- `POST /execute-plan?cwd=<abs-path>`
38
+ `POST /task?cwd=<abs-path>`
39
39
 
40
40
  @include _shared/auth.md
41
41
 
@@ -43,6 +43,7 @@ Dispatch named tasks from a plan file to workers. Each `taskDescriptors` string
43
43
 
44
44
  ```json
45
45
  {
46
+ "type": "execute_plan",
46
47
  "taskDescriptors": [
47
48
  "1. Add input validation to login handler",
48
49
  "2. Write unit tests for the auth module"
@@ -59,7 +60,7 @@ Dispatch named tasks from a plan file to workers. Each `taskDescriptors` string
59
60
  | `taskDescriptors` | string[] | yes | At least one; must be unique; each string matches a plan heading verbatim |
60
61
  | `filePaths` | string[] | yes | EXACTLY one entry: the plan markdown file. Source files belong in `contextBlockIds` (registered via `mma-context-blocks`) so workers can grep them on demand without re-inlining into every worker prompt |
61
62
  | `contextBlockIds` | string[] | no | IDs from `mma-context-blocks` — the right place for source files referenced by the plan |
62
- | `perTaskReviewPolicy` | `Record<string, 'full'\|'quality_only'\|'diff_only'\|'none'>` | no | Per-task-index review policy override. Key = task index as string (`"0"`, `"1"`, ...). Default per task: `"full"` |
63
+ | `perTaskReviewPolicy` | `Record<string, 'reviewed'\|'none'>` | no | Per-task-index review policy override. Key = task index as string (`"0"`, `"1"`, ...). Default per task: `"reviewed"` |
63
64
  | `cwd` | string | no | Override the `?cwd=` query param value at the body level (rare; usually pass via query) |
64
65
 
65
66
  @include _shared/review-policy.md
@@ -69,39 +70,39 @@ Dispatch named tasks from a plan file to workers. Each `taskDescriptors` string
69
70
  ## Full example
70
71
 
71
72
  ```bash
72
- BATCH=$(curl -f --show-error -s -X POST \
73
+ RESULT=$(curl -f --show-error -s -X POST \
73
74
  -H "X-MMA-Client: $MMA_CLIENT" \
74
75
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
75
76
  -H "Authorization: Bearer $TOKEN" \
76
77
  -H "Content-Type: application/json" \
77
- -d '{"taskDescriptors":["3. Migrate database schema"],"filePaths":["/project/docs/plan.md"]}' \
78
- "http://localhost:$PORT/execute-plan?cwd=/project")
79
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
78
+ -d '{"type":"execute_plan","taskDescriptors":["3. Migrate database schema"],"filePaths":["/project/docs/plan.md"]}' \
79
+ "http://localhost:$PORT/task?cwd=/project")
80
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
80
81
  ```
81
82
 
82
83
  @include _shared/polling.md
83
84
 
84
85
  ## Response shapes
85
86
 
86
- ### POST /execute-plan?cwd=<abs> — dispatch response (202)
87
+ ### POST /task?cwd=<abs> — dispatch response (202)
87
88
 
88
89
  ```json
89
- { "batchId": "<uuid>", "statusUrl": "/batch/<uuid>" }
90
+ { "taskId": "<uuid>", "statusUrl": "/task/<uuid>" }
90
91
  ```
91
92
 
92
- Use `batchId` to poll. `statusUrl` is a convenience pointer.
93
+ Use `taskId` to poll. `statusUrl` is a convenience pointer.
93
94
 
94
- ### GET /batch/:id — polling response
95
+ ### GET /task/:taskId — polling response
95
96
 
96
97
  The HTTP status is the state discriminator:
97
98
 
98
99
  | Status | Meaning |
99
100
  |---|---|
100
101
  | `202 text/plain` | Still pending — body is the running headline string |
101
- | `200 application/json` | Terminal — body is the batch envelope below |
102
+ | `200 application/json` | Terminal — body is the task envelope below |
102
103
  | `404` / `401` / `5xx` | Error — see Error response below; stop polling |
103
104
 
104
- ### GET /batch/:id?taskIndex=N — single task slice
105
+ ### GET /task/:taskId?taskIndex=N — single task slice
105
106
 
106
107
  Same envelope. `results` contains exactly the task at index `N`. Returns `404 unknown_task_index` if `N` is out of range.
107
108
 
@@ -187,7 +188,7 @@ Use `telemetry.haltedStage` to find the first halt; `telemetry.stopReason` to fi
187
188
  This skill is one step in the larger flow described in `multi-model-agent` → "Best practices". Recipes that involve `mma-execute-plan`:
188
189
 
189
190
  - **Recipe C — Investigate-plan-execute.** `mma-investigate` → write the plan → `mma-execute-plan` → `mma-retry` on failed indices. Register the plan file as a context block before the execute-plan call so it isn't re-inlined into every worker's prompt; retry inherits the same configuration.
190
- - **Recipe D — Plan-execute-retry (entry point).** `mma-execute-plan` is the producer of the `batchId` that `mma-retry` consumes. When this batch returns mixed `done` / `failed`, the next call is `mma-retry` with failed indices, NOT a re-dispatch.
191
+ - **Recipe D — Plan-execute-retry (entry point).** `mma-execute-plan` is the producer of the `taskId` that `mma-retry` consumes. When this dispatch returns mixed `done` / `failed`, the next call is `mma-retry` with failed indices, NOT a re-dispatch.
191
192
 
192
193
  Anti-pattern alert: **`full-batch-redispatch`** (AP4). When the batch returns mixed `done` / `failed`, do NOT re-run the whole task list — use `mma-retry` with the failed indices only. Re-running the whole list re-charges every successful task.
193
194
 
@@ -14,7 +14,7 @@ when_to_use: >-
14
14
  mma-journal-recall (prior learnings/decisions) in parallel and synthesise the
15
15
  results yourself. DO NOT use for convergent single-answer questions — those
16
16
  are mma-investigate.
17
- version: 5.1.0
17
+ version: 5.2.0
18
18
  ---
19
19
 
20
20
  # mma-explore
@@ -81,8 +81,9 @@ result (or have decided to skip investigate as greenfield).
81
81
 
82
82
  This is a main-agent skill — there is no dedicated `/explore` HTTP endpoint.
83
83
  Behind the scenes, you dispatch the three delegated tools `mma-investigate`
84
- (`POST /investigate`), `mma-research` (`POST /research`), and
85
- `mma-journal-recall` (`POST /journal-recall`) yourself.
84
+ (`POST /task` with `type: "investigate"`), `mma-research` (`POST /task` with
85
+ `type: "research"`), and `mma-journal-recall` (`POST /task` with
86
+ `type: "journal_recall"`) yourself.
86
87
 
87
88
  ## Request body
88
89
 
@@ -12,7 +12,7 @@ when_to_use: >-
12
12
  git-history queries. OR you are about to read 3+ files / run any grep in main
13
13
  context — that's the inline-labor-leakage anti-pattern (AP2); delegate to this
14
14
  skill instead.
15
- version: 5.1.0
15
+ version: 5.2.0
16
16
  ---
17
17
 
18
18
  # mma-investigate
@@ -58,7 +58,7 @@ digraph when_to_use {
58
58
 
59
59
  ## Endpoint
60
60
 
61
- `POST /investigate?cwd=<abs-path>`
61
+ `POST /task?cwd=<abs-path>`
62
62
 
63
63
  @include _shared/auth.md
64
64
 
@@ -66,6 +66,7 @@ digraph when_to_use {
66
66
 
67
67
  ```json
68
68
  {
69
+ "type": "investigate",
69
70
  "question": "How does the auth middleware handle token refresh?",
70
71
  "subtype": "default",
71
72
  "filePaths": ["/project/src/auth/"],
@@ -93,14 +94,14 @@ digraph when_to_use {
93
94
  ## Full example
94
95
 
95
96
  ```bash
96
- BATCH=$(curl -f --show-error -s -X POST \
97
+ RESULT=$(curl -f --show-error -s -X POST \
97
98
  -H "X-MMA-Client: $MMA_CLIENT" \
98
99
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
99
100
  -H "Authorization: Bearer $TOKEN" \
100
101
  -H "Content-Type: application/json" \
101
- -d '{"question":"How does the auth middleware handle token refresh?"}' \
102
- "http://localhost:$PORT/investigate?cwd=/project")
103
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
102
+ -d '{"type":"investigate","question":"How does the auth middleware handle token refresh?"}' \
103
+ "http://localhost:$PORT/task?cwd=/project")
104
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
104
105
  ```
105
106
 
106
107
  @include _shared/polling.md
@@ -12,7 +12,7 @@ when_to_use: >-
12
12
  A question about THIS project's learnings, before attempting or designing
13
13
  something — ask a vague conceptual question; skip if recording a new learning,
14
14
  asking the codebase, or researching external docs.
15
- version: 5.1.0
15
+ version: 5.2.0
16
16
  ---
17
17
 
18
18
  # mma-journal-recall
@@ -39,7 +39,7 @@ Recall relevant project learnings from the journal via a read-only mmagent worke
39
39
 
40
40
  ## Endpoint
41
41
 
42
- `POST /journal-recall?cwd=<abs-path>`
42
+ `POST /task?cwd=<abs-path>`
43
43
 
44
44
  @include _shared/auth.md
45
45
 
@@ -47,6 +47,7 @@ Recall relevant project learnings from the journal via a read-only mmagent worke
47
47
 
48
48
  ```json
49
49
  {
50
+ "type": "journal_recall",
50
51
  "query": "what have we learned about dispatch cancellation reliability?",
51
52
  "contextBlockIds": []
52
53
  }
@@ -70,14 +71,14 @@ Recall relevant project learnings from the journal via a read-only mmagent worke
70
71
  ## Full example
71
72
 
72
73
  ```bash
73
- BATCH=$(curl -f --show-error -s -X POST \
74
+ RESULT=$(curl -f --show-error -s -X POST \
74
75
  -H "X-MMA-Client: $MMA_CLIENT" \
75
76
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
76
77
  -H "Authorization: Bearer $TOKEN" \
77
78
  -H "Content-Type: application/json" \
78
- -d '{"query":"what have we learned about dispatch cancellation reliability?"}' \
79
- "http://localhost:$PORT/journal-recall?cwd=/project")
80
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
79
+ -d '{"type":"journal_recall","query":"what have we learned about dispatch cancellation reliability?"}' \
80
+ "http://localhost:$PORT/task?cwd=/project")
81
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
81
82
  ```
82
83
 
83
84
  @include _shared/polling.md
@@ -9,7 +9,7 @@ when_to_use: >-
9
9
  hit a blocking constraint, or reached a conclusion worth remembering. NOT for
10
10
  recall/investigate/delegate; those are read routes. Journal stores conclusions
11
11
  for cross-session reference.
12
- version: 5.1.0
12
+ version: 5.2.0
13
13
  ---
14
14
 
15
15
  # mma-journal-record
@@ -36,7 +36,7 @@ Record a learning, constraint, or decision outcome to the persistent journal via
36
36
 
37
37
  ## Endpoint
38
38
 
39
- `POST /journal-record?cwd=<abs-path>`
39
+ `POST /task?cwd=<abs-path>`
40
40
 
41
41
  @include _shared/auth.md
42
42
 
@@ -44,20 +44,14 @@ Record a learning, constraint, or decision outcome to the persistent journal via
44
44
 
45
45
  ```json
46
46
  {
47
- "learnings": [
48
- "Tried worker self-report for grouped-dispatch cancellation; dropped it — git diff is the source of truth. Lesson: use getRealFilesChanged.",
49
- "Bun.spawn lacks process groups; keep node:child_process for codex subprocess management."
50
- ],
51
- "tagHints": ["dispatch", "cancellation"]
47
+ "type": "journal_record",
48
+ "entry": "Tried worker self-report for grouped-dispatch cancellation; dropped it — git diff is the source of truth. Lesson: use getRealFilesChanged. Also: Bun.spawn lacks process groups; keep node:child_process for codex subprocess management."
52
49
  }
53
50
  ```
54
51
 
55
- **Batch your learnings into ONE call.** Collect every learning from the session and send them together in `learnings[]` — do NOT fire multiple concurrent `journal-record` calls. One worker integrates them sequentially in a single pass (fast and collision-free).
56
-
57
52
  | Field | Type | Required | Notes |
58
53
  |---|---|---|---|
59
- | `learnings` | string[] | yes | 1–20 entries, each 20–8000 chars. Each is a natural-language entry: what you decided, why, or what you learned. Keep them concrete. |
60
- | `tagHints` | string[] | no | Optional tags applied across ALL learnings (batch-scoped); the worker revises/normalizes per node. Advisory. |
54
+ | `entry` | string | yes | A natural-language entry: what you decided, why, or what you learned. Keep it concrete (min 1 char). |
61
55
 
62
56
  **What gets stored & where:**
63
57
 
@@ -71,19 +65,17 @@ The worker creates, refines, or supersedes nodes in the graph (never appends bli
71
65
  ## Full example
72
66
 
73
67
  ```bash
74
- BATCH=$(curl -f --show-error -s -X POST \
68
+ RESULT=$(curl -f --show-error -s -X POST \
75
69
  -H "X-MMA-Client: $MMA_CLIENT" \
76
70
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
77
71
  -H "Authorization: Bearer $TOKEN" \
78
72
  -H "Content-Type: application/json" \
79
73
  -d '{
80
- "learnings": [
81
- "Tried worker self-report for grouped-dispatch cancellation; dropped it — git diff is the source of truth. Lesson: use getRealFilesChanged."
82
- ],
83
- "tagHints": ["dispatch", "cancellation"]
74
+ "type": "journal_record",
75
+ "entry": "Tried worker self-report for grouped-dispatch cancellation; dropped it. Lesson: use getRealFilesChanged."
84
76
  }' \
85
- "http://localhost:$PORT/journal-record?cwd=/project")
86
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
77
+ "http://localhost:$PORT/task?cwd=/project")
78
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
87
79
  ```
88
80
 
89
81
  @include _shared/polling.md
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: mma-orchestrate
3
+ description: >-
4
+ Use when a frontend workflow needs a high-quality LLM brain for orchestration
5
+ — send a structured prompt, get a structured response, reuse the session
6
+ across workflow phases
7
+ when_to_use: >-
8
+ A multi-phase workflow (explore → spec → plan → execute) needs an intelligent
9
+ orchestrator that maintains session context across phases. Each call sends a
10
+ self-contained prompt; the agent processes it and returns structured output
11
+ the calling system parses directly.
12
+ version: 5.2.0
13
+ ---
14
+
15
+ # mma-orchestrate
16
+
17
+ ## Overview
18
+
19
+ The orchestrate endpoint provides a session-persistent, high-quality LLM agent for multi-phase workflow orchestration. Unlike worker routes (audit, delegate, review), the orchestrate agent has no reviewer, no worktree, and no findings structure — it takes a prompt and returns the output the caller needs.
20
+
21
+ **Core principle:** The frontend owns the workflow state; MMA provides the LLM continuity. Each prompt is self-contained; session reuse provides project context across phases.
22
+
23
+ ## When to Use
24
+
25
+ **Use when:**
26
+ - A multi-step workflow needs an intelligent brain across phases
27
+ - The calling system constructs structured prompts and expects structured responses
28
+ - Session continuity across workflow phases improves output quality
29
+ - The task requires synthesis, analysis, or decision-making — not file writing
30
+
31
+ **Don't use when:**
32
+ - You need file modifications → use `mma-delegate`
33
+ - You need structured code review → use `mma-review`
34
+ - You need document auditing → use `mma-audit`
35
+ - A single API call suffices — orchestrate is for when you need tool use + reasoning
36
+
37
+ ## Endpoint
38
+
39
+ `POST /task?cwd=<abs-path>`
40
+
41
+ ```json
42
+ {
43
+ "type": "main",
44
+ "prompt": "Synthesize the exploration results into a requirements specification...",
45
+ "outputFormat": "json"
46
+ }
47
+ ```
48
+
49
+ | Field | Type | Required | Notes |
50
+ |---|---|---|---|
51
+ | `type` | `"main"` | yes | Discriminator |
52
+ | `prompt` | string | yes | The full instruction for this workflow phase |
53
+ | `outputFormat` | string | no | Hint for desired output format (e.g. `"json"`, `"markdown"`) |
54
+ | `sessionIds` | object | no | `{ implementer: "<session-id>" }` — reuse a prior session |
55
+ | `contextBlockIds` | string[] | no | IDs from `mma-context-blocks` |
56
+
57
+ > The orchestrate agent always uses the `main` tier (falls back to `complex` if `agents.main` is not configured). Review is always skipped — there is no reviewer phase.
58
+
59
+ ## Session Reuse
60
+
61
+ To maintain context across workflow phases, capture the session ID from the first response and pass it back:
62
+
63
+ ```bash
64
+ # Phase 1: Exploration
65
+ RESULT=$(curl ... -d '{"type":"main","prompt":"Explore the codebase for auth patterns..."}' ...)
66
+ SESSION_ID=$(echo "$RESULT" | jq -r '.sessions.implementer.sessionId')
67
+
68
+ # Phase 2: Specification (reuse session)
69
+ RESULT=$(curl ... -d '{"type":"main","prompt":"Based on your exploration, write a spec...","sessionIds":{"implementer":"'"$SESSION_ID"'"}}' ...)
70
+ ```
71
+
72
+ @include _shared/auth.md
73
+ @include _shared/polling.md
74
+ @include _shared/response-shape.md
@@ -10,7 +10,7 @@ when_to_use: >-
10
10
  others do, what published methods exist) AND mmagent is running. Delegate the
11
11
  multi-source web/adapter research to a worker so the main context stays on
12
12
  judgment. NOT for codebase questions — those are mma-investigate.
13
- version: 5.1.0
13
+ version: 5.2.0
14
14
  ---
15
15
 
16
16
  # mma-research
@@ -43,7 +43,7 @@ mean and which directions to pursue.
43
43
 
44
44
  ## Endpoint
45
45
 
46
- `POST /research?cwd=<abs-path>`
46
+ `POST /task?cwd=<abs-path>`
47
47
 
48
48
  @include _shared/auth.md
49
49
 
@@ -71,6 +71,7 @@ If the Semantic Scholar API key is not configured:
71
71
 
72
72
  ```json
73
73
  {
74
+ "type": "research",
74
75
  "researchQuestion": "What approaches exist for streaming JSON parsing under 100KB?",
75
76
  "background": "We currently use a single-pass push parser; we want to evaluate alternatives.",
76
77
  "subtype": "default",
@@ -92,17 +93,18 @@ The `default` subtype's criteria target primary-source preference, practitioner
92
93
  ## Full example
93
94
 
94
95
  ```bash
95
- BATCH=$(curl -f -sS -X POST \
96
+ RESULT=$(curl -f -sS -X POST \
96
97
  -H "Authorization: Bearer $TOKEN" \
97
98
  -H "X-MMA-Client: $MMA_CLIENT" \
98
99
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
99
100
  -H "Content-Type: application/json" \
100
101
  -d '{
102
+ "type": "research",
101
103
  "researchQuestion": "State-of-the-art SIMD JSON parsers under 100KB?",
102
104
  "background": "We use a single-pass push parser; want SIMD alternatives."
103
105
  }' \
104
- "http://localhost:$PORT/research?cwd=/project")
105
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
106
+ "http://localhost:$PORT/task?cwd=/project")
107
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
106
108
  ```
107
109
 
108
110
  @include _shared/polling.md