@zhixuan92/multi-model-agent 4.9.1 → 5.0.1
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.
- package/README.md +4 -3
- package/bin/mmagent.mjs +47 -0
- package/package.json +24 -43
- package/postinstall.mjs +8 -0
- package/dist/cli/index.d.ts +0 -62
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/index.js +0 -345
- package/dist/cli/index.js.map +0 -1
- package/dist/cli/info.d.ts +0 -22
- package/dist/cli/info.d.ts.map +0 -1
- package/dist/cli/info.js +0 -100
- package/dist/cli/info.js.map +0 -1
- package/dist/cli/logs.d.ts +0 -15
- package/dist/cli/logs.d.ts.map +0 -1
- package/dist/cli/logs.js +0 -102
- package/dist/cli/logs.js.map +0 -1
- package/dist/cli/print-token.d.ts +0 -18
- package/dist/cli/print-token.d.ts.map +0 -1
- package/dist/cli/print-token.js +0 -60
- package/dist/cli/print-token.js.map +0 -1
- package/dist/cli/serve.d.ts +0 -28
- package/dist/cli/serve.d.ts.map +0 -1
- package/dist/cli/serve.js +0 -405
- package/dist/cli/serve.js.map +0 -1
- package/dist/cli/status.d.ts +0 -49
- package/dist/cli/status.d.ts.map +0 -1
- package/dist/cli/status.js +0 -155
- package/dist/cli/status.js.map +0 -1
- package/dist/cli/sync-skills.d.ts +0 -58
- package/dist/cli/sync-skills.d.ts.map +0 -1
- package/dist/cli/sync-skills.js +0 -266
- package/dist/cli/sync-skills.js.map +0 -1
- package/dist/cli/telemetry.d.ts +0 -10
- package/dist/cli/telemetry.d.ts.map +0 -1
- package/dist/cli/telemetry.js +0 -161
- package/dist/cli/telemetry.js.map +0 -1
- package/dist/cli/toggle.d.ts +0 -26
- package/dist/cli/toggle.d.ts.map +0 -1
- package/dist/cli/toggle.js +0 -185
- package/dist/cli/toggle.js.map +0 -1
- package/dist/http/async-dispatch.d.ts +0 -44
- package/dist/http/async-dispatch.d.ts.map +0 -1
- package/dist/http/async-dispatch.js +0 -175
- package/dist/http/async-dispatch.js.map +0 -1
- package/dist/http/auth.d.ts +0 -20
- package/dist/http/auth.d.ts.map +0 -1
- package/dist/http/auth.js +0 -56
- package/dist/http/auth.js.map +0 -1
- package/dist/http/canonicalize-file-paths.d.ts +0 -8
- package/dist/http/canonicalize-file-paths.d.ts.map +0 -1
- package/dist/http/canonicalize-file-paths.js +0 -43
- package/dist/http/canonicalize-file-paths.js.map +0 -1
- package/dist/http/cwd-validator.d.ts +0 -11
- package/dist/http/cwd-validator.d.ts.map +0 -1
- package/dist/http/cwd-validator.js +0 -130
- package/dist/http/cwd-validator.js.map +0 -1
- package/dist/http/errors.d.ts +0 -4
- package/dist/http/errors.d.ts.map +0 -1
- package/dist/http/errors.js +0 -9
- package/dist/http/errors.js.map +0 -1
- package/dist/http/execution-context.d.ts +0 -18
- package/dist/http/execution-context.d.ts.map +0 -1
- package/dist/http/execution-context.js +0 -61
- package/dist/http/execution-context.js.map +0 -1
- package/dist/http/handler-deps.d.ts +0 -19
- package/dist/http/handler-deps.d.ts.map +0 -1
- package/dist/http/handler-deps.js +0 -2
- package/dist/http/handler-deps.js.map +0 -1
- package/dist/http/handlers/control/batch-slice.d.ts +0 -4
- package/dist/http/handlers/control/batch-slice.d.ts.map +0 -1
- package/dist/http/handlers/control/batch-slice.js +0 -40
- package/dist/http/handlers/control/batch-slice.js.map +0 -1
- package/dist/http/handlers/control/batch.d.ts +0 -23
- package/dist/http/handlers/control/batch.d.ts.map +0 -1
- package/dist/http/handlers/control/batch.js +0 -332
- package/dist/http/handlers/control/batch.js.map +0 -1
- package/dist/http/handlers/control/context-blocks.d.ts +0 -22
- package/dist/http/handlers/control/context-blocks.d.ts.map +0 -1
- package/dist/http/handlers/control/context-blocks.js +0 -111
- package/dist/http/handlers/control/context-blocks.js.map +0 -1
- package/dist/http/handlers/introspection/health.d.ts +0 -20
- package/dist/http/handlers/introspection/health.d.ts.map +0 -1
- package/dist/http/handlers/introspection/health.js +0 -18
- package/dist/http/handlers/introspection/health.js.map +0 -1
- package/dist/http/handlers/introspection/status.d.ts +0 -26
- package/dist/http/handlers/introspection/status.d.ts.map +0 -1
- package/dist/http/handlers/introspection/status.js +0 -136
- package/dist/http/handlers/introspection/status.js.map +0 -1
- package/dist/http/handlers/tools/audit.d.ts +0 -4
- package/dist/http/handlers/tools/audit.d.ts.map +0 -1
- package/dist/http/handlers/tools/audit.js +0 -43
- package/dist/http/handlers/tools/audit.js.map +0 -1
- package/dist/http/handlers/tools/debug.d.ts +0 -4
- package/dist/http/handlers/tools/debug.d.ts.map +0 -1
- package/dist/http/handlers/tools/debug.js +0 -43
- package/dist/http/handlers/tools/debug.js.map +0 -1
- package/dist/http/handlers/tools/delegate.d.ts +0 -4
- package/dist/http/handlers/tools/delegate.d.ts.map +0 -1
- package/dist/http/handlers/tools/delegate.js +0 -43
- package/dist/http/handlers/tools/delegate.js.map +0 -1
- package/dist/http/handlers/tools/execute-plan.d.ts +0 -4
- package/dist/http/handlers/tools/execute-plan.d.ts.map +0 -1
- package/dist/http/handlers/tools/execute-plan.js +0 -45
- package/dist/http/handlers/tools/execute-plan.js.map +0 -1
- package/dist/http/handlers/tools/investigate.d.ts +0 -4
- package/dist/http/handlers/tools/investigate.d.ts.map +0 -1
- package/dist/http/handlers/tools/investigate.js +0 -64
- package/dist/http/handlers/tools/investigate.js.map +0 -1
- package/dist/http/handlers/tools/journal-recall.d.ts +0 -4
- package/dist/http/handlers/tools/journal-recall.d.ts.map +0 -1
- package/dist/http/handlers/tools/journal-recall.js +0 -40
- package/dist/http/handlers/tools/journal-recall.js.map +0 -1
- package/dist/http/handlers/tools/journal-record.d.ts +0 -4
- package/dist/http/handlers/tools/journal-record.d.ts.map +0 -1
- package/dist/http/handlers/tools/journal-record.js +0 -35
- package/dist/http/handlers/tools/journal-record.js.map +0 -1
- package/dist/http/handlers/tools/research.d.ts +0 -4
- package/dist/http/handlers/tools/research.d.ts.map +0 -1
- package/dist/http/handlers/tools/research.js +0 -64
- package/dist/http/handlers/tools/research.js.map +0 -1
- package/dist/http/handlers/tools/retry.d.ts +0 -4
- package/dist/http/handlers/tools/retry.d.ts.map +0 -1
- package/dist/http/handlers/tools/retry.js +0 -73
- package/dist/http/handlers/tools/retry.js.map +0 -1
- package/dist/http/handlers/tools/review.d.ts +0 -4
- package/dist/http/handlers/tools/review.d.ts.map +0 -1
- package/dist/http/handlers/tools/review.js +0 -43
- package/dist/http/handlers/tools/review.js.map +0 -1
- package/dist/http/middleware/body-reader.d.ts +0 -16
- package/dist/http/middleware/body-reader.d.ts.map +0 -1
- package/dist/http/middleware/body-reader.js +0 -44
- package/dist/http/middleware/body-reader.js.map +0 -1
- package/dist/http/middleware/caller-identity.d.ts +0 -16
- package/dist/http/middleware/caller-identity.d.ts.map +0 -1
- package/dist/http/middleware/caller-identity.js +0 -16
- package/dist/http/middleware/caller-identity.js.map +0 -1
- package/dist/http/middleware/decompress.d.ts +0 -14
- package/dist/http/middleware/decompress.d.ts.map +0 -1
- package/dist/http/middleware/decompress.js +0 -51
- package/dist/http/middleware/decompress.js.map +0 -1
- package/dist/http/project-registry.d.ts +0 -54
- package/dist/http/project-registry.d.ts.map +0 -1
- package/dist/http/project-registry.js +0 -130
- package/dist/http/project-registry.js.map +0 -1
- package/dist/http/request-observability.d.ts +0 -8
- package/dist/http/request-observability.d.ts.map +0 -1
- package/dist/http/request-observability.js +0 -20
- package/dist/http/request-observability.js.map +0 -1
- package/dist/http/request-pipeline.d.ts +0 -16
- package/dist/http/request-pipeline.d.ts.map +0 -1
- package/dist/http/request-pipeline.js +0 -144
- package/dist/http/request-pipeline.js.map +0 -1
- package/dist/http/server.d.ts +0 -17
- package/dist/http/server.d.ts.map +0 -1
- package/dist/http/server.js +0 -300
- package/dist/http/server.js.map +0 -1
- package/dist/http/types.d.ts +0 -20
- package/dist/http/types.d.ts.map +0 -1
- package/dist/http/types.js +0 -2
- package/dist/http/types.js.map +0 -1
- package/dist/skill-install/disabled-state.d.ts +0 -35
- package/dist/skill-install/disabled-state.d.ts.map +0 -1
- package/dist/skill-install/disabled-state.js +0 -96
- package/dist/skill-install/disabled-state.js.map +0 -1
- package/dist/skill-install/discover.d.ts +0 -29
- package/dist/skill-install/discover.d.ts.map +0 -1
- package/dist/skill-install/discover.js +0 -104
- package/dist/skill-install/discover.js.map +0 -1
- package/dist/skill-install/include-utils.d.ts +0 -27
- package/dist/skill-install/include-utils.d.ts.map +0 -1
- package/dist/skill-install/include-utils.js +0 -90
- package/dist/skill-install/include-utils.js.map +0 -1
- package/dist/skill-install/manifest.d.ts +0 -82
- package/dist/skill-install/manifest.d.ts.map +0 -1
- package/dist/skill-install/manifest.js +0 -215
- package/dist/skill-install/manifest.js.map +0 -1
- package/dist/skill-install/skill-installer-common.d.ts +0 -26
- package/dist/skill-install/skill-installer-common.d.ts.map +0 -1
- package/dist/skill-install/skill-installer-common.js +0 -139
- package/dist/skill-install/skill-installer-common.js.map +0 -1
- package/dist/skill-install/skill-installers/claude-code.d.ts +0 -43
- package/dist/skill-install/skill-installers/claude-code.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/claude-code.js +0 -65
- package/dist/skill-install/skill-installers/claude-code.js.map +0 -1
- package/dist/skill-install/skill-installers/codex-cli.d.ts +0 -27
- package/dist/skill-install/skill-installers/codex-cli.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/codex-cli.js +0 -84
- package/dist/skill-install/skill-installers/codex-cli.js.map +0 -1
- package/dist/skill-install/skill-installers/cursor.d.ts +0 -72
- package/dist/skill-install/skill-installers/cursor.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/cursor.js +0 -81
- package/dist/skill-install/skill-installers/cursor.js.map +0 -1
- package/dist/skill-install/skill-installers/gemini-cli.d.ts +0 -50
- package/dist/skill-install/skill-installers/gemini-cli.d.ts.map +0 -1
- package/dist/skill-install/skill-installers/gemini-cli.js +0 -72
- package/dist/skill-install/skill-installers/gemini-cli.js.map +0 -1
- package/dist/skill-install/skill-manifest-sync.d.ts +0 -11
- package/dist/skill-install/skill-manifest-sync.d.ts.map +0 -1
- package/dist/skill-install/skill-manifest-sync.js +0 -65
- package/dist/skill-install/skill-manifest-sync.js.map +0 -1
- package/dist/skills/_shared/auth.md +0 -41
- package/dist/skills/_shared/error-handling.md +0 -31
- package/dist/skills/_shared/polling.md +0 -88
- package/dist/skills/_shared/response-shape.md +0 -55
- package/dist/skills/_shared/review-policy.md +0 -15
- package/dist/skills/mma-audit/SKILL.md +0 -270
- package/dist/skills/mma-context-blocks/SKILL.md +0 -148
- package/dist/skills/mma-debug/SKILL.md +0 -208
- package/dist/skills/mma-delegate/SKILL.md +0 -216
- package/dist/skills/mma-execute-plan/SKILL.md +0 -214
- package/dist/skills/mma-explore/SKILL.md +0 -190
- package/dist/skills/mma-investigate/SKILL.md +0 -258
- package/dist/skills/mma-journal-recall/SKILL.md +0 -242
- package/dist/skills/mma-journal-record/SKILL.md +0 -189
- package/dist/skills/mma-research/SKILL.md +0 -223
- package/dist/skills/mma-retry/SKILL.md +0 -221
- package/dist/skills/mma-review/SKILL.md +0 -209
- package/dist/skills/multi-model-agent/SKILL.md +0 -206
- package/dist/telemetry/consent.d.ts +0 -4
- package/dist/telemetry/consent.d.ts.map +0 -1
- package/dist/telemetry/consent.js +0 -40
- package/dist/telemetry/consent.js.map +0 -1
- package/dist/telemetry/flusher.d.ts +0 -19
- package/dist/telemetry/flusher.d.ts.map +0 -1
- package/dist/telemetry/flusher.js +0 -277
- package/dist/telemetry/flusher.js.map +0 -1
- package/dist/telemetry/generation.d.ts +0 -9
- package/dist/telemetry/generation.d.ts.map +0 -1
- package/dist/telemetry/generation.js +0 -33
- package/dist/telemetry/generation.js.map +0 -1
- package/dist/telemetry/identity.d.ts +0 -9
- package/dist/telemetry/identity.d.ts.map +0 -1
- package/dist/telemetry/identity.js +0 -35
- package/dist/telemetry/identity.js.map +0 -1
- package/dist/telemetry/install-id.d.ts +0 -13
- package/dist/telemetry/install-id.d.ts.map +0 -1
- package/dist/telemetry/install-id.js +0 -49
- package/dist/telemetry/install-id.js.map +0 -1
- package/dist/telemetry/install-meta.d.ts +0 -10
- package/dist/telemetry/install-meta.d.ts.map +0 -1
- package/dist/telemetry/install-meta.js +0 -15
- package/dist/telemetry/install-meta.js.map +0 -1
- package/dist/telemetry/queue.d.ts +0 -35
- package/dist/telemetry/queue.d.ts.map +0 -1
- package/dist/telemetry/queue.js +0 -287
- package/dist/telemetry/queue.js.map +0 -1
- package/dist/telemetry/recorder.d.ts +0 -39
- package/dist/telemetry/recorder.d.ts.map +0 -1
- package/dist/telemetry/recorder.js +0 -173
- package/dist/telemetry/recorder.js.map +0 -1
- package/scripts/postinstall.js +0 -36
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options for installing a Cursor skill.
|
|
3
|
-
*
|
|
4
|
-
* NOTE: `homeDir` is accepted for API parity with other skill writers
|
|
5
|
-
* (Claude Code, Gemini CLI, etc.) but is intentionally not used by this
|
|
6
|
-
* writer. The Cursor rules target path is always CWD-relative under
|
|
7
|
-
* `<cwd>/.cursor/rules/`, not homeDir-relative. This is intentional to
|
|
8
|
-
* keep Cursor rules scoped to the project directory.
|
|
9
|
-
*/
|
|
10
|
-
export interface CursorInstallOpts {
|
|
11
|
-
/**
|
|
12
|
-
* Raw skill content. May contain `@include _shared/<file>.md` directives
|
|
13
|
-
* which are inlined before writing.
|
|
14
|
-
*/
|
|
15
|
-
content: string;
|
|
16
|
-
/**
|
|
17
|
-
* Working directory — replaces `process.cwd()`.
|
|
18
|
-
* Used to construct the CWD-relative target path:
|
|
19
|
-
* `<cwd>/.cursor/rules/multi-model-agent.mdc`
|
|
20
|
-
*/
|
|
21
|
-
cwd: string;
|
|
22
|
-
/**
|
|
23
|
-
* Home directory. Accepted for API signature compatibility with other
|
|
24
|
-
* skill writers, but NOT used by this writer. Cursor rules are always
|
|
25
|
-
* written relative to `cwd`, not `homeDir`.
|
|
26
|
-
*/
|
|
27
|
-
homeDir: string;
|
|
28
|
-
/**
|
|
29
|
-
* Where shared files live. The writer reads `<skillsRoot>/_shared/<path>`
|
|
30
|
-
* when inlining `@include` directives.
|
|
31
|
-
*/
|
|
32
|
-
skillsRoot: string;
|
|
33
|
-
/**
|
|
34
|
-
* If true, overwrite the existing file. If false (default), skip writing
|
|
35
|
-
* when the file already exists.
|
|
36
|
-
*/
|
|
37
|
-
force?: boolean;
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Result of `installCursor`.
|
|
41
|
-
*/
|
|
42
|
-
export interface CursorInstallResult {
|
|
43
|
-
/**
|
|
44
|
-
* `true` if the file was written, `false` if it was skipped because it
|
|
45
|
-
* already exists and `force` was not set.
|
|
46
|
-
*/
|
|
47
|
-
written: boolean;
|
|
48
|
-
/** The full path that was (or would have been) written. */
|
|
49
|
-
targetPath: string;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Install the multi-model-agent skill for Cursor.
|
|
53
|
-
*
|
|
54
|
-
* - Target path is `<cwd>/.cursor/rules/multi-model-agent.mdc` (CWD-relative).
|
|
55
|
-
* - Creates `<cwd>/.cursor/rules/` if it does not exist.
|
|
56
|
-
* - Inlines `@include` directives before writing (see `inlineIncludes`).
|
|
57
|
-
* - If the file already exists and `force` is not set, skips writing and
|
|
58
|
-
* returns `written: false`.
|
|
59
|
-
*
|
|
60
|
-
* @param opts Installation options (see `CursorInstallOpts`).
|
|
61
|
-
*/
|
|
62
|
-
export declare function installCursor(opts: CursorInstallOpts): CursorInstallResult;
|
|
63
|
-
/**
|
|
64
|
-
* Uninstall the multi-model-agent Cursor skill.
|
|
65
|
-
*
|
|
66
|
-
* Removes `<cwd>/.cursor/rules/multi-model-agent.mdc`.
|
|
67
|
-
* This is a no-op when the file does not exist (no error is thrown).
|
|
68
|
-
*
|
|
69
|
-
* @param cwd Working directory (replaces `process.cwd()`).
|
|
70
|
-
*/
|
|
71
|
-
export declare function uninstallCursor(cwd: string): void;
|
|
72
|
-
//# sourceMappingURL=cursor.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.d.ts","sourceRoot":"","sources":["../../../src/skill-install/skill-installers/cursor.ts"],"names":[],"mappings":"AA8BA;;;;;;;;GAQG;AACH,MAAM,WAAW,iBAAiB;IAChC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;OAGG;IACH,OAAO,EAAE,OAAO,CAAC;IACjB,2DAA2D;IAC3D,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,iBAAiB,GAAG,mBAAmB,CAmB1E;AAED;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAmBjD"}
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Cursor skill writer.
|
|
3
|
-
*
|
|
4
|
-
* Writes the skill content to `<cwd>/.cursor/rules/multi-model-agent.mdc`.
|
|
5
|
-
*
|
|
6
|
-
* Before writing, inlines any `@include _shared/<file>.md` directives found in
|
|
7
|
-
* the content. The directive line is replaced with the full content of
|
|
8
|
-
* the corresponding shared file sourced from `<skillsRoot>/_shared/<path>`.
|
|
9
|
-
* The `@include` directive is NOT preserved in the written file.
|
|
10
|
-
*
|
|
11
|
-
* If a referenced shared file is missing (ENOENT):
|
|
12
|
-
* - A warning is logged to stderr.
|
|
13
|
-
* - The include line is removed from the output (not preserved).
|
|
14
|
-
* - Processing continues for remaining directives.
|
|
15
|
-
*
|
|
16
|
-
* Security constraints on `@include` directives:
|
|
17
|
-
* - Only paths beginning with `_shared/` are accepted.
|
|
18
|
-
* - The resolved path must stay within `<skillsRoot>/_shared/`.
|
|
19
|
-
* Path traversal attempts (e.g. `_shared/../secrets.txt`) are rejected
|
|
20
|
-
* with a warning and the directive line is dropped.
|
|
21
|
-
* - Non-`_shared/` paths are rejected with a warning and the directive
|
|
22
|
-
* line is dropped.
|
|
23
|
-
*
|
|
24
|
-
* @module
|
|
25
|
-
*/
|
|
26
|
-
import fs from 'node:fs';
|
|
27
|
-
import path from 'node:path';
|
|
28
|
-
import { inlineIncludes } from '../include-utils.js';
|
|
29
|
-
/**
|
|
30
|
-
* Install the multi-model-agent skill for Cursor.
|
|
31
|
-
*
|
|
32
|
-
* - Target path is `<cwd>/.cursor/rules/multi-model-agent.mdc` (CWD-relative).
|
|
33
|
-
* - Creates `<cwd>/.cursor/rules/` if it does not exist.
|
|
34
|
-
* - Inlines `@include` directives before writing (see `inlineIncludes`).
|
|
35
|
-
* - If the file already exists and `force` is not set, skips writing and
|
|
36
|
-
* returns `written: false`.
|
|
37
|
-
*
|
|
38
|
-
* @param opts Installation options (see `CursorInstallOpts`).
|
|
39
|
-
*/
|
|
40
|
-
export function installCursor(opts) {
|
|
41
|
-
const { content, cwd, skillsRoot, force } = opts;
|
|
42
|
-
const targetPath = path.join(cwd, '.cursor', 'rules', 'multi-model-agent.mdc');
|
|
43
|
-
if (!force && fs.existsSync(targetPath)) {
|
|
44
|
-
process.stderr.write(`Warning: Cursor skill writer: file already exists: ${targetPath} — skipping (use force: true to overwrite)\n`);
|
|
45
|
-
return { written: false, targetPath };
|
|
46
|
-
}
|
|
47
|
-
const rulesDir = path.join(cwd, '.cursor', 'rules');
|
|
48
|
-
fs.mkdirSync(rulesDir, { recursive: true, mode: 0o700 });
|
|
49
|
-
const finalContent = inlineIncludes('Cursor skill writer', content, skillsRoot);
|
|
50
|
-
fs.writeFileSync(targetPath, finalContent, 'utf-8');
|
|
51
|
-
return { written: true, targetPath };
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* Uninstall the multi-model-agent Cursor skill.
|
|
55
|
-
*
|
|
56
|
-
* Removes `<cwd>/.cursor/rules/multi-model-agent.mdc`.
|
|
57
|
-
* This is a no-op when the file does not exist (no error is thrown).
|
|
58
|
-
*
|
|
59
|
-
* @param cwd Working directory (replaces `process.cwd()`).
|
|
60
|
-
*/
|
|
61
|
-
export function uninstallCursor(cwd) {
|
|
62
|
-
const targetPath = path.join(cwd, '.cursor', 'rules', 'multi-model-agent.mdc');
|
|
63
|
-
// Only remove the file if it exists and is a file (not a directory).
|
|
64
|
-
// This is a no-op when the path does not exist.
|
|
65
|
-
try {
|
|
66
|
-
const stat = fs.statSync(targetPath);
|
|
67
|
-
if (stat.isFile()) {
|
|
68
|
-
fs.unlinkSync(targetPath);
|
|
69
|
-
}
|
|
70
|
-
// If it's a directory or symlink to directory, do nothing — the brief
|
|
71
|
-
// specifies removing a file, not a directory tree.
|
|
72
|
-
}
|
|
73
|
-
catch (err) {
|
|
74
|
-
const nodeErr = err;
|
|
75
|
-
// ENOENT means the file doesn't exist — that's fine, we were asked to remove it
|
|
76
|
-
if (nodeErr.code !== 'ENOENT') {
|
|
77
|
-
throw err;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
//# sourceMappingURL=cursor.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"cursor.js","sourceRoot":"","sources":["../../../src/skill-install/skill-installers/cursor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAsDrD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,aAAa,CAAC,IAAuB;IACnD,MAAM,EAAE,OAAO,EAAE,GAAG,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC;IAEjD,MA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,CAAC;QAC7C,gFAAgF;QAChF,IAAI,OAAO,CAAC,IAAI,KAAK,QAAQ,EAAE,CAAC;YAC9B,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Options for installing a skill via the Gemini CLI writer.
|
|
3
|
-
*/
|
|
4
|
-
export interface GeminiCliInstallOpts {
|
|
5
|
-
/** Skill name (currently informational; writes always go to multi-model-agent extension). */
|
|
6
|
-
skillName: string;
|
|
7
|
-
/**
|
|
8
|
-
* Raw SKILL.md content. May contain `@include _shared/<file>.md` directives
|
|
9
|
-
* which are inlined before writing.
|
|
10
|
-
*/
|
|
11
|
-
content: string;
|
|
12
|
-
/**
|
|
13
|
-
* Version string for the extension manifest's `version` field.
|
|
14
|
-
*/
|
|
15
|
-
skillVersion: string;
|
|
16
|
-
/**
|
|
17
|
-
* The "home directory" that replaces `os.homedir()`.
|
|
18
|
-
* Must NOT default to `os.homedir()` — always required explicitly.
|
|
19
|
-
*/
|
|
20
|
-
homeDir: string;
|
|
21
|
-
/**
|
|
22
|
-
* Where shared files live. The writer reads `<skillsRoot>/_shared/<file>.md`
|
|
23
|
-
* when inlining `@include` directives.
|
|
24
|
-
*/
|
|
25
|
-
skillsRoot: string;
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Install a skill to the Gemini CLI extensions directory.
|
|
29
|
-
*
|
|
30
|
-
* Writes two files into `<homeDir>/.gemini/extensions/multi-model-agent/`:
|
|
31
|
-
* 1. `gemini-extension.json` — the extension manifest
|
|
32
|
-
* 2. `SKILL.md` — the skill content with @include directives inlined
|
|
33
|
-
*
|
|
34
|
-
* The directory (and any parent directories) are created with mode `0o700`.
|
|
35
|
-
* Calling this function multiple times overwrites the previous installation
|
|
36
|
-
* (idempotent).
|
|
37
|
-
*
|
|
38
|
-
* @param opts Installation options (see `GeminiCliInstallOpts`).
|
|
39
|
-
*/
|
|
40
|
-
export declare function installGeminiCli(opts: GeminiCliInstallOpts): void;
|
|
41
|
-
/**
|
|
42
|
-
* Uninstall the multi-model-agent Gemini CLI extension.
|
|
43
|
-
*
|
|
44
|
-
* Recursively removes `<homeDir>/.gemini/extensions/multi-model-agent/`.
|
|
45
|
-
* This is a no-op when the directory does not exist (no error is thrown).
|
|
46
|
-
*
|
|
47
|
-
* @param homeDir The "home directory" that replaces `os.homedir()`.
|
|
48
|
-
*/
|
|
49
|
-
export declare function uninstallGeminiCli(homeDir: string): void;
|
|
50
|
-
//# sourceMappingURL=gemini-cli.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-cli.d.ts","sourceRoot":"","sources":["../../../src/skill-install/skill-installers/gemini-cli.ts"],"names":[],"mappings":"AAwBA;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,6FAA6F;IAC7F,SAAS,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,oBAAoB,GAAG,IAAI,CAuBjE;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAKxD"}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Gemini CLI skill writer.
|
|
3
|
-
*
|
|
4
|
-
* Writes to `<homeDir>/.gemini/extensions/multi-model-agent/`:
|
|
5
|
-
* - `gemini-extension.json` — extension manifest
|
|
6
|
-
* - `SKILL.md` — skill content (with @include directives inlined)
|
|
7
|
-
*
|
|
8
|
-
* The extension is always named `multi-model-agent` regardless of `skillName`
|
|
9
|
-
* (the extension loads whichever skill files are provided). This is a
|
|
10
|
-
* judgment call because the Gemini CLI extension format is not fully
|
|
11
|
-
* standardized; a minimal JSON schema is used.
|
|
12
|
-
*
|
|
13
|
-
* Before writing SKILL.md, any `@include _shared/<file>.md` directive lines
|
|
14
|
-
* are replaced via the shared `inlineIncludes` helper (the same one
|
|
15
|
-
* Claude/Codex/Cursor use). That helper enforces the `_shared/` prefix,
|
|
16
|
-
* rejects path traversal, suppresses only ENOENT (missing file → warn + drop),
|
|
17
|
-
* and re-throws other I/O errors.
|
|
18
|
-
*
|
|
19
|
-
* @module
|
|
20
|
-
*/
|
|
21
|
-
import fs from 'node:fs';
|
|
22
|
-
import path from 'node:path';
|
|
23
|
-
import { inlineIncludes } from '../include-utils.js';
|
|
24
|
-
/**
|
|
25
|
-
* Install a skill to the Gemini CLI extensions directory.
|
|
26
|
-
*
|
|
27
|
-
* Writes two files into `<homeDir>/.gemini/extensions/multi-model-agent/`:
|
|
28
|
-
* 1. `gemini-extension.json` — the extension manifest
|
|
29
|
-
* 2. `SKILL.md` — the skill content with @include directives inlined
|
|
30
|
-
*
|
|
31
|
-
* The directory (and any parent directories) are created with mode `0o700`.
|
|
32
|
-
* Calling this function multiple times overwrites the previous installation
|
|
33
|
-
* (idempotent).
|
|
34
|
-
*
|
|
35
|
-
* @param opts Installation options (see `GeminiCliInstallOpts`).
|
|
36
|
-
*/
|
|
37
|
-
export function installGeminiCli(opts) {
|
|
38
|
-
const { skillName: _skillName, content, skillVersion, homeDir, skillsRoot } = opts;
|
|
39
|
-
const extDir = path.join(homeDir, '.gemini', 'extensions', 'multi-model-agent');
|
|
40
|
-
fs.mkdirSync(extDir, { recursive: true, mode: 0o700 });
|
|
41
|
-
// Write the extension manifest.
|
|
42
|
-
// Shape is a minimal reasonable schema; Gemini CLI extension format is not
|
|
43
|
-
// fully standardized, so we document this judgment call.
|
|
44
|
-
const manifest = {
|
|
45
|
-
name: 'multi-model-agent',
|
|
46
|
-
version: skillVersion,
|
|
47
|
-
description: 'multi-model-agent skills for Gemini CLI',
|
|
48
|
-
schemaVersion: '1.0',
|
|
49
|
-
contextFiles: ['SKILL.md'],
|
|
50
|
-
};
|
|
51
|
-
const manifestPath = path.join(extDir, 'gemini-extension.json');
|
|
52
|
-
fs.writeFileSync(manifestPath, JSON.stringify(manifest, null, 2) + '\n', 'utf-8');
|
|
53
|
-
// Write the skill content with @include directives inlined.
|
|
54
|
-
const finalContent = inlineIncludes('Gemini CLI skill writer', content, skillsRoot);
|
|
55
|
-
const skillPath = path.join(extDir, 'SKILL.md');
|
|
56
|
-
fs.writeFileSync(skillPath, finalContent, 'utf-8');
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Uninstall the multi-model-agent Gemini CLI extension.
|
|
60
|
-
*
|
|
61
|
-
* Recursively removes `<homeDir>/.gemini/extensions/multi-model-agent/`.
|
|
62
|
-
* This is a no-op when the directory does not exist (no error is thrown).
|
|
63
|
-
*
|
|
64
|
-
* @param homeDir The "home directory" that replaces `os.homedir()`.
|
|
65
|
-
*/
|
|
66
|
-
export function uninstallGeminiCli(homeDir) {
|
|
67
|
-
const extDir = path.join(homeDir, '.gemini', 'extensions', 'multi-model-agent');
|
|
68
|
-
if (fs.existsSync(extDir)) {
|
|
69
|
-
fs.rmSync(extDir, { recursive: true, force: true });
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
//# sourceMappingURL=gemini-cli.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gemini-cli.js","sourceRoot":"","sources":["../../../src/skill-install/skill-installers/gemini-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA6BrD;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAA0B;IACzD,MAAM,EAAE,S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E,CAAC,MAAM,CAAC,MAAM,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;IACtD,CAAC;AACH,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Client } from './manifest.js';
|
|
2
|
-
export interface DriftEntry {
|
|
3
|
-
skill: string;
|
|
4
|
-
client: Client;
|
|
5
|
-
issue: 'missing' | 'outdated' | 'orphan';
|
|
6
|
-
}
|
|
7
|
-
export interface SkillManifestSync {
|
|
8
|
-
driftReport(): DriftEntry[];
|
|
9
|
-
}
|
|
10
|
-
export declare function makeSkillManifestSync(perClientInstallDirs: Partial<Record<Client, string>>): SkillManifestSync;
|
|
11
|
-
//# sourceMappingURL=skill-manifest-sync.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill-manifest-sync.d.ts","sourceRoot":"","sources":["../../src/skill-install/skill-manifest-sync.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAG5C,MAAM,WAAW,UAAU;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,SAAS,GAAG,UAAU,GAAG,QAAQ,CAAC;CAC1C;AAED,MAAM,WAAW,iBAAiB;IAChC,WAAW,IAAI,UAAU,EAAE,CAAC;CAC7B;AAcD,wBAAgB,qBAAqB,CAAC,oBAAoB,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,GAAG,iBAAiB,CAuC9G"}
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { readdirSync, readFileSync } from 'node:fs';
|
|
2
|
-
import { join } from 'node:path';
|
|
3
|
-
import { SUPPORTED_SKILLS, readSkillContent } from './discover.js';
|
|
4
|
-
import matter from 'gray-matter';
|
|
5
|
-
function canonicalVersion(skillName) {
|
|
6
|
-
const content = readSkillContent(skillName);
|
|
7
|
-
if (content === null)
|
|
8
|
-
return null;
|
|
9
|
-
try {
|
|
10
|
-
const parsed = matter(content);
|
|
11
|
-
const v = parsed.data['version'];
|
|
12
|
-
return typeof v === 'string' ? v : null;
|
|
13
|
-
}
|
|
14
|
-
catch {
|
|
15
|
-
return null;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
export function makeSkillManifestSync(perClientInstallDirs) {
|
|
19
|
-
return {
|
|
20
|
-
driftReport() {
|
|
21
|
-
const drift = [];
|
|
22
|
-
const supported = new Set(SUPPORTED_SKILLS);
|
|
23
|
-
for (const [client, dir] of Object.entries(perClientInstallDirs)) {
|
|
24
|
-
let entries;
|
|
25
|
-
try {
|
|
26
|
-
entries = readdirSync(dir);
|
|
27
|
-
}
|
|
28
|
-
catch {
|
|
29
|
-
continue;
|
|
30
|
-
}
|
|
31
|
-
const present = new Set(entries.filter(n => n.startsWith('mma-') || n === 'multi-model-agent'));
|
|
32
|
-
for (const exp of supported) {
|
|
33
|
-
if (!present.has(exp))
|
|
34
|
-
drift.push({ skill: exp, client: client, issue: 'missing' });
|
|
35
|
-
}
|
|
36
|
-
for (const got of present) {
|
|
37
|
-
if (!supported.has(got)) {
|
|
38
|
-
drift.push({ skill: got, client: client, issue: 'orphan' });
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
for (const skill of present) {
|
|
42
|
-
if (!supported.has(skill))
|
|
43
|
-
continue;
|
|
44
|
-
const canonVer = canonicalVersion(skill);
|
|
45
|
-
if (canonVer === null)
|
|
46
|
-
continue;
|
|
47
|
-
const installedPath = join(dir, skill, 'SKILL.md');
|
|
48
|
-
try {
|
|
49
|
-
const installedContent = readFileSync(installedPath, 'utf-8');
|
|
50
|
-
const parsed = matter(installedContent);
|
|
51
|
-
const installedVer = parsed.data['version'];
|
|
52
|
-
if (typeof installedVer === 'string' && installedVer !== canonVer) {
|
|
53
|
-
drift.push({ skill, client: client, issue: 'outdated' });
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
catch {
|
|
57
|
-
// skip outdated check if installed SKILL.md is unreadable
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
return drift;
|
|
62
|
-
},
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
//# sourceMappingURL=skill-manifest-sync.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"skill-manifest-sync.js","sourceRoot":"","sources":["../../src/skill-install/skill-manifest-sync.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,MAAM,MAAM,aAAa,CAAC;AAYjC,SAAS,gBAAgB,CAAC,SAAiB;IACzC,MAAM,OAAO,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC5C,IAAI,OAAO,KAAK,IAAI;QAAE,OAAO,IAAI,CAAC;IAClC,IAAI,CAAC;QACH,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,CAAC;QAC/B,MAAM,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACjC,OAAO,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC1C,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,oBAAqD;IACzF,OAAO;QACL,WAAW;YACT,MAAM,KAAK,GAAiB,EAAE,CAAC;YAC/B,MAAM,SAAS,GAAG,IAAI,GAAG,CAAS,gBAAgB,CAAC,CAAC;YACpD,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,oBAAoB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AC,CAAC;wBAC9D,MAAM,MAAM,GAAG,MAAM,CAAC,gBAAgB,CAAC,CAAC;wBACxC,MAAM,YAAY,GAAG,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;wBAC5C,IAAI,OAAO,YAAY,KAAK,QAAQ,IAAI,YAAY,KAAK,QAAQ,EAAE,CAAC;4BAClE,KAAK,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,MAAgB,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC,CAAC;wBACrE,CAAC;oBACH,CAAC;oBAAC,MAAM,CAAC;wBACP,0DAA0D;oBAC5D,CAAC;gBACH,CAAC;YACH,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
## Authentication & identity headers
|
|
2
|
-
|
|
3
|
-
Every request to the multi-model-agent server requires:
|
|
4
|
-
|
|
5
|
-
| Header | Required for | Purpose |
|
|
6
|
-
|---|---|---|
|
|
7
|
-
| `Authorization: Bearer <token>` | All routes (except `/health`) | Auth — token from `mmagent print-token` |
|
|
8
|
-
| `X-MMA-Client: <client>` | All tool routes | Identifies your client. One of `claude-code`, `cursor`, `codex-cli`, `gemini-cli`. **Server returns `400 client_required` if missing.** |
|
|
9
|
-
| `X-MMA-Main-Model: <model-id>` | All tool routes | Calling agent's model id (e.g. `claude-opus-4-7`, `gpt-5.4`). Used as `mainModel` in wire telemetry so cost-delta-vs-main and family attribution can be computed. **Server returns `400 main_model_required` if missing.** Auto-detection is intentionally not attempted — the calling client is the only reliable source. |
|
|
10
|
-
|
|
11
|
-
### Obtain the token
|
|
12
|
-
|
|
13
|
-
**From environment variable** (preferred):
|
|
14
|
-
```
|
|
15
|
-
MMAGENT_AUTH_TOKEN=<token>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
**From CLI**:
|
|
19
|
-
```bash
|
|
20
|
-
mmagent print-token
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
### Shell helper
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
TOKEN="${MMAGENT_AUTH_TOKEN:-$(mmagent print-token)}"
|
|
27
|
-
MMA_CLIENT="${MMAGENT_CLIENT:-claude-code}"
|
|
28
|
-
MMA_MAIN_MODEL="${MMAGENT_MAIN_MODEL:-claude-opus-4-7}"
|
|
29
|
-
|
|
30
|
-
curl \
|
|
31
|
-
-H "Authorization: Bearer $TOKEN" \
|
|
32
|
-
-H "X-MMA-Client: $MMA_CLIENT" \
|
|
33
|
-
-H "X-MMA-Main-Model: $MMA_MAIN_MODEL" \
|
|
34
|
-
...
|
|
35
|
-
```
|
|
36
|
-
|
|
37
|
-
### Errors
|
|
38
|
-
|
|
39
|
-
- `401 unauthorized` — re-run `mmagent print-token`; the token may have changed after a server restart.
|
|
40
|
-
- `400 client_required` — `X-MMA-Client` header is missing on a tool route. Set it to one of: `claude-code`, `cursor`, `codex-cli`, `gemini-cli`.
|
|
41
|
-
- `400 main_model_required` — `X-MMA-Main-Model` header is missing on a tool route. Set it to the calling agent's model id (e.g. `claude-opus-4-7`, `gpt-5.4`).
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
## Error handling
|
|
2
|
-
|
|
3
|
-
### HTTP status decision table
|
|
4
|
-
|
|
5
|
-
| Status | Code | Action |
|
|
6
|
-
|---|---|---|
|
|
7
|
-
| `400` | `invalid_request` | Fix the request body or query params |
|
|
8
|
-
| `401` | `unauthorized` | Re-fetch token; check `MMAGENT_AUTH_TOKEN` |
|
|
9
|
-
| `403` | `forbidden` | `cwd` query param missing or out of scope |
|
|
10
|
-
| `404` | `not_found` | Wrong `batchId` or resource does not exist |
|
|
11
|
-
| `409` | `invalid_batch_state` / `pinned` | Batch in wrong state; check current state first |
|
|
12
|
-
| `413` | `payload_too_large` | Reduce content size (context block or body) |
|
|
13
|
-
| `429` | `rate_limited` | Wait `Retry-After` seconds, then retry |
|
|
14
|
-
| `503` | `project_cap_exceeded` | Too many concurrent projects; wait and retry |
|
|
15
|
-
| `5xx` | server error | Retry once after 2 s; escalate if it persists |
|
|
16
|
-
|
|
17
|
-
### Network failures
|
|
18
|
-
|
|
19
|
-
Retry up to 3 times with exponential backoff (1 s → 2 s → 4 s).
|
|
20
|
-
If the server is unreachable, check that `mmagent serve` is running:
|
|
21
|
-
```bash
|
|
22
|
-
curl -s http://localhost:$PORT/health # expects { "status": "ok" } (v4.0 — see spec C13)
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
### Auth errors (401)
|
|
26
|
-
|
|
27
|
-
```bash
|
|
28
|
-
export MMAGENT_AUTH_TOKEN=$(mmagent print-token)
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
The token changes on every server restart. Re-export before retrying.
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
## Polling for batch completion
|
|
2
|
-
|
|
3
|
-
After a tool call returns a `batchId`, poll `GET /batch/:id` until the batch
|
|
4
|
-
reaches a terminal state.
|
|
5
|
-
|
|
6
|
-
### HTTP response shapes (3.1.0)
|
|
7
|
-
|
|
8
|
-
| Status | Content-Type | Meaning |
|
|
9
|
-
|---|---|---|
|
|
10
|
-
| `202` | `text/plain` | Still working — body is the running headline (e.g. `1/1 running, 47s elapsed`) |
|
|
11
|
-
| `200` | `application/json` | Terminal — body is the uniform 6-field envelope (see `response-shape.md`) |
|
|
12
|
-
| `404` / `401` / other | — | Error — stop polling |
|
|
13
|
-
|
|
14
|
-
### Terminal envelope states
|
|
15
|
-
|
|
16
|
-
Every terminal envelope has the same six fields; inspect `error` to tell
|
|
17
|
-
which terminal state you're in:
|
|
18
|
-
|
|
19
|
-
| Shape | Meaning |
|
|
20
|
-
|---|---|
|
|
21
|
-
| `error` is a real object | Batch failed — read `error.code` + `error.message` |
|
|
22
|
-
| `error` is `{kind: "not_applicable", ...}` | Batch succeeded — read `results` |
|
|
23
|
-
|
|
24
|
-
### Poll loop (POSIX sh)
|
|
25
|
-
|
|
26
|
-
```bash
|
|
27
|
-
DELAY=1
|
|
28
|
-
START=$(date +%s)
|
|
29
|
-
TIMEOUT_S=${MMAGENT_POLL_TIMEOUT_S:-1800}
|
|
30
|
-
BODY_FILE=$(mktemp -t mmagent-poll.XXXXXX)
|
|
31
|
-
trap 'rm -f "$BODY_FILE"' EXIT
|
|
32
|
-
|
|
33
|
-
while true; do
|
|
34
|
-
NOW=$(date +%s)
|
|
35
|
-
if [ $((NOW - START)) -ge "$TIMEOUT_S" ]; then
|
|
36
|
-
echo "mmagent: poll timed out after ${TIMEOUT_S}s" >&2
|
|
37
|
-
exit 124
|
|
38
|
-
fi
|
|
39
|
-
|
|
40
|
-
STATUS=$(curl -f --show-error -o "$BODY_FILE" -w "%{http_code}" -s \
|
|
41
|
-
-H "Authorization: Bearer $TOKEN" \
|
|
42
|
-
"http://127.0.0.1:$PORT/batch/$BATCH_ID" || true)
|
|
43
|
-
|
|
44
|
-
case "$STATUS" in
|
|
45
|
-
202)
|
|
46
|
-
cat "$BODY_FILE"; echo
|
|
47
|
-
sleep "$DELAY"
|
|
48
|
-
DELAY=$(( DELAY < 30 ? DELAY * 2 : 30 ))
|
|
49
|
-
;;
|
|
50
|
-
200)
|
|
51
|
-
cat "$BODY_FILE"
|
|
52
|
-
exit 0
|
|
53
|
-
;;
|
|
54
|
-
"")
|
|
55
|
-
echo "mmagent: unreachable (curl failed)" >&2; exit 1 ;;
|
|
56
|
-
*)
|
|
57
|
-
echo "mmagent: HTTP $STATUS"; cat "$BODY_FILE" >&2; exit 1 ;;
|
|
58
|
-
esac
|
|
59
|
-
done
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
Start at 1 s, double each iteration, cap at 30 s. The 1800-second client-side
|
|
63
|
-
timeout is a safety cap; most batches complete in under 60 s. Discover `$PORT`
|
|
64
|
-
at runtime with `mmagent info --json | jq -r .port` (default: 7337).
|
|
65
|
-
|
|
66
|
-
### Caller-side tool-timeout note
|
|
67
|
-
|
|
68
|
-
The poll helper's internal `TIMEOUT_S` default is 1800s (30 minutes). If your
|
|
69
|
-
agent's shell tool (e.g. Claude Code's Bash) caps command wall-clock at
|
|
70
|
-
10 minutes by default, the helper will be killed at 10m regardless of
|
|
71
|
-
`TIMEOUT_S` — long-running delegations then appear to "fail" before terminal.
|
|
72
|
-
|
|
73
|
-
When invoking this poll loop, pick one:
|
|
74
|
-
|
|
75
|
-
- **Preferred — pass a 30-minute tool timeout explicitly** (e.g. Claude Code
|
|
76
|
-
Bash accepts `timeout: 1800000`, up to 600000ms/10 min by default; pass the
|
|
77
|
-
max the tool allows, or bump the tool's allowed ceiling via harness
|
|
78
|
-
settings).
|
|
79
|
-
- **Alternative — cap the helper to match the tool's limit** by exporting
|
|
80
|
-
`MMAGENT_POLL_TIMEOUT_S=600` before running the loop. The helper will then
|
|
81
|
-
exit 124 cleanly at 10 minutes and the caller can decide whether to
|
|
82
|
-
re-poll or surface the timeout.
|
|
83
|
-
|
|
84
|
-
Never let the helper run longer than the caller's tool cap — the process
|
|
85
|
-
gets killed mid-poll, the caller sees a generic failure, and diagnostics
|
|
86
|
-
from the `TIMEOUT_S` exit path are lost.
|
|
87
|
-
|
|
88
|
-
Windows/PowerShell equivalent is planned for a later release.
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
## Response shapes
|
|
2
|
-
|
|
3
|
-
### POST /<tool>?cwd=<abs> — dispatch response (202)
|
|
4
|
-
|
|
5
|
-
```json
|
|
6
|
-
{ "batchId": "<uuid>", "statusUrl": "/batch/<uuid>" }
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
Use `batchId` to poll. `statusUrl` is a convenience pointer.
|
|
10
|
-
|
|
11
|
-
### GET /batch/:id — polling response
|
|
12
|
-
|
|
13
|
-
The HTTP status is the state discriminator:
|
|
14
|
-
|
|
15
|
-
| Status | Meaning |
|
|
16
|
-
|---|---|
|
|
17
|
-
| `202 text/plain` | Still pending — body is the running headline string (e.g. `"1/2 running, 47s elapsed"`) |
|
|
18
|
-
| `200 application/json` | Terminal — body is the uniform 7-field envelope below |
|
|
19
|
-
| `404` / `401` / `5xx` | Error — see Error response below; stop polling |
|
|
20
|
-
|
|
21
|
-
The terminal JSON envelope always has these 6 fields. Each may be a real value or a `not_applicable` sentinel:
|
|
22
|
-
|
|
23
|
-
```json
|
|
24
|
-
{
|
|
25
|
-
"headline": "<string>",
|
|
26
|
-
"results": [ /* per-task result objects */ ],
|
|
27
|
-
"batchTimings": { /* timings */ },
|
|
28
|
-
"costSummary": { /* cost roll-up */ },
|
|
29
|
-
"structuredReport": { /* parsed sections */ },
|
|
30
|
-
"error": { "kind": "not_applicable", "reason": "batch succeeded" }
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
Read the envelope by the shape of `error`:
|
|
35
|
-
|
|
36
|
-
| Shape | Meaning |
|
|
37
|
-
|---|---|
|
|
38
|
-
| `error` is a real object (with `code` / `message`) | Batch failed — read `error.code` + `error.message` |
|
|
39
|
-
| `error` is `{kind: "not_applicable", ...}` | Batch succeeded — read `results` |
|
|
40
|
-
|
|
41
|
-
### GET /batch/:id?taskIndex=N — single task slice
|
|
42
|
-
|
|
43
|
-
Same 6-field envelope. `results` contains exactly the task at index `N`. Returns `404 unknown_task_index` if `N` is out of range.
|
|
44
|
-
|
|
45
|
-
### Error response (4xx / 5xx)
|
|
46
|
-
|
|
47
|
-
```json
|
|
48
|
-
{
|
|
49
|
-
"error": "<code>",
|
|
50
|
-
"message": "<human-readable>",
|
|
51
|
-
"details": { /* optional structured context, e.g. fieldErrors for 400 */ }
|
|
52
|
-
}
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-
`details` is optional and present only when the server has structured additional context.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
### `reviewPolicy` — review lifecycle per task
|
|
2
|
-
|
|
3
|
-
**Applies to write routes only** (`delegate`, `execute-plan`, `retry`).
|
|
4
|
-
Read-only routes (audit, review, debug, investigate, research) do not expose
|
|
5
|
-
this field — they are hardcoded to `"none"` because the review stage is
|
|
6
|
-
write-routes-only. They still run the always-on **annotate** judge (a
|
|
7
|
-
standard-tier LLM pass that summarizes the worker's report); their findings
|
|
8
|
-
come from the worker itself, not from a second-pass code review.
|
|
9
|
-
|
|
10
|
-
| Value | Behavior | Use when |
|
|
11
|
-
|---|---|---|
|
|
12
|
-
| `"full"` | Spec review + quality review (default) | Default for new code or risky edits |
|
|
13
|
-
| `"quality_only"` | Quality review only | Write task where spec-conformance is already certain but you still want a quality pass |
|
|
14
|
-
| `"diff_only"` | Single-pass review of the produced diff | Cheap mechanical refactors (file moves, renames, import-path updates) |
|
|
15
|
-
| `"none"` | Skip the review stage | Trivially mechanical edits or throwaway scripts where a second-pass reviewer adds nothing |
|