@zhixuan92/multi-model-agent 5.0.3 → 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 (122) hide show
  1. package/README.md +6 -5
  2. package/dist/cli/serve.d.ts.map +1 -1
  3. package/dist/cli/serve.js +9 -34
  4. package/dist/cli/serve.js.map +1 -1
  5. package/dist/cli/status.js +1 -1
  6. package/dist/cli/status.js.map +1 -1
  7. package/dist/http/handler-deps.d.ts +3 -3
  8. package/dist/http/handler-deps.d.ts.map +1 -1
  9. package/dist/http/handlers/control/context-blocks.d.ts +1 -2
  10. package/dist/http/handlers/control/context-blocks.d.ts.map +1 -1
  11. package/dist/http/handlers/control/context-blocks.js +7 -30
  12. package/dist/http/handlers/control/context-blocks.js.map +1 -1
  13. package/dist/http/handlers/introspection/status.d.ts +3 -3
  14. package/dist/http/handlers/introspection/status.d.ts.map +1 -1
  15. package/dist/http/handlers/introspection/status.js +13 -31
  16. package/dist/http/handlers/introspection/status.js.map +1 -1
  17. package/dist/http/handlers/unified-task.d.ts +5 -0
  18. package/dist/http/handlers/unified-task.d.ts.map +1 -0
  19. package/dist/http/handlers/unified-task.js +520 -0
  20. package/dist/http/handlers/unified-task.js.map +1 -0
  21. package/dist/http/project-registry.d.ts +5 -4
  22. package/dist/http/project-registry.d.ts.map +1 -1
  23. package/dist/http/project-registry.js +5 -7
  24. package/dist/http/project-registry.js.map +1 -1
  25. package/dist/http/server.d.ts +4 -3
  26. package/dist/http/server.d.ts.map +1 -1
  27. package/dist/http/server.js +76 -134
  28. package/dist/http/server.js.map +1 -1
  29. package/dist/skill-install/discover.d.ts +1 -1
  30. package/dist/skill-install/discover.d.ts.map +1 -1
  31. package/dist/skill-install/discover.js +1 -0
  32. package/dist/skill-install/discover.js.map +1 -1
  33. package/dist/skills/_shared/error-handling.md +2 -2
  34. package/dist/skills/_shared/polling.md +7 -7
  35. package/dist/skills/_shared/response-shape.md +8 -8
  36. package/dist/skills/_shared/review-policy.md +1 -3
  37. package/dist/skills/mma-audit/SKILL.md +16 -15
  38. package/dist/skills/mma-context-blocks/SKILL.md +9 -9
  39. package/dist/skills/mma-debug/SKILL.md +9 -13
  40. package/dist/skills/mma-delegate/SKILL.md +14 -13
  41. package/dist/skills/mma-execute-plan/SKILL.md +15 -14
  42. package/dist/skills/mma-explore/SKILL.md +4 -3
  43. package/dist/skills/mma-investigate/SKILL.md +7 -6
  44. package/dist/skills/mma-journal-recall/SKILL.md +7 -6
  45. package/dist/skills/mma-journal-record/SKILL.md +10 -18
  46. package/dist/skills/mma-orchestrate/SKILL.md +74 -0
  47. package/dist/skills/mma-research/SKILL.md +7 -5
  48. package/dist/skills/mma-retry/SKILL.md +38 -37
  49. package/dist/skills/mma-review/SKILL.md +7 -6
  50. package/dist/skills/multi-model-agent/SKILL.md +7 -7
  51. package/dist/telemetry/flusher.d.ts.map +1 -1
  52. package/dist/telemetry/flusher.js +8 -11
  53. package/dist/telemetry/flusher.js.map +1 -1
  54. package/package.json +2 -2
  55. package/dist/http/async-dispatch.d.ts +0 -44
  56. package/dist/http/async-dispatch.d.ts.map +0 -1
  57. package/dist/http/async-dispatch.js +0 -175
  58. package/dist/http/async-dispatch.js.map +0 -1
  59. package/dist/http/canonicalize-file-paths.d.ts +0 -8
  60. package/dist/http/canonicalize-file-paths.d.ts.map +0 -1
  61. package/dist/http/canonicalize-file-paths.js +0 -43
  62. package/dist/http/canonicalize-file-paths.js.map +0 -1
  63. package/dist/http/execution-context.d.ts +0 -18
  64. package/dist/http/execution-context.d.ts.map +0 -1
  65. package/dist/http/execution-context.js +0 -61
  66. package/dist/http/execution-context.js.map +0 -1
  67. package/dist/http/handlers/control/batch-slice.d.ts +0 -4
  68. package/dist/http/handlers/control/batch-slice.d.ts.map +0 -1
  69. package/dist/http/handlers/control/batch-slice.js +0 -40
  70. package/dist/http/handlers/control/batch-slice.js.map +0 -1
  71. package/dist/http/handlers/control/batch.d.ts +0 -23
  72. package/dist/http/handlers/control/batch.d.ts.map +0 -1
  73. package/dist/http/handlers/control/batch.js +0 -332
  74. package/dist/http/handlers/control/batch.js.map +0 -1
  75. package/dist/http/handlers/tools/audit.d.ts +0 -4
  76. package/dist/http/handlers/tools/audit.d.ts.map +0 -1
  77. package/dist/http/handlers/tools/audit.js +0 -43
  78. package/dist/http/handlers/tools/audit.js.map +0 -1
  79. package/dist/http/handlers/tools/debug.d.ts +0 -4
  80. package/dist/http/handlers/tools/debug.d.ts.map +0 -1
  81. package/dist/http/handlers/tools/debug.js +0 -43
  82. package/dist/http/handlers/tools/debug.js.map +0 -1
  83. package/dist/http/handlers/tools/delegate.d.ts +0 -4
  84. package/dist/http/handlers/tools/delegate.d.ts.map +0 -1
  85. package/dist/http/handlers/tools/delegate.js +0 -43
  86. package/dist/http/handlers/tools/delegate.js.map +0 -1
  87. package/dist/http/handlers/tools/execute-plan.d.ts +0 -4
  88. package/dist/http/handlers/tools/execute-plan.d.ts.map +0 -1
  89. package/dist/http/handlers/tools/execute-plan.js +0 -45
  90. package/dist/http/handlers/tools/execute-plan.js.map +0 -1
  91. package/dist/http/handlers/tools/investigate.d.ts +0 -4
  92. package/dist/http/handlers/tools/investigate.d.ts.map +0 -1
  93. package/dist/http/handlers/tools/investigate.js +0 -64
  94. package/dist/http/handlers/tools/investigate.js.map +0 -1
  95. package/dist/http/handlers/tools/journal-recall.d.ts +0 -4
  96. package/dist/http/handlers/tools/journal-recall.d.ts.map +0 -1
  97. package/dist/http/handlers/tools/journal-recall.js +0 -40
  98. package/dist/http/handlers/tools/journal-recall.js.map +0 -1
  99. package/dist/http/handlers/tools/journal-record.d.ts +0 -8
  100. package/dist/http/handlers/tools/journal-record.d.ts.map +0 -1
  101. package/dist/http/handlers/tools/journal-record.js +0 -40
  102. package/dist/http/handlers/tools/journal-record.js.map +0 -1
  103. package/dist/http/handlers/tools/research.d.ts +0 -4
  104. package/dist/http/handlers/tools/research.d.ts.map +0 -1
  105. package/dist/http/handlers/tools/research.js +0 -64
  106. package/dist/http/handlers/tools/research.js.map +0 -1
  107. package/dist/http/handlers/tools/retry.d.ts +0 -4
  108. package/dist/http/handlers/tools/retry.d.ts.map +0 -1
  109. package/dist/http/handlers/tools/retry.js +0 -73
  110. package/dist/http/handlers/tools/retry.js.map +0 -1
  111. package/dist/http/handlers/tools/review.d.ts +0 -4
  112. package/dist/http/handlers/tools/review.d.ts.map +0 -1
  113. package/dist/http/handlers/tools/review.js +0 -43
  114. package/dist/http/handlers/tools/review.js.map +0 -1
  115. package/dist/http/journal-lock.d.ts +0 -4
  116. package/dist/http/journal-lock.d.ts.map +0 -1
  117. package/dist/http/journal-lock.js +0 -34
  118. package/dist/http/journal-lock.js.map +0 -1
  119. package/dist/http/request-observability.d.ts +0 -8
  120. package/dist/http/request-observability.d.ts.map +0 -1
  121. package/dist/http/request-observability.js +0 -20
  122. package/dist/http/request-observability.js.map +0 -1
@@ -1,38 +1,38 @@
1
1
  ---
2
2
  name: mma-retry
3
3
  description: >-
4
- Use when a previous mma-* batch returned partial results (some tasks failed or
5
- came back incomplete) and you want to re-run JUST the failed indices without
6
- re-dispatching the whole batch
4
+ Use when a previous mma-* dispatch returned partial results (some tasks failed
5
+ or came back incomplete) and you want to re-run JUST the failed indices
6
+ without re-dispatching the whole task
7
7
  when_to_use: >-
8
8
  A previous mma-delegate / mma-execute-plan / mma-audit / mma-review /
9
- mma-debug / mma-investigate batch returned partial results AND you want to
10
- re-try the failed indices only. Prefer this over re-dispatching the whole
11
- batch or inline-retrying — it's idempotent and preserves the original batch's
9
+ mma-debug / mma-investigate dispatch returned partial results AND you want to
10
+ re-try the failed indices only. Prefer this over re-dispatching the whole task
11
+ or inline-retrying — it's idempotent and preserves the original task's
12
12
  diagnostics.
13
- version: 5.0.3
13
+ version: 5.2.0
14
14
  ---
15
15
 
16
16
  # mma-retry
17
17
 
18
18
  ## Overview
19
19
 
20
- Re-run selected tasks from a completed or failed batch. Specify the original `batchId` and the zero-based indices of the tasks to re-run. The retry runs those tasks fresh with the same configuration as the original batch and produces a new `batchId`.
20
+ Re-run selected tasks from a completed or failed dispatch. Specify the original `taskId` and the zero-based indices of the tasks to re-run. The retry runs those tasks fresh with the same configuration as the original dispatch and produces a new `taskId`.
21
21
 
22
- **Core principle:** A batch is the unit of dispatch, but a TASK is the unit of failure. Retry at the task level so successful tasks aren't re-charged.
22
+ **Core principle:** A dispatch is the unit of fan-out, but a TASK is the unit of failure. Retry at the task level so successful tasks aren't re-charged.
23
23
 
24
24
  ## When to Use
25
25
 
26
26
  ```dot
27
27
  digraph when_to_use {
28
- "Batch returned terminal?" [shape=diamond];
28
+ "Dispatch returned terminal?" [shape=diamond];
29
29
  "Some tasks failed/incomplete?" [shape=diamond];
30
30
  "All tasks failed?" [shape=diamond];
31
31
  "mma-retry (selected indices)" [shape=box];
32
- "Re-dispatch the whole batch" [shape=box];
32
+ "Re-dispatch the whole task" [shape=box];
33
33
  "Investigate first (mma-debug)" [shape=box];
34
34
 
35
- "Batch returned terminal?" -> "Some tasks failed/incomplete?";
35
+ "Dispatch returned terminal?" -> "Some tasks failed/incomplete?";
36
36
  "Some tasks failed/incomplete?" -> "All tasks failed?" [label="yes"];
37
37
  "Some tasks failed/incomplete?" -> "Done — read results" [label="no"];
38
38
  "All tasks failed?" -> "Investigate first (mma-debug)" [label="yes"];
@@ -41,18 +41,18 @@ digraph when_to_use {
41
41
  ```
42
42
 
43
43
  **Use when:**
44
- - A previous batch's terminal envelope shows mixed `completed: true` / `completed: false`
44
+ - A previous dispatch's terminal envelope shows mixed `completed: true` / `completed: false`
45
45
  - 1–N tasks (but not all) need a re-run with the same config
46
- - You want to keep the original batch's diagnostics intact for comparison
46
+ - You want to keep the original dispatch's diagnostics intact for comparison
47
47
 
48
48
  **Don't use when:**
49
49
  - All tasks failed → investigate the systemic cause first (`mma-debug`); retrying won't help
50
- - The original batch is `expired` (TTL elapsed) → re-dispatch fresh
50
+ - The original task is `expired` (TTL elapsed) → re-dispatch fresh
51
51
  - You want to change the prompt → re-dispatch with the new prompt; retry preserves the original
52
52
 
53
53
  ## Endpoint
54
54
 
55
- `POST /retry?cwd=<abs-path>`
55
+ `POST /task?cwd=<abs-path>`
56
56
 
57
57
  @include _shared/auth.md
58
58
 
@@ -60,14 +60,15 @@ digraph when_to_use {
60
60
 
61
61
  ```json
62
62
  {
63
- "batchId": "550e8400-e29b-41d4-a716-446655440000",
63
+ "type": "retry_tasks",
64
+ "taskId": "550e8400-e29b-41d4-a716-446655440000",
64
65
  "taskIndices": [1, 3]
65
66
  }
66
67
  ```
67
68
 
68
69
  | Field | Type | Required | Notes |
69
70
  |---|---|---|---|
70
- | `batchId` | string (UUID) | yes | Batch ID from a previous dispatch (not yet expired) |
71
+ | `taskId` | string (UUID) | yes | Task ID from a previous dispatch (not yet expired) |
71
72
  | `taskIndices` | number[] | yes | Zero-based indices to re-run; must be non-negative integers |
72
73
 
73
74
  To re-run all tasks: pass `[0, 1, ..., tasks.length - 1]`. (But consider: if all failed, debug instead of retrying.)
@@ -75,40 +76,40 @@ To re-run all tasks: pass `[0, 1, ..., tasks.length - 1]`. (But consider: if all
75
76
  ## Full example
76
77
 
77
78
  ```bash
78
- # Original batch had 4 tasks; re-run tasks at index 1 and 3
79
- BATCH=$(curl -f --show-error -s -X POST \
79
+ # Original dispatch had 4 tasks; re-run tasks at index 1 and 3
80
+ RESULT=$(curl -f --show-error -s -X POST \
80
81
  -H "X-MMA-Client: $MMA_CLIENT" \
81
82
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
82
83
  -H "Authorization: Bearer $TOKEN" \
83
84
  -H "Content-Type: application/json" \
84
- -d '{"batchId":"550e8400-e29b-41d4-a716-446655440000","taskIndices":[1,3]}' \
85
- "http://localhost:$PORT/retry?cwd=/project")
86
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId') # NEW batchId — not the original
85
+ -d '{"type":"retry_tasks","taskId":"550e8400-e29b-41d4-a716-446655440000","taskIndices":[1,3]}' \
86
+ "http://localhost:$PORT/task?cwd=/project")
87
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId') # NEW taskId — not the original
87
88
  ```
88
89
 
89
90
  @include _shared/polling.md
90
91
 
91
92
  ## Response shapes
92
93
 
93
- ### POST /retry?cwd=<abs> — dispatch response (202)
94
+ ### POST /task?cwd=<abs> — dispatch response (202)
94
95
 
95
96
  ```json
96
- { "batchId": "<uuid>", "statusUrl": "/batch/<uuid>" }
97
+ { "taskId": "<uuid>", "statusUrl": "/task/<uuid>" }
97
98
  ```
98
99
 
99
- Use `batchId` to poll. `statusUrl` is a convenience pointer. **This is a new batchId** — polling the original batch returns its terminal state.
100
+ Use `taskId` to poll. `statusUrl` is a convenience pointer. **This is a new taskId** — polling the original task returns its terminal state.
100
101
 
101
- ### GET /batch/:id — polling response
102
+ ### GET /task/:taskId — polling response
102
103
 
103
104
  The HTTP status is the state discriminator:
104
105
 
105
106
  | Status | Meaning |
106
107
  |---|---|
107
108
  | `202 text/plain` | Still pending — body is the running headline string |
108
- | `200 application/json` | Terminal — body is the batch envelope below |
109
+ | `200 application/json` | Terminal — body is the task envelope below |
109
110
  | `404` / `401` / `5xx` | Error — see Error response below; stop polling |
110
111
 
111
- ### GET /batch/:id?taskIndex=N — single task slice
112
+ ### GET /task/:taskId?taskIndex=N — single task slice
112
113
 
113
114
  Same envelope. `results` contains exactly the task at index `N`. Returns `404 unknown_task_index` if `N` is out of range.
114
115
 
@@ -167,7 +168,7 @@ Each task result is the per-task wire object (`ComposePayload`):
167
168
  | `findings` | Issues surfaced by the worker or reviewer. `severity` = `critical` \| `high` \| `medium` \| `low`. `source` = `implementer` \| `reviewer`. |
168
169
  | `filesChanged` | File paths modified (empty for read-only routes). |
169
170
  | `commitSha` | Git SHA of the committed diff; `null` for read-only routes or when commit was skipped. |
170
- | `blockId` | Always `null` (retry replays write tasks; `contextBlockId` is `null` too — no terminal block). |
171
+ | `blockId` | Always `null` for write tasks (retry replays write tasks; `contextBlockId` is `null` too — no terminal block). |
171
172
 
172
173
  **The stages array** (always 9 rows) is the canonical telemetry log. `outcome` is one of:
173
174
  - `advance` — stage ran and produced its payload
@@ -194,28 +195,28 @@ Use `telemetry.haltedStage` to find the first halt; `telemetry.stopReason` to fi
194
195
  This skill is one step in the larger flow described in `multi-model-agent` → "Best practices". Recipes that involve `mma-retry`:
195
196
 
196
197
  - **Recipe C — Investigate-plan-execute (last step).** After `mma-execute-plan` returns mixed results, retry the failed indices to close the loop.
197
- - **Recipe D — Plan-execute-retry.** Pass the **original `batchId`** as input, specify the failed indices, keep the same configuration. `mma-retry` produces a NEW `batchId` in its response — poll that one for terminal state. Any `contextBlockIds` from the original carry forward.
198
+ - **Recipe D — Plan-execute-retry.** Pass the **original `taskId`** as input, specify the failed indices, keep the same configuration. `mma-retry` produces a NEW `taskId` in its response — poll that one for terminal state. Any `contextBlockIds` from the original carry forward.
198
199
 
199
- Anti-pattern alert: **`full-batch-redispatch`** (AP4). Re-dispatching the entire batch re-charges every successful task. Always retry by index.
200
+ Anti-pattern alert: **`full-batch-redispatch`** (AP4). Re-dispatching the entire task re-charges every successful sub-task. Always retry by index.
200
201
 
201
202
  ## Common pitfalls
202
203
 
203
- ❌ **Retrying after the batch expired**
204
+ ❌ **Retrying after the task expired**
204
205
  TTL elapsed → original task specs are gone. **Fix:** re-dispatch fresh; the retry endpoint returns 404.
205
206
 
206
207
  ❌ **Retrying without addressing the root cause**
207
208
  A flaky task that failed once will likely fail again. **Fix:** investigate (`mma-debug` or read the original `result.error.message`), then retry — or escalate `agentType` to `complex` by re-dispatching.
208
209
 
209
- ❌ **Confusing the new and original `batchId`**
210
- Retry produces a NEW batchId; polling the original returns the old terminal state. **Fix:** save the retry's `batchId` and poll that one.
210
+ ❌ **Confusing the new and original `taskId`**
211
+ Retry produces a NEW taskId; polling the original returns the old terminal state. **Fix:** save the retry's `taskId` and poll that one.
211
212
 
212
213
  ❌ **Using retry to change task config**
213
- Retry preserves the ORIGINAL config (prompt, agentType, filePaths, reviewPolicy). **Fix:** if you want different config, re-dispatch with `mma-delegate` / `mma-execute-plan`.
214
+ Retry preserves the ORIGINAL config (prompt, agentTier, filePaths, reviewPolicy). **Fix:** if you want different config, re-dispatch with `mma-delegate` / `mma-execute-plan`.
214
215
 
215
216
  ## Terminal context block
216
217
 
217
218
  Write-route tasks (delegate / execute-plan / retry) do NOT register a terminal context block — their durable record is the commit (`commitSha` + changed files). The per-task result's `contextBlockId` is always `null` for these routes. Read routes (audit / review / debug / investigate / research) return a non-null `contextBlockId`; see those skills for the delta-follow-up recipe.
218
219
 
219
- Note: a re-run **read-route** task registers its own terminal context block (`contextBlockId`); re-run write tasks register none. Original-batch blocks remain intact and are not overwritten.
220
+ Note: a re-run **read-route** task registers its own terminal context block (`contextBlockId`); re-run write tasks register none. Original-task blocks remain intact and are not overwritten.
220
221
 
221
222
  @include _shared/error-handling.md
@@ -10,7 +10,7 @@ when_to_use: >-
10
10
  AND mmagent is running. Delegate so each file reviews on its own worker; the
11
11
  main agent only decides what to merge. Review on SOURCE CODE — use mma-audit
12
12
  for prose specs / configs.
13
- version: 5.0.3
13
+ version: 5.2.0
14
14
  ---
15
15
 
16
16
  # mma-review
@@ -45,7 +45,7 @@ The cross-file ripple pass (changed-symbol → broken caller) only fires when th
45
45
 
46
46
  ## Endpoint
47
47
 
48
- `POST /review?cwd=<abs-path>`
48
+ `POST /task?cwd=<abs-path>`
49
49
 
50
50
  @include _shared/auth.md
51
51
 
@@ -53,6 +53,7 @@ The cross-file ripple pass (changed-symbol → broken caller) only fires when th
53
53
 
54
54
  ```json
55
55
  {
56
+ "type": "review",
56
57
  "code": "inline code snippet (optional if filePaths given)",
57
58
  "focus": ["correctness", "security"],
58
59
  "subtype": "default",
@@ -76,14 +77,14 @@ Either `code` or `filePaths` (or both) must be provided.
76
77
  ## Full example
77
78
 
78
79
  ```bash
79
- BATCH=$(curl -f --show-error -s -X POST \
80
+ RESULT=$(curl -f --show-error -s -X POST \
80
81
  -H "X-MMA-Client: $MMA_CLIENT" \
81
82
  -H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
82
83
  -H "Authorization: Bearer $TOKEN" \
83
84
  -H "Content-Type: application/json" \
84
- -d '{"focus":["security","correctness"],"filePaths":["/project/src/auth/login.ts"]}' \
85
- "http://localhost:$PORT/review?cwd=/project")
86
- BATCH_ID=$(echo "$BATCH" | jq -r '.batchId')
85
+ -d '{"type":"review","focus":["security","correctness"],"filePaths":["/project/src/auth/login.ts"]}' \
86
+ "http://localhost:$PORT/task?cwd=/project")
87
+ TASK_ID=$(echo "$RESULT" | jq -r '.taskId')
87
88
  ```
88
89
 
89
90
  @include _shared/polling.md
@@ -11,7 +11,7 @@ when_to_use: >-
11
11
  tasks — AND mmagent is running. Read this once, pick the matching mma-* skill,
12
12
  and delegate there. Applies equally whether the user invoked a superpowers
13
13
  methodology skill or asked directly.
14
- version: 5.0.3
14
+ version: 5.2.0
15
15
  ---
16
16
 
17
17
  # multi-model-agent (router)
@@ -65,7 +65,7 @@ digraph picker {
65
65
  | `mma-investigate` | Codebase Q&A — structured answer with `file:line` citations + confidence |
66
66
  | `mma-explore` | Divergent ideation from codebase + web research + prior-learnings recall — use before `superpowers:brainstorming` |
67
67
  | `mma-delegate` | Ad-hoc implementation / research with no plan file |
68
- | `mma-retry` | Re-run specific failed/incomplete tasks from a previous batch by index |
68
+ | `mma-retry` | Re-run specific failed/incomplete tasks from a previous dispatch by index |
69
69
  | `mma-context-blocks` | Register a reused doc once; reference by ID across N tasks |
70
70
 
71
71
  ## Best practices
@@ -113,7 +113,7 @@ Any artifact (spec, plan, prior-round findings, long error log) that crosses 2+
113
113
 
114
114
  ### Recipe D — Plan-execute-retry
115
115
 
116
- When `mma-execute-plan` returns mixed `done` / `done_with_concerns` / `failed`, the next step is `mma-retry` on the failed indices only — never a full-batch re-dispatch. Pass the **original `batchId`** as input, specify the failed task indices, keep the same configuration. (`mma-retry` produces a NEW `batchId` in its response — poll that one for terminal state, not the original.) Any `contextBlockIds` registered for the original batch carry forward into retry — no need to re-register.
116
+ When `mma-execute-plan` returns mixed `done` / `done_with_concerns` / `failed`, the next step is `mma-retry` on the failed indices only — never a full re-dispatch. Pass the **original `taskId`** as input, specify the failed task indices, keep the same configuration. (`mma-retry` produces a NEW `taskId` in its response — poll that one for terminal state, not the original.) Any `contextBlockIds` registered for the original task carry forward into retry — no need to re-register.
117
117
 
118
118
  ### Anti-patterns
119
119
 
@@ -173,7 +173,7 @@ If you need `complex` tier on plan-style work, dispatch via `mma-delegate` with
173
173
 
174
174
  | Default | Value | Notes |
175
175
  |---|---|---|
176
- | Idle TTL | 24 h | Block eligible for eviction after 24 h with no active batch references |
176
+ | Idle TTL | 24 h | Block eligible for eviction after 24 h with no active task references |
177
177
  | `maxEntries` | 500 | Per-project cap on total context blocks |
178
178
  | Body cap | 50 MiB | Maximum `content` size per block |
179
179
 
@@ -189,8 +189,8 @@ Use it for delta follow-ups — feed prior results' block ids into a later call'
189
189
 
190
190
  ## General flow
191
191
 
192
- 1. Call the matching `mma-*` skill → receive `{ batchId, statusUrl }`.
193
- 2. Poll `GET /batch/:id`: `202 text/plain` while pending (body is the running headline), `200 application/json` on terminal.
192
+ 1. Call the matching `mma-*` skill → receive `{ taskId, statusUrl }`.
193
+ 2. Poll `GET /task/:taskId`: `202 text/plain` while pending (body is the running headline), `200 application/json` on terminal.
194
194
  3. Read `results` / `error` from the 6-field terminal envelope.
195
195
 
196
196
  ## Common pitfalls
@@ -203,4 +203,4 @@ Use it for delta follow-ups — feed prior results' block ids into a later call'
203
203
 
204
204
  ## Diagnosing slow tasks
205
205
 
206
- `mmagent serve --verbose` (or `diagnostics.verbose: true` in config) records `tool_call`, `turn_complete`, and `heartbeat` events. Tail with `mmagent logs --follow --batch=$BATCH_ID`.
206
+ `mmagent serve --verbose` (or `diagnostics.verbose: true` in config) records `tool_call`, `turn_complete`, and `heartbeat` events. Tail with `mmagent logs --follow --task=$TASK_ID`.
@@ -1 +1 @@
1
- {"version":3,"file":"flusher.d.ts","sourceRoot":"","sources":["../../src/telemetry/flusher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAMnC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AA2BD,qBAAa,OAAO;;gBAYN,IAAI,EAAE,cAAc;IAOhC,IAAI,UAAU,IAAI,eAAe,CAEhC;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,KAAK,IAAI,IAAI;IAeb,IAAI,IAAI,IAAI;IAaN,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAyM5B,YAAY,IAAI,IAAI;CAOrB"}
1
+ {"version":3,"file":"flusher.d.ts","sourceRoot":"","sources":["../../src/telemetry/flusher.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAMnC,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,KAAK,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AA2BD,qBAAa,OAAO;;gBAYN,IAAI,EAAE,cAAc;IAOhC,IAAI,UAAU,IAAI,eAAe,CAEhC;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;IAED,IAAI,aAAa,IAAI,OAAO,CAE3B;IAED,KAAK,IAAI,IAAI;IAeb,IAAI,IAAI,IAAI;IAaN,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAYtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAuM5B,YAAY,IAAI,IAAI;CAOrB"}
@@ -1,7 +1,6 @@
1
1
  import { gzipSync } from 'node:zlib';
2
2
  import { readGeneration } from './generation.js';
3
3
  import { getOrCreateIdentity, sign } from './identity.js';
4
- import { SCHEMA_VERSION } from '@zhixuan92/multi-model-agent-core/events/wire-schema';
5
4
  const MAX_BATCH = 500;
6
5
  const INTERVAL_MS = 5 * 60 * 1000; // 5 minutes
7
6
  const BOOT_DELAY_MS = 5_000; // 5 seconds
@@ -95,19 +94,17 @@ export class Flusher {
95
94
  }
96
95
  // Single identity snapshot per flush — threaded into both head-truncation and uploadBatch.
97
96
  const identity = getOrCreateIdentity(this.#dir);
98
- // V4-only: drop EVERY record that can't be authenticated, not just a
99
- // contiguous head-prefix. Records older than SCHEMA_VERSION or whose
100
- // installId doesn't match the current identity are permanently
101
- // un-authenticatable; retrying the same signed payload always fails.
102
- // Previously we only dropped a contiguous head — a sandwiched older
103
- // record (e.g. queued during a roll-back/forward, or installId churn)
104
- // would either propagate into an upload or split the upload into
105
- // versioned groups. Now: full-batch filter, then re-read to refresh
106
- // meta byteOffsets after the file rewrite.
97
+ // Drop every record that can't be authenticated. Records with
98
+ // schemaVersion < 5 (truly ancient v1–v4) or whose installId doesn't
99
+ // match the current identity are permanently un-authenticatable;
100
+ // retrying the same signed payload always fails. v5 records (from
101
+ // existing 4.x/5.0/5.1 installations) and v6+ (current) are kept.
102
+ // Full-batch filter, then re-read to refresh meta byteOffsets after
103
+ // the file rewrite.
107
104
  const dropHashes = new Set();
108
105
  for (let i = 0; i < batch.records.length; i++) {
109
106
  const r = batch.records[i];
110
- if (r.schemaVersion < SCHEMA_VERSION || r.installId !== identity.installId) {
107
+ if (r.schemaVersion < 5 || r.installId !== identity.installId) {
111
108
  dropHashes.add(batch.meta[i].sha256);
112
109
  }
113
110
  }
@@ -1 +1 @@
1
- {"version":3,"file":"flusher.js","sourceRoot":"","sources":["../../src/telemetry/flusher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAErC,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAA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CAAC;YAC1B,IAAI,CAAC,UAAU,GAAG,kBAAkB,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,UAAU,GAAG,CAAC,EAAE,cAAc,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,IAAI,CAAC,UAAU,CAAC;IACzB,CAAC;IAED,gBAAgB,CAAC,EAAU;QACzB,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;YACnC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAC1B,IAAI,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QAC/B,CAAC,EAAE,EAAE,CAAC,CAAC;QACP,IAAI,IAAI,CAAC,aAAa,CAAC,KAAK;YAAE,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC3D,CAAC;IAED,YAAY;QACV,IAAI,IAAI,CAAC,aAAa,EAAE,CAAC;YACvB,YAAY,CAAC,IAAI,CAAC,aAAa,CAAC,CAAC;YACjC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;QAC5B,CAAC;QACD,IAAI,CAAC,UAAU,GAAG,CAAC,CAAC;IACtB,CAAC;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zhixuan92/multi-model-agent",
3
- "version": "5.0.3",
3
+ "version": "5.2.0",
4
4
  "type": "module",
5
5
  "license": "MIT",
6
6
  "description": "Standalone HTTP server for multi-model-agent. Routes tool-invocation work to Claude, Codex, or OpenAI-compatible sub-agents with async-polling REST dispatch and installable skills for Claude Code, Gemini CLI, Codex CLI, and Cursor.",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@asteasolutions/zod-to-openapi": "^8.5.0",
56
- "@zhixuan92/multi-model-agent-core": "^5.0.3",
56
+ "@zhixuan92/multi-model-agent-core": "^5.2.0",
57
57
  "gray-matter": "^4.0.3",
58
58
  "minimist": "^1.2.8",
59
59
  "proper-lockfile": "^4.1.2",
@@ -1,44 +0,0 @@
1
- import type { BatchRegistry, ProjectContext } from '@zhixuan92/multi-model-agent-core';
2
- import type { ExecutionContext } from '@zhixuan92/multi-model-agent-core';
3
- import type { HandlerDeps } from './handler-deps.js';
4
- export interface AsyncDispatchOptions<TResult> {
5
- tool: string;
6
- projectCwd: string;
7
- blockIds: string[];
8
- batchRegistry: BatchRegistry;
9
- projectContext: ProjectContext;
10
- deps: HandlerDeps;
11
- /**
12
- * Caller identity from the x-mma-client request header. Threaded into
13
- * ExecutionContext so the cloud `task.completed` event carries the client.
14
- * Without this the wire event has an empty string and the backend rejects
15
- * the upload (STRICT_ID_REGEX). triggeringSkill was dropped because it's
16
- * implied by `route` for the 99% case (mma-<route> → /<route>).
17
- */
18
- caller?: {
19
- client: string;
20
- mainModel?: string | null;
21
- };
22
- reviewPolicy?: 'full' | 'quality_only' | 'diff_only' | 'none';
23
- /**
24
- * The async function that does the real work. Receives the ExecutionContext
25
- * and the pre-allocated batchId.
26
- */
27
- executor: (ctx: ExecutionContext, batchId: string) => Promise<TResult>;
28
- }
29
- export interface AsyncDispatchResult {
30
- batchId: string;
31
- statusUrl: string;
32
- }
33
- /**
34
- * Registers a new batch as 'pending', schedules the executor via setImmediate,
35
- * and returns immediately with { batchId, statusUrl }.
36
- *
37
- * On success: calls batchRegistry.complete(batchId, result).
38
- * On failure: calls batchRegistry.fail(batchId, { code, message, stack }).
39
- *
40
- * IMPORTANT: Does NOT maintain a manual activeBatches counter.
41
- * Use BatchRegistry.countActiveForProject(cwd) as the truth source.
42
- */
43
- export declare function asyncDispatch<TResult>(opts: AsyncDispatchOptions<TResult>): AsyncDispatchResult;
44
- //# sourceMappingURL=async-dispatch.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-dispatch.d.ts","sourceRoot":"","sources":["../../src/http/async-dispatch.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACvF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAGrD,MAAM,WAAW,oBAAoB,CAAC,OAAO;IAC3C,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,aAAa,EAAE,aAAa,CAAC;IAC7B,cAAc,EAAE,cAAc,CAAC;IAC/B,IAAI,EAAE,WAAW,CAAC;IAClB;;;;;;OAMG;IACH,MAAM,CAAC,EAAE;QAAE,MAAM,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC;IACvD,YAAY,CAAC,EAAE,MAAM,GAAG,cAAc,GAAG,WAAW,GAAG,MAAM,CAAC;IAC9D;;;OAGG;IACH,QAAQ,EAAE,CAAC,GAAG,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;GASG;AACH,wBAAgB,aAAa,CAAC,OAAO,EACnC,IAAI,EAAE,oBAAoB,CAAC,OAAO,CAAC,GAClC,mBAAmB,CA8HrB"}
@@ -1,175 +0,0 @@
1
- // packages/server/src/http/async-dispatch.ts
2
- import { randomUUID } from 'node:crypto';
3
- import { TaskEnvelopeStore } from '@zhixuan92/multi-model-agent-core/events/task-envelope';
4
- import { buildExecutionContext } from './execution-context.js';
5
- /**
6
- * Registers a new batch as 'pending', schedules the executor via setImmediate,
7
- * and returns immediately with { batchId, statusUrl }.
8
- *
9
- * On success: calls batchRegistry.complete(batchId, result).
10
- * On failure: calls batchRegistry.fail(batchId, { code, message, stack }).
11
- *
12
- * IMPORTANT: Does NOT maintain a manual activeBatches counter.
13
- * Use BatchRegistry.countActiveForProject(cwd) as the truth source.
14
- */
15
- export function asyncDispatch(opts) {
16
- const batchId = randomUUID();
17
- const { batchRegistry, projectContext, deps, tool, projectCwd, blockIds } = opts;
18
- // Register entry as 'pending' before scheduling executor
19
- batchRegistry.register({
20
- batchId,
21
- projectCwd,
22
- tool,
23
- state: 'pending',
24
- startedAt: Date.now(),
25
- stateChangedAt: Date.now(),
26
- blockIds,
27
- blocksReleased: false,
28
- });
29
- // Create and attach envelope to registry
30
- const envelope = TaskEnvelopeStore.create({
31
- taskId: batchId + ':' + 0,
32
- batchId: batchId, taskIndex: 0,
33
- route: tool, agentType: 'standard',
34
- client: opts.caller?.client ?? '', mainModel: opts.caller?.mainModel ?? '', cwd: projectCwd,
35
- reviewPolicy: opts.reviewPolicy ?? 'full',
36
- }, deps.bus);
37
- batchRegistry.attachEnvelope(batchId, 0, envelope);
38
- // Build execution context for this batch
39
- const ctx = buildExecutionContext(deps, projectContext, batchId, envelope, tool, opts.caller);
40
- // Schedule executor asynchronously — do not await here
41
- const startedAtMs = Date.now();
42
- setImmediate(() => {
43
- void (async () => {
44
- try {
45
- // Mark the batch as running so /batch/:id polling reports
46
- // "1/1 running, Xs elapsed" the instant the executor begins.
47
- // Without bumping the headline snapshot here, the polling endpoint
48
- // returns the initial "0/N queued" fallback until the runner's first
49
- // heartbeat arrives — which can be many seconds (or minutes) later
50
- // because heartbeats fire from inside provider.run. That gap is what
51
- // made 4.0.1 audits look like the daemon was deadlocked when the
52
- // only thing actually slow was the LLM call.
53
- const entry = batchRegistry.get(batchId);
54
- if (entry) {
55
- entry.tasksTotal = 1;
56
- entry.tasksStarted = 1;
57
- entry.tasksCompleted = 0;
58
- // Use the route's stage-order denominator (3 for audit, 7 for
59
- // delegate, etc.) so polling shows "Implementing (1/3)" the
60
- // instant the executor starts — instead of an opaque
61
- // "1/1 running" that doesn't tell the main agent how far along
62
- // the lifecycle has progressed.
63
- // Headline seeding moved to envelope creation in T7-T11 migration —
64
- // each TaskEnvelope's headline is derived on every mutation, and
65
- // BatchRegistry no longer caches snapshot objects.
66
- }
67
- // 4.6.0+: always-on verbose breadcrumb so operators tailing the daemon
68
- // see the executor lifecycle past request_received without grepping the
69
- // JSONL log.
70
- process.stderr.write(`[mmagent] event=executor_started ts=${new Date().toISOString()} batch=${batchId} route=${tool}\n`);
71
- const result = await opts.executor(ctx, batchId);
72
- const resultObj = result;
73
- const entryAfter = batchRegistry.get(batchId);
74
- if (entryAfter) {
75
- // For multi-task batches the executor bumped tasksTotal from the
76
- // placeholder of 1 to the real fan-out width. Mark every task as
77
- // completed so the live/terminal headline reports n/n complete.
78
- entryAfter.tasksCompleted = Math.max(entryAfter.tasksTotal ?? 1, 1);
79
- }
80
- const taskCount = Array.isArray(resultObj?.results) ? resultObj.results.length : 0;
81
- const durationMs = Date.now() - startedAtMs;
82
- // Gap 5 fix (4.0.3+): inspect the envelope for structured failure
83
- // signals. The executor may catch errors and package them into a
84
- // result envelope (with structuredError or status='error') instead
85
- // of throwing — without this check, batch_completed fires
86
- // misleadingly while the verbose log gives operators no signal
87
- // that anything went wrong. Detection uses STRUCTURED FIELDS ONLY,
88
- // never string comparisons.
89
- //
90
- // Order matters: detect failure FIRST, then call complete() or
91
- // fail() exactly once. Pre-fix, complete() ran unconditionally
92
- // before fail() — the fail() then no-op'd because the registry
93
- // entry was already terminal, leaving the wire error field stuck
94
- // at "not_applicable" even when detectFailure returned a real
95
- // failure. Probe I (multi-task /delegate) hit this every time.
96
- const failure = detectFailure(resultObj);
97
- if (failure) {
98
- batchRegistry.fail(batchId, failure);
99
- deps.bus.emitPlainEntry({ ts: new Date().toISOString(), kind: 'batch_failed', fields: { batch_id: batchId, tool, duration_ms: durationMs, error_code: failure.code, error_message: failure.message } });
100
- process.stderr.write(`[mmagent] event=batch_failed ts=${new Date().toISOString()} batch=${batchId} route=${tool} duration_ms=${durationMs} error_code=${failure.code} error="${failure.message.replace(/"/g, '\\"')}"\n`);
101
- }
102
- else {
103
- batchRegistry.complete(batchId);
104
- const dispatchMode = resultObj?.dispatchMode;
105
- deps.bus.emitPlainEntry({ ts: new Date().toISOString(), kind: 'batch_completed', fields: { batch_id: batchId, tool, duration_ms: durationMs, task_count: taskCount, ...(dispatchMode !== undefined ? { dispatch_mode: dispatchMode } : {}) } });
106
- process.stderr.write(`[mmagent] event=batch_completed ts=${new Date().toISOString()} batch=${batchId} route=${tool} duration_ms=${durationMs}\n`);
107
- }
108
- }
109
- catch (err) {
110
- const message = err instanceof Error ? err.message : String(err);
111
- const stack = err instanceof Error ? err.stack : undefined;
112
- const errObj = {
113
- code: 'runner_crash',
114
- message,
115
- ...(stack !== undefined && { stack }),
116
- };
117
- batchRegistry.fail(batchId, errObj);
118
- const durationMs = Date.now() - startedAtMs;
119
- deps.bus.emitPlainEntry({ ts: new Date().toISOString(), kind: 'batch_failed', fields: { batch_id: batchId, tool, duration_ms: durationMs, error_code: errObj.code, error_message: errObj.message } });
120
- process.stderr.write(`[mmagent] event=batch_failed ts=${new Date().toISOString()} batch=${batchId} route=${tool} duration_ms=${durationMs} error="${message.replace(/"/g, '\\"')}"\n`);
121
- }
122
- })();
123
- });
124
- return {
125
- batchId,
126
- statusUrl: `/batch/${batchId}`,
127
- };
128
- }
129
- /**
130
- * Inspect an executor return envelope for structured failure signals.
131
- * Returns { code, message } when the envelope indicates failure, null
132
- * otherwise.
133
- *
134
- * Per the Gap 5 fix design (wire-telemetry-gaps plan): NO string
135
- * comparison to "batch succeeded". Use only:
136
- * 1. Any task result with `structuredError` (most authoritative)
137
- * 2. Any task result with `status` other than 'ok'
138
- * 3. Envelope-level `error` object whose `kind` is not 'not_applicable'
139
- * (notApplicable() is the structured "no error" sentinel)
140
- */
141
- function detectFailure(envelope) {
142
- if (!envelope)
143
- return null;
144
- const results = Array.isArray(envelope.results) ? envelope.results : [];
145
- // Source 1: explicit structuredError on any task result
146
- for (const r of results) {
147
- const se = r.structuredError;
148
- if (se && typeof se.code === 'string') {
149
- return { code: se.code, message: typeof se.message === 'string' ? se.message : se.code };
150
- }
151
- }
152
- // Source 2: any task result with status === 'error'.
153
- // 'incomplete' is intentionally NOT treated as failure — review-rework
154
- // paths can transit through 'incomplete' on intermediate rounds while
155
- // the eventual envelope still represents a valid (if imperfect) batch.
156
- // Only 'error' and 'failed' are categorical batch-level failures.
157
- for (const r of results) {
158
- const status = r.status;
159
- if (typeof status === 'string' && (status === 'error' || status === 'failed')) {
160
- const code = (typeof r.errorCode === 'string' && r.errorCode.length > 0) ? r.errorCode : status;
161
- const msg = (typeof r.error === 'string' && r.error.length > 0) ? r.error : status;
162
- return { code, message: msg };
163
- }
164
- }
165
- // Source 3: envelope-level error object with kind != 'not_applicable'
166
- const env = envelope.error;
167
- if (env && typeof env.kind === 'string' && env.kind !== 'not_applicable') {
168
- return {
169
- code: typeof env.code === 'string' ? env.code : 'envelope_error',
170
- message: typeof env.message === 'string' ? env.message : 'envelope error',
171
- };
172
- }
173
- return null;
174
- }
175
- //# sourceMappingURL=async-dispatch.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"async-dispatch.js","sourceRoot":"","sources":["../../src/http/async-dispatch.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAIzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,wDAAwD,CAAC;AAE3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AA8B/D;;;;;;;;;GASG;AACH,MAAM,UAAU,aAAa,CAC3B,IAAmC;IAEnC,MAAM,OAAO,GAAG,UAAU,EAAE,CAAC;IAC7B,MAAM,EAAE,aAAa,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