agents-inc 0.168.0 → 0.170.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 +21 -0
- package/README.md +18 -15
- package/dist/{chunk-JIBCVXXL.js → chunk-3G7X2WKI.js} +4 -4
- package/dist/{chunk-JOEA52NR.js → chunk-44TE3RKH.js} +46 -2
- package/dist/chunk-44TE3RKH.js.map +1 -0
- package/dist/{chunk-NU2K5G54.js → chunk-52HDHJ7I.js} +11 -19
- package/dist/chunk-52HDHJ7I.js.map +1 -0
- package/dist/{chunk-EH2PGPLP.js → chunk-6HNXYYVF.js} +39 -22
- package/dist/chunk-6HNXYYVF.js.map +1 -0
- package/dist/{chunk-4UKMQUAU.js → chunk-6ZRH5RHC.js} +10 -11
- package/dist/chunk-6ZRH5RHC.js.map +1 -0
- package/dist/{chunk-5JUQKGCP.js → chunk-7RDMTR64.js} +14 -34
- package/dist/chunk-7RDMTR64.js.map +1 -0
- package/dist/{chunk-3LZNY46H.js → chunk-BMRUNMPV.js} +4 -4
- package/dist/{chunk-VVRI35SK.js → chunk-CLPUWOSA.js} +4 -4
- package/dist/{chunk-VVRI35SK.js.map → chunk-CLPUWOSA.js.map} +1 -1
- package/dist/{chunk-TW35AEB4.js → chunk-F2BHT5C4.js} +9 -7
- package/dist/chunk-F2BHT5C4.js.map +1 -0
- package/dist/{chunk-27AVGFXH.js → chunk-F5EBEATU.js} +2 -2
- package/dist/{chunk-GE7NUPMI.js → chunk-HED2DAXZ.js} +3 -3
- package/dist/{chunk-7PYXS2QU.js → chunk-KOLDW6SF.js} +3 -3
- package/dist/{chunk-7PYXS2QU.js.map → chunk-KOLDW6SF.js.map} +1 -1
- package/dist/{chunk-C2UISKIM.js → chunk-MQ6CGZNJ.js} +109 -422
- package/dist/chunk-MQ6CGZNJ.js.map +1 -0
- package/dist/{chunk-P6I72PR3.js → chunk-NCWDK6L7.js} +115 -196
- package/dist/chunk-NCWDK6L7.js.map +1 -0
- package/dist/{chunk-VRXX4D6K.js → chunk-NEZ4OAOL.js} +1 -1
- package/dist/chunk-NEZ4OAOL.js.map +1 -0
- package/dist/chunk-NIHUOWE4.js +106 -0
- package/dist/chunk-NIHUOWE4.js.map +1 -0
- package/dist/{chunk-OI2H6M5I.js → chunk-NQW25DCF.js} +2 -2
- package/dist/chunk-NQW25DCF.js.map +1 -0
- package/dist/{chunk-ZUGH4MQG.js → chunk-OYJQUA3D.js} +3 -3
- package/dist/{chunk-ZUGH4MQG.js.map → chunk-OYJQUA3D.js.map} +1 -1
- package/dist/{chunk-AG3ZVM3B.js → chunk-PJWGTNOX.js} +186 -210
- package/dist/chunk-PJWGTNOX.js.map +1 -0
- package/dist/{chunk-HR7TK2XW.js → chunk-RIPSGNLU.js} +3 -3
- package/dist/chunk-RIPSGNLU.js.map +1 -0
- package/dist/{chunk-4DRFEYCE.js → chunk-SZYQISA2.js} +7 -7
- package/dist/chunk-SZYQISA2.js.map +1 -0
- package/dist/{chunk-W6GO2CYX.js → chunk-USVBYQSQ.js} +2 -2
- package/dist/{chunk-H4ZKGGTE.js → chunk-V3KTSP3Q.js} +50 -42
- package/dist/chunk-V3KTSP3Q.js.map +1 -0
- package/dist/{chunk-KTLKR4YY.js → chunk-WTWMGH2C.js} +2 -2
- package/dist/commands/build/marketplace.js +23 -22
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +8 -9
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +19 -20
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +17 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +118 -297
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +21 -33
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/init.js +17 -45
- package/dist/commands/list.js +19 -17
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/marketplace.js +11 -11
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/search.js +12 -13
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/share.js +11 -12
- package/dist/commands/share.js.map +1 -1
- package/dist/commands/uninstall.js +18 -20
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +8 -9
- package/dist/commands/update.js.map +1 -1
- package/dist/components/common/removal-plan-confirm.js +2 -2
- package/dist/components/common/scroll-affordance.js +9 -0
- package/dist/components/common/select-list.js +2 -3
- package/dist/components/common/skill-agent-summary.js +11 -0
- package/dist/components/common/spinner.js +1 -1
- package/dist/{chunk-QWFG7Y3R.js → components/common/summary-panel.js} +57 -31
- package/dist/components/common/summary-panel.js.map +1 -0
- package/dist/config-exports.js +1 -1
- package/dist/hooks/init.js +18 -46
- package/dist/hooks/init.js.map +1 -1
- package/dist/load-agent-defs-YMDWBFDP.js +14 -0
- package/dist/recompile-project-agents-SZ76WNTW.js +18 -0
- package/dist/{source-loader-FRJTCSDL.js → source-loader-C5SQXZXI.js} +5 -5
- package/dist/src/agents/meta/codex-keeper/playbook.md +2 -3
- package/package.json +2 -3
- package/src/agents/meta/codex-keeper/playbook.md +2 -3
- package/src/schemas/project-config.schema.json +1 -1
- package/assets/demo.tape +0 -266
- package/dist/chunk-23DNVNFP.js +0 -292
- package/dist/chunk-23DNVNFP.js.map +0 -1
- package/dist/chunk-3DIDV6H3.js +0 -268
- package/dist/chunk-3DIDV6H3.js.map +0 -1
- package/dist/chunk-4DRFEYCE.js.map +0 -1
- package/dist/chunk-4HWOYYY7.js +0 -92
- package/dist/chunk-4HWOYYY7.js.map +0 -1
- package/dist/chunk-4UKMQUAU.js.map +0 -1
- package/dist/chunk-5JUQKGCP.js.map +0 -1
- package/dist/chunk-6WGXTB2L.js +0 -28
- package/dist/chunk-6WGXTB2L.js.map +0 -1
- package/dist/chunk-AG3ZVM3B.js.map +0 -1
- package/dist/chunk-C2UISKIM.js.map +0 -1
- package/dist/chunk-CMJBKQUH.js +0 -23
- package/dist/chunk-CMJBKQUH.js.map +0 -1
- package/dist/chunk-DJEO3F2H.js +0 -230
- package/dist/chunk-DJEO3F2H.js.map +0 -1
- package/dist/chunk-EH2PGPLP.js.map +0 -1
- package/dist/chunk-GRL73YPF.js +0 -197
- package/dist/chunk-GRL73YPF.js.map +0 -1
- package/dist/chunk-H4ZKGGTE.js.map +0 -1
- package/dist/chunk-HI6YB7XP.js +0 -59
- package/dist/chunk-HI6YB7XP.js.map +0 -1
- package/dist/chunk-HL3GYRMR.js +0 -17
- package/dist/chunk-HL3GYRMR.js.map +0 -1
- package/dist/chunk-HR7TK2XW.js.map +0 -1
- package/dist/chunk-JOEA52NR.js.map +0 -1
- package/dist/chunk-JPMV4E4E.js +0 -118
- package/dist/chunk-JPMV4E4E.js.map +0 -1
- package/dist/chunk-JVUN6AOO.js +0 -237
- package/dist/chunk-JVUN6AOO.js.map +0 -1
- package/dist/chunk-KQ3PDARZ.js +0 -25
- package/dist/chunk-KQ3PDARZ.js.map +0 -1
- package/dist/chunk-L3W2JWBA.js +0 -168
- package/dist/chunk-L3W2JWBA.js.map +0 -1
- package/dist/chunk-LFUJCRCT.js +0 -27
- package/dist/chunk-LFUJCRCT.js.map +0 -1
- package/dist/chunk-NU2K5G54.js.map +0 -1
- package/dist/chunk-OI2H6M5I.js.map +0 -1
- package/dist/chunk-P6I72PR3.js.map +0 -1
- package/dist/chunk-PCFUXQJA.js +0 -317
- package/dist/chunk-PCFUXQJA.js.map +0 -1
- package/dist/chunk-PLX2FLEQ.js +0 -48
- package/dist/chunk-PLX2FLEQ.js.map +0 -1
- package/dist/chunk-QWFG7Y3R.js.map +0 -1
- package/dist/chunk-SLBL3WIP.js +0 -121
- package/dist/chunk-SLBL3WIP.js.map +0 -1
- package/dist/chunk-TSIU7DME.js +0 -43
- package/dist/chunk-TSIU7DME.js.map +0 -1
- package/dist/chunk-TW35AEB4.js.map +0 -1
- package/dist/chunk-VRXX4D6K.js.map +0 -1
- package/dist/chunk-W5KEYSOL.js +0 -51
- package/dist/chunk-W5KEYSOL.js.map +0 -1
- package/dist/chunk-WNLF5EDZ.js +0 -1170
- package/dist/chunk-WNLF5EDZ.js.map +0 -1
- package/dist/chunk-WTJ3AY33.js +0 -31
- package/dist/chunk-WTJ3AY33.js.map +0 -1
- package/dist/chunk-X6ZZEYO3.js +0 -53
- package/dist/chunk-X6ZZEYO3.js.map +0 -1
- package/dist/chunk-XQHZPINL.js +0 -89
- package/dist/chunk-XQHZPINL.js.map +0 -1
- package/dist/chunk-YN3SWF53.js +0 -35
- package/dist/chunk-YN3SWF53.js.map +0 -1
- package/dist/components/wizard/category-grid.js +0 -13
- package/dist/components/wizard/checkbox-grid.js +0 -12
- package/dist/components/wizard/domain-selection.js +0 -18
- package/dist/components/wizard/run-wizard-session.js +0 -40
- package/dist/components/wizard/run-wizard-session.js.map +0 -1
- package/dist/components/wizard/scroll-affordance.js +0 -9
- package/dist/components/wizard/skill-agent-summary.js +0 -13
- package/dist/components/wizard/source-grid.js +0 -16
- package/dist/components/wizard/source-grid.js.map +0 -1
- package/dist/components/wizard/stack-selection.js +0 -17
- package/dist/components/wizard/stack-selection.js.map +0 -1
- package/dist/components/wizard/step-agents.js +0 -18
- package/dist/components/wizard/step-agents.js.map +0 -1
- package/dist/components/wizard/step-build.js +0 -18
- package/dist/components/wizard/step-build.js.map +0 -1
- package/dist/components/wizard/step-confirm.js +0 -18
- package/dist/components/wizard/step-confirm.js.map +0 -1
- package/dist/components/wizard/step-sources.js +0 -19
- package/dist/components/wizard/step-sources.js.map +0 -1
- package/dist/components/wizard/step-stack.js +0 -18
- package/dist/components/wizard/step-stack.js.map +0 -1
- package/dist/components/wizard/summary-panel.js +0 -17
- package/dist/components/wizard/summary-panel.js.map +0 -1
- package/dist/components/wizard/toast.js +0 -9
- package/dist/components/wizard/toast.js.map +0 -1
- package/dist/components/wizard/wizard-layout.js +0 -22
- package/dist/components/wizard/wizard-layout.js.map +0 -1
- package/dist/components/wizard/wizard-tabs.js +0 -11
- package/dist/components/wizard/wizard-tabs.js.map +0 -1
- package/dist/components/wizard/wizard.js +0 -39
- package/dist/components/wizard/wizard.js.map +0 -1
- package/dist/load-agent-defs-5XMVB3MU.js +0 -14
- package/dist/load-agent-defs-5XMVB3MU.js.map +0 -1
- package/dist/recompile-project-agents-7PQWYQ6B.js +0 -18
- package/dist/recompile-project-agents-7PQWYQ6B.js.map +0 -1
- package/dist/source-loader-FRJTCSDL.js.map +0 -1
- package/dist/stores/wizard-store.js +0 -24
- package/dist/stores/wizard-store.js.map +0 -1
- /package/assets/{demo.gif → legacy-wizard.gif} +0 -0
- /package/dist/{chunk-JIBCVXXL.js.map → chunk-3G7X2WKI.js.map} +0 -0
- /package/dist/{chunk-3LZNY46H.js.map → chunk-BMRUNMPV.js.map} +0 -0
- /package/dist/{chunk-27AVGFXH.js.map → chunk-F5EBEATU.js.map} +0 -0
- /package/dist/{chunk-GE7NUPMI.js.map → chunk-HED2DAXZ.js.map} +0 -0
- /package/dist/{chunk-W6GO2CYX.js.map → chunk-USVBYQSQ.js.map} +0 -0
- /package/dist/{chunk-KTLKR4YY.js.map → chunk-WTWMGH2C.js.map} +0 -0
- /package/dist/components/{wizard → common}/scroll-affordance.js.map +0 -0
- /package/dist/components/{wizard → common}/skill-agent-summary.js.map +0 -0
- /package/dist/{components/wizard/category-grid.js.map → load-agent-defs-YMDWBFDP.js.map} +0 -0
- /package/dist/{components/wizard/checkbox-grid.js.map → recompile-project-agents-SZ76WNTW.js.map} +0 -0
- /package/dist/{components/wizard/domain-selection.js.map → source-loader-C5SQXZXI.js.map} +0 -0
package/dist/commands/edit.js
CHANGED
|
@@ -1,18 +1,22 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
awaitUnderSpinner
|
|
4
|
+
} from "../chunk-NEZ4OAOL.js";
|
|
2
5
|
import {
|
|
3
6
|
publishSeedConfig,
|
|
4
7
|
seedPayloadForInstallation,
|
|
5
8
|
skillsAuthoredHere
|
|
6
|
-
} from "../chunk-
|
|
9
|
+
} from "../chunk-SZYQISA2.js";
|
|
7
10
|
import {
|
|
8
11
|
RemovalPlanConfirm
|
|
9
|
-
} from "../chunk-
|
|
12
|
+
} from "../chunk-USVBYQSQ.js";
|
|
10
13
|
import {
|
|
11
14
|
unofferablePlacementsFound
|
|
12
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-WTWMGH2C.js";
|
|
13
16
|
import {
|
|
14
17
|
arrivalLines,
|
|
15
18
|
arrivalsByScope,
|
|
19
|
+
joinedStatement,
|
|
16
20
|
notInstalledGlobally,
|
|
17
21
|
openUrl,
|
|
18
22
|
readInstalledGlobal,
|
|
@@ -21,87 +25,54 @@ import {
|
|
|
21
25
|
sameAssignments,
|
|
22
26
|
skillLabel,
|
|
23
27
|
withUnplaceableAssignees
|
|
24
|
-
} from "../chunk-
|
|
25
|
-
import {
|
|
26
|
-
runWizardSession
|
|
27
|
-
} from "../chunk-X6ZZEYO3.js";
|
|
28
|
-
import "../chunk-PCFUXQJA.js";
|
|
29
|
-
import "../chunk-KQ3PDARZ.js";
|
|
30
|
-
import "../chunk-PLX2FLEQ.js";
|
|
31
|
-
import "../chunk-HL3GYRMR.js";
|
|
32
|
-
import "../chunk-JVUN6AOO.js";
|
|
33
|
-
import "../chunk-QWFG7Y3R.js";
|
|
34
|
-
import "../chunk-6WGXTB2L.js";
|
|
35
|
-
import "../chunk-L3W2JWBA.js";
|
|
36
|
-
import "../chunk-HI6YB7XP.js";
|
|
37
|
-
import "../chunk-23DNVNFP.js";
|
|
38
|
-
import "../chunk-7PYXS2QU.js";
|
|
39
|
-
import "../chunk-GRL73YPF.js";
|
|
40
|
-
import "../chunk-DJEO3F2H.js";
|
|
41
|
-
import "../chunk-YN3SWF53.js";
|
|
42
|
-
import "../chunk-4HWOYYY7.js";
|
|
43
|
-
import "../chunk-TSIU7DME.js";
|
|
44
|
-
import "../chunk-JOEA52NR.js";
|
|
45
|
-
import {
|
|
46
|
-
awaitUnderSpinner
|
|
47
|
-
} from "../chunk-VRXX4D6K.js";
|
|
48
|
-
import "../chunk-3DIDV6H3.js";
|
|
49
|
-
import "../chunk-XQHZPINL.js";
|
|
50
|
-
import "../chunk-JPMV4E4E.js";
|
|
51
|
-
import "../chunk-LFUJCRCT.js";
|
|
52
|
-
import "../chunk-WTJ3AY33.js";
|
|
53
|
-
import "../chunk-SLBL3WIP.js";
|
|
28
|
+
} from "../chunk-6HNXYYVF.js";
|
|
54
29
|
import {
|
|
55
30
|
fetchSeedConfig
|
|
56
|
-
} from "../chunk-
|
|
31
|
+
} from "../chunk-OYJQUA3D.js";
|
|
57
32
|
import {
|
|
58
33
|
promptConfirm
|
|
59
34
|
} from "../chunk-4AAOOAIN.js";
|
|
60
35
|
import "../chunk-OZXAJNLA.js";
|
|
61
36
|
import {
|
|
62
37
|
hostCompileNotices
|
|
63
|
-
} from "../chunk-
|
|
38
|
+
} from "../chunk-F5EBEATU.js";
|
|
64
39
|
import {
|
|
65
|
-
applyMigratedGlobalSources,
|
|
66
40
|
compileAgentsAllScopes,
|
|
67
41
|
compileProjectScope,
|
|
68
42
|
detectProject,
|
|
69
43
|
loadSource,
|
|
70
44
|
movedGlobalAgentInputs,
|
|
71
|
-
mutateGlobal,
|
|
72
45
|
sayCapturedWarnings,
|
|
73
46
|
writeProjectConfig
|
|
74
|
-
} from "../chunk-
|
|
47
|
+
} from "../chunk-7RDMTR64.js";
|
|
75
48
|
import {
|
|
76
49
|
copyLocalSkills,
|
|
77
50
|
discoverInstalledSkills,
|
|
78
51
|
removeCompiledAgents,
|
|
79
52
|
uninstallPluginSkills
|
|
80
|
-
} from "../chunk-
|
|
53
|
+
} from "../chunk-F2BHT5C4.js";
|
|
81
54
|
import {
|
|
82
55
|
loadAgentDefs
|
|
83
|
-
} from "../chunk-
|
|
84
|
-
import "../chunk-
|
|
85
|
-
import "../chunk-
|
|
86
|
-
import "../chunk-4UKMQUAU.js";
|
|
87
|
-
import "../chunk-JFLVEFFP.js";
|
|
56
|
+
} from "../chunk-HED2DAXZ.js";
|
|
57
|
+
import "../chunk-3G7X2WKI.js";
|
|
58
|
+
import "../chunk-BMRUNMPV.js";
|
|
88
59
|
import {
|
|
89
60
|
formatScopeTag
|
|
90
|
-
} from "../chunk-
|
|
61
|
+
} from "../chunk-NIHUOWE4.js";
|
|
62
|
+
import "../chunk-JFLVEFFP.js";
|
|
91
63
|
import {
|
|
92
64
|
providerFlag,
|
|
93
65
|
providerNamedBy,
|
|
94
66
|
refuseAnAmbiguousInstallation
|
|
95
|
-
} from "../chunk-
|
|
67
|
+
} from "../chunk-RIPSGNLU.js";
|
|
96
68
|
import {
|
|
97
69
|
BaseCommand,
|
|
98
70
|
EXIT_CODES,
|
|
99
71
|
carriedSkillsThatDiffer,
|
|
100
72
|
registerExternalSkills,
|
|
101
73
|
writeExternalSkills
|
|
102
|
-
} from "../chunk-
|
|
103
|
-
import "../chunk-
|
|
104
|
-
import "../chunk-CMJBKQUH.js";
|
|
74
|
+
} from "../chunk-V3KTSP3Q.js";
|
|
75
|
+
import "../chunk-CLPUWOSA.js";
|
|
105
76
|
import {
|
|
106
77
|
ERROR_MESSAGES,
|
|
107
78
|
INCOMPLETE_WORK_RECOVERY,
|
|
@@ -116,53 +87,45 @@ import {
|
|
|
116
87
|
carriedSkillsWritten,
|
|
117
88
|
deleteLocalSkill,
|
|
118
89
|
detectMigrations,
|
|
119
|
-
|
|
90
|
+
editorSkillMetadataUnusableError,
|
|
120
91
|
ejectCopyFailureError,
|
|
121
92
|
executeMigration,
|
|
122
|
-
foldLocalSkillIntoGlobal,
|
|
123
93
|
getErrorMessage,
|
|
124
94
|
holdsItsOwnInstallation,
|
|
125
95
|
hostAt,
|
|
126
96
|
isHomeDirectory,
|
|
127
97
|
keptAsInstalledGlobally,
|
|
128
98
|
keptUnassigned,
|
|
99
|
+
loadProjectConfig,
|
|
129
100
|
localSkillsCopied,
|
|
130
101
|
migrateLocalSkillScope,
|
|
131
102
|
nothingInstalledToApplyTo,
|
|
132
|
-
plural,
|
|
133
103
|
projectCopyRemoved,
|
|
134
104
|
providerInUse,
|
|
135
105
|
recompileSummary,
|
|
136
106
|
resolveInstallPaths,
|
|
137
|
-
|
|
107
|
+
seedToInstallSelection,
|
|
138
108
|
sharedConfigDestinations,
|
|
139
109
|
sharedConfigNeedsTerminal,
|
|
140
110
|
skippedUnknownAgents,
|
|
141
111
|
skippedUnknownSkills,
|
|
142
|
-
unplaceableKept
|
|
143
|
-
|
|
144
|
-
wizardNeedsTerminal
|
|
145
|
-
} from "../chunk-C2UISKIM.js";
|
|
112
|
+
unplaceableKept
|
|
113
|
+
} from "../chunk-MQ6CGZNJ.js";
|
|
146
114
|
import {
|
|
147
115
|
getSkillById,
|
|
148
|
-
getSkillDisplayName
|
|
149
|
-
|
|
150
|
-
typedKeys
|
|
151
|
-
} from "../chunk-NU2K5G54.js";
|
|
116
|
+
getSkillDisplayName
|
|
117
|
+
} from "../chunk-52HDHJ7I.js";
|
|
152
118
|
import {
|
|
153
119
|
CLI_COLORS,
|
|
154
120
|
CLI_INVOKE_COMMAND,
|
|
155
|
-
EDIT_PROJECT_SETUP_FLAG,
|
|
156
|
-
EDIT_PROJECT_SETUP_MARKETPLACE_FLAG,
|
|
157
121
|
EJECT_SOURCE,
|
|
158
|
-
activeAgentNames,
|
|
159
122
|
activeAgentScopeMap,
|
|
160
123
|
editorConfigUrl,
|
|
161
124
|
formatSourceDisplayName,
|
|
162
125
|
isActiveAt,
|
|
163
126
|
isGlobalTombstone
|
|
164
|
-
} from "../chunk-
|
|
165
|
-
import "../chunk-
|
|
127
|
+
} from "../chunk-PJWGTNOX.js";
|
|
128
|
+
import "../chunk-NQW25DCF.js";
|
|
166
129
|
|
|
167
130
|
// src/cli/commands/edit.tsx
|
|
168
131
|
import path from "path";
|
|
@@ -200,13 +163,9 @@ function scopeArrow(change) {
|
|
|
200
163
|
function formatValueChangeLine(subject, change, kind) {
|
|
201
164
|
return chalk.hex(CLI_COLORS.WARNING)(` ~ ${subject}`) + chalk.hex(CLI_COLORS.NEUTRAL)(` (${kind}: ${change.from} \u2192 ${change.to})`);
|
|
202
165
|
}
|
|
203
|
-
function
|
|
204
|
-
|
|
205
|
-
}
|
|
206
|
-
function resolveEditRoot(installation, cwd, setupRequested) {
|
|
207
|
-
const dir = setupRequested ? cwd : installation.projectDir;
|
|
208
|
-
const isGlobal = isHomeDirectory(dir);
|
|
209
|
-
return { dir, isGlobal, isProjectSetup: setupRequested && !isGlobal };
|
|
166
|
+
function resolveEditRoot(installation) {
|
|
167
|
+
const dir = installation.projectDir;
|
|
168
|
+
return { dir, isGlobal: isHomeDirectory(dir) };
|
|
210
169
|
}
|
|
211
170
|
function sharedConfigPlan(changes, kept) {
|
|
212
171
|
const dropped = droppedProjectHalves(changes);
|
|
@@ -228,12 +187,11 @@ function removalSections(skills, agents) {
|
|
|
228
187
|
].filter((section) => section.items.length > 0);
|
|
229
188
|
}
|
|
230
189
|
function droppedProjectHalves(changes) {
|
|
231
|
-
const droppedSkills = changes.collapsedPairs.filter((pair) => !pair.folded);
|
|
232
190
|
const droppedAgents = [...changes.agentScopeChanges].filter(
|
|
233
191
|
([name, change]) => change.to === "global" && changes.dualScopeAgentTransitions.has(name)
|
|
234
192
|
);
|
|
235
193
|
return {
|
|
236
|
-
skillIds:
|
|
194
|
+
skillIds: changes.collapsedPairs.map(({ projectHalf }) => projectHalf.id),
|
|
237
195
|
agentNames: droppedAgents.map(([name]) => name)
|
|
238
196
|
};
|
|
239
197
|
}
|
|
@@ -241,13 +199,11 @@ function planHeading(sections) {
|
|
|
241
199
|
if (sections.length === 0) return SHARED_CONFIG_APPLY.NOTHING_REMOVED;
|
|
242
200
|
return SHARED_CONFIG_APPLY.PREVIEW_HEADING;
|
|
243
201
|
}
|
|
244
|
-
function compilesGlobalScope(
|
|
245
|
-
|
|
246
|
-
return movedGlobalAgentInputs(written);
|
|
202
|
+
function compilesGlobalScope(editRoot, written) {
|
|
203
|
+
return editRoot.isGlobal || movedGlobalAgentInputs(written);
|
|
247
204
|
}
|
|
248
205
|
function withReassignments(changes, result, installedStack, editRoot) {
|
|
249
206
|
const { assignedStack } = result;
|
|
250
|
-
if (assignedStack === void 0) return { ...changes, reassignedAgents: [] };
|
|
251
207
|
const ownedHere = (agent) => editRoot.isGlobal || isActiveAt(agent, "project");
|
|
252
208
|
const countedAsAdded = (agent) => changes.addedAgents.includes(agent.name);
|
|
253
209
|
const rowsMoved = (agent) => !sameAssignments(assignedStack[agent.name], installedStack?.[agent.name]);
|
|
@@ -303,41 +259,31 @@ function applyAuthority(editRoot) {
|
|
|
303
259
|
return editRoot.isGlobal ? "all" : "owned";
|
|
304
260
|
}
|
|
305
261
|
var Edit = class _Edit extends BaseCommand {
|
|
306
|
-
static summary = "
|
|
307
|
-
static description = "
|
|
262
|
+
static summary = "Open this installation in the editor, or apply a configuration with --from";
|
|
263
|
+
static description = "Open this installation in agentsinc.sh/editor, or apply a configuration built there with --from";
|
|
308
264
|
static examples = [
|
|
309
265
|
{
|
|
310
|
-
description: "Open the
|
|
266
|
+
description: "Open this installation in the editor",
|
|
311
267
|
command: "<%= config.bin %> <%= command.id %>"
|
|
312
268
|
},
|
|
313
|
-
{
|
|
314
|
-
description: "Open this installation in the editor instead of the wizard",
|
|
315
|
-
command: "<%= config.bin %> <%= command.id %> --ui"
|
|
316
|
-
},
|
|
317
269
|
{
|
|
318
270
|
description: "Apply a configuration built in the editor, by its id",
|
|
319
271
|
command: "<%= config.bin %> <%= command.id %> --from <id>"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
description: "Look at a shared configuration without applying it",
|
|
275
|
+
command: "<%= config.bin %> <%= command.id %> --ui --from <id>"
|
|
320
276
|
}
|
|
321
277
|
];
|
|
322
278
|
static flags = {
|
|
323
279
|
ui: Flags.boolean({
|
|
324
|
-
description: "Open agentsinc.sh/editor
|
|
280
|
+
description: "Open agentsinc.sh/editor on this installation, or on the id --from names without applying it \u2014 what a bare edit does",
|
|
325
281
|
default: false
|
|
326
282
|
}),
|
|
327
283
|
from: Flags.string({
|
|
328
284
|
description: "Apply a configuration shared from agentsinc.sh by its id, removing whatever it leaves out \u2014 from a project, only the project's own entries",
|
|
329
285
|
helpValue: "<id>"
|
|
330
286
|
}),
|
|
331
|
-
[EDIT_PROJECT_SETUP_FLAG]: Flags.boolean({
|
|
332
|
-
description: "Internal: this run continues an `init` project setup",
|
|
333
|
-
default: false,
|
|
334
|
-
hidden: true
|
|
335
|
-
}),
|
|
336
|
-
[EDIT_PROJECT_SETUP_MARKETPLACE_FLAG]: Flags.string({
|
|
337
|
-
description: "Internal: the marketplace `init --marketplace` named for that project setup",
|
|
338
|
-
hidden: true,
|
|
339
|
-
dependsOn: [EDIT_PROJECT_SETUP_FLAG]
|
|
340
|
-
}),
|
|
341
287
|
provider: providerFlag()
|
|
342
288
|
};
|
|
343
289
|
/** The exit code is decided once, after every path through `applyEdit`. */
|
|
@@ -357,17 +303,16 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
357
303
|
);
|
|
358
304
|
await this.ensureConfigReadable(cwd);
|
|
359
305
|
await this.refuseUnofferablePlacements(cwd);
|
|
360
|
-
if (flags.
|
|
361
|
-
const payload =
|
|
362
|
-
const context = await this.loadContextUnderSpinner(
|
|
363
|
-
const editRoot = resolveEditRoot(context.installation
|
|
306
|
+
if (flags.from === void 0) return this.openInEditor(cwd);
|
|
307
|
+
const payload = await this.fetchSharedConfigOrFail(flags.from);
|
|
308
|
+
const context = await this.loadContextUnderSpinner();
|
|
309
|
+
const editRoot = resolveEditRoot(context.installation);
|
|
364
310
|
await this.ensureSavedSkillsReadable(
|
|
365
311
|
context.projectConfig?.skills ?? [],
|
|
366
312
|
context.sourceResult.matrix,
|
|
367
|
-
|
|
313
|
+
editRoot.dir
|
|
368
314
|
);
|
|
369
|
-
const selection =
|
|
370
|
-
if (!selection) this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
|
|
315
|
+
const selection = await this.selectionFromSharedConfig(payload, context, editRoot);
|
|
371
316
|
const { result } = selection;
|
|
372
317
|
this.reportValidationErrors(result.validation);
|
|
373
318
|
const activeNewSkills = result.skills.filter((s) => !s.excluded);
|
|
@@ -380,18 +325,21 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
380
325
|
agentConfigs: activeNewAgents
|
|
381
326
|
};
|
|
382
327
|
const filteredOldConfig = context.projectConfig ? { ...context.projectConfig, skills: activeOldSkills, agents: activeOldAgents } : null;
|
|
383
|
-
const planned =
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
328
|
+
const planned = {
|
|
329
|
+
...withReassignments(
|
|
330
|
+
detectConfigChanges(filteredOldConfig, filteredResult, {
|
|
331
|
+
newSkills: result.skills,
|
|
332
|
+
oldSkills: context.projectConfig?.skills ?? [],
|
|
333
|
+
newAgents: result.agentConfigs,
|
|
334
|
+
oldAgents: context.projectConfig?.agents ?? []
|
|
335
|
+
}),
|
|
336
|
+
filteredResult,
|
|
337
|
+
context.projectConfig?.stack,
|
|
338
|
+
editRoot
|
|
339
|
+
),
|
|
340
|
+
joinedGlobalAgents: selection.joinedGlobalAgents
|
|
341
|
+
};
|
|
342
|
+
const rewritten = await this.confirmAndWriteCarried(selection, planned, filteredResult);
|
|
395
343
|
const changes = {
|
|
396
344
|
...planned,
|
|
397
345
|
rewrittenSkills: difference(rewritten, planned.addedSkills)
|
|
@@ -399,24 +347,9 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
399
347
|
const authority = applyAuthority(editRoot);
|
|
400
348
|
if (!hasAnyChanges(changes)) {
|
|
401
349
|
this.log(chalk.hex(CLI_COLORS.NEUTRAL)("No changes made."));
|
|
402
|
-
if (!editRoot.isProjectSetup) return;
|
|
403
|
-
await this.writeConfigAndCompile(result, context, editRoot, authority, selection.producer);
|
|
404
|
-
await this.reportWhatThisHostCannotCarry(editRoot);
|
|
405
|
-
this.logCompletionSummary(changes);
|
|
406
350
|
return;
|
|
407
351
|
}
|
|
408
|
-
|
|
409
|
-
result.unresolvableSkillIds,
|
|
410
|
-
activeOldSkills,
|
|
411
|
-
context.projectDir,
|
|
412
|
-
loadedSourceLabel(context.sourceResult)
|
|
413
|
-
);
|
|
414
|
-
this.logChangeSummary(
|
|
415
|
-
changes,
|
|
416
|
-
filteredResult.skills,
|
|
417
|
-
filteredOldConfig?.skills ?? [],
|
|
418
|
-
removalReasons
|
|
419
|
-
);
|
|
352
|
+
this.logChangeSummary(changes, filteredResult.skills, filteredOldConfig?.skills ?? []);
|
|
420
353
|
const migratedSkillIds = await this.applyMigrations(
|
|
421
354
|
changes,
|
|
422
355
|
filteredResult,
|
|
@@ -424,31 +357,17 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
424
357
|
context,
|
|
425
358
|
editRoot
|
|
426
359
|
);
|
|
427
|
-
await this.recordGlobalSourceMigrations(
|
|
428
|
-
migratedSkillIds,
|
|
429
|
-
filteredResult.skills,
|
|
430
|
-
editRoot,
|
|
431
|
-
context
|
|
432
|
-
);
|
|
433
360
|
await this.applyScopeChanges(changes, filteredResult, context, editRoot);
|
|
434
|
-
await this.applyCollapsedPairs(changes,
|
|
361
|
+
await this.applyCollapsedPairs(changes, context, editRoot);
|
|
435
362
|
await this.applySourceChanges(changes, activeOldSkills, editRoot, migratedSkillIds);
|
|
436
363
|
await this.applyPluginChanges(changes, filteredResult, activeOldSkills, context, editRoot);
|
|
437
364
|
await this.copyNewLocalSkills(changes, filteredResult, context, editRoot);
|
|
438
365
|
await this.removeDeletedLocalSkills(changes, activeOldSkills, editRoot);
|
|
439
|
-
await this.writeConfigAndCompile(result, context, editRoot, authority
|
|
366
|
+
await this.writeConfigAndCompile(result, context, editRoot, authority);
|
|
440
367
|
await this.cleanupStaleAgentFiles(changes, activeOldAgents, editRoot);
|
|
441
368
|
await this.reportWhatThisHostCannotCarry(editRoot);
|
|
442
369
|
this.logCompletionSummary(changes);
|
|
443
370
|
}
|
|
444
|
-
async selectionFromWizard(context, editRoot) {
|
|
445
|
-
if (!process.stdin.isTTY) {
|
|
446
|
-
this.error(wizardNeedsTerminal("edit"), { exit: EXIT_CODES.ERROR });
|
|
447
|
-
}
|
|
448
|
-
const result = await this.runEditWizard(context, editRoot);
|
|
449
|
-
if (!result) return null;
|
|
450
|
-
return { producer: "wizard", result };
|
|
451
|
-
}
|
|
452
371
|
/**
|
|
453
372
|
* A shared configuration applies destructively, except for a skill written here (`forkedFrom`)
|
|
454
373
|
* and an id this catalogue cannot place — both disclosed in the confirm. From a project the
|
|
@@ -487,14 +406,15 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
487
406
|
if (skippedSkillIds.length > 0) this.warn(skippedUnknownSkills(skippedSkillIds));
|
|
488
407
|
if (skippedAgentNames.length > 0) this.warn(skippedUnknownAgents(skippedAgentNames));
|
|
489
408
|
return {
|
|
490
|
-
producer: "shared",
|
|
491
409
|
result: held.result,
|
|
492
410
|
kept: [
|
|
493
411
|
...keptStatements(reconciled.kept),
|
|
494
412
|
...unassignedStatement(reconciled.unassigned),
|
|
413
|
+
...joinedStatement(held),
|
|
495
414
|
...keptAsInstalledStatement(held, revisedGlobally)
|
|
496
415
|
],
|
|
497
|
-
carried: arrivingCarried
|
|
416
|
+
carried: arrivingCarried,
|
|
417
|
+
joinedGlobalAgents: held.joined.map(({ agentName }) => agentName)
|
|
498
418
|
};
|
|
499
419
|
}
|
|
500
420
|
/** Best-effort: an unreadable directory protects nothing and must not fail an apply. */
|
|
@@ -524,7 +444,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
524
444
|
}
|
|
525
445
|
decodeSeedOrFail(payload, sourceMatrix) {
|
|
526
446
|
try {
|
|
527
|
-
return
|
|
447
|
+
return seedToInstallSelection(payload, sourceMatrix);
|
|
528
448
|
} catch (error) {
|
|
529
449
|
this.handleError(error);
|
|
530
450
|
}
|
|
@@ -580,6 +500,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
580
500
|
* nothing on disk.
|
|
581
501
|
*/
|
|
582
502
|
async openInEditor(projectDir) {
|
|
503
|
+
await this.ensureInstalledSkillsReadable(projectDir);
|
|
583
504
|
const prepared = await seedPayloadForInstallation(projectDir);
|
|
584
505
|
if (!prepared.ok) {
|
|
585
506
|
this.error(prepared.error, { exit: EXIT_CODES.ERROR });
|
|
@@ -591,6 +512,20 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
591
512
|
}
|
|
592
513
|
await this.handToBrowser(published.id);
|
|
593
514
|
}
|
|
515
|
+
/**
|
|
516
|
+
* The payload reads every ejected skill's metadata.yaml for its provenance, and no catalogue is
|
|
517
|
+
* loaded here to resolve a skill around it, so every installed entry is asked about — not only
|
|
518
|
+
* those a catalogue lacks, as `edit --from` asks. The config read is the one the payload reads.
|
|
519
|
+
*/
|
|
520
|
+
async ensureInstalledSkillsReadable(projectDir) {
|
|
521
|
+
const loaded = await loadProjectConfig(projectDir);
|
|
522
|
+
if (!loaded) return;
|
|
523
|
+
await this.refuseUnusableSavedSkillMetadata(
|
|
524
|
+
loaded.config.skills,
|
|
525
|
+
projectDir,
|
|
526
|
+
editorSkillMetadataUnusableError
|
|
527
|
+
);
|
|
528
|
+
}
|
|
594
529
|
/** Opens an id rather than applying it; `--from` without `--ui` is the destructive apply. */
|
|
595
530
|
async openSharedInEditor(id, cwd) {
|
|
596
531
|
const url = editorConfigUrl(id);
|
|
@@ -610,13 +545,10 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
610
545
|
const opened = await openUrl(editorConfigUrl(id));
|
|
611
546
|
if (!opened.ok) this.warn(opened.error);
|
|
612
547
|
}
|
|
613
|
-
async loadContextUnderSpinner(
|
|
614
|
-
return awaitUnderSpinner(
|
|
615
|
-
STATUS_MESSAGES.LOADING_SKILLS,
|
|
616
|
-
() => this.loadContext(setupMarketplace)
|
|
617
|
-
);
|
|
548
|
+
async loadContextUnderSpinner() {
|
|
549
|
+
return awaitUnderSpinner(STATUS_MESSAGES.LOADING_SKILLS, () => this.loadContext());
|
|
618
550
|
}
|
|
619
|
-
async loadContext(
|
|
551
|
+
async loadContext() {
|
|
620
552
|
const detected = await detectProject();
|
|
621
553
|
if (!detected) {
|
|
622
554
|
this.error(ERROR_MESSAGES.NO_INSTALLATION, {
|
|
@@ -624,113 +556,17 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
624
556
|
});
|
|
625
557
|
}
|
|
626
558
|
const { installation, config: projectConfig } = detected;
|
|
627
|
-
const projectDir = installation.projectDir;
|
|
628
|
-
let sourceResult;
|
|
629
|
-
let startupMessages = [];
|
|
630
559
|
try {
|
|
631
|
-
const
|
|
632
|
-
projectDir,
|
|
633
|
-
...setupMarketplace !== void 0 && { sourceFlag: setupMarketplace },
|
|
560
|
+
const { sourceResult, startupMessages } = await loadSource({
|
|
561
|
+
projectDir: installation.projectDir,
|
|
634
562
|
captureStartupMessages: true
|
|
635
563
|
});
|
|
636
|
-
sourceResult
|
|
637
|
-
startupMessages = loaded.startupMessages;
|
|
638
|
-
const sourceInfo = sourceResult.isLocal ? "local" : sourceResult.sourceConfig.sourceOrigin;
|
|
639
|
-
startupMessages.push({
|
|
640
|
-
level: "info",
|
|
641
|
-
text: `Loaded ${plural(Object.keys(matrix.skills).length, "skill")} (${sourceInfo})`
|
|
642
|
-
});
|
|
564
|
+
return { installation, projectConfig, sourceResult, startupMessages };
|
|
643
565
|
} catch (error) {
|
|
644
566
|
this.handleError(error);
|
|
645
567
|
}
|
|
646
|
-
let currentSkillIds;
|
|
647
|
-
try {
|
|
648
|
-
const discoveredSkills = await discoverAllPluginSkills(projectDir);
|
|
649
|
-
const pluginSkillIds = typedKeys(discoveredSkills);
|
|
650
|
-
const excludedConfigIds = new Set(
|
|
651
|
-
projectConfig?.skills.filter((s) => s.excluded).map((s) => s.id) ?? []
|
|
652
|
-
);
|
|
653
|
-
const configSkillIds = projectConfig?.skills.filter((s) => !s.excluded).map((s) => s.id) ?? [];
|
|
654
|
-
const filteredPluginSkillIds = pluginSkillIds.filter((id) => !excludedConfigIds.has(id));
|
|
655
|
-
const mergedIds = /* @__PURE__ */ new Set([...filteredPluginSkillIds, ...configSkillIds]);
|
|
656
|
-
currentSkillIds = [...mergedIds];
|
|
657
|
-
startupMessages.push({
|
|
658
|
-
level: "info",
|
|
659
|
-
text: `Found ${plural(currentSkillIds.length, "installed skill")}`
|
|
660
|
-
});
|
|
661
|
-
} catch (error) {
|
|
662
|
-
this.handleError(error);
|
|
663
|
-
}
|
|
664
|
-
return {
|
|
665
|
-
installation,
|
|
666
|
-
projectConfig,
|
|
667
|
-
projectDir,
|
|
668
|
-
sourceResult,
|
|
669
|
-
startupMessages,
|
|
670
|
-
currentSkillIds,
|
|
671
|
-
...setupMarketplace !== void 0 && sourceResult.marketplace !== void 0 && { setupMarketplace: sourceResult.marketplace }
|
|
672
|
-
};
|
|
673
568
|
}
|
|
674
|
-
|
|
675
|
-
const { projectConfig, currentSkillIds } = context;
|
|
676
|
-
const selectedAgents = projectConfig?.agents && activeAgentNames(projectConfig.agents);
|
|
677
|
-
return runWizardSession({
|
|
678
|
-
hydrate: {
|
|
679
|
-
initialStep: "build",
|
|
680
|
-
...projectConfig?.selectedDomains !== void 0 && {
|
|
681
|
-
initialDomains: projectConfig.selectedDomains
|
|
682
|
-
},
|
|
683
|
-
...selectedAgents !== void 0 && { initialAgents: selectedAgents },
|
|
684
|
-
installedSkillIds: currentSkillIds,
|
|
685
|
-
...projectConfig?.skills !== void 0 && { installedSkillConfigs: projectConfig.skills },
|
|
686
|
-
...projectConfig?.agents !== void 0 && { installedAgentConfigs: projectConfig.agents },
|
|
687
|
-
isEditingFromGlobalScope: editRoot.isGlobal,
|
|
688
|
-
...context.setupMarketplace !== void 0 && {
|
|
689
|
-
setupMarketplace: context.setupMarketplace
|
|
690
|
-
}
|
|
691
|
-
},
|
|
692
|
-
props: {
|
|
693
|
-
version: this.config.version,
|
|
694
|
-
initialAgents: selectedAgents,
|
|
695
|
-
installedSkillIds: currentSkillIds,
|
|
696
|
-
startupMessages: context.startupMessages
|
|
697
|
-
},
|
|
698
|
-
onCancel: () => this.log("\nEdit cancelled"),
|
|
699
|
-
clearTerminal: () => this.clearTerminal()
|
|
700
|
-
});
|
|
701
|
-
}
|
|
702
|
-
/**
|
|
703
|
-
* Records in the GLOBAL config the install-mode migrations this run already performed under
|
|
704
|
-
* `$HOME`, and only their `origin`: `executeMigration` resolves paths from each skill's own
|
|
705
|
-
* scope, so leaving the record alone would contradict the disk and the plugin registry. The
|
|
706
|
-
* reachable case is a mode change on a `[P][G]` pair's project half, carried to global by `s`.
|
|
707
|
-
* Runs before `writeConfigAndCompile`, through the gate so every other project is refreshed.
|
|
708
|
-
*/
|
|
709
|
-
async recordGlobalSourceMigrations(migratedSkillIds, newSkills, editRoot, context) {
|
|
710
|
-
if (editRoot.isGlobal) return;
|
|
711
|
-
const migratedSources = new Map(
|
|
712
|
-
newSkills.filter((s) => migratedSkillIds.has(s.id) && isActiveAt(s, "global")).map((s) => [s.id, s.origin])
|
|
713
|
-
);
|
|
714
|
-
if (migratedSources.size === 0) return;
|
|
715
|
-
try {
|
|
716
|
-
const report = await mutateGlobal(
|
|
717
|
-
{ kind: "migrate-skill-sources", sources: migratedSources },
|
|
718
|
-
{
|
|
719
|
-
// config-gate/deps.ts declares `loadMatrix` async; the matrix is already in hand.
|
|
720
|
-
// eslint-disable-next-line @typescript-eslint/require-await -- deps contract
|
|
721
|
-
loadMatrix: async () => context.sourceResult.matrix,
|
|
722
|
-
loadAgents: async () => (await loadAgentDefs()).agents
|
|
723
|
-
}
|
|
724
|
-
);
|
|
725
|
-
this.reportFanOut(report);
|
|
726
|
-
} catch (error) {
|
|
727
|
-
this.reportIncompleteWork(
|
|
728
|
-
`Could not record global origin change: ${getErrorMessage(error)}`,
|
|
729
|
-
INCOMPLETE_WORK_RECOVERY.INSPECT_INSTALLATION
|
|
730
|
-
);
|
|
731
|
-
}
|
|
732
|
-
}
|
|
733
|
-
logChangeSummary(changes, newSkills, oldSkills, removalReasons) {
|
|
569
|
+
logChangeSummary(changes, newSkills, oldSkills) {
|
|
734
570
|
const {
|
|
735
571
|
addedSkills,
|
|
736
572
|
removedSkills,
|
|
@@ -743,6 +579,7 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
743
579
|
dualScopeAgentTransitions,
|
|
744
580
|
tuningChanges,
|
|
745
581
|
reassignedAgents,
|
|
582
|
+
joinedGlobalAgents,
|
|
746
583
|
rewrittenSkills
|
|
747
584
|
} = changes;
|
|
748
585
|
this.log(`
|
|
@@ -757,10 +594,7 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
757
594
|
for (const skillId of removedSkills) {
|
|
758
595
|
const scope = oldSkills.find((s) => s.id === skillId)?.scope;
|
|
759
596
|
const scopeLabel = scope ? ` ${formatScopeTag(scope)}` : "";
|
|
760
|
-
|
|
761
|
-
this.log(
|
|
762
|
-
chalk.hex(CLI_COLORS.ERROR)(` - ${getSkillDisplayName(skillId)}${scopeLabel}`) + (reason ? chalk.hex(CLI_COLORS.NEUTRAL)(` (${reason})`) : "")
|
|
763
|
-
);
|
|
597
|
+
this.log(chalk.hex(CLI_COLORS.ERROR)(` - ${getSkillDisplayName(skillId)}${scopeLabel}`));
|
|
764
598
|
}
|
|
765
599
|
for (const agentName of addedAgents) {
|
|
766
600
|
this.log(
|
|
@@ -794,6 +628,11 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
794
628
|
chalk.hex(CLI_COLORS.WARNING)(` ~ ${agentName}`) + chalk.hex(CLI_COLORS.NEUTRAL)(" (agent: skills reassigned)")
|
|
795
629
|
);
|
|
796
630
|
}
|
|
631
|
+
for (const agentName of joinedGlobalAgents) {
|
|
632
|
+
this.log(
|
|
633
|
+
chalk.hex(CLI_COLORS.WARNING)(` ~ ${agentName}`) + chalk.hex(CLI_COLORS.NEUTRAL)(` ${formatScopeTag("global")} (agent: skills added)`)
|
|
634
|
+
);
|
|
635
|
+
}
|
|
797
636
|
for (const skillId of rewrittenSkills) {
|
|
798
637
|
this.log(
|
|
799
638
|
chalk.hex(CLI_COLORS.WARNING)(` ~ ${getSkillDisplayName(skillId)}`) + chalk.hex(CLI_COLORS.NEUTRAL)(" (skill: files rewritten)")
|
|
@@ -856,7 +695,7 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
856
695
|
this.log(chalk.hex(CLI_COLORS.NEUTRAL)(`Switching ${count} skill(s) to ${modeDescription}`));
|
|
857
696
|
}
|
|
858
697
|
/**
|
|
859
|
-
* A collapsed `[P][G]` pair is not a move: its project half is dropped
|
|
698
|
+
* A collapsed `[P][G]` pair is not a move: its project half is dropped
|
|
860
699
|
* ({@link applyCollapsedPairs}).
|
|
861
700
|
*/
|
|
862
701
|
async applyScopeChanges(changes, filteredResult, context, editRoot) {
|
|
@@ -891,22 +730,14 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
891
730
|
}
|
|
892
731
|
}
|
|
893
732
|
/**
|
|
894
|
-
*
|
|
895
|
-
* Every other half is removed at project scope only. The global install's mode is
|
|
733
|
+
* Each project half is removed at project scope only. The global install's mode is
|
|
896
734
|
* {@link applyMigrations}' to change. The uninstall is diagnostic, as every one here is.
|
|
897
735
|
*/
|
|
898
|
-
async applyCollapsedPairs(changes,
|
|
899
|
-
const [foldedCopies, removedPairs] = partition(
|
|
900
|
-
changes.collapsedPairs,
|
|
901
|
-
(pair) => foldsItsCopyIntoGlobal(pair, filteredResult.skills)
|
|
902
|
-
);
|
|
736
|
+
async applyCollapsedPairs(changes, context, editRoot) {
|
|
903
737
|
const [ejectedHalves, pluginHalves] = partition(
|
|
904
|
-
|
|
738
|
+
changes.collapsedPairs.map(({ projectHalf }) => projectHalf),
|
|
905
739
|
(half) => half.origin === EJECT_SOURCE
|
|
906
740
|
);
|
|
907
|
-
for (const { projectHalf } of foldedCopies) {
|
|
908
|
-
await foldLocalSkillIntoGlobal(editRoot.dir, projectHalf.id);
|
|
909
|
-
}
|
|
910
741
|
for (const half of ejectedHalves) {
|
|
911
742
|
await deleteLocalSkill(editRoot.dir, half.id, half.scope);
|
|
912
743
|
}
|
|
@@ -1012,7 +843,7 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
1012
843
|
await deleteLocalSkill(editRoot.dir, skillId, oldSkill.scope);
|
|
1013
844
|
}
|
|
1014
845
|
}
|
|
1015
|
-
async writeConfigAndCompile(result, context, editRoot, authority
|
|
846
|
+
async writeConfigAndCompile(result, context, editRoot, authority) {
|
|
1016
847
|
let agentDefsResult;
|
|
1017
848
|
try {
|
|
1018
849
|
agentDefsResult = await loadAgentDefs();
|
|
@@ -1022,7 +853,7 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
1022
853
|
let configResult;
|
|
1023
854
|
try {
|
|
1024
855
|
configResult = await writeProjectConfig({
|
|
1025
|
-
|
|
856
|
+
selection: result,
|
|
1026
857
|
sourceResult: context.sourceResult,
|
|
1027
858
|
projectDir: editRoot.dir,
|
|
1028
859
|
agentDefs: agentDefsResult,
|
|
@@ -1037,7 +868,7 @@ ${chalk.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
|
1037
868
|
try {
|
|
1038
869
|
const agentScopeMap = activeAgentScopeMap(result.agentConfigs);
|
|
1039
870
|
const { allSkills } = await discoverInstalledSkills(editRoot.dir);
|
|
1040
|
-
const compile = compilesGlobalScope(
|
|
871
|
+
const compile = compilesGlobalScope(editRoot, configResult.propagation) ? compileAgentsAllScopes : compileProjectScope;
|
|
1041
872
|
const compilationResult = await compile({
|
|
1042
873
|
projectDir: editRoot.dir,
|
|
1043
874
|
sourcePath: agentDefsResult.sourcePath,
|
|
@@ -1102,21 +933,21 @@ ${chalk.hex(CLI_COLORS.SUCCESS)("\u2713 Done")}
|
|
|
1102
933
|
`);
|
|
1103
934
|
}
|
|
1104
935
|
};
|
|
1105
|
-
function detectConfigChanges(oldConfig,
|
|
936
|
+
function detectConfigChanges(oldConfig, selection, fullEntries) {
|
|
1106
937
|
const oldSkillIds = oldConfig?.skills.map((s) => s.id) ?? [];
|
|
1107
|
-
const newSkillIds =
|
|
938
|
+
const newSkillIds = selection.skills.map((s) => s.id);
|
|
1108
939
|
const oldAgentNames = oldConfig?.agents.map((a) => a.name) ?? [];
|
|
1109
|
-
const newAgentNames =
|
|
940
|
+
const newAgentNames = selection.agentConfigs.map((a) => a.name);
|
|
1110
941
|
const oldSkillsById = indexBy(oldConfig?.skills ?? [], (s) => s.id);
|
|
1111
942
|
const oldAgentsByName = indexBy(oldConfig?.agents ?? [], (a) => a.name);
|
|
1112
943
|
const scopeChanges = detectPropertyChanges(
|
|
1113
|
-
|
|
944
|
+
selection.skills,
|
|
1114
945
|
oldSkillsById,
|
|
1115
946
|
(s) => s.id,
|
|
1116
947
|
(s) => s.scope
|
|
1117
948
|
);
|
|
1118
949
|
const agentScopeChanges = detectPropertyChanges(
|
|
1119
|
-
|
|
950
|
+
selection.agentConfigs,
|
|
1120
951
|
oldAgentsByName,
|
|
1121
952
|
(a) => a.name,
|
|
1122
953
|
(a) => a.scope
|
|
@@ -1130,8 +961,7 @@ function detectConfigChanges(oldConfig, wizardResult, fullEntries) {
|
|
|
1130
961
|
const collapsedPairs = collapsedPairsOf(
|
|
1131
962
|
scopeChanges,
|
|
1132
963
|
dualScopeSkillTransitions,
|
|
1133
|
-
fullEntries?.oldSkills ?? []
|
|
1134
|
-
wizardResult.foldedSkillIds ?? []
|
|
964
|
+
fullEntries?.oldSkills ?? []
|
|
1135
965
|
);
|
|
1136
966
|
return {
|
|
1137
967
|
addedSkills: difference(newSkillIds, oldSkillIds),
|
|
@@ -1139,7 +969,7 @@ function detectConfigChanges(oldConfig, wizardResult, fullEntries) {
|
|
|
1139
969
|
addedAgents: difference(newAgentNames, oldAgentNames),
|
|
1140
970
|
removedAgents: difference(oldAgentNames, newAgentNames),
|
|
1141
971
|
sourceChanges: detectPropertyChanges(
|
|
1142
|
-
|
|
972
|
+
selection.skills,
|
|
1143
973
|
indexBy(withMaskedGlobalsRestored(oldConfig?.skills ?? [], collapsedPairs), (s) => s.id),
|
|
1144
974
|
(s) => s.id,
|
|
1145
975
|
(s) => s.origin
|
|
@@ -1155,7 +985,7 @@ function detectConfigChanges(oldConfig, wizardResult, fullEntries) {
|
|
|
1155
985
|
(a) => a.name
|
|
1156
986
|
),
|
|
1157
987
|
tuningChanges: detectPropertyChanges(
|
|
1158
|
-
|
|
988
|
+
selection.agentConfigs,
|
|
1159
989
|
oldAgentsByName,
|
|
1160
990
|
(a) => a.name,
|
|
1161
991
|
describeTuning
|
|
@@ -1194,20 +1024,12 @@ function detectDualScopeTransitions(scopeChanges, fullNew, fullOld, getKey) {
|
|
|
1194
1024
|
}
|
|
1195
1025
|
return result;
|
|
1196
1026
|
}
|
|
1197
|
-
function collapsedPairsOf(scopeChanges, dualScopeSkillTransitions, fullOldSkills
|
|
1027
|
+
function collapsedPairsOf(scopeChanges, dualScopeSkillTransitions, fullOldSkills) {
|
|
1198
1028
|
return [...scopeChanges].filter(([id, change]) => change.to === "global" && dualScopeSkillTransitions.has(id)).map(([id]) => ({
|
|
1199
1029
|
projectHalf: oldHalfOf(fullOldSkills, id, (skill) => isActiveAt(skill, "project")),
|
|
1200
|
-
maskedGlobal: oldHalfOf(fullOldSkills, id, isGlobalTombstone)
|
|
1201
|
-
folded: foldedSkillIds.includes(id)
|
|
1030
|
+
maskedGlobal: oldHalfOf(fullOldSkills, id, isGlobalTombstone)
|
|
1202
1031
|
}));
|
|
1203
1032
|
}
|
|
1204
|
-
function foldsItsCopyIntoGlobal(pair, newSkills) {
|
|
1205
|
-
const { projectHalf, folded } = pair;
|
|
1206
|
-
const globalEntry = newSkills.find(
|
|
1207
|
-
(skill) => skill.id === projectHalf.id && isActiveAt(skill, "global")
|
|
1208
|
-
);
|
|
1209
|
-
return folded && projectHalf.origin === EJECT_SOURCE && globalEntry?.origin === EJECT_SOURCE;
|
|
1210
|
-
}
|
|
1211
1033
|
function oldHalfOf(fullOldSkills, id, isHalf) {
|
|
1212
1034
|
const half = fullOldSkills.find((skill) => skill.id === id && isHalf(skill));
|
|
1213
1035
|
if (half === void 0) {
|
|
@@ -1253,7 +1075,7 @@ function planStaleAgentRemovals(changes, oldAgents, editRoot) {
|
|
|
1253
1075
|
return STALE_AGENT_SCOPES.map(removalAtScope).filter((removal) => removal.agents.length > 0);
|
|
1254
1076
|
}
|
|
1255
1077
|
function hasAnyChanges(changes) {
|
|
1256
|
-
return changes.reassignedAgents.length > 0 || changes.rewrittenSkills.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;
|
|
1078
|
+
return changes.reassignedAgents.length > 0 || changes.joinedGlobalAgents.length > 0 || changes.rewrittenSkills.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;
|
|
1257
1079
|
}
|
|
1258
1080
|
async function migratePluginSkillScopes(scopeChanges, skills, marketplace, projectDir) {
|
|
1259
1081
|
const host = hostAt(projectDir);
|
|
@@ -1278,7 +1100,6 @@ async function migratePluginSkillScopes(scopeChanges, skills, marketplace, proje
|
|
|
1278
1100
|
return { migrated, failed };
|
|
1279
1101
|
}
|
|
1280
1102
|
export {
|
|
1281
|
-
applyMigratedGlobalSources,
|
|
1282
1103
|
Edit as default,
|
|
1283
1104
|
detectConfigChanges,
|
|
1284
1105
|
migratePluginSkillScopes
|