agents-inc 0.176.0 → 0.177.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 +65 -0
- package/README.md +2 -2
- package/dist/{chunk-FACDJH6O.js → chunk-2FE4AJNC.js} +20 -26
- package/dist/chunk-2FE4AJNC.js.map +1 -0
- package/dist/{chunk-U46LYYRA.js → chunk-4SIBDIIO.js} +49 -13
- package/dist/chunk-4SIBDIIO.js.map +1 -0
- package/dist/chunk-5ZK4IND4.js +30 -0
- package/dist/chunk-5ZK4IND4.js.map +1 -0
- package/dist/{chunk-MQZNDK5F.js → chunk-77SHXTDD.js} +137 -56
- package/dist/chunk-77SHXTDD.js.map +1 -0
- package/dist/{chunk-U672FZVC.js → chunk-7OJ2SS4E.js} +10 -86
- package/dist/chunk-7OJ2SS4E.js.map +1 -0
- package/dist/{chunk-C2BSCEDN.js → chunk-7WN6TUZP.js} +7 -8
- package/dist/chunk-7WN6TUZP.js.map +1 -0
- package/dist/chunk-AVKX3IXF.js +117 -0
- package/dist/chunk-AVKX3IXF.js.map +1 -0
- package/dist/{chunk-ENET4IF6.js → chunk-D2PC7NIR.js} +1653 -1734
- package/dist/chunk-D2PC7NIR.js.map +1 -0
- package/dist/{chunk-JTMSFBCA.js → chunk-E6W3PYGF.js} +823 -72
- package/dist/chunk-E6W3PYGF.js.map +1 -0
- package/dist/chunk-H33ZAEKH.js +147 -0
- package/dist/chunk-H33ZAEKH.js.map +1 -0
- package/dist/{chunk-B7AVWSK2.js → chunk-JEFVFZAR.js} +39 -151
- package/dist/chunk-JEFVFZAR.js.map +1 -0
- package/dist/{chunk-UE4Z3YMB.js → chunk-KKGJH46C.js} +3 -21
- package/dist/chunk-KKGJH46C.js.map +1 -0
- package/dist/chunk-OIQKRXHH.js +142 -0
- package/dist/chunk-OIQKRXHH.js.map +1 -0
- package/dist/{chunk-CKBWEWHZ.js → chunk-TNN72UL6.js} +264 -247
- package/dist/chunk-TNN72UL6.js.map +1 -0
- package/dist/{chunk-XMQIWPIR.js → chunk-V3WJMNBF.js} +45 -18
- package/dist/chunk-V3WJMNBF.js.map +1 -0
- package/dist/chunk-VFD2XYM7.js +14 -0
- package/dist/chunk-VFD2XYM7.js.map +1 -0
- package/dist/{chunk-XYBHH3M5.js → chunk-WH7JXGDA.js} +2 -2
- package/dist/{chunk-JNRACLNS.js → chunk-XSR4WRXJ.js} +3 -3
- package/dist/{chunk-3F5LT433.js → chunk-Y5VMB73R.js} +202 -116
- package/dist/chunk-Y5VMB73R.js.map +1 -0
- package/dist/chunk-ZIBWVTLN.js +18 -0
- package/dist/chunk-ZIBWVTLN.js.map +1 -0
- package/dist/commands/build/marketplace.js +6 -10
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +10 -39
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +60 -81
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +234 -145
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +64 -159
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +64 -54
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +19 -17
- package/dist/commands/list.js +10 -12
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +5 -5
- package/dist/commands/search.js +14 -13
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +21 -44
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +139 -56
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +22 -37
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/header-row.js +9 -0
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +4 -4
- package/dist/components/common/summary-panel.js +6 -5
- package/dist/hooks/init.js +35 -22
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-OCFWOZD2.js +14 -0
- package/dist/{recompile-project-agents-U3UGHPWG.js → recompile-project-agents-CXZBPIUS.js} +9 -9
- package/dist/{recompile-project-agents-U3UGHPWG.js.map → recompile-project-agents-CXZBPIUS.js.map} +1 -1
- package/dist/{source-loader-E2Y5MMN5.js → source-loader-GGDQDMN4.js} +6 -4
- package/dist/source-loader-GGDQDMN4.js.map +1 -0
- package/package.json +1 -1
- package/src/schemas/stacks.schema.json +105 -1
- package/dist/chunk-3F5LT433.js.map +0 -1
- package/dist/chunk-5CFHP6Z5.js +0 -109
- package/dist/chunk-5CFHP6Z5.js.map +0 -1
- package/dist/chunk-B7AVWSK2.js.map +0 -1
- package/dist/chunk-C2BSCEDN.js.map +0 -1
- package/dist/chunk-CKBWEWHZ.js.map +0 -1
- package/dist/chunk-EC3JXT23.js +0 -160
- package/dist/chunk-EC3JXT23.js.map +0 -1
- package/dist/chunk-ENET4IF6.js.map +0 -1
- package/dist/chunk-FACDJH6O.js.map +0 -1
- package/dist/chunk-H6WUOW5F.js +0 -35
- package/dist/chunk-H6WUOW5F.js.map +0 -1
- package/dist/chunk-JTMSFBCA.js.map +0 -1
- package/dist/chunk-MQZNDK5F.js.map +0 -1
- package/dist/chunk-SN64WNWE.js +0 -428
- package/dist/chunk-SN64WNWE.js.map +0 -1
- package/dist/chunk-U46LYYRA.js.map +0 -1
- package/dist/chunk-U672FZVC.js.map +0 -1
- package/dist/chunk-UE4Z3YMB.js.map +0 -1
- package/dist/chunk-XMQIWPIR.js.map +0 -1
- package/dist/chunk-ZBI6GFJD.js +0 -39
- package/dist/chunk-ZBI6GFJD.js.map +0 -1
- package/dist/load-agent-defs-5BSECHE6.js +0 -14
- /package/dist/{chunk-XYBHH3M5.js.map → chunk-WH7JXGDA.js.map} +0 -0
- /package/dist/{chunk-JNRACLNS.js.map → chunk-XSR4WRXJ.js.map} +0 -0
- /package/dist/{load-agent-defs-5BSECHE6.js.map → components/common/header-row.js.map} +0 -0
- /package/dist/{source-loader-E2Y5MMN5.js.map → load-agent-defs-OCFWOZD2.js.map} +0 -0
package/dist/commands/edit.js
CHANGED
|
@@ -4,18 +4,8 @@ import {
|
|
|
4
4
|
} from "../chunk-ZEGM3MVR.js";
|
|
5
5
|
import {
|
|
6
6
|
editorPayloadForInstallation,
|
|
7
|
-
publishSeedConfig,
|
|
8
7
|
skillsAuthoredHere
|
|
9
|
-
} from "../chunk-
|
|
10
|
-
import {
|
|
11
|
-
unofferablePlacementsFound
|
|
12
|
-
} from "../chunk-ZBI6GFJD.js";
|
|
13
|
-
import {
|
|
14
|
-
openUrl
|
|
15
|
-
} from "../chunk-H6WUOW5F.js";
|
|
16
|
-
import {
|
|
17
|
-
fetchSeedConfig
|
|
18
|
-
} from "../chunk-SN64WNWE.js";
|
|
8
|
+
} from "../chunk-JEFVFZAR.js";
|
|
19
9
|
import {
|
|
20
10
|
Confirm
|
|
21
11
|
} from "../chunk-OZXAJNLA.js";
|
|
@@ -24,10 +14,11 @@ import {
|
|
|
24
14
|
} from "../chunk-P6CYS4JK.js";
|
|
25
15
|
import {
|
|
26
16
|
summaryPanelBlock
|
|
27
|
-
} from "../chunk-
|
|
17
|
+
} from "../chunk-7WN6TUZP.js";
|
|
28
18
|
import {
|
|
29
19
|
hostCompileNotices
|
|
30
|
-
} from "../chunk-
|
|
20
|
+
} from "../chunk-7OJ2SS4E.js";
|
|
21
|
+
import "../chunk-H33ZAEKH.js";
|
|
31
22
|
import {
|
|
32
23
|
compileAgentsAllScopes,
|
|
33
24
|
compileProjectScope,
|
|
@@ -37,7 +28,7 @@ import {
|
|
|
37
28
|
projectsAFanOutReaches,
|
|
38
29
|
sayCapturedWarnings,
|
|
39
30
|
writeProjectConfig
|
|
40
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-TNN72UL6.js";
|
|
41
32
|
import {
|
|
42
33
|
copyLocalSkills,
|
|
43
34
|
discoverInstalledSkills,
|
|
@@ -45,38 +36,36 @@ import {
|
|
|
45
36
|
removeCompiledAgents,
|
|
46
37
|
removeUnderFirstNameHeld,
|
|
47
38
|
uninstallPluginSkills
|
|
48
|
-
} from "../chunk-
|
|
39
|
+
} from "../chunk-V3WJMNBF.js";
|
|
49
40
|
import {
|
|
50
41
|
loadAgentDefs
|
|
51
|
-
} from "../chunk-
|
|
52
|
-
import "../chunk-
|
|
53
|
-
import "../chunk-
|
|
42
|
+
} from "../chunk-XSR4WRXJ.js";
|
|
43
|
+
import "../chunk-VFD2XYM7.js";
|
|
44
|
+
import "../chunk-5ZK4IND4.js";
|
|
45
|
+
import "../chunk-77SHXTDD.js";
|
|
54
46
|
import "../chunk-KIK5EZYD.js";
|
|
55
|
-
import "../chunk-
|
|
47
|
+
import "../chunk-ZIBWVTLN.js";
|
|
48
|
+
import "../chunk-OIQKRXHH.js";
|
|
56
49
|
import {
|
|
57
50
|
BaseCommand,
|
|
58
51
|
EXIT_CODES,
|
|
59
52
|
carriedSkillsThatDiffer,
|
|
60
|
-
installationToName,
|
|
61
|
-
installsAtHome,
|
|
62
53
|
joinedStatement,
|
|
54
|
+
keptAsInstalledStatement,
|
|
63
55
|
notInstalledGlobally,
|
|
64
56
|
panelRowEntries,
|
|
65
57
|
providerFlag,
|
|
66
58
|
providerNamedBy,
|
|
67
59
|
readInstalledGlobal,
|
|
68
60
|
reconcileSharedConfig,
|
|
69
|
-
refuseAnAmbiguousInstallation,
|
|
70
|
-
registerExternalSkills,
|
|
71
61
|
restoreInstalledGlobal,
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
} from "../chunk-
|
|
62
|
+
runFromHomeFor,
|
|
63
|
+
sameAssignments
|
|
64
|
+
} from "../chunk-E6W3PYGF.js";
|
|
75
65
|
import {
|
|
76
66
|
agentChangesAmong,
|
|
77
|
-
formatScopeTag
|
|
78
|
-
|
|
79
|
-
} from "../chunk-FACDJH6O.js";
|
|
67
|
+
formatScopeTag
|
|
68
|
+
} from "../chunk-2FE4AJNC.js";
|
|
80
69
|
import {
|
|
81
70
|
ERROR_MESSAGES,
|
|
82
71
|
INCOMPLETE_WORK_RECOVERY,
|
|
@@ -85,10 +74,8 @@ import {
|
|
|
85
74
|
SHARED_CONFIG_APPLY,
|
|
86
75
|
STATUS_MESSAGES,
|
|
87
76
|
agentsNotCompiled,
|
|
88
|
-
applySharedConfigHere,
|
|
89
77
|
authoredHereKept,
|
|
90
78
|
buildMarketplacePluginRef,
|
|
91
|
-
carriedSkillsWritten,
|
|
92
79
|
chooseProviderForThisRun,
|
|
93
80
|
copyingBesideGlobalPlugins,
|
|
94
81
|
deleteLocalSkill,
|
|
@@ -97,37 +84,33 @@ import {
|
|
|
97
84
|
ejectCopyFailureError,
|
|
98
85
|
executeMigration,
|
|
99
86
|
getErrorMessage,
|
|
100
|
-
holdsItsOwnInstallation,
|
|
101
87
|
hostAt,
|
|
102
88
|
idNamesAnotherMarketplace,
|
|
103
89
|
initProviderToNameAt,
|
|
104
90
|
installingBesideGlobalCopies,
|
|
105
91
|
isHomeDirectory,
|
|
106
92
|
keepsGlobalInstall,
|
|
107
|
-
keptAsInstalledGlobally,
|
|
108
93
|
keptUnassigned,
|
|
109
94
|
loadConfigInPlay,
|
|
110
95
|
localSkillsCopied,
|
|
111
96
|
migrateLocalSkillScope,
|
|
112
97
|
nothingInstalledToApplyTo,
|
|
113
98
|
providerInUse,
|
|
114
|
-
providerToNameAt,
|
|
115
99
|
recompileSummary,
|
|
116
100
|
registeredProjectsRecompiled,
|
|
117
101
|
resolveInstallPaths,
|
|
118
|
-
seedToInstallSelection,
|
|
119
|
-
sharedConfigDestinations,
|
|
120
102
|
sharedConfigNeedsTerminal,
|
|
121
103
|
stoppingOnARefusal,
|
|
122
104
|
subAgentChanged,
|
|
123
105
|
unplaceableKept
|
|
124
|
-
} from "../chunk-
|
|
106
|
+
} from "../chunk-D2PC7NIR.js";
|
|
125
107
|
import {
|
|
126
108
|
getSkillById,
|
|
127
109
|
getSkillDisplayName,
|
|
128
110
|
getSkillEntryDisplayName,
|
|
129
|
-
inertLine
|
|
130
|
-
|
|
111
|
+
inertLine,
|
|
112
|
+
plural
|
|
113
|
+
} from "../chunk-KKGJH46C.js";
|
|
131
114
|
import {
|
|
132
115
|
CLI_COLORS,
|
|
133
116
|
CLI_INVOKE_COMMAND,
|
|
@@ -138,11 +121,10 @@ import {
|
|
|
138
121
|
formatSourceDisplayName,
|
|
139
122
|
isActiveAt,
|
|
140
123
|
isGlobalTombstone
|
|
141
|
-
} from "../chunk-
|
|
124
|
+
} from "../chunk-4SIBDIIO.js";
|
|
142
125
|
import "../chunk-GHHJYNAN.js";
|
|
143
126
|
|
|
144
127
|
// src/cli/commands/edit.tsx
|
|
145
|
-
import os from "os";
|
|
146
128
|
import path from "path";
|
|
147
129
|
import chalk from "chalk";
|
|
148
130
|
import { Flags } from "@oclif/core";
|
|
@@ -196,6 +178,9 @@ function installedEntryOf(skillId, oldSkills) {
|
|
|
196
178
|
if (entry === void 0) throw new Error(`Removed skill '${skillId}' has no installed entry`);
|
|
197
179
|
return entry;
|
|
198
180
|
}
|
|
181
|
+
function addedSkillsOf(changes, selection) {
|
|
182
|
+
return selection.skills.filter((skill) => changes.addedSkills.includes(skill.id));
|
|
183
|
+
}
|
|
199
184
|
function scopeLabelOf(skillId, skills) {
|
|
200
185
|
const skill = skills.find((s) => s.id === skillId);
|
|
201
186
|
return skill === void 0 ? "" : ` ${formatScopeTag(skill.scope)}`;
|
|
@@ -328,20 +313,6 @@ function keptOnApply(reconciled, held, revisedCarried, runFromHome) {
|
|
|
328
313
|
...keptAsInstalledStatement(held, revisedCarried, runFromHome)
|
|
329
314
|
];
|
|
330
315
|
}
|
|
331
|
-
function keptAsInstalledStatement(held, revisedCarried, runFromHome) {
|
|
332
|
-
const skillIds = [...held.keptAsInstalled.skillIds, ...revisedCarried];
|
|
333
|
-
const { agentNames } = held.keptAsInstalled;
|
|
334
|
-
if (skillIds.length === 0 && agentNames.length === 0) return [];
|
|
335
|
-
return [
|
|
336
|
-
keptAsInstalledGlobally(
|
|
337
|
-
skillIds,
|
|
338
|
-
agentNames,
|
|
339
|
-
runFromHome.id,
|
|
340
|
-
runFromHome.provider,
|
|
341
|
-
panelRowEntries(held)
|
|
342
|
-
)
|
|
343
|
-
];
|
|
344
|
-
}
|
|
345
316
|
function applyAuthority(editRoot) {
|
|
346
317
|
return editRoot.isGlobal ? "all" : "owned";
|
|
347
318
|
}
|
|
@@ -424,20 +395,13 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
424
395
|
if (flags.ui && flags.from !== void 0) {
|
|
425
396
|
return this.openSharedInEditor(flags.from, cwd, namedProvider);
|
|
426
397
|
}
|
|
427
|
-
await this.
|
|
428
|
-
|
|
429
|
-
cwd,
|
|
430
|
-
"edit",
|
|
431
|
-
namedProvider,
|
|
432
|
-
(message) => this.error(message, { exit: EXIT_CODES.INVALID_ARGS })
|
|
433
|
-
);
|
|
434
|
-
await this.ensureConfigReadable(cwd);
|
|
435
|
-
await this.refuseUnofferablePlacements(cwd);
|
|
436
|
-
if (flags.from === void 0) return this.openInEditor(cwd);
|
|
398
|
+
await this.checkTheInstallationBeforeActing(cwd, "edit", namedProvider);
|
|
399
|
+
if (flags.from === void 0) return this.openInEditor(cwd, namedProvider);
|
|
437
400
|
return this.applySharedConfig(flags.from, namedProvider);
|
|
438
401
|
}
|
|
439
402
|
async applySharedConfig(id, namedProvider) {
|
|
440
|
-
|
|
403
|
+
await this.refuseWhenNothingIsInstalled(id, namedProvider);
|
|
404
|
+
const payload = await this.fetchSharedConfigOrFail(id);
|
|
441
405
|
const context = await this.loadContextUnderSpinner();
|
|
442
406
|
this.sayWhenItNamesAnotherMarketplace(payload, context.sourceResult);
|
|
443
407
|
const editRoot = resolveEditRoot(context.installation);
|
|
@@ -502,10 +466,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
502
466
|
const revisedGlobally = await carriedSkillsThatDiffer(difference(carried, arrivingCarried));
|
|
503
467
|
sayCapturedWarnings(context.startupMessages);
|
|
504
468
|
this.warnOfSkippedEntries(mapping, context.sourceResult.unloadedSkillIds);
|
|
505
|
-
const runFromHome =
|
|
506
|
-
id: installsAtHome(result) ? id : void 0,
|
|
507
|
-
provider: providerToNameAt(os.homedir(), providerInUse(editRoot.dir))
|
|
508
|
-
};
|
|
469
|
+
const runFromHome = runFromHomeFor(result, id, editRoot.dir);
|
|
509
470
|
return {
|
|
510
471
|
result: held.result,
|
|
511
472
|
kept: keptOnApply(reconciled, held, revisedGlobally, runFromHome),
|
|
@@ -533,48 +494,16 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
533
494
|
return /* @__PURE__ */ new Set();
|
|
534
495
|
}
|
|
535
496
|
}
|
|
536
|
-
/**
|
|
537
|
-
async
|
|
538
|
-
if (
|
|
539
|
-
|
|
540
|
-
}
|
|
541
|
-
this.log(`Fetching configuration ${id}...`);
|
|
542
|
-
const fetched = await fetchSeedConfig(id);
|
|
543
|
-
if (!fetched.ok) {
|
|
544
|
-
this.error(fetched.error, { exit: EXIT_CODES.ERROR });
|
|
545
|
-
}
|
|
546
|
-
return fetched.payload;
|
|
497
|
+
/** Before the fetch, so an empty directory spends no round trip. */
|
|
498
|
+
async refuseWhenNothingIsInstalled(id, namedProvider) {
|
|
499
|
+
if (await detectProject()) return;
|
|
500
|
+
this.error(nothingInstalledToApplyTo(id, namedProvider), { exit: EXIT_CODES.ERROR });
|
|
547
501
|
}
|
|
548
502
|
/** An apply always reads the installation's own marketplace; one an id names is never fetched. */
|
|
549
503
|
sayWhenItNamesAnotherMarketplace({ marketplace: named }, { sourceConfig: { source: used } }) {
|
|
550
504
|
if (named === void 0 || named === used) return;
|
|
551
505
|
this.log(idNamesAnotherMarketplace(named, used));
|
|
552
506
|
}
|
|
553
|
-
decodeSeedOrFail(payload, sourceMatrix) {
|
|
554
|
-
try {
|
|
555
|
-
return seedToInstallSelection(payload, sourceMatrix);
|
|
556
|
-
} catch (error) {
|
|
557
|
-
this.handleError(error);
|
|
558
|
-
}
|
|
559
|
-
}
|
|
560
|
-
registerExternalSkillsOrFail(payload, sourceMatrix, projectDir) {
|
|
561
|
-
try {
|
|
562
|
-
return registerExternalSkills(payload, sourceMatrix, projectDir);
|
|
563
|
-
} catch (error) {
|
|
564
|
-
this.handleError(error);
|
|
565
|
-
}
|
|
566
|
-
}
|
|
567
|
-
async writeCarriedSkills(carried) {
|
|
568
|
-
if (carried.length === 0) return;
|
|
569
|
-
await writeExternalSkills(carried);
|
|
570
|
-
const recorded = carried.map(({ id, skill }) => ({ id, displayName: skill.displayName }));
|
|
571
|
-
this.log(
|
|
572
|
-
carriedSkillsWritten(
|
|
573
|
-
carried.map(({ id }) => id),
|
|
574
|
-
namedByActiveEntries(recorded)
|
|
575
|
-
)
|
|
576
|
-
);
|
|
577
|
-
}
|
|
578
507
|
/**
|
|
579
508
|
* A destructive apply nobody can confirm must never become a yes. Asked only of a run that changes
|
|
580
509
|
* something: one that changes nothing needs no one to confirm it.
|
|
@@ -639,24 +568,18 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
639
568
|
this.log("\nEdit cancelled");
|
|
640
569
|
this.exit(EXIT_CODES.CANCELLED);
|
|
641
570
|
}
|
|
642
|
-
/** `
|
|
643
|
-
async
|
|
644
|
-
const [finding] = await unofferablePlacementsFound(cwd);
|
|
645
|
-
if (finding !== void 0) this.error(finding, { exit: EXIT_CODES.ERROR });
|
|
646
|
-
}
|
|
647
|
-
/** Mints what `share` mints, marked when made in a project. Touches nothing on disk. */
|
|
648
|
-
async openInEditor(projectDir) {
|
|
571
|
+
/** Mints what `share` mints, marked with where it was made. Touches nothing on disk. */
|
|
572
|
+
async openInEditor(projectDir, namedProvider) {
|
|
649
573
|
await this.ensureInstalledSkillsReadable(projectDir);
|
|
650
574
|
const prepared = await editorPayloadForInstallation(projectDir);
|
|
651
575
|
if (!prepared.ok) {
|
|
652
576
|
this.error(prepared.error, { exit: EXIT_CODES.ERROR });
|
|
653
577
|
}
|
|
654
|
-
this.log(
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
await this.handToBrowser(published.id);
|
|
578
|
+
this.log(
|
|
579
|
+
`Opening ${plural(prepared.skills, "skill")} across ${plural(prepared.agents, "sub-agent")}...`
|
|
580
|
+
);
|
|
581
|
+
const id = await this.publishToApplyBackOrFail(prepared.payload, projectDir, namedProvider);
|
|
582
|
+
await this.openInBrowserAtATerminal(editorConfigUrl(id));
|
|
660
583
|
}
|
|
661
584
|
/**
|
|
662
585
|
* The payload reads every ejected skill's metadata.yaml for its provenance, and no catalogue is
|
|
@@ -679,23 +602,10 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
679
602
|
async openSharedInEditor(id, cwd, namedProvider) {
|
|
680
603
|
if (namedProvider !== void 0) chooseProviderForThisRun(namedProvider);
|
|
681
604
|
const url = editorConfigUrl(id);
|
|
682
|
-
const
|
|
683
|
-
const provider = installedHere ? await installationToName(cwd, namedProvider) : namedProvider;
|
|
605
|
+
const applyHere = await this.howToApplyItHere(id, cwd, namedProvider);
|
|
684
606
|
this.log(`Open it at ${url}`);
|
|
685
|
-
this.log(
|
|
686
|
-
|
|
687
|
-
const opened = await openUrl(url);
|
|
688
|
-
if (!opened.ok) this.warn(opened.error);
|
|
689
|
-
}
|
|
690
|
-
/** The link prints first: it works over a pipe, in CI and with no desktop. Opening is extra. */
|
|
691
|
-
async handToBrowser(id) {
|
|
692
|
-
this.logSuccess(`Shared as ${id}`);
|
|
693
|
-
for (const destination of sharedConfigDestinations(id)) {
|
|
694
|
-
this.log(destination);
|
|
695
|
-
}
|
|
696
|
-
if (!process.stdin.isTTY) return;
|
|
697
|
-
const opened = await openUrl(editorConfigUrl(id));
|
|
698
|
-
if (!opened.ok) this.warn(opened.error);
|
|
607
|
+
this.log(applyHere);
|
|
608
|
+
await this.openInBrowserAtATerminal(url);
|
|
699
609
|
}
|
|
700
610
|
async loadContextUnderSpinner() {
|
|
701
611
|
return awaitUnderSpinner(STATUS_MESSAGES.LOADING_SKILLS, () => this.loadContext());
|
|
@@ -788,7 +698,9 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
788
698
|
}
|
|
789
699
|
}
|
|
790
700
|
logModeSwitch(count, modeDescription) {
|
|
791
|
-
this.log(
|
|
701
|
+
this.log(
|
|
702
|
+
chalk.hex(CLI_COLORS.NEUTRAL)(`Switching ${plural(count, "skill")} to ${modeDescription}`)
|
|
703
|
+
);
|
|
792
704
|
}
|
|
793
705
|
logCopiesBesideGlobalPlugins(count) {
|
|
794
706
|
this.log(chalk.hex(CLI_COLORS.NEUTRAL)(copyingBesideGlobalPlugins(count)));
|
|
@@ -865,19 +777,18 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
865
777
|
projectDir
|
|
866
778
|
);
|
|
867
779
|
if (uninstalled.length > 0) {
|
|
868
|
-
this.log(chalk.hex(CLI_COLORS.NEUTRAL)(`Removed ${uninstalled.length
|
|
780
|
+
this.log(chalk.hex(CLI_COLORS.NEUTRAL)(`Removed ${plural(uninstalled.length, "plugin")}`));
|
|
869
781
|
}
|
|
870
782
|
for (const item of failed) {
|
|
871
783
|
this.warn(`Failed to uninstall plugin ${item.id}: ${item.error}`);
|
|
872
784
|
}
|
|
873
785
|
}
|
|
874
786
|
async applyPluginChanges(changes, filteredResult, activeOldSkills, context, editRoot) {
|
|
875
|
-
const
|
|
876
|
-
|
|
877
|
-
(s) => addedSkills.includes(s.id) && s.origin !== EJECT_SOURCE
|
|
787
|
+
const addedPluginSkills = addedSkillsOf(changes, filteredResult).filter(
|
|
788
|
+
(skill) => skill.origin !== EJECT_SOURCE
|
|
878
789
|
);
|
|
879
|
-
const removedPluginSkills = removedSkills.filter(
|
|
880
|
-
(id) =>
|
|
790
|
+
const removedPluginSkills = changes.removedSkills.filter(
|
|
791
|
+
(id) => installedEntryOf(id, activeOldSkills).origin !== EJECT_SOURCE
|
|
881
792
|
);
|
|
882
793
|
if (addedPluginSkills.length === 0 && removedPluginSkills.length === 0) return;
|
|
883
794
|
const marketplace = await this.requireMarketplaceOrExit(
|
|
@@ -903,9 +814,8 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
903
814
|
}
|
|
904
815
|
}
|
|
905
816
|
async copyNewLocalSkills(changes, filteredResult, context, editRoot) {
|
|
906
|
-
const
|
|
907
|
-
|
|
908
|
-
(s) => addedSkills.includes(s.id) && s.origin === EJECT_SOURCE
|
|
817
|
+
const addedLocalSkills = addedSkillsOf(changes, filteredResult).filter(
|
|
818
|
+
(skill) => skill.origin === EJECT_SOURCE
|
|
909
819
|
);
|
|
910
820
|
if (addedLocalSkills.length > 0) {
|
|
911
821
|
const copyResult = await copyLocalSkills(
|
|
@@ -917,10 +827,9 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
917
827
|
}
|
|
918
828
|
}
|
|
919
829
|
async removeDeletedLocalSkills(changes, activeOldSkills, editRoot) {
|
|
920
|
-
const
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
if (oldSkill?.origin !== EJECT_SOURCE) continue;
|
|
830
|
+
for (const skillId of changes.removedSkills) {
|
|
831
|
+
const oldSkill = installedEntryOf(skillId, activeOldSkills);
|
|
832
|
+
if (oldSkill.origin !== EJECT_SOURCE) continue;
|
|
924
833
|
await deleteLocalSkill(editRoot.dir, skillId, oldSkill.scope);
|
|
925
834
|
}
|
|
926
835
|
}
|
|
@@ -974,12 +883,9 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
974
883
|
this.log(`You can manually recompile with '${CLI_INVOKE_COMMAND} compile'.`);
|
|
975
884
|
}
|
|
976
885
|
}
|
|
977
|
-
reportRecompile(
|
|
978
|
-
const
|
|
979
|
-
|
|
980
|
-
compiled.length - rewritten.length,
|
|
981
|
-
RECOMPILE_SUBJECT
|
|
982
|
-
);
|
|
886
|
+
reportRecompile(result) {
|
|
887
|
+
const { compiled, failed, warnings } = result;
|
|
888
|
+
const summary = recompileSummary(result, RECOMPILE_SUBJECT);
|
|
983
889
|
if (failed.length > 0) {
|
|
984
890
|
this.log(
|
|
985
891
|
chalk.hex(CLI_COLORS.NEUTRAL)(summary) + chalk.hex(CLI_COLORS.WARNING)(` (${failed.length} failed)`)
|
|
@@ -1007,12 +913,11 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
1007
913
|
}
|
|
1008
914
|
}
|
|
1009
915
|
/**
|
|
1010
|
-
*
|
|
1011
|
-
*
|
|
1012
|
-
* work, whose tree may not be readable.
|
|
916
|
+
* After {@link cleanupStaleAgentFiles}, so a deleted file is not counted. Skipped on a run owing
|
|
917
|
+
* work besides a plugin's switch, whose tree may not be readable.
|
|
1013
918
|
*/
|
|
1014
919
|
async reportWhatThisHostCannotCarry(editRoot) {
|
|
1015
|
-
if (this.
|
|
920
|
+
if (this.owesWorkBesidesPluginSwitches) return;
|
|
1016
921
|
for (const notice of await hostCompileNotices(providerInUse(editRoot.dir), editRoot.dir)) {
|
|
1017
922
|
this.log(notice);
|
|
1018
923
|
}
|