cadre-ai 3.4.0 → 3.5.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.
- package/.claude-plugin/plugin.json +2 -2
- package/.codex-plugin/plugin.json +2 -2
- package/CHANGELOG.md +38 -0
- package/README.md +33 -10
- package/dist/cadre-cli.mjs +394 -91
- package/dist/cadre-mcp.mjs +67 -30
- package/package.json +3 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cadre",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "A human-governed, Git-aware product delivery harness for Codex and
|
|
3
|
+
"version": "3.5.0",
|
|
4
|
+
"description": "A human-governed, Git-aware product delivery harness for Codex, Claude Code, and Zed Agent.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cadre contributors"
|
|
7
7
|
},
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cadre",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "A human-governed, Git-aware product delivery harness for Codex and
|
|
3
|
+
"version": "3.5.0",
|
|
4
|
+
"description": "A human-governed, Git-aware product delivery harness for Codex, Claude Code, and Zed Agent.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Cadre contributors"
|
|
7
7
|
},
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,43 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [3.5.0] - 2026-08-27
|
|
4
|
+
|
|
5
|
+
Cadre 3.5.0 adds beta support for the native Zed Agent while keeping the
|
|
6
|
+
Codex and Claude Code integrations stable. Cadre lifecycle, governance,
|
|
7
|
+
project-state, and template-set semantics are unchanged.
|
|
8
|
+
|
|
9
|
+
### Added
|
|
10
|
+
|
|
11
|
+
- Added `zed` to explicit client selection and auto-detection. `--target all`
|
|
12
|
+
now installs or removes Codex, Claude Code, and Zed integrations.
|
|
13
|
+
- Added generated Zed adapters for all ten workflows under
|
|
14
|
+
`zed-skills/cadre-<workflow>/`, exposed in Zed as `/cadre-*` skills through
|
|
15
|
+
collision-safe global symlinks.
|
|
16
|
+
- Added JSONC-preserving Zed configuration for the packaged Cadre context
|
|
17
|
+
server and one exact allow rule for each of the 22 Cadre MCP tools.
|
|
18
|
+
- Added safe Zed uninstall behavior that removes only Cadre-owned links and a
|
|
19
|
+
matching context server while preserving permissions and unrelated settings.
|
|
20
|
+
- Added `contentMode: "text"` to `template_get_many` for clients that cannot
|
|
21
|
+
consume embedded resource bodies, while preserving the existing embedded
|
|
22
|
+
resource default.
|
|
23
|
+
|
|
24
|
+
### Changed
|
|
25
|
+
|
|
26
|
+
- Centralized all 22 MCP tool names so server registration, Zed permissions,
|
|
27
|
+
validation, and tests share one catalog.
|
|
28
|
+
- Extended the documentation command switcher, installation guides,
|
|
29
|
+
architecture, configuration, troubleshooting, and release validation for
|
|
30
|
+
the Zed Agent beta.
|
|
31
|
+
- Updated the runtime version to 3.5.0. Existing 3.4 projects remain readable
|
|
32
|
+
and use the standard explicit `refresh` flow before further state mutation;
|
|
33
|
+
the active template set remains v2.
|
|
34
|
+
|
|
35
|
+
### Stability
|
|
36
|
+
|
|
37
|
+
- Codex and Claude Code remain stable integrations.
|
|
38
|
+
- Native Zed Agent support is beta in this release. It targets Zed's global
|
|
39
|
+
Skills and custom MCP surfaces, not Codex or Claude ACP agents hosted in Zed.
|
|
40
|
+
|
|
3
41
|
## [3.4.0] - 2026-08-27
|
|
4
42
|
|
|
5
43
|
Cadre 3.4.0 is a breaking MCP and template-contract release. Existing v1
|
package/README.md
CHANGED
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
# Cadre
|
|
2
2
|
|
|
3
|
-
Cadre is a human-governed, Git-aware delivery harness for Codex
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
Cadre is a human-governed, Git-aware delivery harness for Codex, Claude Code,
|
|
4
|
+
and Zed Agent. Codex and Claude Code support is stable; native Zed Agent support
|
|
5
|
+
is beta. Cadre turns project context into resumable feature and bug tracks,
|
|
6
|
+
carries learning forward between phases, and records implementation provenance
|
|
7
|
+
in Git.
|
|
8
|
+
|
|
9
|
+
Cadre is installed as a user integration. Codex and Claude use native plugins;
|
|
10
|
+
Zed uses global skills and a custom MCP server. The bundled TypeScript MCP
|
|
11
|
+
server provides deterministic state operations and immutable, versioned
|
|
12
|
+
templates. A project keeps only approved, mutable delivery state under
|
|
13
|
+
`.cadre/`; runtime code and template catalogs are not copied into the project.
|
|
6
14
|
|
|
7
15
|
**Documentation:** [cadre-docs.pages.dev](https://cadre-docs.pages.dev/) ·
|
|
8
16
|
[Quickstart](https://cadre-docs.pages.dev/quickstart/) ·
|
|
@@ -30,7 +38,7 @@ Default idiomatic styleguides are included for Go, Java, Kotlin, Maven, Gradle,
|
|
|
30
38
|
|
|
31
39
|
- Node.js 18 or newer
|
|
32
40
|
- Git
|
|
33
|
-
- The `codex`
|
|
41
|
+
- The `codex`, `claude`, or `zed` CLI for each selected client
|
|
34
42
|
|
|
35
43
|
## Install
|
|
36
44
|
|
|
@@ -55,14 +63,18 @@ cadre-ai install --target codex
|
|
|
55
63
|
|
|
56
64
|
# Claude Code only
|
|
57
65
|
cadre-ai install --target claude
|
|
66
|
+
|
|
67
|
+
# Zed Agent only (beta)
|
|
68
|
+
cadre-ai install --target zed
|
|
58
69
|
```
|
|
59
70
|
|
|
60
71
|
The installer:
|
|
61
72
|
|
|
62
|
-
1. Packages the skills, MCP configuration, self-contained runtime,
|
|
63
|
-
templates into a local
|
|
64
|
-
2. Registers
|
|
65
|
-
|
|
73
|
+
1. Packages the skills, MCP configuration, self-contained runtime, generated
|
|
74
|
+
Zed adapters, and templates into a shared local payload.
|
|
75
|
+
2. Registers and installs `cadre@cadre` for Codex/Claude, or links global
|
|
76
|
+
`cadre-*` skills and configures the custom MCP server for Zed.
|
|
77
|
+
3. Verifies each selected client through its available native state.
|
|
66
78
|
4. Pre-approves only Cadre MCP tools so normal Cadre commands do not produce an
|
|
67
79
|
extra permission prompt.
|
|
68
80
|
|
|
@@ -75,6 +87,8 @@ By default, installation applies these narrowly scoped rules:
|
|
|
75
87
|
- Codex: `default_tools_approval_mode = "approve"` under `plugins."cadre@cadre".mcp_servers.cadre` in the user Codex configuration.
|
|
76
88
|
- Claude Code: `cadre` in `enabledMcpjsonServers` and `mcp__cadre__*` in the
|
|
77
89
|
user permission allowlist.
|
|
90
|
+
- Zed Agent (beta): one exact `mcp:cadre:<tool>` allow entry for each Cadre MCP tool
|
|
91
|
+
under `agent.tool_permissions.tools`.
|
|
78
92
|
|
|
79
93
|
Existing configuration, comments, and unrelated permission rules are preserved. A Claude deny rule is never removed or overridden. These rules suppress the host application's per-tool prompt; they do not bypass Cadre's requirement to present artifacts and lifecycle mutations to the human for approval.
|
|
80
94
|
|
|
@@ -90,7 +104,7 @@ cadre-ai install --target codex --prompt-mcp-tools
|
|
|
90
104
|
|
|
91
105
|
| Option | Effect |
|
|
92
106
|
| --- | --- |
|
|
93
|
-
| `--target auto\|all\|codex\|claude` | Select the target client; defaults to `auto`. |
|
|
107
|
+
| `--target auto\|all\|codex\|claude\|zed` | Select the target client; defaults to `auto`. |
|
|
94
108
|
| `--scope user` | Explicitly select the only supported installation scope. |
|
|
95
109
|
| `--replace-marketplace` | Replace another configured marketplace named `cadre` after the installer detects the path mismatch. |
|
|
96
110
|
| `--prompt-mcp-tools` | Do not add the Cadre MCP pre-approval rule. |
|
|
@@ -126,6 +140,8 @@ After installation or update:
|
|
|
126
140
|
|
|
127
141
|
- Start a new Codex conversation so the new skills and MCP tools are loaded.
|
|
128
142
|
- In Claude Code, run `/reload-plugins` or start a new session.
|
|
143
|
+
- In Zed, open a new Agent thread; global skills reload live and the Cadre MCP
|
|
144
|
+
server should appear active under AI → MCP Servers.
|
|
129
145
|
|
|
130
146
|
You can inspect installation state with:
|
|
131
147
|
|
|
@@ -136,7 +152,8 @@ claude plugin list --json
|
|
|
136
152
|
|
|
137
153
|
## Quick start
|
|
138
154
|
|
|
139
|
-
Cadre commands are agent skills, not shell commands. Invoke them in
|
|
155
|
+
Cadre commands are agent skills, not shell commands. Invoke them in a Codex,
|
|
156
|
+
Claude Code, or native Zed Agent conversation.
|
|
140
157
|
|
|
141
158
|
### 1. Initialize a project
|
|
142
159
|
|
|
@@ -145,6 +162,7 @@ From the project repository, invoke:
|
|
|
145
162
|
```text
|
|
146
163
|
Codex: $cadre:create
|
|
147
164
|
Claude Code: /cadre:create
|
|
165
|
+
Zed Agent: /cadre-create
|
|
148
166
|
```
|
|
149
167
|
|
|
150
168
|
Cadre will:
|
|
@@ -162,6 +180,7 @@ Cadre will:
|
|
|
162
180
|
```text
|
|
163
181
|
Codex: $cadre:track Add passwordless login as a feature
|
|
164
182
|
Claude Code: /cadre:track Fix duplicate invoice creation as a bug
|
|
183
|
+
Zed Agent: /cadre-track Add passwordless login as a feature
|
|
165
184
|
```
|
|
166
185
|
|
|
167
186
|
Cadre proposes and separately approves:
|
|
@@ -177,6 +196,7 @@ Every delivery phase ends with `User Manual Verification`. The final phase is al
|
|
|
177
196
|
```text
|
|
178
197
|
Codex: $cadre:implement passwordless-login
|
|
179
198
|
Claude Code: /cadre:implement passwordless-login
|
|
199
|
+
Zed Agent: /cadre-implement passwordless-login
|
|
180
200
|
```
|
|
181
201
|
|
|
182
202
|
Parallel mode is the default. Request sequential execution explicitly when needed:
|
|
@@ -184,6 +204,7 @@ Parallel mode is the default. Request sequential execution explicitly when neede
|
|
|
184
204
|
```text
|
|
185
205
|
Codex: $cadre:implement passwordless-login sequentially
|
|
186
206
|
Claude Code: /cadre:implement passwordless-login sequentially
|
|
207
|
+
Zed Agent: /cadre-implement passwordless-login sequentially
|
|
187
208
|
```
|
|
188
209
|
|
|
189
210
|
Implementation starts only after declared track dependencies are completed. Phase and task dependencies form a hierarchical DAG: phase dependencies activate phases, task dependencies expose phase-local work, and main allocates one global worker bound across every ready task. The generated workflow defaults to three delegated workers, the execution runtime accepts `maxWorkers` from 1 through 32, and effective concurrency is clamped by safe ready nodes and available host worker slots. Different phases can use direct execution, a sequential phase worker, or task-worker fan-out concurrently. Within one phase, execution can switch between sequential and fan-out modes only at a clean, journaled checkpoint. The main agent remains the only scheduler, operational owner of phase integration worktrees, state owner, merger, conflict resolver, worktree cleaner, and recorder of human approval.
|
|
@@ -195,6 +216,7 @@ Every delivery phase ends with a derived manual-verification barrier over its ta
|
|
|
195
216
|
```text
|
|
196
217
|
Codex: $cadre:review passwordless-login
|
|
197
218
|
Claude Code: /cadre:review passwordless-login
|
|
219
|
+
Zed Agent: /cadre-review passwordless-login
|
|
198
220
|
```
|
|
199
221
|
|
|
200
222
|
Findings are presented before they become Cadre state. Approved bugs create a timestamped bug artifact and add remediation phases to the plan. A human-approved clean review marks the track `completed`.
|
|
@@ -204,6 +226,7 @@ Findings are presented before they become Cadre state. Approved bugs create a ti
|
|
|
204
226
|
```text
|
|
205
227
|
Codex: $cadre:archive passwordless-login account-lockout
|
|
206
228
|
Claude Code: /cadre:archive all completed
|
|
229
|
+
Zed Agent: /cadre-archive all completed
|
|
207
230
|
```
|
|
208
231
|
|
|
209
232
|
Archive accepts one or more completed tracks in one resumable batch. It distills their durable learning into the project pattern catalog, updates relevant seeds for active tracks, preserves the full track history, and moves each selected track to its derived archive location.
|
package/dist/cadre-cli.mjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
3
|
// scripts/cli.ts
|
|
4
|
-
import { existsSync as
|
|
5
|
-
import { dirname as
|
|
4
|
+
import { existsSync as existsSync7, readFileSync as readFileSync7 } from "node:fs";
|
|
5
|
+
import { dirname as dirname7, join as join7, resolve as resolve7 } from "node:path";
|
|
6
6
|
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
7
7
|
|
|
8
8
|
// scripts/install.ts
|
|
9
|
-
import { existsSync as
|
|
10
|
-
import { homedir as
|
|
11
|
-
import { basename as basename2, dirname as
|
|
9
|
+
import { existsSync as existsSync5, mkdtempSync, mkdirSync as mkdirSync4, readFileSync as readFileSync5, renameSync as renameSync2 } from "node:fs";
|
|
10
|
+
import { homedir as homedir3 } from "node:os";
|
|
11
|
+
import { basename as basename2, dirname as dirname5, join as join5, parse as parse4, resolve as resolve5 } from "node:path";
|
|
12
12
|
|
|
13
13
|
// scripts/cli-options.ts
|
|
14
14
|
import { homedir } from "node:os";
|
|
@@ -16,7 +16,7 @@ import { join, resolve } from "node:path";
|
|
|
16
16
|
|
|
17
17
|
// scripts/native-clients.ts
|
|
18
18
|
import { spawnSync } from "node:child_process";
|
|
19
|
-
var CLIENTS = ["codex", "claude"];
|
|
19
|
+
var CLIENTS = ["codex", "claude", "zed"];
|
|
20
20
|
function commandExists(command) {
|
|
21
21
|
const lookup = process.platform === "win32" ? "where" : "which";
|
|
22
22
|
return spawnSync(lookup, [command], { stdio: "ignore" }).status === 0;
|
|
@@ -47,7 +47,7 @@ function runJson(command, args) {
|
|
|
47
47
|
// scripts/cli-options.ts
|
|
48
48
|
function parseClient(value) {
|
|
49
49
|
if (value === "all" || value === "auto" || CLIENTS.includes(value)) return value;
|
|
50
|
-
throw new Error("--target/--agent must be auto, all, codex, or
|
|
50
|
+
throw new Error("--target/--agent must be auto, all, codex, claude, or zed");
|
|
51
51
|
}
|
|
52
52
|
function defaultMarketplaceRoot() {
|
|
53
53
|
const cadreHome = process.env.CADRE_HOME ? resolve(process.env.CADRE_HOME) : join(homedir(), ".cadre");
|
|
@@ -63,8 +63,8 @@ function marketplaceFromHome(home) {
|
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
// scripts/package-plugin.ts
|
|
66
|
-
import { cpSync, existsSync as
|
|
67
|
-
import { dirname as
|
|
66
|
+
import { cpSync as cpSync2, existsSync as existsSync3, mkdirSync as mkdirSync2, readFileSync as readFileSync3, writeFileSync as writeFileSync2 } from "node:fs";
|
|
67
|
+
import { dirname as dirname3, join as join4, resolve as resolve4 } from "node:path";
|
|
68
68
|
import { fileURLToPath as fileURLToPath2 } from "node:url";
|
|
69
69
|
|
|
70
70
|
// src/domain/templates.ts
|
|
@@ -74,7 +74,7 @@ import { dirname, extname, join as join2, relative, resolve as resolve2, sep } f
|
|
|
74
74
|
import { fileURLToPath } from "node:url";
|
|
75
75
|
|
|
76
76
|
// src/domain/version.ts
|
|
77
|
-
var CADRE_RUNTIME_VERSION = "3.
|
|
77
|
+
var CADRE_RUNTIME_VERSION = "3.5.0";
|
|
78
78
|
var TEMPLATE_SET_VERSION = "v2";
|
|
79
79
|
|
|
80
80
|
// src/domain/templates.ts
|
|
@@ -185,8 +185,127 @@ function templateCatalog() {
|
|
|
185
185
|
return catalogCache.map((template) => ({ ...template }));
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
+
// scripts/zed.ts
|
|
189
|
+
import {
|
|
190
|
+
cpSync,
|
|
191
|
+
existsSync as existsSync2,
|
|
192
|
+
lstatSync,
|
|
193
|
+
mkdirSync,
|
|
194
|
+
readFileSync as readFileSync2,
|
|
195
|
+
readlinkSync,
|
|
196
|
+
symlinkSync,
|
|
197
|
+
unlinkSync,
|
|
198
|
+
writeFileSync
|
|
199
|
+
} from "node:fs";
|
|
200
|
+
import { homedir as homedir2 } from "node:os";
|
|
201
|
+
import { dirname as dirname2, join as join3, resolve as resolve3 } from "node:path";
|
|
202
|
+
var CADRE_WORKFLOWS = [
|
|
203
|
+
"create",
|
|
204
|
+
"track",
|
|
205
|
+
"implement",
|
|
206
|
+
"review",
|
|
207
|
+
"revise",
|
|
208
|
+
"archive",
|
|
209
|
+
"refresh",
|
|
210
|
+
"revert",
|
|
211
|
+
"status",
|
|
212
|
+
"wisp"
|
|
213
|
+
];
|
|
214
|
+
var ZED_COMPATIBILITY = `## Zed compatibility
|
|
215
|
+
|
|
216
|
+
Zed Agent consumes Cadre templates through tools rather than MCP resource discovery. Whenever this workflow calls \`template_get_many\`, include \`contentMode: "text"\`. Use known template IDs and descriptor tools such as \`styleguide_resolve\`; do not attempt to list or read MCP resources directly.`;
|
|
217
|
+
function pathExists(path) {
|
|
218
|
+
try {
|
|
219
|
+
lstatSync(path);
|
|
220
|
+
return true;
|
|
221
|
+
} catch {
|
|
222
|
+
return false;
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
function zedSettingsPath() {
|
|
226
|
+
return join3(homedir2(), ".config", "zed", "settings.json");
|
|
227
|
+
}
|
|
228
|
+
function zedSkillsRoot() {
|
|
229
|
+
return join3(homedir2(), ".agents", "skills");
|
|
230
|
+
}
|
|
231
|
+
function zedAdapterRoot(marketplaceRoot) {
|
|
232
|
+
return join3(resolve3(marketplaceRoot), "plugins", "cadre", "zed-skills");
|
|
233
|
+
}
|
|
234
|
+
function createZedSkillAdapters(pluginRoot) {
|
|
235
|
+
const adapterRoot = join3(pluginRoot, "zed-skills");
|
|
236
|
+
if (existsSync2(adapterRoot)) throw new Error(`Zed skill adapter output already exists: ${adapterRoot}`);
|
|
237
|
+
mkdirSync(adapterRoot, { recursive: true });
|
|
238
|
+
for (const workflow of CADRE_WORKFLOWS) {
|
|
239
|
+
const source = join3(pluginRoot, "skills", workflow);
|
|
240
|
+
const target = join3(adapterRoot, `cadre-${workflow}`);
|
|
241
|
+
cpSync(source, target, { recursive: true });
|
|
242
|
+
const skillPath = join3(target, "SKILL.md");
|
|
243
|
+
const body = readFileSync2(skillPath, "utf8");
|
|
244
|
+
const expectedName = `name: ${workflow}`;
|
|
245
|
+
const namePattern = new RegExp(`^${expectedName}$`, "m");
|
|
246
|
+
if (!namePattern.test(body)) throw new Error(`${skillPath}: expected ${expectedName}`);
|
|
247
|
+
const renamed = body.replace(namePattern, `name: cadre-${workflow}`);
|
|
248
|
+
const frontmatterEnd = renamed.indexOf("\n---\n", 4);
|
|
249
|
+
if (frontmatterEnd === -1) throw new Error(`${skillPath}: invalid skill frontmatter`);
|
|
250
|
+
const insertionPoint = frontmatterEnd + "\n---\n".length;
|
|
251
|
+
const adapted = `${renamed.slice(0, insertionPoint)}
|
|
252
|
+
${ZED_COMPATIBILITY}
|
|
253
|
+
${renamed.slice(insertionPoint)}`;
|
|
254
|
+
writeFileSync(skillPath, adapted);
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
function expectedSkillLink(marketplaceRoot, workflow) {
|
|
258
|
+
return {
|
|
259
|
+
destination: join3(zedSkillsRoot(), `cadre-${workflow}`),
|
|
260
|
+
target: join3(zedAdapterRoot(marketplaceRoot), `cadre-${workflow}`)
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
function linkTarget(path) {
|
|
264
|
+
if (!pathExists(path) || !lstatSync(path).isSymbolicLink()) return null;
|
|
265
|
+
return resolve3(dirname2(path), readlinkSync(path));
|
|
266
|
+
}
|
|
267
|
+
function preflightZedSkillLinks(marketplaceRoot) {
|
|
268
|
+
for (const workflow of CADRE_WORKFLOWS) {
|
|
269
|
+
const link = expectedSkillLink(marketplaceRoot, workflow);
|
|
270
|
+
if (!pathExists(link.destination)) continue;
|
|
271
|
+
if (linkTarget(link.destination) !== link.target) {
|
|
272
|
+
throw new Error(
|
|
273
|
+
`${link.destination} already exists and is not owned by Cadre; move it before installing Zed support`
|
|
274
|
+
);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
function installZedSkillLinks(marketplaceRoot) {
|
|
279
|
+
preflightZedSkillLinks(marketplaceRoot);
|
|
280
|
+
mkdirSync(zedSkillsRoot(), { recursive: true });
|
|
281
|
+
const installed = [];
|
|
282
|
+
for (const workflow of CADRE_WORKFLOWS) {
|
|
283
|
+
const link = expectedSkillLink(marketplaceRoot, workflow);
|
|
284
|
+
if (!pathExists(link.destination)) {
|
|
285
|
+
symlinkSync(link.target, link.destination, process.platform === "win32" ? "junction" : "dir");
|
|
286
|
+
}
|
|
287
|
+
installed.push(link.destination);
|
|
288
|
+
}
|
|
289
|
+
return installed;
|
|
290
|
+
}
|
|
291
|
+
function removeZedSkillLinks(marketplaceRoot) {
|
|
292
|
+
const removed = [];
|
|
293
|
+
const retained = [];
|
|
294
|
+
for (const workflow of CADRE_WORKFLOWS) {
|
|
295
|
+
const link = expectedSkillLink(marketplaceRoot, workflow);
|
|
296
|
+
if (!pathExists(link.destination)) continue;
|
|
297
|
+
if (linkTarget(link.destination) === link.target) {
|
|
298
|
+
unlinkSync(link.destination);
|
|
299
|
+
removed.push(link.destination);
|
|
300
|
+
} else {
|
|
301
|
+
retained.push(link.destination);
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return { removed, retained };
|
|
305
|
+
}
|
|
306
|
+
|
|
188
307
|
// scripts/package-plugin.ts
|
|
189
|
-
var sourceRoot =
|
|
308
|
+
var sourceRoot = resolve4(dirname3(fileURLToPath2(import.meta.url)), "..");
|
|
190
309
|
var requiredEntries = [
|
|
191
310
|
"skills",
|
|
192
311
|
"templates",
|
|
@@ -198,11 +317,11 @@ var requiredEntries = [
|
|
|
198
317
|
];
|
|
199
318
|
var optionalEntries = ["hooks", "hooks.json", ".app.json", "assets", "commands", "agents"];
|
|
200
319
|
function readJson(path) {
|
|
201
|
-
return JSON.parse(
|
|
320
|
+
return JSON.parse(readFileSync3(path, "utf8"));
|
|
202
321
|
}
|
|
203
322
|
function writeJson(path, value) {
|
|
204
|
-
|
|
205
|
-
|
|
323
|
+
mkdirSync2(dirname3(path), { recursive: true });
|
|
324
|
+
writeFileSync2(path, `${JSON.stringify(value, null, 2)}
|
|
206
325
|
`);
|
|
207
326
|
}
|
|
208
327
|
function withCachebuster(version, product, cachebuster) {
|
|
@@ -214,36 +333,37 @@ function defaultCachebuster() {
|
|
|
214
333
|
}
|
|
215
334
|
function packagePluginMarketplace(outputRoot, requestedCachebuster = defaultCachebuster()) {
|
|
216
335
|
templateCatalog();
|
|
217
|
-
const targetRoot =
|
|
336
|
+
const targetRoot = resolve4(outputRoot);
|
|
218
337
|
const cachebuster = requestedCachebuster.trim();
|
|
219
338
|
if (!/^[0-9A-Za-z-]+$/.test(cachebuster)) {
|
|
220
339
|
throw new Error("cachebuster must contain only letters, digits, and hyphens");
|
|
221
340
|
}
|
|
222
|
-
const pluginRoot =
|
|
223
|
-
if (
|
|
224
|
-
|
|
341
|
+
const pluginRoot = join4(targetRoot, "plugins", "cadre");
|
|
342
|
+
if (existsSync3(pluginRoot)) throw new Error(`plugin output already exists: ${pluginRoot}`);
|
|
343
|
+
mkdirSync2(pluginRoot, { recursive: true });
|
|
225
344
|
for (const entry of requiredEntries) {
|
|
226
|
-
const source =
|
|
227
|
-
if (!
|
|
228
|
-
|
|
345
|
+
const source = join4(sourceRoot, entry);
|
|
346
|
+
if (!existsSync3(source)) throw new Error(`required plugin entry is missing: ${entry}`);
|
|
347
|
+
cpSync2(source, join4(pluginRoot, entry), { recursive: true });
|
|
229
348
|
}
|
|
230
349
|
for (const entry of optionalEntries) {
|
|
231
|
-
const source =
|
|
232
|
-
if (
|
|
350
|
+
const source = join4(sourceRoot, entry);
|
|
351
|
+
if (existsSync3(source)) cpSync2(source, join4(pluginRoot, entry), { recursive: true });
|
|
233
352
|
}
|
|
234
|
-
|
|
353
|
+
createZedSkillAdapters(pluginRoot);
|
|
354
|
+
const codexManifest = readJson(join4(sourceRoot, ".codex-plugin", "plugin.json"));
|
|
235
355
|
codexManifest.version = withCachebuster(codexManifest.version, "codex", cachebuster);
|
|
236
|
-
writeJson(
|
|
237
|
-
const claudeManifest = readJson(
|
|
356
|
+
writeJson(join4(pluginRoot, ".codex-plugin", "plugin.json"), codexManifest);
|
|
357
|
+
const claudeManifest = readJson(join4(sourceRoot, ".claude-plugin", "plugin.json"));
|
|
238
358
|
claudeManifest.version = withCachebuster(claudeManifest.version, "claude", cachebuster);
|
|
239
|
-
writeJson(
|
|
359
|
+
writeJson(join4(pluginRoot, ".claude-plugin", "plugin.json"), claudeManifest);
|
|
240
360
|
writeJson(
|
|
241
|
-
|
|
242
|
-
readJson(
|
|
361
|
+
join4(targetRoot, ".agents", "plugins", "marketplace.json"),
|
|
362
|
+
readJson(join4(sourceRoot, "marketplace", "codex.json"))
|
|
243
363
|
);
|
|
244
364
|
writeJson(
|
|
245
|
-
|
|
246
|
-
readJson(
|
|
365
|
+
join4(targetRoot, ".claude-plugin", "marketplace.json"),
|
|
366
|
+
readJson(join4(sourceRoot, "marketplace", "claude.json"))
|
|
247
367
|
);
|
|
248
368
|
return { targetRoot, pluginRoot, cachebuster };
|
|
249
369
|
}
|
|
@@ -1660,17 +1780,17 @@ function applyEdits(text, edits) {
|
|
|
1660
1780
|
// scripts/permissions.ts
|
|
1661
1781
|
import {
|
|
1662
1782
|
chmodSync,
|
|
1663
|
-
existsSync as
|
|
1664
|
-
lstatSync,
|
|
1665
|
-
mkdirSync as
|
|
1783
|
+
existsSync as existsSync4,
|
|
1784
|
+
lstatSync as lstatSync2,
|
|
1785
|
+
mkdirSync as mkdirSync3,
|
|
1666
1786
|
realpathSync,
|
|
1667
1787
|
renameSync,
|
|
1668
1788
|
statSync,
|
|
1669
|
-
unlinkSync,
|
|
1670
|
-
writeFileSync as
|
|
1671
|
-
readFileSync as
|
|
1789
|
+
unlinkSync as unlinkSync2,
|
|
1790
|
+
writeFileSync as writeFileSync3,
|
|
1791
|
+
readFileSync as readFileSync4
|
|
1672
1792
|
} from "node:fs";
|
|
1673
|
-
import { basename, dirname as
|
|
1793
|
+
import { basename, dirname as dirname4 } from "node:path";
|
|
1674
1794
|
|
|
1675
1795
|
// ../node_modules/.pnpm/smol-toml@1.7.1/node_modules/smol-toml/dist/date.js
|
|
1676
1796
|
var DATE_TIME_RE = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
@@ -2354,25 +2474,53 @@ function parse3(toml, { maxDepth = 1e3, integersAsBigInt } = {}) {
|
|
|
2354
2474
|
return res;
|
|
2355
2475
|
}
|
|
2356
2476
|
|
|
2477
|
+
// src/mcp/tool-names.ts
|
|
2478
|
+
var CADRE_MCP_TOOLS = {
|
|
2479
|
+
workflowElicit: "workflow_elicit",
|
|
2480
|
+
templateGetMany: "template_get_many",
|
|
2481
|
+
styleguideResolve: "styleguide_resolve",
|
|
2482
|
+
projectStatus: "project_status",
|
|
2483
|
+
stateValidate: "state_validate",
|
|
2484
|
+
candidateStagePrepare: "candidate_stage_prepare",
|
|
2485
|
+
candidateInspect: "candidate_inspect",
|
|
2486
|
+
executionGraphValidate: "execution_graph_validate",
|
|
2487
|
+
reviewComplete: "review_complete",
|
|
2488
|
+
archiveBatchCandidate: "archive_batch_candidate",
|
|
2489
|
+
archiveBatchRecord: "archive_batch_record",
|
|
2490
|
+
executionStart: "execution_start",
|
|
2491
|
+
executionCheckpoint: "execution_checkpoint",
|
|
2492
|
+
executionStatus: "execution_status",
|
|
2493
|
+
executionFinish: "execution_finish",
|
|
2494
|
+
worktreeCreate: "worktree_create",
|
|
2495
|
+
integration: "integration",
|
|
2496
|
+
worktreeCleanup: "worktree_cleanup",
|
|
2497
|
+
projectInitCandidate: "project_init_candidate",
|
|
2498
|
+
setupRecordCommit: "setup_record_commit",
|
|
2499
|
+
setupRecordGitInitialized: "setup_record_git_initialized",
|
|
2500
|
+
tracksRender: "tracks_render"
|
|
2501
|
+
};
|
|
2502
|
+
var CADRE_MCP_TOOL_NAMES = Object.freeze(Object.values(CADRE_MCP_TOOLS));
|
|
2503
|
+
|
|
2357
2504
|
// scripts/permissions.ts
|
|
2358
2505
|
var CODEX_SECTION = '[plugins."cadre@cadre".mcp_servers.cadre]';
|
|
2359
2506
|
var CODEX_APPROVAL = 'default_tools_approval_mode = "approve"';
|
|
2360
2507
|
var CLAUDE_APPROVAL = "mcp__cadre__*";
|
|
2361
2508
|
var CLAUDE_SERVER_APPROVAL = "cadre";
|
|
2509
|
+
var ZED_MCP_PERMISSION_KEYS = CADRE_MCP_TOOL_NAMES.map((name) => `mcp:cadre:${name}`);
|
|
2362
2510
|
function isRecord(value) {
|
|
2363
2511
|
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
2364
2512
|
}
|
|
2365
2513
|
function atomicWrite(path, content) {
|
|
2366
|
-
const effectivePath =
|
|
2367
|
-
const directory =
|
|
2368
|
-
|
|
2514
|
+
const effectivePath = existsSync4(path) && lstatSync2(path).isSymbolicLink() ? realpathSync(path) : path;
|
|
2515
|
+
const directory = dirname4(effectivePath);
|
|
2516
|
+
mkdirSync3(directory, { recursive: true });
|
|
2369
2517
|
const temporary = `${directory}/.${basename(effectivePath)}.cadre-${process.pid}-${Date.now()}`;
|
|
2370
2518
|
try {
|
|
2371
|
-
|
|
2372
|
-
if (
|
|
2519
|
+
writeFileSync3(temporary, content, { encoding: "utf8", flag: "wx" });
|
|
2520
|
+
if (existsSync4(effectivePath)) chmodSync(temporary, statSync(effectivePath).mode);
|
|
2373
2521
|
renameSync(temporary, effectivePath);
|
|
2374
2522
|
} finally {
|
|
2375
|
-
if (
|
|
2523
|
+
if (existsSync4(temporary)) unlinkSync2(temporary);
|
|
2376
2524
|
}
|
|
2377
2525
|
}
|
|
2378
2526
|
function cadreCodexPolicy(value) {
|
|
@@ -2385,7 +2533,7 @@ function cadreCodexPolicy(value) {
|
|
|
2385
2533
|
return isRecord(server) ? server : void 0;
|
|
2386
2534
|
}
|
|
2387
2535
|
function configureCodexMcpApproval(configPath) {
|
|
2388
|
-
const existing =
|
|
2536
|
+
const existing = existsSync4(configPath) ? readFileSync4(configPath, "utf8") : "";
|
|
2389
2537
|
let parsed;
|
|
2390
2538
|
try {
|
|
2391
2539
|
parsed = parse3(existing);
|
|
@@ -2459,7 +2607,7 @@ function deniesCadre(rule) {
|
|
|
2459
2607
|
return rule === "mcp__*" || rule === "mcp__cadre" || rule.startsWith("mcp__cadre__");
|
|
2460
2608
|
}
|
|
2461
2609
|
function configureClaudeMcpApproval(settingsPath) {
|
|
2462
|
-
const existing =
|
|
2610
|
+
const existing = existsSync4(settingsPath) ? readFileSync4(settingsPath, "utf8") : "{}\n";
|
|
2463
2611
|
const errors = [];
|
|
2464
2612
|
const parsed = parse2(existing, errors, { allowTrailingComma: true });
|
|
2465
2613
|
if (errors.length) {
|
|
@@ -2517,6 +2665,132 @@ function configureClaudeMcpApproval(settingsPath) {
|
|
|
2517
2665
|
`);
|
|
2518
2666
|
return { path: settingsPath, changed: true, rule: CLAUDE_APPROVAL };
|
|
2519
2667
|
}
|
|
2668
|
+
function parseJsoncSettings(settingsPath) {
|
|
2669
|
+
const existing = existsSync4(settingsPath) ? readFileSync4(settingsPath, "utf8") : "{}\n";
|
|
2670
|
+
const errors = [];
|
|
2671
|
+
const parsed = parse2(existing, errors, { allowTrailingComma: true });
|
|
2672
|
+
if (errors.length) {
|
|
2673
|
+
const detail = errors.map((error) => `${printParseErrorCode(error.error)} at ${error.offset}`).join(", ");
|
|
2674
|
+
throw new Error(`Cannot update invalid Zed settings ${settingsPath}: ${detail}`);
|
|
2675
|
+
}
|
|
2676
|
+
if (!isRecord(parsed)) throw new Error(`${settingsPath}: Zed settings root must be an object`);
|
|
2677
|
+
return { existing, root: parsed };
|
|
2678
|
+
}
|
|
2679
|
+
function assertRecordField(owner, field, settingsPath) {
|
|
2680
|
+
const value = owner[field];
|
|
2681
|
+
if (value === void 0) return {};
|
|
2682
|
+
if (!isRecord(value)) throw new Error(`${settingsPath}: ${field} must be an object`);
|
|
2683
|
+
return value;
|
|
2684
|
+
}
|
|
2685
|
+
function zedServerMatches(server, nodePath, mcpPath) {
|
|
2686
|
+
if (!isRecord(server) || server.command !== nodePath || !Array.isArray(server.args)) return false;
|
|
2687
|
+
return server.args.length === 1 && server.args[0] === mcpPath;
|
|
2688
|
+
}
|
|
2689
|
+
function zedServerTargetsMcp(server, mcpPath) {
|
|
2690
|
+
return isRecord(server) && Array.isArray(server.args) && server.args.length === 1 && server.args[0] === mcpPath;
|
|
2691
|
+
}
|
|
2692
|
+
function hasBlockingZedRule(rule, field) {
|
|
2693
|
+
const value = rule[field];
|
|
2694
|
+
return value !== void 0 && (!Array.isArray(value) || value.length > 0);
|
|
2695
|
+
}
|
|
2696
|
+
function configureZedCadre(settingsPath, nodePath, mcpPath, autoApproveMcp) {
|
|
2697
|
+
const { existing, root } = parseJsoncSettings(settingsPath);
|
|
2698
|
+
const contextServers = assertRecordField(root, "context_servers", settingsPath);
|
|
2699
|
+
const currentServer = contextServers.cadre;
|
|
2700
|
+
if (currentServer !== void 0 && !zedServerMatches(currentServer, nodePath, mcpPath)) {
|
|
2701
|
+
throw new Error(
|
|
2702
|
+
`${settingsPath}: context_servers.cadre is not the Cadre-managed server; remove or rename it before installation`
|
|
2703
|
+
);
|
|
2704
|
+
}
|
|
2705
|
+
if (isRecord(currentServer) && currentServer.enabled === false) {
|
|
2706
|
+
throw new Error(`${settingsPath}: context_servers.cadre is disabled; enable it before installation`);
|
|
2707
|
+
}
|
|
2708
|
+
const agent = assertRecordField(root, "agent", settingsPath);
|
|
2709
|
+
const toolPermissions = assertRecordField(agent, "tool_permissions", settingsPath);
|
|
2710
|
+
const tools = assertRecordField(toolPermissions, "tools", settingsPath);
|
|
2711
|
+
if (autoApproveMcp) {
|
|
2712
|
+
for (const key of ZED_MCP_PERMISSION_KEYS) {
|
|
2713
|
+
const current = tools[key];
|
|
2714
|
+
if (current === void 0) continue;
|
|
2715
|
+
if (!isRecord(current)) throw new Error(`${settingsPath}: agent.tool_permissions.tools.${key} must be an object`);
|
|
2716
|
+
if (hasBlockingZedRule(current, "always_deny") || hasBlockingZedRule(current, "always_confirm")) {
|
|
2717
|
+
throw new Error(
|
|
2718
|
+
`${settingsPath}: ${key} has a higher-precedence deny/confirm rule; remove it or rerun with --prompt-mcp-tools`
|
|
2719
|
+
);
|
|
2720
|
+
}
|
|
2721
|
+
}
|
|
2722
|
+
}
|
|
2723
|
+
const formattingOptions = { insertSpaces: true, tabSize: 2, eol: "\n" };
|
|
2724
|
+
const serverChanged = currentServer === void 0;
|
|
2725
|
+
let proposed = existing;
|
|
2726
|
+
if (serverChanged) {
|
|
2727
|
+
proposed = applyEdits(proposed, modify(
|
|
2728
|
+
proposed,
|
|
2729
|
+
["context_servers", "cadre"],
|
|
2730
|
+
{ command: nodePath, args: [mcpPath], env: {} },
|
|
2731
|
+
{ formattingOptions }
|
|
2732
|
+
));
|
|
2733
|
+
}
|
|
2734
|
+
let permissionsChanged = false;
|
|
2735
|
+
if (autoApproveMcp) {
|
|
2736
|
+
for (const key of ZED_MCP_PERMISSION_KEYS) {
|
|
2737
|
+
const current = isRecord(tools[key]) ? tools[key] : {};
|
|
2738
|
+
if (current.default === "allow") continue;
|
|
2739
|
+
proposed = applyEdits(proposed, modify(
|
|
2740
|
+
proposed,
|
|
2741
|
+
["agent", "tool_permissions", "tools", key, "default"],
|
|
2742
|
+
"allow",
|
|
2743
|
+
{ formattingOptions }
|
|
2744
|
+
));
|
|
2745
|
+
permissionsChanged = true;
|
|
2746
|
+
}
|
|
2747
|
+
}
|
|
2748
|
+
const verificationErrors = [];
|
|
2749
|
+
const verified = parse2(proposed, verificationErrors, { allowTrailingComma: true });
|
|
2750
|
+
const verifiedRoot = isRecord(verified) ? verified : {};
|
|
2751
|
+
const verifiedServers = isRecord(verifiedRoot.context_servers) ? verifiedRoot.context_servers : {};
|
|
2752
|
+
if (verificationErrors.length || !zedServerMatches(verifiedServers.cadre, nodePath, mcpPath)) {
|
|
2753
|
+
throw new Error("Generated Zed settings did not contain the Cadre MCP server");
|
|
2754
|
+
}
|
|
2755
|
+
if (autoApproveMcp) {
|
|
2756
|
+
const verifiedAgent = isRecord(verifiedRoot.agent) ? verifiedRoot.agent : {};
|
|
2757
|
+
const verifiedPermissions = isRecord(verifiedAgent.tool_permissions) ? verifiedAgent.tool_permissions : {};
|
|
2758
|
+
const verifiedTools = isRecord(verifiedPermissions.tools) ? verifiedPermissions.tools : {};
|
|
2759
|
+
if (ZED_MCP_PERMISSION_KEYS.some((key) => !isRecord(verifiedTools[key]) || verifiedTools[key].default !== "allow")) {
|
|
2760
|
+
throw new Error("Generated Zed settings did not contain every exact Cadre MCP approval rule");
|
|
2761
|
+
}
|
|
2762
|
+
}
|
|
2763
|
+
const changed = serverChanged || permissionsChanged;
|
|
2764
|
+
if (changed) atomicWrite(settingsPath, proposed.endsWith("\n") ? proposed : `${proposed}
|
|
2765
|
+
`);
|
|
2766
|
+
return {
|
|
2767
|
+
path: settingsPath,
|
|
2768
|
+
changed,
|
|
2769
|
+
serverChanged,
|
|
2770
|
+
permissionsChanged,
|
|
2771
|
+
rule: `${ZED_MCP_PERMISSION_KEYS.length} exact Cadre MCP tools`
|
|
2772
|
+
};
|
|
2773
|
+
}
|
|
2774
|
+
function removeZedCadreServer(settingsPath, mcpPath) {
|
|
2775
|
+
if (!existsSync4(settingsPath)) return { changed: false, retainedConflict: false };
|
|
2776
|
+
const { existing, root } = parseJsoncSettings(settingsPath);
|
|
2777
|
+
const contextServers = assertRecordField(root, "context_servers", settingsPath);
|
|
2778
|
+
const currentServer = contextServers.cadre;
|
|
2779
|
+
if (currentServer === void 0) return { changed: false, retainedConflict: false };
|
|
2780
|
+
if (!zedServerTargetsMcp(currentServer, mcpPath)) {
|
|
2781
|
+
return { changed: false, retainedConflict: true };
|
|
2782
|
+
}
|
|
2783
|
+
const formattingOptions = { insertSpaces: true, tabSize: 2, eol: "\n" };
|
|
2784
|
+
const proposed = applyEdits(existing, modify(
|
|
2785
|
+
existing,
|
|
2786
|
+
["context_servers", "cadre"],
|
|
2787
|
+
void 0,
|
|
2788
|
+
{ formattingOptions }
|
|
2789
|
+
));
|
|
2790
|
+
atomicWrite(settingsPath, proposed.endsWith("\n") ? proposed : `${proposed}
|
|
2791
|
+
`);
|
|
2792
|
+
return { changed: true, retainedConflict: false };
|
|
2793
|
+
}
|
|
2520
2794
|
|
|
2521
2795
|
// scripts/install.ts
|
|
2522
2796
|
var marketplaceName = "cadre";
|
|
@@ -2537,7 +2811,7 @@ function parseInstallOptions(args) {
|
|
|
2537
2811
|
options.selection = parseClient(optionValue(args, index, arg));
|
|
2538
2812
|
index += 1;
|
|
2539
2813
|
} else if (arg === "--marketplace-root") {
|
|
2540
|
-
options.marketplaceRoot =
|
|
2814
|
+
options.marketplaceRoot = resolve5(optionValue(args, index, arg));
|
|
2541
2815
|
index += 1;
|
|
2542
2816
|
} else if (arg === "--home") {
|
|
2543
2817
|
options.marketplaceRoot = marketplaceFromHome(optionValue(args, index, arg));
|
|
@@ -2574,7 +2848,7 @@ function claudeMarketplaces() {
|
|
|
2574
2848
|
function replaceMarketplaceIfNeeded(client, existing, targetRoot, allowReplacement) {
|
|
2575
2849
|
if (!existing) return false;
|
|
2576
2850
|
const currentPath = marketplacePath(existing);
|
|
2577
|
-
if (currentPath &&
|
|
2851
|
+
if (currentPath && resolve5(currentPath) === targetRoot) return true;
|
|
2578
2852
|
if (!allowReplacement) {
|
|
2579
2853
|
throw new Error(
|
|
2580
2854
|
`${client} already has a ${marketplaceName} marketplace at ${currentPath ?? "an unknown path"}; review it and rerun with --replace-marketplace`
|
|
@@ -2594,8 +2868,8 @@ function installCodex(targetRoot, allowReplacement, autoApproveMcp) {
|
|
|
2594
2868
|
throw new Error(`Codex did not report ${pluginId} as installed and enabled`);
|
|
2595
2869
|
}
|
|
2596
2870
|
if (autoApproveMcp) {
|
|
2597
|
-
const codexRoot = process.env.CODEX_HOME ?
|
|
2598
|
-
const update = configureCodexMcpApproval(
|
|
2871
|
+
const codexRoot = process.env.CODEX_HOME ? resolve5(process.env.CODEX_HOME) : join5(homedir3(), ".codex");
|
|
2872
|
+
const update = configureCodexMcpApproval(join5(codexRoot, "config.toml"));
|
|
2599
2873
|
process.stdout.write(`${update.changed ? "Added" : "Retained"} Codex Cadre MCP approval in ${update.path}
|
|
2600
2874
|
`);
|
|
2601
2875
|
}
|
|
@@ -2616,31 +2890,41 @@ function installClaude(targetRoot, allowReplacement, autoApproveMcp) {
|
|
|
2616
2890
|
throw new Error(`Claude did not report ${pluginId} as installed and enabled`);
|
|
2617
2891
|
}
|
|
2618
2892
|
if (autoApproveMcp) {
|
|
2619
|
-
const claudeRoot = process.env.CLAUDE_HOME ?? process.env.CLAUDE_CONFIG_DIR ??
|
|
2620
|
-
const update = configureClaudeMcpApproval(
|
|
2893
|
+
const claudeRoot = process.env.CLAUDE_HOME ?? process.env.CLAUDE_CONFIG_DIR ?? join5(homedir3(), ".claude");
|
|
2894
|
+
const update = configureClaudeMcpApproval(join5(resolve5(claudeRoot), "settings.json"));
|
|
2621
2895
|
process.stdout.write(`${update.changed ? "Added" : "Retained"} Claude Cadre MCP approval in ${update.path}
|
|
2622
2896
|
`);
|
|
2623
2897
|
}
|
|
2624
2898
|
}
|
|
2899
|
+
function installZed(targetRoot, autoApproveMcp) {
|
|
2900
|
+
const pluginRoot = join5(targetRoot, "plugins", "cadre");
|
|
2901
|
+
const mcpPath = join5(pluginRoot, "dist", "cadre-mcp.mjs");
|
|
2902
|
+
const links = installZedSkillLinks(targetRoot);
|
|
2903
|
+
const update = configureZedCadre(zedSettingsPath(), resolve5(process.execPath), mcpPath, autoApproveMcp);
|
|
2904
|
+
process.stdout.write(`${update.changed ? "Updated" : "Retained"} Zed Cadre MCP configuration in ${update.path}
|
|
2905
|
+
`);
|
|
2906
|
+
process.stdout.write(`Installed ${links.length} Cadre workflow skill links for Zed Agent.
|
|
2907
|
+
`);
|
|
2908
|
+
}
|
|
2625
2909
|
function assertSafeTarget(targetRoot) {
|
|
2626
|
-
if (targetRoot === parse4(targetRoot).root || targetRoot ===
|
|
2910
|
+
if (targetRoot === parse4(targetRoot).root || targetRoot === resolve5(homedir3())) {
|
|
2627
2911
|
throw new Error(`refusing to use broad marketplace root ${targetRoot}`);
|
|
2628
2912
|
}
|
|
2629
2913
|
if (basename2(targetRoot) !== "cadre") throw new Error("marketplace root must end in a directory named cadre");
|
|
2630
2914
|
}
|
|
2631
2915
|
function prepareMarketplace(targetRoot, cachebuster) {
|
|
2632
|
-
const parent =
|
|
2633
|
-
|
|
2634
|
-
const stagingRoot = mkdtempSync(
|
|
2916
|
+
const parent = dirname5(targetRoot);
|
|
2917
|
+
mkdirSync4(parent, { recursive: true });
|
|
2918
|
+
const stagingRoot = mkdtempSync(join5(parent, ".cadre-staging-"));
|
|
2635
2919
|
const packaged = packagePluginMarketplace(stagingRoot, cachebuster ?? void 0);
|
|
2636
2920
|
let backupRoot = null;
|
|
2637
|
-
if (
|
|
2921
|
+
if (existsSync5(targetRoot)) {
|
|
2638
2922
|
const catalogs = [
|
|
2639
|
-
|
|
2640
|
-
|
|
2923
|
+
join5(targetRoot, ".agents", "plugins", "marketplace.json"),
|
|
2924
|
+
join5(targetRoot, ".claude-plugin", "marketplace.json")
|
|
2641
2925
|
];
|
|
2642
|
-
const owned = catalogs.every((path) =>
|
|
2643
|
-
if (!owned) throw new Error(`${targetRoot} exists but is not a Cadre
|
|
2926
|
+
const owned = catalogs.every((path) => existsSync5(path) && JSON.parse(readFileSync5(path, "utf8")).name === marketplaceName);
|
|
2927
|
+
if (!owned) throw new Error(`${targetRoot} exists but is not a Cadre marketplace payload`);
|
|
2644
2928
|
backupRoot = `${targetRoot}.backup-${Date.now()}`;
|
|
2645
2929
|
renameSync2(targetRoot, backupRoot);
|
|
2646
2930
|
}
|
|
@@ -2652,7 +2936,7 @@ function runInstall(args) {
|
|
|
2652
2936
|
assertSafeTarget(options.marketplaceRoot);
|
|
2653
2937
|
const clients = selectedClients(options.selection);
|
|
2654
2938
|
if (!options.prepareOnly && clients.length === 0) {
|
|
2655
|
-
throw new Error("No supported client detected. Install Codex or
|
|
2939
|
+
throw new Error("No supported client detected. Install Codex, Claude, or Zed, or pass --target codex|claude|zed|all");
|
|
2656
2940
|
}
|
|
2657
2941
|
for (const client of clients) {
|
|
2658
2942
|
if (!commandExists(client) && !options.prepareOnly && !options.dryRun) {
|
|
@@ -2662,10 +2946,14 @@ function runInstall(args) {
|
|
|
2662
2946
|
if (options.dryRun) {
|
|
2663
2947
|
process.stdout.write(`Would prepare Cadre marketplace at ${options.marketplaceRoot}
|
|
2664
2948
|
`);
|
|
2665
|
-
for (const client of clients)
|
|
2949
|
+
for (const client of clients) {
|
|
2950
|
+
const identity = client === "zed" ? "Cadre skills and MCP server" : pluginId;
|
|
2951
|
+
process.stdout.write(`Would install ${identity} for ${client} at user scope
|
|
2666
2952
|
`);
|
|
2953
|
+
}
|
|
2667
2954
|
return 0;
|
|
2668
2955
|
}
|
|
2956
|
+
if (!options.prepareOnly && clients.includes("zed")) preflightZedSkillLinks(options.marketplaceRoot);
|
|
2669
2957
|
const backupRoot = prepareMarketplace(options.marketplaceRoot, options.cachebuster);
|
|
2670
2958
|
process.stdout.write(`Prepared Cadre plugin marketplace at ${options.marketplaceRoot}
|
|
2671
2959
|
`);
|
|
@@ -2675,17 +2963,18 @@ function runInstall(args) {
|
|
|
2675
2963
|
const autoApproveMcp = !options.promptMcpTools;
|
|
2676
2964
|
for (const client of clients) {
|
|
2677
2965
|
if (client === "codex") installCodex(options.marketplaceRoot, options.replaceMarketplace, autoApproveMcp);
|
|
2678
|
-
else installClaude(options.marketplaceRoot, options.replaceMarketplace, autoApproveMcp);
|
|
2966
|
+
else if (client === "claude") installClaude(options.marketplaceRoot, options.replaceMarketplace, autoApproveMcp);
|
|
2967
|
+
else installZed(options.marketplaceRoot, autoApproveMcp);
|
|
2679
2968
|
}
|
|
2680
|
-
process.stdout.write(`Installed
|
|
2969
|
+
process.stdout.write(`Installed Cadre for ${clients.join(", ")}.
|
|
2681
2970
|
`);
|
|
2682
|
-
process.stdout.write("Start a new
|
|
2971
|
+
process.stdout.write("Start a new client conversation; in Claude Code, run /reload-plugins first.\n");
|
|
2683
2972
|
return 0;
|
|
2684
2973
|
}
|
|
2685
2974
|
|
|
2686
2975
|
// scripts/uninstall.ts
|
|
2687
|
-
import { existsSync as
|
|
2688
|
-
import { basename as basename3, dirname as
|
|
2976
|
+
import { existsSync as existsSync6, readFileSync as readFileSync6, readdirSync as readdirSync2, rmSync } from "node:fs";
|
|
2977
|
+
import { basename as basename3, dirname as dirname6, join as join6, resolve as resolve6 } from "node:path";
|
|
2689
2978
|
var marketplaceName2 = "cadre";
|
|
2690
2979
|
var pluginId2 = "cadre@cadre";
|
|
2691
2980
|
function parseUninstallOptions(args) {
|
|
@@ -2700,7 +2989,7 @@ function parseUninstallOptions(args) {
|
|
|
2700
2989
|
options.selection = parseClient(optionValue(args, index, arg));
|
|
2701
2990
|
index += 1;
|
|
2702
2991
|
} else if (arg === "--marketplace-root") {
|
|
2703
|
-
options.marketplaceRoot =
|
|
2992
|
+
options.marketplaceRoot = resolve6(optionValue(args, index, arg));
|
|
2704
2993
|
index += 1;
|
|
2705
2994
|
} else if (arg === "--home") {
|
|
2706
2995
|
options.marketplaceRoot = marketplaceFromHome(optionValue(args, index, arg));
|
|
@@ -2720,37 +3009,48 @@ function selectedClients2(selection) {
|
|
|
2720
3009
|
return [selection];
|
|
2721
3010
|
}
|
|
2722
3011
|
function ownedMarketplace(root) {
|
|
2723
|
-
if (!
|
|
3012
|
+
if (!existsSync6(root)) return false;
|
|
2724
3013
|
const catalogs = [
|
|
2725
|
-
|
|
2726
|
-
|
|
3014
|
+
join6(root, ".agents", "plugins", "marketplace.json"),
|
|
3015
|
+
join6(root, ".claude-plugin", "marketplace.json")
|
|
2727
3016
|
];
|
|
2728
3017
|
return catalogs.every((path) => {
|
|
2729
|
-
if (!
|
|
3018
|
+
if (!existsSync6(path)) return false;
|
|
2730
3019
|
try {
|
|
2731
|
-
return JSON.parse(
|
|
3020
|
+
return JSON.parse(readFileSync6(path, "utf8")).name === marketplaceName2;
|
|
2732
3021
|
} catch {
|
|
2733
3022
|
return false;
|
|
2734
3023
|
}
|
|
2735
3024
|
});
|
|
2736
3025
|
}
|
|
2737
|
-
function uninstallClient(client) {
|
|
3026
|
+
function uninstallClient(client, marketplaceRoot) {
|
|
2738
3027
|
if (client === "codex") {
|
|
2739
3028
|
runCommand("codex", ["plugin", "remove", pluginId2, "--json"]);
|
|
2740
3029
|
runCommand("codex", ["plugin", "marketplace", "remove", marketplaceName2]);
|
|
2741
|
-
} else {
|
|
3030
|
+
} else if (client === "claude") {
|
|
2742
3031
|
runCommand("claude", ["plugin", "uninstall", "--scope", "user", "--yes", pluginId2]);
|
|
2743
3032
|
runCommand("claude", ["plugin", "marketplace", "remove", "--scope", "user", marketplaceName2]);
|
|
3033
|
+
} else {
|
|
3034
|
+
const skills = removeZedSkillLinks(marketplaceRoot);
|
|
3035
|
+
const mcpPath = join6(marketplaceRoot, "plugins", "cadre", "dist", "cadre-mcp.mjs");
|
|
3036
|
+
const settings = removeZedCadreServer(zedSettingsPath(), mcpPath);
|
|
3037
|
+
if (skills.retained.length) {
|
|
3038
|
+
process.stderr.write(`Retained non-Cadre Zed skill paths: ${skills.retained.join(", ")}
|
|
3039
|
+
`);
|
|
3040
|
+
}
|
|
3041
|
+
if (settings.retainedConflict) {
|
|
3042
|
+
process.stderr.write("Retained Zed context_servers.cadre because it no longer matches the Cadre installation.\n");
|
|
3043
|
+
}
|
|
2744
3044
|
}
|
|
2745
3045
|
}
|
|
2746
3046
|
function removeOwnedMarketplaces(root) {
|
|
2747
3047
|
const removed = [];
|
|
2748
3048
|
const candidates = [root];
|
|
2749
|
-
const parent =
|
|
3049
|
+
const parent = dirname6(root);
|
|
2750
3050
|
const prefix = `${basename3(root)}.backup-`;
|
|
2751
|
-
if (
|
|
3051
|
+
if (existsSync6(parent)) {
|
|
2752
3052
|
for (const entry of readdirSync2(parent)) {
|
|
2753
|
-
if (entry.startsWith(prefix)) candidates.push(
|
|
3053
|
+
if (entry.startsWith(prefix)) candidates.push(join6(parent, entry));
|
|
2754
3054
|
}
|
|
2755
3055
|
}
|
|
2756
3056
|
for (const candidate of candidates) {
|
|
@@ -2764,22 +3064,25 @@ function runUninstall(args) {
|
|
|
2764
3064
|
const options = parseUninstallOptions(args);
|
|
2765
3065
|
const clients = selectedClients2(options.selection);
|
|
2766
3066
|
if (options.dryRun) {
|
|
2767
|
-
for (const client of clients)
|
|
3067
|
+
for (const client of clients) {
|
|
3068
|
+
const identity = client === "zed" ? "Cadre skills and MCP server" : pluginId2;
|
|
3069
|
+
process.stdout.write(`Would uninstall ${identity} from ${client} at user scope
|
|
2768
3070
|
`);
|
|
3071
|
+
}
|
|
2769
3072
|
if (options.selection === "all") process.stdout.write(`Would remove owned marketplace: ${options.marketplaceRoot}
|
|
2770
3073
|
`);
|
|
2771
3074
|
return 0;
|
|
2772
3075
|
}
|
|
2773
3076
|
let failed = false;
|
|
2774
3077
|
for (const client of clients) {
|
|
2775
|
-
if (!commandExists(client)) {
|
|
3078
|
+
if (client !== "zed" && !commandExists(client)) {
|
|
2776
3079
|
process.stderr.write(`${client} is not available; continuing local cleanup.
|
|
2777
3080
|
`);
|
|
2778
3081
|
continue;
|
|
2779
3082
|
}
|
|
2780
3083
|
try {
|
|
2781
|
-
uninstallClient(client);
|
|
2782
|
-
process.stdout.write(`Uninstalled
|
|
3084
|
+
uninstallClient(client, options.marketplaceRoot);
|
|
3085
|
+
process.stdout.write(`Uninstalled Cadre from ${client}.
|
|
2783
3086
|
`);
|
|
2784
3087
|
} catch (error) {
|
|
2785
3088
|
failed = true;
|
|
@@ -2792,7 +3095,7 @@ function runUninstall(args) {
|
|
|
2792
3095
|
if (removed.length) process.stdout.write(`Removed ${removed.join(", ")}
|
|
2793
3096
|
`);
|
|
2794
3097
|
else process.stdout.write("No owned Cadre marketplace files found to remove.\n");
|
|
2795
|
-
} else if (
|
|
3098
|
+
} else if (existsSync6(options.marketplaceRoot)) {
|
|
2796
3099
|
process.stdout.write(`Retained shared marketplace at ${options.marketplaceRoot} for other clients.
|
|
2797
3100
|
`);
|
|
2798
3101
|
}
|
|
@@ -2805,15 +3108,15 @@ function usage() {
|
|
|
2805
3108
|
"Cadre CLI",
|
|
2806
3109
|
"",
|
|
2807
3110
|
"Usage:",
|
|
2808
|
-
" cadre-ai install [--target auto|codex|claude|all] [--scope user] [--dry-run] [--replace-marketplace]",
|
|
2809
|
-
" cadre-ai uninstall [--target codex|claude|all] [--scope user] [--dry-run]",
|
|
3111
|
+
" cadre-ai install [--target auto|codex|claude|zed|all] [--scope user] [--dry-run] [--replace-marketplace]",
|
|
3112
|
+
" cadre-ai uninstall [--target codex|claude|zed|all] [--scope user] [--dry-run]",
|
|
2810
3113
|
" cadre-ai doctor",
|
|
2811
3114
|
" cadre-ai --version",
|
|
2812
3115
|
" cadre-ai help"
|
|
2813
3116
|
].join("\n");
|
|
2814
3117
|
}
|
|
2815
3118
|
function packageRoot() {
|
|
2816
|
-
return
|
|
3119
|
+
return resolve7(dirname7(fileURLToPath3(import.meta.url)), "..");
|
|
2817
3120
|
}
|
|
2818
3121
|
function runDoctor() {
|
|
2819
3122
|
const root = packageRoot();
|
|
@@ -2825,11 +3128,11 @@ function runDoctor() {
|
|
|
2825
3128
|
"skills",
|
|
2826
3129
|
"templates"
|
|
2827
3130
|
];
|
|
2828
|
-
const missing = required.filter((entry) => !
|
|
2829
|
-
const packageJson =
|
|
3131
|
+
const missing = required.filter((entry) => !existsSync7(join7(root, entry)));
|
|
3132
|
+
const packageJson = join7(root, "package.json");
|
|
2830
3133
|
let identity = `cadre-ai@${CADRE_RUNTIME_VERSION}`;
|
|
2831
|
-
if (
|
|
2832
|
-
const metadata = JSON.parse(
|
|
3134
|
+
if (existsSync7(packageJson)) {
|
|
3135
|
+
const metadata = JSON.parse(readFileSync7(packageJson, "utf8"));
|
|
2833
3136
|
identity = `${metadata.name ?? "cadre-ai"}@${metadata.version ?? CADRE_RUNTIME_VERSION}`;
|
|
2834
3137
|
}
|
|
2835
3138
|
process.stdout.write(`${identity}
|
package/dist/cadre-mcp.mjs
CHANGED
|
@@ -30997,8 +30997,8 @@ import { existsSync as existsSync5, lstatSync as lstatSync2, readFileSync as rea
|
|
|
30997
30997
|
import { isAbsolute, join as join3, relative, resolve as resolve5 } from "node:path";
|
|
30998
30998
|
|
|
30999
30999
|
// src/domain/version.ts
|
|
31000
|
-
var CADRE_RUNTIME_VERSION = "3.
|
|
31001
|
-
var LEGACY_RUNTIME_VERSIONS = ["3.3.0"];
|
|
31000
|
+
var CADRE_RUNTIME_VERSION = "3.5.0";
|
|
31001
|
+
var LEGACY_RUNTIME_VERSIONS = ["3.4.0", "3.3.0"];
|
|
31002
31002
|
var TEMPLATE_SET_VERSION = "v2";
|
|
31003
31003
|
var LEGACY_TEMPLATE_SET_VERSIONS = ["v1"];
|
|
31004
31004
|
|
|
@@ -34497,6 +34497,33 @@ var ProposalTokenStore = class {
|
|
|
34497
34497
|
}
|
|
34498
34498
|
};
|
|
34499
34499
|
|
|
34500
|
+
// src/mcp/tool-names.ts
|
|
34501
|
+
var CADRE_MCP_TOOLS = {
|
|
34502
|
+
workflowElicit: "workflow_elicit",
|
|
34503
|
+
templateGetMany: "template_get_many",
|
|
34504
|
+
styleguideResolve: "styleguide_resolve",
|
|
34505
|
+
projectStatus: "project_status",
|
|
34506
|
+
stateValidate: "state_validate",
|
|
34507
|
+
candidateStagePrepare: "candidate_stage_prepare",
|
|
34508
|
+
candidateInspect: "candidate_inspect",
|
|
34509
|
+
executionGraphValidate: "execution_graph_validate",
|
|
34510
|
+
reviewComplete: "review_complete",
|
|
34511
|
+
archiveBatchCandidate: "archive_batch_candidate",
|
|
34512
|
+
archiveBatchRecord: "archive_batch_record",
|
|
34513
|
+
executionStart: "execution_start",
|
|
34514
|
+
executionCheckpoint: "execution_checkpoint",
|
|
34515
|
+
executionStatus: "execution_status",
|
|
34516
|
+
executionFinish: "execution_finish",
|
|
34517
|
+
worktreeCreate: "worktree_create",
|
|
34518
|
+
integration: "integration",
|
|
34519
|
+
worktreeCleanup: "worktree_cleanup",
|
|
34520
|
+
projectInitCandidate: "project_init_candidate",
|
|
34521
|
+
setupRecordCommit: "setup_record_commit",
|
|
34522
|
+
setupRecordGitInitialized: "setup_record_git_initialized",
|
|
34523
|
+
tracksRender: "tracks_render"
|
|
34524
|
+
};
|
|
34525
|
+
var CADRE_MCP_TOOL_NAMES = Object.freeze(Object.values(CADRE_MCP_TOOLS));
|
|
34526
|
+
|
|
34500
34527
|
// src/mcp/server.ts
|
|
34501
34528
|
function result(value, summary = "Cadre operation completed.") {
|
|
34502
34529
|
return {
|
|
@@ -34504,9 +34531,16 @@ function result(value, summary = "Cadre operation completed.") {
|
|
|
34504
34531
|
structuredContent: value
|
|
34505
34532
|
};
|
|
34506
34533
|
}
|
|
34507
|
-
function templateResult(templates) {
|
|
34534
|
+
function templateResult(templates, contentMode) {
|
|
34508
34535
|
return {
|
|
34509
|
-
content: templates.map((template) => ({
|
|
34536
|
+
content: contentMode === "text" ? templates.map((template) => ({
|
|
34537
|
+
type: "text",
|
|
34538
|
+
text: [
|
|
34539
|
+
`<cadre-template id=${JSON.stringify(template.id)} uri=${JSON.stringify(template.uri)} mimeType=${JSON.stringify(template.mimeType)}>`,
|
|
34540
|
+
template.content,
|
|
34541
|
+
"</cadre-template>"
|
|
34542
|
+
].join("\n")
|
|
34543
|
+
})) : templates.map((template) => ({
|
|
34510
34544
|
type: "resource",
|
|
34511
34545
|
resource: {
|
|
34512
34546
|
uri: template.uri,
|
|
@@ -34702,7 +34736,7 @@ function createCadreServer() {
|
|
|
34702
34736
|
].join(" ")
|
|
34703
34737
|
}
|
|
34704
34738
|
);
|
|
34705
|
-
server.registerTool(
|
|
34739
|
+
server.registerTool(CADRE_MCP_TOOLS.workflowElicit, {
|
|
34706
34740
|
title: "Collect Cadre workflow input",
|
|
34707
34741
|
description: "Present one read-only Cadre approval or clarification form. Skip it under non-interactive host policy, bind approvals to an immutable digest or checkpoint, never request secrets, and use its chat fallback once.",
|
|
34708
34742
|
inputSchema: workflowElicitationInputSchema,
|
|
@@ -34735,19 +34769,22 @@ function createCadreServer() {
|
|
|
34735
34769
|
async () => ({ contents: [{ uri: template.uri, mimeType: template.mimeType, text: template.content }] })
|
|
34736
34770
|
);
|
|
34737
34771
|
}
|
|
34738
|
-
server.registerTool(
|
|
34772
|
+
server.registerTool(CADRE_MCP_TOOLS.templateGetMany, {
|
|
34739
34773
|
title: "Get multiple Cadre templates",
|
|
34740
|
-
description: "Read
|
|
34741
|
-
inputSchema: {
|
|
34774
|
+
description: "Read ordered immutable Cadre templates in one call.",
|
|
34775
|
+
inputSchema: {
|
|
34776
|
+
ids: external_exports.array(external_exports.enum(TEMPLATE_IDS)).min(1),
|
|
34777
|
+
contentMode: external_exports.enum(["embedded_resource", "text"]).optional().default("embedded_resource")
|
|
34778
|
+
},
|
|
34742
34779
|
annotations: { readOnlyHint: true, openWorldHint: false }
|
|
34743
|
-
}, async ({ ids }) => {
|
|
34780
|
+
}, async ({ ids, contentMode }) => {
|
|
34744
34781
|
try {
|
|
34745
|
-
return templateResult(getTemplates(ids).map(describeTemplate));
|
|
34782
|
+
return templateResult(getTemplates(ids).map(describeTemplate), contentMode);
|
|
34746
34783
|
} catch (error51) {
|
|
34747
34784
|
return failure(error51);
|
|
34748
34785
|
}
|
|
34749
34786
|
});
|
|
34750
|
-
server.registerTool(
|
|
34787
|
+
server.registerTool(CADRE_MCP_TOOLS.styleguideResolve, {
|
|
34751
34788
|
title: "Resolve default styleguides",
|
|
34752
34789
|
description: "Resolve the bundled idiomatic styleguides relevant to an approved technology list.",
|
|
34753
34790
|
inputSchema: { technologies: external_exports.array(external_exports.string()).min(1) },
|
|
@@ -34765,7 +34802,7 @@ function createCadreServer() {
|
|
|
34765
34802
|
return failure(error51);
|
|
34766
34803
|
}
|
|
34767
34804
|
});
|
|
34768
|
-
server.registerTool(
|
|
34805
|
+
server.registerTool(CADRE_MCP_TOOLS.projectStatus, {
|
|
34769
34806
|
title: "Read Cadre project status",
|
|
34770
34807
|
description: "Read compact project, focused track, or implementation status with embedded validation.",
|
|
34771
34808
|
inputSchema: {
|
|
@@ -34829,7 +34866,7 @@ function createCadreServer() {
|
|
|
34829
34866
|
return failure(error51);
|
|
34830
34867
|
}
|
|
34831
34868
|
});
|
|
34832
|
-
server.registerTool(
|
|
34869
|
+
server.registerTool(CADRE_MCP_TOOLS.stateValidate, {
|
|
34833
34870
|
title: "Validate Cadre project state",
|
|
34834
34871
|
description: "Validate Cadre project invariants and return all discovered tracks and errors.",
|
|
34835
34872
|
inputSchema: { projectRoot: external_exports.string().min(1) },
|
|
@@ -34841,7 +34878,7 @@ function createCadreServer() {
|
|
|
34841
34878
|
return failure(error51);
|
|
34842
34879
|
}
|
|
34843
34880
|
});
|
|
34844
|
-
server.registerTool(
|
|
34881
|
+
server.registerTool(CADRE_MCP_TOOLS.candidateStagePrepare, {
|
|
34845
34882
|
title: "Prepare a Cadre candidate stage",
|
|
34846
34883
|
description: "Create or resume one project-local candidate directory and ensure /stage/ is ignored by Git.",
|
|
34847
34884
|
inputSchema: {
|
|
@@ -34856,7 +34893,7 @@ function createCadreServer() {
|
|
|
34856
34893
|
return failure(error51);
|
|
34857
34894
|
}
|
|
34858
34895
|
});
|
|
34859
|
-
server.registerTool(
|
|
34896
|
+
server.registerTool(CADRE_MCP_TOOLS.candidateInspect, {
|
|
34860
34897
|
title: "Inspect staged artifact candidates",
|
|
34861
34898
|
description: "Manifest an exact staged file set and optionally validate its plan graph in one read-only call.",
|
|
34862
34899
|
inputSchema: {
|
|
@@ -34900,7 +34937,7 @@ function createCadreServer() {
|
|
|
34900
34937
|
return failure(error51);
|
|
34901
34938
|
}
|
|
34902
34939
|
});
|
|
34903
|
-
server.registerTool(
|
|
34940
|
+
server.registerTool(CADRE_MCP_TOOLS.executionGraphValidate, {
|
|
34904
34941
|
title: "Validate a track execution graph",
|
|
34905
34942
|
description: "Compile and validate phase/task dependencies and derived manual-verification barriers from an approved plan.",
|
|
34906
34943
|
inputSchema: { projectRoot: external_exports.string().min(1), trackId: external_exports.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/) },
|
|
@@ -34926,7 +34963,7 @@ function createCadreServer() {
|
|
|
34926
34963
|
approval: external_exports.string().min(1),
|
|
34927
34964
|
acceptedRisks: external_exports.array(external_exports.string().min(1)).optional()
|
|
34928
34965
|
};
|
|
34929
|
-
server.registerTool(
|
|
34966
|
+
server.registerTool(CADRE_MCP_TOOLS.reviewComplete, {
|
|
34930
34967
|
title: "Complete a clean review",
|
|
34931
34968
|
description: "Prepare the exact clean-review completion for human approval, or apply its unchanged proposal token after approval.",
|
|
34932
34969
|
inputSchema: adaptiveInputSchema(reviewCompleteSchema),
|
|
@@ -34986,7 +35023,7 @@ function createCadreServer() {
|
|
|
34986
35023
|
selectedTracks: external_exports.array(external_exports.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/)).min(1).optional(),
|
|
34987
35024
|
updates: external_exports.array(archiveCandidateUpdateSchema)
|
|
34988
35025
|
};
|
|
34989
|
-
server.registerTool(
|
|
35026
|
+
server.registerTool(CADRE_MCP_TOOLS.archiveBatchCandidate, {
|
|
34990
35027
|
title: "Govern a staged archive batch",
|
|
34991
35028
|
description: "Prepare a staged archive batch for human approval, or apply its unchanged proposal token after approval.",
|
|
34992
35029
|
inputSchema: adaptiveInputSchema(archiveBatchCandidateSchema),
|
|
@@ -35046,7 +35083,7 @@ function createCadreServer() {
|
|
|
35046
35083
|
projectRoot: external_exports.string().min(1),
|
|
35047
35084
|
batchId: external_exports.string().regex(/^archive-[0-9A-Za-z]+(?:-[0-9A-Za-z]+)*$/)
|
|
35048
35085
|
};
|
|
35049
|
-
server.registerTool(
|
|
35086
|
+
server.registerTool(CADRE_MCP_TOOLS.archiveBatchRecord, {
|
|
35050
35087
|
title: "Record archive provenance",
|
|
35051
35088
|
description: "Atomically validate and record the already-authorized archive commit in track, project, and batch state.",
|
|
35052
35089
|
inputSchema: archiveRecordSchema,
|
|
@@ -35079,7 +35116,7 @@ function createCadreServer() {
|
|
|
35079
35116
|
approvalMode: external_exports.enum(EXECUTION_APPROVAL_MODES).optional(),
|
|
35080
35117
|
maxWorkers: external_exports.number().int().min(1).max(32).optional().default(3)
|
|
35081
35118
|
};
|
|
35082
|
-
server.registerTool(
|
|
35119
|
+
server.registerTool(CADRE_MCP_TOOLS.executionStart, {
|
|
35083
35120
|
title: "Start implementation execution",
|
|
35084
35121
|
description: "Atomically validate and start the implementation execution already authorized by the implement invocation.",
|
|
35085
35122
|
inputSchema: executionStartSchema,
|
|
@@ -35127,7 +35164,7 @@ function createCadreServer() {
|
|
|
35127
35164
|
authorization: external_exports.string().min(1).optional(),
|
|
35128
35165
|
blocker: external_exports.string().min(1).optional()
|
|
35129
35166
|
};
|
|
35130
|
-
server.registerTool(
|
|
35167
|
+
server.registerTool(CADRE_MCP_TOOLS.executionCheckpoint, {
|
|
35131
35168
|
title: "Apply an execution checkpoint",
|
|
35132
35169
|
description: "Atomically validate and apply one already-authorized semantic execution event.",
|
|
35133
35170
|
inputSchema: executionCheckpointSchema,
|
|
@@ -35148,7 +35185,7 @@ function createCadreServer() {
|
|
|
35148
35185
|
return failure(error51);
|
|
35149
35186
|
}
|
|
35150
35187
|
});
|
|
35151
|
-
server.registerTool(
|
|
35188
|
+
server.registerTool(CADRE_MCP_TOOLS.executionStatus, {
|
|
35152
35189
|
title: "Read implementation execution status",
|
|
35153
35190
|
description: "Read an execution journal and derive ready, active, and blocked DAG nodes.",
|
|
35154
35191
|
inputSchema: {
|
|
@@ -35171,7 +35208,7 @@ function createCadreServer() {
|
|
|
35171
35208
|
trackId: external_exports.string().regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/),
|
|
35172
35209
|
executionId: external_exports.string().regex(/^[0-9A-Za-z]+(?:-[0-9A-Za-z]+)*$/)
|
|
35173
35210
|
};
|
|
35174
|
-
server.registerTool(
|
|
35211
|
+
server.registerTool(CADRE_MCP_TOOLS.executionFinish, {
|
|
35175
35212
|
title: "Complete implementation execution",
|
|
35176
35213
|
description: "Atomically verify and finalize an execution after its required manual verification is already recorded.",
|
|
35177
35214
|
inputSchema: executionFinishSchema,
|
|
@@ -35202,7 +35239,7 @@ function createCadreServer() {
|
|
|
35202
35239
|
executionId: external_exports.string().regex(/^[0-9A-Za-z]+(?:-[0-9A-Za-z]+)*$/),
|
|
35203
35240
|
nodeId: external_exports.string().regex(/^(?:P\d+|T\d+\.\d+)$/)
|
|
35204
35241
|
};
|
|
35205
|
-
server.registerTool(
|
|
35242
|
+
server.registerTool(CADRE_MCP_TOOLS.worktreeCreate, {
|
|
35206
35243
|
title: "Create a Cadre worker worktree",
|
|
35207
35244
|
description: "Atomically validate and create or reconcile one already-authorized constrained worker worktree.",
|
|
35208
35245
|
inputSchema: worktreeSchema,
|
|
@@ -35229,7 +35266,7 @@ function createCadreServer() {
|
|
|
35229
35266
|
return failure(error51);
|
|
35230
35267
|
}
|
|
35231
35268
|
});
|
|
35232
|
-
server.registerTool(
|
|
35269
|
+
server.registerTool(CADRE_MCP_TOOLS.integration, {
|
|
35233
35270
|
title: "Integrate a worker branch",
|
|
35234
35271
|
description: "Atomically merge in phase/autonomous mode; in governed mode return approval_required first, then accept the unchanged proposal token after human approval.",
|
|
35235
35272
|
inputSchema: adaptiveInputSchema(worktreeSchema),
|
|
@@ -35265,7 +35302,7 @@ function createCadreServer() {
|
|
|
35265
35302
|
return failure(error51);
|
|
35266
35303
|
}
|
|
35267
35304
|
});
|
|
35268
|
-
server.registerTool(
|
|
35305
|
+
server.registerTool(CADRE_MCP_TOOLS.worktreeCleanup, {
|
|
35269
35306
|
title: "Clean up an integrated worker",
|
|
35270
35307
|
description: "Atomically verify and remove only a clean, fully integrated Cadre worktree and safely deletable branch.",
|
|
35271
35308
|
inputSchema: worktreeSchema,
|
|
@@ -35298,7 +35335,7 @@ function createCadreServer() {
|
|
|
35298
35335
|
stagedFiles: external_exports.array(external_exports.string().min(1)).min(3),
|
|
35299
35336
|
styleguideIds: external_exports.array(external_exports.string().min(1)).min(1)
|
|
35300
35337
|
};
|
|
35301
|
-
server.registerTool(
|
|
35338
|
+
server.registerTool(CADRE_MCP_TOOLS.projectInitCandidate, {
|
|
35302
35339
|
title: "Initialize from a staged Cadre candidate",
|
|
35303
35340
|
description: "Prepare staged initialization for human approval, or atomically promote its unchanged proposal token after approval.",
|
|
35304
35341
|
inputSchema: adaptiveInputSchema(initCandidateSchema),
|
|
@@ -35346,7 +35383,7 @@ function createCadreServer() {
|
|
|
35346
35383
|
return failure(error51);
|
|
35347
35384
|
}
|
|
35348
35385
|
});
|
|
35349
|
-
server.registerTool(
|
|
35386
|
+
server.registerTool(CADRE_MCP_TOOLS.setupRecordCommit, {
|
|
35350
35387
|
title: "Record the project setup commit",
|
|
35351
35388
|
description: "Complete a pending create operation by recording its already-created Git commit SHA.",
|
|
35352
35389
|
inputSchema: { projectRoot: external_exports.string().min(1) },
|
|
@@ -35360,7 +35397,7 @@ function createCadreServer() {
|
|
|
35360
35397
|
return failure(error51);
|
|
35361
35398
|
}
|
|
35362
35399
|
});
|
|
35363
|
-
server.registerTool(
|
|
35400
|
+
server.registerTool(CADRE_MCP_TOOLS.setupRecordGitInitialized, {
|
|
35364
35401
|
title: "Record Git initialization checkpoint",
|
|
35365
35402
|
description: "Advance an approved create operation after the caller verifies Git was initialized at the exact project root.",
|
|
35366
35403
|
inputSchema: { projectRoot: external_exports.string().min(1) },
|
|
@@ -35373,7 +35410,7 @@ function createCadreServer() {
|
|
|
35373
35410
|
return failure(error51);
|
|
35374
35411
|
}
|
|
35375
35412
|
});
|
|
35376
|
-
server.registerTool(
|
|
35413
|
+
server.registerTool(CADRE_MCP_TOOLS.tracksRender, {
|
|
35377
35414
|
title: "Render the derived tracks index",
|
|
35378
35415
|
description: "Atomically validate and rewrite deterministic tracks.md from current track-local state.",
|
|
35379
35416
|
inputSchema: { projectRoot: external_exports.string().min(1) },
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cadre-ai",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "Cross-agent, human-governed software delivery harness",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Vishal Kumar",
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
"agent-workflows",
|
|
20
20
|
"mcp",
|
|
21
21
|
"codex",
|
|
22
|
-
"claude"
|
|
22
|
+
"claude",
|
|
23
|
+
"zed"
|
|
23
24
|
],
|
|
24
25
|
"type": "module",
|
|
25
26
|
"packageManager": "pnpm@11.4.0",
|