agents-inc 0.172.0 → 0.174.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 +68 -0
- package/dist/{chunk-6LUTY35Q.js → chunk-3PJZ4QNJ.js} +7 -7
- package/dist/{chunk-255DGUCH.js → chunk-6PGXTLA4.js} +12 -6
- package/dist/{chunk-255DGUCH.js.map → chunk-6PGXTLA4.js.map} +1 -1
- package/dist/{chunk-KCLBLK3F.js → chunk-7BHDKEGK.js} +3 -3
- package/dist/{chunk-7OG635DK.js → chunk-AIBVAYHS.js} +6 -2
- package/dist/{chunk-7OG635DK.js.map → chunk-AIBVAYHS.js.map} +1 -1
- package/dist/{chunk-5MGRHS2G.js → chunk-APWMMZOK.js} +42 -25
- package/dist/chunk-APWMMZOK.js.map +1 -0
- package/dist/{chunk-VILFCMRN.js → chunk-E45IT3HC.js} +368 -123
- package/dist/chunk-E45IT3HC.js.map +1 -0
- package/dist/{chunk-MOL2J5HS.js → chunk-ECPFYHDX.js} +2 -2
- package/dist/{chunk-LUKDDHSI.js → chunk-EFXVYQGT.js} +4 -4
- package/dist/{chunk-G7NUK3BF.js → chunk-FQF6VHO3.js} +29 -19
- package/dist/chunk-FQF6VHO3.js.map +1 -0
- package/dist/chunk-H5E6IO2L.js +116 -0
- package/dist/chunk-H5E6IO2L.js.map +1 -0
- package/dist/{chunk-3R3LHA4Q.js → chunk-I3WF6L43.js} +2 -2
- package/dist/{chunk-7ZOWSCAO.js → chunk-IAQFZFWD.js} +4 -4
- package/dist/{chunk-NISWBQNS.js → chunk-IXVGBUWI.js} +5 -5
- package/dist/{chunk-MBIOZ5LW.js → chunk-ORO2T4K2.js} +19 -5
- package/dist/chunk-ORO2T4K2.js.map +1 -0
- package/dist/{chunk-A3ZAXL5T.js → chunk-QCX66KBM.js} +3 -3
- package/dist/{chunk-6CRA46YO.js → chunk-R7GKQBZJ.js} +44 -21
- package/dist/chunk-R7GKQBZJ.js.map +1 -0
- package/dist/{chunk-Y23MP2OC.js → chunk-REHVGFJE.js} +5 -5
- package/dist/{chunk-5PPB6HT6.js → chunk-TVEDNGVP.js} +2 -2
- package/dist/{chunk-MHAQWMNJ.js → chunk-WUSEZFER.js} +1 -5
- package/dist/{chunk-MHAQWMNJ.js.map → chunk-WUSEZFER.js.map} +1 -1
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +6 -6
- package/dist/commands/compile.js +12 -12
- package/dist/commands/doctor.js +33 -15
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +56 -59
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +25 -30
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +17 -18
- package/dist/commands/list.js +41 -16
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +4 -4
- package/dist/commands/search.js +9 -9
- package/dist/commands/share.js +9 -9
- package/dist/commands/uninstall.js +61 -56
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +6 -6
- package/dist/components/common/select-list.js +2 -2
- package/dist/components/common/skill-agent-summary.js +3 -3
- package/dist/components/common/summary-panel.js +4 -7
- package/dist/hooks/init.js +57 -33
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-5U5KAURA.js +14 -0
- package/dist/{recompile-project-agents-5A44NJRD.js → recompile-project-agents-KYK44C24.js} +8 -8
- package/dist/{source-loader-LQNRI5UZ.js → source-loader-G5I4RNUP.js} +4 -4
- package/package.json +1 -1
- package/dist/chunk-33JICQD5.js +0 -196
- package/dist/chunk-33JICQD5.js.map +0 -1
- package/dist/chunk-5MGRHS2G.js.map +0 -1
- package/dist/chunk-6CRA46YO.js.map +0 -1
- package/dist/chunk-G7NUK3BF.js.map +0 -1
- package/dist/chunk-MBIOZ5LW.js.map +0 -1
- package/dist/chunk-N33AKFLR.js +0 -24
- package/dist/chunk-N33AKFLR.js.map +0 -1
- package/dist/chunk-VILFCMRN.js.map +0 -1
- package/dist/components/common/scroll-affordance.js +0 -9
- package/dist/load-agent-defs-54VIKN4T.js +0 -14
- package/dist/source-loader-LQNRI5UZ.js.map +0 -1
- /package/dist/{chunk-6LUTY35Q.js.map → chunk-3PJZ4QNJ.js.map} +0 -0
- /package/dist/{chunk-KCLBLK3F.js.map → chunk-7BHDKEGK.js.map} +0 -0
- /package/dist/{chunk-MOL2J5HS.js.map → chunk-ECPFYHDX.js.map} +0 -0
- /package/dist/{chunk-LUKDDHSI.js.map → chunk-EFXVYQGT.js.map} +0 -0
- /package/dist/{chunk-3R3LHA4Q.js.map → chunk-I3WF6L43.js.map} +0 -0
- /package/dist/{chunk-7ZOWSCAO.js.map → chunk-IAQFZFWD.js.map} +0 -0
- /package/dist/{chunk-NISWBQNS.js.map → chunk-IXVGBUWI.js.map} +0 -0
- /package/dist/{chunk-A3ZAXL5T.js.map → chunk-QCX66KBM.js.map} +0 -0
- /package/dist/{chunk-Y23MP2OC.js.map → chunk-REHVGFJE.js.map} +0 -0
- /package/dist/{chunk-5PPB6HT6.js.map → chunk-TVEDNGVP.js.map} +0 -0
- /package/dist/{components/common/scroll-affordance.js.map → load-agent-defs-5U5KAURA.js.map} +0 -0
- /package/dist/{recompile-project-agents-5A44NJRD.js.map → recompile-project-agents-KYK44C24.js.map} +0 -0
- /package/dist/{load-agent-defs-54VIKN4T.js.map → source-loader-G5I4RNUP.js.map} +0 -0
package/dist/commands/edit.js
CHANGED
|
@@ -6,16 +6,16 @@ import {
|
|
|
6
6
|
editorPayloadForInstallation,
|
|
7
7
|
publishSeedConfig,
|
|
8
8
|
skillsAuthoredHere
|
|
9
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-3PJZ4QNJ.js";
|
|
10
10
|
import {
|
|
11
11
|
unofferablePlacementsFound
|
|
12
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-ECPFYHDX.js";
|
|
13
13
|
import {
|
|
14
14
|
openUrl
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-TVEDNGVP.js";
|
|
16
16
|
import {
|
|
17
17
|
fetchSeedConfig
|
|
18
|
-
} from "../chunk-
|
|
18
|
+
} from "../chunk-QCX66KBM.js";
|
|
19
19
|
import {
|
|
20
20
|
Confirm
|
|
21
21
|
} from "../chunk-OZXAJNLA.js";
|
|
@@ -24,11 +24,10 @@ import {
|
|
|
24
24
|
} from "../chunk-P6CYS4JK.js";
|
|
25
25
|
import {
|
|
26
26
|
summaryPanelBlock
|
|
27
|
-
} from "../chunk-
|
|
28
|
-
import "../chunk-N33AKFLR.js";
|
|
27
|
+
} from "../chunk-H5E6IO2L.js";
|
|
29
28
|
import {
|
|
30
29
|
hostCompileNotices
|
|
31
|
-
} from "../chunk-
|
|
30
|
+
} from "../chunk-6PGXTLA4.js";
|
|
32
31
|
import {
|
|
33
32
|
compileAgentsAllScopes,
|
|
34
33
|
compileProjectScope,
|
|
@@ -38,29 +37,29 @@ import {
|
|
|
38
37
|
projectsAFanOutReaches,
|
|
39
38
|
sayCapturedWarnings,
|
|
40
39
|
writeProjectConfig
|
|
41
|
-
} from "../chunk-
|
|
40
|
+
} from "../chunk-R7GKQBZJ.js";
|
|
42
41
|
import {
|
|
43
42
|
copyLocalSkills,
|
|
44
43
|
discoverInstalledSkills,
|
|
45
44
|
removeCompiledAgents,
|
|
46
45
|
uninstallPluginSkills
|
|
47
|
-
} from "../chunk-
|
|
46
|
+
} from "../chunk-REHVGFJE.js";
|
|
48
47
|
import {
|
|
49
48
|
loadAgentDefs
|
|
50
|
-
} from "../chunk-
|
|
51
|
-
import "../chunk-
|
|
52
|
-
import "../chunk-
|
|
49
|
+
} from "../chunk-7BHDKEGK.js";
|
|
50
|
+
import "../chunk-IXVGBUWI.js";
|
|
51
|
+
import "../chunk-EFXVYQGT.js";
|
|
53
52
|
import "../chunk-KIK5EZYD.js";
|
|
54
53
|
import {
|
|
55
54
|
agentChangesAmong,
|
|
56
55
|
formatScopeTag
|
|
57
|
-
} from "../chunk-
|
|
56
|
+
} from "../chunk-FQF6VHO3.js";
|
|
58
57
|
import {
|
|
59
58
|
installationToName,
|
|
60
59
|
providerFlag,
|
|
61
60
|
providerNamedBy,
|
|
62
61
|
refuseAnAmbiguousInstallation
|
|
63
|
-
} from "../chunk-
|
|
62
|
+
} from "../chunk-ORO2T4K2.js";
|
|
64
63
|
import {
|
|
65
64
|
BaseCommand,
|
|
66
65
|
EXIT_CODES,
|
|
@@ -74,7 +73,7 @@ import {
|
|
|
74
73
|
restoreInstalledGlobal,
|
|
75
74
|
sameAssignments,
|
|
76
75
|
writeExternalSkills
|
|
77
|
-
} from "../chunk-
|
|
76
|
+
} from "../chunk-IAQFZFWD.js";
|
|
78
77
|
import {
|
|
79
78
|
ERROR_MESSAGES,
|
|
80
79
|
INCOMPLETE_WORK_RECOVERY,
|
|
@@ -115,14 +114,16 @@ import {
|
|
|
115
114
|
seedToInstallSelection,
|
|
116
115
|
sharedConfigDestinations,
|
|
117
116
|
sharedConfigNeedsTerminal,
|
|
117
|
+
stoppingOnARefusal,
|
|
118
118
|
subAgentChanged,
|
|
119
119
|
unplaceableKept
|
|
120
|
-
} from "../chunk-
|
|
120
|
+
} from "../chunk-E45IT3HC.js";
|
|
121
121
|
import {
|
|
122
122
|
getSkillById,
|
|
123
123
|
getSkillDisplayName,
|
|
124
|
+
getSkillEntryDisplayName,
|
|
124
125
|
inertLine
|
|
125
|
-
} from "../chunk-
|
|
126
|
+
} from "../chunk-AIBVAYHS.js";
|
|
126
127
|
import {
|
|
127
128
|
CLI_COLORS,
|
|
128
129
|
CLI_INVOKE_COMMAND,
|
|
@@ -133,7 +134,7 @@ import {
|
|
|
133
134
|
formatSourceDisplayName,
|
|
134
135
|
isActiveAt,
|
|
135
136
|
isGlobalTombstone
|
|
136
|
-
} from "../chunk-
|
|
137
|
+
} from "../chunk-WUSEZFER.js";
|
|
137
138
|
import "../chunk-GHHJYNAN.js";
|
|
138
139
|
|
|
139
140
|
// src/cli/commands/edit.tsx
|
|
@@ -182,17 +183,25 @@ function sourceChangeLine(skillId, change) {
|
|
|
182
183
|
const to = formatSourceDisplayName(change.to);
|
|
183
184
|
return changeLine("~", getSkillDisplayName(skillId), ` (${from} \u2192 ${to})`);
|
|
184
185
|
}
|
|
186
|
+
function removedSkillLine(skillId, oldSkills) {
|
|
187
|
+
const removed = installedEntryOf(skillId, oldSkills);
|
|
188
|
+
return changeLine("-", `${getSkillEntryDisplayName(removed)} ${formatScopeTag(removed.scope)}`);
|
|
189
|
+
}
|
|
190
|
+
function installedEntryOf(skillId, oldSkills) {
|
|
191
|
+
const entry = oldSkills.find((s) => s.id === skillId);
|
|
192
|
+
if (entry === void 0) throw new Error(`Removed skill '${skillId}' has no installed entry`);
|
|
193
|
+
return entry;
|
|
194
|
+
}
|
|
185
195
|
function scopeLabelOf(skillId, skills) {
|
|
186
196
|
const skill = skills.find((s) => s.id === skillId);
|
|
187
197
|
return skill === void 0 ? "" : ` ${formatScopeTag(skill.scope)}`;
|
|
188
198
|
}
|
|
189
199
|
function changeSummaryLines(changes, newSkills, oldSkills) {
|
|
190
200
|
const addedSkill = (id) => changeLine("+", `${inertLine(getSkillById(id).displayName)}${scopeLabelOf(id, newSkills)}`);
|
|
191
|
-
const removedSkill = (id) => changeLine("-", `${getSkillDisplayName(id)}${scopeLabelOf(id, oldSkills)}`);
|
|
192
201
|
const joinedGlobalDetail = ` ${formatScopeTag("global")} (agent: skills added)`;
|
|
193
202
|
return [
|
|
194
203
|
...changes.addedSkills.map(addedSkill),
|
|
195
|
-
...changes.removedSkills.map(
|
|
204
|
+
...changes.removedSkills.map((id) => removedSkillLine(id, oldSkills)),
|
|
196
205
|
...changes.addedAgents.map((name) => changeLine("+", name, AGENT_DETAIL)),
|
|
197
206
|
...changes.removedAgents.map((name) => changeLine("-", name, AGENT_DETAIL)),
|
|
198
207
|
...[...changes.sourceChanges].map(([id, change]) => sourceChangeLine(id, change)),
|
|
@@ -238,7 +247,7 @@ function changedSubAgents(changes, { result, installedGlobal }, projectConfig) {
|
|
|
238
247
|
...changes.tuningChanges.keys(),
|
|
239
248
|
...changes.joinedGlobalAgents
|
|
240
249
|
]).filter((name) => !arrivingOrLeaving.has(name));
|
|
241
|
-
const after = { agents: result.agentConfigs, stack: result.assignedStack };
|
|
250
|
+
const after = { agents: result.agentConfigs, skills: result.skills, stack: result.assignedStack };
|
|
242
251
|
if (installedGlobal === null) return agentChangesAmong(changed, projectConfig, after);
|
|
243
252
|
const [heldGlobal, ownedHere] = partition(changed, (name) => isHeldGlobally(name, result));
|
|
244
253
|
return [
|
|
@@ -444,8 +453,9 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
444
453
|
async applyApprovedChanges(changes, active, result, context, editRoot) {
|
|
445
454
|
const { selection: activeSelection, oldSkills, oldAgents } = active;
|
|
446
455
|
this.logChangeSummary(changes, activeSelection.skills, oldSkills);
|
|
447
|
-
|
|
448
|
-
await this.
|
|
456
|
+
const migrationPlan = migrationPlanOf(changes, active);
|
|
457
|
+
await this.applyMigrations(migrationPlan, context, editRoot);
|
|
458
|
+
await this.applyScopeChanges(migrationPlan.scopeChanges, context, editRoot);
|
|
449
459
|
await this.applyCollapsedPairs(changes, context, editRoot);
|
|
450
460
|
await this.applyPluginChanges(changes, activeSelection, oldSkills, context, editRoot);
|
|
451
461
|
await this.copyNewLocalSkills(changes, activeSelection, context, editRoot);
|
|
@@ -675,10 +685,9 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
675
685
|
}
|
|
676
686
|
const { installation, config: projectConfig } = detected;
|
|
677
687
|
try {
|
|
678
|
-
const { sourceResult, startupMessages } = await
|
|
679
|
-
projectDir: installation.projectDir,
|
|
680
|
-
|
|
681
|
-
});
|
|
688
|
+
const { sourceResult, startupMessages } = await stoppingOnARefusal(
|
|
689
|
+
() => loadSource({ projectDir: installation.projectDir, captureStartupMessages: true })
|
|
690
|
+
);
|
|
682
691
|
return { installation, projectConfig, sourceResult, startupMessages };
|
|
683
692
|
} catch (error) {
|
|
684
693
|
this.handleError(error);
|
|
@@ -692,8 +701,7 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
692
701
|
}
|
|
693
702
|
this.log("");
|
|
694
703
|
}
|
|
695
|
-
async applyMigrations(
|
|
696
|
-
const migrationPlan = migrationPlanOf(changes, active);
|
|
704
|
+
async applyMigrations(migrationPlan, context, editRoot) {
|
|
697
705
|
if (migrationPlan.toEject.length === 0 && migrationPlan.toPlugin.length === 0) return;
|
|
698
706
|
this.announceMigrations(migrationPlan);
|
|
699
707
|
if (migrationPlan.toPlugin.length > 0) {
|
|
@@ -765,21 +773,23 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
765
773
|
this.log(chalk.hex(CLI_COLORS.NEUTRAL)(installingBesideGlobalCopies(count)));
|
|
766
774
|
}
|
|
767
775
|
/**
|
|
768
|
-
*
|
|
769
|
-
* ({@link applyCollapsedPairs}).
|
|
776
|
+
* Only moves that keep their mode: a switch lands at its new scope ({@link applyMigrations}). A
|
|
777
|
+
* collapsed `[P][G]` pair is not a move: its project half is dropped ({@link applyCollapsedPairs}).
|
|
770
778
|
*/
|
|
771
|
-
async applyScopeChanges(
|
|
772
|
-
const
|
|
773
|
-
|
|
774
|
-
|
|
779
|
+
async applyScopeChanges(scopeMoves, context, editRoot) {
|
|
780
|
+
const [copyMoves, pluginMoves] = partition(
|
|
781
|
+
scopeMoves,
|
|
782
|
+
(move) => move.newSource === EJECT_SOURCE
|
|
783
|
+
);
|
|
784
|
+
await moveEjectedSkillCopies(copyMoves, editRoot.dir);
|
|
785
|
+
if (pluginMoves.length === 0) return;
|
|
775
786
|
const marketplace = await this.requireMarketplaceOrExit(
|
|
776
787
|
context.sourceResult,
|
|
777
788
|
"migrate plugin skill scopes",
|
|
778
789
|
hostAt(editRoot.dir)
|
|
779
790
|
);
|
|
780
791
|
const pluginScopeResult = await migratePluginSkillScopes(
|
|
781
|
-
|
|
782
|
-
filteredResult.skills,
|
|
792
|
+
pluginMoves,
|
|
783
793
|
marketplace,
|
|
784
794
|
editRoot.dir
|
|
785
795
|
);
|
|
@@ -1135,20 +1145,11 @@ function scopeMovesOf(changes) {
|
|
|
1135
1145
|
const collapsed = new Set(changes.collapsedPairs.map(({ projectHalf }) => projectHalf.id));
|
|
1136
1146
|
return new Map([...changes.scopeChanges].filter(([id]) => !collapsed.has(id)));
|
|
1137
1147
|
}
|
|
1138
|
-
async function moveEjectedSkillCopies(
|
|
1139
|
-
for (const
|
|
1140
|
-
|
|
1141
|
-
if (skillConfig?.origin === EJECT_SOURCE) {
|
|
1142
|
-
await migrateLocalSkillScope(skillId, change.from, projectDir);
|
|
1143
|
-
}
|
|
1148
|
+
async function moveEjectedSkillCopies(copyMoves, projectDir) {
|
|
1149
|
+
for (const move of copyMoves) {
|
|
1150
|
+
await migrateLocalSkillScope(move.id, move.oldScope, projectDir);
|
|
1144
1151
|
}
|
|
1145
1152
|
}
|
|
1146
|
-
function movesAPluginSkill(scopeMoves, skills) {
|
|
1147
|
-
return [...scopeMoves.keys()].some((skillId) => {
|
|
1148
|
-
const skill = skills.find((s) => s.id === skillId);
|
|
1149
|
-
return skill !== void 0 && skill.origin !== EJECT_SOURCE;
|
|
1150
|
-
});
|
|
1151
|
-
}
|
|
1152
1153
|
var STALE_AGENT_SCOPES = ["project", "global"];
|
|
1153
1154
|
var UNRECORDED_AGENT_SCOPE = "project";
|
|
1154
1155
|
function installedScope(name, oldAgents) {
|
|
@@ -1173,22 +1174,18 @@ function hasAnyChanges(changes) {
|
|
|
1173
1174
|
function changesTheConfig(changes) {
|
|
1174
1175
|
return changes.reassignedAgents.length > 0 || changes.joinedGlobalAgents.length > 0 || changes.addedSkills.length > 0 || changes.removedSkills.length > 0 || changes.addedAgents.length > 0 || changes.removedAgents.length > 0 || changes.sourceChanges.size > 0 || changes.scopeChanges.size > 0 || changes.agentScopeChanges.size > 0 || changes.tuningChanges.size > 0;
|
|
1175
1176
|
}
|
|
1176
|
-
async function migratePluginSkillScopes(
|
|
1177
|
+
async function migratePluginSkillScopes(pluginMoves, marketplace, projectDir) {
|
|
1177
1178
|
const host = hostAt(projectDir);
|
|
1178
1179
|
const failed = [];
|
|
1179
|
-
for (const
|
|
1180
|
-
const
|
|
1181
|
-
if (!skillConfig || skillConfig.origin === EJECT_SOURCE) {
|
|
1182
|
-
continue;
|
|
1183
|
-
}
|
|
1184
|
-
const pluginRef = buildMarketplacePluginRef(skillId, marketplace);
|
|
1180
|
+
for (const move of pluginMoves) {
|
|
1181
|
+
const pluginRef = buildMarketplacePluginRef(move.id, marketplace);
|
|
1185
1182
|
try {
|
|
1186
|
-
if (
|
|
1183
|
+
if (move.oldScope === "project") {
|
|
1187
1184
|
await host.uninstallPlugin(pluginRef, "project", projectDir);
|
|
1188
1185
|
}
|
|
1189
|
-
await host.installPlugin(pluginRef,
|
|
1186
|
+
await host.installPlugin(pluginRef, move.newScope, projectDir);
|
|
1190
1187
|
} catch (error) {
|
|
1191
|
-
failed.push({ id:
|
|
1188
|
+
failed.push({ id: move.id, error: getErrorMessage(error) });
|
|
1192
1189
|
}
|
|
1193
1190
|
}
|
|
1194
1191
|
return { failed };
|