@cannbot-ai/install-helper 1.1.5-beta.1 → 1.1.6-beta.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/dist/index.js CHANGED
@@ -1,19 +1,13 @@
1
1
  #!/usr/bin/env node
2
-
3
- // src/cli.ts
4
- import { Command } from "commander";
5
-
6
- // src/commands/init.ts
7
- import { select as select4, Separator as Separator3 } from "@inquirer/prompts";
8
- import chalk7 from "chalk";
9
-
10
- // src/ui/wizard.ts
11
- import { select, Separator } from "@inquirer/prompts";
12
- import chalk3 from "chalk";
13
-
14
- // src/core/registry.ts
15
- import { readdirSync, existsSync } from "fs";
16
- import { join } from "path";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __esm = (fn, res) => function __init() {
5
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
6
+ };
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
17
11
 
18
12
  // src/utils/fs-helpers.ts
19
13
  import { lstatSync, statSync, unlinkSync, rmSync } from "fs";
@@ -42,532 +36,544 @@ function removePath(p) {
42
36
  } catch {
43
37
  }
44
38
  }
39
+ var init_fs_helpers = __esm({
40
+ "src/utils/fs-helpers.ts"() {
41
+ "use strict";
42
+ }
43
+ });
45
44
 
46
45
  // src/embedded-plugins.json
47
- var embedded_plugins_default = [
48
- {
49
- id: "ops-direct-invoke",
50
- dir: "plugins-official/ops-direct-invoke",
51
- displayName: "AscendC Kernel \u76F4\u8C03",
52
- script: "init.sh",
53
- aliases: [
54
- "ops-direct",
55
- "ascendc-direct",
56
- "direct",
57
- "kernel"
58
- ],
59
- skills: 20,
60
- agents: 4,
61
- description: "Ascend C \u76F4\u8C03\u5168\u6D41\u7A0B\uFF1A\u73AF\u5883\u2192\u8BBE\u8BA1\u2192\u5F00\u53D1\u2192\u5BA1\u67E5\u2192\u6027\u80FD\u9A8C\u6536",
62
- version: "1.2.4",
63
- configFile: "AGENTS.md",
64
- configRootConfigLink: false,
65
- installSkills: [
46
+ var embedded_plugins_default;
47
+ var init_embedded_plugins = __esm({
48
+ "src/embedded-plugins.json"() {
49
+ embedded_plugins_default = [
66
50
  {
67
- dir: "ops",
68
- skills: [
69
- "ascendc-tiling-design",
70
- "npu-arch",
71
- "ascendc-api-best-practices",
72
- "ascendc-regbase-best-practice",
73
- "ascendc-blaze-best-practice",
74
- "ops-precision-standard",
75
- "ascendc-docs-search",
76
- "ascendc-env-check",
77
- "ascendc-precision-debug",
78
- "ops-profiling",
79
- "ascendc-direct-invoke-template",
80
- "torch-ascendc-op-extension",
81
- "ascendc-runtime-debug",
82
- "ascendc-crash-debug",
83
- "ascendc-code-review",
84
- "ascendc-mc2-best-practice"
51
+ id: "ops-direct-invoke",
52
+ dir: "plugins-official/ops-direct-invoke",
53
+ displayName: "AscendC Kernel \u76F4\u8C03",
54
+ script: "init.sh",
55
+ aliases: [
56
+ "ops-direct",
57
+ "ascendc-direct",
58
+ "direct",
59
+ "kernel"
60
+ ],
61
+ skills: 20,
62
+ agents: 4,
63
+ description: "Ascend C \u76F4\u8C03\u5168\u6D41\u7A0B\uFF1A\u73AF\u5883\u2192\u8BBE\u8BA1\u2192\u5F00\u53D1\u2192\u5BA1\u67E5\u2192\u6027\u80FD\u9A8C\u6536",
64
+ version: "1.2.4",
65
+ configFile: "AGENTS.md",
66
+ configRootConfigLink: false,
67
+ installSkills: [
68
+ {
69
+ dir: "ops",
70
+ skills: [
71
+ "ascendc-tiling-design",
72
+ "npu-arch",
73
+ "ascendc-api-best-practices",
74
+ "ascendc-regbase-best-practice",
75
+ "ascendc-blaze-best-practice",
76
+ "ops-precision-standard",
77
+ "ascendc-docs-search",
78
+ "ascendc-env-check",
79
+ "ascendc-precision-debug",
80
+ "ops-profiling",
81
+ "ascendc-direct-invoke-template",
82
+ "torch-ascendc-op-extension",
83
+ "ascendc-runtime-debug",
84
+ "ascendc-crash-debug",
85
+ "ascendc-code-review",
86
+ "ascendc-mc2-best-practice"
87
+ ]
88
+ },
89
+ {
90
+ dir: "infra",
91
+ skills: [
92
+ "gitcode-toolkit",
93
+ "gitcode-pr-handler",
94
+ "gitcode-issue-gen",
95
+ "gitcode-issue-handler"
96
+ ]
97
+ }
98
+ ],
99
+ installAgents: [
100
+ "ascendc-kernel-architect",
101
+ "ascendc-kernel-design-reviewer",
102
+ "ascendc-kernel-developer",
103
+ "ascendc-kernel-reviewer"
104
+ ],
105
+ externalRepos: [
106
+ {
107
+ url: "https://gitcode.com/cann/asc-devkit.git",
108
+ dir: "plugins-official/ops-direct-invoke/asc-devkit",
109
+ configRootLink: false
110
+ }
85
111
  ]
86
112
  },
87
113
  {
88
- dir: "infra",
89
- skills: [
90
- "gitcode-toolkit",
91
- "gitcode-pr-handler",
92
- "gitcode-issue-gen",
93
- "gitcode-issue-handler"
94
- ]
95
- }
96
- ],
97
- installAgents: [
98
- "ascendc-kernel-architect",
99
- "ascendc-kernel-design-reviewer",
100
- "ascendc-kernel-developer",
101
- "ascendc-kernel-reviewer"
102
- ],
103
- externalRepos: [
104
- {
105
- url: "https://gitcode.com/cann/asc-devkit.git",
106
- dir: "plugins-official/ops-direct-invoke/asc-devkit",
107
- configRootLink: false
108
- }
109
- ]
110
- },
111
- {
112
- id: "ops-direct-invoke-flash",
113
- dir: "plugins-official/ops-direct-invoke-flash",
114
- displayName: "AscendC Kernel \u76F4\u8C03\uFF08\u5FEB\u901F\u7248\uFF09",
115
- script: "init.sh",
116
- aliases: [
117
- "flash",
118
- "kernel-flash"
119
- ],
120
- skills: 7,
121
- agents: 1,
122
- description: "\u4ECE\u6570\u5B66\u516C\u5F0F\u6216\u4EE3\u7801\u7247\u6BB5\u5FEB\u901F\u6784\u5EFA\u5E76\u9A8C\u8BC1 Ascend NPU \u6838\u51FD\u6570",
123
- version: "1.2.2",
124
- configFile: "AGENTS.md",
125
- configRootConfigLink: true,
126
- installSkills: [
127
- {
128
- dir: "plugins-official/ops-direct-invoke-flash/skills",
129
- skills: [
130
- "ops-direct-invoke-flash"
114
+ id: "ops-direct-invoke-flash",
115
+ dir: "plugins-official/ops-direct-invoke-flash",
116
+ displayName: "AscendC Kernel \u76F4\u8C03\uFF08\u5FEB\u901F\u7248\uFF09",
117
+ script: "init.sh",
118
+ aliases: [
119
+ "flash",
120
+ "kernel-flash"
121
+ ],
122
+ skills: 7,
123
+ agents: 1,
124
+ description: "\u4ECE\u6570\u5B66\u516C\u5F0F\u6216\u4EE3\u7801\u7247\u6BB5\u5FEB\u901F\u6784\u5EFA\u5E76\u9A8C\u8BC1 Ascend NPU \u6838\u51FD\u6570",
125
+ version: "1.2.2",
126
+ configFile: "AGENTS.md",
127
+ configRootConfigLink: true,
128
+ installSkills: [
129
+ {
130
+ dir: "plugins-official/ops-direct-invoke-flash/skills",
131
+ skills: [
132
+ "ops-direct-invoke-flash"
133
+ ]
134
+ },
135
+ {
136
+ dir: "ops",
137
+ skills: [
138
+ "ascendc-st-design",
139
+ "ascendc-whitebox-design"
140
+ ]
141
+ },
142
+ {
143
+ dir: "infra",
144
+ skills: [
145
+ "gitcode-toolkit",
146
+ "gitcode-pr-handler",
147
+ "gitcode-issue-gen",
148
+ "gitcode-issue-handler"
149
+ ]
150
+ }
151
+ ],
152
+ installAgents: [
153
+ "ops-direct-invoke-flash-reviewer"
131
154
  ]
132
155
  },
133
156
  {
134
- dir: "ops",
135
- skills: [
136
- "ascendc-st-design",
137
- "ascendc-whitebox-design"
157
+ id: "ops-registry-invoke",
158
+ dir: "plugins-official/ops-registry-invoke",
159
+ displayName: "AscendC \u7B97\u5B50\u6CE8\u518C\u8C03\u7528",
160
+ script: "init.sh",
161
+ aliases: [
162
+ "ops-registry",
163
+ "ascendc-registry",
164
+ "registry"
165
+ ],
166
+ skills: 28,
167
+ agents: 3,
168
+ description: "\u751F\u4EA7\u7EA7 ACLNN \u6CE8\u518C\u7B97\u5B50\u5168\u6D41\u7A0B\uFF1A\u4EE3\u7801\u2192UT/ST\u2192\u4E0A\u5E93",
169
+ version: "1.2.0",
170
+ configFile: "AGENTS.md",
171
+ configRootConfigLink: false,
172
+ installSkills: [
173
+ {
174
+ dir: "ops",
175
+ skills: [
176
+ "ascendc-blaze-best-practice",
177
+ "ascendc-api-best-practices",
178
+ "ascendc-code-review",
179
+ "ascendc-crash-debug",
180
+ "ascendc-direct-invoke-template",
181
+ "ascendc-docs-gen",
182
+ "ascendc-docs-search",
183
+ "ascendc-env-check",
184
+ "npu-arch",
185
+ "ascendc-performance-best-practices",
186
+ "ascendc-precision-debug",
187
+ "ascendc-regbase-best-practice",
188
+ "ascendc-registry-invoke-template",
189
+ "ascendc-runtime-debug",
190
+ "ascendc-st-design",
191
+ "ascendc-tiling-design",
192
+ "ascendc-ut-develop",
193
+ "ascendc-whitebox-design",
194
+ "ops-precision-standard",
195
+ "ops-profiling",
196
+ "ops-spec-gen",
197
+ "ascendc-perf-optimize",
198
+ "ops-simulator"
199
+ ]
200
+ },
201
+ {
202
+ dir: "infra",
203
+ skills: [
204
+ "gitcode-toolkit",
205
+ "gitcode-pr-handler",
206
+ "gitcode-issue-gen",
207
+ "gitcode-issue-handler"
208
+ ]
209
+ },
210
+ {
211
+ dir: "plugins-official/ops-registry-invoke",
212
+ skills: [
213
+ {
214
+ name: "workflow",
215
+ as: "ops-registry-invoke-workflow"
216
+ }
217
+ ]
218
+ }
219
+ ],
220
+ installAgents: [
221
+ "ascendc-ops-architect",
222
+ "ascendc-ops-developer",
223
+ "ascendc-ops-tester"
224
+ ],
225
+ externalRepos: [
226
+ {
227
+ url: "https://gitcode.com/cann/asc-devkit.git",
228
+ dir: "plugins-official/ops-registry-invoke/asc-devkit",
229
+ configRootLink: false
230
+ }
138
231
  ]
139
232
  },
140
233
  {
141
- dir: "infra",
142
- skills: [
143
- "gitcode-toolkit",
144
- "gitcode-pr-handler",
145
- "gitcode-issue-gen",
146
- "gitcode-issue-handler"
147
- ]
148
- }
149
- ],
150
- installAgents: [
151
- "ops-direct-invoke-flash-reviewer"
152
- ]
153
- },
154
- {
155
- id: "ops-registry-invoke",
156
- dir: "plugins-official/ops-registry-invoke",
157
- displayName: "AscendC \u7B97\u5B50\u6CE8\u518C\u8C03\u7528",
158
- script: "init.sh",
159
- aliases: [
160
- "ops-registry",
161
- "ascendc-registry",
162
- "registry"
163
- ],
164
- skills: 28,
165
- agents: 3,
166
- description: "\u751F\u4EA7\u7EA7 ACLNN \u6CE8\u518C\u7B97\u5B50\u5168\u6D41\u7A0B\uFF1A\u4EE3\u7801\u2192UT/ST\u2192\u4E0A\u5E93",
167
- version: "1.2.0",
168
- configFile: "AGENTS.md",
169
- configRootConfigLink: false,
170
- installSkills: [
171
- {
172
- dir: "ops",
173
- skills: [
174
- "ascendc-blaze-best-practice",
175
- "ascendc-api-best-practices",
176
- "ascendc-code-review",
177
- "ascendc-crash-debug",
178
- "ascendc-direct-invoke-template",
179
- "ascendc-docs-gen",
180
- "ascendc-docs-search",
181
- "ascendc-env-check",
182
- "npu-arch",
183
- "ascendc-performance-best-practices",
184
- "ascendc-precision-debug",
185
- "ascendc-regbase-best-practice",
186
- "ascendc-registry-invoke-template",
187
- "ascendc-runtime-debug",
188
- "ascendc-st-design",
189
- "ascendc-tiling-design",
190
- "ascendc-ut-develop",
191
- "ascendc-whitebox-design",
192
- "ops-precision-standard",
193
- "ops-profiling",
194
- "ops-spec-gen",
195
- "ascendc-perf-optimize",
196
- "ops-simulator"
234
+ id: "catlass-op-generator",
235
+ dir: "plugins-official/catlass-op-generator",
236
+ displayName: "Catlass \u7B97\u5B50\u76F4\u8C03",
237
+ script: "init.sh",
238
+ aliases: [
239
+ "catlass"
240
+ ],
241
+ skills: 14,
242
+ agents: 3,
243
+ description: "Catlass \u6A21\u677F\u62FC\u88C5 GEMM/Matmul/Epilogue \u7B97\u5B50\u5F00\u53D1",
244
+ version: "1.0.0",
245
+ configFile: "AGENTS.md",
246
+ configRootConfigLink: true,
247
+ installSkills: [
248
+ {
249
+ dir: "ops",
250
+ skills: [
251
+ "catlass-op-design",
252
+ "catlass-op-develop",
253
+ "catlass-op-perf-tune",
254
+ "ascendc-tiling-design",
255
+ "npu-arch",
256
+ "ascendc-api-best-practices",
257
+ "ops-precision-standard",
258
+ "ascendc-docs-search",
259
+ "ascendc-env-check",
260
+ "ascendc-precision-debug",
261
+ "ops-profiling",
262
+ "ascendc-runtime-debug",
263
+ "ascendc-code-review",
264
+ "torch-ascendc-op-extension"
265
+ ]
266
+ }
267
+ ],
268
+ installAgents: [
269
+ "catlass-op-architect",
270
+ "catlass-op-generator",
271
+ "catlass-op-reviewer"
272
+ ],
273
+ externalRepos: [
274
+ {
275
+ url: "https://gitcode.com/cann/asc-devkit.git",
276
+ dir: "plugins-official/catlass-op-generator/asc-devkit",
277
+ configRootLink: false
278
+ }
197
279
  ]
198
280
  },
199
281
  {
200
- dir: "infra",
201
- skills: [
202
- "gitcode-toolkit",
203
- "gitcode-pr-handler",
204
- "gitcode-issue-gen",
205
- "gitcode-issue-handler"
282
+ id: "model-infer-sota-approach",
283
+ dir: "plugins-official/model-infer-sota-approach",
284
+ displayName: "NPU \u63A8\u7406 SOTA \u4F18\u5316",
285
+ script: "init.sh",
286
+ aliases: [
287
+ "sota",
288
+ "sota-approach",
289
+ "model-infer-sota"
290
+ ],
291
+ skills: 14,
292
+ agents: 6,
293
+ description: "NPU \u63A8\u7406 baseline \u4E4B\u4E0A profiling \u9A71\u52A8\u7684\u63A2\u7D22\u5F0F\u4F18\u5316\u7F16\u6392\uFF08Plan/round \u81EA\u5FAA\u73AF\uFF0C\u4E0E model-infer-optimize \u524D\u540E\u8854\u63A5\uFF09",
294
+ version: "1.0.0",
295
+ configFile: "AGENTS.md",
296
+ configRootConfigLink: true,
297
+ installSkills: [
298
+ {
299
+ dir: "model",
300
+ skills: [
301
+ "model-infer-migrator",
302
+ "model-infer-parallel-analysis",
303
+ "model-infer-parallel-impl",
304
+ "model-infer-kvcache",
305
+ "model-infer-fusion",
306
+ "model-infer-quantization",
307
+ "model-infer-graph-mode",
308
+ "model-infer-precision-debug",
309
+ "model-infer-runtime-debug",
310
+ "model-infer-multi-stream",
311
+ "model-infer-prefetch",
312
+ "model-infer-superkernel",
313
+ "model-infer-profiling",
314
+ "model-infer-perf-breakdown"
315
+ ]
316
+ }
317
+ ],
318
+ installAgents: [
319
+ "model-infer-sota-scenario",
320
+ "model-infer-sota-profiling-instrumenter",
321
+ "model-infer-sota-profile-analyzer",
322
+ "model-infer-sota-candidate",
323
+ "model-infer-sota-implementer",
324
+ "model-infer-sota-reviewer"
325
+ ],
326
+ externalRepos: [
327
+ {
328
+ url: "https://gitcode.com/cann/cann-recipes-infer.git",
329
+ dir: "plugins-official/model-infer-sota-approach/cann-recipes-infer",
330
+ depth: 1,
331
+ configRootLink: true
332
+ }
206
333
  ]
207
334
  },
208
335
  {
209
- dir: "plugins-official/ops-registry-invoke",
210
- skills: [
336
+ id: "model-infer-optimize",
337
+ dir: "plugins-official/model-infer-optimize",
338
+ displayName: "NPU \u63A8\u7406\u4F18\u5316",
339
+ script: "init.sh",
340
+ aliases: [
341
+ "model-infer",
342
+ "infer",
343
+ "inference"
344
+ ],
345
+ skills: 14,
346
+ agents: 3,
347
+ description: "NPU \u6A21\u578B\u63A8\u7406\u7AEF\u5230\u7AEF\u4F18\u5316\uFF08\u5E76\u884C/KVCache/\u878D\u5408/\u91CF\u5316/\u56FE\u6A21\u5F0F/\u591A\u6D41/SuperKernel\uFF09",
348
+ version: "1.0.5",
349
+ configFile: "AGENTS.md",
350
+ configRootConfigLink: true,
351
+ installSkills: [
211
352
  {
212
- name: "workflow",
213
- as: "ops-registry-invoke-workflow"
353
+ dir: "model",
354
+ skills: [
355
+ "model-infer-migrator",
356
+ "model-infer-parallel-analysis",
357
+ "model-infer-parallel-impl",
358
+ "model-infer-kvcache",
359
+ "model-infer-fusion",
360
+ "model-infer-quantization",
361
+ "model-infer-graph-mode",
362
+ "model-infer-precision-debug",
363
+ "model-infer-runtime-debug",
364
+ "model-infer-multi-stream",
365
+ "model-infer-prefetch",
366
+ "model-infer-superkernel",
367
+ "model-infer-profiling",
368
+ "model-infer-perf-breakdown"
369
+ ]
370
+ }
371
+ ],
372
+ installAgents: [
373
+ "model-infer-analyzer",
374
+ "model-infer-implementer",
375
+ "model-infer-reviewer"
376
+ ],
377
+ externalRepos: [
378
+ {
379
+ url: "https://gitcode.com/cann/cann-recipes-infer.git",
380
+ dir: "plugins-official/model-infer-optimize/cann-recipes-infer",
381
+ depth: 1,
382
+ configRootLink: true
214
383
  }
215
384
  ]
216
- }
217
- ],
218
- installAgents: [
219
- "ascendc-ops-architect",
220
- "ascendc-ops-developer",
221
- "ascendc-ops-tester"
222
- ],
223
- externalRepos: [
224
- {
225
- url: "https://gitcode.com/cann/asc-devkit.git",
226
- dir: "plugins-official/ops-registry-invoke/asc-devkit",
227
- configRootLink: false
228
- }
229
- ]
230
- },
231
- {
232
- id: "catlass-op-generator",
233
- dir: "plugins-official/catlass-op-generator",
234
- displayName: "Catlass \u7B97\u5B50\u76F4\u8C03",
235
- script: "init.sh",
236
- aliases: [
237
- "catlass"
238
- ],
239
- skills: 14,
240
- agents: 3,
241
- description: "Catlass \u6A21\u677F\u62FC\u88C5 GEMM/Matmul/Epilogue \u7B97\u5B50\u5F00\u53D1",
242
- version: "1.0.0",
243
- configFile: "AGENTS.md",
244
- configRootConfigLink: true,
245
- installSkills: [
246
- {
247
- dir: "ops",
248
- skills: [
249
- "catlass-op-design",
250
- "catlass-op-develop",
251
- "catlass-op-perf-tune",
252
- "ascendc-tiling-design",
253
- "npu-arch",
254
- "ascendc-api-best-practices",
255
- "ops-precision-standard",
256
- "ascendc-docs-search",
257
- "ascendc-env-check",
258
- "ascendc-precision-debug",
259
- "ops-profiling",
260
- "ascendc-runtime-debug",
261
- "ascendc-code-review",
262
- "torch-ascendc-op-extension"
263
- ]
264
- }
265
- ],
266
- installAgents: [
267
- "catlass-op-architect",
268
- "catlass-op-generator",
269
- "catlass-op-reviewer"
270
- ],
271
- externalRepos: [
272
- {
273
- url: "https://gitcode.com/cann/asc-devkit.git",
274
- dir: "plugins-official/catlass-op-generator/asc-devkit",
275
- configRootLink: false
276
- }
277
- ]
278
- },
279
- {
280
- id: "model-infer-sota-approach",
281
- dir: "plugins-official/model-infer-sota-approach",
282
- displayName: "NPU \u63A8\u7406 SOTA \u4F18\u5316",
283
- script: "init.sh",
284
- aliases: [
285
- "sota",
286
- "sota-approach",
287
- "model-infer-sota"
288
- ],
289
- skills: 14,
290
- agents: 6,
291
- description: "NPU \u63A8\u7406 baseline \u4E4B\u4E0A profiling \u9A71\u52A8\u7684\u63A2\u7D22\u5F0F\u4F18\u5316\u7F16\u6392\uFF08Plan/round \u81EA\u5FAA\u73AF\uFF0C\u4E0E model-infer-optimize \u524D\u540E\u8854\u63A5\uFF09",
292
- version: "1.0.0",
293
- configFile: "AGENTS.md",
294
- configRootConfigLink: true,
295
- installSkills: [
296
- {
297
- dir: "model",
298
- skills: [
299
- "model-infer-migrator",
300
- "model-infer-parallel-analysis",
301
- "model-infer-parallel-impl",
302
- "model-infer-kvcache",
303
- "model-infer-fusion",
304
- "model-infer-quantization",
305
- "model-infer-graph-mode",
306
- "model-infer-precision-debug",
307
- "model-infer-runtime-debug",
308
- "model-infer-multi-stream",
309
- "model-infer-prefetch",
310
- "model-infer-superkernel",
311
- "model-infer-profiling",
312
- "model-infer-perf-breakdown"
313
- ]
314
- }
315
- ],
316
- installAgents: [
317
- "model-infer-sota-scenario",
318
- "model-infer-sota-profiling-instrumenter",
319
- "model-infer-sota-profile-analyzer",
320
- "model-infer-sota-candidate",
321
- "model-infer-sota-implementer",
322
- "model-infer-sota-reviewer"
323
- ],
324
- externalRepos: [
325
- {
326
- url: "https://gitcode.com/cann/cann-recipes-infer.git",
327
- dir: "plugins-official/model-infer-sota-approach/cann-recipes-infer",
328
- depth: 1,
329
- configRootLink: true
330
- }
331
- ]
332
- },
333
- {
334
- id: "model-infer-optimize",
335
- dir: "plugins-official/model-infer-optimize",
336
- displayName: "NPU \u63A8\u7406\u4F18\u5316",
337
- script: "init.sh",
338
- aliases: [
339
- "model-infer",
340
- "infer",
341
- "inference"
342
- ],
343
- skills: 14,
344
- agents: 3,
345
- description: "NPU \u6A21\u578B\u63A8\u7406\u7AEF\u5230\u7AEF\u4F18\u5316\uFF08\u5E76\u884C/KVCache/\u878D\u5408/\u91CF\u5316/\u56FE\u6A21\u5F0F/\u591A\u6D41/SuperKernel\uFF09",
346
- version: "1.0.5",
347
- configFile: "AGENTS.md",
348
- configRootConfigLink: true,
349
- installSkills: [
350
- {
351
- dir: "model",
352
- skills: [
353
- "model-infer-migrator",
354
- "model-infer-parallel-analysis",
355
- "model-infer-parallel-impl",
356
- "model-infer-kvcache",
357
- "model-infer-fusion",
358
- "model-infer-quantization",
359
- "model-infer-graph-mode",
360
- "model-infer-precision-debug",
361
- "model-infer-runtime-debug",
362
- "model-infer-multi-stream",
363
- "model-infer-prefetch",
364
- "model-infer-superkernel",
365
- "model-infer-profiling",
366
- "model-infer-perf-breakdown"
367
- ]
368
- }
369
- ],
370
- installAgents: [
371
- "model-infer-analyzer",
372
- "model-infer-implementer",
373
- "model-infer-reviewer"
374
- ],
375
- externalRepos: [
376
- {
377
- url: "https://gitcode.com/cann/cann-recipes-infer.git",
378
- dir: "plugins-official/model-infer-optimize/cann-recipes-infer",
379
- depth: 1,
380
- configRootLink: true
381
- }
382
- ]
383
- },
384
- {
385
- id: "pypto-op-orchestrator",
386
- dir: "plugins-official/pypto-op-orchestrator",
387
- displayName: "PyPTO \u7B97\u5B50\u5F00\u53D1",
388
- script: "init.sh",
389
- aliases: [
390
- "pypto",
391
- "pytorch"
392
- ],
393
- skills: 8,
394
- agents: 3,
395
- description: "PyPTO Python API \u7B97\u5B50\u5168\u6D41\u7A0B\u5F00\u53D1\uFF0C\u8986\u76D6\u9700\u6C42\u7406\u89E3\u3001API \u63A2\u7D22\u3001\u5B9E\u73B0\u4E0E\u8C03\u4F18",
396
- version: "1.1.9",
397
- configFile: "AGENTS.md",
398
- configRootConfigLink: false,
399
- installSkills: [
385
+ },
400
386
  {
401
- dir: "ops",
402
- skills: [
403
- "pypto-intent-understand",
404
- "pypto-api-explore",
405
- "pypto-op-design",
406
- "pypto-op-develop",
407
- "pypto-precision-debug",
408
- "pypto-precision-compare",
409
- "pypto-op-perf-tune",
410
- "pypto-golden-generate"
387
+ id: "pypto-op-orchestrator",
388
+ dir: "plugins-official/pypto-op-orchestrator",
389
+ displayName: "PyPTO \u7B97\u5B50\u5F00\u53D1",
390
+ script: "init.sh",
391
+ aliases: [
392
+ "pypto",
393
+ "pytorch"
394
+ ],
395
+ skills: 8,
396
+ agents: 3,
397
+ description: "PyPTO Python API \u7B97\u5B50\u5168\u6D41\u7A0B\u5F00\u53D1\uFF0C\u8986\u76D6\u9700\u6C42\u7406\u89E3\u3001API \u63A2\u7D22\u3001\u5B9E\u73B0\u4E0E\u8C03\u4F18",
398
+ version: "1.1.9",
399
+ configFile: "AGENTS.md",
400
+ configRootConfigLink: false,
401
+ installSkills: [
402
+ {
403
+ dir: "ops",
404
+ skills: [
405
+ "pypto-intent-understand",
406
+ "pypto-api-explore",
407
+ "pypto-op-design",
408
+ "pypto-op-develop",
409
+ "pypto-precision-debug",
410
+ "pypto-precision-compare",
411
+ "pypto-op-perf-tune",
412
+ "pypto-golden-generate"
413
+ ]
414
+ }
415
+ ],
416
+ installAgents: [
417
+ "pypto-op-analyst",
418
+ "pypto-op-developer",
419
+ "pypto-op-perf-tuner"
420
+ ],
421
+ externalRepos: [
422
+ {
423
+ url: "https://gitcode.com/cann/pypto.git",
424
+ dir: "plugins-official/pypto-op-orchestrator/pypto",
425
+ configRootLink: false
426
+ }
411
427
  ]
412
- }
413
- ],
414
- installAgents: [
415
- "pypto-op-analyst",
416
- "pypto-op-developer",
417
- "pypto-op-perf-tuner"
418
- ],
419
- externalRepos: [
420
- {
421
- url: "https://gitcode.com/cann/pypto.git",
422
- dir: "plugins-official/pypto-op-orchestrator/pypto",
423
- configRootLink: false
424
- }
425
- ]
426
- },
427
- {
428
- id: "tilelang-op-orchestrator",
429
- dir: "plugins-official/tilelang-op-orchestrator",
430
- displayName: "TileLang \u7B97\u5B50\u5F00\u53D1",
431
- script: "init.sh",
432
- aliases: [
433
- "tilelang"
434
- ],
435
- skills: 9,
436
- agents: 3,
437
- description: "TileLang Python DSL + @tilelang.jit \u7B97\u5B50\u5F00\u53D1\uFF08\u652F\u6301 Developer/Expert \u53CC\u6A21\u5F0F\uFF09",
438
- version: "1.1.0",
439
- configFile: "AGENTS.md",
440
- configRootConfigLink: false,
441
- installSkills: [
428
+ },
442
429
  {
443
- dir: "ops",
444
- skills: [
445
- "tilelang-api-best-practices",
446
- "tilelang-env-check",
447
- "tilelang-op-design",
448
- "tilelang-op-develop",
449
- "tilelang-op-test-design",
450
- "tilelang-perf-optimization",
451
- "tilelang-programming-model-guide",
452
- "tilelang-review",
453
- "tilelang-submodule-pull"
430
+ id: "tilelang-op-orchestrator",
431
+ dir: "plugins-official/tilelang-op-orchestrator",
432
+ displayName: "TileLang \u7B97\u5B50\u5F00\u53D1",
433
+ script: "init.sh",
434
+ aliases: [
435
+ "tilelang"
436
+ ],
437
+ skills: 9,
438
+ agents: 3,
439
+ description: "TileLang Python DSL + @tilelang.jit \u7B97\u5B50\u5F00\u53D1\uFF08\u652F\u6301 Developer/Expert \u53CC\u6A21\u5F0F\uFF09",
440
+ version: "1.1.0",
441
+ configFile: "AGENTS.md",
442
+ configRootConfigLink: false,
443
+ installSkills: [
444
+ {
445
+ dir: "ops",
446
+ skills: [
447
+ "tilelang-api-best-practices",
448
+ "tilelang-env-check",
449
+ "tilelang-op-design",
450
+ "tilelang-op-develop",
451
+ "tilelang-op-test-design",
452
+ "tilelang-perf-optimization",
453
+ "tilelang-programming-model-guide",
454
+ "tilelang-review",
455
+ "tilelang-submodule-pull"
456
+ ]
457
+ }
458
+ ],
459
+ installAgents: [
460
+ "tilelang-op-analyst",
461
+ "tilelang-op-developer",
462
+ "tilelang-op-perf-tuner"
463
+ ],
464
+ externalRepos: [
465
+ {
466
+ url: "https://github.com/tile-ai/tilelang-ascend.git",
467
+ dir: "plugins-official/tilelang-op-orchestrator/tilelang-ascend",
468
+ depth: 1,
469
+ recursive: true,
470
+ configRootLink: false
471
+ }
454
472
  ]
455
- }
456
- ],
457
- installAgents: [
458
- "tilelang-op-analyst",
459
- "tilelang-op-developer",
460
- "tilelang-op-perf-tuner"
461
- ],
462
- externalRepos: [
463
- {
464
- url: "https://github.com/tile-ai/tilelang-ascend.git",
465
- dir: "plugins-official/tilelang-op-orchestrator/tilelang-ascend",
466
- depth: 1,
467
- recursive: true,
468
- configRootLink: false
469
- }
470
- ]
471
- },
472
- {
473
- id: "triton-op-generator",
474
- dir: "plugins-official/triton-op-generator",
475
- displayName: "Triton \u7B97\u5B50\u5F00\u53D1",
476
- script: "init.sh",
477
- aliases: [
478
- "triton"
479
- ],
480
- skills: 7,
481
- agents: 0,
482
- description: "Triton-Ascend \u7B97\u5B50 6 \u9636\u6BB5\u81EA\u52A8\u751F\u6210\u4E0E\u4F18\u5316\uFF08\u63CF\u8FF0\u2192\u4EE3\u7801\u2192\u9A8C\u8BC1\u2192\u4F18\u5316\uFF09",
483
- version: "1.0.2",
484
- configFile: "AGENTS.md",
485
- configRootConfigLink: false,
486
- installSkills: [
473
+ },
487
474
  {
488
- dir: "ops",
489
- skills: [
490
- "triton-task-extractor",
491
- "triton-op-designer",
492
- "triton-op-coding",
493
- "triton-op-verifier",
494
- "triton-latency-optimizer",
495
- "npu-arch",
496
- "triton-precision-debug"
497
- ]
498
- }
499
- ],
500
- installAgents: []
501
- },
502
- {
503
- id: "torch-compile",
504
- dir: "plugins-official/torch-compile",
505
- displayName: "torch.compile \u56FE\u6A21\u5F0F",
506
- script: "init.sh",
507
- aliases: [
508
- "torch",
509
- "compile",
510
- "graph"
511
- ],
512
- skills: 6,
513
- agents: 1,
514
- description: "NPU \u56FE\u6A21\u5F0F npugraph_ex \u914D\u7F6E\u3001\u811A\u672C\u8FC1\u79FB\u3001\u7F16\u8BD1\u8BCA\u65AD\u4E0E\u81EA\u5B9A\u4E49\u7B97\u5B50\u5165\u56FE",
515
- version: "1.0.4",
516
- configFile: "AGENTS.md",
517
- configRootConfigLink: true,
518
- installSkills: [
475
+ id: "triton-op-generator",
476
+ dir: "plugins-official/triton-op-generator",
477
+ displayName: "Triton \u7B97\u5B50\u5F00\u53D1",
478
+ script: "init.sh",
479
+ aliases: [
480
+ "triton"
481
+ ],
482
+ skills: 7,
483
+ agents: 0,
484
+ description: "Triton-Ascend \u7B97\u5B50 6 \u9636\u6BB5\u81EA\u52A8\u751F\u6210\u4E0E\u4F18\u5316\uFF08\u63CF\u8FF0\u2192\u4EE3\u7801\u2192\u9A8C\u8BC1\u2192\u4F18\u5316\uFF09",
485
+ version: "1.0.2",
486
+ configFile: "AGENTS.md",
487
+ configRootConfigLink: false,
488
+ installSkills: [
489
+ {
490
+ dir: "ops",
491
+ skills: [
492
+ "triton-task-extractor",
493
+ "triton-op-designer",
494
+ "triton-op-coding",
495
+ "triton-op-verifier",
496
+ "triton-latency-optimizer",
497
+ "npu-arch",
498
+ "triton-precision-debug"
499
+ ]
500
+ }
501
+ ],
502
+ installAgents: []
503
+ },
519
504
  {
520
- dir: "graph",
521
- skills: [
522
- "torch-npugraph-ex-knowledge",
523
- "torch-npugraph-ex-template",
524
- "torch-npugraph-ex-dfx-triage",
525
- "torch-npugraph-ex-compile-error-diagnosis",
526
- "torch-npugraph-ex-runtime-error-diagnosis",
527
- "torch-custom-ops-guide"
505
+ id: "torch-compile",
506
+ dir: "plugins-official/torch-compile",
507
+ displayName: "torch.compile \u56FE\u6A21\u5F0F",
508
+ script: "init.sh",
509
+ aliases: [
510
+ "torch",
511
+ "compile",
512
+ "graph"
513
+ ],
514
+ skills: 6,
515
+ agents: 1,
516
+ description: "NPU \u56FE\u6A21\u5F0F npugraph_ex \u914D\u7F6E\u3001\u811A\u672C\u8FC1\u79FB\u3001\u7F16\u8BD1\u8BCA\u65AD\u4E0E\u81EA\u5B9A\u4E49\u7B97\u5B50\u5165\u56FE",
517
+ version: "1.0.4",
518
+ configFile: "AGENTS.md",
519
+ configRootConfigLink: true,
520
+ installSkills: [
521
+ {
522
+ dir: "graph",
523
+ skills: [
524
+ "torch-npugraph-ex-knowledge",
525
+ "torch-npugraph-ex-template",
526
+ "torch-npugraph-ex-dfx-triage",
527
+ "torch-npugraph-ex-compile-error-diagnosis",
528
+ "torch-npugraph-ex-runtime-error-diagnosis",
529
+ "torch-custom-ops-guide"
530
+ ]
531
+ }
532
+ ],
533
+ installAgents: [
534
+ "torch-npugraph-ex"
528
535
  ]
529
- }
530
- ],
531
- installAgents: [
532
- "torch-npugraph-ex"
533
- ]
534
- },
535
- {
536
- id: "ops-code-reviewer",
537
- dir: "plugins-official/ops-code-reviewer",
538
- displayName: "\u4EE3\u7801\u68C0\u89C6",
539
- script: "init.sh",
540
- aliases: [
541
- "code-review",
542
- "reviewer",
543
- "review"
544
- ],
545
- skills: 5,
546
- agents: 2,
547
- description: "Ascend C \u7B97\u5B50\u4EE3\u7801 4 \u9636\u6BB5\u5168\u91CF\u68C0\u89C6\uFF08\u4E3B Agent \u7F16\u6392 + \u5B50 Agent \u5E76\u884C\u68C0\u89C6\uFF09",
548
- version: "1.1.0",
549
- configFile: "AGENTS.md",
550
- configRootConfigLink: false,
551
- installSkills: [
536
+ },
552
537
  {
553
- dir: "ops",
554
- skills: [
555
- "ascendc-code-review",
556
- "ascendc-docs-search",
557
- "ascendc-task-focus",
558
- "ascendc-api-best-practices",
559
- "npu-arch"
538
+ id: "ops-code-reviewer",
539
+ dir: "plugins-official/ops-code-reviewer",
540
+ displayName: "\u4EE3\u7801\u68C0\u89C6",
541
+ script: "init.sh",
542
+ aliases: [
543
+ "code-review",
544
+ "reviewer",
545
+ "review"
546
+ ],
547
+ skills: 5,
548
+ agents: 2,
549
+ description: "Ascend C \u7B97\u5B50\u4EE3\u7801 4 \u9636\u6BB5\u5168\u91CF\u68C0\u89C6\uFF08\u4E3B Agent \u7F16\u6392 + \u5B50 Agent \u5E76\u884C\u68C0\u89C6\uFF09",
550
+ version: "1.1.0",
551
+ configFile: "AGENTS.md",
552
+ configRootConfigLink: false,
553
+ installSkills: [
554
+ {
555
+ dir: "ops",
556
+ skills: [
557
+ "ascendc-code-review",
558
+ "ascendc-docs-search",
559
+ "ascendc-task-focus",
560
+ "ascendc-api-best-practices",
561
+ "npu-arch"
562
+ ]
563
+ }
564
+ ],
565
+ installAgents: [
566
+ "ascendc-code-summarizer",
567
+ "ascendc-ops-reviewer"
560
568
  ]
561
569
  }
562
- ],
563
- installAgents: [
564
- "ascendc-code-summarizer",
565
- "ascendc-ops-reviewer"
566
- ]
570
+ ];
567
571
  }
568
- ];
572
+ });
569
573
 
570
574
  // src/core/registry.ts
575
+ import { readdirSync, existsSync } from "fs";
576
+ import { join } from "path";
571
577
  function loadPlugins() {
572
578
  const plugins = [...embedded_plugins_default];
573
579
  plugins.sort(
@@ -575,8 +581,6 @@ function loadPlugins() {
575
581
  );
576
582
  return plugins;
577
583
  }
578
- var PLUGIN_REGISTRY = loadPlugins();
579
- var PLUGIN_DIRS = ["plugins-official", "plugins-community"];
580
584
  function mergeDynamicPlugins(repoPath) {
581
585
  if (!existsSync(repoPath)) return;
582
586
  const existingIds = new Set(PLUGIN_REGISTRY.map((p) => p.id));
@@ -637,412 +641,455 @@ function getAllPlugins() {
637
641
  function getPluginById(id) {
638
642
  return PLUGIN_REGISTRY.find((p) => p.id === id);
639
643
  }
644
+ var PLUGIN_REGISTRY, PLUGIN_DIRS;
645
+ var init_registry = __esm({
646
+ "src/core/registry.ts"() {
647
+ "use strict";
648
+ init_fs_helpers();
649
+ init_embedded_plugins();
650
+ PLUGIN_REGISTRY = loadPlugins();
651
+ PLUGIN_DIRS = ["plugins-official", "plugins-community"];
652
+ }
653
+ });
640
654
 
641
- // src/core/detector.ts
642
- import { execa } from "execa";
643
- import { existsSync as existsSync4 } from "fs";
644
- import { homedir as homedir2 } from "os";
645
- import { join as join4 } from "path";
655
+ // src/locales/zh_CN.json
656
+ var zh_CN_default;
657
+ var init_zh_CN = __esm({
658
+ "src/locales/zh_CN.json"() {
659
+ zh_CN_default = {
660
+ wizard_title: "CANNBot Install Helper",
661
+ wizard_detect: "\u6B63\u5728\u68C0\u6D4B\u5DF2\u5B89\u88C5\u7684 AI \u7F16\u7A0B\u5DE5\u5177...",
662
+ wizard_select_tool: "\u9009\u62E9 AI \u7F16\u7A0B\u5DE5\u5177",
663
+ wizard_select_level: "\u9009\u62E9\u5B89\u88C5\u4F4D\u7F6E",
664
+ wizard_select_plugin: "\u9009\u62E9\u8981\u5B89\u88C5\u7684\u63D2\u4EF6",
665
+ wizard_confirm: "\u786E\u8BA4\u5B89\u88C5",
666
+ wizard_detected_tool: "\u68C0\u6D4B\u5230",
667
+ wizard_confirm_tool: "\u4F7F\u7528",
668
+ wizard_last_used: "\u4E0A\u6B21\u4F7F\u7528",
669
+ wizard_already_installed: "\u5DF2\u5B89\u88C5",
670
+ install_repo_ready: "\u4ED3\u5E93\u5C31\u7EEA",
671
+ install_progress: "\u6B63\u5728\u5B89\u88C5",
672
+ install_done: "\u5B89\u88C5\u5B8C\u6210",
673
+ install_success: "\u6210\u529F",
674
+ install_already_installed: "\u5DF2\u5B89\u88C5",
675
+ install_reinstall_confirm: "\u662F\u5426\u91CD\u65B0\u5B89\u88C5\uFF08\u8986\u76D6\uFF09",
676
+ install_skip: "\u8DF3\u8FC7",
677
+ install_enhanced_next_steps: "\u4E0B\u4E00\u6B65",
678
+ install_enhanced_launch: "\u542F\u52A8",
679
+ install_enhanced_try: "\u8BD5\u8BD5",
680
+ install_enhanced_more: "\u66F4\u591A",
681
+ install_enhanced_check: "\u68C0\u67E5",
682
+ install_enhanced_docs: "\u6587\u6863",
683
+ update_updating: "\u6B63\u5728\u66F4\u65B0",
684
+ update_done: "\u66F4\u65B0\u5B8C\u6210",
685
+ update_no_plugins: "\u6682\u65E0\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6",
686
+ update_skipped: "\u5DF2\u8DF3\u8FC7",
687
+ doctor_title: "CANNBot Doctor",
688
+ doctor_tools: "AI \u5DE5\u5177",
689
+ doctor_plugins: "\u5DF2\u5B89\u88C5\u63D2\u4EF6",
690
+ doctor_links: "\u94FE\u63A5\u5B8C\u6574\u6027",
691
+ doctor_config: "\u914D\u7F6E\u6587\u4EF6",
692
+ doctor_result: "\u7ED3\u679C",
693
+ doctor_fix_cleaning: "\u6E05\u7406\u5931\u6548\u94FE\u63A5",
694
+ doctor_fix_rebuilding: "\u91CD\u5EFA\u76EE\u5F55",
695
+ info_description: "\u63CF\u8FF0",
696
+ info_skills: "Skills",
697
+ info_agents: "Agents",
698
+ info_status: "\u72B6\u6001",
699
+ info_quickstart: "\u5FEB\u901F\u5F00\u59CB",
700
+ info_not_found: "\u672A\u627E\u5230\u63D2\u4EF6",
701
+ lang_title: "\u8BED\u8A00\u8BBE\u7F6E",
702
+ lang_current: "\u5F53\u524D\u8BED\u8A00",
703
+ lang_set: "\u8BED\u8A00\u5DF2\u8BBE\u7F6E\u4E3A",
704
+ lang_invalid: "\u65E0\u6548\u7684\u8BED\u8A00\uFF0C\u652F\u6301: zh_CN, en_US",
705
+ list_title: "\u53EF\u7528\u573A\u666F",
706
+ list_id: "\u5E8F\u53F7",
707
+ list_name: "\u573A\u666F\u540D",
708
+ list_status: "\u72B6\u6001",
709
+ list_description: "\u63CF\u8FF0",
710
+ status_installed: "\u5DF2\u88C5",
711
+ status_not_installed: "\u672A\u88C5",
712
+ error_tool_not_found: "\u672A\u68C0\u6D4B\u5230\u4EFB\u4F55 AI \u7F16\u7A0B\u5DE5\u5177",
713
+ error_plugin_not_found: "\u672A\u627E\u5230\u63D2\u4EF6",
714
+ error_invalid_tool: "\u6682\u4E0D\u652F\u6301\u7684 AI \u5DE5\u5177: {tool}\n\u652F\u6301\u7684\u5DE5\u5177: {tools}",
715
+ error_invalid_level: "\u6682\u4E0D\u652F\u6301\u7684\u5B89\u88C5\u7EA7\u522B: {level}\n\u652F\u6301\u7684\u7EA7\u522B: {levels}",
716
+ error_skill_not_found: "\u672A\u5728\u6CE8\u518C\u8868\u4E2D\u627E\u5230 Skill",
717
+ error_source_not_found: "\u672A\u627E\u5230\u6E90\u6587\u4EF6: {path}",
718
+ error_script_not_found: "\u672A\u627E\u5230\u5B89\u88C5\u811A\u672C: {path}",
719
+ error_unknown: "\u672A\u77E5\u9519\u8BEF",
720
+ error_not_installed: "\u672A\u5B89\u88C5",
721
+ error_no_shell: "\u672A\u627E\u5230 bash \u6216 sh\uFF0C\u65E0\u6CD5\u6267\u884C\u5B89\u88C5\u811A\u672C\u3002\u8BF7\u5B89\u88C5 Git Bash \u6216 WSL",
722
+ error_symlink_windows: "\u521B\u5EFA\u7B26\u53F7\u94FE\u63A5\u5931\u8D25\uFF0C\u8BF7\u4EE5\u7BA1\u7406\u5458\u8EAB\u4EFD\u8FD0\u884C\u6216\u5F00\u542F Windows \u5F00\u53D1\u8005\u6A21\u5F0F",
723
+ skill_select_category: "\u9009\u62E9 Skill \u7C7B\u522B",
724
+ skill_select_items: "\u9009\u62E9\u8981\u5B89\u88C5\u7684 Skills",
725
+ skill_already_installed: "\u5DF2\u5B89\u88C5",
726
+ skill_select_all: "\u5168\u9009\u6240\u6709 Skills\uFF08\u5171 {count} \u4E2A\uFF09",
727
+ skill_select_all_category: "\u5168\u9009\u5F53\u524D\u7C7B\u522B",
728
+ skill_continue_or_install: "\u5DF2\u9009 {count} \u4E2A Skills\uFF0C\u8BF7\u9009\u62E9\u64CD\u4F5C",
729
+ skill_continue_select: "\u7EE7\u7EED\u9009\u62E9\u5176\u4ED6\u7C7B\u522B",
730
+ skill_confirm_install_count: "\u786E\u8BA4\u5B89\u88C5\uFF08\u5DF2\u9009 {count} \u4E2A Skills\uFF09",
731
+ skill_all_install_progress: "\u6B63\u5728\u5B89\u88C5\u5168\u90E8 {count} \u4E2A Skills...",
732
+ skill_install_progress: "\u6B63\u5728\u5B89\u88C5",
733
+ skill_install_done: "Skill \u5B89\u88C5\u5B8C\u6210",
734
+ skill_uninstall_done: "Skill \u5378\u8F7D\u5B8C\u6210",
735
+ skill_list_title: "\u53EF\u7528 Skills",
736
+ wizard_select_mode: "\u9009\u62E9\u5B89\u88C5\u7C7B\u578B",
737
+ wizard_mode_plugin: "\u5B89\u88C5 Plugin",
738
+ wizard_mode_plugin_desc: "\u5B8C\u6574\u5F00\u53D1\u5DE5\u4F5C\u6D41\uFF08Skills + Agents + \u914D\u7F6E\u6587\u4EF6\uFF09",
739
+ wizard_mode_skill: "\u5B89\u88C5 Skill",
740
+ wizard_mode_skill_desc: "\u4EC5\u5B89\u88C5\u9886\u57DF\u77E5\u8BC6\u6280\u80FD\uFF0C\u8BA9 AI \u638C\u63E1\u7279\u5B9A\u80FD\u529B",
741
+ wizard_back: "\u8FD4\u56DE",
742
+ wizard_cancel: "\u9000\u51FA",
743
+ wizard_no_selection: "\u672A\u9009\u62E9\u4EFB\u4F55\u9879\uFF0C\u8BF7\u9009\u62E9\u64CD\u4F5C",
744
+ wizard_back_to_reselect: "\u8FD4\u56DE",
745
+ status_title: "\u5DF2\u5B89\u88C5\u63D2\u4EF6",
746
+ status_none: "\u6682\u65E0\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6",
747
+ status_hint: "\u8FD0\u884C install-helper init \u5F00\u59CB\u5B89\u88C5",
748
+ status_install_time: "\u5B89\u88C5\u65F6\u95F4",
749
+ install_installed_to: "\u5B89\u88C5\u5230",
750
+ install_skills_count: "Skills",
751
+ install_agents_count: "Agents",
752
+ lang_supported: "\u652F\u6301\u7684\u8BED\u8A00: zh_CN, en_US",
753
+ lang_usage: "\u7528\u6CD5: install-helper lang set <language>",
754
+ lang_specify: "\u8BF7\u6307\u5B9A\u8BED\u8A00: install-helper lang set zh_CN",
755
+ lang_unknown_action: "\u672A\u77E5\u64CD\u4F5C",
756
+ lang_supported_actions: "\u652F\u6301\u7684\u64CD\u4F5C: show, set",
757
+ info_aliases: "\u522B\u540D",
758
+ uninstall_not_found: "\u672A\u627E\u5230",
759
+ uninstall_no_record: "\u672A\u627E\u5230\u5B89\u88C5\u8BB0\u5F55\uFF0C\u53EF\u80FD\u672A\u5B89\u88C5\u6216\u5B89\u88C5\u8BB0\u5F55\u5DF2\u635F\u574F",
760
+ uninstall_no_record_hint: "\u5982\u9700\u5F3A\u5236\u6E05\u7406\uFF0C\u8BF7\u624B\u52A8\u5220\u9664 .opencode/ \u6216 .claude/ \u76EE\u5F55\u4E2D\u7684\u76F8\u5173\u6587\u4EF6",
761
+ uninstall_in_progress: "\u6B63\u5728\u5378\u8F7D",
762
+ uninstall_summary_format: "{name}\uFF08\u79FB\u9664 {files} \u4E2A\u6587\u4EF6\uFF0C{dirs} \u4E2A\u76EE\u5F55\uFF09",
763
+ uninstall_files_gone: "\u7684\u6587\u4EF6\u5DF2\u4E0D\u5B58\u5728\uFF0C\u5DF2\u6E05\u7406\u5B89\u88C5\u8BB0\u5F55",
764
+ uninstall_skills_in_progress: "\u6B63\u5728\u5378\u8F7D",
765
+ init_pkg_dir_warn: "\u5F53\u524D\u76EE\u5F55\u770B\u8D77\u6765\u662F install-helper \u5305\u76EE\u5F55",
766
+ init_pkg_dir_hint: "\u8BF7\u5728\u4F60\u7684\u9879\u76EE\u76EE\u5F55\u4E2D\u8FD0\u884C\u6B64\u547D\u4EE4\uFF0C\u800C\u4E0D\u662F\u5728 install-helper \u5B89\u88C5\u76EE\u5F55\u4E2D",
767
+ init_pkg_dir_example: "\u793A\u4F8B\uFF1Acd ~/my-project && install-helper",
768
+ init_cancelled: "\u5DF2\u53D6\u6D88\u5B89\u88C5",
769
+ backup_detected: "\u68C0\u6D4B\u5230\u5F53\u524D\u76EE\u5F55\u5DF2\u5B89\u88C5\u63D2\u4EF6",
770
+ backup_current: "\u5F53\u524D\u5B89\u88C5",
771
+ backup_installing: "\u5373\u5C06\u5B89\u88C5",
772
+ backup_overwrite_warning: "\u7EE7\u7EED\u5B89\u88C5\u5C06\u8986\u76D6\u73B0\u6709\u7684 AGENTS.md \u914D\u7F6E\u6587\u4EF6\u3002",
773
+ backup_auto_create: "\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u521B\u5EFA\u5907\u4EFD\uFF0C\u4EE5\u4FBF\u540E\u7EED\u6062\u590D\u3002",
774
+ backup_overwrite: "\u8986\u76D6\u5B89\u88C5\uFF08\u81EA\u52A8\u5907\u4EFD\uFF09",
775
+ backup_cancel: "\u53D6\u6D88\u5B89\u88C5",
776
+ backup_restore_prompt: "\u68C0\u6D4B\u5230\u5907\u4EFD\u914D\u7F6E\uFF0C\u662F\u5426\u6062\u590D\uFF1F",
777
+ backup_restore: "\u6062\u590D",
778
+ backup_only_uninstall: "\u4EC5\u5378\u8F7D\uFF08\u4E0D\u6062\u590D\uFF09",
779
+ backup_select_action: "\u8BF7\u9009\u62E9\u64CD\u4F5C",
780
+ backup_restore_success: "\u5DF2\u6062\u590D\u914D\u7F6E",
781
+ backup_created: "\u5DF2\u521B\u5EFA\u5907\u4EFD",
782
+ backup_failed: "\u5907\u4EFD\u521B\u5EFA\u5931\u8D25\uFF0C\u5B89\u88C5\u5DF2\u4E2D\u6B62\u4EE5\u4FDD\u62A4\u73B0\u6709\u914D\u7F6E",
783
+ loading_skills_list: "\u6B63\u5728\u52A0\u8F7D Skills \u5217\u8868...",
784
+ loading_skills_list_complete: "Skills \u5217\u8868\u52A0\u8F7D\u5B8C\u6210",
785
+ loading_plugin_data: "\u6B63\u5728\u52A0\u8F7D\u63D2\u4EF6\u6570\u636E...",
786
+ loading_plugin_data_complete: "\u63D2\u4EF6\u6570\u636E\u52A0\u8F7D\u5B8C\u6210",
787
+ loading_skills_list_failed: "Skills \u5217\u8868\u52A0\u8F7D\u5931\u8D25\uFF0C\u5C06\u4F7F\u7528\u5185\u7F6E\u6570\u636E",
788
+ repo_pull_failed: "\u65E0\u6CD5\u62C9\u53D6\u6700\u65B0\u5185\u5BB9\uFF0C\u4F7F\u7528\u7F13\u5B58\u6570\u636E",
789
+ repo_cloning: "\u9996\u6B21\u4F7F\u7528\uFF0C\u6B63\u5728\u514B\u9686 cannbot-skills \u4ED3\u5E93...",
790
+ repo_clone_failed: "\u514B\u9686\u4ED3\u5E93\u5931\u8D25: {error}\n\u8BF7\u624B\u52A8\u514B\u9686: git clone {url} {dir}",
791
+ external_repo_update_failed: "\u5916\u90E8\u4ED3\u5E93\u66F4\u65B0\u5931\u8D25\uFF0C\u4F7F\u7528\u73B0\u6709\u7248\u672C: {dir}",
792
+ config_corrupted: "\u914D\u7F6E\u6587\u4EF6\u5DF2\u635F\u574F\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E",
793
+ record_corrupted: "\u5B89\u88C5\u8BB0\u5F55\u5DF2\u635F\u574F\uFF1A{file}",
794
+ skill_record_corrupted: "Skill \u5B89\u88C5\u8BB0\u5F55\u5DF2\u635F\u574F",
795
+ record_write_failed: "\u5B89\u88C5\u8BB0\u5F55\u5199\u5165\u5931\u8D25\uFF0C\u5378\u8F7D\u65F6\u53EF\u80FD\u65E0\u6CD5\u81EA\u52A8\u6E05\u7406",
796
+ install_config_failed: "\u914D\u7F6E\u6587\u4EF6\u5B89\u88C5\u5931\u8D25: {error}",
797
+ install_clone_failed: "git clone \u5931\u8D25: {url}\uFF0C\u8BF7\u624B\u52A8\u514B\u9686: git clone {url} {dir}",
798
+ install_link_config_failed: "\u94FE\u63A5 {name} \u5230\u914D\u7F6E\u76EE\u5F55\u5931\u8D25",
799
+ install_link_project_failed: "\u94FE\u63A5 {name} \u5230\u9879\u76EE\u76EE\u5F55\u5931\u8D25",
800
+ install_link_workflows_failed: "\u94FE\u63A5 workflows \u5230\u914D\u7F6E\u76EE\u5F55\u5931\u8D25",
801
+ install_skill_source_not_found: "Skill \u6E90\u76EE\u5F55\u672A\u627E\u5230: {dir}",
802
+ install_skill_not_found: "Skill \u672A\u627E\u5230: {name} (\u5728 {dir})",
803
+ install_skill_failed: "Skill \u5B89\u88C5\u5931\u8D25: {name}",
804
+ install_agent_not_found: "Agent \u672A\u627E\u5230: {name}",
805
+ install_agent_failed: "Agent \u5B89\u88C5\u5931\u8D25: {name}",
806
+ install_no_skill_selected: "\u672A\u9009\u62E9\u4EFB\u4F55 Skill",
807
+ install_to: "\u5B89\u88C5\u5230",
808
+ start_to_use: "\u542F\u52A8 {tool} \u5373\u53EF\u4F7F\u7528",
809
+ wizard_step_1_title: "[1/4] \u9009\u62E9 AI \u7F16\u7A0B\u5DE5\u5177",
810
+ wizard_step_2_title: "[2/4] \u9009\u62E9\u5B89\u88C5\u4F4D\u7F6E",
811
+ wizard_step_3_title: "[3/4] \u9009\u62E9\u8981\u5B89\u88C5\u7684\u63D2\u4EF6",
812
+ wizard_step_4_title: "[4/4] \u786E\u8BA4\u5B89\u88C5",
813
+ wizard_step_3_skill_title: "[3/4] \u9009\u62E9 Skill \u7C7B\u522B",
814
+ wizard_step_4_skill_title: "[4/4] \u9009\u62E9\u8981\u5B89\u88C5\u7684 Skills \u2014 {category}",
815
+ install_level_project: "\u5B89\u88C5\u5230\u5F53\u524D\u76EE\u5F55\uFF08\u63A8\u8350\uFF0C\u4EC5\u5F53\u524D\u9879\u76EE\u53EF\u7528\uFF09",
816
+ install_level_global: "\u5B89\u88C5\u5230\u5168\u5C40\uFF08\u6240\u6709\u9879\u76EE\u5171\u4EAB\uFF09",
817
+ wizard_select_mode_title: "\u9009\u62E9\u5B89\u88C5\u7C7B\u578B",
818
+ skill_count_format: "{count} \u4E2A Skills",
819
+ result_success_format: "{count} \u6210\u529F",
820
+ result_failed_format: "{count} \u5931\u8D25",
821
+ uninstall_remove_label: "\u79FB\u9664",
822
+ uninstall_clean_empty_dir: "\u6E05\u7406\u7A7A\u76EE\u5F55",
823
+ uninstall_skill_not_installed: "\u672A\u5B89\u88C5",
824
+ available_plugins: "\u53EF\u7528\u63D2\u4EF6",
825
+ available_skills: "\u53EF\u7528 Skills",
826
+ skill_total_count: "\u5171 {count} \u4E2A Skills",
827
+ wizard_confirm_install_format: "\u5373\u5C06\u5B89\u88C5 {count} \u4E2A\u63D2\u4EF6\u5230 {tool}\uFF08{level} \u7EA7\u522B\uFF09\uFF1A",
828
+ wizard_install_path: "\u5B89\u88C5\u8DEF\u5F84",
829
+ update_install_hint: "\u4F7F\u7528 {cmd} \u5B89\u88C5\u63D2\u4EF6",
830
+ hint_select_move: "\u79FB\u52A8",
831
+ hint_select_space: "\u7A7A\u683C",
832
+ hint_select_check: "\u52FE\u9009",
833
+ hint_select_confirm: "\u786E\u8BA4",
834
+ hint_checkbox_suffix: "\u4E0D\u9009\u6309\u56DE\u8F66\u53EF\u8FD4\u56DE",
835
+ doctor_not_installed: "\u672A\u5B89\u88C5",
836
+ doctor_links_valid: "{count} \u4E2A\u8F6F\u94FE\u63A5\u5747\u6709\u6548",
837
+ doctor_broken_links: "{count} \u4E2A\u5931\u6548\u94FE\u63A5",
838
+ doctor_fixed: "\u5DF2\u6E05\u7406 {count} \u4E2A\u5931\u6548\u94FE\u63A5",
839
+ doctor_not_exist: "\u4E0D\u5B58\u5728",
840
+ doctor_created: "\u5DF2\u521B\u5EFA {path}",
841
+ doctor_config_exists: "\u5B58\u5728",
842
+ doctor_config_not_exist: "\u4E0D\u5B58\u5728",
843
+ doctor_result_with_fix: "{warnings} \u4E2A\u8B66\u544A, {fixes} \u9879\u5DF2\u4FEE\u590D",
844
+ doctor_result_without_fix: "{warnings} \u4E2A\u8B66\u544A",
845
+ count_suffix: "\u4E2A",
846
+ try_prompt: "\u5E2E\u6211\u5F00\u53D1\u4E00\u4E2A Abs \u7B97\u5B50",
847
+ uninstall_interactive_title: "\u7BA1\u7406\u5DF2\u5B89\u88C5\u7684\u5185\u5BB9 \u2014 \u53D6\u6D88\u52FE\u9009\u8981\u5378\u8F7D\u7684\u9879",
848
+ uninstall_select_type: "\u9009\u62E9\u8981\u5378\u8F7D\u7684\u7C7B\u578B",
849
+ uninstall_type_skill: "\u5378\u8F7D Skills",
850
+ uninstall_type_plugin: "\u5378\u8F7D Plugins",
851
+ uninstall_checkbox_hint: "\u52FE\u9009=\u4FDD\u7559\uFF0C\u53D6\u6D88\u52FE\u9009=\u5378\u8F7D",
852
+ uninstall_uncheck_all: "\u5168\u4E0D\u9009\uFF08\u6807\u8BB0\u5168\u90E8\u5378\u8F7D\uFF09",
853
+ uninstall_confirm_count: "\u786E\u8BA4\u5378\u8F7D\uFF08{count} \u4E2A\u5C06\u5378\u8F7D\uFF09",
854
+ uninstall_no_installed: "\u6CA1\u6709\u5DF2\u5B89\u88C5\u7684 Skills \u6216 Plugins",
855
+ uninstall_no_installed_skills: "\u6CA1\u6709\u5DF2\u5B89\u88C5\u7684 Skills",
856
+ uninstall_no_installed_plugins: "\u6CA1\u6709\u5DF2\u5B89\u88C5\u7684 Plugins",
857
+ uninstall_nothing_to_uninstall: "\u6CA1\u6709\u9700\u8981\u5378\u8F7D\u7684\u9879\u76EE",
858
+ uninstall_all_progress: "\u6B63\u5728\u5378\u8F7D\u5168\u90E8 {count} \u4E2A Skills...",
859
+ uninstall_all_summary: "\u5373\u5C06\u5378\u8F7D {skills} \u4E2A Skills \u548C {plugins} \u4E2A Plugins\uFF1A",
860
+ uninstall_all_done: "\u6279\u91CF\u5378\u8F7D\u5B8C\u6210",
861
+ uninstall_recent_no_history: "\u65E0\u5B89\u88C5\u6279\u6B21\u8BB0\u5F55\uFF0C\u65E0\u6CD5\u8BC6\u522B\u6700\u8FD1\u5B89\u88C5\u7684 Skills",
862
+ uninstall_recent_progress: "\u5373\u5C06\u5378\u8F7D\u6700\u8FD1\u5B89\u88C5\u7684 {count} \u4E2A Skills\uFF1A",
863
+ uninstall_plugin_batch_progress: "\u6B63\u5728\u6279\u91CF\u5378\u8F7D {count} \u4E2A\u63D2\u4EF6...",
864
+ uninstall_plugin_batch_skip_restore: "\u6279\u91CF\u5378\u8F7D\u6A21\u5F0F\uFF1A\u8DF3\u8FC7\u5907\u4EFD\u6062\u590D",
865
+ uninstall_confirm_prompt: "\u5373\u5C06\u5378\u8F7D {count} \u9879\uFF0C\u786E\u8BA4\uFF1F",
866
+ uninstall_select_items: "\u7BA1\u7406\u5DF2\u5B89\u88C5\u7684 Skills\uFF08\u7A7A\u683C\u5207\u6362\uFF0C\u56DE\u8F66\u786E\u8BA4\uFF09",
867
+ uninstall_select_plugins: "\u7BA1\u7406\u5DF2\u5B89\u88C5\u7684 Plugins\uFF08\u7A7A\u683C\u5207\u6362\uFF0C\u56DE\u8F66\u786E\u8BA4\uFF09"
868
+ };
869
+ }
870
+ });
646
871
 
647
- // src/utils/paths.ts
648
- import { homedir } from "os";
649
- import { join as join3 } from "path";
650
- import { existsSync as existsSync3 } from "fs";
872
+ // src/locales/en_US.json
873
+ var en_US_default;
874
+ var init_en_US = __esm({
875
+ "src/locales/en_US.json"() {
876
+ en_US_default = {
877
+ wizard_title: "CANNBot Install Helper",
878
+ wizard_detect: "Detecting installed AI coding tools...",
879
+ wizard_select_tool: "Select AI coding tool",
880
+ wizard_select_level: "Select install level",
881
+ wizard_select_plugin: "Select a scenario to install",
882
+ wizard_confirm: "Confirm installation",
883
+ wizard_detected_tool: "Detected",
884
+ wizard_confirm_tool: "Confirm using",
885
+ wizard_last_used: "last used",
886
+ wizard_already_installed: "installed",
887
+ install_repo_ready: "Repository ready",
888
+ install_progress: "Installing",
889
+ install_done: "Installation complete",
890
+ install_success: "success",
891
+ install_already_installed: "already installed",
892
+ install_reinstall_confirm: "Reinstall (overwrite)",
893
+ install_skip: "skipped",
894
+ install_enhanced_next_steps: "Next steps",
895
+ install_enhanced_launch: "Launch",
896
+ install_enhanced_try: "Try",
897
+ install_enhanced_more: "More",
898
+ install_enhanced_check: "Check",
899
+ install_enhanced_docs: "Docs",
900
+ update_updating: "Updating",
901
+ update_done: "Update complete",
902
+ update_no_plugins: "No installed plugins",
903
+ update_skipped: "skipped",
904
+ doctor_title: "CANNBot Doctor",
905
+ doctor_tools: "AI Tools",
906
+ doctor_plugins: "Installed Plugins",
907
+ doctor_links: "Link Integrity",
908
+ doctor_config: "Configuration",
909
+ doctor_result: "Result",
910
+ doctor_fix_cleaning: "Cleaning broken links",
911
+ doctor_fix_rebuilding: "Rebuilding directories",
912
+ info_description: "Description",
913
+ info_skills: "Skills",
914
+ info_agents: "Agents",
915
+ info_status: "Status",
916
+ info_quickstart: "Quick Start",
917
+ info_not_found: "Plugin not found",
918
+ lang_title: "Language Settings",
919
+ lang_current: "Current language",
920
+ lang_set: "Language set to",
921
+ lang_invalid: "Invalid language, supported: zh_CN, en_US",
922
+ list_title: "Available Scenarios",
923
+ list_id: "#",
924
+ list_name: "Name",
925
+ list_status: "Status",
926
+ list_description: "Description",
927
+ status_installed: "installed",
928
+ status_not_installed: "not installed",
929
+ error_tool_not_found: "No AI coding tool detected",
930
+ error_plugin_not_found: "Plugin not found",
931
+ error_invalid_tool: "Unsupported AI tool: {tool}\nSupported tools: {tools}",
932
+ error_invalid_level: "Unsupported install level: {level}\nSupported levels: {levels}",
933
+ error_skill_not_found: "Skill not found in registry",
934
+ error_source_not_found: "Source not found: {path}",
935
+ error_script_not_found: "Script not found: {path}",
936
+ error_unknown: "Unknown error",
937
+ error_not_installed: "Not installed",
938
+ error_no_shell: "bash or sh not found, cannot execute install script. Please install Git Bash or WSL",
939
+ error_symlink_windows: "Failed to create symlink, please run as administrator or enable Windows Developer Mode",
940
+ skill_select_category: "Select Skill category",
941
+ skill_select_items: "Select Skills to install (space to toggle, enter to confirm)",
942
+ skill_already_installed: "installed",
943
+ skill_select_all: "Select ALL Skills ({count} total)",
944
+ skill_select_all_category: "Select all in this category",
945
+ skill_continue_or_install: "{count} Skills selected, choose an action",
946
+ skill_continue_select: "Continue selecting from other categories",
947
+ skill_confirm_install_count: "Install now ({count} Skills selected)",
948
+ skill_all_install_progress: "Installing all {count} Skills...",
949
+ skill_install_progress: "Installing",
950
+ skill_install_done: "Skill installation complete",
951
+ skill_uninstall_done: "Skill uninstallation complete",
952
+ skill_list_title: "Available Skills",
953
+ wizard_select_mode: "Select installation mode",
954
+ wizard_mode_plugin: "Install Plugin",
955
+ wizard_mode_plugin_desc: "Full development workflow (Skills + Agents + config)",
956
+ wizard_mode_skill: "Install Skill",
957
+ wizard_mode_skill_desc: "Domain knowledge only, give AI specific capabilities",
958
+ wizard_back: "Go back",
959
+ wizard_cancel: "Cancel installation",
960
+ wizard_no_selection: "No items selected, please choose an action",
961
+ wizard_back_to_reselect: "Go back",
962
+ status_title: "Installed Plugins",
963
+ status_none: "No installed plugins",
964
+ status_hint: "Run install-helper init to start",
965
+ status_install_time: "Installed at",
966
+ install_installed_to: "Installed to",
967
+ install_skills_count: "Skills",
968
+ install_agents_count: "Agents",
969
+ lang_supported: "Supported languages: zh_CN, en_US",
970
+ lang_usage: "Usage: install-helper lang set <language>",
971
+ lang_specify: "Please specify language: install-helper lang set zh_CN",
972
+ lang_unknown_action: "Unknown action",
973
+ lang_supported_actions: "Supported actions: show, set",
974
+ info_aliases: "Aliases",
975
+ uninstall_not_found: "Not found",
976
+ uninstall_no_record: "No install record found, may not be installed or record is corrupted",
977
+ uninstall_no_record_hint: "For manual cleanup, delete related files in .opencode/ or .claude/ directory",
978
+ uninstall_in_progress: "Uninstalling",
979
+ uninstall_summary_format: "{name} (removed {files} files, {dirs} directories)",
980
+ uninstall_files_gone: " files no longer exist, install record cleaned",
981
+ uninstall_skills_in_progress: "Uninstalling",
982
+ init_pkg_dir_warn: "Current directory appears to be the install-helper package directory",
983
+ init_pkg_dir_hint: "Please run this command in your project directory, not in the install-helper package directory",
984
+ init_pkg_dir_example: "Example: cd ~/my-project && install-helper",
985
+ init_cancelled: "Installation cancelled",
986
+ backup_detected: "Plugin already installed in current directory",
987
+ backup_current: "Currently installed",
988
+ backup_installing: "About to install",
989
+ backup_overwrite_warning: "Continuing will overwrite existing AGENTS.md configuration.",
990
+ backup_auto_create: "System will automatically create backup for future restoration.",
991
+ backup_overwrite: "Overwrite (auto backup)",
992
+ backup_cancel: "Cancel installation",
993
+ backup_restore_prompt: "Backup configuration detected, restore?",
994
+ backup_restore: "Restore",
995
+ backup_only_uninstall: "Uninstall only (no restore)",
996
+ backup_select_action: "Please select an action",
997
+ backup_restore_success: "Configuration restored",
998
+ backup_created: "Backup created",
999
+ backup_failed: "Backup creation failed, installation aborted to protect existing config",
1000
+ loading_skills_list: "Loading Skills list...",
1001
+ loading_skills_list_complete: "Skills list loaded",
1002
+ loading_plugin_data: "Loading plugin data...",
1003
+ loading_plugin_data_complete: "Plugin data loaded",
1004
+ loading_skills_list_failed: "Failed to load Skills list, using built-in data",
1005
+ repo_pull_failed: "Failed to pull latest updates, using cached data",
1006
+ repo_cloning: "First-time setup: cloning cannbot-skills repository...",
1007
+ repo_clone_failed: "Failed to clone repository: {error}\nClone manually: git clone {url} {dir}",
1008
+ external_repo_update_failed: "External repo update failed, using existing version: {dir}",
1009
+ config_corrupted: "Config file corrupted, using defaults",
1010
+ record_corrupted: "Install record corrupted: {file}",
1011
+ skill_record_corrupted: "Skill install record corrupted",
1012
+ record_write_failed: "Install record write failed, uninstall may not work properly",
1013
+ install_config_failed: "Failed to install config file: {error}",
1014
+ install_clone_failed: "git clone failed: {url}, clone manually: git clone {url} {dir}",
1015
+ install_link_config_failed: "Failed to link {name} to config directory",
1016
+ install_link_project_failed: "Failed to link {name} to project directory",
1017
+ install_link_workflows_failed: "Failed to link workflows to config directory",
1018
+ install_skill_source_not_found: "Skill source not found: {dir}",
1019
+ install_skill_not_found: "Skill not found: {name} in {dir}",
1020
+ install_skill_failed: "Failed to install skill: {name}",
1021
+ install_agent_not_found: "Agent not found: {name}",
1022
+ install_agent_failed: "Failed to install agent: {name}",
1023
+ install_no_skill_selected: "No Skill selected",
1024
+ install_to: "Install to",
1025
+ start_to_use: "Start {tool} to use",
1026
+ wizard_step_1_title: "[1/4] Select AI coding tool",
1027
+ wizard_step_2_title: "[2/4] Select installation location",
1028
+ wizard_step_3_title: "[3/4] Select plugins to install",
1029
+ wizard_step_4_title: "[4/4] Confirm installation",
1030
+ wizard_step_3_skill_title: "[3/4] Select Skill category",
1031
+ wizard_step_4_skill_title: "[4/4] Select Skills to install \u2014 {category}",
1032
+ install_level_project: "Install to current directory (recommended, current project only)",
1033
+ install_level_global: "Install globally (all projects)",
1034
+ wizard_select_mode_title: "Select installation type",
1035
+ skill_count_format: "{count} Skills",
1036
+ result_success_format: "{count} succeeded",
1037
+ result_failed_format: "{count} failed",
1038
+ uninstall_remove_label: "Removed",
1039
+ uninstall_clean_empty_dir: "Cleaned empty directory",
1040
+ uninstall_skill_not_installed: "Not installed",
1041
+ available_plugins: "Available plugins",
1042
+ available_skills: "Available Skills",
1043
+ skill_total_count: "Total {count} Skills",
1044
+ wizard_confirm_install_format: "About to install {count} plugins to {tool} ({level} level):",
1045
+ wizard_install_path: "Install path",
1046
+ update_install_hint: "Use {cmd} to install plugins",
1047
+ hint_select_move: "Navigate",
1048
+ hint_select_space: "Space",
1049
+ hint_select_check: "Toggle",
1050
+ hint_select_confirm: "Confirm",
1051
+ hint_checkbox_suffix: "Press enter without selection to go back",
1052
+ doctor_not_installed: "Not installed",
1053
+ doctor_links_valid: "{count} symlinks all valid",
1054
+ doctor_broken_links: "{count} broken links",
1055
+ doctor_fixed: "Cleaned {count} broken links",
1056
+ doctor_not_exist: "Does not exist",
1057
+ doctor_created: "Created {path}",
1058
+ doctor_config_exists: "Exists",
1059
+ doctor_config_not_exist: "Does not exist",
1060
+ doctor_result_with_fix: "{warnings} warnings, {fixes} fixed",
1061
+ doctor_result_without_fix: "{warnings} warnings",
1062
+ count_suffix: "",
1063
+ try_prompt: "help me develop an Abs operator",
1064
+ uninstall_interactive_title: "Manage installed items \u2014 uncheck to uninstall",
1065
+ uninstall_select_type: "Select type to uninstall",
1066
+ uninstall_type_skill: "Uninstall Skills",
1067
+ uninstall_type_plugin: "Uninstall Plugins",
1068
+ uninstall_checkbox_hint: "Checked = keep, unchecked = uninstall",
1069
+ uninstall_uncheck_all: "Uncheck all (mark all for uninstall)",
1070
+ uninstall_confirm_count: "Confirm uninstall ({count} will be removed)",
1071
+ uninstall_no_installed: "No installed Skills or Plugins",
1072
+ uninstall_no_installed_skills: "No installed Skills",
1073
+ uninstall_no_installed_plugins: "No installed Plugins",
1074
+ uninstall_nothing_to_uninstall: "Nothing to uninstall",
1075
+ uninstall_all_progress: "Uninstalling all {count} Skills...",
1076
+ uninstall_all_summary: "About to uninstall {skills} Skills and {plugins} Plugins:",
1077
+ uninstall_all_done: "Batch uninstall complete",
1078
+ uninstall_recent_no_history: "No install batch history, cannot identify recently installed Skills",
1079
+ uninstall_recent_progress: "About to uninstall {count} recently installed Skills:",
1080
+ uninstall_plugin_batch_progress: "Batch uninstalling {count} plugins...",
1081
+ uninstall_plugin_batch_skip_restore: "Batch mode: skipping backup restore",
1082
+ uninstall_confirm_prompt: "About to uninstall {count} items, confirm?",
1083
+ uninstall_select_items: "Manage installed Skills (space to toggle, enter to confirm)",
1084
+ uninstall_select_plugins: "Manage installed Plugins (space to toggle, enter to confirm)"
1085
+ };
1086
+ }
1087
+ });
651
1088
 
652
1089
  // src/utils/i18n.ts
653
1090
  import { readFileSync, existsSync as existsSync2 } from "fs";
654
1091
  import { join as join2, dirname } from "path";
655
1092
  import { fileURLToPath } from "url";
656
-
657
- // src/locales/zh_CN.json
658
- var zh_CN_default = {
659
- wizard_title: "CANNBot Install Helper",
660
- wizard_detect: "\u6B63\u5728\u68C0\u6D4B\u5DF2\u5B89\u88C5\u7684 AI \u7F16\u7A0B\u5DE5\u5177...",
661
- wizard_select_tool: "\u9009\u62E9 AI \u7F16\u7A0B\u5DE5\u5177",
662
- wizard_select_level: "\u9009\u62E9\u5B89\u88C5\u4F4D\u7F6E",
663
- wizard_select_plugin: "\u9009\u62E9\u8981\u5B89\u88C5\u7684\u63D2\u4EF6",
664
- wizard_confirm: "\u786E\u8BA4\u5B89\u88C5",
665
- wizard_detected_tool: "\u68C0\u6D4B\u5230",
666
- wizard_confirm_tool: "\u4F7F\u7528",
667
- wizard_last_used: "\u4E0A\u6B21\u4F7F\u7528",
668
- wizard_already_installed: "\u5DF2\u5B89\u88C5",
669
- install_repo_ready: "\u4ED3\u5E93\u5C31\u7EEA",
670
- install_progress: "\u6B63\u5728\u5B89\u88C5",
671
- install_done: "\u5B89\u88C5\u5B8C\u6210",
672
- install_success: "\u6210\u529F",
673
- install_already_installed: "\u5DF2\u5B89\u88C5",
674
- install_reinstall_confirm: "\u662F\u5426\u91CD\u65B0\u5B89\u88C5\uFF08\u8986\u76D6\uFF09",
675
- install_skip: "\u8DF3\u8FC7",
676
- install_enhanced_next_steps: "\u4E0B\u4E00\u6B65",
677
- install_enhanced_launch: "\u542F\u52A8",
678
- install_enhanced_try: "\u8BD5\u8BD5",
679
- install_enhanced_more: "\u66F4\u591A",
680
- install_enhanced_check: "\u68C0\u67E5",
681
- install_enhanced_docs: "\u6587\u6863",
682
- update_updating: "\u6B63\u5728\u66F4\u65B0",
683
- update_done: "\u66F4\u65B0\u5B8C\u6210",
684
- update_no_plugins: "\u6682\u65E0\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6",
685
- update_skipped: "\u5DF2\u8DF3\u8FC7",
686
- doctor_title: "CANNBot Doctor",
687
- doctor_tools: "AI \u5DE5\u5177",
688
- doctor_plugins: "\u5DF2\u5B89\u88C5\u63D2\u4EF6",
689
- doctor_links: "\u94FE\u63A5\u5B8C\u6574\u6027",
690
- doctor_config: "\u914D\u7F6E\u6587\u4EF6",
691
- doctor_result: "\u7ED3\u679C",
692
- doctor_fix_cleaning: "\u6E05\u7406\u5931\u6548\u94FE\u63A5",
693
- doctor_fix_rebuilding: "\u91CD\u5EFA\u76EE\u5F55",
694
- info_description: "\u63CF\u8FF0",
695
- info_skills: "Skills",
696
- info_agents: "Agents",
697
- info_status: "\u72B6\u6001",
698
- info_quickstart: "\u5FEB\u901F\u5F00\u59CB",
699
- info_not_found: "\u672A\u627E\u5230\u63D2\u4EF6",
700
- lang_title: "\u8BED\u8A00\u8BBE\u7F6E",
701
- lang_current: "\u5F53\u524D\u8BED\u8A00",
702
- lang_set: "\u8BED\u8A00\u5DF2\u8BBE\u7F6E\u4E3A",
703
- lang_invalid: "\u65E0\u6548\u7684\u8BED\u8A00\uFF0C\u652F\u6301: zh_CN, en_US",
704
- list_title: "\u53EF\u7528\u573A\u666F",
705
- list_id: "\u5E8F\u53F7",
706
- list_name: "\u573A\u666F\u540D",
707
- list_status: "\u72B6\u6001",
708
- list_description: "\u63CF\u8FF0",
709
- status_installed: "\u5DF2\u88C5",
710
- status_not_installed: "\u672A\u88C5",
711
- error_tool_not_found: "\u672A\u68C0\u6D4B\u5230\u4EFB\u4F55 AI \u7F16\u7A0B\u5DE5\u5177",
712
- error_plugin_not_found: "\u672A\u627E\u5230\u63D2\u4EF6",
713
- error_invalid_tool: "\u6682\u4E0D\u652F\u6301\u7684 AI \u5DE5\u5177: {tool}\n\u652F\u6301\u7684\u5DE5\u5177: {tools}",
714
- error_invalid_level: "\u6682\u4E0D\u652F\u6301\u7684\u5B89\u88C5\u7EA7\u522B: {level}\n\u652F\u6301\u7684\u7EA7\u522B: {levels}",
715
- error_skill_not_found: "\u672A\u5728\u6CE8\u518C\u8868\u4E2D\u627E\u5230 Skill",
716
- error_source_not_found: "\u672A\u627E\u5230\u6E90\u6587\u4EF6: {path}",
717
- error_script_not_found: "\u672A\u627E\u5230\u5B89\u88C5\u811A\u672C: {path}",
718
- error_unknown: "\u672A\u77E5\u9519\u8BEF",
719
- error_not_installed: "\u672A\u5B89\u88C5",
720
- error_no_shell: "\u672A\u627E\u5230 bash \u6216 sh\uFF0C\u65E0\u6CD5\u6267\u884C\u5B89\u88C5\u811A\u672C\u3002\u8BF7\u5B89\u88C5 Git Bash \u6216 WSL",
721
- error_symlink_windows: "\u521B\u5EFA\u7B26\u53F7\u94FE\u63A5\u5931\u8D25\uFF0C\u8BF7\u4EE5\u7BA1\u7406\u5458\u8EAB\u4EFD\u8FD0\u884C\u6216\u5F00\u542F Windows \u5F00\u53D1\u8005\u6A21\u5F0F",
722
- skill_select_category: "\u9009\u62E9 Skill \u7C7B\u522B",
723
- skill_select_items: "\u9009\u62E9\u8981\u5B89\u88C5\u7684 Skills",
724
- skill_already_installed: "\u5DF2\u5B89\u88C5",
725
- skill_select_all: "\u5168\u9009\u6240\u6709 Skills\uFF08\u5171 {count} \u4E2A\uFF09",
726
- skill_select_all_category: "\u5168\u9009\u5F53\u524D\u7C7B\u522B",
727
- skill_continue_or_install: "\u5DF2\u9009 {count} \u4E2A Skills\uFF0C\u8BF7\u9009\u62E9\u64CD\u4F5C",
728
- skill_continue_select: "\u7EE7\u7EED\u9009\u62E9\u5176\u4ED6\u7C7B\u522B",
729
- skill_confirm_install_count: "\u786E\u8BA4\u5B89\u88C5\uFF08\u5DF2\u9009 {count} \u4E2A Skills\uFF09",
730
- skill_all_install_progress: "\u6B63\u5728\u5B89\u88C5\u5168\u90E8 {count} \u4E2A Skills...",
731
- skill_install_progress: "\u6B63\u5728\u5B89\u88C5",
732
- skill_install_done: "Skill \u5B89\u88C5\u5B8C\u6210",
733
- skill_uninstall_done: "Skill \u5378\u8F7D\u5B8C\u6210",
734
- skill_list_title: "\u53EF\u7528 Skills",
735
- wizard_select_mode: "\u9009\u62E9\u5B89\u88C5\u7C7B\u578B",
736
- wizard_mode_plugin: "\u5B89\u88C5 Plugin",
737
- wizard_mode_plugin_desc: "\u5B8C\u6574\u5F00\u53D1\u5DE5\u4F5C\u6D41\uFF08Skills + Agents + \u914D\u7F6E\u6587\u4EF6\uFF09",
738
- wizard_mode_skill: "\u5B89\u88C5 Skill",
739
- wizard_mode_skill_desc: "\u4EC5\u5B89\u88C5\u9886\u57DF\u77E5\u8BC6\u6280\u80FD\uFF0C\u8BA9 AI \u638C\u63E1\u7279\u5B9A\u80FD\u529B",
740
- wizard_back: "\u8FD4\u56DE",
741
- wizard_cancel: "\u9000\u51FA",
742
- wizard_no_selection: "\u672A\u9009\u62E9\u4EFB\u4F55\u9879\uFF0C\u8BF7\u9009\u62E9\u64CD\u4F5C",
743
- wizard_back_to_reselect: "\u8FD4\u56DE",
744
- status_title: "\u5DF2\u5B89\u88C5\u63D2\u4EF6",
745
- status_none: "\u6682\u65E0\u5DF2\u5B89\u88C5\u7684\u63D2\u4EF6",
746
- status_hint: "\u8FD0\u884C install-helper init \u5F00\u59CB\u5B89\u88C5",
747
- status_install_time: "\u5B89\u88C5\u65F6\u95F4",
748
- install_installed_to: "\u5B89\u88C5\u5230",
749
- install_skills_count: "Skills",
750
- install_agents_count: "Agents",
751
- lang_supported: "\u652F\u6301\u7684\u8BED\u8A00: zh_CN, en_US",
752
- lang_usage: "\u7528\u6CD5: install-helper lang set <language>",
753
- lang_specify: "\u8BF7\u6307\u5B9A\u8BED\u8A00: install-helper lang set zh_CN",
754
- lang_unknown_action: "\u672A\u77E5\u64CD\u4F5C",
755
- lang_supported_actions: "\u652F\u6301\u7684\u64CD\u4F5C: show, set",
756
- info_aliases: "\u522B\u540D",
757
- uninstall_not_found: "\u672A\u627E\u5230",
758
- uninstall_no_record: "\u672A\u627E\u5230\u5B89\u88C5\u8BB0\u5F55\uFF0C\u53EF\u80FD\u672A\u5B89\u88C5\u6216\u5B89\u88C5\u8BB0\u5F55\u5DF2\u635F\u574F",
759
- uninstall_no_record_hint: "\u5982\u9700\u5F3A\u5236\u6E05\u7406\uFF0C\u8BF7\u624B\u52A8\u5220\u9664 .opencode/ \u6216 .claude/ \u76EE\u5F55\u4E2D\u7684\u76F8\u5173\u6587\u4EF6",
760
- uninstall_in_progress: "\u6B63\u5728\u5378\u8F7D",
761
- uninstall_summary_format: "{name}\uFF08\u79FB\u9664 {files} \u4E2A\u6587\u4EF6\uFF0C{dirs} \u4E2A\u76EE\u5F55\uFF09",
762
- uninstall_files_gone: "\u7684\u6587\u4EF6\u5DF2\u4E0D\u5B58\u5728\uFF0C\u5DF2\u6E05\u7406\u5B89\u88C5\u8BB0\u5F55",
763
- uninstall_skills_in_progress: "\u6B63\u5728\u5378\u8F7D",
764
- init_pkg_dir_warn: "\u5F53\u524D\u76EE\u5F55\u770B\u8D77\u6765\u662F install-helper \u5305\u76EE\u5F55",
765
- init_pkg_dir_hint: "\u8BF7\u5728\u4F60\u7684\u9879\u76EE\u76EE\u5F55\u4E2D\u8FD0\u884C\u6B64\u547D\u4EE4\uFF0C\u800C\u4E0D\u662F\u5728 install-helper \u5B89\u88C5\u76EE\u5F55\u4E2D",
766
- init_pkg_dir_example: "\u793A\u4F8B\uFF1Acd ~/my-project && install-helper",
767
- init_cancelled: "\u5DF2\u53D6\u6D88\u5B89\u88C5",
768
- backup_detected: "\u68C0\u6D4B\u5230\u5F53\u524D\u76EE\u5F55\u5DF2\u5B89\u88C5\u63D2\u4EF6",
769
- backup_current: "\u5F53\u524D\u5B89\u88C5",
770
- backup_installing: "\u5373\u5C06\u5B89\u88C5",
771
- backup_overwrite_warning: "\u7EE7\u7EED\u5B89\u88C5\u5C06\u8986\u76D6\u73B0\u6709\u7684 AGENTS.md \u914D\u7F6E\u6587\u4EF6\u3002",
772
- backup_auto_create: "\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u521B\u5EFA\u5907\u4EFD\uFF0C\u4EE5\u4FBF\u540E\u7EED\u6062\u590D\u3002",
773
- backup_overwrite: "\u8986\u76D6\u5B89\u88C5\uFF08\u81EA\u52A8\u5907\u4EFD\uFF09",
774
- backup_cancel: "\u53D6\u6D88\u5B89\u88C5",
775
- backup_restore_prompt: "\u68C0\u6D4B\u5230\u5907\u4EFD\u914D\u7F6E\uFF0C\u662F\u5426\u6062\u590D\uFF1F",
776
- backup_restore: "\u6062\u590D",
777
- backup_only_uninstall: "\u4EC5\u5378\u8F7D\uFF08\u4E0D\u6062\u590D\uFF09",
778
- backup_select_action: "\u8BF7\u9009\u62E9\u64CD\u4F5C",
779
- backup_restore_success: "\u5DF2\u6062\u590D\u914D\u7F6E",
780
- backup_created: "\u5DF2\u521B\u5EFA\u5907\u4EFD",
781
- backup_failed: "\u5907\u4EFD\u521B\u5EFA\u5931\u8D25\uFF0C\u5B89\u88C5\u5DF2\u4E2D\u6B62\u4EE5\u4FDD\u62A4\u73B0\u6709\u914D\u7F6E",
782
- loading_skills_list: "\u6B63\u5728\u52A0\u8F7D Skills \u5217\u8868...",
783
- loading_skills_list_complete: "Skills \u5217\u8868\u52A0\u8F7D\u5B8C\u6210",
784
- loading_plugin_data: "\u6B63\u5728\u52A0\u8F7D\u63D2\u4EF6\u6570\u636E...",
785
- loading_plugin_data_complete: "\u63D2\u4EF6\u6570\u636E\u52A0\u8F7D\u5B8C\u6210",
786
- loading_skills_list_failed: "Skills \u5217\u8868\u52A0\u8F7D\u5931\u8D25\uFF0C\u5C06\u4F7F\u7528\u5185\u7F6E\u6570\u636E",
787
- repo_pull_failed: "\u65E0\u6CD5\u62C9\u53D6\u6700\u65B0\u5185\u5BB9\uFF0C\u4F7F\u7528\u7F13\u5B58\u6570\u636E",
788
- repo_cloning: "\u9996\u6B21\u4F7F\u7528\uFF0C\u6B63\u5728\u514B\u9686 cannbot-skills \u4ED3\u5E93...",
789
- repo_clone_failed: "\u514B\u9686\u4ED3\u5E93\u5931\u8D25: {error}\n\u8BF7\u624B\u52A8\u514B\u9686: git clone {url} {dir}",
790
- external_repo_update_failed: "\u5916\u90E8\u4ED3\u5E93\u66F4\u65B0\u5931\u8D25\uFF0C\u4F7F\u7528\u73B0\u6709\u7248\u672C: {dir}",
791
- config_corrupted: "\u914D\u7F6E\u6587\u4EF6\u5DF2\u635F\u574F\uFF0C\u4F7F\u7528\u9ED8\u8BA4\u914D\u7F6E",
792
- record_corrupted: "\u5B89\u88C5\u8BB0\u5F55\u5DF2\u635F\u574F\uFF1A{file}",
793
- skill_record_corrupted: "Skill \u5B89\u88C5\u8BB0\u5F55\u5DF2\u635F\u574F",
794
- record_write_failed: "\u5B89\u88C5\u8BB0\u5F55\u5199\u5165\u5931\u8D25\uFF0C\u5378\u8F7D\u65F6\u53EF\u80FD\u65E0\u6CD5\u81EA\u52A8\u6E05\u7406",
795
- install_config_failed: "\u914D\u7F6E\u6587\u4EF6\u5B89\u88C5\u5931\u8D25: {error}",
796
- install_clone_failed: "git clone \u5931\u8D25: {url}\uFF0C\u8BF7\u624B\u52A8\u514B\u9686: git clone {url} {dir}",
797
- install_link_config_failed: "\u94FE\u63A5 {name} \u5230\u914D\u7F6E\u76EE\u5F55\u5931\u8D25",
798
- install_link_project_failed: "\u94FE\u63A5 {name} \u5230\u9879\u76EE\u76EE\u5F55\u5931\u8D25",
799
- install_link_workflows_failed: "\u94FE\u63A5 workflows \u5230\u914D\u7F6E\u76EE\u5F55\u5931\u8D25",
800
- install_skill_source_not_found: "Skill \u6E90\u76EE\u5F55\u672A\u627E\u5230: {dir}",
801
- install_skill_not_found: "Skill \u672A\u627E\u5230: {name} (\u5728 {dir})",
802
- install_skill_failed: "Skill \u5B89\u88C5\u5931\u8D25: {name}",
803
- install_agent_not_found: "Agent \u672A\u627E\u5230: {name}",
804
- install_agent_failed: "Agent \u5B89\u88C5\u5931\u8D25: {name}",
805
- install_no_skill_selected: "\u672A\u9009\u62E9\u4EFB\u4F55 Skill",
806
- install_to: "\u5B89\u88C5\u5230",
807
- start_to_use: "\u542F\u52A8 {tool} \u5373\u53EF\u4F7F\u7528",
808
- wizard_step_1_title: "[1/4] \u9009\u62E9 AI \u7F16\u7A0B\u5DE5\u5177",
809
- wizard_step_2_title: "[2/4] \u9009\u62E9\u5B89\u88C5\u4F4D\u7F6E",
810
- wizard_step_3_title: "[3/4] \u9009\u62E9\u8981\u5B89\u88C5\u7684\u63D2\u4EF6",
811
- wizard_step_4_title: "[4/4] \u786E\u8BA4\u5B89\u88C5",
812
- wizard_step_3_skill_title: "[3/4] \u9009\u62E9 Skill \u7C7B\u522B",
813
- wizard_step_4_skill_title: "[4/4] \u9009\u62E9\u8981\u5B89\u88C5\u7684 Skills \u2014 {category}",
814
- install_level_project: "\u5B89\u88C5\u5230\u5F53\u524D\u76EE\u5F55\uFF08\u63A8\u8350\uFF0C\u4EC5\u5F53\u524D\u9879\u76EE\u53EF\u7528\uFF09",
815
- install_level_global: "\u5B89\u88C5\u5230\u5168\u5C40\uFF08\u6240\u6709\u9879\u76EE\u5171\u4EAB\uFF09",
816
- wizard_select_mode_title: "\u9009\u62E9\u5B89\u88C5\u7C7B\u578B",
817
- skill_count_format: "{count} \u4E2A Skills",
818
- result_success_format: "{count} \u6210\u529F",
819
- result_failed_format: "{count} \u5931\u8D25",
820
- uninstall_remove_label: "\u79FB\u9664",
821
- uninstall_clean_empty_dir: "\u6E05\u7406\u7A7A\u76EE\u5F55",
822
- uninstall_skill_not_installed: "\u672A\u5B89\u88C5",
823
- available_plugins: "\u53EF\u7528\u63D2\u4EF6",
824
- available_skills: "\u53EF\u7528 Skills",
825
- skill_total_count: "\u5171 {count} \u4E2A Skills",
826
- wizard_confirm_install_format: "\u5373\u5C06\u5B89\u88C5 {count} \u4E2A\u63D2\u4EF6\u5230 {tool}\uFF08{level} \u7EA7\u522B\uFF09\uFF1A",
827
- wizard_install_path: "\u5B89\u88C5\u8DEF\u5F84",
828
- update_install_hint: "\u4F7F\u7528 {cmd} \u5B89\u88C5\u63D2\u4EF6",
829
- hint_select_move: "\u79FB\u52A8",
830
- hint_select_space: "\u7A7A\u683C",
831
- hint_select_check: "\u52FE\u9009",
832
- hint_select_confirm: "\u786E\u8BA4",
833
- hint_checkbox_suffix: "\u4E0D\u9009\u6309\u56DE\u8F66\u53EF\u8FD4\u56DE",
834
- doctor_not_installed: "\u672A\u5B89\u88C5",
835
- doctor_links_valid: "{count} \u4E2A\u8F6F\u94FE\u63A5\u5747\u6709\u6548",
836
- doctor_broken_links: "{count} \u4E2A\u5931\u6548\u94FE\u63A5",
837
- doctor_fixed: "\u5DF2\u6E05\u7406 {count} \u4E2A\u5931\u6548\u94FE\u63A5",
838
- doctor_not_exist: "\u4E0D\u5B58\u5728",
839
- doctor_created: "\u5DF2\u521B\u5EFA {path}",
840
- doctor_config_exists: "\u5B58\u5728",
841
- doctor_config_not_exist: "\u4E0D\u5B58\u5728",
842
- doctor_result_with_fix: "{warnings} \u4E2A\u8B66\u544A, {fixes} \u9879\u5DF2\u4FEE\u590D",
843
- doctor_result_without_fix: "{warnings} \u4E2A\u8B66\u544A",
844
- count_suffix: "\u4E2A",
845
- try_prompt: "\u5E2E\u6211\u5F00\u53D1\u4E00\u4E2A Abs \u7B97\u5B50"
846
- };
847
-
848
- // src/locales/en_US.json
849
- var en_US_default = {
850
- wizard_title: "CANNBot Install Helper",
851
- wizard_detect: "Detecting installed AI coding tools...",
852
- wizard_select_tool: "Select AI coding tool",
853
- wizard_select_level: "Select install level",
854
- wizard_select_plugin: "Select a scenario to install",
855
- wizard_confirm: "Confirm installation",
856
- wizard_detected_tool: "Detected",
857
- wizard_confirm_tool: "Confirm using",
858
- wizard_last_used: "last used",
859
- wizard_already_installed: "installed",
860
- install_repo_ready: "Repository ready",
861
- install_progress: "Installing",
862
- install_done: "Installation complete",
863
- install_success: "success",
864
- install_already_installed: "already installed",
865
- install_reinstall_confirm: "Reinstall (overwrite)",
866
- install_skip: "skipped",
867
- install_enhanced_next_steps: "Next steps",
868
- install_enhanced_launch: "Launch",
869
- install_enhanced_try: "Try",
870
- install_enhanced_more: "More",
871
- install_enhanced_check: "Check",
872
- install_enhanced_docs: "Docs",
873
- update_updating: "Updating",
874
- update_done: "Update complete",
875
- update_no_plugins: "No installed plugins",
876
- update_skipped: "skipped",
877
- doctor_title: "CANNBot Doctor",
878
- doctor_tools: "AI Tools",
879
- doctor_plugins: "Installed Plugins",
880
- doctor_links: "Link Integrity",
881
- doctor_config: "Configuration",
882
- doctor_result: "Result",
883
- doctor_fix_cleaning: "Cleaning broken links",
884
- doctor_fix_rebuilding: "Rebuilding directories",
885
- info_description: "Description",
886
- info_skills: "Skills",
887
- info_agents: "Agents",
888
- info_status: "Status",
889
- info_quickstart: "Quick Start",
890
- info_not_found: "Plugin not found",
891
- lang_title: "Language Settings",
892
- lang_current: "Current language",
893
- lang_set: "Language set to",
894
- lang_invalid: "Invalid language, supported: zh_CN, en_US",
895
- list_title: "Available Scenarios",
896
- list_id: "#",
897
- list_name: "Name",
898
- list_status: "Status",
899
- list_description: "Description",
900
- status_installed: "installed",
901
- status_not_installed: "not installed",
902
- error_tool_not_found: "No AI coding tool detected",
903
- error_plugin_not_found: "Plugin not found",
904
- error_invalid_tool: "Unsupported AI tool: {tool}\nSupported tools: {tools}",
905
- error_invalid_level: "Unsupported install level: {level}\nSupported levels: {levels}",
906
- error_skill_not_found: "Skill not found in registry",
907
- error_source_not_found: "Source not found: {path}",
908
- error_script_not_found: "Script not found: {path}",
909
- error_unknown: "Unknown error",
910
- error_not_installed: "Not installed",
911
- error_no_shell: "bash or sh not found, cannot execute install script. Please install Git Bash or WSL",
912
- error_symlink_windows: "Failed to create symlink, please run as administrator or enable Windows Developer Mode",
913
- skill_select_category: "Select Skill category",
914
- skill_select_items: "Select Skills to install (space to toggle, enter to confirm)",
915
- skill_already_installed: "installed",
916
- skill_select_all: "Select ALL Skills ({count} total)",
917
- skill_select_all_category: "Select all in this category",
918
- skill_continue_or_install: "{count} Skills selected, choose an action",
919
- skill_continue_select: "Continue selecting from other categories",
920
- skill_confirm_install_count: "Install now ({count} Skills selected)",
921
- skill_all_install_progress: "Installing all {count} Skills...",
922
- skill_install_progress: "Installing",
923
- skill_install_done: "Skill installation complete",
924
- skill_uninstall_done: "Skill uninstallation complete",
925
- skill_list_title: "Available Skills",
926
- wizard_select_mode: "Select installation mode",
927
- wizard_mode_plugin: "Install Plugin",
928
- wizard_mode_plugin_desc: "Full development workflow (Skills + Agents + config)",
929
- wizard_mode_skill: "Install Skill",
930
- wizard_mode_skill_desc: "Domain knowledge only, give AI specific capabilities",
931
- wizard_back: "Go back",
932
- wizard_cancel: "Cancel installation",
933
- wizard_no_selection: "No items selected, please choose an action",
934
- wizard_back_to_reselect: "Go back",
935
- status_title: "Installed Plugins",
936
- status_none: "No installed plugins",
937
- status_hint: "Run install-helper init to start",
938
- status_install_time: "Installed at",
939
- install_installed_to: "Installed to",
940
- install_skills_count: "Skills",
941
- install_agents_count: "Agents",
942
- lang_supported: "Supported languages: zh_CN, en_US",
943
- lang_usage: "Usage: install-helper lang set <language>",
944
- lang_specify: "Please specify language: install-helper lang set zh_CN",
945
- lang_unknown_action: "Unknown action",
946
- lang_supported_actions: "Supported actions: show, set",
947
- info_aliases: "Aliases",
948
- uninstall_not_found: "Not found",
949
- uninstall_no_record: "No install record found, may not be installed or record is corrupted",
950
- uninstall_no_record_hint: "For manual cleanup, delete related files in .opencode/ or .claude/ directory",
951
- uninstall_in_progress: "Uninstalling",
952
- uninstall_summary_format: "{name} (removed {files} files, {dirs} directories)",
953
- uninstall_files_gone: " files no longer exist, install record cleaned",
954
- uninstall_skills_in_progress: "Uninstalling",
955
- init_pkg_dir_warn: "Current directory appears to be the install-helper package directory",
956
- init_pkg_dir_hint: "Please run this command in your project directory, not in the install-helper package directory",
957
- init_pkg_dir_example: "Example: cd ~/my-project && install-helper",
958
- init_cancelled: "Installation cancelled",
959
- backup_detected: "Plugin already installed in current directory",
960
- backup_current: "Currently installed",
961
- backup_installing: "About to install",
962
- backup_overwrite_warning: "Continuing will overwrite existing AGENTS.md configuration.",
963
- backup_auto_create: "System will automatically create backup for future restoration.",
964
- backup_overwrite: "Overwrite (auto backup)",
965
- backup_cancel: "Cancel installation",
966
- backup_restore_prompt: "Backup configuration detected, restore?",
967
- backup_restore: "Restore",
968
- backup_only_uninstall: "Uninstall only (no restore)",
969
- backup_select_action: "Please select an action",
970
- backup_restore_success: "Configuration restored",
971
- backup_created: "Backup created",
972
- backup_failed: "Backup creation failed, installation aborted to protect existing config",
973
- loading_skills_list: "Loading Skills list...",
974
- loading_skills_list_complete: "Skills list loaded",
975
- loading_plugin_data: "Loading plugin data...",
976
- loading_plugin_data_complete: "Plugin data loaded",
977
- loading_skills_list_failed: "Failed to load Skills list, using built-in data",
978
- repo_pull_failed: "Failed to pull latest updates, using cached data",
979
- repo_cloning: "First-time setup: cloning cannbot-skills repository...",
980
- repo_clone_failed: "Failed to clone repository: {error}\nClone manually: git clone {url} {dir}",
981
- external_repo_update_failed: "External repo update failed, using existing version: {dir}",
982
- config_corrupted: "Config file corrupted, using defaults",
983
- record_corrupted: "Install record corrupted: {file}",
984
- skill_record_corrupted: "Skill install record corrupted",
985
- record_write_failed: "Install record write failed, uninstall may not work properly",
986
- install_config_failed: "Failed to install config file: {error}",
987
- install_clone_failed: "git clone failed: {url}, clone manually: git clone {url} {dir}",
988
- install_link_config_failed: "Failed to link {name} to config directory",
989
- install_link_project_failed: "Failed to link {name} to project directory",
990
- install_link_workflows_failed: "Failed to link workflows to config directory",
991
- install_skill_source_not_found: "Skill source not found: {dir}",
992
- install_skill_not_found: "Skill not found: {name} in {dir}",
993
- install_skill_failed: "Failed to install skill: {name}",
994
- install_agent_not_found: "Agent not found: {name}",
995
- install_agent_failed: "Failed to install agent: {name}",
996
- install_no_skill_selected: "No Skill selected",
997
- install_to: "Install to",
998
- start_to_use: "Start {tool} to use",
999
- wizard_step_1_title: "[1/4] Select AI coding tool",
1000
- wizard_step_2_title: "[2/4] Select installation location",
1001
- wizard_step_3_title: "[3/4] Select plugins to install",
1002
- wizard_step_4_title: "[4/4] Confirm installation",
1003
- wizard_step_3_skill_title: "[3/4] Select Skill category",
1004
- wizard_step_4_skill_title: "[4/4] Select Skills to install \u2014 {category}",
1005
- install_level_project: "Install to current directory (recommended, current project only)",
1006
- install_level_global: "Install globally (all projects)",
1007
- wizard_select_mode_title: "Select installation type",
1008
- skill_count_format: "{count} Skills",
1009
- result_success_format: "{count} succeeded",
1010
- result_failed_format: "{count} failed",
1011
- uninstall_remove_label: "Removed",
1012
- uninstall_clean_empty_dir: "Cleaned empty directory",
1013
- uninstall_skill_not_installed: "Not installed",
1014
- available_plugins: "Available plugins",
1015
- available_skills: "Available Skills",
1016
- skill_total_count: "Total {count} Skills",
1017
- wizard_confirm_install_format: "About to install {count} plugins to {tool} ({level} level):",
1018
- wizard_install_path: "Install path",
1019
- update_install_hint: "Use {cmd} to install plugins",
1020
- hint_select_move: "Navigate",
1021
- hint_select_space: "Space",
1022
- hint_select_check: "Toggle",
1023
- hint_select_confirm: "Confirm",
1024
- hint_checkbox_suffix: "Press enter without selection to go back",
1025
- doctor_not_installed: "Not installed",
1026
- doctor_links_valid: "{count} symlinks all valid",
1027
- doctor_broken_links: "{count} broken links",
1028
- doctor_fixed: "Cleaned {count} broken links",
1029
- doctor_not_exist: "Does not exist",
1030
- doctor_created: "Created {path}",
1031
- doctor_config_exists: "Exists",
1032
- doctor_config_not_exist: "Does not exist",
1033
- doctor_result_with_fix: "{warnings} warnings, {fixes} fixed",
1034
- doctor_result_without_fix: "{warnings} warnings",
1035
- count_suffix: "",
1036
- try_prompt: "help me develop an Abs operator"
1037
- };
1038
-
1039
- // src/utils/i18n.ts
1040
- var __filename = fileURLToPath(import.meta.url);
1041
- var __dirname = dirname(__filename);
1042
- var EMBEDDED_LOCALES = {
1043
- zh_CN: zh_CN_default,
1044
- en_US: en_US_default
1045
- };
1046
1093
  function loadLocale(locale) {
1047
1094
  const embedded = EMBEDDED_LOCALES[locale];
1048
1095
  if (embedded) return embedded;
@@ -1064,8 +1111,6 @@ function loadLocale(locale) {
1064
1111
  }
1065
1112
  return EMBEDDED_LOCALES.zh_CN || {};
1066
1113
  }
1067
- var currentLang = "zh_CN";
1068
- var messages = loadLocale("zh_CN");
1069
1114
  function setLanguage(lang) {
1070
1115
  currentLang = lang;
1071
1116
  messages = loadLocale(lang);
@@ -1073,10 +1118,27 @@ function setLanguage(lang) {
1073
1118
  function t(key) {
1074
1119
  return messages[key] !== void 0 ? messages[key] : key;
1075
1120
  }
1121
+ var __filename, __dirname, EMBEDDED_LOCALES, currentLang, messages;
1122
+ var init_i18n = __esm({
1123
+ "src/utils/i18n.ts"() {
1124
+ "use strict";
1125
+ init_zh_CN();
1126
+ init_en_US();
1127
+ __filename = fileURLToPath(import.meta.url);
1128
+ __dirname = dirname(__filename);
1129
+ EMBEDDED_LOCALES = {
1130
+ zh_CN: zh_CN_default,
1131
+ en_US: en_US_default
1132
+ };
1133
+ currentLang = "zh_CN";
1134
+ messages = loadLocale("zh_CN");
1135
+ }
1136
+ });
1076
1137
 
1077
1138
  // src/utils/paths.ts
1078
- var VALID_TOOLS = ["opencode", "claude", "trae", "cursor", "copilot", "codearts"];
1079
- var VALID_LEVELS = ["project", "global"];
1139
+ import { homedir } from "os";
1140
+ import { join as join3 } from "path";
1141
+ import { existsSync as existsSync3 } from "fs";
1080
1142
  function validateTool(tool) {
1081
1143
  if (!VALID_TOOLS.includes(tool)) {
1082
1144
  throw new Error(
@@ -1181,8 +1243,21 @@ function getCannbotConfigDir() {
1181
1243
  function getCannbotRepoPath() {
1182
1244
  return join3(getCannbotConfigDir(), "repo");
1183
1245
  }
1246
+ var VALID_TOOLS, VALID_LEVELS;
1247
+ var init_paths = __esm({
1248
+ "src/utils/paths.ts"() {
1249
+ "use strict";
1250
+ init_i18n();
1251
+ VALID_TOOLS = ["opencode", "claude", "trae", "cursor", "copilot", "codearts"];
1252
+ VALID_LEVELS = ["project", "global"];
1253
+ }
1254
+ });
1184
1255
 
1185
1256
  // src/core/detector.ts
1257
+ import { execa } from "execa";
1258
+ import { existsSync as existsSync4 } from "fs";
1259
+ import { homedir as homedir2 } from "os";
1260
+ import { join as join4 } from "path";
1186
1261
  async function getCommandVersion(cmd, args = ["--version"]) {
1187
1262
  try {
1188
1263
  const result = await execa(cmd, args, { timeout: 5e3 });
@@ -1295,6 +1370,12 @@ function getToolDisplayName(tool) {
1295
1370
  function getAllTools() {
1296
1371
  return VALID_TOOLS;
1297
1372
  }
1373
+ var init_detector = __esm({
1374
+ "src/core/detector.ts"() {
1375
+ "use strict";
1376
+ init_paths();
1377
+ }
1378
+ });
1298
1379
 
1299
1380
  // src/core/manifest.ts
1300
1381
  import { existsSync as existsSync5, readFileSync as readFileSync2 } from "fs";
@@ -1389,16 +1470,16 @@ function verifyPluginFilesExist(configRoot, manifest, tool, level) {
1389
1470
  if (!existsSync5(configFilePath)) return false;
1390
1471
  return true;
1391
1472
  }
1392
-
1393
- // src/utils/logger.ts
1394
- import chalk2 from "chalk";
1395
- import ora from "ora";
1473
+ var init_manifest = __esm({
1474
+ "src/core/manifest.ts"() {
1475
+ "use strict";
1476
+ init_paths();
1477
+ init_registry();
1478
+ }
1479
+ });
1396
1480
 
1397
1481
  // src/ui/theme.ts
1398
1482
  import chalk from "chalk";
1399
- var selectTheme = {
1400
- helpMode: "never"
1401
- };
1402
1483
  function isCJK(code) {
1403
1484
  return code >= 11904 && code <= 40959 || code >= 63744 && code <= 64255 || code >= 65072 && code <= 65103 || code >= 65280 && code <= 65519 || code >= 13312 && code <= 19903 || code >= 131072 && code <= 173791 || code >= 173824 && code <= 177983 || code >= 177984 && code <= 178207 || code >= 178208 && code <= 183983;
1404
1485
  }
@@ -1457,27 +1538,30 @@ function wrapDescription(text) {
1457
1538
  if (line) lines.push(line.trimEnd());
1458
1539
  return lines.map((l, i2) => chalk.cyan(i2 === 0 ? prefix + l : indent + l)).join("\n");
1459
1540
  }
1460
- var checkboxTheme = {
1461
- icon: {
1462
- checked: "\x1B[32m\u2611\x1B[22m",
1463
- unchecked: "\u2610",
1464
- cursor: "\u276F"
1465
- },
1466
- helpMode: "never",
1467
- style: {
1468
- description: (text) => wrapDescription(text)
1541
+ var selectTheme, checkboxTheme;
1542
+ var init_theme = __esm({
1543
+ "src/ui/theme.ts"() {
1544
+ "use strict";
1545
+ selectTheme = {
1546
+ helpMode: "never"
1547
+ };
1548
+ checkboxTheme = {
1549
+ icon: {
1550
+ checked: "\x1B[32m\u2611\x1B[22m",
1551
+ unchecked: "\u2610",
1552
+ cursor: "\u276F"
1553
+ },
1554
+ helpMode: "never",
1555
+ style: {
1556
+ description: (text) => wrapDescription(text)
1557
+ }
1558
+ };
1469
1559
  }
1470
- };
1560
+ });
1471
1561
 
1472
1562
  // src/utils/logger.ts
1473
- var logger = {
1474
- success: (msg) => console.log(chalk2.green("\u2713") + " " + msg),
1475
- error: (msg) => console.log(chalk2.red("\u2717") + " " + msg),
1476
- warn: (msg) => console.log(chalk2.yellow("\u26A0") + " " + msg),
1477
- info: (msg) => console.log(chalk2.cyan("\u2192") + " " + msg),
1478
- step: (msg) => console.log(chalk2.dim(msg)),
1479
- blank: () => console.log()
1480
- };
1563
+ import chalk2 from "chalk";
1564
+ import ora from "ora";
1481
1565
  function createSpinner(text) {
1482
1566
  return ora({ text, color: "cyan" });
1483
1567
  }
@@ -1516,11 +1600,22 @@ function showOperationHints(isCheckbox = false) {
1516
1600
  `);
1517
1601
  }
1518
1602
  }
1519
-
1520
- // src/utils/config.ts
1521
- import { existsSync as existsSync7, mkdirSync, readFileSync as readFileSync3 } from "fs";
1522
- import { join as join6 } from "path";
1523
- import { parse, stringify } from "yaml";
1603
+ var logger;
1604
+ var init_logger = __esm({
1605
+ "src/utils/logger.ts"() {
1606
+ "use strict";
1607
+ init_i18n();
1608
+ init_theme();
1609
+ logger = {
1610
+ success: (msg) => console.log(chalk2.green("\u2713") + " " + msg),
1611
+ error: (msg) => console.log(chalk2.red("\u2717") + " " + msg),
1612
+ warn: (msg) => console.log(chalk2.yellow("\u26A0") + " " + msg),
1613
+ info: (msg) => console.log(chalk2.cyan("\u2192") + " " + msg),
1614
+ step: (msg) => console.log(chalk2.dim(msg)),
1615
+ blank: () => console.log()
1616
+ };
1617
+ }
1618
+ });
1524
1619
 
1525
1620
  // src/utils/fs.ts
1526
1621
  import { writeFileSync, renameSync, existsSync as existsSync6, unlinkSync as unlinkSync2 } from "fs";
@@ -1542,8 +1637,16 @@ function atomicWriteFileSync(filePath, data, encoding = "utf-8") {
1542
1637
  throw e;
1543
1638
  }
1544
1639
  }
1640
+ var init_fs = __esm({
1641
+ "src/utils/fs.ts"() {
1642
+ "use strict";
1643
+ }
1644
+ });
1545
1645
 
1546
1646
  // src/utils/config.ts
1647
+ import { existsSync as existsSync7, mkdirSync, readFileSync as readFileSync3 } from "fs";
1648
+ import { join as join6 } from "path";
1649
+ import { parse, stringify } from "yaml";
1547
1650
  function getConfigDir() {
1548
1651
  return getCannbotConfigDir();
1549
1652
  }
@@ -1605,12 +1708,35 @@ function removeInstalledPlugin(pluginId) {
1605
1708
  );
1606
1709
  writeConfig(config);
1607
1710
  }
1711
+ var init_config = __esm({
1712
+ "src/utils/config.ts"() {
1713
+ "use strict";
1714
+ init_fs();
1715
+ init_logger();
1716
+ init_i18n();
1717
+ init_paths();
1718
+ }
1719
+ });
1608
1720
 
1609
1721
  // src/utils/constants.ts
1610
- var BACK = "__back__";
1611
- var CANCEL = "__cancel__";
1722
+ var BACK, CANCEL;
1723
+ var init_constants = __esm({
1724
+ "src/utils/constants.ts"() {
1725
+ "use strict";
1726
+ BACK = "__back__";
1727
+ CANCEL = "__cancel__";
1728
+ }
1729
+ });
1612
1730
 
1613
1731
  // src/ui/wizard.ts
1732
+ var wizard_exports = {};
1733
+ __export(wizard_exports, {
1734
+ runWizard: () => runWizard,
1735
+ selectToolWithDetection: () => selectToolWithDetection,
1736
+ stepLevel: () => stepLevel
1737
+ });
1738
+ import { select, Separator } from "@inquirer/prompts";
1739
+ import chalk3 from "chalk";
1614
1740
  async function selectToolWithDetection() {
1615
1741
  const config = readConfig();
1616
1742
  logger.blank();
@@ -1842,8 +1968,33 @@ async function stepConfirm(tool, level, plugins) {
1842
1968
  if (result === CANCEL) return CANCEL;
1843
1969
  return true;
1844
1970
  }
1971
+ var init_wizard = __esm({
1972
+ "src/ui/wizard.ts"() {
1973
+ "use strict";
1974
+ init_registry();
1975
+ init_detector();
1976
+ init_manifest();
1977
+ init_paths();
1978
+ init_i18n();
1979
+ init_logger();
1980
+ init_config();
1981
+ init_theme();
1982
+ init_constants();
1983
+ }
1984
+ });
1985
+
1986
+ // src/cli.ts
1987
+ import { Command } from "commander";
1988
+
1989
+ // src/commands/init.ts
1990
+ init_wizard();
1991
+ import { select as select4, Separator as Separator3 } from "@inquirer/prompts";
1992
+ import chalk7 from "chalk";
1845
1993
 
1846
1994
  // src/core/repository.ts
1995
+ init_paths();
1996
+ init_logger();
1997
+ init_i18n();
1847
1998
  import { existsSync as existsSync10, mkdirSync as mkdirSync3, readFileSync as readFileSync6, rmSync as rmSync2 } from "fs";
1848
1999
  import { join as join9, dirname as dirname4 } from "path";
1849
2000
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -1851,6 +2002,9 @@ import { execa as execa2 } from "execa";
1851
2002
  import { parse as parseYaml2 } from "yaml";
1852
2003
 
1853
2004
  // src/core/scanner.ts
2005
+ init_paths();
2006
+ init_fs();
2007
+ init_fs_helpers();
1854
2008
  import { existsSync as existsSync8, readdirSync as readdirSync2, readFileSync as readFileSync4, mkdirSync as mkdirSync2 } from "fs";
1855
2009
  import { join as join7, dirname as dirname3 } from "path";
1856
2010
  import { fileURLToPath as fileURLToPath2 } from "url";
@@ -1883,13 +2037,13 @@ function loadScanConfig() {
1883
2037
  const config = parseYaml(readFileSync4(configPath, "utf-8"));
1884
2038
  const ttlHours = config.scanCacheTtlHours || 24;
1885
2039
  return {
1886
- skillDirs: config.scanDirs || ["ops", "model", "graph", "infra", "ops-lab", "runtime"],
2040
+ skillDirs: config.scanDirs || ["ops", "model", "graph", "infra", "runtime"],
1887
2041
  pluginDirs: config.pluginDirs || ["plugins-official", "plugins-community"],
1888
2042
  cacheTtlMs: ttlHours * 60 * 60 * 1e3
1889
2043
  };
1890
2044
  } catch {
1891
2045
  return {
1892
- skillDirs: ["ops", "model", "graph", "infra", "ops-lab", "runtime"],
2046
+ skillDirs: ["ops", "model", "graph", "infra", "runtime"],
1893
2047
  pluginDirs: ["plugins-official", "plugins-community"],
1894
2048
  cacheTtlMs: 24 * 60 * 60 * 1e3
1895
2049
  };
@@ -2057,6 +2211,7 @@ function safeReaddir(dir) {
2057
2211
  }
2058
2212
 
2059
2213
  // src/core/skill-registry.ts
2214
+ init_i18n();
2060
2215
  var CATEGORY_DEFS = [
2061
2216
  { id: "knowledge", name: "\u77E5\u8BC6\u4E0E\u53C2\u8003", nameEn: "Knowledge & Reference" },
2062
2217
  { id: "env-tools", name: "\u73AF\u5883\u4E0E\u5DE5\u5177", nameEn: "Environment & Tools" },
@@ -2292,7 +2447,11 @@ function getAllCategories() {
2292
2447
  })).filter((cat) => cat.skills.length > 0);
2293
2448
  }
2294
2449
 
2450
+ // src/core/repository.ts
2451
+ init_registry();
2452
+
2295
2453
  // src/core/metadata-sync.ts
2454
+ init_registry();
2296
2455
  import { existsSync as existsSync9, readFileSync as readFileSync5, statSync as statSync2 } from "fs";
2297
2456
  import { join as join8 } from "path";
2298
2457
  function readPluginJson(pluginDir) {
@@ -2517,11 +2676,19 @@ function createRepositoryManager(customPath) {
2517
2676
  }
2518
2677
 
2519
2678
  // src/core/installer.ts
2679
+ init_registry();
2680
+ init_manifest();
2681
+ init_paths();
2520
2682
  import { existsSync as existsSync14 } from "fs";
2521
2683
  import { join as join13, basename as basename2 } from "path";
2522
2684
  import { execa as execa4, execaSync } from "execa";
2523
2685
 
2524
2686
  // src/core/record.ts
2687
+ init_paths();
2688
+ init_fs();
2689
+ init_fs_helpers();
2690
+ init_logger();
2691
+ init_i18n();
2525
2692
  import { existsSync as existsSync11, mkdirSync as mkdirSync4, readFileSync as readFileSync7, unlinkSync as unlinkSync3 } from "fs";
2526
2693
  import { join as join10 } from "path";
2527
2694
  function getInstallsDir() {
@@ -2657,12 +2824,21 @@ function addSkillsToRecord(skillIds, tool, level, installPath) {
2657
2824
  record[tool][level][installPath] = { skills: [], installTime: "" };
2658
2825
  }
2659
2826
  const entry = record[tool][level][installPath];
2827
+ const now = (/* @__PURE__ */ new Date()).toISOString();
2828
+ const newSkills = [];
2660
2829
  for (const id of skillIds) {
2661
2830
  if (!entry.skills.includes(id)) {
2662
2831
  entry.skills.push(id);
2832
+ newSkills.push(id);
2663
2833
  }
2664
2834
  }
2665
- entry.installTime = (/* @__PURE__ */ new Date()).toISOString();
2835
+ entry.installTime = now;
2836
+ if (!entry.batches) entry.batches = [];
2837
+ entry.batches.push({
2838
+ batchId: `batch-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
2839
+ installedAt: now,
2840
+ skills: newSkills.length > 0 ? newSkills : [...skillIds]
2841
+ });
2666
2842
  writeSkillRecord(record);
2667
2843
  }
2668
2844
  function removeSkillsFromRecord(skillIds, tool, level, installPath) {
@@ -2670,6 +2846,15 @@ function removeSkillsFromRecord(skillIds, tool, level, installPath) {
2670
2846
  if (!record[tool]?.[level]?.[installPath]) return;
2671
2847
  const entry = record[tool][level][installPath];
2672
2848
  entry.skills = entry.skills.filter((id) => !skillIds.includes(id));
2849
+ if (entry.batches) {
2850
+ for (const batch of entry.batches) {
2851
+ batch.skills = batch.skills.filter((id) => !skillIds.includes(id));
2852
+ }
2853
+ entry.batches = entry.batches.filter((b) => b.skills.length > 0);
2854
+ if (entry.batches.length === 0) {
2855
+ delete entry.batches;
2856
+ }
2857
+ }
2673
2858
  if (entry.skills.length === 0) {
2674
2859
  delete record[tool][level][installPath];
2675
2860
  if (Object.keys(record[tool][level]).length === 0) {
@@ -2691,10 +2876,27 @@ function getInstalledSkills(tool, level, installPath) {
2691
2876
  return existsSync11(skillPath) || isSymlink(skillPath);
2692
2877
  });
2693
2878
  }
2879
+ function getLastBatchSkills(tool, level, installPath) {
2880
+ const record = readSkillRecord();
2881
+ const entry = record[tool]?.[level]?.[installPath];
2882
+ if (!entry || !entry.batches || entry.batches.length === 0) {
2883
+ return null;
2884
+ }
2885
+ const lastBatch = entry.batches[entry.batches.length - 1];
2886
+ const configRoot = getConfigRoot(tool, level);
2887
+ const skillsDir = join10(configRoot, "skills");
2888
+ return lastBatch.skills.filter((skillId) => {
2889
+ const skillPath = join10(skillsDir, skillId);
2890
+ return existsSync11(skillPath) || isSymlink(skillPath);
2891
+ });
2892
+ }
2694
2893
 
2695
2894
  // src/core/backup.ts
2895
+ init_manifest();
2696
2896
  import { existsSync as existsSync12, copyFileSync, readdirSync as readdirSync3, unlinkSync as unlinkSync4 } from "fs";
2697
2897
  import { join as join11 } from "path";
2898
+ init_registry();
2899
+ init_paths();
2698
2900
  function detectCurrentPlugin(configRoot, tool, installPath) {
2699
2901
  const manifests = readAllManifests(configRoot);
2700
2902
  if (manifests.length > 0) {
@@ -2822,6 +3024,7 @@ function readAllRecords() {
2822
3024
  }
2823
3025
 
2824
3026
  // src/ui/backup-prompts.ts
3027
+ init_i18n();
2825
3028
  import { select as select2 } from "@inquirer/prompts";
2826
3029
  import chalk4 from "chalk";
2827
3030
  async function showOverwriteWarning(currentPluginName, newPluginName) {
@@ -2860,6 +3063,10 @@ async function showRestorePrompt(backups) {
2860
3063
  }
2861
3064
 
2862
3065
  // src/core/plugin-installer.ts
3066
+ init_paths();
3067
+ init_fs_helpers();
3068
+ init_logger();
3069
+ init_i18n();
2863
3070
  import { existsSync as existsSync13, mkdirSync as mkdirSync5, symlinkSync, realpathSync, readlinkSync, copyFileSync as copyFileSync2, cpSync, writeFileSync as writeFileSync2, rmSync as rmSync3 } from "fs";
2864
3071
  import { join as join12, basename } from "path";
2865
3072
  import { execa as execa3 } from "execa";
@@ -3125,6 +3332,8 @@ async function installViaManifest(plugin, repoPath, tool, level, installPath) {
3125
3332
  }
3126
3333
 
3127
3334
  // src/core/installer.ts
3335
+ init_i18n();
3336
+ init_logger();
3128
3337
  function findShell() {
3129
3338
  const candidates = ["bash", "sh"];
3130
3339
  for (const cmd of candidates) {
@@ -3336,12 +3545,22 @@ async function installPlugin(opts) {
3336
3545
  }
3337
3546
  }
3338
3547
 
3548
+ // src/commands/init.ts
3549
+ init_registry();
3550
+
3339
3551
  // src/core/skill-installer.ts
3552
+ init_paths();
3553
+ init_fs_helpers();
3554
+ init_constants();
3555
+ init_logger();
3556
+ init_i18n();
3340
3557
  import { existsSync as existsSync15, mkdirSync as mkdirSync6, symlinkSync as symlinkSync2, readdirSync as readdirSync4, rmSync as rmSync4, realpathSync as realpathSync2, readlinkSync as readlinkSync2, cpSync as cpSync2 } from "fs";
3341
3558
  import { join as join14, dirname as dirname5, isAbsolute } from "path";
3342
3559
  import { select as select3, checkbox, Separator as Separator2 } from "@inquirer/prompts";
3343
3560
  import chalk5 from "chalk";
3344
3561
  import Table from "cli-table3";
3562
+ init_theme();
3563
+ import { confirm } from "@inquirer/prompts";
3345
3564
  async function installSkills(skillIds, tool, level, repoPath) {
3346
3565
  const configRoot = getConfigRoot(tool, level);
3347
3566
  const skillsDir = join14(configRoot, "skills");
@@ -3448,6 +3667,7 @@ async function uninstallSkills(skillIds, tool, level) {
3448
3667
  var SELECT_ALL = "__select_all__";
3449
3668
  var SELECT_ALL_CATEGORY = "__select_all_category__";
3450
3669
  var CONTINUE_SELECT = "__continue_select__";
3670
+ var UNSELECT_ALL = "__unselect_all__";
3451
3671
  async function interactiveSkillSelect(tool, level) {
3452
3672
  const categories = getAllCategories();
3453
3673
  const allSkillIds = getAllSkills().map((s) => s.id);
@@ -3589,6 +3809,68 @@ async function interactiveSkillSelect(tool, level) {
3589
3809
  }
3590
3810
  }
3591
3811
  }
3812
+ async function interactiveSkillUnselect(tool, level) {
3813
+ const installPath = level === "project" ? process.cwd() : getConfigRoot(tool, level);
3814
+ const installedSkills = getInstalledSkills(tool, level, installPath);
3815
+ if (installedSkills.length === 0) {
3816
+ logger.warn(t("uninstall_no_installed_skills"));
3817
+ return "back";
3818
+ }
3819
+ const categories = getAllCategories();
3820
+ const installedSet = new Set(installedSkills);
3821
+ const skillChoices = [
3822
+ {
3823
+ name: `>> ${t("uninstall_uncheck_all")}`,
3824
+ value: UNSELECT_ALL,
3825
+ checked: false,
3826
+ description: t("uninstall_uncheck_all")
3827
+ },
3828
+ new Separator2("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),
3829
+ ...installedSkills.map((skillId) => {
3830
+ const skill = findSkill(skillId);
3831
+ const cat = categories.find((c) => c.skills.some((s) => s.id === skillId));
3832
+ const catName = cat ? cat.name : "";
3833
+ const desc = skill?.description || "";
3834
+ return {
3835
+ name: `${chalk5.cyan(skillId)}${catName ? chalk5.dim(` [${catName}]`) : ""}`,
3836
+ value: skillId,
3837
+ checked: true,
3838
+ description: desc
3839
+ };
3840
+ })
3841
+ ];
3842
+ printBoxTitle(t("uninstall_interactive_title"));
3843
+ logger.info(chalk5.dim(` ${t("uninstall_checkbox_hint")}`));
3844
+ logger.blank();
3845
+ showOperationHints(true);
3846
+ const selected = await checkbox({
3847
+ message: t("uninstall_select_items"),
3848
+ choices: skillChoices,
3849
+ loop: false,
3850
+ instructions: false,
3851
+ theme: checkboxTheme,
3852
+ pageSize: 20
3853
+ });
3854
+ let toKeep;
3855
+ if (selected.includes(UNSELECT_ALL)) {
3856
+ toKeep = [];
3857
+ } else {
3858
+ toKeep = selected.filter((id) => id !== UNSELECT_ALL);
3859
+ }
3860
+ const toUninstall = installedSkills.filter((id) => !toKeep.includes(id));
3861
+ if (toUninstall.length === 0) {
3862
+ logger.info(t("uninstall_nothing_to_uninstall"));
3863
+ return "back";
3864
+ }
3865
+ const confirmed = await confirm({
3866
+ message: t("uninstall_confirm_count").replace("{count}", chalk5.bold(String(toUninstall.length))),
3867
+ default: false
3868
+ });
3869
+ if (!confirmed) {
3870
+ return "cancel";
3871
+ }
3872
+ return { toUninstall, toKeep };
3873
+ }
3592
3874
  function listAllSkills() {
3593
3875
  const categories = getAllCategories();
3594
3876
  console.log();
@@ -3625,6 +3907,9 @@ function resolveSkillSourcePath(skill, repoPath) {
3625
3907
  }
3626
3908
 
3627
3909
  // src/ui/display.ts
3910
+ init_i18n();
3911
+ init_detector();
3912
+ init_registry();
3628
3913
  import chalk6 from "chalk";
3629
3914
  import Table2 from "cli-table3";
3630
3915
  function printPluginList(plugins, installed) {
@@ -3713,6 +3998,12 @@ function printEnhancedSummary(results, tool, configRoot) {
3713
3998
  }
3714
3999
 
3715
4000
  // src/commands/init.ts
4001
+ init_logger();
4002
+ init_i18n();
4003
+ init_config();
4004
+ init_paths();
4005
+ init_theme();
4006
+ init_constants();
3716
4007
  import { existsSync as existsSync16, readFileSync as readFileSync8 } from "fs";
3717
4008
  import { join as join15 } from "path";
3718
4009
  async function initCommand() {
@@ -3942,6 +4233,8 @@ async function skillInstallFlow() {
3942
4233
  }
3943
4234
 
3944
4235
  // src/commands/list.ts
4236
+ init_registry();
4237
+ init_manifest();
3945
4238
  async function listCommand() {
3946
4239
  try {
3947
4240
  const repoManager = createRepositoryManager();
@@ -3955,6 +4248,11 @@ async function listCommand() {
3955
4248
  }
3956
4249
 
3957
4250
  // src/commands/doctor.ts
4251
+ init_detector();
4252
+ init_registry();
4253
+ init_manifest();
4254
+ init_paths();
4255
+ init_i18n();
3958
4256
  import chalk8 from "chalk";
3959
4257
  import { existsSync as existsSync17, readdirSync as readdirSync5, lstatSync as lstatSync2, unlinkSync as unlinkSync5, mkdirSync as mkdirSync7 } from "fs";
3960
4258
  import { join as join16 } from "path";
@@ -4125,6 +4423,8 @@ function fixBrokenLinks(dir) {
4125
4423
  }
4126
4424
 
4127
4425
  // src/commands/status.ts
4426
+ init_manifest();
4427
+ init_i18n();
4128
4428
  import chalk9 from "chalk";
4129
4429
  async function statusCommand() {
4130
4430
  const installed = scanInstalled();
@@ -4152,8 +4452,15 @@ async function statusCommand() {
4152
4452
  }
4153
4453
 
4154
4454
  // src/commands/install.ts
4455
+ init_registry();
4456
+ init_wizard();
4457
+ init_manifest();
4458
+ init_logger();
4459
+ init_i18n();
4460
+ init_config();
4461
+ init_paths();
4155
4462
  import { join as join17 } from "path";
4156
- import { confirm } from "@inquirer/prompts";
4463
+ import { confirm as confirm2 } from "@inquirer/prompts";
4157
4464
  import chalk10 from "chalk";
4158
4465
  async function installCommand(names, options) {
4159
4466
  if (options.list) {
@@ -4367,7 +4674,7 @@ async function installCommand(names, options) {
4367
4674
  const plugin = findPlugin(pluginId);
4368
4675
  const displayName = plugin?.displayName || pluginId;
4369
4676
  logger.warn(`${displayName} [${t("install_already_installed")}]`);
4370
- const shouldReinstall = await confirm({
4677
+ const shouldReinstall = await confirm2({
4371
4678
  message: `${t("install_reinstall_confirm")}?`,
4372
4679
  default: false
4373
4680
  });
@@ -4482,12 +4789,34 @@ async function installPlugins(pluginIds, tool, level, repoPath, installPath, yes
4482
4789
  }
4483
4790
 
4484
4791
  // src/commands/uninstall.ts
4792
+ init_registry();
4485
4793
  import { existsSync as existsSync18, unlinkSync as unlinkSync6, rmdirSync, readdirSync as readdirSync6 } from "fs";
4486
4794
  import { resolve, basename as basename3, sep } from "path";
4487
4795
  import chalk11 from "chalk";
4796
+ import { select as select5, checkbox as checkbox2, Separator as Separator4, confirm as confirm3 } from "@inquirer/prompts";
4797
+ init_config();
4798
+ init_fs_helpers();
4799
+ init_logger();
4800
+ init_i18n();
4801
+ init_paths();
4802
+ init_manifest();
4803
+ init_theme();
4804
+ init_wizard();
4488
4805
  async function uninstallCommand(names, options) {
4489
4806
  const tool = options.tool ? validateTool(options.tool) : "opencode";
4490
4807
  const level = options.level ? validateLevel(options.level) : "project";
4808
+ if (options.all) {
4809
+ await uninstallAll(tool, level, options.yes || false);
4810
+ return;
4811
+ }
4812
+ if (options.recent) {
4813
+ await uninstallRecent(tool, level, options.yes || false);
4814
+ return;
4815
+ }
4816
+ if (names.length === 0) {
4817
+ await uninstallInteractive(tool, level);
4818
+ return;
4819
+ }
4491
4820
  const plugins = [];
4492
4821
  const skills = [];
4493
4822
  for (const name of names) {
@@ -4503,99 +4832,289 @@ async function uninstallCommand(names, options) {
4503
4832
  }
4504
4833
  logger.error(`${t("uninstall_not_found")}: ${name}`);
4505
4834
  }
4506
- for (const pluginId of plugins) {
4507
- const plugin = findPlugin(pluginId);
4508
- if (!plugin) continue;
4509
- const record = readRecord(plugin.id);
4510
- if (!record) {
4511
- logger.warn(`${plugin.displayName} ${t("uninstall_no_record")}`);
4512
- logger.info(`${t("uninstall_no_record_hint")}`);
4513
- continue;
4835
+ await uninstallPlugins(plugins, options.yes || false);
4836
+ await uninstallSkillsByName(skills, tool, level);
4837
+ }
4838
+ async function uninstallAll(tool, level, yes) {
4839
+ const installPath = level === "project" ? process.cwd() : getConfigRoot(tool, level);
4840
+ const installedSkills = getInstalledSkills(tool, level, installPath);
4841
+ const installedPlugins = scanInstalled().filter((p) => p.tool === tool && p.level === level);
4842
+ const totalItems = installedSkills.length + installedPlugins.length;
4843
+ if (totalItems === 0) {
4844
+ logger.warn(t("uninstall_no_installed"));
4845
+ return;
4846
+ }
4847
+ logger.info(t("uninstall_all_summary").replace("{skills}", String(installedSkills.length)).replace("{plugins}", String(installedPlugins.length)));
4848
+ logger.blank();
4849
+ for (const s of installedSkills) {
4850
+ logger.step(` \u2022 ${chalk11.cyan(s)}`);
4851
+ }
4852
+ for (const p of installedPlugins) {
4853
+ logger.step(` \u2022 ${chalk11.cyan(p.displayName)} ${chalk11.dim(`(${p.id})`)}`);
4854
+ }
4855
+ logger.blank();
4856
+ if (!yes) {
4857
+ const confirmed = await confirm3({
4858
+ message: t("uninstall_confirm_prompt").replace("{count}", chalk11.bold(String(totalItems))),
4859
+ default: false
4860
+ });
4861
+ if (!confirmed) {
4862
+ logger.info(t("init_cancelled"));
4863
+ return;
4514
4864
  }
4515
- logger.info(`${t("uninstall_in_progress")} ${plugin.displayName}...`);
4516
- const configRoot = getConfigRoot(record.tool, record.level);
4517
- const allowedBases = [resolve(configRoot), resolve(record.installPath)];
4518
- const isSafePath = (p) => {
4519
- const resolved = resolve(p);
4520
- return allowedBases.some((base) => resolved === base || resolved.startsWith(base + sep));
4521
- };
4522
- let removedFiles = 0;
4523
- let removedDirs = 0;
4524
- for (const filePath of record.files) {
4525
- if (!isSafePath(filePath)) continue;
4526
- try {
4527
- if (existsSync18(filePath) || isSymlink(filePath)) {
4528
- unlinkSync6(filePath);
4529
- const name = basename3(filePath);
4530
- logger.step(` ${t("uninstall_remove_label")}: ${name}`);
4531
- removedFiles++;
4532
- }
4533
- } catch {
4534
- }
4865
+ }
4866
+ if (installedSkills.length > 0) {
4867
+ logger.info(`${t("uninstall_skills_in_progress")} ${t("skill_count_format").replace("{count}", String(installedSkills.length))}...`);
4868
+ await uninstallSkills(installedSkills, tool, level);
4869
+ }
4870
+ if (installedPlugins.length > 0) {
4871
+ logger.info(`${t("uninstall_plugin_batch_progress").replace("{count}", String(installedPlugins.length))}...`);
4872
+ for (const inst of installedPlugins) {
4873
+ await uninstallPluginById(inst.id, true);
4535
4874
  }
4536
- const sortedDirs = [...record.directories].filter(isSafePath).sort((a, b) => b.length - a.length);
4537
- for (const dirPath of sortedDirs) {
4538
- try {
4539
- if (resolve(dirPath) === resolve(configRoot)) {
4540
- continue;
4541
- }
4542
- if (existsSync18(dirPath)) {
4543
- const entries = readdirSync6(dirPath);
4544
- if (entries.length === 0) {
4545
- rmdirSync(dirPath);
4546
- const name = basename3(dirPath);
4547
- logger.step(` ${t("uninstall_clean_empty_dir")}: ${name}/`);
4548
- removedDirs++;
4549
- }
4550
- }
4551
- } catch {
4875
+ }
4876
+ logger.blank();
4877
+ logger.success(t("uninstall_all_done"));
4878
+ logger.blank();
4879
+ }
4880
+ async function uninstallRecent(tool, level, yes) {
4881
+ const installPath = level === "project" ? process.cwd() : getConfigRoot(tool, level);
4882
+ const lastBatch = getLastBatchSkills(tool, level, installPath);
4883
+ if (!lastBatch || lastBatch.length === 0) {
4884
+ logger.warn(t("uninstall_recent_no_history"));
4885
+ return;
4886
+ }
4887
+ logger.info(t("uninstall_recent_progress").replace("{count}", chalk11.bold(String(lastBatch.length))));
4888
+ logger.blank();
4889
+ for (const s of lastBatch) {
4890
+ logger.step(` \u2022 ${chalk11.cyan(s)}`);
4891
+ }
4892
+ logger.blank();
4893
+ if (!yes) {
4894
+ const confirmed = await confirm3({
4895
+ message: t("uninstall_confirm_prompt").replace("{count}", chalk11.bold(String(lastBatch.length))),
4896
+ default: false
4897
+ });
4898
+ if (!confirmed) {
4899
+ logger.info(t("init_cancelled"));
4900
+ return;
4901
+ }
4902
+ }
4903
+ logger.info(`${t("uninstall_skills_in_progress")} ${t("skill_count_format").replace("{count}", String(lastBatch.length))}...`);
4904
+ await uninstallSkills(lastBatch, tool, level);
4905
+ logger.blank();
4906
+ logger.success(t("skill_uninstall_done"));
4907
+ logger.blank();
4908
+ }
4909
+ async function uninstallInteractive(defaultTool, defaultLevel) {
4910
+ let tool = defaultTool;
4911
+ let level = defaultLevel;
4912
+ printBoxTitle(t("uninstall_interactive_title"));
4913
+ const typeChoices = [
4914
+ { name: `> ${t("uninstall_type_skill")}`, value: "skill" },
4915
+ { name: `> ${t("uninstall_type_plugin")}`, value: "plugin" },
4916
+ new Separator4("\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500"),
4917
+ { name: "x " + t("wizard_cancel"), value: "cancel" }
4918
+ ];
4919
+ showOperationHints();
4920
+ const uninstallType = await select5({
4921
+ message: t("uninstall_select_type"),
4922
+ choices: typeChoices,
4923
+ loop: false,
4924
+ theme: selectTheme
4925
+ });
4926
+ if (uninstallType === "cancel") {
4927
+ logger.info(t("init_cancelled"));
4928
+ return;
4929
+ }
4930
+ if (!process.env.INSTALL_HELPER_TOOL) {
4931
+ const detected = await selectToolWithDetection();
4932
+ if (detected === "back" || detected === "cancel") {
4933
+ logger.info(t("init_cancelled"));
4934
+ return;
4935
+ }
4936
+ tool = detected;
4937
+ }
4938
+ if (!process.env.INSTALL_HELPER_LEVEL) {
4939
+ const { stepLevel: stepLevel2 } = await Promise.resolve().then(() => (init_wizard(), wizard_exports));
4940
+ const levelResult = await stepLevel2();
4941
+ if (levelResult === "__back__" || levelResult === "__cancel__") {
4942
+ logger.info(t("init_cancelled"));
4943
+ return;
4944
+ }
4945
+ level = levelResult;
4946
+ }
4947
+ if (uninstallType === "skill") {
4948
+ await interactiveSkillUninstall(tool, level);
4949
+ } else {
4950
+ await interactivePluginUninstall(tool, level);
4951
+ }
4952
+ }
4953
+ async function interactiveSkillUninstall(tool, level) {
4954
+ const result = await interactiveSkillUnselect(tool, level);
4955
+ if (result === "back" || result === "cancel") {
4956
+ if (result === "cancel") logger.info(t("init_cancelled"));
4957
+ return;
4958
+ }
4959
+ const { toUninstall } = result;
4960
+ logger.info(`${t("uninstall_skills_in_progress")} ${t("skill_count_format").replace("{count}", String(toUninstall.length))}...`);
4961
+ await uninstallSkills(toUninstall, tool, level);
4962
+ logger.blank();
4963
+ logger.success(t("skill_uninstall_done"));
4964
+ logger.blank();
4965
+ }
4966
+ async function interactivePluginUninstall(tool, level) {
4967
+ const installed = scanInstalled().filter((p) => p.tool === tool && p.level === level);
4968
+ if (installed.length === 0) {
4969
+ logger.warn(t("uninstall_no_installed_plugins"));
4970
+ return;
4971
+ }
4972
+ const pluginChoices = [
4973
+ ...installed.map((inst) => ({
4974
+ name: `${chalk11.cyan(inst.displayName)} ${chalk11.dim(`(${inst.id})`)}`,
4975
+ value: inst.id,
4976
+ checked: true,
4977
+ description: `${inst.skillsCount} skills, ${inst.agentsCount} agents`
4978
+ }))
4979
+ ];
4980
+ printBoxTitle(t("uninstall_interactive_title"));
4981
+ logger.info(chalk11.dim(` ${t("uninstall_checkbox_hint")}`));
4982
+ logger.blank();
4983
+ showOperationHints(true);
4984
+ const selected = await checkbox2({
4985
+ message: t("uninstall_select_plugins"),
4986
+ choices: pluginChoices,
4987
+ loop: false,
4988
+ instructions: false,
4989
+ theme: checkboxTheme,
4990
+ pageSize: 15
4991
+ });
4992
+ const toUninstall = installed.filter((inst) => !selected.includes(inst.id));
4993
+ if (toUninstall.length === 0) {
4994
+ logger.info(t("uninstall_nothing_to_uninstall"));
4995
+ return;
4996
+ }
4997
+ const confirmed = await confirm3({
4998
+ message: t("uninstall_confirm_count").replace("{count}", chalk11.bold(String(toUninstall.length))),
4999
+ default: false
5000
+ });
5001
+ if (!confirmed) {
5002
+ logger.info(t("init_cancelled"));
5003
+ return;
5004
+ }
5005
+ logger.info(`${t("uninstall_plugin_batch_progress").replace("{count}", String(toUninstall.length))}...`);
5006
+ for (const inst of toUninstall) {
5007
+ await uninstallPluginById(inst.id, true);
5008
+ }
5009
+ logger.blank();
5010
+ logger.success(t("uninstall_all_done"));
5011
+ logger.blank();
5012
+ }
5013
+ async function uninstallPlugins(pluginIds, batchMode) {
5014
+ for (const pluginId of pluginIds) {
5015
+ await uninstallPluginById(pluginId, batchMode);
5016
+ }
5017
+ }
5018
+ async function uninstallPluginById(pluginId, batchMode) {
5019
+ const plugin = findPlugin(pluginId);
5020
+ if (!plugin) return;
5021
+ const record = readRecord(plugin.id);
5022
+ if (!record) {
5023
+ logger.warn(`${plugin.displayName} ${t("uninstall_no_record")}`);
5024
+ logger.info(`${t("uninstall_no_record_hint")}`);
5025
+ return;
5026
+ }
5027
+ logger.info(`${t("uninstall_in_progress")} ${plugin.displayName}...`);
5028
+ const configRoot = getConfigRoot(record.tool, record.level);
5029
+ const allowedBases = [resolve(configRoot), resolve(record.installPath)];
5030
+ const isSafePath = (p) => {
5031
+ const resolved = resolve(p);
5032
+ return allowedBases.some((base) => resolved === base || resolved.startsWith(base + sep));
5033
+ };
5034
+ let removedFiles = 0;
5035
+ let removedDirs = 0;
5036
+ for (const filePath of record.files) {
5037
+ if (!isSafePath(filePath)) continue;
5038
+ try {
5039
+ if (existsSync18(filePath) || isSymlink(filePath)) {
5040
+ unlinkSync6(filePath);
5041
+ const name = basename3(filePath);
5042
+ logger.step(` ${t("uninstall_remove_label")}: ${name}`);
5043
+ removedFiles++;
4552
5044
  }
5045
+ } catch {
4553
5046
  }
4554
- deleteRecord(plugin.id);
4555
- removeInstalledPlugin(plugin.id);
4556
- const backups = findBackups(configRoot);
4557
- const otherBackups = backups.filter((b) => b.pluginId !== pluginId);
4558
- if (otherBackups.length > 0) {
4559
- const choice = await showRestorePrompt(otherBackups);
4560
- if (choice !== "none") {
4561
- const restored = restoreBackup(choice, configRoot, record.tool);
4562
- if (restored) {
4563
- const backupInfo = otherBackups.find((b) => b.filePath === choice);
4564
- logger.success(`${t("backup_restore_success")}: ${backupInfo?.pluginName || ""}`);
4565
- deleteBackup(choice);
5047
+ }
5048
+ const sortedDirs = [...record.directories].filter(isSafePath).sort((a, b) => b.length - a.length);
5049
+ for (const dirPath of sortedDirs) {
5050
+ try {
5051
+ if (resolve(dirPath) === resolve(configRoot)) {
5052
+ continue;
5053
+ }
5054
+ if (existsSync18(dirPath)) {
5055
+ const entries = readdirSync6(dirPath);
5056
+ if (entries.length === 0) {
5057
+ rmdirSync(dirPath);
5058
+ const name = basename3(dirPath);
5059
+ logger.step(` ${t("uninstall_clean_empty_dir")}: ${name}/`);
5060
+ removedDirs++;
4566
5061
  }
4567
5062
  }
4568
- }
4569
- const currentBackups = backups.filter((b) => b.pluginId === pluginId);
4570
- for (const backup of currentBackups) {
4571
- deleteBackup(backup.filePath);
4572
- }
4573
- const totalRemoved = removedFiles + removedDirs;
4574
- if (totalRemoved > 0) {
4575
- logger.success(t("uninstall_summary_format").replace("{name}", plugin.displayName).replace("{files}", String(removedFiles)).replace("{dirs}", String(removedDirs)));
4576
- } else {
4577
- logger.warn(`${plugin.displayName}${t("uninstall_files_gone")}`);
5063
+ } catch {
4578
5064
  }
4579
5065
  }
4580
- if (skills.length > 0) {
4581
- logger.info(`${t("uninstall_skills_in_progress")} ${t("skill_count_format").replace("{count}", String(skills.length))}...`);
4582
- const results = await uninstallSkills(skills, tool, level);
4583
- let successCount = 0;
4584
- let failCount = 0;
4585
- for (const result of results) {
4586
- if (result.success) {
4587
- successCount++;
4588
- } else {
4589
- failCount++;
5066
+ deleteRecord(plugin.id);
5067
+ removeInstalledPlugin(plugin.id);
5068
+ const backups = findBackups(configRoot);
5069
+ const otherBackups = backups.filter((b) => b.pluginId !== pluginId);
5070
+ if (!batchMode && otherBackups.length > 0) {
5071
+ const choice = await showRestorePrompt(otherBackups);
5072
+ if (choice !== "none") {
5073
+ const restored = restoreBackup(choice, configRoot, record.tool);
5074
+ if (restored) {
5075
+ const backupInfo = otherBackups.find((b) => b.filePath === choice);
5076
+ logger.success(`${t("backup_restore_success")}: ${backupInfo?.pluginName || ""}`);
5077
+ deleteBackup(choice);
4590
5078
  }
4591
5079
  }
4592
- logger.blank();
4593
- logger.success(`${t("skill_uninstall_done")}: ${chalk11.green(t("result_success_format").replace("{count}", String(successCount)))}, ${failCount > 0 ? chalk11.red(t("result_failed_format").replace("{count}", String(failCount))) : chalk11.dim(t("result_failed_format").replace("{count}", String(failCount)))}`);
4594
- logger.blank();
5080
+ } else if (batchMode && otherBackups.length > 0) {
5081
+ logger.info(t("uninstall_plugin_batch_skip_restore"));
4595
5082
  }
5083
+ const currentBackups = backups.filter((b) => b.pluginId === pluginId);
5084
+ for (const backup of currentBackups) {
5085
+ deleteBackup(backup.filePath);
5086
+ }
5087
+ const totalRemoved = removedFiles + removedDirs;
5088
+ if (totalRemoved > 0) {
5089
+ logger.success(t("uninstall_summary_format").replace("{name}", plugin.displayName).replace("{files}", String(removedFiles)).replace("{dirs}", String(removedDirs)));
5090
+ } else {
5091
+ logger.warn(`${plugin.displayName}${t("uninstall_files_gone")}`);
5092
+ }
5093
+ }
5094
+ async function uninstallSkillsByName(skills, tool, level) {
5095
+ if (skills.length === 0) return;
5096
+ logger.info(`${t("uninstall_skills_in_progress")} ${t("skill_count_format").replace("{count}", String(skills.length))}...`);
5097
+ const results = await uninstallSkills(skills, tool, level);
5098
+ let successCount = 0;
5099
+ let failCount = 0;
5100
+ for (const result of results) {
5101
+ if (result.success) {
5102
+ successCount++;
5103
+ } else {
5104
+ failCount++;
5105
+ }
5106
+ }
5107
+ logger.blank();
5108
+ logger.success(`${t("skill_uninstall_done")}: ${chalk11.green(t("result_success_format").replace("{count}", String(successCount)))}, ${failCount > 0 ? chalk11.red(t("result_failed_format").replace("{count}", String(failCount))) : chalk11.dim(t("result_failed_format").replace("{count}", String(failCount)))}`);
5109
+ logger.blank();
4596
5110
  }
4597
5111
 
4598
5112
  // src/commands/update.ts
5113
+ init_registry();
5114
+ init_manifest();
5115
+ init_logger();
5116
+ init_i18n();
5117
+ init_paths();
4599
5118
  import chalk12 from "chalk";
4600
5119
  async function updateCommand(pluginNames, options) {
4601
5120
  const repoManager = createRepositoryManager();
@@ -4692,9 +5211,12 @@ async function updateCommand(pluginNames, options) {
4692
5211
  }
4693
5212
 
4694
5213
  // src/commands/info.ts
5214
+ init_registry();
4695
5215
  import chalk13 from "chalk";
4696
5216
  import { existsSync as existsSync19, readdirSync as readdirSync7 } from "fs";
4697
5217
  import { join as join18 } from "path";
5218
+ init_manifest();
5219
+ init_i18n();
4698
5220
  async function infoCommand(pluginName) {
4699
5221
  const plugin = findPlugin(pluginName);
4700
5222
  if (!plugin) {
@@ -4740,6 +5262,8 @@ async function infoCommand(pluginName) {
4740
5262
  }
4741
5263
 
4742
5264
  // src/commands/lang.ts
5265
+ init_config();
5266
+ init_i18n();
4743
5267
  import chalk14 from "chalk";
4744
5268
  async function langCommand(action, value) {
4745
5269
  const config = readConfig();
@@ -4776,6 +5300,8 @@ async function langCommand(action, value) {
4776
5300
  }
4777
5301
 
4778
5302
  // src/cli.ts
5303
+ init_config();
5304
+ init_i18n();
4779
5305
  import { readFileSync as readFileSync9, existsSync as existsSync20 } from "fs";
4780
5306
  import { fileURLToPath as fileURLToPath4 } from "url";
4781
5307
  import { dirname as dirname6, join as join19 } from "path";
@@ -4829,7 +5355,7 @@ function createCLI() {
4829
5355
  program2.command("install [names...]").description("Install plugins or skills (auto-detects type)").option("-t, --tool <tool>", "AI tool (opencode, claude, trae, cursor, copilot, codearts)").option("-l, --level <level>", "Install level (project, global)", "project").option("-y, --yes", "Skip confirmation prompts").option("-a, --all", "Install ALL available skills").option("--list", "List all available skills by category").action(async (names, options) => {
4830
5356
  await installCommand(names, options);
4831
5357
  });
4832
- program2.command("uninstall <names...>").description("Uninstall plugins or skills (auto-detects type)").option("-t, --tool <tool>", "AI tool (opencode, claude, trae, cursor, copilot, codearts)").option("-l, --level <level>", "Install level (project, global)", "project").action(async (names, options) => {
5358
+ program2.command("uninstall [names...]").description("Uninstall plugins or skills (auto-detects type)").option("-t, --tool <tool>", "AI tool (opencode, claude, trae, cursor, copilot, codearts)").option("-l, --level <level>", "Install level (project, global)", "project").option("-y, --yes", "Skip confirmation prompts").option("-a, --all", "Uninstall ALL installed skills and plugins").option("--recent", "Uninstall the most recently installed skill batch").action(async (names, options) => {
4833
5359
  await uninstallCommand(names, options);
4834
5360
  });
4835
5361
  program2.command("update [plugins...]").description("Update installed plugins (git pull + reinstall)").option("-t, --tool <tool>", "AI tool (opencode, claude, trae, cursor, copilot, codearts)").option("-l, --level <level>", "Install level (project, global)").option("-y, --yes", "Skip confirmation prompts").action(async (plugins, options) => {
@@ -4848,6 +5374,7 @@ function createCLI() {
4848
5374
  }
4849
5375
 
4850
5376
  // src/index.ts
5377
+ init_i18n();
4851
5378
  function isExitError(error) {
4852
5379
  if (!error) return false;
4853
5380
  return error.name === "ExitPromptError" || error.message?.includes("force closed") || error.message?.includes("SIGINT") || error.constructor?.name === "ExitPromptError";