agent-composer 0.1.10 → 0.1.11
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/composer.config.schema.json +53 -14
- package/dist/config/schema.d.ts +20 -0
- package/dist/config/schema.js +2 -1
- package/dist/config/schema.js.map +1 -1
- package/dist/registry.js +5 -1
- package/dist/registry.js.map +1 -1
- package/dist/server.d.ts +14 -0
- package/dist/server.js +96 -0
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
- package/plugin/composer-mastermind/agents/reviewer.md +7 -2
- package/plugin/composer-mastermind/plugin.json +1 -1
- package/plugin/composer-mastermind/skills/composer-mastermind/SKILL.md +19 -4
|
@@ -4,31 +4,54 @@
|
|
|
4
4
|
"title": "Composer Configuration",
|
|
5
5
|
"description": "Dependency Inversion at runtime: maps subagent role → provider impl. C0.2 — frozen Wave 0, append-only during Wave 1.",
|
|
6
6
|
"type": "object",
|
|
7
|
-
"required": [
|
|
7
|
+
"required": [
|
|
8
|
+
"roles"
|
|
9
|
+
],
|
|
8
10
|
"additionalProperties": false,
|
|
9
11
|
"properties": {
|
|
10
12
|
"roles": {
|
|
11
13
|
"type": "object",
|
|
12
|
-
"required": [
|
|
14
|
+
"required": [
|
|
15
|
+
"researcher",
|
|
16
|
+
"coder",
|
|
17
|
+
"reviewer"
|
|
18
|
+
],
|
|
13
19
|
"additionalProperties": false,
|
|
14
20
|
"properties": {
|
|
15
|
-
"researcher": {
|
|
16
|
-
|
|
17
|
-
|
|
21
|
+
"researcher": {
|
|
22
|
+
"$ref": "#/$defs/roleConfig"
|
|
23
|
+
},
|
|
24
|
+
"coder": {
|
|
25
|
+
"$ref": "#/$defs/roleConfig"
|
|
26
|
+
},
|
|
27
|
+
"reviewer": {
|
|
28
|
+
"$ref": "#/$defs/roleConfig"
|
|
29
|
+
},
|
|
30
|
+
"coderCli": {
|
|
31
|
+
"$ref": "#/$defs/roleConfig"
|
|
32
|
+
}
|
|
18
33
|
}
|
|
19
34
|
},
|
|
20
|
-
"spendAuthorization": {
|
|
35
|
+
"spendAuthorization": {
|
|
36
|
+
"$ref": "#/$defs/spendAuthorization"
|
|
37
|
+
}
|
|
21
38
|
},
|
|
22
39
|
"$defs": {
|
|
23
40
|
"spendAuthorization": {
|
|
24
41
|
"type": "object",
|
|
25
|
-
"required": [
|
|
42
|
+
"required": [
|
|
43
|
+
"mode"
|
|
44
|
+
],
|
|
26
45
|
"additionalProperties": false,
|
|
27
46
|
"description": "Orchestrator behaviour when a real-money provider call is about to be made. Added 2026-05-24 after the first dogfood audit revealed the soft 'always ask' rule was inconsistent across sessions. Optional — omit for the default 'interactive' behaviour.",
|
|
28
47
|
"properties": {
|
|
29
48
|
"mode": {
|
|
30
49
|
"type": "string",
|
|
31
|
-
"enum": [
|
|
50
|
+
"enum": [
|
|
51
|
+
"interactive",
|
|
52
|
+
"auto",
|
|
53
|
+
"deny"
|
|
54
|
+
],
|
|
32
55
|
"description": "interactive: ask the user 'go' before any priced call (legacy default). auto: proceed without asking, respect the maxUsd caps. deny: refuse all real-money calls; force tape replay / mock providers."
|
|
33
56
|
},
|
|
34
57
|
"maxUsdPerSession": {
|
|
@@ -45,15 +68,24 @@
|
|
|
45
68
|
},
|
|
46
69
|
"providerId": {
|
|
47
70
|
"type": "string",
|
|
48
|
-
"enum": [
|
|
71
|
+
"enum": [
|
|
72
|
+
"anthropic",
|
|
73
|
+
"openai_compatible",
|
|
74
|
+
"cli",
|
|
75
|
+
"mock"
|
|
76
|
+
],
|
|
49
77
|
"description": "Discriminator picked up by ProviderFactory. Must match IProvider.id."
|
|
50
78
|
},
|
|
51
79
|
"roleConfig": {
|
|
52
80
|
"type": "object",
|
|
53
|
-
"required": [
|
|
81
|
+
"required": [
|
|
82
|
+
"provider"
|
|
83
|
+
],
|
|
54
84
|
"additionalProperties": false,
|
|
55
85
|
"properties": {
|
|
56
|
-
"provider": {
|
|
86
|
+
"provider": {
|
|
87
|
+
"$ref": "#/$defs/providerId"
|
|
88
|
+
},
|
|
57
89
|
"apiKeyEnv": {
|
|
58
90
|
"type": "string",
|
|
59
91
|
"description": "Name of the env var holding the API key. Resolved by ProviderFactory at startup; the key value itself is NEVER stored in this file."
|
|
@@ -69,7 +101,9 @@
|
|
|
69
101
|
},
|
|
70
102
|
"cli": {
|
|
71
103
|
"type": "array",
|
|
72
|
-
"items": {
|
|
104
|
+
"items": {
|
|
105
|
+
"type": "string"
|
|
106
|
+
},
|
|
73
107
|
"minItems": 1,
|
|
74
108
|
"description": "argv array for CLIProvider, e.g. [\"agy\",\"--dangerously-skip-permissions\",\"-p\"]. Passed to child_process.execFile — NEVER shell-interpolated."
|
|
75
109
|
},
|
|
@@ -81,12 +115,17 @@
|
|
|
81
115
|
"thinking": {
|
|
82
116
|
"type": "object",
|
|
83
117
|
"additionalProperties": false,
|
|
84
|
-
"required": [
|
|
118
|
+
"required": [
|
|
119
|
+
"type"
|
|
120
|
+
],
|
|
85
121
|
"description": "Extended-thinking knob for Anthropic-compat providers (GLM glm-5.1, glm-4.6+, Claude). Ignored by other providers. Added 2026-05-25 for v0.1.3.",
|
|
86
122
|
"properties": {
|
|
87
123
|
"type": {
|
|
88
124
|
"type": "string",
|
|
89
|
-
"enum": [
|
|
125
|
+
"enum": [
|
|
126
|
+
"enabled",
|
|
127
|
+
"disabled"
|
|
128
|
+
],
|
|
90
129
|
"description": "enabled: include the `thinking` block on every call. disabled: explicitly opt out."
|
|
91
130
|
},
|
|
92
131
|
"budgetTokens": {
|
package/dist/config/schema.d.ts
CHANGED
|
@@ -37,6 +37,7 @@ export declare const RoleNameSchema: z.ZodEnum<{
|
|
|
37
37
|
researcher: "researcher";
|
|
38
38
|
coder: "coder";
|
|
39
39
|
reviewer: "reviewer";
|
|
40
|
+
coderCli: "coderCli";
|
|
40
41
|
}>;
|
|
41
42
|
export type RoleName = z.infer<typeof RoleNameSchema>;
|
|
42
43
|
export declare const SpendAuthorizationModeSchema: z.ZodEnum<{
|
|
@@ -114,6 +115,25 @@ export declare const ComposerConfigSchema: z.ZodObject<{
|
|
|
114
115
|
type: z.ZodLiteral<"disabled">;
|
|
115
116
|
}, z.core.$strict>], "type">>;
|
|
116
117
|
}, z.core.$strict>;
|
|
118
|
+
coderCli: z.ZodOptional<z.ZodObject<{
|
|
119
|
+
provider: z.ZodEnum<{
|
|
120
|
+
anthropic: "anthropic";
|
|
121
|
+
openai_compatible: "openai_compatible";
|
|
122
|
+
cli: "cli";
|
|
123
|
+
mock: "mock";
|
|
124
|
+
}>;
|
|
125
|
+
apiKeyEnv: z.ZodOptional<z.ZodString>;
|
|
126
|
+
baseUrl: z.ZodOptional<z.ZodURL>;
|
|
127
|
+
model: z.ZodOptional<z.ZodString>;
|
|
128
|
+
cli: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
129
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
130
|
+
thinking: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
131
|
+
type: z.ZodLiteral<"enabled">;
|
|
132
|
+
budgetTokens: z.ZodNumber;
|
|
133
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
134
|
+
type: z.ZodLiteral<"disabled">;
|
|
135
|
+
}, z.core.$strict>], "type">>;
|
|
136
|
+
}, z.core.$strict>>;
|
|
117
137
|
}, z.core.$strict>;
|
|
118
138
|
spendAuthorization: z.ZodOptional<z.ZodObject<{
|
|
119
139
|
mode: z.ZodEnum<{
|
package/dist/config/schema.js
CHANGED
|
@@ -31,7 +31,7 @@ export const RoleConfigSchema = z
|
|
|
31
31
|
thinking: ThinkingConfigSchema.optional(),
|
|
32
32
|
})
|
|
33
33
|
.strict();
|
|
34
|
-
export const RoleNameSchema = z.enum(["researcher", "coder", "reviewer"]);
|
|
34
|
+
export const RoleNameSchema = z.enum(["researcher", "coder", "reviewer", "coderCli"]);
|
|
35
35
|
export const SpendAuthorizationModeSchema = z.enum([
|
|
36
36
|
"interactive",
|
|
37
37
|
"auto",
|
|
@@ -51,6 +51,7 @@ export const ComposerConfigSchema = z
|
|
|
51
51
|
researcher: RoleConfigSchema,
|
|
52
52
|
coder: RoleConfigSchema,
|
|
53
53
|
reviewer: RoleConfigSchema,
|
|
54
|
+
coderCli: RoleConfigSchema.optional(),
|
|
54
55
|
})
|
|
55
56
|
.strict(),
|
|
56
57
|
spendAuthorization: SpendAuthorizationSchema.optional(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.js","sourceRoot":"","sources":["../../src/config/schema.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,0EAA0E;AAE1E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,CAAC,IAAI,CAAC;IACrC,WAAW;IACX,mBAAmB;IACnB,KAAK;IACL,MAAM;CACP,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC,kBAAkB,CAAC,MAAM,EAAE;IAC/D,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;QAC1B,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC;KACzC,CAAC;SACD,MAAM,EAAE;IACX,CAAC;SACE,MAAM,CAAC;QACN,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;KAC5B,CAAC;SACD,MAAM,EAAE;CACZ,CAAC,CAAC;AAGH,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC;KAC9B,MAAM,CAAC;IACN,QAAQ,EAAE,gBAAgB;IAC1B,SAAS,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE;IACvC,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC3B,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,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C;IACN,KAAK,EAAE,CAAC;SACL,MAAM,CAAC;QACN,UAAU,EAAE,gBAAgB;QAC5B,KAAK,EAAE,gBAAgB;QACvB,QAAQ,EAAE,gBAAgB;QAC1B,QAAQ,EAAE,gBAAgB,CAAC,QAAQ,EAAE;KACtC,CAAC;SACD,MAAM,EAAE;IACX,kBAAkB,EAAE,wBAAwB,CAAC,QAAQ,EAAE;CACxD,CAAC;KACD,MAAM,EAAE,CAAC"}
|
package/dist/registry.js
CHANGED
|
@@ -34,7 +34,11 @@ export class ProviderRegistry {
|
|
|
34
34
|
const cached = this.cache.get(role);
|
|
35
35
|
if (cached)
|
|
36
36
|
return cached;
|
|
37
|
-
const
|
|
37
|
+
const rc = this.config.roles[role];
|
|
38
|
+
if (!rc) {
|
|
39
|
+
throw new ProviderConfigError(role, "role not configured in composer.config.json roles");
|
|
40
|
+
}
|
|
41
|
+
const created = this.buildProvider(rc);
|
|
38
42
|
this.cache.set(role, created);
|
|
39
43
|
return created;
|
|
40
44
|
}
|
package/dist/registry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,EAAE;AACF,sEAAsE;AACtE,kEAAkE;AAClE,0BAA0B;AAG1B,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,2BAA2B,EAAE,MAAM,4CAA4C,CAAC;AACzF,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AAOzD;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,SAAS,CAAC;AAEjD,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD,YAAY,UAAkB;QAC5B,KAAK,CACH,aAAa,UAAU,oHAAoH,CAC5I,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,6BAA6B,CAAC;IAC5C,CAAC;CACF;AAED,MAAM,OAAO,mBAAoB,S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AkC,CAClE,CAAC;gBACJ,CAAC;gBACD,iEAAiE;gBACjE,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;gBAChD,MAAM,KAAK,GACT,CAAC,OAAO,QAAQ,KAAK,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC;oBAC5E,UAAU,CAAC,KAAK;oBAChB,uBAAuB,CAAC;gBAC1B,OAAO,IAAI,2BAA2B,CAAC;oBACrC,OAAO,EAAE,UAAU,CAAC,OAAO;oBAC3B,MAAM;oBACN,KAAK;oBACL,gBAAgB,EAAE,UAAU,CAAC,SAAS;oBACtC,QAAQ,EAAE,UAAU,CAAC,QAAQ;iBAC9B,CAAC,CAAC;YACL,CAAC;YAED,KAAK,KAAK,CAAC,CAAC,CAAC;gBACX,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,UAAU,CAAC,GAAG,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;oBACnD,MAAM,IAAI,mBAAmB,CAAC,KAAK,EAAE,kBAAkB,CAAC,CAAC;gBAC3D,CAAC;gBACD,OAAO,IAAI,WAAW,CAAC;oBACrB,GAAG,EAAE,UAAU,CAAC,GAAG;oBACnB,KAAK,EAAE,UAAU,CAAC,KAAK;iBACxB,CAAC,CAAC;YACL,CAAC;YAED,KAAK,mBAAmB;gBACtB,MAAM,IAAI,2BAA2B,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF"}
|
package/dist/server.d.ts
CHANGED
|
@@ -3,4 +3,18 @@ import type { ProviderRegistry } from "./registry.js";
|
|
|
3
3
|
export declare const COMPOSER_RESEARCH: "composer_research";
|
|
4
4
|
export declare const COMPOSER_CODE: "composer_code";
|
|
5
5
|
export declare const COMPOSER_REVIEW: "composer_review";
|
|
6
|
+
export declare const COMPOSER_CODE_CLI: "composer_code_cli";
|
|
7
|
+
export declare const COMPOSER_CODE_CHAIN: "composer_code_chain";
|
|
8
|
+
/**
|
|
9
|
+
* Deterministically apply GLM-authored output of the form
|
|
10
|
+
* FILE: <relative/path>
|
|
11
|
+
* ```lang
|
|
12
|
+
* <content>
|
|
13
|
+
* ```
|
|
14
|
+
* Writes each file under `root` (cwd). Guards against path traversal.
|
|
15
|
+
*/
|
|
16
|
+
export declare function applyFileBlocks(text: string, root: string): {
|
|
17
|
+
written: string[];
|
|
18
|
+
skipped: string[];
|
|
19
|
+
};
|
|
6
20
|
export declare function createComposerServer(registry: ProviderRegistry): McpServer;
|
package/dist/server.js
CHANGED
|
@@ -4,20 +4,65 @@
|
|
|
4
4
|
// InMemoryTransport; src/index.ts connects via StdioServerTransport.
|
|
5
5
|
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
6
6
|
import { z } from "zod";
|
|
7
|
+
import fs from "node:fs";
|
|
8
|
+
import path from "node:path";
|
|
7
9
|
// C0.3 — locked MCP tool names. Referenced by subagent allowlists +
|
|
8
10
|
// boundary_guard.sh; do not rename without a new ADR.
|
|
9
11
|
export const COMPOSER_RESEARCH = "composer_research";
|
|
10
12
|
export const COMPOSER_CODE = "composer_code";
|
|
11
13
|
export const COMPOSER_REVIEW = "composer_review";
|
|
14
|
+
export const COMPOSER_CODE_CLI = "composer_code_cli";
|
|
15
|
+
export const COMPOSER_CODE_CHAIN = "composer_code_chain";
|
|
12
16
|
const RESEARCH_DESCRIPTION = "MANDATORY for ALL research, documentation lookup, web search, and " +
|
|
13
17
|
"context gathering. The orchestrator MUST delegate research questions " +
|
|
14
18
|
"to this tool. Do not search or hypothesise in the main session.";
|
|
15
19
|
const CODE_DESCRIPTION = "MANDATORY for ALL code writing, refactoring, debugging, and " +
|
|
16
20
|
"implementation. The orchestrator MUST delegate implementation to this " +
|
|
17
21
|
"tool. Do not write code in the main session.";
|
|
22
|
+
const CODE_CHAIN_DESCRIPTION = "Preferred for substantial code: GLM AUTHORS the code (off-CC), then the " +
|
|
23
|
+
"CLI executor (agy) APPLIES it to disk (off-CC), then you gate it through " +
|
|
24
|
+
"composer_review. The orchestrator only calls this once and relays the " +
|
|
25
|
+
"summary — it never generates or writes code itself. Combines GLM code " +
|
|
26
|
+
"quality with off-CC application (keeps the main session lean). Returns a " +
|
|
27
|
+
"summary of files written.";
|
|
28
|
+
const CODE_CLI_DESCRIPTION = "Generate AND APPLY code changes directly to disk via the CLI executor " +
|
|
29
|
+
"(agy/Gemini), which runs in the server working directory and edits files " +
|
|
30
|
+
"itself. Returns ONLY a summary of what changed. Use this to offload BOTH " +
|
|
31
|
+
"generation and file-writing off the main session: the orchestrator does " +
|
|
32
|
+
"NOT call Edit/Write — the executor already applied the changes. Prefer " +
|
|
33
|
+
"this for multi-file or substantial edits to keep the main context lean.";
|
|
18
34
|
const REVIEW_DESCRIPTION = "MANDATORY for ALL code review, diff critique, and finding bugs in " +
|
|
19
35
|
"candidate patches. The orchestrator MUST delegate review to this tool " +
|
|
20
36
|
"before integrating worker output.";
|
|
37
|
+
/**
|
|
38
|
+
* Deterministically apply GLM-authored output of the form
|
|
39
|
+
* FILE: <relative/path>
|
|
40
|
+
* ```lang
|
|
41
|
+
* <content>
|
|
42
|
+
* ```
|
|
43
|
+
* Writes each file under `root` (cwd). Guards against path traversal.
|
|
44
|
+
*/
|
|
45
|
+
export function applyFileBlocks(text, root) {
|
|
46
|
+
const written = [];
|
|
47
|
+
const skipped = [];
|
|
48
|
+
const re = /FILE:\s*(\S+)[^\n]*\n```[^\n]*\n([\s\S]*?)```/g;
|
|
49
|
+
let m;
|
|
50
|
+
while ((m = re.exec(text)) !== null) {
|
|
51
|
+
const rel = (m[1] ?? "").trim();
|
|
52
|
+
const content = m[2] ?? "";
|
|
53
|
+
if (!rel)
|
|
54
|
+
continue;
|
|
55
|
+
const abs = path.resolve(root, rel);
|
|
56
|
+
if (abs !== root && !abs.startsWith(root + path.sep)) {
|
|
57
|
+
skipped.push(rel + " (outside root)");
|
|
58
|
+
continue;
|
|
59
|
+
}
|
|
60
|
+
fs.mkdirSync(path.dirname(abs), { recursive: true });
|
|
61
|
+
fs.writeFileSync(abs, content, "utf8");
|
|
62
|
+
written.push(rel);
|
|
63
|
+
}
|
|
64
|
+
return { written, skipped };
|
|
65
|
+
}
|
|
21
66
|
export function createComposerServer(registry) {
|
|
22
67
|
const server = new McpServer({
|
|
23
68
|
name: "composer",
|
|
@@ -80,6 +125,57 @@ export function createComposerServer(registry) {
|
|
|
80
125
|
const result = await provider.execute({ prompt, context: diff });
|
|
81
126
|
return { content: [{ type: "text", text: result.text }] };
|
|
82
127
|
});
|
|
128
|
+
server.registerTool(COMPOSER_CODE_CHAIN, {
|
|
129
|
+
description: CODE_CHAIN_DESCRIPTION,
|
|
130
|
+
inputSchema: {
|
|
131
|
+
prompt: z.string().min(1),
|
|
132
|
+
context: z.string().optional(),
|
|
133
|
+
},
|
|
134
|
+
annotations: {
|
|
135
|
+
title: "Composer Code (GLM author -> CLI apply)",
|
|
136
|
+
readOnlyHint: false,
|
|
137
|
+
openWorldHint: false,
|
|
138
|
+
destructiveHint: true,
|
|
139
|
+
idempotentHint: false,
|
|
140
|
+
},
|
|
141
|
+
}, async ({ prompt, context }) => {
|
|
142
|
+
// Stage 1: GLM authors the code off-CC (returns full file contents).
|
|
143
|
+
const gen = registry.getProviderForRole("coder");
|
|
144
|
+
const genPrompt = prompt +
|
|
145
|
+
"\n\nOUTPUT FORMAT: give the COMPLETE contents of every file to " +
|
|
146
|
+
"create or modify. For each file, write a line `FILE: <relative/path>` " +
|
|
147
|
+
"followed by a fenced code block with the full file content. No " +
|
|
148
|
+
"abbreviations, no placeholders, no commentary outside the blocks.";
|
|
149
|
+
const authored = await gen.execute({ prompt: genPrompt, context });
|
|
150
|
+
// Stage 2: server applies GLM's FILE: blocks deterministically (off-CC,
|
|
151
|
+
// no LLM transcription step — an executor cannot fabricate the apply).
|
|
152
|
+
const { written, skipped } = applyFileBlocks(authored.text, process.cwd());
|
|
153
|
+
const summary = written.length > 0
|
|
154
|
+
? `GLM authored + applied off-CC. Wrote ${written.length} file(s): ${written.join(", ")}.` +
|
|
155
|
+
(skipped.length ? ` Skipped: ${skipped.join(", ")}.` : "")
|
|
156
|
+
: "GLM authored but produced NO parseable FILE: blocks — nothing written. " +
|
|
157
|
+
"Re-issue with explicit 'FILE: <path>' + fenced-block formatting, or " +
|
|
158
|
+
"use composer_code_cli (agy authors+applies) instead.";
|
|
159
|
+
return { content: [{ type: "text", text: summary }] };
|
|
160
|
+
});
|
|
161
|
+
server.registerTool(COMPOSER_CODE_CLI, {
|
|
162
|
+
description: CODE_CLI_DESCRIPTION,
|
|
163
|
+
inputSchema: {
|
|
164
|
+
prompt: z.string().min(1),
|
|
165
|
+
context: z.string().optional(),
|
|
166
|
+
},
|
|
167
|
+
annotations: {
|
|
168
|
+
title: "Composer Code (CLI apply)",
|
|
169
|
+
readOnlyHint: false,
|
|
170
|
+
openWorldHint: false,
|
|
171
|
+
destructiveHint: true,
|
|
172
|
+
idempotentHint: false,
|
|
173
|
+
},
|
|
174
|
+
}, async ({ prompt, context }) => {
|
|
175
|
+
const provider = registry.getProviderForRole("coderCli");
|
|
176
|
+
const result = await provider.execute({ prompt, context });
|
|
177
|
+
return { content: [{ type: "text", text: result.text }] };
|
|
178
|
+
});
|
|
83
179
|
return server;
|
|
84
180
|
}
|
|
85
181
|
//# sourceMappingURL=server.js.map
|
package/dist/server.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,4EAA4E;AAC5E,+DAA+D;AAC/D,qEAAqE;AAErE,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA,oEAAoE;AACpE,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,KAAK;YACpB,eAAe,EAAE,IAAI;YACrB,cAAc,EAAE,KAAK;SACtB;KACF,EACD,KAAK,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,EAAE;QAC5B,MAAM,QAAQ,GAAG,QAAQ,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC;QACzD,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;QAC3D,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;IAC5D,CAAC,CACF,CAAC;IAEF,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -15,13 +15,18 @@ findings.
|
|
|
15
15
|
patch (`diff`).
|
|
16
16
|
- Use `Read` / `Glob` to load surrounding files when the diff alone is
|
|
17
17
|
insufficient context for the reviewer provider.
|
|
18
|
+
- In the `prompt` to `composer_review`, instruct the reviewer to **run
|
|
19
|
+
`tsc --noEmit` and any existing tests on the changed files** (the agy
|
|
20
|
+
reviewer executes them off-CC in the repo cwd) and include pass/fail in
|
|
21
|
+
the findings. If no tests/types exist, it must say so explicitly.
|
|
18
22
|
- Call `mcp__composer__composer_review` once.
|
|
19
|
-
- Return the tool output verbatim (
|
|
23
|
+
- Return the tool output verbatim (findings, severity, line refs, test results).
|
|
20
24
|
|
|
21
25
|
# What you DO NOT do
|
|
22
26
|
|
|
23
27
|
- DO NOT propose fixes — only flag issues.
|
|
24
|
-
- DO NOT edit
|
|
28
|
+
- DO NOT edit or write files yourself, and do NOT run tests in YOUR (CC)
|
|
29
|
+
context — instruct the reviewer provider (agy) to run them off-CC instead.
|
|
25
30
|
- DO NOT call any tool other than `composer_review`, `Read`, or `Glob`.
|
|
26
31
|
- DO NOT soften or rephrase the reviewer's output — the orchestrator
|
|
27
32
|
needs the raw verdict.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "composer-mastermind",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Multi-agent orchestrator: Claude as brain, GLM/agy as executors. Dispatches code/research/review work to subagents wired through the @composer-mcp/server MCP server.",
|
|
5
5
|
"claudeCodeVersion": ">=4.6",
|
|
6
6
|
"requires": [
|
|
@@ -24,6 +24,13 @@ output.
|
|
|
24
24
|
or `composer_review` directly from the main session. **ALWAYS**
|
|
25
25
|
dispatch via the `Task` tool to the matching subagent so the worker's
|
|
26
26
|
context window stays isolated and only the summary returns to you.
|
|
27
|
+
- **EXCEPTION — `composer_code_chain` / `composer_code_cli`:** call these
|
|
28
|
+
**directly** from the main session for any file create / edit / refactor.
|
|
29
|
+
They return only a short summary (the executor already applied the files
|
|
30
|
+
off-CC), so there is no large patch to isolate and no CC tokens spent
|
|
31
|
+
applying. Do NOT wrap in a subagent or follow with `Edit`/`Write`.
|
|
32
|
+
**Default to `composer_code_chain`** (GLM authors off-CC → agy applies
|
|
33
|
+
off-CC); use `composer_code_cli` when agy may author directly (fastest).
|
|
27
34
|
- **NEVER** write code in the main session — not even a one-liner. Delegate to `coder`.
|
|
28
35
|
- **NEVER** speculate when a fact is needed. Delegate to `researcher`.
|
|
29
36
|
- **NEVER** integrate a candidate patch without review. Delegate to
|
|
@@ -34,13 +41,21 @@ output.
|
|
|
34
41
|
| If the user (or your plan) needs… | Use the `Task` tool to dispatch to |
|
|
35
42
|
|---|---|
|
|
36
43
|
| Information, docs, web search, current API shape, "what's the X best practice" | `researcher` subagent |
|
|
37
|
-
| Writing
|
|
44
|
+
| Writing / editing / refactoring code (DEFAULT) | **`composer_code_chain`** — call directly (GLM authors off-CC → agy applies off-CC → summary), then review |
|
|
45
|
+
| Fast/cheap edit, agy may author | `composer_code_cli` directly (agy generates AND applies off-CC) |
|
|
46
|
+
| Generate a patch WITHOUT applying (rare) | `coder` subagent (`composer_code` → you integrate) |
|
|
38
47
|
| Reviewing a candidate patch / diff / implementation | `reviewer` subagent |
|
|
39
48
|
| Anything that mutates state outside the conversation (push, deploy, install) | Escalate to the user. Do not act. |
|
|
40
49
|
|
|
41
|
-
For multi-step requests,
|
|
42
|
-
`
|
|
43
|
-
|
|
50
|
+
For multi-step requests, run in order: `researcher` → plan →
|
|
51
|
+
`composer_code_cli` (apply) → `reviewer` on the `git diff` → integrate.
|
|
52
|
+
**Code applied but not reviewed is NOT done** — always gate a code change
|
|
53
|
+
through `reviewer` (or `composer_review`) before reporting success.
|
|
54
|
+
Cross-model review: **GLM writes → agy reviews** (a different model catches
|
|
55
|
+
more). The review `prompt` MUST instruct the reviewer to **run `tsc --noEmit`
|
|
56
|
+
and any existing tests on the changed files and report pass/fail** — an LLM
|
|
57
|
+
read alone does not gate quality. The agy reviewer executes them off-CC in
|
|
58
|
+
the repo; if no tests exist, it says so. Each call returns only a summary.
|
|
44
59
|
|
|
45
60
|
**Dispatch calibration:** dispatch costs ~1.5k cache tokens for
|
|
46
61
|
skill+agent registry plus one Task roundtrip. The split saves tokens
|