@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
@@ -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,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,CAAC,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;YACtB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;YAChE,OAAO;QACT,CAAC;QACD,MAAM,EAAE,GAAG,aAAa,CAAC,cAAc,CAAC;QACxC,EAAE,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAE5C,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC;YAC3C,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,GAAG;YACf,QAAQ;YACR,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,EAAE;YAClB,IAAI;YACJ,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;YAC9D,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;gBAC/B,OAAO,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,mBAAmB,CAAC,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,OAAO;QACT,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC;QAC1B,MAAM,GAAG,GAAG,GAAG,CAAC,GAAI,CAAC;QAErB,MAAM,aAAa,GAAG,IAAI,CAAC,eAAe,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAC/D,IAAI,CAAC,aAAa,CAAC,EAAE,EAAE,CAAC;YACtB,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,aAAa,CAAC,KAAK,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;YAChE,OAAO;QACT,CAAC;QACD,MAAM,EAAE,GAAG,aAAa,CAAC,cAAc,CAAC;QACxC,EAAE,CAAC,cAAc,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAE5C,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC;YAC3C,IAAI,EAAE,OAAO;YACb,UAAU,EAAE,GAAG;YACf,QAAQ;YACR,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,EAAE;YAClB,IAAI;YACJ,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;YAC9D,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;gBAC/B,OAAO,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,mBAAmB,CAAC,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 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,M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AE5C,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,IAAI,EAAE,CAAC,CAAC;QACnE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC;YAC3C,IAAI,EAAE,UAAU;YAChB,UAAU,EAAE,GAAG;YACf,QAAQ;YACR,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,EAAE;YAClB,IAAI;YACJ,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;YAC9D,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;gBAC/B,OAAO,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,mBAAmB,CAAC,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 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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CAAC,GAAG,EAAE,CAAC;QAC/B,IAAI,CAAC,eAAe,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC;QAE5C,MAAM,QAAQ,GAAG,KAAK,CAAC,eAAe,IAAI,EAAE,CAAC;QAC7C,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC;YAC3C,IAAI,EAAE,cAAc;YACpB,UAAU,EAAE,GAAG;YACf,QAAQ;YACR,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,EAAE;YAClB,IAAI;YACJ,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;YAC9D,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;gBAC/B,OAAO,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;SACF,CAAC,CAAC;QAEH,MAAM,mBAAmB,CAAC,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 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,uBAAuB,CAAC,IAAiB;IACvD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAAO,EAAE,GAAG,EAAE,EAAE;QACxE,MAAM,MAAM,GAAG,WAAW,CAAC,WAAW,CAAC,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC3D,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;Y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AE,EAAE,WAAW,EAAE,WAAW,CAAC,WAAW,EAAE,CAAC,CAAC;YACrH,OAAO;QACT,CAAC;QACD,MAAM,sBAAsB,GAAG,WAAW,CAAC;QAE3C,sDAAsD;QACtD,MAAM,aAAa,GAA6B;YAC9C,GAAG,KAAK;YACR,sBAAsB;SACvB,CAAC;QAEF,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC;YAC3C,IAAI,EAAE,aAAa;YACnB,UAAU,EAAE,GAAG;YACf,QAAQ;YACR,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,cAAc,EAAE,EAAE;YAClB,IAAI;YACJ,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;YAC9D,QAAQ,EAAE,KAAK,EAAE,YAAY,EAAE,EAAE;gBAC/B,OAAO,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;YAC9D,CAAC;SACF,CAAC,CAAC;QAEH,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 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
-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-agent-core';
3
- import type { HandlerDeps } from '../../handler-deps.js';
4
- import type { RawHandler } from '../../types.js';
5
- /**
6
- * Executor for one journal-record dispatch. Per-cwd serialization is handled by
7
- * the goal-set's `withWriteGoalLock` (in task-executor), which subsumes the old
8
- * per-project journal lock — no separate lock here.
9
- */
10
- export declare function journalRecordExecutor(input: journal.Input, _cwd: string): (executionCtx: ExecutionContext) => Promise<import("@zhixuan92/multi-model-agent-core/lifecycle/executor-output-types").ExecutorOutput>;
11
- export declare function buildJournalRecordHandler(deps: HandlerDeps): RawHandler;
12
- //# 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":"AACA,OAAO,KAAK,OAAO,MAAM,+DAA+D,CAAC;AAGzF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AAG1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,MAAM,IAC9D,cAAc,gBAAgB,yGAEvC;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAyBvE"}
@@ -1,43 +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
- /**
8
- * Executor for one journal-record dispatch. Per-cwd serialization is handled by
9
- * the goal-set's `withWriteGoalLock` (in task-executor), which subsumes the old
10
- * per-project journal lock — no separate lock here.
11
- */
12
- export function journalRecordExecutor(input, _cwd) {
13
- return (executionCtx) => executeTask(toolConfig, executionCtx, input);
14
- }
15
- export function buildJournalRecordHandler(deps) {
16
- return async (_req, res, _params, ctx) => {
17
- const parsed = journal.inputSchema.safeParse(ctx.body);
18
- if (!parsed.success) {
19
- sendError(res, 400, 'invalid_request', 'Request body validation failed', { fieldErrors: parsed.error.flatten() });
20
- return;
21
- }
22
- const input = parsed.data;
23
- const cwd = ctx.cwd;
24
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
25
- if (!reserveResult.ok) {
26
- sendError(res, 503, reserveResult.error, reserveResult.message);
27
- return;
28
- }
29
- const pc = reserveResult.projectContext;
30
- pc.lastActivityAt = Date.now();
31
- deps.projectRegistry.cancelReservation(cwd);
32
- const blockIds = input.contextBlockIds ?? [];
33
- const { batchId, statusUrl } = asyncDispatch({
34
- tool: 'journal-record', projectCwd: cwd, blockIds,
35
- batchRegistry: deps.batchRegistry, projectContext: pc, deps,
36
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
37
- executor: journalRecordExecutor(input, cwd),
38
- });
39
- await emitRequestReceived(deps, batchId, _req.url ?? '', input);
40
- sendJson(res, 202, { batchId, statusUrl });
41
- };
42
- }
43
- //# 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;AAEhG,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAExD,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAA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,GAAG,aAAa,CAAC;YAC3C,IAAI,EAAE,gBAAgB,EAAE,UAAU,EAAE,GAAG,EAAE,QAAQ;YACjD,aAAa,EAAE,IAAI,CAAC,aAAa,EAAE,cAAc,EAAE,EAAE,EAAE,IAAI;YAC3D,MAAM,EAAE,EAAE,MAAM,EAAE,GAAG,CAAC,YAAY,EAAE,SAAS,EAAE,GAAG,CAAC,SAAS,EAAE;YAC9D,QAAQ,EAAE,qBAAqB,CAAC,KAAK,EAAE,GAAG,CAAC;SAC5C,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 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"}
@@ -1,64 +0,0 @@
1
- import * as research from '@zhixuan92/multi-model-agent-core/tools/research/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/research/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 buildResearchHandler(deps) {
8
- return async (_req, res, _params, ctx) => {
9
- const parsed = research.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 resolvedContextBlocks = [];
28
- const missingBlocks = [];
29
- for (const id of blockIds) {
30
- const content = pc.contextBlocks.get(id);
31
- if (content === undefined) {
32
- missingBlocks.push(id);
33
- }
34
- else {
35
- resolvedContextBlocks.push({ id, content });
36
- }
37
- }
38
- if (missingBlocks.length > 0) {
39
- sendError(res, 400, 'context_block_not_found', 'one or more context block IDs do not exist', { missingBlocks });
40
- return;
41
- }
42
- const researchCfg = deps.config.research;
43
- const enrichedInput = {
44
- ...input,
45
- resolvedContextBlocks,
46
- hasBrave: (researchCfg?.brave?.apiKeys?.length ?? 0) > 0,
47
- };
48
- const { batchId, statusUrl } = asyncDispatch({
49
- tool: 'research',
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=research.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"research.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/research.ts"],"names":[],"mapp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EAAE,YAAY,EAAE,EAAE;gBAC/B,OAAO,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,CAAC,CAAC;YAC9D,CAAC;SACF,CAAC,CAAC;QAEH,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 buildRetryHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=retry.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/retry.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAgD/D"}
@@ -1,49 +0,0 @@
1
- import * as retry from '@zhixuan92/multi-model-agent-core/tools/retry/schema';
2
- import { executeTask } from '@zhixuan92/multi-model-agent-core/lifecycle/task-executor';
3
- import { toolConfig } from '@zhixuan92/multi-model-agent-core/tools/retry/tool-config';
4
- import { sendError, sendJson } from '../../errors.js';
5
- import { asyncDispatch } from '../../async-dispatch.js';
6
- export function buildRetryHandler(deps) {
7
- return async (_req, res, _params, ctx) => {
8
- const parsed = retry.inputSchema.safeParse(ctx.body);
9
- if (!parsed.success) {
10
- sendError(res, 400, 'invalid_request', 'Request body validation failed', {
11
- fieldErrors: parsed.error.flatten(),
12
- });
13
- return;
14
- }
15
- const input = parsed.data;
16
- const cwd = ctx.cwd;
17
- const reserveResult = deps.projectRegistry.reserveProject(cwd);
18
- if (!reserveResult.ok) {
19
- sendError(res, 503, reserveResult.error, reserveResult.message);
20
- return;
21
- }
22
- const pc = reserveResult.projectContext;
23
- pc.lastActivityAt = Date.now();
24
- deps.projectRegistry.cancelReservation(cwd);
25
- const { batchId, statusUrl } = asyncDispatch({
26
- tool: 'retry',
27
- projectCwd: cwd,
28
- blockIds: [],
29
- batchRegistry: deps.batchRegistry,
30
- projectContext: pc,
31
- deps,
32
- caller: { client: ctx.callerClient, mainModel: ctx.mainModel },
33
- executor: async (executionCtx) => {
34
- const batchCache = executionCtx.projectContext.batchCache;
35
- // Surface a clean error if the prior batch's goal is gone; buildTaskSpec
36
- // also throws goal_not_found, but this gives the friendlier message.
37
- if (!batchCache.get(input.batchId)) {
38
- throw new Error(`batch "${input.batchId}" is unknown or expired — re-dispatch via delegate / execute-plan`);
39
- }
40
- batchCache.touch(input.batchId);
41
- // Goal mode: executeTask pulls the stored goal (via the retry tool-config's
42
- // buildTaskSpec) and re-fires the whole goal-set against the current HEAD.
43
- return executeTask(toolConfig, executionCtx, input);
44
- },
45
- });
46
- sendJson(res, 202, { batchId, statusUrl });
47
- };
48
- }
49
- //# sourceMappingURL=retry.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"retry.js","sourceRoot":"","sources":["../../../../src/http/handlers/tools/retry.ts"],"names":[],"mappings":"AAQA,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;AAIxD,MAAM,UAAU,iBAAiB,CAAC,IAAiB;IACjD,OAAO,KAAK,EAAE,IAAqB,EAAE,GAAmB,EAAE,OAA+B,EAAE,GAAG,EAAE,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,CAAC;gBAC3D,yEAAyE;gBACzE,qEAAqE;gBACrE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE,CAAC;oBACnC,MAAM,IAAI,KAAK,CACb,UAAU,KAAK,CAAC,OAAO,mEAAmE,CAC3F,CAAC;gBACJ,CAAC;gBACD,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;gBAChC,4EAA4E;gBAC5E,2EAA2E;gBAC3E,OAAO,WAAW,CAAC,UAAU,EAAE,YAAY,EAAE,KAAK,CAAC,CAAC;YACtD,CAAC;SACF,CAAC,CAAC;QAEH,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 buildReviewHandler(deps: HandlerDeps): RawHandler;
4
- //# sourceMappingURL=review.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"review.d.ts","sourceRoot":"","sources":["../../../../src/http/handlers/tools/review.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEzD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACjD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,WAAW,GAAG,UAAU,CAwChE"}