@zhixuan92/multi-model-agent 4.9.0 → 5.0.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 (252) hide show
  1. package/bin/mmagent.mjs +47 -0
  2. package/package.json +19 -57
  3. package/postinstall.mjs +8 -0
  4. package/LICENSE +0 -21
  5. package/README.md +0 -306
  6. package/dist/cli/index.d.ts +0 -62
  7. package/dist/cli/index.d.ts.map +0 -1
  8. package/dist/cli/index.js +0 -345
  9. package/dist/cli/index.js.map +0 -1
  10. package/dist/cli/info.d.ts +0 -22
  11. package/dist/cli/info.d.ts.map +0 -1
  12. package/dist/cli/info.js +0 -100
  13. package/dist/cli/info.js.map +0 -1
  14. package/dist/cli/logs.d.ts +0 -15
  15. package/dist/cli/logs.d.ts.map +0 -1
  16. package/dist/cli/logs.js +0 -102
  17. package/dist/cli/logs.js.map +0 -1
  18. package/dist/cli/print-token.d.ts +0 -18
  19. package/dist/cli/print-token.d.ts.map +0 -1
  20. package/dist/cli/print-token.js +0 -60
  21. package/dist/cli/print-token.js.map +0 -1
  22. package/dist/cli/serve.d.ts +0 -28
  23. package/dist/cli/serve.d.ts.map +0 -1
  24. package/dist/cli/serve.js +0 -405
  25. package/dist/cli/serve.js.map +0 -1
  26. package/dist/cli/status.d.ts +0 -49
  27. package/dist/cli/status.d.ts.map +0 -1
  28. package/dist/cli/status.js +0 -155
  29. package/dist/cli/status.js.map +0 -1
  30. package/dist/cli/sync-skills.d.ts +0 -58
  31. package/dist/cli/sync-skills.d.ts.map +0 -1
  32. package/dist/cli/sync-skills.js +0 -266
  33. package/dist/cli/sync-skills.js.map +0 -1
  34. package/dist/cli/telemetry.d.ts +0 -10
  35. package/dist/cli/telemetry.d.ts.map +0 -1
  36. package/dist/cli/telemetry.js +0 -161
  37. package/dist/cli/telemetry.js.map +0 -1
  38. package/dist/cli/toggle.d.ts +0 -26
  39. package/dist/cli/toggle.d.ts.map +0 -1
  40. package/dist/cli/toggle.js +0 -185
  41. package/dist/cli/toggle.js.map +0 -1
  42. package/dist/http/async-dispatch.d.ts +0 -44
  43. package/dist/http/async-dispatch.d.ts.map +0 -1
  44. package/dist/http/async-dispatch.js +0 -175
  45. package/dist/http/async-dispatch.js.map +0 -1
  46. package/dist/http/auth.d.ts +0 -20
  47. package/dist/http/auth.d.ts.map +0 -1
  48. package/dist/http/auth.js +0 -56
  49. package/dist/http/auth.js.map +0 -1
  50. package/dist/http/canonicalize-file-paths.d.ts +0 -8
  51. package/dist/http/canonicalize-file-paths.d.ts.map +0 -1
  52. package/dist/http/canonicalize-file-paths.js +0 -43
  53. package/dist/http/canonicalize-file-paths.js.map +0 -1
  54. package/dist/http/cwd-validator.d.ts +0 -11
  55. package/dist/http/cwd-validator.d.ts.map +0 -1
  56. package/dist/http/cwd-validator.js +0 -130
  57. package/dist/http/cwd-validator.js.map +0 -1
  58. package/dist/http/errors.d.ts +0 -4
  59. package/dist/http/errors.d.ts.map +0 -1
  60. package/dist/http/errors.js +0 -9
  61. package/dist/http/errors.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/handler-deps.d.ts +0 -19
  67. package/dist/http/handler-deps.d.ts.map +0 -1
  68. package/dist/http/handler-deps.js +0 -2
  69. package/dist/http/handler-deps.js.map +0 -1
  70. package/dist/http/handlers/control/batch-slice.d.ts +0 -4
  71. package/dist/http/handlers/control/batch-slice.d.ts.map +0 -1
  72. package/dist/http/handlers/control/batch-slice.js +0 -40
  73. package/dist/http/handlers/control/batch-slice.js.map +0 -1
  74. package/dist/http/handlers/control/batch.d.ts +0 -23
  75. package/dist/http/handlers/control/batch.d.ts.map +0 -1
  76. package/dist/http/handlers/control/batch.js +0 -332
  77. package/dist/http/handlers/control/batch.js.map +0 -1
  78. package/dist/http/handlers/control/context-blocks.d.ts +0 -22
  79. package/dist/http/handlers/control/context-blocks.d.ts.map +0 -1
  80. package/dist/http/handlers/control/context-blocks.js +0 -111
  81. package/dist/http/handlers/control/context-blocks.js.map +0 -1
  82. package/dist/http/handlers/introspection/health.d.ts +0 -20
  83. package/dist/http/handlers/introspection/health.d.ts.map +0 -1
  84. package/dist/http/handlers/introspection/health.js +0 -18
  85. package/dist/http/handlers/introspection/health.js.map +0 -1
  86. package/dist/http/handlers/introspection/status.d.ts +0 -26
  87. package/dist/http/handlers/introspection/status.d.ts.map +0 -1
  88. package/dist/http/handlers/introspection/status.js +0 -136
  89. package/dist/http/handlers/introspection/status.js.map +0 -1
  90. package/dist/http/handlers/tools/audit.d.ts +0 -4
  91. package/dist/http/handlers/tools/audit.d.ts.map +0 -1
  92. package/dist/http/handlers/tools/audit.js +0 -43
  93. package/dist/http/handlers/tools/audit.js.map +0 -1
  94. package/dist/http/handlers/tools/debug.d.ts +0 -4
  95. package/dist/http/handlers/tools/debug.d.ts.map +0 -1
  96. package/dist/http/handlers/tools/debug.js +0 -43
  97. package/dist/http/handlers/tools/debug.js.map +0 -1
  98. package/dist/http/handlers/tools/delegate.d.ts +0 -4
  99. package/dist/http/handlers/tools/delegate.d.ts.map +0 -1
  100. package/dist/http/handlers/tools/delegate.js +0 -43
  101. package/dist/http/handlers/tools/delegate.js.map +0 -1
  102. package/dist/http/handlers/tools/execute-plan.d.ts +0 -4
  103. package/dist/http/handlers/tools/execute-plan.d.ts.map +0 -1
  104. package/dist/http/handlers/tools/execute-plan.js +0 -45
  105. package/dist/http/handlers/tools/execute-plan.js.map +0 -1
  106. package/dist/http/handlers/tools/investigate.d.ts +0 -4
  107. package/dist/http/handlers/tools/investigate.d.ts.map +0 -1
  108. package/dist/http/handlers/tools/investigate.js +0 -64
  109. package/dist/http/handlers/tools/investigate.js.map +0 -1
  110. package/dist/http/handlers/tools/journal-recall.d.ts +0 -4
  111. package/dist/http/handlers/tools/journal-recall.d.ts.map +0 -1
  112. package/dist/http/handlers/tools/journal-recall.js +0 -40
  113. package/dist/http/handlers/tools/journal-recall.js.map +0 -1
  114. package/dist/http/handlers/tools/journal-record.d.ts +0 -4
  115. package/dist/http/handlers/tools/journal-record.d.ts.map +0 -1
  116. package/dist/http/handlers/tools/journal-record.js +0 -35
  117. package/dist/http/handlers/tools/journal-record.js.map +0 -1
  118. package/dist/http/handlers/tools/research.d.ts +0 -4
  119. package/dist/http/handlers/tools/research.d.ts.map +0 -1
  120. package/dist/http/handlers/tools/research.js +0 -64
  121. package/dist/http/handlers/tools/research.js.map +0 -1
  122. package/dist/http/handlers/tools/retry.d.ts +0 -4
  123. package/dist/http/handlers/tools/retry.d.ts.map +0 -1
  124. package/dist/http/handlers/tools/retry.js +0 -73
  125. package/dist/http/handlers/tools/retry.js.map +0 -1
  126. package/dist/http/handlers/tools/review.d.ts +0 -4
  127. package/dist/http/handlers/tools/review.d.ts.map +0 -1
  128. package/dist/http/handlers/tools/review.js +0 -43
  129. package/dist/http/handlers/tools/review.js.map +0 -1
  130. package/dist/http/middleware/body-reader.d.ts +0 -16
  131. package/dist/http/middleware/body-reader.d.ts.map +0 -1
  132. package/dist/http/middleware/body-reader.js +0 -44
  133. package/dist/http/middleware/body-reader.js.map +0 -1
  134. package/dist/http/middleware/caller-identity.d.ts +0 -16
  135. package/dist/http/middleware/caller-identity.d.ts.map +0 -1
  136. package/dist/http/middleware/caller-identity.js +0 -16
  137. package/dist/http/middleware/caller-identity.js.map +0 -1
  138. package/dist/http/middleware/decompress.d.ts +0 -14
  139. package/dist/http/middleware/decompress.d.ts.map +0 -1
  140. package/dist/http/middleware/decompress.js +0 -51
  141. package/dist/http/middleware/decompress.js.map +0 -1
  142. package/dist/http/project-registry.d.ts +0 -54
  143. package/dist/http/project-registry.d.ts.map +0 -1
  144. package/dist/http/project-registry.js +0 -130
  145. package/dist/http/project-registry.js.map +0 -1
  146. package/dist/http/request-observability.d.ts +0 -8
  147. package/dist/http/request-observability.d.ts.map +0 -1
  148. package/dist/http/request-observability.js +0 -20
  149. package/dist/http/request-observability.js.map +0 -1
  150. package/dist/http/request-pipeline.d.ts +0 -16
  151. package/dist/http/request-pipeline.d.ts.map +0 -1
  152. package/dist/http/request-pipeline.js +0 -144
  153. package/dist/http/request-pipeline.js.map +0 -1
  154. package/dist/http/server.d.ts +0 -17
  155. package/dist/http/server.d.ts.map +0 -1
  156. package/dist/http/server.js +0 -300
  157. package/dist/http/server.js.map +0 -1
  158. package/dist/http/types.d.ts +0 -20
  159. package/dist/http/types.d.ts.map +0 -1
  160. package/dist/http/types.js +0 -2
  161. package/dist/http/types.js.map +0 -1
  162. package/dist/skill-install/disabled-state.d.ts +0 -35
  163. package/dist/skill-install/disabled-state.d.ts.map +0 -1
  164. package/dist/skill-install/disabled-state.js +0 -96
  165. package/dist/skill-install/disabled-state.js.map +0 -1
  166. package/dist/skill-install/discover.d.ts +0 -29
  167. package/dist/skill-install/discover.d.ts.map +0 -1
  168. package/dist/skill-install/discover.js +0 -104
  169. package/dist/skill-install/discover.js.map +0 -1
  170. package/dist/skill-install/include-utils.d.ts +0 -27
  171. package/dist/skill-install/include-utils.d.ts.map +0 -1
  172. package/dist/skill-install/include-utils.js +0 -90
  173. package/dist/skill-install/include-utils.js.map +0 -1
  174. package/dist/skill-install/manifest.d.ts +0 -82
  175. package/dist/skill-install/manifest.d.ts.map +0 -1
  176. package/dist/skill-install/manifest.js +0 -215
  177. package/dist/skill-install/manifest.js.map +0 -1
  178. package/dist/skill-install/skill-installer-common.d.ts +0 -26
  179. package/dist/skill-install/skill-installer-common.d.ts.map +0 -1
  180. package/dist/skill-install/skill-installer-common.js +0 -139
  181. package/dist/skill-install/skill-installer-common.js.map +0 -1
  182. package/dist/skill-install/skill-installers/claude-code.d.ts +0 -43
  183. package/dist/skill-install/skill-installers/claude-code.d.ts.map +0 -1
  184. package/dist/skill-install/skill-installers/claude-code.js +0 -65
  185. package/dist/skill-install/skill-installers/claude-code.js.map +0 -1
  186. package/dist/skill-install/skill-installers/codex-cli.d.ts +0 -27
  187. package/dist/skill-install/skill-installers/codex-cli.d.ts.map +0 -1
  188. package/dist/skill-install/skill-installers/codex-cli.js +0 -84
  189. package/dist/skill-install/skill-installers/codex-cli.js.map +0 -1
  190. package/dist/skill-install/skill-installers/cursor.d.ts +0 -72
  191. package/dist/skill-install/skill-installers/cursor.d.ts.map +0 -1
  192. package/dist/skill-install/skill-installers/cursor.js +0 -81
  193. package/dist/skill-install/skill-installers/cursor.js.map +0 -1
  194. package/dist/skill-install/skill-installers/gemini-cli.d.ts +0 -50
  195. package/dist/skill-install/skill-installers/gemini-cli.d.ts.map +0 -1
  196. package/dist/skill-install/skill-installers/gemini-cli.js +0 -72
  197. package/dist/skill-install/skill-installers/gemini-cli.js.map +0 -1
  198. package/dist/skill-install/skill-manifest-sync.d.ts +0 -11
  199. package/dist/skill-install/skill-manifest-sync.d.ts.map +0 -1
  200. package/dist/skill-install/skill-manifest-sync.js +0 -65
  201. package/dist/skill-install/skill-manifest-sync.js.map +0 -1
  202. package/dist/skills/_shared/auth.md +0 -41
  203. package/dist/skills/_shared/error-handling.md +0 -31
  204. package/dist/skills/_shared/polling.md +0 -88
  205. package/dist/skills/_shared/response-shape.md +0 -55
  206. package/dist/skills/_shared/review-policy.md +0 -15
  207. package/dist/skills/mma-audit/SKILL.md +0 -270
  208. package/dist/skills/mma-context-blocks/SKILL.md +0 -148
  209. package/dist/skills/mma-debug/SKILL.md +0 -208
  210. package/dist/skills/mma-delegate/SKILL.md +0 -216
  211. package/dist/skills/mma-execute-plan/SKILL.md +0 -214
  212. package/dist/skills/mma-explore/SKILL.md +0 -190
  213. package/dist/skills/mma-investigate/SKILL.md +0 -258
  214. package/dist/skills/mma-journal-recall/SKILL.md +0 -242
  215. package/dist/skills/mma-journal-record/SKILL.md +0 -189
  216. package/dist/skills/mma-research/SKILL.md +0 -223
  217. package/dist/skills/mma-retry/SKILL.md +0 -221
  218. package/dist/skills/mma-review/SKILL.md +0 -209
  219. package/dist/skills/multi-model-agent/SKILL.md +0 -206
  220. package/dist/telemetry/consent.d.ts +0 -4
  221. package/dist/telemetry/consent.d.ts.map +0 -1
  222. package/dist/telemetry/consent.js +0 -40
  223. package/dist/telemetry/consent.js.map +0 -1
  224. package/dist/telemetry/flusher.d.ts +0 -19
  225. package/dist/telemetry/flusher.d.ts.map +0 -1
  226. package/dist/telemetry/flusher.js +0 -277
  227. package/dist/telemetry/flusher.js.map +0 -1
  228. package/dist/telemetry/generation.d.ts +0 -9
  229. package/dist/telemetry/generation.d.ts.map +0 -1
  230. package/dist/telemetry/generation.js +0 -33
  231. package/dist/telemetry/generation.js.map +0 -1
  232. package/dist/telemetry/identity.d.ts +0 -9
  233. package/dist/telemetry/identity.d.ts.map +0 -1
  234. package/dist/telemetry/identity.js +0 -35
  235. package/dist/telemetry/identity.js.map +0 -1
  236. package/dist/telemetry/install-id.d.ts +0 -13
  237. package/dist/telemetry/install-id.d.ts.map +0 -1
  238. package/dist/telemetry/install-id.js +0 -49
  239. package/dist/telemetry/install-id.js.map +0 -1
  240. package/dist/telemetry/install-meta.d.ts +0 -10
  241. package/dist/telemetry/install-meta.d.ts.map +0 -1
  242. package/dist/telemetry/install-meta.js +0 -15
  243. package/dist/telemetry/install-meta.js.map +0 -1
  244. package/dist/telemetry/queue.d.ts +0 -35
  245. package/dist/telemetry/queue.d.ts.map +0 -1
  246. package/dist/telemetry/queue.js +0 -287
  247. package/dist/telemetry/queue.js.map +0 -1
  248. package/dist/telemetry/recorder.d.ts +0 -39
  249. package/dist/telemetry/recorder.d.ts.map +0 -1
  250. package/dist/telemetry/recorder.js +0 -173
  251. package/dist/telemetry/recorder.js.map +0 -1
  252. package/scripts/postinstall.js +0 -36
@@ -1,136 +0,0 @@
1
- // packages/server/src/http/handlers/introspection/status.ts
2
- import { readFileSync } from 'node:fs';
3
- import { homedir } from 'node:os';
4
- import { join } from 'node:path';
5
- import { sendJson } from '../../errors.js';
6
- /**
7
- * The skill manifest is installed by the `sync-skills` CLI.
8
- * We read it at /status request time — if absent, skillVersion and
9
- * skillCompatible are both null.
10
- */
11
- const SKILL_MANIFEST_PATH = join(homedir(), '.multi-model', 'skills-install-manifest.json');
12
- /**
13
- * SemVer range this server is compatible with for installed skills.
14
- * A manifest version that does NOT match means the skill is out of date.
15
- */
16
- export const SKILL_VERSION_COMPATIBLE = '>=3.0.0 <4.0.0';
17
- /** Simple semver range check: parses major.minor.patch and checks >=min <max. */
18
- function checkSkillCompatible(version) {
19
- // Parse the version string
20
- const match = /^(\d+)\.(\d+)\.(\d+)/.exec(version);
21
- if (!match)
22
- return false;
23
- const [, majorStr, minorStr, patchStr] = match;
24
- const major = parseInt(majorStr, 10);
25
- const minor = parseInt(minorStr, 10);
26
- const patch = parseInt(patchStr, 10);
27
- // Must be >= 3.0.0
28
- if (major < 3)
29
- return false;
30
- if (major === 3 && minor === 0 && patch < 0)
31
- return false;
32
- // Must be < 4.0.0
33
- if (major >= 4)
34
- return false;
35
- return true;
36
- }
37
- function readSkillManifest() {
38
- try {
39
- const raw = readFileSync(SKILL_MANIFEST_PATH, 'utf8');
40
- const manifest = JSON.parse(raw);
41
- const skillVersion = typeof manifest['skillVersion'] === 'string'
42
- ? manifest['skillVersion']
43
- : null;
44
- if (skillVersion === null) {
45
- return { skillVersion: null, skillCompatible: null };
46
- }
47
- let skillCompatible;
48
- try {
49
- skillCompatible = checkSkillCompatible(skillVersion);
50
- }
51
- catch {
52
- // Version parse failed — report incompatible
53
- skillCompatible = false;
54
- }
55
- return { skillVersion, skillCompatible };
56
- }
57
- catch {
58
- // File absent or unreadable
59
- return { skillVersion: null, skillCompatible: null };
60
- }
61
- }
62
- /**
63
- * GET /status — operator introspection endpoint.
64
- *
65
- * Requires both:
66
- * - Bearer auth (enforced by server pipeline, step 4)
67
- * - Loopback origin (enforced by server pipeline, step 3 — LOOPBACK_ONLY_PATHS)
68
- *
69
- * Returns the §5.10 status shape.
70
- */
71
- export function buildStatusHandler(deps) {
72
- return (_req, res) => {
73
- const { batchRegistry, projectRegistry, serverStartedAt, bind, version, } = deps;
74
- const now = Date.now();
75
- // ── Counters ──────────────────────────────────────────────────────────────
76
- let activeRequests = 0;
77
- let activeBatches = 0;
78
- const projects = [];
79
- for (const [, pc] of projectRegistry.entries()) {
80
- const pcActiveBatches = batchRegistry.countActiveForProject(pc.cwd);
81
- activeRequests += pc.activeRequests;
82
- activeBatches += pcActiveBatches;
83
- projects.push({
84
- cwd: pc.cwd,
85
- createdAt: pc.createdAt,
86
- lastActivityAt: pc.lastActivityAt,
87
- activeRequests: pc.activeRequests,
88
- activeBatches: pcActiveBatches,
89
- contextBlockCount: pc.contextBlocks.size,
90
- });
91
- }
92
- // ── Batch lists ───────────────────────────────────────────────────────────
93
- const inflight = [];
94
- const recent = [];
95
- for (const entry of batchRegistry.entries()) {
96
- if (entry.state === 'pending') {
97
- inflight.push({
98
- batchId: entry.batchId,
99
- tool: entry.tool,
100
- cwd: entry.projectCwd,
101
- startedAt: entry.startedAt,
102
- state: entry.state,
103
- });
104
- }
105
- else if (entry.state === 'complete' || entry.state === 'failed') {
106
- recent.push({
107
- batchId: entry.batchId,
108
- tool: entry.tool,
109
- cwd: entry.projectCwd,
110
- state: entry.state,
111
- stateChangedAt: entry.stateChangedAt,
112
- });
113
- }
114
- }
115
- // ── Skill manifest ────────────────────────────────────────────────────────
116
- const { skillVersion, skillCompatible } = readSkillManifest();
117
- sendJson(res, 200, {
118
- version,
119
- pid: process.pid,
120
- bind,
121
- uptimeMs: now - serverStartedAt,
122
- auth: { enabled: true },
123
- counters: {
124
- projectCount: projectRegistry.size,
125
- activeRequests,
126
- activeBatches,
127
- },
128
- projects,
129
- inflight,
130
- recent,
131
- skillVersion,
132
- skillCompatible,
133
- });
134
- };
135
- }
136
- //# sourceMappingURL=status.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"status.js","sourceRoot":"","sources":["../../../../src/http/handlers/introspection/status.ts"],"names":[],"mappings":"AAAA,4DAA4D;AAC5D,OAAO,EAAE,YAAY,EAAE,MAAM,S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QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE;YACjB,OAAO;YACP,GAAG,EAAE,OAAO,CAAC,GAAG;YAChB,IAAI;YACJ,QAAQ,EAAE,GAAG,GAAG,eAAe;YAC/B,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE;YACvB,QAAQ,EAAE;gBACR,YAAY,EAAE,eAAe,CAAC,IAAI;gBAClC,cAAc;gBACd,aAAa;aACd;YACD,QAAQ;YACR,QAAQ;YACR,MAAM;YACN,YAAY;YACZ,eAAe;SAChB,CAAC,CAAC;IACL,CAAC,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { HandlerDeps } from '../../handler-deps.js';
2
- import type { RawHandler } from '../../types.js';
3
- export declare function buildAuditHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=audit.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/audit.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAwC/D"}
@@ -1,43 +0,0 @@
1
- import * as audit from '@zhixuan92/multi-model-agent-core/tools/audit/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/audit/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- import { emitRequestReceived } from '../../request-observability.js';
7
- export function buildAuditHandler(deps) {
8
- return async (_req, res, _params, ctx) => {
9
- const parsed = audit.inputSchema.safeParse(ctx.body);
10
- if (!parsed.success) {
11
- sendError(res, 400, 'invalid_request', 'Request body validation failed', {
12
- fieldErrors: parsed.error.flatten(),
13
- });
14
- return;
15
- }
16
- const input = parsed.data;
17
- const cwd = ctx.cwd;
18
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
19
- if (!reserveResult.ok) {
20
- sendError(res, 503, reserveResult.error, reserveResult.message);
21
- return;
22
- }
23
- const pc = reserveResult.projectContext;
24
- pc.lastActivityAt = Date.now();
25
- deps.projectRegistry.cancelReservation(cwd);
26
- const blockIds = input.contextBlockIds ?? [];
27
- const { batchId, statusUrl } = asyncDispatch({
28
- tool: 'audit',
29
- projectCwd: cwd,
30
- blockIds,
31
- batchRegistry: deps.batchRegistry,
32
- projectContext: pc,
33
- deps,
34
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
35
- executor: async (executionCtx) => {
36
- return executeTask(toolConfig, executionCtx, input);
37
- },
38
- });
39
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
40
- sendJson(res, 202, { batchId, statusUrl });
41
- };
42
- }
43
- //# sourceMappingURL=audit.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/audit.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,sDAAsD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,MAAM,UAAU,iBAAiB,CAAC,IAAiB;IACjD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAA+B,EAAE,GAAG,EAAE,EAAE;QAChG,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,MAA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IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;QAEhE,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { HandlerDeps } from '../../handler-deps.js';
2
- import type { RawHandler } from '../../types.js';
3
- export declare function buildDebugHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=debug.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/debug.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAwC/D"}
@@ -1,43 +0,0 @@
1
- import * as debug from '@zhixuan92/multi-model-agent-core/tools/debug/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/debug/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- import { emitRequestReceived } from '../../request-observability.js';
7
- export function buildDebugHandler(deps) {
8
- return async (_req, res, _params, ctx) => {
9
- const parsed = debug.inputSchema.safeParse(ctx.body);
10
- if (!parsed.success) {
11
- sendError(res, 400, 'invalid_request', 'Request body validation failed', {
12
- fieldErrors: parsed.error.flatten(),
13
- });
14
- return;
15
- }
16
- const input = parsed.data;
17
- const cwd = ctx.cwd;
18
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
19
- if (!reserveResult.ok) {
20
- sendError(res, 503, reserveResult.error, reserveResult.message);
21
- return;
22
- }
23
- const pc = reserveResult.projectContext;
24
- pc.lastActivityAt = Date.now();
25
- deps.projectRegistry.cancelReservation(cwd);
26
- const blockIds = input.contextBlockIds ?? [];
27
- const { batchId, statusUrl } = asyncDispatch({
28
- tool: 'debug',
29
- projectCwd: cwd,
30
- blockIds,
31
- batchRegistry: deps.batchRegistry,
32
- projectContext: pc,
33
- deps,
34
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
35
- executor: async (executionCtx) => {
36
- return executeTask(toolConfig, executionCtx, input);
37
- },
38
- });
39
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
40
- sendJson(res, 202, { batchId, statusUrl });
41
- };
42
- }
43
- //# sourceMappingURL=debug.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"debug.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/debug.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,KAAK,MAAM,sDAAsD,CAAC;AAC9E,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,2DAA2D,CAAC;AACvF,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,MAAM,UAAU,iBAAiB,CAAC,IAAiB;IACjD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAA+B,EAAE,GAAG,EAAE,EAAE;QAChG,MAAM,MAAM,GAAG,KAAK,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACrD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,gCAAgC,EAAE;gBACvE,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE;aACpC,CAAC,CAAC;YACH,O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,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { HandlerDeps } from '../../handler-deps.js';
2
- import type { RawHandler } from '../../types.js';
3
- export declare function buildDelegateHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=delegate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delegate.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/delegate.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAwClE"}
@@ -1,43 +0,0 @@
1
- import * as delegate from '@zhixuan92/multi-model-agent-core/tools/delegate/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/delegate/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- import { emitRequestReceived } from '../../request-observability.js';
7
- export function buildDelegateHandler(deps) {
8
- return async (_req, res, _params, ctx) => {
9
- const parsed = delegate.inputSchema.safeParse(ctx.body);
10
- if (!parsed.success) {
11
- sendError(res, 400, 'invalid_request', 'Request body validation failed', {
12
- fieldErrors: parsed.error.flatten(),
13
- });
14
- return;
15
- }
16
- const input = parsed.data;
17
- const cwd = ctx.cwd;
18
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
19
- if (!reserveResult.ok) {
20
- sendError(res, 503, reserveResult.error, reserveResult.message);
21
- return;
22
- }
23
- const pc = reserveResult.projectContext;
24
- pc.lastActivityAt = Date.now();
25
- deps.projectRegistry.cancelReservation(cwd);
26
- const blockIds = input.tasks.flatMap(t => t.contextBlockIds ?? []);
27
- const { batchId, statusUrl } = asyncDispatch({
28
- tool: 'delegate',
29
- projectCwd: cwd,
30
- blockIds,
31
- batchRegistry: deps.batchRegistry,
32
- projectContext: pc,
33
- deps,
34
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
35
- executor: async (executionCtx) => {
36
- return executeTask(toolConfig, executionCtx, input);
37
- },
38
- });
39
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
40
- sendJson(res, 202, { batchId, statusUrl });
41
- };
42
- }
43
- //# sourceMappingURL=delegate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"delegate.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/delegate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,QAAQ,MAAM,yDAAyD,CAAC;AACpF,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,8DAA8D,CAAC;AAC1F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,MAAM,UAAU,oBAAoB,CAAC,IAAiB;IACpD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAA+B,EAAE,GAAG,EAAE,EAAE;QAChG,MAAM,MAAM,GAAG,QAAQ,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACxD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,gCAAgC,EAAE;gBACvE,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE;aACpC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;QAC1B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAI,CAAC;QAErB,MAAM,aAAa,GAAG,IAAI,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- import type { RawHandler } from '../../types.js';
3
- export declare function buildExecutePlanHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=execute-plan.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execute-plan.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/execute-plan.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CA0CrE"}
@@ -1,45 +0,0 @@
1
- import { executePlanInputSchema } from '@zhixuan92/multi-model-agent-core/tools/execute-plan/tool-config';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/execute-plan/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- import { emitRequestReceived } from '../../request-observability.js';
7
- export function buildExecutePlanHandler(deps) {
8
- return async (_req, res, _params, ctx) => {
9
- const parsed = executePlanInputSchema.safeParse(ctx.body);
10
- if (!parsed.success) {
11
- sendError(res, 400, 'invalid_request', 'Request body validation failed', {
12
- fieldErrors: parsed.error.flatten(),
13
- });
14
- return;
15
- }
16
- // Carry the HTTP `?cwd=` value through to the brief slot via input.cwd.
17
- // The schema marks cwd as optional; callers normally provide it via URL.
18
- const cwd = ctx.cwd;
19
- const input = { ...parsed.data, cwd };
20
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
21
- if (!reserveResult.ok) {
22
- sendError(res, 503, reserveResult.error, reserveResult.message);
23
- return;
24
- }
25
- const pc = reserveResult.projectContext;
26
- pc.lastActivityAt = Date.now();
27
- deps.projectRegistry.cancelReservation(cwd);
28
- const blockIds = input.contextBlockIds ?? [];
29
- const { batchId, statusUrl } = asyncDispatch({
30
- tool: 'execute-plan',
31
- projectCwd: cwd,
32
- blockIds,
33
- batchRegistry: deps.batchRegistry,
34
- projectContext: pc,
35
- deps,
36
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
37
- executor: async (executionCtx) => {
38
- return executeTask(toolConfig, executionCtx, input);
39
- },
40
- });
41
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
42
- sendJson(res, 202, { batchId, statusUrl });
43
- };
44
- }
45
- //# sourceMappingURL=execute-plan.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"execute-plan.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/execute-plan.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kEAAkE,CAAC;AAE1G,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,kEAAkE,CAAC;AAC9F,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,MAAM,UAAU,uBAAuB,CAAC,IAAiB;IACvD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAA+B,EAAE,GAAG,EAAE,EAAE;QAChG,MAAM,MAAM,GAAG,sBAAsB,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC1D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,gCAAgC,EAAE;gBACvE,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE;aACpC,CAAC,CAAC;YACH,OAAO;QACT,CAAC;QAED,wEAAwE;QACxE,yEAAyE;QACzE,MAAM,GAAG,GAAG,GAAG,CAAC,GAAI,CAAC;QACrB,MAAM,KAAK,GAAy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erDeps } from '../../handler-deps.js';
2
- import type { RawHandler } from '../../types.js';
3
- export declare function buildInvestigateHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=investigate.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"investigate.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/investigate.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CA6DrE"}
@@ -1,64 +0,0 @@
1
- import * as investigate from '@zhixuan92/multi-model-agent-core/tools/investigate/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/investigate/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- import { emitRequestReceived } from '../../request-observability.js';
7
- import { canonicalizeFilePaths } from '../../canonicalize-file-paths.js';
8
- export function buildInvestigateHandler(deps) {
9
- return async (_req, res, _params, ctx) => {
10
- const parsed = investigate.inputSchema.safeParse(ctx.body);
11
- if (!parsed.success) {
12
- sendError(res, 400, 'invalid_request', 'Request body validation failed', {
13
- fieldErrors: parsed.error.flatten(),
14
- });
15
- return;
16
- }
17
- const input = parsed.data;
18
- const cwd = ctx.cwd;
19
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
20
- if (!reserveResult.ok) {
21
- sendError(res, 503, reserveResult.error, reserveResult.message);
22
- return;
23
- }
24
- const pc = reserveResult.projectContext;
25
- pc.lastActivityAt = Date.now();
26
- deps.projectRegistry.cancelReservation(cwd);
27
- // Validate context block IDs exist (content reaches the worker via the
28
- // dispatch-time prepend keyed on TaskSpec.contextBlockIds).
29
- const blockIds = input.contextBlockIds ?? [];
30
- const missingBlocks = blockIds.filter(id => pc.contextBlocks.get(id) === undefined);
31
- if (missingBlocks.length > 0) {
32
- sendError(res, 400, 'context_block_not_found', 'one or more context block IDs do not exist', { missingBlocks });
33
- return;
34
- }
35
- // Canonicalize file paths.
36
- const rawPaths = input.filePaths ?? [];
37
- const canonResult = canonicalizeFilePaths(rawPaths, cwd);
38
- if (!Array.isArray(canonResult)) {
39
- sendError(res, 400, 'invalid_request', 'one or more filePaths escape cwd', { fieldErrors: canonResult.fieldErrors });
40
- return;
41
- }
42
- const canonicalizedFilePaths = canonResult;
43
- // Build enriched input for the generic task executor.
44
- const enrichedInput = {
45
- ...input,
46
- canonicalizedFilePaths,
47
- };
48
- const { batchId, statusUrl } = asyncDispatch({
49
- tool: 'investigate',
50
- projectCwd: cwd,
51
- blockIds,
52
- batchRegistry: deps.batchRegistry,
53
- projectContext: pc,
54
- deps,
55
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
56
- executor: async (executionCtx) => {
57
- return executeTask(toolConfig, executionCtx, enrichedInput);
58
- },
59
- });
60
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
61
- sendJson(res, 202, { batchId, statusUrl });
62
- };
63
- }
64
- //# sourceMappingURL=investigate.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"investigate.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/investigate.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,WAAW,MAAM,4DAA4D,CAAC;AAC1F,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,UAAU,EAAiC,MAAM,iEAAiE,CAAC;AAC5H,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAErE,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,MAAM,UAAU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,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { HandlerDeps } from '../../handler-deps.js';
2
- import type { RawHandler } from '../../types.js';
3
- export declare function buildJournalRecallHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=journal-recall.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"journal-recall.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/journal-recall.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CA8BvE"}
@@ -1,40 +0,0 @@
1
- import * as recall from '@zhixuan92/multi-model-agent-core/tools/journal/recall/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/journal/recall/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- import { emitRequestReceived } from '../../request-observability.js';
7
- export function buildJournalRecallHandler(deps) {
8
- return async (_req, res, _params, ctx) => {
9
- const parsed = recall.inputSchema.safeParse(ctx.body);
10
- if (!parsed.success) {
11
- sendError(res, 400, 'invalid_request', 'Request body validation failed', { fieldErrors: parsed.error.flatten() });
12
- return;
13
- }
14
- const input = parsed.data;
15
- const cwd = ctx.cwd;
16
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
17
- if (!reserveResult.ok) {
18
- sendError(res, 503, reserveResult.error, reserveResult.message);
19
- return;
20
- }
21
- const pc = reserveResult.projectContext;
22
- pc.lastActivityAt = Date.now();
23
- deps.projectRegistry.cancelReservation(cwd);
24
- const blockIds = input.contextBlockIds ?? [];
25
- const missingBlocks = blockIds.filter(id => pc.contextBlocks.get(id) === undefined);
26
- if (missingBlocks.length > 0) {
27
- sendError(res, 400, 'context_block_not_found', 'one or more context block IDs do not exist', { missingBlocks });
28
- return;
29
- }
30
- const { batchId, statusUrl } = asyncDispatch({
31
- tool: 'journal-recall', projectCwd: cwd, blockIds,
32
- batchRegistry: deps.batchRegistry, projectContext: pc, deps,
33
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
34
- executor: async (executionCtx) => executeTask(toolConfig, executionCtx, input),
35
- });
36
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
37
- sendJson(res, 202, { batchId, statusUrl });
38
- };
39
- }
40
- //# sourceMappingURL=journal-recall.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"journal-recall.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/journal-recall.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,MAAM,+DAA+D,CAAC;AACxF,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,oEAAoE,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,MAAM,UAAU,yBAAyB,CAAC,IAAiB;IACzD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;QACxE,MAAM,MAAM,GAAG,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACtD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,EAAE,WAAW,EAAE,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;YAClH,OAAO;QACT,CAAC;QACD,MAAM,KAAK,GAAG,MA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AW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC;SAC/E,CAAC,CAAC;QACH,MAAM,mBAAmB,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,GAAG,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC;QAChE,QAAQ,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { HandlerDeps } from '../../handler-deps.js';
2
- import type { RawHandler } from '../../types.js';
3
- export declare function buildJournalRecordHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=journal-record.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"journal-record.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/journal-record.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAyBvE"}
@@ -1,35 +0,0 @@
1
- import * as journal from '@zhixuan92/multi-model-agent-core/tools/journal/record/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/journal/record/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- import { emitRequestReceived } from '../../request-observability.js';
7
- export function buildJournalRecordHandler(deps) {
8
- return async (_req, res, _params, ctx) => {
9
- const parsed = journal.inputSchema.safeParse(ctx.body);
10
- if (!parsed.success) {
11
- sendError(res, 400, 'invalid_request', 'Request body validation failed', { fieldErrors: parsed.error.flatten() });
12
- return;
13
- }
14
- const input = parsed.data;
15
- const cwd = ctx.cwd;
16
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
17
- if (!reserveResult.ok) {
18
- sendError(res, 503, reserveResult.error, reserveResult.message);
19
- return;
20
- }
21
- const pc = reserveResult.projectContext;
22
- pc.lastActivityAt = Date.now();
23
- deps.projectRegistry.cancelReservation(cwd);
24
- const blockIds = input.contextBlockIds ?? [];
25
- const { batchId, statusUrl } = asyncDispatch({
26
- tool: 'journal-record', projectCwd: cwd, blockIds,
27
- batchRegistry: deps.batchRegistry, projectContext: pc, deps,
28
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
29
- executor: async (executionCtx) => executeTask(toolConfig, executionCtx, input),
30
- });
31
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
32
- sendJson(res, 202, { batchId, statusUrl });
33
- };
34
- }
35
- //# sourceMappingURL=journal-record.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"journal-record.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/journal-record.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,+DAA+D,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,2DAA2D,CAAC;AACxF,OAAO,EAAE,UAAU,EAAE,MAAM,oEAAoE,CAAC;AAChG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAGrE,MAAM,UAAU,yBAAyB,CAAC,IAAiB;IACzD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAA+B,EAAE,GAAG,EAAE,EAAE;QAChG,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QACvD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;YACpB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,iBAAiB,EAAE,gCAAgC,EAAE,EAAE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AE,EAAE,OAAO,EAAE,SAAS,EAAE,CAAC,CAAC;IAC7C,CAAC,CAAC;AACJ,CAAC"}
@@ -1,4 +0,0 @@
1
- import type { HandlerDeps } from '../../handler-deps.js';
2
- import type { RawHandler } from '../../types.js';
3
- export declare function buildResearchHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=research.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"research.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/research.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CA4DlE"}