agents-inc 0.164.0 → 0.166.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/CHANGELOG.md +63 -0
- package/README.md +8 -9
- package/dist/{chunk-X4SSJZLY.js → chunk-25MPBIK3.js} +12 -261
- package/dist/chunk-25MPBIK3.js.map +1 -0
- package/dist/{chunk-LT5GXEB2.js → chunk-2VUYFTUB.js} +8 -7
- package/dist/chunk-2VUYFTUB.js.map +1 -0
- package/dist/chunk-4AAOOAIN.js +49 -0
- package/dist/chunk-4AAOOAIN.js.map +1 -0
- package/dist/{chunk-ARYNOWKF.js → chunk-4NDBUJHK.js} +8 -8
- package/dist/{chunk-S63LXWMC.js → chunk-6L75SQZU.js} +2 -2
- package/dist/{chunk-7REKOTKG.js → chunk-6LF4CQBY.js} +3 -3
- package/dist/{chunk-K5ITEA3I.js → chunk-7JNJ52CD.js} +34 -17
- package/dist/chunk-7JNJ52CD.js.map +1 -0
- package/dist/{chunk-XPDVAJDH.js → chunk-A4KDXNOT.js} +3519 -1568
- package/dist/chunk-A4KDXNOT.js.map +1 -0
- package/dist/{chunk-XHPWTL4I.js → chunk-DAIEQJIF.js} +3 -3
- package/dist/{chunk-UITEKY2R.js → chunk-ENGYJCTF.js} +28 -4
- package/dist/chunk-ENGYJCTF.js.map +1 -0
- package/dist/{chunk-G2JJ5BO5.js → chunk-G4JK7WVO.js} +336 -140
- package/dist/chunk-G4JK7WVO.js.map +1 -0
- package/dist/{chunk-X37UYIE3.js → chunk-G6UREQ4V.js} +436 -739
- package/dist/chunk-G6UREQ4V.js.map +1 -0
- package/dist/chunk-GE3WKJ6Q.js +375 -0
- package/dist/chunk-GE3WKJ6Q.js.map +1 -0
- package/dist/{chunk-RGYDFBCT.js → chunk-HHIYT3PI.js} +5 -5
- package/dist/{chunk-2CQNPLVF.js → chunk-HWEKHVLE.js} +63 -42
- package/dist/chunk-HWEKHVLE.js.map +1 -0
- package/dist/{chunk-XVAQG2CV.js → chunk-JOEA52NR.js} +10 -8
- package/dist/chunk-JOEA52NR.js.map +1 -0
- package/dist/{chunk-3WVH2CTK.js → chunk-JQRJQ4SS.js} +15 -8
- package/dist/chunk-JQRJQ4SS.js.map +1 -0
- package/dist/{chunk-DSL66I4N.js → chunk-LFWLEDUG.js} +6 -6
- package/dist/{chunk-B3Y3QMWI.js → chunk-MAWNVT2C.js} +4 -4
- package/dist/{chunk-Q4IRRVXK.js → chunk-MPTNC32T.js} +3 -3
- package/dist/chunk-NBXXFIIW.js +73 -0
- package/dist/chunk-NBXXFIIW.js.map +1 -0
- package/dist/{chunk-B6FSLXYN.js → chunk-PMJWD27C.js} +3 -3
- package/dist/{chunk-XATLUKXK.js → chunk-PNB3524H.js} +6 -6
- package/dist/chunk-PXWG7KFO.js +39 -0
- package/dist/chunk-PXWG7KFO.js.map +1 -0
- package/dist/{chunk-4VL3CEOS.js → chunk-QHDPLLK6.js} +3 -3
- package/dist/{chunk-AOTCIUGX.js → chunk-RAHSOJQ2.js} +2 -2
- package/dist/{chunk-PHCPUQVR.js → chunk-RZDXDMT6.js} +2 -2
- package/dist/{chunk-6MV4JOCL.js → chunk-SAYZWCH6.js} +2 -2
- package/dist/{chunk-URXIQE7I.js → chunk-SCOQ34YM.js} +2 -2
- package/dist/{chunk-NQXO4LR3.js → chunk-SXVHSOTH.js} +16 -11
- package/dist/chunk-SXVHSOTH.js.map +1 -0
- package/dist/{chunk-QZX7SYKU.js → chunk-T6UWJAB3.js} +2 -2
- package/dist/{chunk-ZVXGW2IC.js → chunk-TODCQFRB.js} +4 -6
- package/dist/chunk-TODCQFRB.js.map +1 -0
- package/dist/{chunk-YRS3QZP2.js → chunk-TTY6DPJN.js} +3 -3
- package/dist/{chunk-QGUP3QJF.js → chunk-TZ2YJJKK.js} +22 -18
- package/dist/{chunk-QGUP3QJF.js.map → chunk-TZ2YJJKK.js.map} +1 -1
- package/dist/chunk-V3I7VQ7N.js +356 -0
- package/dist/chunk-V3I7VQ7N.js.map +1 -0
- package/dist/{chunk-AVK2HEKB.js → chunk-V5WXIM2F.js} +2 -6
- package/dist/{chunk-AVK2HEKB.js.map → chunk-V5WXIM2F.js.map} +1 -1
- package/dist/{chunk-NKGYKOB7.js → chunk-VAPTVR3J.js} +7 -8
- package/dist/chunk-VAPTVR3J.js.map +1 -0
- package/dist/chunk-VRXX4D6K.js +31 -0
- package/dist/chunk-VRXX4D6K.js.map +1 -0
- package/dist/{chunk-ABAZMMG4.js → chunk-WVUDLKIO.js} +2 -2
- package/dist/{chunk-ECURHW3T.js → chunk-WWIFNPJG.js} +13 -12
- package/dist/chunk-WWIFNPJG.js.map +1 -0
- package/dist/{chunk-J27W6TXS.js → chunk-XQHZPINL.js} +8 -4
- package/dist/chunk-XQHZPINL.js.map +1 -0
- package/dist/{chunk-V5GLL2JB.js → chunk-XZEVWPX6.js} +7 -7
- package/dist/chunk-Y3VIRVVE.js +932 -0
- package/dist/chunk-Y3VIRVVE.js.map +1 -0
- package/dist/{chunk-NTF4UXGK.js → chunk-Y47EV74W.js} +73 -30
- package/dist/chunk-Y47EV74W.js.map +1 -0
- package/dist/chunk-ZR4YPKXQ.js +159 -0
- package/dist/chunk-ZR4YPKXQ.js.map +1 -0
- package/dist/chunk-ZXKBERQU.js +250 -0
- package/dist/chunk-ZXKBERQU.js.map +1 -0
- package/dist/commands/build/marketplace.js +17 -17
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +11 -9
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +105 -27
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +309 -171
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +503 -314
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +40 -23
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +44 -40
- package/dist/commands/list.js +44 -10
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +13 -10
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +12 -10
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +102 -15
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +231 -103
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +49 -20
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/prompt-confirm.js +1 -1
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/select-list.js +3 -3
- package/dist/components/common/spinner.js +6 -3
- package/dist/components/wizard/category-grid.js +5 -5
- package/dist/components/wizard/checkbox-grid.js +4 -4
- package/dist/components/wizard/domain-selection.js +9 -9
- package/dist/components/wizard/run-wizard-session.js +29 -29
- package/dist/components/wizard/scroll-affordance.js +2 -2
- package/dist/components/wizard/skill-agent-summary.js +5 -5
- package/dist/components/wizard/source-grid.js +6 -6
- package/dist/components/wizard/stack-selection.js +8 -8
- package/dist/components/wizard/step-agents.js +8 -8
- package/dist/components/wizard/step-build.js +8 -8
- package/dist/components/wizard/step-confirm.js +9 -9
- package/dist/components/wizard/step-sources.js +9 -9
- package/dist/components/wizard/step-stack.js +9 -9
- package/dist/components/wizard/summary-panel.js +8 -8
- package/dist/components/wizard/toast.js +2 -2
- package/dist/components/wizard/wizard-layout.js +12 -12
- package/dist/components/wizard/wizard-tabs.js +2 -2
- package/dist/components/wizard/wizard.js +27 -27
- package/dist/hooks/init.js +69 -43
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-3C27ENC7.js +14 -0
- package/dist/recompile-project-agents-DGNBCU3N.js +18 -0
- package/dist/{source-loader-GRBVNRAW.js → source-loader-7KZ3MD5O.js} +6 -4
- package/dist/src/agents/_templates/agent-body.liquid +55 -0
- package/dist/src/agents/_templates/agent.liquid +1 -55
- package/dist/src/agents/meta/agent-summoner/output.md +1 -1
- package/dist/src/agents/meta/agent-summoner/playbook.md +15 -7
- package/dist/stores/wizard-store.js +4 -4
- package/package.json +10 -9
- package/src/agents/_templates/agent-body.liquid +55 -0
- package/src/agents/_templates/agent.liquid +1 -55
- package/src/agents/meta/agent-summoner/output.md +1 -1
- package/src/agents/meta/agent-summoner/playbook.md +15 -7
- package/src/schemas/project-config.schema.json +1 -1
- package/src/schemas/project-source-config.schema.json +1 -1
- package/dist/chunk-2CQNPLVF.js.map +0 -1
- package/dist/chunk-3WVH2CTK.js.map +0 -1
- package/dist/chunk-7ANJQLPJ.js +0 -35
- package/dist/chunk-7ANJQLPJ.js.map +0 -1
- package/dist/chunk-ECURHW3T.js.map +0 -1
- package/dist/chunk-FLW25ORT.js +0 -130
- package/dist/chunk-FLW25ORT.js.map +0 -1
- package/dist/chunk-G2JJ5BO5.js.map +0 -1
- package/dist/chunk-J27W6TXS.js.map +0 -1
- package/dist/chunk-JCPANDNR.js +0 -35
- package/dist/chunk-JCPANDNR.js.map +0 -1
- package/dist/chunk-JIERYE6B.js +0 -480
- package/dist/chunk-JIERYE6B.js.map +0 -1
- package/dist/chunk-JU4ZGJ7A.js +0 -668
- package/dist/chunk-JU4ZGJ7A.js.map +0 -1
- package/dist/chunk-K5ITEA3I.js.map +0 -1
- package/dist/chunk-LT5GXEB2.js.map +0 -1
- package/dist/chunk-NKGYKOB7.js.map +0 -1
- package/dist/chunk-NQXO4LR3.js.map +0 -1
- package/dist/chunk-NTF4UXGK.js.map +0 -1
- package/dist/chunk-UITEKY2R.js.map +0 -1
- package/dist/chunk-X37UYIE3.js.map +0 -1
- package/dist/chunk-X4SSJZLY.js.map +0 -1
- package/dist/chunk-XPDVAJDH.js.map +0 -1
- package/dist/chunk-XVAQG2CV.js.map +0 -1
- package/dist/chunk-ZBPEFQ4G.js +0 -12
- package/dist/chunk-ZBPEFQ4G.js.map +0 -1
- package/dist/chunk-ZVXGW2IC.js.map +0 -1
- package/dist/load-agent-defs-7IM3GBEQ.js +0 -13
- package/dist/recompile-project-agents-VR4NLGOU.js +0 -17
- /package/dist/{chunk-ARYNOWKF.js.map → chunk-4NDBUJHK.js.map} +0 -0
- /package/dist/{chunk-S63LXWMC.js.map → chunk-6L75SQZU.js.map} +0 -0
- /package/dist/{chunk-7REKOTKG.js.map → chunk-6LF4CQBY.js.map} +0 -0
- /package/dist/{chunk-XHPWTL4I.js.map → chunk-DAIEQJIF.js.map} +0 -0
- /package/dist/{chunk-RGYDFBCT.js.map → chunk-HHIYT3PI.js.map} +0 -0
- /package/dist/{chunk-DSL66I4N.js.map → chunk-LFWLEDUG.js.map} +0 -0
- /package/dist/{chunk-B3Y3QMWI.js.map → chunk-MAWNVT2C.js.map} +0 -0
- /package/dist/{chunk-Q4IRRVXK.js.map → chunk-MPTNC32T.js.map} +0 -0
- /package/dist/{chunk-B6FSLXYN.js.map → chunk-PMJWD27C.js.map} +0 -0
- /package/dist/{chunk-XATLUKXK.js.map → chunk-PNB3524H.js.map} +0 -0
- /package/dist/{chunk-4VL3CEOS.js.map → chunk-QHDPLLK6.js.map} +0 -0
- /package/dist/{chunk-AOTCIUGX.js.map → chunk-RAHSOJQ2.js.map} +0 -0
- /package/dist/{chunk-PHCPUQVR.js.map → chunk-RZDXDMT6.js.map} +0 -0
- /package/dist/{chunk-6MV4JOCL.js.map → chunk-SAYZWCH6.js.map} +0 -0
- /package/dist/{chunk-URXIQE7I.js.map → chunk-SCOQ34YM.js.map} +0 -0
- /package/dist/{chunk-QZX7SYKU.js.map → chunk-T6UWJAB3.js.map} +0 -0
- /package/dist/{chunk-YRS3QZP2.js.map → chunk-TTY6DPJN.js.map} +0 -0
- /package/dist/{chunk-ABAZMMG4.js.map → chunk-WVUDLKIO.js.map} +0 -0
- /package/dist/{chunk-V5GLL2JB.js.map → chunk-XZEVWPX6.js.map} +0 -0
- /package/dist/{load-agent-defs-7IM3GBEQ.js.map → load-agent-defs-3C27ENC7.js.map} +0 -0
- /package/dist/{recompile-project-agents-VR4NLGOU.js.map → recompile-project-agents-DGNBCU3N.js.map} +0 -0
- /package/dist/{source-loader-GRBVNRAW.js.map → source-loader-7KZ3MD5O.js.map} +0 -0
package/dist/commands/eject.js
CHANGED
|
@@ -5,16 +5,22 @@ import {
|
|
|
5
5
|
loadSource,
|
|
6
6
|
mutateGlobal,
|
|
7
7
|
writeProjectPartial
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
8
|
+
} from "../chunk-G6UREQ4V.js";
|
|
9
|
+
import "../chunk-HWEKHVLE.js";
|
|
10
|
+
import "../chunk-PMJWD27C.js";
|
|
11
|
+
import "../chunk-ZR4YPKXQ.js";
|
|
12
|
+
import "../chunk-GE3WKJ6Q.js";
|
|
13
|
+
import {
|
|
14
|
+
providerFlag,
|
|
15
|
+
providerNamedBy,
|
|
16
|
+
refuseAnAmbiguousInstallation
|
|
17
|
+
} from "../chunk-NBXXFIIW.js";
|
|
12
18
|
import {
|
|
13
19
|
BaseCommand,
|
|
14
20
|
EXIT_CODES
|
|
15
|
-
} from "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
21
|
+
} from "../chunk-Y3VIRVVE.js";
|
|
22
|
+
import "../chunk-VAPTVR3J.js";
|
|
23
|
+
import "../chunk-RZDXDMT6.js";
|
|
18
24
|
import {
|
|
19
25
|
INCOMPLETE_WORK_RECOVERY,
|
|
20
26
|
INFO_MESSAGES,
|
|
@@ -28,19 +34,20 @@ import {
|
|
|
28
34
|
isHomeDirectory,
|
|
29
35
|
listDirectories,
|
|
30
36
|
loadProjectSourceConfig,
|
|
31
|
-
|
|
32
|
-
|
|
37
|
+
plural,
|
|
38
|
+
providerInUse,
|
|
39
|
+
relativeConfigPath,
|
|
40
|
+
resolveSource,
|
|
41
|
+
sourceFolderInUse
|
|
42
|
+
} from "../chunk-A4KDXNOT.js";
|
|
33
43
|
import {
|
|
34
|
-
matrix
|
|
35
|
-
|
|
36
|
-
} from "../chunk-AVK2HEKB.js";
|
|
44
|
+
matrix
|
|
45
|
+
} from "../chunk-V5WXIM2F.js";
|
|
37
46
|
import {
|
|
38
|
-
CLAUDE_SRC_DIR,
|
|
39
47
|
DIRS,
|
|
40
48
|
LOCAL_SKILLS_PATH,
|
|
41
|
-
PROJECT_ROOT
|
|
42
|
-
|
|
43
|
-
} from "../chunk-UITEKY2R.js";
|
|
49
|
+
PROJECT_ROOT
|
|
50
|
+
} from "../chunk-ENGYJCTF.js";
|
|
44
51
|
import "../chunk-OI2H6M5I.js";
|
|
45
52
|
|
|
46
53
|
// src/cli/commands/eject.ts
|
|
@@ -84,6 +91,7 @@ var Eject = class _Eject extends BaseCommand {
|
|
|
84
91
|
})
|
|
85
92
|
};
|
|
86
93
|
static flags = {
|
|
94
|
+
provider: providerFlag(),
|
|
87
95
|
force: Flags.boolean({
|
|
88
96
|
char: "f",
|
|
89
97
|
description: "Overwrite existing files",
|
|
@@ -101,6 +109,13 @@ var Eject = class _Eject extends BaseCommand {
|
|
|
101
109
|
async run() {
|
|
102
110
|
const { args, flags } = await this.parse(_Eject);
|
|
103
111
|
const projectDir = process.cwd();
|
|
112
|
+
await refuseAnAmbiguousInstallation(
|
|
113
|
+
projectDir,
|
|
114
|
+
"eject",
|
|
115
|
+
providerNamedBy(flags.provider),
|
|
116
|
+
(message) => this.error(message, { exit: EXIT_CODES.INVALID_ARGS })
|
|
117
|
+
);
|
|
118
|
+
await this.ensureConfigReadable(projectDir);
|
|
104
119
|
const ejectType = this.validateEjectType(args.type);
|
|
105
120
|
const outputBase = await this.resolveOutputBase(flags, projectDir);
|
|
106
121
|
this.printHeader(
|
|
@@ -149,7 +164,7 @@ var Eject = class _Eject extends BaseCommand {
|
|
|
149
164
|
}
|
|
150
165
|
return outputBase;
|
|
151
166
|
}
|
|
152
|
-
return
|
|
167
|
+
return sourceFolderInUse(projectDir, providerInUse(projectDir)).dir;
|
|
153
168
|
}
|
|
154
169
|
printHeader(brandingName, outputBase) {
|
|
155
170
|
this.log("");
|
|
@@ -209,17 +224,18 @@ var Eject = class _Eject extends BaseCommand {
|
|
|
209
224
|
* a config recording a marketplace it read out of a file it could not evaluate.
|
|
210
225
|
*/
|
|
211
226
|
async ensureConfig(projectDir, sourceResult) {
|
|
227
|
+
const configTsRel = relativeConfigPath(projectDir, providerInUse(projectDir));
|
|
212
228
|
try {
|
|
213
229
|
const configResult = await ensureMinimalConfig({
|
|
214
230
|
projectDir,
|
|
215
231
|
...sourceResult !== void 0 && { sourceResult }
|
|
216
232
|
});
|
|
217
233
|
if (configResult.created) {
|
|
218
|
-
this.logSuccess(`Created ${
|
|
234
|
+
this.logSuccess(`Created ${configTsRel}`);
|
|
219
235
|
}
|
|
220
236
|
} catch (error) {
|
|
221
237
|
this.reportIncompleteWork(
|
|
222
|
-
`Could not create ${
|
|
238
|
+
`Could not create ${configTsRel}: ${getErrorMessage(error)}`,
|
|
223
239
|
INCOMPLETE_WORK_RECOVERY.INSPECT_INSTALLATION
|
|
224
240
|
);
|
|
225
241
|
}
|
|
@@ -261,7 +277,7 @@ var Eject = class _Eject extends BaseCommand {
|
|
|
261
277
|
return;
|
|
262
278
|
}
|
|
263
279
|
this.logSuccess(
|
|
264
|
-
`${result.copiedSkills.length}
|
|
280
|
+
`${plural(result.copiedSkills.length, "skill")} ejected to ${result.destDir} from ${result.sourceLabel}`
|
|
265
281
|
);
|
|
266
282
|
this.log("You can now customize skill content locally.");
|
|
267
283
|
}
|
|
@@ -334,7 +350,7 @@ async function ejectSkills(options) {
|
|
|
334
350
|
copiedSkills: []
|
|
335
351
|
};
|
|
336
352
|
}
|
|
337
|
-
const skillIds =
|
|
353
|
+
const skillIds = [...sourceResult.marketplaceSkillIds].filter(
|
|
338
354
|
(skillId) => !matrix2.skills[skillId]?.local
|
|
339
355
|
);
|
|
340
356
|
if (skillIds.length === 0) {
|
|
@@ -356,7 +372,8 @@ async function ejectSkills(options) {
|
|
|
356
372
|
}
|
|
357
373
|
async function ensureMinimalConfig(options) {
|
|
358
374
|
const { projectDir, sourceResult } = options;
|
|
359
|
-
const
|
|
375
|
+
const provider = providerInUse(projectDir);
|
|
376
|
+
const tsConfigPath = getProjectConfigPath(projectDir, provider);
|
|
360
377
|
if (await fileExists(tsConfigPath)) {
|
|
361
378
|
return { configPath: tsConfigPath, created: false };
|
|
362
379
|
}
|
|
@@ -364,7 +381,7 @@ async function ensureMinimalConfig(options) {
|
|
|
364
381
|
const existingProjectConfig = await loadProjectSourceConfig(projectDir);
|
|
365
382
|
const source = resolvedConfig.source || void 0;
|
|
366
383
|
if (isHomeDirectory(projectDir)) {
|
|
367
|
-
await ensureBlankPair();
|
|
384
|
+
await ensureBlankPair(provider);
|
|
368
385
|
if (source) await recordSource(projectDir, source);
|
|
369
386
|
return { configPath: tsConfigPath, created: true };
|
|
370
387
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/eject.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport os from \"os\";\nimport { BaseCommand } from \"../base-command.js\";\nimport { copy, ensureDir, directoryExists, fileExists, listDirectories } from \"../utils/fs.js\";\nimport {\n CLAUDE_SRC_DIR,\n DIRS,\n LOCAL_SKILLS_PATH,\n PROJECT_ROOT,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { type SourceLoadResult } from \"../lib/loading/index.js\";\nimport { loadSource } from \"../lib/operations/index.js\";\nimport { matrix } from \"../lib/matrix/matrix-provider\";\nimport {\n resolveSource,\n loadProjectSourceConfig,\n getProjectConfigPath,\n} from \"../lib/configuration/index.js\";\nimport {\n ensureBlankPair,\n lazyGateDeps,\n mutateGlobal,\n writeProjectPartial,\n} from \"../lib/config-gate/index.js\";\nimport { isHomeDirectory } from \"../lib/installation/index.js\";\nimport { copySkillsToLocalFlattened, type CopiedSkill } from \"../lib/skills/index.js\";\nimport { INCOMPLETE_WORK_RECOVERY, INFO_MESSAGES } from \"../utils/messages.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport type { MergedSkillsMatrix, SkillId } from \"../types/index.js\";\nimport { typedKeys } from \"../utils/typed-object.js\";\n\nconst EJECT_TYPES = [\"agent-partials\", \"templates\", \"skills\", \"all\"] as const;\ntype EjectType = (typeof EJECT_TYPES)[number];\n\nfunction isEjectType(value: string): value is EjectType {\n return (EJECT_TYPES as readonly string[]).includes(value);\n}\n\nexport default class Eject extends BaseCommand {\n static summary = \"Eject skills, agent partials, or templates for local customization\";\n static description =\n \"Copy agent partials, templates, or skills to your project for customization. \" +\n \"Agent partials and templates are always copied from the CLI. \" +\n \"Skills are copied from the marketplace this installation is configured to read \" +\n \"(the public one by default).\";\n\n static examples = [\n {\n description: \"Eject agent partials for customization\",\n command: \"<%= config.bin %> <%= command.id %> agent-partials\",\n },\n {\n description: \"Eject only agent templates\",\n command: \"<%= config.bin %> <%= command.id %> templates\",\n },\n {\n description: \"Eject skills to local directory\",\n command: \"<%= config.bin %> <%= command.id %> skills\",\n },\n {\n description: \"Eject everything with force overwrite\",\n command: \"<%= config.bin %> <%= command.id %> all --force\",\n },\n {\n description: \"Eject to a custom output directory\",\n command: \"<%= config.bin %> <%= command.id %> skills -o ./custom-dir\",\n },\n ];\n\n static args = {\n type: Args.string({\n description: \"What to eject: agent-partials, templates, skills, all\",\n required: false,\n options: [...EJECT_TYPES],\n }),\n };\n\n static flags = {\n force: Flags.boolean({\n char: \"f\",\n description: \"Overwrite existing files\",\n default: false,\n }),\n output: Flags.string({\n char: \"o\",\n // No `default:`, and no default named here either: each eject type has its own\n // destination and this flag replaces all three at once. The reference page carries\n // the table; a one-line description that picked one of the three would be wrong\n // about the other two, which is what it was.\n description:\n \"Write everything into this directory instead of each eject type's own destination\",\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Eject);\n const projectDir = process.cwd();\n\n const ejectType = this.validateEjectType(args.type);\n const outputBase = await this.resolveOutputBase(flags, projectDir);\n\n this.printHeader(\n await this.resolveBrandingName(projectDir),\n flags.output ? outputBase : undefined,\n );\n\n const sourceResult = await this.loadSourceIfNeeded(ejectType, projectDir);\n await this.executeEject(ejectType, outputBase, flags, projectDir, sourceResult);\n await this.ensureConfig(projectDir, sourceResult);\n\n this.reportEnding();\n }\n\n /**\n * The command's last word.\n *\n * `Eject complete!` claims the whole eject landed, so it is withheld whenever part of it did\n * not — the account {@link BaseCommand.exitIfWorkIncomplete} prints replaces that tick rather\n * than sitting under it, and carries the non-zero exit with it.\n */\n private reportEnding(): void {\n this.log(\"\");\n if (!this.hasIncompleteWork) this.logSuccess(\"Eject complete!\");\n this.log(\"\");\n\n this.exitIfWorkIncomplete();\n }\n\n private validateEjectType(typeArg: string | undefined): EjectType {\n if (!typeArg) {\n this.error(\"Please specify what to eject: agent-partials, templates, skills, or all\", {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n if (!isEjectType(typeArg)) {\n this.error(`Unknown eject type: ${typeArg}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n return typeArg;\n }\n\n private async resolveOutputBase(\n flags: { output: string | undefined },\n projectDir: string,\n ): Promise<string> {\n if (flags.output) {\n const expandedPath = flags.output.startsWith(\"~\")\n ? path.join(os.homedir(), flags.output.slice(1))\n : flags.output;\n const outputBase = path.resolve(projectDir, expandedPath);\n\n if (await fileExists(outputBase)) {\n this.error(`Output path exists as a file: ${outputBase}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n return outputBase;\n }\n\n return path.join(projectDir, CLAUDE_SRC_DIR);\n }\n\n private printHeader(brandingName: string, outputBase?: string): void {\n this.log(\"\");\n this.log(`${brandingName} Eject`);\n this.log(\"\");\n\n if (outputBase) {\n this.log(`Output directory: ${outputBase}`);\n }\n }\n\n private async loadSourceIfNeeded(\n ejectType: EjectType,\n projectDir: string,\n ): Promise<SourceLoadResult | undefined> {\n if (ejectType === \"skills\" || ejectType === \"all\") {\n const loaded = await loadSource({ projectDir });\n return loaded.sourceResult;\n }\n return undefined;\n }\n\n private async executeEject(\n ejectType: EjectType,\n outputBase: string,\n flags: { force: boolean; output: string | undefined },\n projectDir: string,\n sourceResult: SourceLoadResult | undefined,\n ): Promise<void> {\n const directOutput = !!flags.output;\n\n switch (ejectType) {\n case \"agent-partials\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n break;\n case \"templates\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, true);\n break;\n case \"skills\":\n if (!sourceResult) {\n throw new Error(\"The marketplace must be loaded for skills eject\");\n }\n await this.handleSkills(projectDir, flags.force, sourceResult, directOutput, outputBase);\n break;\n case \"all\":\n if (!sourceResult) {\n throw new Error(\"The marketplace must be loaded for full eject\");\n }\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n await this.handleAgentPartials(outputBase, true, directOutput, true);\n await this.handleSkills(projectDir, flags.force, sourceResult, directOutput, outputBase);\n break;\n default: {\n const _exhaustive: never = ejectType;\n return _exhaustive;\n }\n }\n }\n\n /**\n * The convenience step after the eject: a minimal `config.ts` so a later `compile` has\n * something to read.\n *\n * It can refuse, and by the time it does the ejection has already landed — the templates,\n * partials or skills are on disk and stay there. So the throw is caught rather than left to\n * become the process's exit code: an `ERROR` tells the caller nothing landed and the run can\n * be repeated, which is the wrong instruction for a tree that now holds an ejection. What is\n * owed is the account and `EXIT_CODES.COMPLETED_WITH_FAILURES`.\n *\n * The refusal itself is right and is not weakened here: `ensureMinimalConfig` will not invent\n * a config recording a marketplace it read out of a file it could not evaluate.\n */\n private async ensureConfig(\n projectDir: string,\n sourceResult: SourceLoadResult | undefined,\n ): Promise<void> {\n try {\n const configResult = await ensureMinimalConfig({\n projectDir,\n ...(sourceResult !== undefined && { sourceResult }),\n });\n if (configResult.created) {\n this.logSuccess(`Created ${CLAUDE_SRC_DIR}/${STANDARD_FILES.CONFIG_TS}`);\n }\n } catch (error) {\n this.reportIncompleteWork(\n `Could not create ${CLAUDE_SRC_DIR}/${STANDARD_FILES.CONFIG_TS}: ${getErrorMessage(error)}`,\n INCOMPLETE_WORK_RECOVERY.INSPECT_INSTALLATION,\n );\n }\n }\n\n private async handleAgentPartials(\n outputBase: string,\n force: boolean,\n directOutput: boolean,\n templatesOnly: boolean,\n ): Promise<void> {\n const result = await ejectAgentPartials({\n outputBase,\n force,\n directOutput,\n templatesOnly,\n });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n if (result.templatesSkipped) {\n this.warn(\n \"Agent templates already exist — skipping templates, only ejecting agent partials.\",\n );\n }\n\n this.logSuccess(\n `${templatesOnly ? \"Agent templates\" : \"Agent partials\"} ejected to ${result.destDir}`,\n );\n this.log(\n templatesOnly\n ? \"You can now customize agent templates locally.\"\n : INFO_MESSAGES.AGENT_PARTIALS_CUSTOMIZABLE,\n );\n }\n\n private async handleSkills(\n projectDir: string,\n force: boolean,\n sourceResult: SourceLoadResult,\n directOutput: boolean,\n outputBase: string,\n ): Promise<void> {\n const result = await ejectSkills({\n projectDir,\n force,\n sourceResult,\n matrix,\n directOutput,\n ...(directOutput && { customOutputBase: outputBase }),\n });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n this.logSuccess(\n `${result.copiedSkills.length} skills ejected to ${result.destDir} from ${result.sourceLabel}`,\n );\n this.log(\"You can now customize skill content locally.\");\n }\n}\n\ntype EjectAgentPartialsOptions = {\n outputBase: string;\n force: boolean;\n /** When true, outputBase is used directly as the destination (no subdirectory nesting). */\n directOutput?: boolean;\n /** When true, ejects only the _templates directory instead of the full agents directory. */\n templatesOnly?: boolean;\n};\n\ntype EjectAgentPartialsResult =\n | {\n skipped: true;\n skipReason: string;\n templatesSkipped: false;\n }\n | {\n skipped: false;\n /** Destination directory that was written to. */\n destDir: string;\n /** Whether templates were skipped during a full agent-partials eject (existing templates preserved). */\n templatesSkipped: boolean;\n };\n\n/**\n * Copies agent partials or templates from the CLI source to a target directory.\n *\n * When `templatesOnly` is true, copies only the _templates subdirectory.\n * When false, copies the full agents directory (optionally skipping existing templates).\n *\n * Returns structured data — the command decides what to log.\n */\n/** Direct output writes to the base itself; otherwise agents/ (plus templates/ in templates-only mode). */\nfunction resolveEjectDestDir(\n outputBase: string,\n directOutput: boolean,\n templatesOnly: boolean,\n): string {\n if (directOutput) return outputBase;\n const agentsDir = path.join(outputBase, path.basename(DIRS.agents));\n return templatesOnly ? path.join(agentsDir, path.basename(DIRS.templates)) : agentsDir;\n}\n\nasync function ejectAgentPartials(\n options: EjectAgentPartialsOptions,\n): Promise<EjectAgentPartialsResult> {\n const { outputBase, force, directOutput = false, templatesOnly = false } = options;\n\n const sourceDir = templatesOnly\n ? path.join(PROJECT_ROOT, DIRS.templates)\n : path.join(PROJECT_ROOT, DIRS.agents);\n\n if (!(await directoryExists(sourceDir))) {\n return {\n skipped: true,\n skipReason: templatesOnly\n ? \"No agent templates found in CLI.\"\n : \"No agent partials found in CLI.\",\n templatesSkipped: false,\n };\n }\n\n const destDir = resolveEjectDestDir(outputBase, directOutput, templatesOnly);\n\n const templatesBasename = path.basename(DIRS.templates);\n\n if ((await directoryExists(destDir)) && !force) {\n if (templatesOnly) {\n return {\n skipped: true,\n skipReason: `Agent templates already exist at ${destDir}. Use --force to overwrite.`,\n templatesSkipped: false,\n };\n }\n\n const hasTemplates = await directoryExists(path.join(destDir, templatesBasename));\n if ((await hasAgentPartialDirs(destDir)) && !hasTemplates) {\n return {\n skipped: true,\n skipReason: `Agent partials already exist at ${destDir}. Use --force to overwrite.`,\n templatesSkipped: false,\n };\n }\n }\n\n await ensureDir(destDir);\n\n const skipTemplates =\n !templatesOnly && !force && (await directoryExists(path.join(destDir, templatesBasename)));\n\n if (skipTemplates) {\n const sourceEntries = await listDirectories(sourceDir);\n const nonTemplateEntries = sourceEntries.filter((entry) => entry !== templatesBasename);\n for (const entry of nonTemplateEntries) {\n await copy(path.join(sourceDir, entry), path.join(destDir, entry));\n }\n } else {\n await copy(sourceDir, destDir);\n }\n\n return {\n skipped: false,\n destDir,\n templatesSkipped: skipTemplates,\n };\n}\n\ntype EjectSkillsOptions = {\n projectDir: string;\n force: boolean;\n sourceResult: SourceLoadResult;\n matrix: MergedSkillsMatrix;\n /** When true, uses customOutputBase as destination instead of LOCAL_SKILLS_PATH. */\n directOutput?: boolean;\n customOutputBase?: string;\n};\n\ntype EjectSkillsResult =\n | {\n skipped: true;\n skipReason: string;\n copiedSkills: [];\n }\n | {\n skipped: false;\n /** Array of skills that were copied. */\n copiedSkills: CopiedSkill[];\n /** Destination directory that was written to. */\n destDir: string;\n /** Label describing the source that skills were copied from. */\n sourceLabel: string;\n };\n\n/**\n * Copies non-local skills from source to a target directory.\n *\n * Filters out skills already marked as local, then copies the remaining skills\n * using copySkillsToLocalFlattened.\n *\n * Returns structured data — the command decides what to log.\n */\nasync function ejectSkills(options: EjectSkillsOptions): Promise<EjectSkillsResult> {\n const {\n projectDir,\n force,\n sourceResult,\n matrix,\n directOutput = false,\n customOutputBase,\n } = options;\n\n const destDir =\n directOutput && customOutputBase ? customOutputBase : path.join(projectDir, LOCAL_SKILLS_PATH);\n\n if ((await directoryExists(destDir)) && !force) {\n return {\n skipped: true,\n skipReason: `Skills already exist at ${destDir}. Use --force to overwrite.`,\n copiedSkills: [],\n };\n }\n\n const skillIds = typedKeys<SkillId>(matrix.skills).filter(\n (skillId) => !matrix.skills[skillId]?.local,\n );\n\n if (skillIds.length === 0) {\n return {\n skipped: true,\n skipReason: \"No skills found in the marketplace to eject.\",\n copiedSkills: [],\n };\n }\n\n await ensureDir(destDir);\n\n const copiedSkills = await copySkillsToLocalFlattened(skillIds, destDir, sourceResult);\n\n const sourceLabel = sourceResult.isLocal\n ? sourceResult.sourcePath\n : sourceResult.marketplace || sourceResult.sourceConfig.source;\n\n return {\n skipped: false,\n copiedSkills,\n destDir,\n sourceLabel,\n };\n}\n\ntype EnsureMinimalConfigOptions = {\n projectDir: string;\n sourceResult?: SourceLoadResult;\n};\n\ntype EnsureMinimalConfigResult = {\n /** Path to the config file. */\n configPath: string;\n /** Whether a new config was created. */\n created: boolean;\n};\n\n/**\n * Ensures a minimal config.ts exists so `npx agents-inc compile` works after eject.\n *\n * If the config already exists, returns immediately with `created: false`.\n * Otherwise generates a minimal config from the resolved source and project metadata.\n *\n * Returns structured data — the command decides what to log.\n */\nasync function ensureMinimalConfig(\n options: EnsureMinimalConfigOptions,\n): Promise<EnsureMinimalConfigResult> {\n const { projectDir, sourceResult } = options;\n\n const tsConfigPath = getProjectConfigPath(projectDir);\n\n if (await fileExists(tsConfigPath)) {\n return { configPath: tsConfigPath, created: false };\n }\n\n // ABORT on an unreadable config. The project has none — the guard above returned for that — so\n // what these two can meet is an unreadable GLOBAL config, and the file about to be invented\n // would record a marketplace read from nowhere. The second call is unreachable for the same\n // reason the guard exists: this project's own config is not there to be unreadable.\n const resolvedConfig =\n sourceResult?.sourceConfig ?? (await resolveSource({ caller: \"stored\", projectDir }));\n const existingProjectConfig = await loadProjectSourceConfig(projectDir);\n const source = resolvedConfig.source || undefined;\n\n // At the home directory the invented config IS the global manifest, and the\n // file it opens with `import type { ProjectConfig } from \"./config-types\"`\n // cannot resolve its own types without the sibling. The gate writes the pair.\n if (isHomeDirectory(projectDir)) {\n await ensureBlankPair();\n if (source) await recordSource(projectDir, source);\n return { configPath: tsConfigPath, created: true };\n }\n\n await writeProjectPartial(\n projectDir,\n {\n skills: [],\n agents: [],\n ...(source ? { marketplace: source } : {}),\n ...(resolvedConfig.marketplace ? { marketplaceName: resolvedConfig.marketplace } : {}),\n ...(existingProjectConfig?.author ? { author: existingProjectConfig.author } : {}),\n ...(existingProjectConfig?.agentsSource\n ? { agentsSource: existingProjectConfig.agentsSource }\n : {}),\n },\n { fallbackName: path.basename(projectDir) },\n );\n\n return { configPath: tsConfigPath, created: true };\n}\n\n/**\n * Records the marketplace ref in whichever scope's config `projectDir` names. At the home\n * directory that config is the global manifest every project's generated types\n * import from, so the write goes through the gate: registered projects inline\n * the scalar and follow it.\n */\nasync function recordSource(projectDir: string, source: string): Promise<void> {\n if (isHomeDirectory(projectDir)) {\n await mutateGlobal(\n { kind: \"set-source\", source, fallbackName: path.basename(projectDir) },\n lazyGateDeps(projectDir),\n );\n return;\n }\n\n // ABORT on an unreadable config. The `?? {}` is a fallback for a config that is not THERE; on\n // one that is there and unreadable it would hand the writer an empty partial, and this scalar\n // write would replace the user's whole file with a two-field one under an invented name.\n const existing = (await loadProjectSourceConfig(projectDir)) ?? {};\n await writeProjectPartial(\n projectDir,\n { ...existing, marketplace: source },\n { fallbackName: path.basename(projectDir) },\n );\n}\n\n/** Checks whether the agents directory contains any agent subdirectories (not just _templates). */\nasync function hasAgentPartialDirs(agentsDir: string): Promise<boolean> {\n const subdirs = await listDirectories(agentsDir);\n const templatesBasename = path.basename(DIRS.templates);\n return subdirs.some((dir) => dir !== templatesBasename);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,aAAa;AAC5B,OAAO,UAAU;AACjB,OAAO,QAAQ;AAgCf,IAAM,cAAc,CAAC,kBAAkB,aAAa,UAAU,KAAK;AAGnE,SAAS,YAAY,OAAmC;AACtD,SAAQ,YAAkC,SAAS,KAAK;AAC1D;AAEA,IAAqB,QAArB,MAAqB,eAAc,YAAY;AAAA,EAC7C,OAAO,UAAU;AAAA,EACjB,OAAO,cACL;AAAA,EAKF,OAAO,WAAW;AAAA,IAChB;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,IACA;AAAA,MACE,aAAa;AAAA,MACb,SAAS;AAAA,IACX;AAAA,EACF;AAAA,EAEA,OAAO,OAAO;AAAA,IACZ,MAAM,KAAK,OAAO;AAAA,MAChB,aAAa;AAAA,MACb,UAAU;AAAA,MACV,SAAS,CAAC,GAAG,WAAW;AAAA,IAC1B,CAAC;A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A+B;AAC7E,MAAI,gBAAgB,UAAU,GAAG;AAC/B,UAAM;AAAA,MACJ,EAAE,MAAM,cAAc,QAAQ,cAAc,KAAK,SAAS,UAAU,EAAE;AAAA,MACtE,aAAa,UAAU;AAAA,IACzB;AACA;AAAA,EACF;AAKA,QAAM,WAAY,MAAM,wBAAwB,UAAU,KAAM,CAAC;AACjE,QAAM;AAAA,IACJ;AAAA,IACA,EAAE,GAAG,UAAU,aAAa,OAAO;AAAA,IACnC,EAAE,cAAc,KAAK,SAAS,UAAU,EAAE;AAAA,EAC5C;AACF;AAGA,eAAe,oBAAoB,WAAqC;AACtE,QAAM,UAAU,MAAM,gBAAgB,SAAS;AAC/C,QAAM,oBAAoB,KAAK,SAAS,KAAK,SAAS;AACtD,SAAO,QAAQ,KAAK,CAAC,QAAQ,QAAQ,iBAAiB;AACxD;","names":["matrix"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/eject.ts"],"sourcesContent":["import { Args, Flags } from \"@oclif/core\";\nimport path from \"path\";\nimport os from \"os\";\nimport { BaseCommand } from \"../base-command.js\";\nimport { copy, ensureDir, directoryExists, fileExists, listDirectories } from \"../utils/fs.js\";\nimport { DIRS, LOCAL_SKILLS_PATH, PROJECT_ROOT } from \"../consts.js\";\nimport {\n providerInUse,\n relativeConfigPath,\n sourceFolderInUse,\n} from \"../lib/installation/install-layout.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { type SourceLoadResult } from \"../lib/loading/index.js\";\nimport { loadSource } from \"../lib/operations/index.js\";\nimport { matrix } from \"../lib/matrix/matrix-provider\";\nimport {\n resolveSource,\n loadProjectSourceConfig,\n getProjectConfigPath,\n} from \"../lib/configuration/index.js\";\nimport {\n ensureBlankPair,\n lazyGateDeps,\n mutateGlobal,\n writeProjectPartial,\n} from \"../lib/config-gate/index.js\";\nimport { isHomeDirectory } from \"../lib/installation/index.js\";\nimport {\n providerFlag,\n providerNamedBy,\n refuseAnAmbiguousInstallation,\n} from \"../lib/installation/provider-flag.js\";\nimport { copySkillsToLocalFlattened, type CopiedSkill } from \"../lib/skills/index.js\";\nimport { INCOMPLETE_WORK_RECOVERY, INFO_MESSAGES } from \"../utils/messages.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { plural } from \"../utils/string.js\";\nimport type { MergedSkillsMatrix } from \"../types/index.js\";\n\nconst EJECT_TYPES = [\"agent-partials\", \"templates\", \"skills\", \"all\"] as const;\ntype EjectType = (typeof EJECT_TYPES)[number];\n\nfunction isEjectType(value: string): value is EjectType {\n return (EJECT_TYPES as readonly string[]).includes(value);\n}\n\nexport default class Eject extends BaseCommand {\n static summary = \"Eject skills, agent partials, or templates for local customization\";\n static description =\n \"Copy agent partials, templates, or skills to your project for customization. \" +\n \"Agent partials and templates are always copied from the CLI. \" +\n \"Skills are copied from the marketplace this installation is configured to read \" +\n \"(the public one by default).\";\n\n static examples = [\n {\n description: \"Eject agent partials for customization\",\n command: \"<%= config.bin %> <%= command.id %> agent-partials\",\n },\n {\n description: \"Eject only agent templates\",\n command: \"<%= config.bin %> <%= command.id %> templates\",\n },\n {\n description: \"Eject skills to local directory\",\n command: \"<%= config.bin %> <%= command.id %> skills\",\n },\n {\n description: \"Eject everything with force overwrite\",\n command: \"<%= config.bin %> <%= command.id %> all --force\",\n },\n {\n description: \"Eject to a custom output directory\",\n command: \"<%= config.bin %> <%= command.id %> skills -o ./custom-dir\",\n },\n ];\n\n static args = {\n type: Args.string({\n description: \"What to eject: agent-partials, templates, skills, all\",\n required: false,\n options: [...EJECT_TYPES],\n }),\n };\n\n static flags = {\n provider: providerFlag(),\n force: Flags.boolean({\n char: \"f\",\n description: \"Overwrite existing files\",\n default: false,\n }),\n output: Flags.string({\n char: \"o\",\n // No `default:`, and no default named here either: each eject type has its own\n // destination and this flag replaces all three at once. The reference page carries\n // the table; a one-line description that picked one of the three would be wrong\n // about the other two, which is what it was.\n description:\n \"Write everything into this directory instead of each eject type's own destination\",\n }),\n };\n\n async run(): Promise<void> {\n const { args, flags } = await this.parse(Eject);\n const projectDir = process.cwd();\n\n // Above the layout settle, because that refusal is about two FOLDER NAMES of one installation\n // and this one is about two installations. Both have to be answered before anything is\n // written, and this one decides which installation the other is even asking about.\n await refuseAnAmbiguousInstallation(\n projectDir,\n \"eject\",\n providerNamedBy(flags.provider),\n (message) => this.error(message, { exit: EXIT_CODES.INVALID_ARGS }),\n );\n\n // Before anything is copied: a config nobody can read is recreated, not ejected over, and a\n // refusal past this point would follow files already written.\n await this.ensureConfigReadable(projectDir);\n const ejectType = this.validateEjectType(args.type);\n const outputBase = await this.resolveOutputBase(flags, projectDir);\n\n this.printHeader(\n await this.resolveBrandingName(projectDir),\n flags.output ? outputBase : undefined,\n );\n\n const sourceResult = await this.loadSourceIfNeeded(ejectType, projectDir);\n await this.executeEject(ejectType, outputBase, flags, projectDir, sourceResult);\n await this.ensureConfig(projectDir, sourceResult);\n\n this.reportEnding();\n }\n\n /**\n * The command's last word.\n *\n * `Eject complete!` claims the whole eject landed, so it is withheld whenever part of it did\n * not — the account {@link BaseCommand.exitIfWorkIncomplete} prints replaces that tick rather\n * than sitting under it, and carries the non-zero exit with it.\n */\n private reportEnding(): void {\n this.log(\"\");\n if (!this.hasIncompleteWork) this.logSuccess(\"Eject complete!\");\n this.log(\"\");\n\n this.exitIfWorkIncomplete();\n }\n\n private validateEjectType(typeArg: string | undefined): EjectType {\n if (!typeArg) {\n this.error(\"Please specify what to eject: agent-partials, templates, skills, or all\", {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n if (!isEjectType(typeArg)) {\n this.error(`Unknown eject type: ${typeArg}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n return typeArg;\n }\n\n private async resolveOutputBase(\n flags: { output: string | undefined },\n projectDir: string,\n ): Promise<string> {\n if (flags.output) {\n const expandedPath = flags.output.startsWith(\"~\")\n ? path.join(os.homedir(), flags.output.slice(1))\n : flags.output;\n const outputBase = path.resolve(projectDir, expandedPath);\n\n if (await fileExists(outputBase)) {\n this.error(`Output path exists as a file: ${outputBase}`, {\n exit: EXIT_CODES.INVALID_ARGS,\n });\n }\n\n return outputBase;\n }\n\n return sourceFolderInUse(projectDir, providerInUse(projectDir)).dir;\n }\n\n private printHeader(brandingName: string, outputBase?: string): void {\n this.log(\"\");\n this.log(`${brandingName} Eject`);\n this.log(\"\");\n\n if (outputBase) {\n this.log(`Output directory: ${outputBase}`);\n }\n }\n\n private async loadSourceIfNeeded(\n ejectType: EjectType,\n projectDir: string,\n ): Promise<SourceLoadResult | undefined> {\n if (ejectType === \"skills\" || ejectType === \"all\") {\n const loaded = await loadSource({ projectDir });\n return loaded.sourceResult;\n }\n return undefined;\n }\n\n private async executeEject(\n ejectType: EjectType,\n outputBase: string,\n flags: { force: boolean; output: string | undefined },\n projectDir: string,\n sourceResult: SourceLoadResult | undefined,\n ): Promise<void> {\n const directOutput = !!flags.output;\n\n switch (ejectType) {\n case \"agent-partials\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n break;\n case \"templates\":\n await this.handleAgentPartials(outputBase, flags.force, directOutput, true);\n break;\n case \"skills\":\n if (!sourceResult) {\n throw new Error(\"The marketplace must be loaded for skills eject\");\n }\n await this.handleSkills(projectDir, flags.force, sourceResult, directOutput, outputBase);\n break;\n case \"all\":\n if (!sourceResult) {\n throw new Error(\"The marketplace must be loaded for full eject\");\n }\n await this.handleAgentPartials(outputBase, flags.force, directOutput, false);\n await this.handleAgentPartials(outputBase, true, directOutput, true);\n await this.handleSkills(projectDir, flags.force, sourceResult, directOutput, outputBase);\n break;\n default: {\n const _exhaustive: never = ejectType;\n return _exhaustive;\n }\n }\n }\n\n /**\n * The convenience step after the eject: a minimal `config.ts` so a later `compile` has\n * something to read.\n *\n * It can refuse, and by the time it does the ejection has already landed — the templates,\n * partials or skills are on disk and stay there. So the throw is caught rather than left to\n * become the process's exit code: an `ERROR` tells the caller nothing landed and the run can\n * be repeated, which is the wrong instruction for a tree that now holds an ejection. What is\n * owed is the account and `EXIT_CODES.COMPLETED_WITH_FAILURES`.\n *\n * The refusal itself is right and is not weakened here: `ensureMinimalConfig` will not invent\n * a config recording a marketplace it read out of a file it could not evaluate.\n */\n private async ensureConfig(\n projectDir: string,\n sourceResult: SourceLoadResult | undefined,\n ): Promise<void> {\n // Named once, before the write, so the success line and the failure line cannot name\n // different files: the provider is read off the disk and the write may create the folder.\n const configTsRel = relativeConfigPath(projectDir, providerInUse(projectDir));\n\n try {\n const configResult = await ensureMinimalConfig({\n projectDir,\n ...(sourceResult !== undefined && { sourceResult }),\n });\n if (configResult.created) {\n this.logSuccess(`Created ${configTsRel}`);\n }\n } catch (error) {\n this.reportIncompleteWork(\n `Could not create ${configTsRel}: ${getErrorMessage(error)}`,\n INCOMPLETE_WORK_RECOVERY.INSPECT_INSTALLATION,\n );\n }\n }\n\n private async handleAgentPartials(\n outputBase: string,\n force: boolean,\n directOutput: boolean,\n templatesOnly: boolean,\n ): Promise<void> {\n const result = await ejectAgentPartials({\n outputBase,\n force,\n directOutput,\n templatesOnly,\n });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n if (result.templatesSkipped) {\n this.warn(\n \"Agent templates already exist — skipping templates, only ejecting agent partials.\",\n );\n }\n\n this.logSuccess(\n `${templatesOnly ? \"Agent templates\" : \"Agent partials\"} ejected to ${result.destDir}`,\n );\n this.log(\n templatesOnly\n ? \"You can now customize agent templates locally.\"\n : INFO_MESSAGES.AGENT_PARTIALS_CUSTOMIZABLE,\n );\n }\n\n private async handleSkills(\n projectDir: string,\n force: boolean,\n sourceResult: SourceLoadResult,\n directOutput: boolean,\n outputBase: string,\n ): Promise<void> {\n const result = await ejectSkills({\n projectDir,\n force,\n sourceResult,\n matrix,\n directOutput,\n ...(directOutput && { customOutputBase: outputBase }),\n });\n\n if (result.skipped) {\n this.warn(result.skipReason);\n return;\n }\n\n this.logSuccess(\n `${plural(result.copiedSkills.length, \"skill\")} ejected to ${result.destDir} from ${result.sourceLabel}`,\n );\n this.log(\"You can now customize skill content locally.\");\n }\n}\n\ntype EjectAgentPartialsOptions = {\n outputBase: string;\n force: boolean;\n /** When true, outputBase is used directly as the destination (no subdirectory nesting). */\n directOutput?: boolean;\n /** When true, ejects only the _templates directory instead of the full agents directory. */\n templatesOnly?: boolean;\n};\n\ntype EjectAgentPartialsResult =\n | {\n skipped: true;\n skipReason: string;\n templatesSkipped: false;\n }\n | {\n skipped: false;\n /** Destination directory that was written to. */\n destDir: string;\n /** Whether templates were skipped during a full agent-partials eject (existing templates preserved). */\n templatesSkipped: boolean;\n };\n\n/** Direct output writes to the base itself; otherwise agents/ (plus templates/ in templates-only mode). */\nfunction resolveEjectDestDir(\n outputBase: string,\n directOutput: boolean,\n templatesOnly: boolean,\n): string {\n if (directOutput) return outputBase;\n const agentsDir = path.join(outputBase, path.basename(DIRS.agents));\n return templatesOnly ? path.join(agentsDir, path.basename(DIRS.templates)) : agentsDir;\n}\n\n/**\n * Copies agent partials or templates from the CLI source to a target directory.\n *\n * When `templatesOnly` is true, copies only the _templates subdirectory.\n * When false, copies the full agents directory (optionally skipping existing templates).\n *\n * Returns structured data — the command decides what to log.\n */\nasync function ejectAgentPartials(\n options: EjectAgentPartialsOptions,\n): Promise<EjectAgentPartialsResult> {\n const { outputBase, force, directOutput = false, templatesOnly = false } = options;\n\n const sourceDir = templatesOnly\n ? path.join(PROJECT_ROOT, DIRS.templates)\n : path.join(PROJECT_ROOT, DIRS.agents);\n\n if (!(await directoryExists(sourceDir))) {\n return {\n skipped: true,\n skipReason: templatesOnly\n ? \"No agent templates found in CLI.\"\n : \"No agent partials found in CLI.\",\n templatesSkipped: false,\n };\n }\n\n const destDir = resolveEjectDestDir(outputBase, directOutput, templatesOnly);\n\n const templatesBasename = path.basename(DIRS.templates);\n\n if ((await directoryExists(destDir)) && !force) {\n if (templatesOnly) {\n return {\n skipped: true,\n skipReason: `Agent templates already exist at ${destDir}. Use --force to overwrite.`,\n templatesSkipped: false,\n };\n }\n\n const hasTemplates = await directoryExists(path.join(destDir, templatesBasename));\n if ((await hasAgentPartialDirs(destDir)) && !hasTemplates) {\n return {\n skipped: true,\n skipReason: `Agent partials already exist at ${destDir}. Use --force to overwrite.`,\n templatesSkipped: false,\n };\n }\n }\n\n await ensureDir(destDir);\n\n const skipTemplates =\n !templatesOnly && !force && (await directoryExists(path.join(destDir, templatesBasename)));\n\n if (skipTemplates) {\n const sourceEntries = await listDirectories(sourceDir);\n const nonTemplateEntries = sourceEntries.filter((entry) => entry !== templatesBasename);\n for (const entry of nonTemplateEntries) {\n await copy(path.join(sourceDir, entry), path.join(destDir, entry));\n }\n } else {\n await copy(sourceDir, destDir);\n }\n\n return {\n skipped: false,\n destDir,\n templatesSkipped: skipTemplates,\n };\n}\n\ntype EjectSkillsOptions = {\n projectDir: string;\n force: boolean;\n sourceResult: SourceLoadResult;\n matrix: MergedSkillsMatrix;\n /** When true, uses customOutputBase as destination instead of LOCAL_SKILLS_PATH. */\n directOutput?: boolean;\n customOutputBase?: string;\n};\n\ntype EjectSkillsResult =\n | {\n skipped: true;\n skipReason: string;\n copiedSkills: [];\n }\n | {\n skipped: false;\n /** Array of skills that were copied. */\n copiedSkills: CopiedSkill[];\n /** Destination directory that was written to. */\n destDir: string;\n /** Label describing the source that skills were copied from. */\n sourceLabel: string;\n };\n\n/**\n * Copies the marketplace's own skills from source to a target directory.\n *\n * Only the skills the loaded marketplace carries, because those are the only ones its folder\n * holds: a global installation's skill seated from another marketplace is in the matrix and not\n * on disk here. Skills already marked as local are filtered out too, then the remaining skills\n * are copied using copySkillsToLocalFlattened.\n *\n * Returns structured data — the command decides what to log.\n */\nasync function ejectSkills(options: EjectSkillsOptions): Promise<EjectSkillsResult> {\n const {\n projectDir,\n force,\n sourceResult,\n matrix,\n directOutput = false,\n customOutputBase,\n } = options;\n\n const destDir =\n directOutput && customOutputBase ? customOutputBase : path.join(projectDir, LOCAL_SKILLS_PATH);\n\n if ((await directoryExists(destDir)) && !force) {\n return {\n skipped: true,\n skipReason: `Skills already exist at ${destDir}. Use --force to overwrite.`,\n copiedSkills: [],\n };\n }\n\n const skillIds = [...sourceResult.marketplaceSkillIds].filter(\n (skillId) => !matrix.skills[skillId]?.local,\n );\n\n if (skillIds.length === 0) {\n return {\n skipped: true,\n skipReason: \"No skills found in the marketplace to eject.\",\n copiedSkills: [],\n };\n }\n\n await ensureDir(destDir);\n\n const copiedSkills = await copySkillsToLocalFlattened(skillIds, destDir, sourceResult);\n\n const sourceLabel = sourceResult.isLocal\n ? sourceResult.sourcePath\n : sourceResult.marketplace || sourceResult.sourceConfig.source;\n\n return {\n skipped: false,\n copiedSkills,\n destDir,\n sourceLabel,\n };\n}\n\ntype EnsureMinimalConfigOptions = {\n projectDir: string;\n sourceResult?: SourceLoadResult;\n};\n\ntype EnsureMinimalConfigResult = {\n /** Path to the config file. */\n configPath: string;\n /** Whether a new config was created. */\n created: boolean;\n};\n\n/**\n * Ensures a minimal config.ts exists so `npx agents-inc compile` works after eject.\n *\n * If the config already exists, returns immediately with `created: false`.\n * Otherwise generates a minimal config from the resolved source and project metadata.\n *\n * Returns structured data — the command decides what to log.\n */\nasync function ensureMinimalConfig(\n options: EnsureMinimalConfigOptions,\n): Promise<EnsureMinimalConfigResult> {\n const { projectDir, sourceResult } = options;\n\n // One read for the whole function: the config it may invent, and the blank global pair it may\n // create beside it, belong to the same installation.\n const provider = providerInUse(projectDir);\n const tsConfigPath = getProjectConfigPath(projectDir, provider);\n\n if (await fileExists(tsConfigPath)) {\n return { configPath: tsConfigPath, created: false };\n }\n\n // ABORT on an unreadable config. The project has none — the guard above returned for that — so\n // what these two can meet is an unreadable GLOBAL config, and the file about to be invented\n // would record a marketplace read from nowhere. The second call is unreachable for the same\n // reason the guard exists: this project's own config is not there to be unreadable.\n const resolvedConfig =\n sourceResult?.sourceConfig ?? (await resolveSource({ caller: \"stored\", projectDir }));\n const existingProjectConfig = await loadProjectSourceConfig(projectDir);\n const source = resolvedConfig.source || undefined;\n\n // At the home directory the invented config IS the global manifest, and the\n // file it opens with `import type { ProjectConfig } from \"./config-types\"`\n // cannot resolve its own types without the sibling. The gate writes the pair.\n if (isHomeDirectory(projectDir)) {\n await ensureBlankPair(provider);\n if (source) await recordSource(projectDir, source);\n return { configPath: tsConfigPath, created: true };\n }\n\n await writeProjectPartial(\n projectDir,\n {\n skills: [],\n agents: [],\n ...(source ? { marketplace: source } : {}),\n ...(resolvedConfig.marketplace ? { marketplaceName: resolvedConfig.marketplace } : {}),\n ...(existingProjectConfig?.author ? { author: existingProjectConfig.author } : {}),\n ...(existingProjectConfig?.agentsSource\n ? { agentsSource: existingProjectConfig.agentsSource }\n : {}),\n },\n { fallbackName: path.basename(projectDir) },\n );\n\n return { configPath: tsConfigPath, created: true };\n}\n\n/**\n * Records the marketplace ref in whichever scope's config `projectDir` names. At the home\n * directory that config is the global manifest every project's generated types\n * import from, so the write goes through the gate: registered projects inline\n * the scalar and follow it.\n */\nasync function recordSource(projectDir: string, source: string): Promise<void> {\n if (isHomeDirectory(projectDir)) {\n await mutateGlobal(\n { kind: \"set-source\", source, fallbackName: path.basename(projectDir) },\n lazyGateDeps(projectDir),\n );\n return;\n }\n\n // ABORT on an unreadable config. The `?? {}` is a fallback for a config that is not THERE; on\n // one that is there and unreadable it would hand the writer an empty partial, and this scalar\n // write would replace the user's whole file with a two-field one under an invented name.\n const existing = (await loadProjectSourceConfig(projectDir)) ?? {};\n await writeProjectPartial(\n projectDir,\n { ...existing, marketplace: source },\n { fallbackName: path.basename(projectDir) },\n );\n}\n\n/** Checks whether the agents directory contains any agent subdirectories (not just _templates). */\nasync function hasAgentPartialDirs(agentsDir: string): Promise<boolean> {\n const subdirs = await listDirectories(agentsDir);\n const templatesBasename = path.basename(DIRS.templates);\n return subdirs.some((dir) => dir !== templatesBasename);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,MAAM,aAAa;AAC5B,OAAO,UAAU;AACjB,OAA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A,IACA,EAAE,GAAG,UAAU,aAAa,OAAO;AAAA,IACnC,EAAE,cAAc,KAAK,SAAS,UAAU,EAAE;AAAA,EAC5C;AACF;AAGA,eAAe,oBAAoB,WAAqC;AACtE,QAAM,UAAU,MAAM,gBAAgB,SAAS;AAC/C,QAAM,oBAAoB,KAAK,SAAS,KAAK,SAAS;AACtD,SAAO,QAAQ,KAAK,CAAC,QAAQ,QAAQ,iBAAiB;AACxD;","names":["matrix"]}
|
package/dist/commands/init.js
CHANGED
|
@@ -7,49 +7,53 @@ import {
|
|
|
7
7
|
getDashboardData,
|
|
8
8
|
runDashboardFlow,
|
|
9
9
|
showDashboard
|
|
10
|
-
} from "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
17
|
-
import "../chunk-
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-
|
|
21
|
-
import "../chunk-
|
|
22
|
-
import "../chunk-
|
|
23
|
-
import "../chunk-
|
|
24
|
-
import "../chunk-
|
|
25
|
-
import "../chunk-
|
|
26
|
-
import "../chunk-
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
10
|
+
} from "../chunk-G4JK7WVO.js";
|
|
11
|
+
import "../chunk-6LF4CQBY.js";
|
|
12
|
+
import "../chunk-V3I7VQ7N.js";
|
|
13
|
+
import "../chunk-HHIYT3PI.js";
|
|
14
|
+
import "../chunk-WWIFNPJG.js";
|
|
15
|
+
import "../chunk-RAHSOJQ2.js";
|
|
16
|
+
import "../chunk-DAIEQJIF.js";
|
|
17
|
+
import "../chunk-SCOQ34YM.js";
|
|
18
|
+
import "../chunk-4NDBUJHK.js";
|
|
19
|
+
import "../chunk-2VUYFTUB.js";
|
|
20
|
+
import "../chunk-T6UWJAB3.js";
|
|
21
|
+
import "../chunk-6L75SQZU.js";
|
|
22
|
+
import "../chunk-LFWLEDUG.js";
|
|
23
|
+
import "../chunk-TZ2YJJKK.js";
|
|
24
|
+
import "../chunk-SAYZWCH6.js";
|
|
25
|
+
import "../chunk-PNB3524H.js";
|
|
26
|
+
import "../chunk-XZEVWPX6.js";
|
|
27
|
+
import "../chunk-QHDPLLK6.js";
|
|
28
|
+
import "../chunk-MPTNC32T.js";
|
|
29
29
|
import "../chunk-TSIU7DME.js";
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
34
|
-
import "../chunk-
|
|
35
|
-
import "../chunk-
|
|
30
|
+
import "../chunk-JOEA52NR.js";
|
|
31
|
+
import "../chunk-VRXX4D6K.js";
|
|
32
|
+
import "../chunk-SXVHSOTH.js";
|
|
33
|
+
import "../chunk-XQHZPINL.js";
|
|
34
|
+
import "../chunk-JQRJQ4SS.js";
|
|
35
|
+
import "../chunk-TTY6DPJN.js";
|
|
36
36
|
import "../chunk-WTJ3AY33.js";
|
|
37
|
-
import "../chunk-
|
|
38
|
-
import "../chunk-
|
|
39
|
-
import "../chunk-
|
|
40
|
-
import "../chunk-
|
|
41
|
-
import "../chunk-
|
|
42
|
-
import "../chunk-
|
|
43
|
-
import "../chunk-
|
|
44
|
-
import "../chunk-
|
|
37
|
+
import "../chunk-WVUDLKIO.js";
|
|
38
|
+
import "../chunk-25MPBIK3.js";
|
|
39
|
+
import "../chunk-4AAOOAIN.js";
|
|
40
|
+
import "../chunk-OZXAJNLA.js";
|
|
41
|
+
import "../chunk-ZXKBERQU.js";
|
|
42
|
+
import "../chunk-G6UREQ4V.js";
|
|
43
|
+
import "../chunk-HWEKHVLE.js";
|
|
44
|
+
import "../chunk-PMJWD27C.js";
|
|
45
|
+
import "../chunk-ZR4YPKXQ.js";
|
|
46
|
+
import "../chunk-GE3WKJ6Q.js";
|
|
47
|
+
import "../chunk-MAWNVT2C.js";
|
|
45
48
|
import "../chunk-JFLVEFFP.js";
|
|
46
|
-
import "../chunk-
|
|
47
|
-
import "../chunk-
|
|
48
|
-
import "../chunk-
|
|
49
|
-
import "../chunk-
|
|
50
|
-
import "../chunk-
|
|
51
|
-
import "../chunk-
|
|
52
|
-
import "../chunk-
|
|
49
|
+
import "../chunk-7JNJ52CD.js";
|
|
50
|
+
import "../chunk-NBXXFIIW.js";
|
|
51
|
+
import "../chunk-Y3VIRVVE.js";
|
|
52
|
+
import "../chunk-VAPTVR3J.js";
|
|
53
|
+
import "../chunk-RZDXDMT6.js";
|
|
54
|
+
import "../chunk-A4KDXNOT.js";
|
|
55
|
+
import "../chunk-V5WXIM2F.js";
|
|
56
|
+
import "../chunk-ENGYJCTF.js";
|
|
53
57
|
import "../chunk-OI2H6M5I.js";
|
|
54
58
|
export {
|
|
55
59
|
Dashboard,
|
package/dist/commands/list.js
CHANGED
|
@@ -1,31 +1,38 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SkillAgentSummary
|
|
4
|
-
} from "../chunk-
|
|
4
|
+
} from "../chunk-MAWNVT2C.js";
|
|
5
5
|
import {
|
|
6
6
|
render
|
|
7
7
|
} from "../chunk-JFLVEFFP.js";
|
|
8
8
|
import {
|
|
9
9
|
hydrateWizardStore
|
|
10
|
-
} from "../chunk-
|
|
10
|
+
} from "../chunk-7JNJ52CD.js";
|
|
11
|
+
import {
|
|
12
|
+
otherInstallationsInThisScope,
|
|
13
|
+
providerFlag,
|
|
14
|
+
providerNamedBy
|
|
15
|
+
} from "../chunk-NBXXFIIW.js";
|
|
11
16
|
import {
|
|
12
17
|
BaseCommand
|
|
13
|
-
} from "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
18
|
+
} from "../chunk-Y3VIRVVE.js";
|
|
19
|
+
import "../chunk-VAPTVR3J.js";
|
|
20
|
+
import "../chunk-RZDXDMT6.js";
|
|
16
21
|
import {
|
|
17
22
|
INSTALL_MODE_LABELS,
|
|
23
|
+
chooseProviderForThisRun,
|
|
18
24
|
detectInstallation,
|
|
19
25
|
formatInstallationDisplay,
|
|
20
26
|
getInstallationInfo,
|
|
21
|
-
loadProjectConfig
|
|
22
|
-
|
|
23
|
-
|
|
27
|
+
loadProjectConfig,
|
|
28
|
+
providerInUse
|
|
29
|
+
} from "../chunk-A4KDXNOT.js";
|
|
30
|
+
import "../chunk-V5WXIM2F.js";
|
|
24
31
|
import {
|
|
25
32
|
CLI_COLORS,
|
|
26
33
|
CLI_INVOKE_COMMAND,
|
|
27
34
|
DEFAULT_BRANDING
|
|
28
|
-
} from "../chunk-
|
|
35
|
+
} from "../chunk-ENGYJCTF.js";
|
|
29
36
|
import "../chunk-OI2H6M5I.js";
|
|
30
37
|
|
|
31
38
|
// src/cli/commands/list.tsx
|
|
@@ -56,14 +63,41 @@ var List = class _List extends BaseCommand {
|
|
|
56
63
|
static summary = "Show installation information";
|
|
57
64
|
static description = `Display details about the ${DEFAULT_BRANDING.NAME} installation (local or plugin mode)`;
|
|
58
65
|
static aliases = ["ls"];
|
|
66
|
+
static flags = { provider: providerFlag() };
|
|
59
67
|
static examples = [
|
|
60
68
|
{
|
|
61
69
|
description: "Show current installation details",
|
|
62
70
|
command: "<%= config.bin %> <%= command.id %>"
|
|
63
71
|
}
|
|
64
72
|
];
|
|
73
|
+
/**
|
|
74
|
+
* Which of the scope's installations this report is about, said out loud where there are two.
|
|
75
|
+
*
|
|
76
|
+
* **`list` reported one of two and nothing anywhere said so.** Everything below resolves the
|
|
77
|
+
* provider through `providerInUse`, which answers by ROSTER ORDER for a scope holding one
|
|
78
|
+
* installation of each — so the report named one installation, its mode, its counts and its
|
|
79
|
+
* config path, all correct, about the half of the directory the user was not asking after. Every
|
|
80
|
+
* command that WRITES refuses this state by name and `doctor` reports it as a finding; the one
|
|
81
|
+
* command whose whole job is to say what is installed was silent about it.
|
|
82
|
+
*
|
|
83
|
+
* It reports rather than refusing, for the reason `doctor` does: a read-only command that
|
|
84
|
+
* refused would leave a user whose scope holds two installations unable to look at either,
|
|
85
|
+
* which is the one state they most need to see.
|
|
86
|
+
*/
|
|
87
|
+
async sayWhichInstallationThisIs(providerFlagValue) {
|
|
88
|
+
const named = providerNamedBy(providerFlagValue);
|
|
89
|
+
if (named !== void 0) {
|
|
90
|
+
chooseProviderForThisRun(named);
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
const cwd = process.cwd();
|
|
94
|
+
const line = await otherInstallationsInThisScope(cwd, providerInUse(cwd));
|
|
95
|
+
if (line !== null) this.log(line);
|
|
96
|
+
}
|
|
65
97
|
async run() {
|
|
66
|
-
await this.parse(_List);
|
|
98
|
+
const { flags } = await this.parse(_List);
|
|
99
|
+
await this.sayWhichInstallationThisIs(flags.provider);
|
|
100
|
+
await this.ensureConfigReadable(process.cwd());
|
|
67
101
|
const installation = await detectInstallation();
|
|
68
102
|
if (!installation) {
|
|
69
103
|
this.log("No installation found.");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/list.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\n\nimport { Box, Text, useApp } from \"ink\";\nimport { render } from \"../components/render.js\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { CLI_INVOKE_COMMAND, CLI_COLORS, DEFAULT_BRANDING } from \"../consts.js\";\nimport { getInstallationInfo, formatInstallationDisplay } from \"../lib/plugins/index.js\";\nimport { detectInstallation, INSTALL_MODE_LABELS } from \"../lib/installation/installation.js\";\nimport { loadProjectConfig } from \"../lib/configuration/project-config.js\";\nimport { SkillAgentSummary } from \"../components/wizard/skill-agent-summary.js\";\nimport { hydrateWizardStore } from \"../stores/wizard-store.js\";\nimport type { AgentScopeConfig, SkillConfig } from \"../types/config.js\";\n\ntype ListViewProps = {\n mode: string;\n source?: string | undefined;\n skillConfigs: SkillConfig[];\n agentConfigs: AgentScopeConfig[];\n};\n\nconst ListView: React.FC<ListViewProps> = ({ mode, source, skillConfigs, agentConfigs }) => {\n const { exit } = useApp();\n\n useEffect(() => {\n const timer = setTimeout(() => exit(), 0);\n return () => clearTimeout(timer);\n }, [exit]);\n\n return (\n <Box flexDirection=\"column\" paddingX={1} paddingY={1}>\n <Box flexDirection=\"column\" marginBottom={1}>\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Mode\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{mode}</Text>\n </Box>\n {source && (\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Marketplace\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{source}</Text>\n </Box>\n )}\n </Box>\n\n <SkillAgentSummary skillConfigs={skillConfigs} agentConfigs={agentConfigs} />\n </Box>\n );\n};\n\nexport default class List extends BaseCommand {\n static summary = \"Show installation information\";\n static description = `Display details about the ${DEFAULT_BRANDING.NAME} installation (local or plugin mode)`;\n static aliases = [\"ls\"];\n\n static examples = [\n {\n description: \"Show current installation details\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n ];\n\n async run(): Promise<void> {\n await this.parse(List);\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.log(\"No installation found.\");\n this.log(`Run '${CLI_INVOKE_COMMAND} init' to create one.`);\n return;\n }\n\n const loaded = await loadProjectConfig(installation.projectDir);\n\n if (!loaded?.config || !process.stdin.isTTY) {\n const info = await getInstallationInfo();\n if (info) {\n this.log(\"\");\n this.log(formatInstallationDisplay(info));\n this.log(\"\");\n }\n return;\n }\n\n const { config } = loaded;\n const modeLabel = INSTALL_MODE_LABELS[installation.mode];\n const activeSkills = config.skills.filter((s) => !s.excluded);\n const activeAgents = config.agents.filter((a) => !a.excluded);\n\n hydrateWizardStore({\n installedSkillConfigs: activeSkills,\n installedAgentConfigs: activeAgents,\n });\n\n const { waitUntilExit, clear } = render(\n <ListView\n mode={modeLabel}\n source={config.marketplace}\n skillConfigs={activeSkills}\n agentConfigs={activeAgents}\n />,\n );\n\n await waitUntilExit();\n clear();\n }\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/list.tsx"],"sourcesContent":["import React, { useEffect } from \"react\";\n\nimport { Box, Text, useApp } from \"ink\";\nimport { render } from \"../components/render.js\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { CLI_INVOKE_COMMAND, CLI_COLORS, DEFAULT_BRANDING } from \"../consts.js\";\nimport { chooseProviderForThisRun, providerInUse } from \"../lib/installation/install-layout.js\";\nimport {\n otherInstallationsInThisScope,\n providerFlag,\n providerNamedBy,\n} from \"../lib/installation/provider-flag.js\";\nimport { getInstallationInfo, formatInstallationDisplay } from \"../lib/plugins/index.js\";\nimport { detectInstallation, INSTALL_MODE_LABELS } from \"../lib/installation/installation.js\";\nimport { loadProjectConfig } from \"../lib/configuration/project-config.js\";\nimport { SkillAgentSummary } from \"../components/wizard/skill-agent-summary.js\";\nimport { hydrateWizardStore } from \"../stores/wizard-store.js\";\nimport type { AgentScopeConfig, SkillConfig } from \"../types/config.js\";\n\ntype ListViewProps = {\n mode: string;\n source?: string | undefined;\n skillConfigs: SkillConfig[];\n agentConfigs: AgentScopeConfig[];\n};\n\nconst ListView: React.FC<ListViewProps> = ({ mode, source, skillConfigs, agentConfigs }) => {\n const { exit } = useApp();\n\n useEffect(() => {\n const timer = setTimeout(() => exit(), 0);\n return () => clearTimeout(timer);\n }, [exit]);\n\n return (\n <Box flexDirection=\"column\" paddingX={1} paddingY={1}>\n <Box flexDirection=\"column\" marginBottom={1}>\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Mode\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{mode}</Text>\n </Box>\n {source && (\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Marketplace\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{source}</Text>\n </Box>\n )}\n </Box>\n\n <SkillAgentSummary skillConfigs={skillConfigs} agentConfigs={agentConfigs} />\n </Box>\n );\n};\n\nexport default class List extends BaseCommand {\n static summary = \"Show installation information\";\n static description = `Display details about the ${DEFAULT_BRANDING.NAME} installation (local or plugin mode)`;\n static aliases = [\"ls\"];\n\n static flags = { provider: providerFlag() };\n\n static examples = [\n {\n description: \"Show current installation details\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n ];\n\n /**\n * Which of the scope's installations this report is about, said out loud where there are two.\n *\n * **`list` reported one of two and nothing anywhere said so.** Everything below resolves the\n * provider through `providerInUse`, which answers by ROSTER ORDER for a scope holding one\n * installation of each — so the report named one installation, its mode, its counts and its\n * config path, all correct, about the half of the directory the user was not asking after. Every\n * command that WRITES refuses this state by name and `doctor` reports it as a finding; the one\n * command whose whole job is to say what is installed was silent about it.\n *\n * It reports rather than refusing, for the reason `doctor` does: a read-only command that\n * refused would leave a user whose scope holds two installations unable to look at either,\n * which is the one state they most need to see.\n */\n private async sayWhichInstallationThisIs(providerFlagValue: string | undefined): Promise<void> {\n const named = providerNamedBy(providerFlagValue);\n if (named !== undefined) {\n chooseProviderForThisRun(named);\n return;\n }\n\n const cwd = process.cwd();\n const line = await otherInstallationsInThisScope(cwd, providerInUse(cwd));\n if (line !== null) this.log(line);\n }\n\n async run(): Promise<void> {\n const { flags } = await this.parse(List);\n await this.sayWhichInstallationThisIs(flags.provider);\n await this.ensureConfigReadable(process.cwd());\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.log(\"No installation found.\");\n this.log(`Run '${CLI_INVOKE_COMMAND} init' to create one.`);\n return;\n }\n\n const loaded = await loadProjectConfig(installation.projectDir);\n\n if (!loaded?.config || !process.stdin.isTTY) {\n const info = await getInstallationInfo();\n if (info) {\n this.log(\"\");\n this.log(formatInstallationDisplay(info));\n this.log(\"\");\n }\n return;\n }\n\n const { config } = loaded;\n const modeLabel = INSTALL_MODE_LABELS[installation.mode];\n const activeSkills = config.skills.filter((s) => !s.excluded);\n const activeAgents = config.agents.filter((a) => !a.excluded);\n\n hydrateWizardStore({\n installedSkillConfigs: activeSkills,\n installedAgentConfigs: activeAgents,\n });\n\n const { waitUntilExit, clear } = render(\n <ListView\n mode={modeLabel}\n source={config.marketplace}\n skillConfigs={activeSkills}\n agentConfigs={activeAgents}\n />,\n );\n\n await waitUntilExit();\n clear();\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,iBAAiB;AAEjC,SAAS,KAAK,MAAM,cAAc;AAoC1B,SACE,KADF;AAXR,IAAM,WAAoC,CAAC,EAAE,MAAM,QAAQ,cAAc,aAAa,MAAM;AAC1F,QAAM,EAAE,KAAK,IAAI,OAAO;AAExB,YAAU,MAAM;AACd,UAAM,QAAQ,WAAW,MAAM,KAAK,GAAG,CAAC;AACxC,WAAO,MAAM,aAAa,KAAK;AAAA,EACjC,GAAG,CAAC,IAAI,CAAC;AAET,SACE,qBAAC,OAAI,eAAc,UAAS,UAAU,GAAG,UAAU,GACjD;AAAA,yBAAC,OAAI,eAAc,UAAS,cAAc,GACxC;AAAA,2BAAC,OAAI,eAAc,OAAM,WAAW,GAClC;AAAA,4BAAC,QAAK,OAAO,WAAW,SAAS,MAAI,MAAC,kBAEtC;AAAA,QACA,oBAAC,QAAK,OAAO,WAAW,SAAU,gBAAK;AAAA,SACzC;AAAA,MACC,UACC,qBAAC,OAAI,eAAc,OAAM,WAAW,GAClC;AAAA,4BAAC,QAAK,OAAO,WAAW,SAAS,MAAI,MAAC,yBAEtC;AAAA,QACA,oBAAC,QAAK,OAAO,WAAW,SAAU,kBAAO;AAAA,SAC3C;AAAA,OAEJ;AAAA,IAEA,oBAAC,qBAAkB,cAA4B,cAA4B;AAAA,KAC7E;AAEJ;AAEA,IAAqB,OAArB,MAAqB,cAAa,YAAY;AAAA,EAC5C,OAAO,UAAU;AAAA,EACjB,OAAO,cAAc,6BAA6B,iBAAiB,IAAI;AAAA,EACvE,OAAO,UAAU,CAAC,IAAI;AAAA,EAEtB,OAAO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AAO,CAAC,MAAM,CAAC,EAAE,QAAQ;AAE5D,uBAAmB;AAAA,MACjB,uBAAuB;AAAA,MACvB,uBAAuB;AAAA,IACzB,CAAC;AAED,UAAM,EAAE,eAAe,MAAM,IAAI;AAAA,MAC/B;AAAA,QAAC;AAAA;AAAA,UACC,MAAM;AAAA,UACN,QAAQ,OAAO;AAAA,UACf,cAAc;AAAA,UACd,cAAc;AAAA;AAAA,MAChB;AAAA,IACF;AAEA,UAAM,cAAc;AACpB,UAAM;AAAA,EACR;AACF;","names":[]}
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
validateMarketplaceName
|
|
4
|
-
} from "../../chunk-FLW25ORT.js";
|
|
5
2
|
import {
|
|
6
3
|
BaseCommand,
|
|
7
4
|
EXIT_CODES
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-Y3VIRVVE.js";
|
|
6
|
+
import "../../chunk-VAPTVR3J.js";
|
|
7
|
+
import "../../chunk-RZDXDMT6.js";
|
|
11
8
|
import {
|
|
12
9
|
isDirectoryEmpty,
|
|
13
10
|
validateKebabCaseName,
|
|
11
|
+
validateMarketplaceName,
|
|
14
12
|
writeFile
|
|
15
|
-
} from "../../chunk-
|
|
16
|
-
import "../../chunk-
|
|
13
|
+
} from "../../chunk-A4KDXNOT.js";
|
|
14
|
+
import "../../chunk-V5WXIM2F.js";
|
|
17
15
|
import {
|
|
18
16
|
CLI_INVOKE_COMMAND,
|
|
19
17
|
DEFAULT_VERSION,
|
|
@@ -22,7 +20,7 @@ import {
|
|
|
22
20
|
SKILL_RULES_PATH,
|
|
23
21
|
STACKS_FILE_PATH,
|
|
24
22
|
STANDARD_FILES
|
|
25
|
-
} from "../../chunk-
|
|
23
|
+
} from "../../chunk-ENGYJCTF.js";
|
|
26
24
|
import "../../chunk-OI2H6M5I.js";
|
|
27
25
|
|
|
28
26
|
// src/cli/commands/new/marketplace.ts
|
|
@@ -157,6 +155,7 @@ function metadataYaml(marketplaceName) {
|
|
|
157
155
|
}
|
|
158
156
|
|
|
159
157
|
// src/cli/commands/new/marketplace.ts
|
|
158
|
+
var RESERVED_NAME_WAY_OUT = `run '${CLI_INVOKE_COMMAND} new marketplace <other-name>'`;
|
|
160
159
|
function occupiedDirectoryError(marketplaceDir) {
|
|
161
160
|
return `${marketplaceDir} already holds files. A scaffold writes a whole marketplace, so it will not write into a directory that already has contents. Choose another name, or empty that directory first.`;
|
|
162
161
|
}
|
|
@@ -199,7 +198,11 @@ var NewMarketplace = class _NewMarketplace extends BaseCommand {
|
|
|
199
198
|
if (kebabError) {
|
|
200
199
|
this.error(kebabError, { exit: EXIT_CODES.INVALID_ARGS });
|
|
201
200
|
}
|
|
202
|
-
const reservedError = validateMarketplaceName(
|
|
201
|
+
const reservedError = validateMarketplaceName(
|
|
202
|
+
marketplaceName,
|
|
203
|
+
marketplaceName,
|
|
204
|
+
RESERVED_NAME_WAY_OUT
|
|
205
|
+
);
|
|
203
206
|
if (reservedError) {
|
|
204
207
|
this.error(reservedError, { exit: EXIT_CODES.ERROR });
|
|
205
208
|
}
|