@zmice/zc 0.2.5 → 0.2.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +98 -11
- package/dist/cli/__tests__/platform.test.js +215 -2
- package/dist/cli/__tests__/platform.test.js.map +1 -1
- package/dist/cli/__tests__/surface.test.js +52 -0
- package/dist/cli/__tests__/surface.test.js.map +1 -1
- package/dist/cli/__tests__/team.test.d.ts +2 -0
- package/dist/cli/__tests__/team.test.d.ts.map +1 -0
- package/dist/cli/__tests__/team.test.js +29 -0
- package/dist/cli/__tests__/team.test.js.map +1 -0
- package/dist/cli/__tests__/upstream.test.js +4 -0
- package/dist/cli/__tests__/upstream.test.js.map +1 -1
- package/dist/cli/platform.d.ts +11 -3
- package/dist/cli/platform.d.ts.map +1 -1
- package/dist/cli/platform.js +216 -54
- package/dist/cli/platform.js.map +1 -1
- package/dist/cli/team.d.ts.map +1 -1
- package/dist/cli/team.js +114 -4
- package/dist/cli/team.js.map +1 -1
- package/dist/cli/upstream.d.ts +1 -0
- package/dist/cli/upstream.d.ts.map +1 -1
- package/dist/cli/upstream.js +84 -5
- package/dist/cli/upstream.js.map +1 -1
- package/dist/node_modules/@zmice/platform-core/dist/index.d.ts +37 -3
- package/dist/node_modules/@zmice/platform-core/dist/index.d.ts.map +1 -1
- package/dist/node_modules/@zmice/platform-core/dist/index.js +68 -0
- package/dist/node_modules/@zmice/platform-core/dist/index.js.map +1 -1
- package/dist/node_modules/@zmice/platform-core/dist/index.test.js +44 -1
- package/dist/node_modules/@zmice/platform-core/dist/index.test.js.map +1 -1
- package/dist/runtime/__tests__/worktree-manager.test.js +63 -1
- package/dist/runtime/__tests__/worktree-manager.test.js.map +1 -1
- package/dist/runtime/worktree-manager.d.ts +26 -1
- package/dist/runtime/worktree-manager.d.ts.map +1 -1
- package/dist/runtime/worktree-manager.js +126 -12
- package/dist/runtime/worktree-manager.js.map +1 -1
- package/dist/team/__tests__/orchestrator.test.js +40 -0
- package/dist/team/__tests__/orchestrator.test.js.map +1 -1
- package/dist/team/__tests__/planner.test.d.ts +2 -0
- package/dist/team/__tests__/planner.test.d.ts.map +1 -0
- package/dist/team/__tests__/planner.test.js +43 -0
- package/dist/team/__tests__/planner.test.js.map +1 -0
- package/dist/team/__tests__/task-queue.test.js +18 -0
- package/dist/team/__tests__/task-queue.test.js.map +1 -1
- package/dist/team/orchestrator.d.ts +2 -1
- package/dist/team/orchestrator.d.ts.map +1 -1
- package/dist/team/orchestrator.js +29 -10
- package/dist/team/orchestrator.js.map +1 -1
- package/dist/team/planner.d.ts +27 -0
- package/dist/team/planner.d.ts.map +1 -0
- package/dist/team/planner.js +120 -0
- package/dist/team/planner.js.map +1 -0
- package/dist/team/task-queue.d.ts +3 -0
- package/dist/team/task-queue.d.ts.map +1 -1
- package/dist/team/task-queue.js +11 -2
- package/dist/team/task-queue.js.map +1 -1
- package/package.json +2 -2
- package/vendor/node_modules/@zmice/platform-core/dist/index.d.ts +37 -3
- package/vendor/node_modules/@zmice/platform-core/dist/index.d.ts.map +1 -1
- package/vendor/node_modules/@zmice/platform-core/dist/index.js +68 -0
- package/vendor/node_modules/@zmice/platform-core/dist/index.js.map +1 -1
- package/vendor/node_modules/@zmice/platform-core/dist/index.test.js +44 -1
- package/vendor/node_modules/@zmice/platform-core/dist/index.test.js.map +1 -1
- package/vendor/packages/platform-claude/dist/index.d.ts.map +1 -1
- package/vendor/packages/platform-claude/dist/index.js +12 -70
- package/vendor/packages/platform-claude/dist/index.js.map +1 -1
- package/vendor/packages/platform-codex/dist/generate.d.ts +1 -1
- package/vendor/packages/platform-codex/dist/generate.d.ts.map +1 -1
- package/vendor/packages/platform-codex/dist/generate.js +1 -1
- package/vendor/packages/platform-codex/dist/generate.js.map +1 -1
- package/vendor/packages/platform-codex/dist/index.d.ts +15 -1
- package/vendor/packages/platform-codex/dist/index.d.ts.map +1 -1
- package/vendor/packages/platform-codex/dist/index.js +320 -47
- package/vendor/packages/platform-codex/dist/index.js.map +1 -1
- package/vendor/packages/platform-codex/dist/index.test.js +113 -5
- package/vendor/packages/platform-codex/dist/index.test.js.map +1 -1
- package/vendor/packages/platform-opencode/dist/index.d.ts.map +1 -1
- package/vendor/packages/platform-opencode/dist/index.js +15 -81
- package/vendor/packages/platform-opencode/dist/index.js.map +1 -1
- package/vendor/packages/platform-qwen/dist/index.d.ts.map +1 -1
- package/vendor/packages/platform-qwen/dist/index.js +28 -84
- package/vendor/packages/platform-qwen/dist/index.js.map +1 -1
- package/vendor/packages/toolkit/src/content/agents/architect/body.md +8 -0
- package/vendor/packages/toolkit/src/content/agents/code-reviewer/body.md +10 -0
- package/vendor/packages/toolkit/src/content/agents/product-owner/body.md +8 -0
- package/vendor/packages/toolkit/src/content/commands/plan-review/body.md +3 -1
- package/vendor/packages/toolkit/src/content/commands/start/body.md +51 -2
- package/vendor/packages/toolkit/src/content/commands/start/meta.yaml +2 -2
- package/vendor/packages/toolkit/src/content/skills/branch-finish-and-cleanup/body.md +17 -0
- package/vendor/packages/toolkit/src/content/skills/browser-qa-testing/body.md +77 -520
- package/vendor/packages/toolkit/src/content/skills/ci-cd-and-automation/body.md +56 -387
- package/vendor/packages/toolkit/src/content/skills/code-review-and-quality/body.md +10 -0
- package/vendor/packages/toolkit/src/content/skills/code-simplification/body.md +55 -301
- package/vendor/packages/toolkit/src/content/skills/context-engineering/body.md +10 -0
- package/vendor/packages/toolkit/src/content/skills/continuous-learning/body.md +66 -331
- package/vendor/packages/toolkit/src/content/skills/multi-perspective-review/body.md +30 -1
- package/vendor/packages/toolkit/src/content/skills/parallel-agent-dispatch/body.md +79 -317
- package/vendor/packages/toolkit/src/content/skills/performance-optimization/body.md +60 -330
- package/vendor/packages/toolkit/src/content/skills/planning-and-task-breakdown/body.md +35 -0
- package/vendor/packages/toolkit/src/content/skills/sdd-tdd-workflow/body.md +66 -342
- package/vendor/packages/toolkit/src/content/skills/sprint-retrospective/body.md +66 -303
- package/vendor/packages/toolkit/src/content/skills/team-orchestration/body.md +81 -327
- package/vendor/packages/toolkit/src/content/skills/test-driven-development/body.md +50 -346
- package/vendor/packages/toolkit/src/content/skills/using-agent-skills/body.md +26 -2
- package/vendor/references/upstreams.yaml +5 -0
|
@@ -15,6 +15,58 @@ describe("zc command surface", () => {
|
|
|
15
15
|
expect(names).not.toContain("runtime");
|
|
16
16
|
expect(names).not.toContain("setup");
|
|
17
17
|
});
|
|
18
|
+
it("keeps platform lifecycle aliases consistent", () => {
|
|
19
|
+
const program = createProgram();
|
|
20
|
+
const platform = program.commands.find((command) => command.name() === "platform");
|
|
21
|
+
expect(platform).toBeDefined();
|
|
22
|
+
const aliasesByCommand = Object.fromEntries(platform.commands.map((command) => [command.name(), command.aliases()]));
|
|
23
|
+
expect(aliasesByCommand).toMatchObject({
|
|
24
|
+
generate: ["g"],
|
|
25
|
+
plugin: ["p"],
|
|
26
|
+
install: ["i"],
|
|
27
|
+
where: ["w"],
|
|
28
|
+
status: ["s"],
|
|
29
|
+
update: ["u"],
|
|
30
|
+
uninstall: ["remove"],
|
|
31
|
+
repair: ["fix"],
|
|
32
|
+
doctor: ["check"],
|
|
33
|
+
});
|
|
34
|
+
});
|
|
35
|
+
it("keeps platform target selector options aligned", () => {
|
|
36
|
+
const program = createProgram();
|
|
37
|
+
const platform = program.commands.find((command) => command.name() === "platform");
|
|
38
|
+
expect(platform).toBeDefined();
|
|
39
|
+
const optionFlagsByCommand = Object.fromEntries(platform.commands.map((command) => [
|
|
40
|
+
command.name(),
|
|
41
|
+
command.options.map((option) => option.flags),
|
|
42
|
+
]));
|
|
43
|
+
for (const commandName of [
|
|
44
|
+
"generate",
|
|
45
|
+
"plugin",
|
|
46
|
+
"install",
|
|
47
|
+
"where",
|
|
48
|
+
"status",
|
|
49
|
+
"update",
|
|
50
|
+
"uninstall",
|
|
51
|
+
"repair",
|
|
52
|
+
"doctor",
|
|
53
|
+
]) {
|
|
54
|
+
expect(optionFlagsByCommand[commandName]?.slice(0, 3)).toEqual([
|
|
55
|
+
"-d, --dir <dir>",
|
|
56
|
+
"-p, --project",
|
|
57
|
+
"-g, --global",
|
|
58
|
+
]);
|
|
59
|
+
}
|
|
60
|
+
expect(optionFlagsByCommand.generate).toEqual([
|
|
61
|
+
"-d, --dir <dir>",
|
|
62
|
+
"-p, --project",
|
|
63
|
+
"-g, --global",
|
|
64
|
+
"-b, --bundle <type>",
|
|
65
|
+
"--plan",
|
|
66
|
+
"-j, --json",
|
|
67
|
+
"-f, --force",
|
|
68
|
+
]);
|
|
69
|
+
});
|
|
18
70
|
it("treats a symlinked bin path as direct execution", () => {
|
|
19
71
|
const tempRoot = mkdtempSync(join(tmpdir(), "zc-symlink-"));
|
|
20
72
|
const target = join(tempRoot, "index.js");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"surface.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/surface.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAClE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAW,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE/D,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,EAAE,CAAC,kDAAkD,EAAE,GAAG,EAAE;QAC1D,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;QAChC,MAAM,KAAK,GAAG,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAEhE,MAAM,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,KAAK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QAAQ;SACT,EAAE,CAAC;YACF,MAAM,CAAC,oBAAoB,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;gBAC7D,iBAAiB;gBACjB,eAAe;gBACf,cAAc;aACf,CAAC,CAAC;QACL,CAAC;QAED,MAAM,CAAC,oBAAoB,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;YAC5C,iBAAiB;YACjB,eAAe;YACf,cAAc;YACd,qBAAqB;YACrB,QAAQ;YACR,YAAY;YACZ,aAAa;SACd,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACzD,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,CAAC,MAAM,EAAE,EAAE,aAAa,CAAC,CAAC,CAAC;QAC5D,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC,CAAC;QAC1C,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC;QAEtC,aAAa,CAAC,MAAM,EAAE,sBAAsB,EAAE,MAAM,CAAC,CAAC;QACtD,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;QAE9B,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7E,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.test.d.ts","sourceRoot":"","sources":["../../../src/cli/__tests__/team.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { describe, expect, it, vi, afterEach } from "vitest";
|
|
2
|
+
import { createProgram } from "../index.js";
|
|
3
|
+
describe("team CLI", () => {
|
|
4
|
+
afterEach(() => {
|
|
5
|
+
vi.restoreAllMocks();
|
|
6
|
+
process.exitCode = undefined;
|
|
7
|
+
});
|
|
8
|
+
it("prints a dry-run team plan without starting runtime", async () => {
|
|
9
|
+
const output = [];
|
|
10
|
+
vi.spyOn(console, "log").mockImplementation((message) => {
|
|
11
|
+
output.push(String(message));
|
|
12
|
+
});
|
|
13
|
+
const program = createProgram();
|
|
14
|
+
await program.parseAsync([
|
|
15
|
+
"node",
|
|
16
|
+
"zc",
|
|
17
|
+
"team",
|
|
18
|
+
"plan",
|
|
19
|
+
"--tasks",
|
|
20
|
+
"API | files=src/api.ts",
|
|
21
|
+
"UI | files=src/ui.ts",
|
|
22
|
+
"--json",
|
|
23
|
+
]);
|
|
24
|
+
const plan = JSON.parse(output.join("\n"));
|
|
25
|
+
expect(plan.canStart).toBe(true);
|
|
26
|
+
expect(plan.tasks).toHaveLength(2);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
//# sourceMappingURL=team.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"team.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/team.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,QAAQ,CAAC;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,QAAQ,CAAC,UAAU,EAAE,GAAG,EAAE;IACxB,SAAS,CAAC,GAAG,EAAE;QACb,EAAE,CAAC,eAAe,EAAE,CAAC;QACrB,OAAO,CAAC,QAAQ,GAAG,SAAS,CAAC;IAC/B,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,MAAM,GAAa,EAAE,CAAC;QAC5B,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAAC,OAAiB,EAAE,EAAE;YAChE,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;QAEH,MAAM,OAAO,GAAG,aAAa,EAAE,CAAC;QAChC,MAAM,OAAO,CAAC,UAAU,CAAC;YACvB,MAAM;YACN,IAAI;YACJ,MAAM;YACN,MAAM;YACN,SAAS;YACT,wBAAwB;YACxB,sBAAsB;YACtB,QAAQ;SACT,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAA4C,CAAC;QACtF,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACjC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;IACrC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -86,6 +86,9 @@ describe("upstream governance commands", () => {
|
|
|
86
86
|
expect(result.stdout).toContain("## Summary");
|
|
87
87
|
expect(result.stdout).toContain("## Evidence");
|
|
88
88
|
expect(result.stdout).toContain("## Decision");
|
|
89
|
+
expect(result.stdout).toContain("source url");
|
|
90
|
+
expect(result.stdout).toContain("https://github.com/addyosmani/agent-skills.git");
|
|
91
|
+
expect(result.stdout).toContain("remote_head: 未采集");
|
|
89
92
|
expect(result.stdout).toContain("`pending-manual-review`");
|
|
90
93
|
expect(result.stdout).toContain("人工审阅");
|
|
91
94
|
});
|
|
@@ -101,6 +104,7 @@ describe("upstream governance commands", () => {
|
|
|
101
104
|
expect(payload.upstream).toBe("agent-skills");
|
|
102
105
|
expect(payload.label).toBe(label);
|
|
103
106
|
expect(payload.metadata.status).toBe("active");
|
|
107
|
+
expect(payload.metadata.source_url).toBe("https://github.com/addyosmani/agent-skills.git");
|
|
104
108
|
}, 15000);
|
|
105
109
|
it("report --output 会把 Markdown 审阅材料写入文件", async () => {
|
|
106
110
|
const outputDir = join(tmpdir(), "ai-coding-upstream-report");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upstream.test.js","sourceRoot":"","sources":["../../../src/cli/__tests__/upstream.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,qBAAqB,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAE/E,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;AACvC,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,iBAAiB,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAEjF,KAAK,UAAU,MAAM,CAAC,IAAc;IAClC,MAAM,WAAW,GAAa,EAAE,CAAC;IACjC,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,MAAM,MAAM,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,kBAAkB,CAAC,CAAC,GAAG,KAAgB,EAAE,EAAE;QACjF,WAAW,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IACH,MAAM,QAAQ,GAAG,EAAE,CAAC,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,kBAAkB,CAAC,CAAC,GAAG,KAAgB,EAAE,EAAE;QACrF,WAAW,CAAC,IAAI,CAAC,KA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C,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnC,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/dist/cli/platform.d.ts
CHANGED
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
type PlatformName = "qwen" | "codex" | "claude" | "opencode";
|
|
3
|
-
type PlatformGenerateBundleType = "release-bundle";
|
|
3
|
+
type PlatformGenerateBundleType = "release-bundle" | "codex-plugin" | "codex-marketplace";
|
|
4
4
|
type PlatformTargetSelectorOpts = {
|
|
5
5
|
dir?: string;
|
|
6
6
|
project?: boolean;
|
|
7
7
|
global?: boolean;
|
|
8
8
|
};
|
|
9
|
-
|
|
10
|
-
dir?: string;
|
|
9
|
+
type PlatformGenerateOpts = PlatformTargetSelectorOpts & {
|
|
11
10
|
force?: boolean;
|
|
12
11
|
plan?: boolean;
|
|
13
12
|
json?: boolean;
|
|
14
13
|
bundle?: PlatformGenerateBundleType;
|
|
14
|
+
};
|
|
15
|
+
export declare function runPlatformGenerate(target: PlatformName, opts: PlatformGenerateOpts): Promise<void>;
|
|
16
|
+
export declare function runPlatformPlugin(target: PlatformName, opts: {
|
|
17
|
+
dir?: string;
|
|
18
|
+
project?: boolean;
|
|
19
|
+
global?: boolean;
|
|
20
|
+
force?: boolean;
|
|
21
|
+
plan?: boolean;
|
|
22
|
+
json?: boolean;
|
|
15
23
|
}): Promise<void>;
|
|
16
24
|
export declare function runPlatformInstall(target: PlatformName, opts: PlatformTargetSelectorOpts & {
|
|
17
25
|
force?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/cli/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAwB,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"platform.d.ts","sourceRoot":"","sources":["../../src/cli/platform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,O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|
|
2
2
|
import { readFileSync } from "node:fs";
|
|
3
|
-
import {
|
|
3
|
+
import { homedir } from "node:os";
|
|
4
|
+
import { dirname, isAbsolute, join, resolve } from "node:path";
|
|
4
5
|
import { attachPlanMetadata } from "@zmice/platform-core";
|
|
5
6
|
import { resolvePlatformInstallDoctor } from "../platform-state/doctor.js";
|
|
6
7
|
import { resolvePlatformInstallStatus } from "../platform-state/status.js";
|
|
@@ -10,7 +11,8 @@ import { pathExists, removeManagedPaths } from "../utils/platform-install-cleanu
|
|
|
10
11
|
import { ArtifactConflictError, importWorkspaceDistModule, resolveWorkspacePath, writeArtifacts, } from "../utils/workspace.js";
|
|
11
12
|
import { QwenOfficialCliUnavailableError, installQwenExtensionFromOfficialRepoWithCli, installQwenExtensionWithOfficialCli, qwenOfficialExtensionRepoUrl, relinkQwenExtensionWithOfficialCli, resolveQwenOfficialCliReleaseBundleDir, syncQwenOfficialCliReleaseBundle, toQwenOfficialCliReleaseArtifacts, uninstallQwenExtensionWithOfficialCli, updateQwenExtensionWithOfficialCli, } from "../utils/qwen-extension-cli.js";
|
|
12
13
|
const platformNames = ["qwen", "codex", "claude", "opencode"];
|
|
13
|
-
|
|
14
|
+
const codexPluginManifestPath = ".codex-plugin/plugin.json";
|
|
15
|
+
function getPlanCapabilitySummary(plan, metadata) {
|
|
14
16
|
const capability = plan.capability;
|
|
15
17
|
if (!capability) {
|
|
16
18
|
return null;
|
|
@@ -18,6 +20,17 @@ function getPlanCapabilitySummary(plan) {
|
|
|
18
20
|
const exposure = (() => {
|
|
19
21
|
switch (plan.platform) {
|
|
20
22
|
case "codex":
|
|
23
|
+
if (metadata?.bundleType === "codex-plugin" || metadata?.bundleType === "codex-marketplace") {
|
|
24
|
+
return {
|
|
25
|
+
style: "plugin-skill",
|
|
26
|
+
entryPattern: "$<skill>",
|
|
27
|
+
examples: [
|
|
28
|
+
"zc:start -> $start",
|
|
29
|
+
"zc:product-analysis -> $product-analysis",
|
|
30
|
+
"zc:sdd-tdd -> $sdd-tdd",
|
|
31
|
+
],
|
|
32
|
+
};
|
|
33
|
+
}
|
|
21
34
|
return {
|
|
22
35
|
style: "skill-alias",
|
|
23
36
|
entryPattern: "$zc-*",
|
|
@@ -84,12 +97,14 @@ function formatSurfaceLabel(surface) {
|
|
|
84
97
|
return "agents 目录";
|
|
85
98
|
case "extension-dir":
|
|
86
99
|
return "extension 目录";
|
|
100
|
+
case "plugin-dir":
|
|
101
|
+
return "plugin 目录";
|
|
87
102
|
default:
|
|
88
103
|
return surface;
|
|
89
104
|
}
|
|
90
105
|
}
|
|
91
|
-
function summarizeCapability(plan) {
|
|
92
|
-
const capability = getPlanCapabilitySummary(plan);
|
|
106
|
+
function summarizeCapability(plan, metadata) {
|
|
107
|
+
const capability = getPlanCapabilitySummary(plan, metadata);
|
|
93
108
|
if (!capability) {
|
|
94
109
|
return [];
|
|
95
110
|
}
|
|
@@ -290,6 +305,12 @@ function formatInstallSourceLabel(source) {
|
|
|
290
305
|
return source === "github-repo" ? "GitHub 扩展仓库" : "本地 bundle";
|
|
291
306
|
}
|
|
292
307
|
function formatBundleTypeLabel(type) {
|
|
308
|
+
if (type === "codex-marketplace") {
|
|
309
|
+
return "Codex marketplace";
|
|
310
|
+
}
|
|
311
|
+
if (type === "codex-plugin") {
|
|
312
|
+
return "Codex plugin";
|
|
313
|
+
}
|
|
293
314
|
return type === "release-bundle" ? "发布态扩展包" : "开发态源包";
|
|
294
315
|
}
|
|
295
316
|
function formatScopeFlag(scope, root) {
|
|
@@ -386,7 +407,7 @@ function summarizePlan(action, target, root, plan, metadata) {
|
|
|
386
407
|
...(metadata?.bundleType ? [`Bundle 类型:${formatBundleTypeLabel(metadata.bundleType)}`] : []),
|
|
387
408
|
...(metadata?.bundlePath ? [`Bundle 目录:${metadata.bundlePath}`] : []),
|
|
388
409
|
...(metadata?.hint ? [`提示:${metadata.hint}`] : []),
|
|
389
|
-
...summarizeCapability(plan),
|
|
410
|
+
...summarizeCapability(plan, metadata),
|
|
390
411
|
`产物数量:${plan.artifacts.length}`,
|
|
391
412
|
...plan.artifacts.map((artifact) => `- ${artifact.path}`),
|
|
392
413
|
];
|
|
@@ -414,18 +435,86 @@ function buildPlanPayload(action, target, root, plan, metadata) {
|
|
|
414
435
|
sourceRef: metadata?.sourceRef ?? null,
|
|
415
436
|
bundleType: metadata?.bundleType ?? null,
|
|
416
437
|
bundlePath: metadata?.bundlePath ?? null,
|
|
417
|
-
capability: getPlanCapabilitySummary(plan),
|
|
438
|
+
capability: getPlanCapabilitySummary(plan, metadata),
|
|
418
439
|
artifactCount: plan.artifacts.length,
|
|
419
440
|
contentFingerprint: plan.metadata?.fingerprint.value ?? null,
|
|
420
441
|
overwrite: "overwrite" in plan ? plan.overwrite : null,
|
|
421
442
|
artifacts: plan.artifacts,
|
|
422
443
|
};
|
|
423
444
|
}
|
|
445
|
+
function resolveGenerateArtifact(outputRoot, artifact) {
|
|
446
|
+
return {
|
|
447
|
+
path: isAbsolute(artifact.path) ? artifact.path : join(outputRoot, artifact.path),
|
|
448
|
+
content: artifact.content,
|
|
449
|
+
};
|
|
450
|
+
}
|
|
451
|
+
async function cleanupCodexPluginSkillsForForce(bundleType, artifacts, force) {
|
|
452
|
+
if (!force || (bundleType !== "codex-plugin" && bundleType !== "codex-marketplace")) {
|
|
453
|
+
return;
|
|
454
|
+
}
|
|
455
|
+
const pluginSkillRoots = artifacts
|
|
456
|
+
.filter((artifact) => artifact.path.endsWith(codexPluginManifestPath))
|
|
457
|
+
.map((artifact) => join(dirname(dirname(artifact.path)), "skills"));
|
|
458
|
+
if (pluginSkillRoots.length > 0) {
|
|
459
|
+
await removeManagedPaths(pluginSkillRoots);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
function assertExclusiveTargetSelector(opts) {
|
|
463
|
+
if (opts.dir && (opts.project || opts.global)) {
|
|
464
|
+
throw new Error("显式目录 `--dir` 不能与 `--project` 或 `--global` 同时使用。");
|
|
465
|
+
}
|
|
466
|
+
if (opts.project && opts.global) {
|
|
467
|
+
throw new Error("`--project` 与 `--global` 不能同时使用。");
|
|
468
|
+
}
|
|
469
|
+
}
|
|
470
|
+
function assertGenerateTargetSelectorSupported(target, opts) {
|
|
471
|
+
if ((opts.project || opts.global) && !(target === "codex" && opts.bundle === "codex-marketplace")) {
|
|
472
|
+
throw new Error("`platform generate --project/--global` 当前仅支持 `codex --bundle codex-marketplace`。");
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
async function resolveGenerateOutputRoot(target, opts) {
|
|
476
|
+
assertExclusiveTargetSelector(opts);
|
|
477
|
+
assertGenerateTargetSelectorSupported(target, opts);
|
|
478
|
+
if (opts.project) {
|
|
479
|
+
const targetResolution = await resolveInstallTarget(target, { project: true });
|
|
480
|
+
return {
|
|
481
|
+
root: targetResolution.root,
|
|
482
|
+
metadata: {
|
|
483
|
+
scope: "project",
|
|
484
|
+
rootSource: targetResolution.source,
|
|
485
|
+
autoResolvedRoot: true,
|
|
486
|
+
hint: targetResolution.hint,
|
|
487
|
+
},
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
if (opts.global) {
|
|
491
|
+
return {
|
|
492
|
+
root: resolve(homedir()),
|
|
493
|
+
metadata: {
|
|
494
|
+
scope: "global",
|
|
495
|
+
rootSource: "official-global",
|
|
496
|
+
},
|
|
497
|
+
};
|
|
498
|
+
}
|
|
499
|
+
return {
|
|
500
|
+
root: opts.dir ? resolve(opts.dir) : resolveWorkspacePath(`.generated/${target}`),
|
|
501
|
+
metadata: {
|
|
502
|
+
scope: "dir",
|
|
503
|
+
rootSource: "explicit",
|
|
504
|
+
},
|
|
505
|
+
};
|
|
506
|
+
}
|
|
424
507
|
function parseGenerateBundleType(value) {
|
|
425
508
|
if (value === "release-bundle" || value === "release") {
|
|
426
509
|
return "release-bundle";
|
|
427
510
|
}
|
|
428
|
-
|
|
511
|
+
if (value === "codex-plugin" || value === "plugin") {
|
|
512
|
+
return "codex-plugin";
|
|
513
|
+
}
|
|
514
|
+
if (value === "codex-marketplace" || value === "marketplace") {
|
|
515
|
+
return "codex-marketplace";
|
|
516
|
+
}
|
|
517
|
+
throw new InvalidArgumentError(`不支持的 bundle 类型:${value}。当前支持:release-bundle | codex-plugin | codex-marketplace`);
|
|
429
518
|
}
|
|
430
519
|
function buildResultPayload(action, target, root, result, metadata) {
|
|
431
520
|
return {
|
|
@@ -678,57 +767,88 @@ function buildUninstallPayload(target, root, result, metadata) {
|
|
|
678
767
|
}
|
|
679
768
|
export async function runPlatformGenerate(target, opts) {
|
|
680
769
|
const format = resolveOutputFormat(opts.json);
|
|
681
|
-
const outputRoot = opts.dir ? resolve(opts.dir) : resolveWorkspacePath(`.generated/${target}`);
|
|
682
770
|
try {
|
|
771
|
+
const outputTarget = await resolveGenerateOutputRoot(target, opts);
|
|
772
|
+
const outputRoot = outputTarget.root;
|
|
773
|
+
const outputMetadata = outputTarget.metadata;
|
|
683
774
|
const manifest = await loadToolkitManifest();
|
|
684
775
|
const platformModule = await loadPlatformModule(target);
|
|
685
776
|
let plan = createGenerationPlan(target, platformModule, manifest);
|
|
686
777
|
let bundleType;
|
|
687
778
|
let bundlePath;
|
|
688
779
|
if (opts.bundle) {
|
|
689
|
-
if (
|
|
690
|
-
|
|
780
|
+
if (opts.bundle === "release-bundle") {
|
|
781
|
+
if (target !== "qwen") {
|
|
782
|
+
throw new Error(`${target} 暂不支持 release-bundle 导出。当前仅 qwen 支持 --bundle release-bundle。`);
|
|
783
|
+
}
|
|
784
|
+
const installPlan = createInstallPlan(target, platformModule, manifest, outputRoot, "dir", resolveOverwriteMode(opts.force));
|
|
785
|
+
bundleType = opts.bundle;
|
|
786
|
+
bundlePath = outputRoot;
|
|
787
|
+
plan = {
|
|
788
|
+
...installPlan,
|
|
789
|
+
artifacts: toQwenOfficialCliReleaseArtifacts(installPlan, outputRoot),
|
|
790
|
+
};
|
|
791
|
+
}
|
|
792
|
+
if (opts.bundle === "codex-plugin") {
|
|
793
|
+
if (target !== "codex") {
|
|
794
|
+
throw new Error(`${target} 暂不支持 codex-plugin 导出。当前仅 codex 支持 --bundle codex-plugin。`);
|
|
795
|
+
}
|
|
796
|
+
if (!platformModule.createCodexPluginGenerationPlan) {
|
|
797
|
+
throw new Error("Codex 平台包未导出 createCodexPluginGenerationPlan()");
|
|
798
|
+
}
|
|
799
|
+
bundleType = opts.bundle;
|
|
800
|
+
bundlePath = outputRoot;
|
|
801
|
+
plan = finalizePlan(platformModule.createCodexPluginGenerationPlan(manifest, {
|
|
802
|
+
manifestSource: manifest.source,
|
|
803
|
+
pluginVersion: getCliVersion(),
|
|
804
|
+
extensionVersion: getCliVersion(),
|
|
805
|
+
}));
|
|
806
|
+
}
|
|
807
|
+
if (opts.bundle === "codex-marketplace") {
|
|
808
|
+
if (target !== "codex") {
|
|
809
|
+
throw new Error(`${target} 暂不支持 codex-marketplace 导出。当前仅 codex 支持 --bundle codex-marketplace。`);
|
|
810
|
+
}
|
|
811
|
+
if (!platformModule.createCodexMarketplaceGenerationPlan) {
|
|
812
|
+
throw new Error("Codex 平台包未导出 createCodexMarketplaceGenerationPlan()");
|
|
813
|
+
}
|
|
814
|
+
bundleType = opts.bundle;
|
|
815
|
+
bundlePath = outputRoot;
|
|
816
|
+
plan = finalizePlan(platformModule.createCodexMarketplaceGenerationPlan(manifest, {
|
|
817
|
+
manifestSource: manifest.source,
|
|
818
|
+
pluginVersion: getCliVersion(),
|
|
819
|
+
extensionVersion: getCliVersion(),
|
|
820
|
+
scope: outputMetadata.scope === "global" ? "global" : "project",
|
|
821
|
+
}));
|
|
691
822
|
}
|
|
692
|
-
const installPlan = createInstallPlan(target, platformModule, manifest, outputRoot, "dir", resolveOverwriteMode(opts.force));
|
|
693
|
-
bundleType = opts.bundle;
|
|
694
|
-
bundlePath = outputRoot;
|
|
695
|
-
plan = {
|
|
696
|
-
...installPlan,
|
|
697
|
-
artifacts: toQwenOfficialCliReleaseArtifacts(installPlan, outputRoot),
|
|
698
|
-
};
|
|
699
823
|
}
|
|
700
824
|
if (opts.plan) {
|
|
701
|
-
const outputPlan =
|
|
702
|
-
|
|
703
|
-
:
|
|
704
|
-
|
|
705
|
-
artifacts: plan.artifacts.map((artifact) => ({
|
|
706
|
-
path: join(outputRoot, artifact.path),
|
|
707
|
-
content: artifact.content,
|
|
708
|
-
})),
|
|
709
|
-
};
|
|
825
|
+
const outputPlan = {
|
|
826
|
+
...plan,
|
|
827
|
+
artifacts: plan.artifacts.map((artifact) => resolveGenerateArtifact(outputRoot, artifact)),
|
|
828
|
+
};
|
|
710
829
|
emitOutput(format, buildPlanPayload("generate", target, outputRoot, outputPlan, {
|
|
830
|
+
...outputMetadata,
|
|
711
831
|
bundleType,
|
|
712
832
|
bundlePath,
|
|
713
833
|
}), summarizePlan("generate", target, outputRoot, outputPlan, {
|
|
834
|
+
...outputMetadata,
|
|
714
835
|
bundleType,
|
|
715
836
|
bundlePath,
|
|
716
837
|
}));
|
|
717
838
|
return;
|
|
718
839
|
}
|
|
719
|
-
const
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
path: join(outputRoot, artifact.path),
|
|
723
|
-
content: artifact.content,
|
|
724
|
-
}))), {
|
|
840
|
+
const resolvedArtifacts = plan.artifacts.map((artifact) => resolveGenerateArtifact(outputRoot, artifact));
|
|
841
|
+
await cleanupCodexPluginSkillsForForce(bundleType, resolvedArtifacts, opts.force);
|
|
842
|
+
const result = await writeArtifacts(resolvedArtifacts, {
|
|
725
843
|
dryRun: false,
|
|
726
844
|
overwrite: resolveOverwriteMode(opts.force)
|
|
727
845
|
});
|
|
728
846
|
emitOutput(format, buildResultPayload("generate", target, outputRoot, result, {
|
|
847
|
+
...outputMetadata,
|
|
729
848
|
bundleType,
|
|
730
849
|
bundlePath,
|
|
731
850
|
}), summarizeResult("generate", target, outputRoot, result, {
|
|
851
|
+
...outputMetadata,
|
|
732
852
|
bundleType,
|
|
733
853
|
bundlePath,
|
|
734
854
|
}));
|
|
@@ -738,6 +858,29 @@ export async function runPlatformGenerate(target, opts) {
|
|
|
738
858
|
process.exitCode = 1;
|
|
739
859
|
}
|
|
740
860
|
}
|
|
861
|
+
export async function runPlatformPlugin(target, opts) {
|
|
862
|
+
const format = resolveOutputFormat(opts.json);
|
|
863
|
+
try {
|
|
864
|
+
if (target !== "codex") {
|
|
865
|
+
throw new Error("当前仅 Codex 支持插件 marketplace 快捷安装。");
|
|
866
|
+
}
|
|
867
|
+
assertExclusiveTargetSelector(opts);
|
|
868
|
+
const useProject = opts.project || (!opts.dir && !opts.global);
|
|
869
|
+
await runPlatformGenerate(target, {
|
|
870
|
+
dir: opts.dir,
|
|
871
|
+
project: useProject,
|
|
872
|
+
global: opts.global,
|
|
873
|
+
bundle: "codex-marketplace",
|
|
874
|
+
force: opts.force,
|
|
875
|
+
plan: opts.plan,
|
|
876
|
+
json: opts.json,
|
|
877
|
+
});
|
|
878
|
+
}
|
|
879
|
+
catch (error) {
|
|
880
|
+
emitPlatformError(format, target, "generate", error instanceof Error ? `${target} 插件生成失败:${error.message}` : `${target} 插件生成失败。`);
|
|
881
|
+
process.exitCode = 1;
|
|
882
|
+
}
|
|
883
|
+
}
|
|
741
884
|
function getUpdateOverwriteMode(status, force) {
|
|
742
885
|
if (status.kind === "update-available") {
|
|
743
886
|
return "force";
|
|
@@ -1662,19 +1805,33 @@ export function registerPlatformCommand(program) {
|
|
|
1662
1805
|
.description("导出平台内容或 Qwen 发布 bundle")
|
|
1663
1806
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1664
1807
|
.option("-d, --dir <dir>", "输出目录")
|
|
1665
|
-
.option("-
|
|
1808
|
+
.option("-p, --project", "输出到当前目录向上解析出的最近项目根(当前仅 codex marketplace)")
|
|
1809
|
+
.option("-g, --global", "输出到用户级默认位置(当前仅 codex marketplace)")
|
|
1810
|
+
.option("-b, --bundle <type>", "导出指定 bundle 布局(qwen: release-bundle;codex: codex-plugin/codex-marketplace)", parseGenerateBundleType)
|
|
1666
1811
|
.option("--plan", "只查看生成计划,不写文件")
|
|
1667
1812
|
.option("-j, --json", "输出 JSON")
|
|
1668
1813
|
.option("-f, --force", "覆盖目标目录中已有但内容不同的产物")
|
|
1669
1814
|
.action(runPlatformGenerate);
|
|
1815
|
+
platform
|
|
1816
|
+
.command("plugin")
|
|
1817
|
+
.alias("p")
|
|
1818
|
+
.description("生成 Codex 插件 marketplace")
|
|
1819
|
+
.argument("<target>", "目标平台(当前支持 codex)", parsePlatformName)
|
|
1820
|
+
.option("-d, --dir <dir>", "使用指定 marketplace root")
|
|
1821
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1822
|
+
.option("-g, --global", "使用用户级 personal marketplace")
|
|
1823
|
+
.option("--plan", "只查看生成计划,不写文件")
|
|
1824
|
+
.option("-j, --json", "输出 JSON")
|
|
1825
|
+
.option("-f, --force", "覆盖目标目录中已有但内容不同的产物")
|
|
1826
|
+
.action(runPlatformPlugin);
|
|
1670
1827
|
platform
|
|
1671
1828
|
.command("install")
|
|
1672
1829
|
.alias("i")
|
|
1673
1830
|
.description("把平台内容安装到项目、用户级或指定目录")
|
|
1674
1831
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1675
|
-
.option("-d, --dir <dir>", "
|
|
1676
|
-
.option("-p, --project", "
|
|
1677
|
-
.option("-g, --global", "
|
|
1832
|
+
.option("-d, --dir <dir>", "使用指定目录")
|
|
1833
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1834
|
+
.option("-g, --global", "使用平台定义的用户级默认位置")
|
|
1678
1835
|
.option("--plan", "只查看安装计划,不写文件")
|
|
1679
1836
|
.option("-j, --json", "输出 JSON")
|
|
1680
1837
|
.option("-f, --force", "覆盖目标目录中已有但内容不同的产物")
|
|
@@ -1684,59 +1841,64 @@ export function registerPlatformCommand(program) {
|
|
|
1684
1841
|
.alias("w")
|
|
1685
1842
|
.description("查看平台内容会安装到哪里")
|
|
1686
1843
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1687
|
-
.option("-d, --dir <dir>", "
|
|
1688
|
-
.option("-p, --project", "
|
|
1689
|
-
.option("-g, --global", "
|
|
1844
|
+
.option("-d, --dir <dir>", "使用指定目录")
|
|
1845
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1846
|
+
.option("-g, --global", "使用平台定义的用户级默认位置")
|
|
1690
1847
|
.option("-j, --json", "输出 JSON")
|
|
1691
1848
|
.action(runPlatformWhere);
|
|
1692
1849
|
platform
|
|
1693
1850
|
.command("status")
|
|
1851
|
+
.alias("s")
|
|
1694
1852
|
.description("查看是否已安装、是否可更新、是否漂移")
|
|
1695
1853
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1696
|
-
.option("-d, --dir <dir>", "
|
|
1697
|
-
.option("-p, --project", "
|
|
1698
|
-
.option("-g, --global", "
|
|
1854
|
+
.option("-d, --dir <dir>", "使用指定目录")
|
|
1855
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1856
|
+
.option("-g, --global", "使用平台定义的用户级默认位置")
|
|
1699
1857
|
.option("-j, --json", "输出 JSON")
|
|
1700
1858
|
.action(runPlatformStatus);
|
|
1701
1859
|
platform
|
|
1702
1860
|
.command("update")
|
|
1861
|
+
.alias("u")
|
|
1703
1862
|
.description("更新已安装的平台内容")
|
|
1704
1863
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1705
|
-
.option("-d, --dir <dir>", "
|
|
1706
|
-
.option("-p, --project", "
|
|
1707
|
-
.option("-g, --global", "
|
|
1864
|
+
.option("-d, --dir <dir>", "使用指定目录")
|
|
1865
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1866
|
+
.option("-g, --global", "使用平台定义的用户级默认位置")
|
|
1708
1867
|
.option("--plan", "只查看更新计划,不写文件")
|
|
1709
1868
|
.option("-j, --json", "输出 JSON")
|
|
1710
1869
|
.option("-f, --force", "覆盖已漂移的已安装产物")
|
|
1711
1870
|
.action(runPlatformUpdate);
|
|
1712
1871
|
platform
|
|
1713
1872
|
.command("uninstall")
|
|
1873
|
+
.alias("remove")
|
|
1714
1874
|
.description("卸载受管平台内容并删除安装记录")
|
|
1715
1875
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1716
|
-
.option("-d, --dir <dir>", "
|
|
1717
|
-
.option("-p, --project", "
|
|
1718
|
-
.option("-g, --global", "
|
|
1876
|
+
.option("-d, --dir <dir>", "使用指定目录")
|
|
1877
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1878
|
+
.option("-g, --global", "使用平台定义的用户级默认位置")
|
|
1719
1879
|
.option("--plan", "只查看卸载计划,不写文件")
|
|
1720
1880
|
.option("-j, --json", "输出 JSON")
|
|
1721
1881
|
.option("-f, --force", "允许卸载已漂移的受管内容")
|
|
1722
1882
|
.action(runPlatformUninstall);
|
|
1723
1883
|
platform
|
|
1724
1884
|
.command("repair")
|
|
1885
|
+
.alias("fix")
|
|
1725
1886
|
.description("修复漂移、缺失或官方 CLI 失配的安装")
|
|
1726
1887
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1727
|
-
.option("-d, --dir <dir>", "
|
|
1728
|
-
.option("-p, --project", "
|
|
1729
|
-
.option("-g, --global", "
|
|
1888
|
+
.option("-d, --dir <dir>", "使用指定目录")
|
|
1889
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1890
|
+
.option("-g, --global", "使用平台定义的用户级默认位置")
|
|
1730
1891
|
.option("--plan", "只查看修复计划,不写文件")
|
|
1731
1892
|
.option("-j, --json", "输出 JSON")
|
|
1732
1893
|
.action(runPlatformRepair);
|
|
1733
1894
|
platform
|
|
1734
1895
|
.command("doctor")
|
|
1896
|
+
.alias("check")
|
|
1735
1897
|
.description("诊断当前平台安装的健康度和下一步建议")
|
|
1736
1898
|
.argument("<target>", "目标平台 (qwen|codex|claude|opencode)", parsePlatformName)
|
|
1737
|
-
.option("-d, --dir <dir>", "
|
|
1738
|
-
.option("-p, --project", "
|
|
1739
|
-
.option("-g, --global", "
|
|
1899
|
+
.option("-d, --dir <dir>", "使用指定目录")
|
|
1900
|
+
.option("-p, --project", "使用当前目录向上解析出的最近项目根")
|
|
1901
|
+
.option("-g, --global", "使用平台定义的用户级默认位置")
|
|
1740
1902
|
.option("-j, --json", "输出 JSON")
|
|
1741
1903
|
.action(runPlatformDoctor);
|
|
1742
1904
|
}
|