@agents-inc/cli 0.48.0 → 0.60.1
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 +181 -5
- package/README.md +1 -2
- package/dist/{chunk-2DNDAXF6.js → chunk-52M2XF3W.js} +57 -27
- package/dist/chunk-52M2XF3W.js.map +1 -0
- package/dist/{chunk-WSGKCBY5.js → chunk-52XO4ULK.js} +6 -9
- package/dist/chunk-52XO4ULK.js.map +1 -0
- package/dist/{chunk-AMNCCZSG.js → chunk-6G3KZSO4.js} +82 -63
- package/dist/chunk-6G3KZSO4.js.map +1 -0
- package/dist/{chunk-LESHL6SM.js → chunk-6OWHQ7HM.js} +21 -13
- package/dist/chunk-6OWHQ7HM.js.map +1 -0
- package/dist/{chunk-X3SZIBVW.js → chunk-7FMEMXJ4.js} +71 -71
- package/dist/chunk-7FMEMXJ4.js.map +1 -0
- package/dist/{chunk-I52THVF6.js → chunk-AJJJE7F7.js} +2 -2
- package/dist/{chunk-ZML3OCYA.js → chunk-AX3SZZWA.js} +2 -2
- package/dist/{chunk-NJVJ7VO5.js → chunk-BFD5NZQ4.js} +5 -4
- package/dist/chunk-BFD5NZQ4.js.map +1 -0
- package/dist/{chunk-GSPPOXMG.js → chunk-BKJHAJQW.js} +2 -2
- package/dist/{chunk-GSPPOXMG.js.map → chunk-BKJHAJQW.js.map} +1 -1
- package/dist/{chunk-FPTUCWBY.js → chunk-BMJZBLP7.js} +46 -30
- package/dist/chunk-BMJZBLP7.js.map +1 -0
- package/dist/chunk-BNQ5O6LE.js +74 -0
- package/dist/chunk-BNQ5O6LE.js.map +1 -0
- package/dist/{chunk-W62XVWXB.js → chunk-C577AJE7.js} +3 -3
- package/dist/chunk-CIG7IKX3.js +118 -0
- package/dist/chunk-CIG7IKX3.js.map +1 -0
- package/dist/chunk-EC3UJRKZ.js +1534 -0
- package/dist/chunk-EC3UJRKZ.js.map +1 -0
- package/dist/{chunk-IS7GP6XC.js → chunk-EMIUPGPL.js} +57 -52
- package/dist/chunk-EMIUPGPL.js.map +1 -0
- package/dist/chunk-G6WHCALR.js +593 -0
- package/dist/chunk-G6WHCALR.js.map +1 -0
- package/dist/{chunk-OTTITQ7C.js → chunk-H7WJK7NJ.js} +48 -95
- package/dist/chunk-H7WJK7NJ.js.map +1 -0
- package/dist/chunk-HGTC76BX.js +16 -0
- package/dist/chunk-HGTC76BX.js.map +1 -0
- package/dist/{chunk-G5OZQ376.js → chunk-K6OLORQL.js} +6 -6
- package/dist/{chunk-OHDEJEYB.js → chunk-KIWFEBKH.js} +41 -11
- package/dist/chunk-KIWFEBKH.js.map +1 -0
- package/dist/{chunk-YMUWTPOM.js → chunk-LWXRUR6B.js} +92 -100
- package/dist/chunk-LWXRUR6B.js.map +1 -0
- package/dist/{chunk-U2AEK4ZL.js → chunk-MGNYPVOJ.js} +2 -2
- package/dist/chunk-MKCHLXMY.js +40 -0
- package/dist/chunk-MKCHLXMY.js.map +1 -0
- package/dist/{chunk-37QYD33C.js → chunk-MMFQNJPE.js} +2 -2
- package/dist/{chunk-DG2U2WY3.js → chunk-MR6OBL3B.js} +3 -11
- package/dist/{chunk-DG2U2WY3.js.map → chunk-MR6OBL3B.js.map} +1 -1
- package/dist/{chunk-7IAKVZL5.js → chunk-O6BA7Q2B.js} +28 -59
- package/dist/chunk-O6BA7Q2B.js.map +1 -0
- package/dist/chunk-OCEFD7V6.js +201 -0
- package/dist/chunk-OCEFD7V6.js.map +1 -0
- package/dist/{chunk-YZTWZVGX.js → chunk-PUT7X3GA.js} +1 -1
- package/dist/chunk-PUT7X3GA.js.map +1 -0
- package/dist/chunk-RO6LX3UV.js +342 -0
- package/dist/chunk-RO6LX3UV.js.map +1 -0
- package/dist/{chunk-34BP5BC4.js → chunk-SDKCQXWE.js} +2 -2
- package/dist/{chunk-VBAAATPU.js → chunk-SEJF7CGJ.js} +41 -28
- package/dist/chunk-SEJF7CGJ.js.map +1 -0
- package/dist/{chunk-5O6GKXAN.js → chunk-SZRK3VOR.js} +24 -14
- package/dist/chunk-SZRK3VOR.js.map +1 -0
- package/dist/{chunk-5MN5S3DV.js → chunk-TC3NHO34.js} +22 -17
- package/dist/chunk-TC3NHO34.js.map +1 -0
- package/dist/{chunk-SPVSWDFM.js → chunk-TGLRDEEL.js} +8 -14
- package/dist/chunk-TGLRDEEL.js.map +1 -0
- package/dist/{chunk-P2SFRDWI.js → chunk-TZXYBG3R.js} +3634 -2875
- package/dist/chunk-TZXYBG3R.js.map +1 -0
- package/dist/{chunk-2BVZOYJP.js → chunk-VR3CDXDT.js} +2 -6
- package/dist/chunk-VR3CDXDT.js.map +1 -0
- package/dist/{chunk-KPJJOLAQ.js → chunk-WF6RM73R.js} +272 -40
- package/dist/chunk-WF6RM73R.js.map +1 -0
- package/dist/chunk-WYVDNGJB.js +31 -0
- package/dist/chunk-WYVDNGJB.js.map +1 -0
- package/dist/{chunk-F7KTUFGU.js → chunk-X5EG4EFP.js} +3 -2
- package/dist/chunk-X5EG4EFP.js.map +1 -0
- package/dist/{chunk-FHKNG3UA.js → chunk-XUDTFI4M.js} +2 -2
- package/dist/{chunk-AXV7NFFJ.js → chunk-YHCYKUA3.js} +14 -10
- package/dist/chunk-YHCYKUA3.js.map +1 -0
- package/dist/commands/build/marketplace.js +4 -4
- package/dist/commands/build/plugins.js +9 -7
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/build/stack.js +13 -10
- package/dist/commands/build/stack.js.map +1 -1
- package/dist/commands/compile.js +45 -72
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/config/index.js +7 -5
- package/dist/commands/config/index.js.map +1 -1
- package/dist/commands/config/path.js +8 -6
- package/dist/commands/config/path.js.map +1 -1
- package/dist/commands/config/show.js +7 -5
- package/dist/commands/diff.js +9 -7
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/doctor.js +20 -16
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +196 -94
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +20 -41
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/import/skill.js +10 -18
- package/dist/commands/import/skill.js.map +1 -1
- package/dist/commands/info.js +21 -20
- package/dist/commands/info.js.map +1 -1
- package/dist/commands/init.js +41 -435
- package/dist/commands/init.js.map +1 -1
- package/dist/commands/list.js +8 -6
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/agent.js +28 -15
- package/dist/commands/new/agent.js.map +1 -1
- package/dist/commands/new/marketplace.js +67 -31
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/new/skill.js +17 -208
- package/dist/commands/new/skill.js.map +1 -1
- package/dist/commands/outdated.js +16 -10
- package/dist/commands/outdated.js.map +1 -1
- package/dist/commands/search.js +45 -35
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/uninstall.js +93 -123
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +11 -9
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +42 -267
- package/dist/commands/validate.js.map +1 -1
- package/dist/components/common/confirm.test.js +4 -4
- package/dist/components/skill-search/skill-search.js +3 -3
- package/dist/components/wizard/category-grid.js +3 -2
- package/dist/components/wizard/category-grid.test.js +113 -59
- package/dist/components/wizard/category-grid.test.js.map +1 -1
- package/dist/components/wizard/checkbox-grid.js +5 -3
- package/dist/components/wizard/checkbox-grid.test.js +6 -5
- package/dist/components/wizard/checkbox-grid.test.js.map +1 -1
- package/dist/components/wizard/domain-selection.js +12 -9
- package/dist/components/wizard/help-modal.js +2 -2
- package/dist/components/wizard/menu-item.js +1 -1
- package/dist/components/wizard/search-modal.js +2 -2
- package/dist/components/wizard/search-modal.test.js +3 -3
- package/dist/components/wizard/search-modal.test.js.map +1 -1
- package/dist/components/wizard/section-progress.js +2 -2
- package/dist/components/wizard/section-progress.test.js +4 -4
- package/dist/components/wizard/section-progress.test.js.map +1 -1
- package/dist/components/wizard/selection-card.js +2 -2
- package/dist/components/wizard/source-grid.js +4 -3
- package/dist/components/wizard/source-grid.test.js +5 -4
- package/dist/components/wizard/source-grid.test.js.map +1 -1
- package/dist/components/wizard/stack-selection.js +9 -8
- package/dist/components/wizard/step-agents.js +11 -8
- package/dist/components/wizard/step-agents.test.js +20 -18
- package/dist/components/wizard/step-agents.test.js.map +1 -1
- package/dist/components/wizard/step-build.js +11 -8
- package/dist/components/wizard/step-build.test.js +18 -36
- package/dist/components/wizard/step-build.test.js.map +1 -1
- package/dist/components/wizard/step-confirm.js +4 -4
- package/dist/components/wizard/step-confirm.test.js +83 -23
- package/dist/components/wizard/step-confirm.test.js.map +1 -1
- package/dist/components/wizard/step-refine.js +2 -2
- package/dist/components/wizard/step-refine.test.js +3 -3
- package/dist/components/wizard/step-settings.js +9 -5
- package/dist/components/wizard/step-settings.test.js +13 -9
- package/dist/components/wizard/step-settings.test.js.map +1 -1
- package/dist/components/wizard/step-sources.js +13 -10
- package/dist/components/wizard/step-sources.test.js +19 -16
- package/dist/components/wizard/step-sources.test.js.map +1 -1
- package/dist/components/wizard/step-stack.js +16 -12
- package/dist/components/wizard/step-stack.test.js +18 -14
- package/dist/components/wizard/step-stack.test.js.map +1 -1
- package/dist/components/wizard/view-title.js +2 -2
- package/dist/components/wizard/wizard-layout.js +10 -8
- package/dist/components/wizard/wizard-tabs.js +2 -2
- package/dist/components/wizard/wizard-tabs.test.js +2 -2
- package/dist/components/wizard/wizard.js +29 -25
- package/dist/config-exports.js +20 -0
- package/dist/config-exports.js.map +1 -0
- package/dist/hooks/init.js +56 -3
- package/dist/hooks/init.js.map +1 -1
- package/dist/loader-2O32KKAQ.js +19 -0
- package/dist/source-loader-A6B3NDI4.js +16 -0
- package/dist/source-loader-A6B3NDI4.js.map +1 -0
- package/dist/source-manager-Q7IQSGIX.js +18 -0
- package/dist/source-manager-Q7IQSGIX.js.map +1 -0
- package/dist/src/agents/meta/agent-summoner/critical-reminders.md +1 -1
- package/dist/src/agents/meta/agent-summoner/critical-requirements.md +1 -1
- package/dist/src/agents/meta/agent-summoner/examples.md +2 -2
- package/dist/src/agents/meta/agent-summoner/output-format.md +1 -1
- package/dist/src/agents/meta/agent-summoner/workflow.md +8 -10
- package/{src/agents/meta/documentor/agent.yaml → dist/src/agents/meta/documentor/metadata.yaml} +1 -0
- package/dist/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
- package/dist/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
- package/dist/src/agents/meta/skill-summoner/intro.md +1 -1
- package/dist/src/agents/meta/skill-summoner/output-format.md +3 -3
- package/dist/src/agents/meta/skill-summoner/workflow.md +8 -8
- package/dist/stores/wizard-store.js +6 -5
- package/dist/stores/wizard-store.test.js +367 -75
- package/dist/stores/wizard-store.test.js.map +1 -1
- package/package.json +5 -1
- package/src/agents/meta/agent-summoner/critical-reminders.md +1 -1
- package/src/agents/meta/agent-summoner/critical-requirements.md +1 -1
- package/src/agents/meta/agent-summoner/examples.md +2 -2
- package/src/agents/meta/agent-summoner/output-format.md +1 -1
- package/src/agents/meta/agent-summoner/workflow.md +8 -10
- package/{dist/src/agents/meta/documentor/agent.yaml → src/agents/meta/documentor/metadata.yaml} +1 -0
- package/src/agents/meta/skill-summoner/critical-reminders.md +2 -2
- package/src/agents/meta/skill-summoner/critical-requirements.md +1 -1
- package/src/agents/meta/skill-summoner/intro.md +1 -1
- package/src/agents/meta/skill-summoner/output-format.md +3 -3
- package/src/agents/meta/skill-summoner/workflow.md +8 -8
- package/src/schemas/agent.schema.json +1 -1
- package/src/schemas/metadata.schema.json +6 -0
- package/src/schemas/project-config.schema.json +0 -3
- package/src/schemas/stacks.schema.json +1 -1
- package/config/skill-categories.yaml +0 -344
- package/config/skill-rules.yaml +0 -740
- package/config/stacks.yaml +0 -1865
- package/dist/chunk-2BVZOYJP.js.map +0 -1
- package/dist/chunk-2DNDAXF6.js.map +0 -1
- package/dist/chunk-5MN5S3DV.js.map +0 -1
- package/dist/chunk-5O6GKXAN.js.map +0 -1
- package/dist/chunk-7IAKVZL5.js.map +0 -1
- package/dist/chunk-AMNCCZSG.js.map +0 -1
- package/dist/chunk-AXV7NFFJ.js.map +0 -1
- package/dist/chunk-AXZNJ5PN.js +0 -99
- package/dist/chunk-AXZNJ5PN.js.map +0 -1
- package/dist/chunk-C7DLY64D.js +0 -115
- package/dist/chunk-C7DLY64D.js.map +0 -1
- package/dist/chunk-F7KTUFGU.js.map +0 -1
- package/dist/chunk-FPTUCWBY.js.map +0 -1
- package/dist/chunk-IS7GP6XC.js.map +0 -1
- package/dist/chunk-KPJJOLAQ.js.map +0 -1
- package/dist/chunk-LESHL6SM.js.map +0 -1
- package/dist/chunk-NJVJ7VO5.js.map +0 -1
- package/dist/chunk-OHDEJEYB.js.map +0 -1
- package/dist/chunk-OTTITQ7C.js.map +0 -1
- package/dist/chunk-P2SFRDWI.js.map +0 -1
- package/dist/chunk-PY2XZUBF.js +0 -29
- package/dist/chunk-PY2XZUBF.js.map +0 -1
- package/dist/chunk-SPVSWDFM.js.map +0 -1
- package/dist/chunk-VBAAATPU.js.map +0 -1
- package/dist/chunk-WSGKCBY5.js.map +0 -1
- package/dist/chunk-X3SZIBVW.js.map +0 -1
- package/dist/chunk-YDASDMTH.js +0 -183
- package/dist/chunk-YDASDMTH.js.map +0 -1
- package/dist/chunk-YMUWTPOM.js.map +0 -1
- package/dist/chunk-YZTWZVGX.js.map +0 -1
- package/dist/commands/config/get.js +0 -61
- package/dist/commands/config/get.js.map +0 -1
- package/dist/commands/config/set-project.js +0 -61
- package/dist/commands/config/set-project.js.map +0 -1
- package/dist/commands/config/unset-project.js +0 -57
- package/dist/commands/config/unset-project.js.map +0 -1
- package/dist/config/skill-categories.yaml +0 -344
- package/dist/config/skill-rules.yaml +0 -740
- package/dist/config/stacks.yaml +0 -1865
- package/dist/source-manager-Y7R6WPOW.js +0 -16
- package/dist/src/agents/migration/cli-migrator/agent.yaml +0 -12
- package/dist/src/agents/migration/cli-migrator/anti-patterns.md +0 -158
- package/dist/src/agents/migration/cli-migrator/conversion-mappings.md +0 -63
- package/dist/src/agents/migration/cli-migrator/critical-reminders.md +0 -17
- package/dist/src/agents/migration/cli-migrator/critical-requirements.md +0 -13
- package/dist/src/agents/migration/cli-migrator/intro.md +0 -15
- package/dist/src/agents/migration/cli-migrator/output-format.md +0 -164
- package/dist/src/agents/migration/cli-migrator/workflow.md +0 -230
- package/src/agents/migration/cli-migrator/agent.yaml +0 -12
- package/src/agents/migration/cli-migrator/anti-patterns.md +0 -158
- package/src/agents/migration/cli-migrator/conversion-mappings.md +0 -63
- package/src/agents/migration/cli-migrator/critical-reminders.md +0 -17
- package/src/agents/migration/cli-migrator/critical-requirements.md +0 -13
- package/src/agents/migration/cli-migrator/intro.md +0 -15
- package/src/agents/migration/cli-migrator/output-format.md +0 -164
- package/src/agents/migration/cli-migrator/workflow.md +0 -230
- /package/dist/{chunk-I52THVF6.js.map → chunk-AJJJE7F7.js.map} +0 -0
- /package/dist/{chunk-ZML3OCYA.js.map → chunk-AX3SZZWA.js.map} +0 -0
- /package/dist/{chunk-W62XVWXB.js.map → chunk-C577AJE7.js.map} +0 -0
- /package/dist/{chunk-G5OZQ376.js.map → chunk-K6OLORQL.js.map} +0 -0
- /package/dist/{chunk-U2AEK4ZL.js.map → chunk-MGNYPVOJ.js.map} +0 -0
- /package/dist/{chunk-37QYD33C.js.map → chunk-MMFQNJPE.js.map} +0 -0
- /package/dist/{chunk-34BP5BC4.js.map → chunk-SDKCQXWE.js.map} +0 -0
- /package/dist/{chunk-FHKNG3UA.js.map → chunk-XUDTFI4M.js.map} +0 -0
- /package/dist/{source-manager-Y7R6WPOW.js.map → loader-2O32KKAQ.js.map} +0 -0
- /package/dist/src/agents/developer/api-developer/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/developer/cli-developer/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/developer/web-architecture/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/developer/web-developer/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/meta/agent-summoner/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/meta/skill-summoner/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/pattern/pattern-scout/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/pattern/web-pattern-critique/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/planning/web-pm/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/researcher/api-researcher/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/researcher/web-researcher/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/reviewer/api-reviewer/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/reviewer/cli-reviewer/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/reviewer/web-reviewer/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/tester/cli-tester/{agent.yaml → metadata.yaml} +0 -0
- /package/dist/src/agents/tester/web-tester/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/developer/api-developer/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/developer/cli-developer/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/developer/web-architecture/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/developer/web-developer/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/meta/agent-summoner/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/meta/skill-summoner/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/pattern/pattern-scout/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/pattern/web-pattern-critique/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/planning/web-pm/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/researcher/api-researcher/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/researcher/web-researcher/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/reviewer/api-reviewer/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/reviewer/cli-reviewer/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/reviewer/web-reviewer/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/tester/cli-tester/{agent.yaml → metadata.yaml} +0 -0
- /package/src/agents/tester/web-tester/{agent.yaml → metadata.yaml} +0 -0
package/dist/commands/edit.js
CHANGED
|
@@ -1,82 +1,95 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
getAgentDefinitions,
|
|
4
|
-
recompileAgents
|
|
5
|
-
} from "../chunk-AXV7NFFJ.js";
|
|
6
2
|
import {
|
|
7
3
|
Wizard
|
|
8
|
-
} from "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
15
|
-
import "../chunk-
|
|
16
|
-
import "../chunk-
|
|
4
|
+
} from "../chunk-6G3KZSO4.js";
|
|
5
|
+
import "../chunk-52M2XF3W.js";
|
|
6
|
+
import "../chunk-SZRK3VOR.js";
|
|
7
|
+
import "../chunk-MKCHLXMY.js";
|
|
8
|
+
import "../chunk-EMIUPGPL.js";
|
|
9
|
+
import "../chunk-MMFQNJPE.js";
|
|
10
|
+
import "../chunk-HGTC76BX.js";
|
|
11
|
+
import "../chunk-SEJF7CGJ.js";
|
|
12
|
+
import "../chunk-TC3NHO34.js";
|
|
17
13
|
import "../chunk-K77I4XGL.js";
|
|
18
|
-
import "../chunk-
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-F7KTUFGU.js";
|
|
21
|
-
import "../chunk-7IAKVZL5.js";
|
|
14
|
+
import "../chunk-KIWFEBKH.js";
|
|
15
|
+
import "../chunk-O6BA7Q2B.js";
|
|
22
16
|
import "../chunk-7SOPVGDV.js";
|
|
23
|
-
import "../chunk-
|
|
17
|
+
import "../chunk-SDKCQXWE.js";
|
|
24
18
|
import "../chunk-KUV24B5M.js";
|
|
25
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-BMJZBLP7.js";
|
|
20
|
+
import "../chunk-X5EG4EFP.js";
|
|
21
|
+
import "../chunk-H7WJK7NJ.js";
|
|
26
22
|
import "../chunk-GG4BSB6S.js";
|
|
27
|
-
import "../chunk-
|
|
28
|
-
import "../chunk-
|
|
29
|
-
import "../chunk-
|
|
30
|
-
import "../chunk-
|
|
31
|
-
import "../chunk-
|
|
23
|
+
import "../chunk-TGLRDEEL.js";
|
|
24
|
+
import "../chunk-BKJHAJQW.js";
|
|
25
|
+
import "../chunk-CIG7IKX3.js";
|
|
26
|
+
import "../chunk-WYVDNGJB.js";
|
|
27
|
+
import "../chunk-MGNYPVOJ.js";
|
|
28
|
+
import "../chunk-BNQ5O6LE.js";
|
|
29
|
+
import "../chunk-52XO4ULK.js";
|
|
30
|
+
import "../chunk-WF6RM73R.js";
|
|
31
|
+
import "../chunk-XUDTFI4M.js";
|
|
32
32
|
import "../chunk-U3IGFMCY.js";
|
|
33
33
|
import {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
} from "../chunk-
|
|
37
|
-
import "../chunk-KPJJOLAQ.js";
|
|
38
|
-
import "../chunk-C7DLY64D.js";
|
|
34
|
+
getAgentDefinitions,
|
|
35
|
+
recompileAgents
|
|
36
|
+
} from "../chunk-YHCYKUA3.js";
|
|
39
37
|
import {
|
|
40
38
|
ERROR_MESSAGES,
|
|
41
39
|
INFO_MESSAGES,
|
|
42
40
|
STATUS_MESSAGES
|
|
43
|
-
} from "../chunk-
|
|
41
|
+
} from "../chunk-MR6OBL3B.js";
|
|
44
42
|
import {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
43
|
+
buildAndMergeConfig,
|
|
44
|
+
claudePluginInstall,
|
|
45
|
+
claudePluginUninstall,
|
|
46
|
+
deleteLocalSkill,
|
|
47
|
+
deriveInstallMode,
|
|
50
48
|
detectInstallation,
|
|
49
|
+
detectMigrations,
|
|
51
50
|
discoverAllPluginSkills,
|
|
51
|
+
executeMigration,
|
|
52
52
|
getMarketplaceLabel,
|
|
53
53
|
loadProjectConfig,
|
|
54
54
|
loadSkillsMatrixFromSource,
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
migrateLocalSkillScope,
|
|
56
|
+
splitConfigByScope,
|
|
57
|
+
writeConfigFile
|
|
58
|
+
} from "../chunk-TZXYBG3R.js";
|
|
59
|
+
import "../chunk-OCEFD7V6.js";
|
|
60
|
+
import "../chunk-T4EXUIBY.js";
|
|
57
61
|
import {
|
|
58
|
-
|
|
59
|
-
|
|
62
|
+
BaseCommand,
|
|
63
|
+
EXIT_CODES
|
|
64
|
+
} from "../chunk-VR3CDXDT.js";
|
|
60
65
|
import {
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
disableBuffering,
|
|
67
|
+
drainBuffer,
|
|
68
|
+
enableBuffering,
|
|
69
|
+
getErrorMessage,
|
|
70
|
+
pushBufferMessage,
|
|
71
|
+
verbose
|
|
72
|
+
} from "../chunk-LWXRUR6B.js";
|
|
63
73
|
import {
|
|
64
74
|
ASCII_LOGO,
|
|
65
|
-
|
|
66
|
-
|
|
75
|
+
CLAUDE_SRC_DIR,
|
|
76
|
+
CLI_BIN_NAME,
|
|
77
|
+
GLOBAL_INSTALL_ROOT,
|
|
78
|
+
SOURCE_DISPLAY_NAMES,
|
|
79
|
+
STANDARD_FILES
|
|
80
|
+
} from "../chunk-6OWHQ7HM.js";
|
|
81
|
+
import "../chunk-EC3UJRKZ.js";
|
|
67
82
|
import {
|
|
68
83
|
init_esm_shims
|
|
69
84
|
} from "../chunk-DHET7RCE.js";
|
|
70
85
|
|
|
71
86
|
// src/cli/commands/edit.tsx
|
|
72
87
|
init_esm_shims();
|
|
88
|
+
import os from "os";
|
|
89
|
+
import path from "path";
|
|
73
90
|
import { Flags } from "@oclif/core";
|
|
74
91
|
import { render } from "ink";
|
|
75
92
|
import { jsx } from "react/jsx-runtime";
|
|
76
|
-
var SOURCE_DISPLAY_NAMES = {
|
|
77
|
-
public: "Public",
|
|
78
|
-
local: "Local"
|
|
79
|
-
};
|
|
80
93
|
function formatSourceDisplayName(sourceName) {
|
|
81
94
|
return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;
|
|
82
95
|
}
|
|
@@ -115,13 +128,16 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
115
128
|
exit: EXIT_CODES.ERROR
|
|
116
129
|
});
|
|
117
130
|
}
|
|
118
|
-
const projectDir =
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
const projectDir = installation.projectDir;
|
|
132
|
+
enableBuffering();
|
|
133
|
+
if (installation.projectDir === os.homedir()) {
|
|
134
|
+
pushBufferMessage(
|
|
135
|
+
"info",
|
|
136
|
+
"No project installation found. Using global installation from ~/.claude-src/"
|
|
137
|
+
);
|
|
138
|
+
}
|
|
124
139
|
let sourceResult;
|
|
140
|
+
let startupMessages = [];
|
|
125
141
|
try {
|
|
126
142
|
sourceResult = await loadSkillsMatrixFromSource({
|
|
127
143
|
sourceFlag: flags.source,
|
|
@@ -129,34 +145,36 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
129
145
|
forceRefresh: flags.refresh
|
|
130
146
|
});
|
|
131
147
|
const sourceInfo = sourceResult.isLocal ? "local" : sourceResult.sourceConfig.sourceOrigin;
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
`
|
|
148
|
+
pushBufferMessage(
|
|
149
|
+
"info",
|
|
150
|
+
`Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})`
|
|
135
151
|
);
|
|
136
152
|
} catch (error) {
|
|
153
|
+
disableBuffering();
|
|
137
154
|
this.handleError(error);
|
|
138
155
|
}
|
|
139
156
|
const projectConfig = await loadProjectConfig(projectDir);
|
|
140
|
-
this.log("Reading current skills...");
|
|
141
157
|
let currentSkillIds;
|
|
142
158
|
try {
|
|
143
159
|
const discoveredSkills = await discoverAllPluginSkills(projectDir);
|
|
144
160
|
currentSkillIds = Object.keys(discoveredSkills);
|
|
145
161
|
if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {
|
|
146
|
-
currentSkillIds = projectConfig.config.skills;
|
|
147
|
-
|
|
148
|
-
`);
|
|
162
|
+
currentSkillIds = projectConfig.config.skills.map((s) => s.id);
|
|
163
|
+
pushBufferMessage("info", `Found ${currentSkillIds.length} skills from project config`);
|
|
149
164
|
} else {
|
|
150
|
-
|
|
151
|
-
`);
|
|
165
|
+
pushBufferMessage("info", `Current plugin has ${currentSkillIds.length} skills`);
|
|
152
166
|
}
|
|
153
167
|
} catch (error) {
|
|
168
|
+
disableBuffering();
|
|
154
169
|
this.handleError(error);
|
|
155
170
|
}
|
|
171
|
+
startupMessages = drainBuffer();
|
|
172
|
+
disableBuffering();
|
|
156
173
|
let wizardResult = null;
|
|
157
174
|
const marketplaceLabel = getMarketplaceLabel(sourceResult);
|
|
158
|
-
const
|
|
159
|
-
const
|
|
175
|
+
const isGlobalDir = projectDir === GLOBAL_INSTALL_ROOT;
|
|
176
|
+
const lockedSkillIds = isGlobalDir ? void 0 : projectConfig?.config?.skills?.filter((s) => s.scope === "global").map((s) => s.id);
|
|
177
|
+
const lockedAgentNames = isGlobalDir ? void 0 : projectConfig?.config?.agents?.filter((a) => a.scope === "global").map((a) => a.name);
|
|
160
178
|
const { waitUntilExit } = render(
|
|
161
179
|
/* @__PURE__ */ jsx(
|
|
162
180
|
Wizard,
|
|
@@ -166,12 +184,14 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
166
184
|
marketplaceLabel,
|
|
167
185
|
logo: ASCII_LOGO,
|
|
168
186
|
initialStep: "build",
|
|
169
|
-
initialInstallMode,
|
|
170
|
-
initialExpertMode: projectConfig?.config?.expertMode,
|
|
171
187
|
initialDomains: projectConfig?.config?.domains,
|
|
172
188
|
initialAgents: projectConfig?.config?.selectedAgents,
|
|
173
189
|
installedSkillIds: currentSkillIds,
|
|
174
|
-
|
|
190
|
+
installedSkillConfigs: projectConfig?.config?.skills,
|
|
191
|
+
lockedSkillIds,
|
|
192
|
+
lockedAgentNames,
|
|
193
|
+
projectDir,
|
|
194
|
+
startupMessages,
|
|
175
195
|
onComplete: (result2) => {
|
|
176
196
|
wizardResult = result2;
|
|
177
197
|
},
|
|
@@ -193,30 +213,32 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
193
213
|
exit: EXIT_CODES.ERROR
|
|
194
214
|
});
|
|
195
215
|
}
|
|
196
|
-
const
|
|
197
|
-
const
|
|
216
|
+
const newSkillIds = result.skills.map((s) => s.id);
|
|
217
|
+
const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));
|
|
218
|
+
const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));
|
|
198
219
|
const sourceChanges = /* @__PURE__ */ new Map();
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
220
|
+
const scopeChanges = /* @__PURE__ */ new Map();
|
|
221
|
+
if (projectConfig?.config?.skills) {
|
|
222
|
+
for (const newSkill of result.skills) {
|
|
223
|
+
const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);
|
|
224
|
+
if (oldSkill && oldSkill.source !== newSkill.source) {
|
|
225
|
+
sourceChanges.set(newSkill.id, {
|
|
226
|
+
from: oldSkill.source,
|
|
227
|
+
to: newSkill.source
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
if (oldSkill && oldSkill.scope !== newSkill.scope) {
|
|
231
|
+
scopeChanges.set(newSkill.id, {
|
|
232
|
+
from: oldSkill.scope,
|
|
233
|
+
to: newSkill.scope
|
|
234
|
+
});
|
|
235
|
+
}
|
|
208
236
|
}
|
|
209
237
|
}
|
|
210
238
|
const hasSourceChanges = sourceChanges.size > 0;
|
|
239
|
+
const hasScopeChanges = scopeChanges.size > 0;
|
|
211
240
|
const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;
|
|
212
|
-
if (
|
|
213
|
-
this.log("\nWarnings:");
|
|
214
|
-
for (const warning of result.validation.warnings) {
|
|
215
|
-
this.warn(` ! ${warning.message}`);
|
|
216
|
-
}
|
|
217
|
-
this.log("");
|
|
218
|
-
}
|
|
219
|
-
if (!hasSkillChanges && !hasSourceChanges) {
|
|
241
|
+
if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges) {
|
|
220
242
|
this.log(INFO_MESSAGES.NO_CHANGES_MADE);
|
|
221
243
|
this.log("Plugin unchanged\n");
|
|
222
244
|
return;
|
|
@@ -235,34 +257,110 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
235
257
|
const toLabel = formatSourceDisplayName(change.to);
|
|
236
258
|
this.log(` ~ ${skillId} (${fromLabel} \u2192 ${toLabel})`);
|
|
237
259
|
}
|
|
260
|
+
for (const [skillId, change] of scopeChanges) {
|
|
261
|
+
const fromLabel = change.from === "global" ? "[G]" : "[P]";
|
|
262
|
+
const toLabel = change.to === "global" ? "[G]" : "[P]";
|
|
263
|
+
this.log(` ~ ${skillId} (${fromLabel} \u2192 ${toLabel})`);
|
|
264
|
+
}
|
|
238
265
|
this.log("");
|
|
266
|
+
const oldSkills = projectConfig?.config?.skills ?? [];
|
|
267
|
+
const migrationPlan = detectMigrations(oldSkills, result.skills);
|
|
268
|
+
const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;
|
|
269
|
+
if (hasMigrations) {
|
|
270
|
+
if (migrationPlan.toLocal.length > 0) {
|
|
271
|
+
this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);
|
|
272
|
+
for (const migration of migrationPlan.toLocal) {
|
|
273
|
+
this.log(` - ${migration.id}`);
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
if (migrationPlan.toPlugin.length > 0) {
|
|
277
|
+
this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);
|
|
278
|
+
for (const migration of migrationPlan.toPlugin) {
|
|
279
|
+
this.log(` - ${migration.id}`);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const migrationResult = await executeMigration(migrationPlan, projectDir, sourceResult);
|
|
283
|
+
for (const warning of migrationResult.warnings) {
|
|
284
|
+
this.warn(warning);
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
const migratedSkillIds = /* @__PURE__ */ new Set([
|
|
288
|
+
...migrationPlan.toLocal.map((m) => m.id),
|
|
289
|
+
...migrationPlan.toPlugin.map((m) => m.id)
|
|
290
|
+
]);
|
|
291
|
+
for (const [skillId, change] of scopeChanges) {
|
|
292
|
+
const skillConfig = result.skills.find((s) => s.id === skillId);
|
|
293
|
+
if (skillConfig?.source === "local") {
|
|
294
|
+
await migrateLocalSkillScope(skillId, change.from, projectDir);
|
|
295
|
+
} else if (sourceResult.marketplace && skillConfig) {
|
|
296
|
+
const oldPluginScope = change.from === "global" ? "user" : "project";
|
|
297
|
+
const newPluginScope = change.to === "global" ? "user" : "project";
|
|
298
|
+
try {
|
|
299
|
+
await claudePluginUninstall(skillId, oldPluginScope, projectDir);
|
|
300
|
+
const pluginRef = `${skillId}@${sourceResult.marketplace}`;
|
|
301
|
+
await claudePluginInstall(pluginRef, newPluginScope, projectDir);
|
|
302
|
+
} catch (error) {
|
|
303
|
+
this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
239
307
|
for (const [skillId, change] of sourceChanges) {
|
|
240
|
-
if (
|
|
241
|
-
|
|
308
|
+
if (migratedSkillIds.has(skillId)) {
|
|
309
|
+
continue;
|
|
242
310
|
}
|
|
243
|
-
if (change.
|
|
244
|
-
await
|
|
311
|
+
if (change.from === "local") {
|
|
312
|
+
await deleteLocalSkill(projectDir, skillId);
|
|
245
313
|
}
|
|
246
314
|
}
|
|
247
|
-
if (
|
|
315
|
+
if (sourceResult.marketplace) {
|
|
248
316
|
for (const skillId of addedSkills) {
|
|
317
|
+
const skillConfig = result.skills.find((s) => s.id === skillId);
|
|
318
|
+
if (!skillConfig || skillConfig.source === "local") continue;
|
|
249
319
|
const pluginRef = `${skillId}@${sourceResult.marketplace}`;
|
|
320
|
+
const pluginScope = skillConfig.scope === "global" ? "user" : "project";
|
|
250
321
|
this.log(`Installing plugin: ${pluginRef}...`);
|
|
251
322
|
try {
|
|
252
|
-
await claudePluginInstall(pluginRef,
|
|
323
|
+
await claudePluginInstall(pluginRef, pluginScope, projectDir);
|
|
253
324
|
} catch (error) {
|
|
254
325
|
this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);
|
|
255
326
|
}
|
|
256
327
|
}
|
|
257
328
|
for (const skillId of removedSkills) {
|
|
329
|
+
const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);
|
|
330
|
+
const pluginScope = oldSkill?.scope === "global" ? "user" : "project";
|
|
258
331
|
this.log(`Uninstalling plugin: ${skillId}...`);
|
|
259
332
|
try {
|
|
260
|
-
await claudePluginUninstall(skillId,
|
|
333
|
+
await claudePluginUninstall(skillId, pluginScope, projectDir);
|
|
261
334
|
} catch (error) {
|
|
262
335
|
this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);
|
|
263
336
|
}
|
|
264
337
|
}
|
|
265
338
|
}
|
|
339
|
+
const isGlobalContext = projectDir === GLOBAL_INSTALL_ROOT;
|
|
340
|
+
try {
|
|
341
|
+
const mergeResult = await buildAndMergeConfig(result, sourceResult, projectDir, flags.source);
|
|
342
|
+
if (isGlobalContext) {
|
|
343
|
+
await writeConfigFile(mergeResult.config, installation.configPath);
|
|
344
|
+
verbose(`Updated global config at ${installation.configPath}`);
|
|
345
|
+
} else {
|
|
346
|
+
const { global: globalConfig, project: projectSplitConfig } = splitConfigByScope(
|
|
347
|
+
mergeResult.config
|
|
348
|
+
);
|
|
349
|
+
const globalConfigPath = path.join(
|
|
350
|
+
GLOBAL_INSTALL_ROOT,
|
|
351
|
+
CLAUDE_SRC_DIR,
|
|
352
|
+
STANDARD_FILES.CONFIG_TS
|
|
353
|
+
);
|
|
354
|
+
await writeConfigFile(globalConfig, globalConfigPath);
|
|
355
|
+
verbose(`Updated global config at ${globalConfigPath}`);
|
|
356
|
+
await writeConfigFile(projectSplitConfig, installation.configPath, {
|
|
357
|
+
isProjectConfig: true
|
|
358
|
+
});
|
|
359
|
+
verbose(`Updated project config at ${installation.configPath}`);
|
|
360
|
+
}
|
|
361
|
+
} catch (error) {
|
|
362
|
+
this.warn(`Could not update config: ${getErrorMessage(error)}`);
|
|
363
|
+
}
|
|
266
364
|
let sourcePath;
|
|
267
365
|
this.log(
|
|
268
366
|
flags["agent-source"] ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS : STATUS_MESSAGES.LOADING_AGENT_PARTIALS
|
|
@@ -284,7 +382,8 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
284
382
|
sourcePath,
|
|
285
383
|
skills: recompileSkills,
|
|
286
384
|
projectDir,
|
|
287
|
-
outputDir: installation.agentsDir
|
|
385
|
+
outputDir: installation.agentsDir,
|
|
386
|
+
installMode: deriveInstallMode(result.skills)
|
|
288
387
|
});
|
|
289
388
|
if (recompileResult.failed.length > 0) {
|
|
290
389
|
this.log(
|
|
@@ -309,6 +408,9 @@ var Edit = class _Edit extends BaseCommand {
|
|
|
309
408
|
if (hasSourceChanges) {
|
|
310
409
|
summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? "s" : ""} changed`);
|
|
311
410
|
}
|
|
411
|
+
if (hasScopeChanges) {
|
|
412
|
+
summaryParts.push(`${scopeChanges.size} scope${scopeChanges.size > 1 ? "s" : ""} changed`);
|
|
413
|
+
}
|
|
312
414
|
this.log(`
|
|
313
415
|
\u2713 Plugin updated! (${summaryParts.join(", ")})
|
|
314
416
|
`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/cli/commands/edit.tsx"],"sourcesContent":["import { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport { ASCII_LOGO, CLI_BIN_NAME } from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport { detectInstallation } from \"../lib/installation/index.js\";\nimport { getMarketplaceLabel, loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { archiveLocalSkill, restoreArchivedSkill } from \"../lib/skills/index.js\";\nimport type { SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { claudePluginInstall, claudePluginUninstall } from \"../utils/exec.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\nimport { typedEntries } from \"../utils/typed-object.js\";\n\nconst SOURCE_DISPLAY_NAMES: Record<string, string> = {\n public: \"Public\",\n local: \"Local\",\n};\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const projectDir = process.cwd();\n const isPluginMode = installation.mode === \"plugin\";\n\n const modeLabel = installation.mode === \"local\" ? \"Local\" : \"Plugin\";\n this.log(`Edit ${modeLabel} Skills\\n`);\n\n this.log(STATUS_MESSAGES.LOADING_MARKETPLACE_SOURCE);\n let sourceResult;\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n this.log(\n `✓ Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})\\n`,\n );\n } catch (error) {\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n this.log(\"Reading current skills...\");\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills;\n this.log(`✓ Found ${currentSkillIds.length} skills from project config\\n`);\n } else {\n this.log(`✓ Current plugin has ${currentSkillIds.length} skills\\n`);\n }\n } catch (error) {\n this.handleError(error);\n }\n\n let wizardResult: WizardResultV2 | null = null;\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n\n // Read saved installMode from config; fall back to marketplace-derived default only if absent\n const savedInstallMode = projectConfig?.config?.installMode;\n const initialInstallMode = savedInstallMode ?? (sourceResult.marketplace ? \"plugin\" : \"local\");\n\n const { waitUntilExit } = render(\n <Wizard\n matrix={sourceResult.matrix}\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n logo={ASCII_LOGO}\n initialStep=\"build\"\n initialInstallMode={initialInstallMode}\n initialExpertMode={projectConfig?.config?.expertMode}\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n projectDir={process.cwd()}\n onComplete={(result) => {\n wizardResult = result as WizardResultV2;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (!result.validation.valid) {\n const errorMessages = result.validation.errors.map((e) => e.message).join(\"\\n \");\n this.error(`Selection has validation errors:\\n ${errorMessages}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const addedSkills = result.selectedSkills.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !result.selectedSkills.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n for (const [skillId, selectedSource] of typedEntries<SkillId, string>(\n result.sourceSelections,\n )) {\n const skill = sourceResult.matrix.skills[skillId];\n if (skill?.activeSource && skill.activeSource.name !== selectedSource) {\n sourceChanges.set(skillId, {\n from: skill.activeSource.name,\n to: selectedSource,\n });\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (result.validation.warnings.length > 0) {\n this.log(\"\\nWarnings:\");\n for (const warning of result.validation.warnings) {\n this.warn(` ! ${warning.message}`);\n }\n this.log(\"\");\n }\n\n if (!hasSkillChanges && !hasSourceChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` + ${skill?.displayName || skillId}`);\n }\n for (const skillId of removedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` - ${skill?.displayName || skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n for (const [skillId, change] of sourceChanges) {\n if (change.from === \"local\") {\n await archiveLocalSkill(projectDir, skillId);\n }\n if (change.to === \"local\") {\n await restoreArchivedSkill(projectDir, skillId);\n }\n }\n\n if (isPluginMode && sourceResult.marketplace) {\n for (const skillId of addedSkills) {\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, \"project\", projectDir);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, \"project\", projectDir);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(projectDir);\n\n const recompileResult = await recompileAgents({\n pluginDir: projectDir,\n sourcePath,\n skills: recompileSkills,\n projectDir,\n outputDir: installation.agentsDir,\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,aAAa;AACtB,SAAS,cAAc;AAuHjB;AArGN,IAAM,uBAA+C;AAAA,EACnD,QAAQ;AAAA,EACR,OAAO;AACT;AAEA,SAAS,wBAAwB,YAA4B;AAC3D,SAAO,qBAAqB,UAAU,KAAK;AAC7C;AAEA,IAAqB,OAArB,MAAqB,cAAa,YAAY;AAAA,EAC5C,OAAO,UAAU;AAAA,EACjB,OAAO,cAAc;AAAA,EAErB,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,EACF;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,IACf,SAAS,MAAM,QAAQ;AAAA,MACrB,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,gBAAgB,MAAM,OAAO;AAAA,MAC3B,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,gBAAgB,SAAS,MAAM,YAAY,gBAAgB,OAAO,MAAM;AAAA;AAAA,QAC1F;AACA,mBAAW,WAAW,gBAAgB,UAAU;AAC9C,eAAK,KAAK,OAAO;AAAA,QACnB;AAAA,MACF,WAAW,gBAAgB,SAAS,SAAS,GAAG;AAC9C,aAAK,IAAI,qBAAgB,gBAAgB,SAAS,MAAM;AAAA,CAAW;AAAA,MACrE,OAAO;AACL,aAAK,IAAI,iCAA4B;AAAA,MACvC;AAAA,IACF,SAAS,OAAO;AACd,WAAK,KAAK,+BAA+B,gBAAgB,KAAK,CAAC,EAAE;AACjE,WAAK,IAAI,oCAAoC,YAAY;AAAA,CAAc;AAAA,IACzE;AAEA,UAAM,eAAe,CAAC,GAAG,YAAY,MAAM,UAAU,GAAG,cAAc,MAAM,UAAU;AACtF,QAAI,kBAAkB;AACpB,mBAAa,KAAK,GAAG,cAAc,IAAI,UAAU,cAAc,OAAO,IAAI,MAAM,EAAE,UAAU;AAAA,IAC9F;AACA,SAAK,IAAI;AAAA,0BAA6B,aAAa,KAAK,IAAI,CAAC;AAAA,CAAK;AAAA,EACpE;AACF;","names":["result"]}
|
|
1
|
+
{"version":3,"sources":["../../src/cli/commands/edit.tsx"],"sourcesContent":["import os from \"os\";\nimport path from \"path\";\n\nimport { Flags } from \"@oclif/core\";\nimport { render } from \"ink\";\n\nimport { BaseCommand } from \"../base-command.js\";\nimport { Wizard, type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport {\n ASCII_LOGO,\n CLI_BIN_NAME,\n CLAUDE_SRC_DIR,\n GLOBAL_INSTALL_ROOT,\n SOURCE_DISPLAY_NAMES,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { getAgentDefinitions, recompileAgents } from \"../lib/agents/index.js\";\nimport { splitConfigByScope } from \"../lib/configuration/config-generator.js\";\nimport { loadProjectConfig } from \"../lib/configuration/index.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport {\n detectInstallation,\n buildAndMergeConfig,\n writeConfigFile,\n detectMigrations,\n executeMigration,\n deriveInstallMode,\n} from \"../lib/installation/index.js\";\nimport { getMarketplaceLabel, loadSkillsMatrixFromSource } from \"../lib/loading/index.js\";\nimport { discoverAllPluginSkills } from \"../lib/plugins/index.js\";\nimport { deleteLocalSkill, migrateLocalSkillScope } from \"../lib/skills/index.js\";\nimport type { SkillId } from \"../types/index.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { claudePluginInstall, claudePluginUninstall } from \"../utils/exec.js\";\nimport {\n enableBuffering,\n drainBuffer,\n disableBuffering,\n pushBufferMessage,\n verbose,\n type StartupMessage,\n} from \"../utils/logger.js\";\nimport { ERROR_MESSAGES, INFO_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nfunction formatSourceDisplayName(sourceName: string): string {\n return SOURCE_DISPLAY_NAMES[sourceName] ?? sourceName;\n}\n\nexport default class Edit extends BaseCommand {\n static summary = \"Edit skills in the plugin\";\n static description = \"Modify the currently installed skills via interactive wizard\";\n\n static examples = [\n {\n description: \"Open the edit wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Edit with a custom source\",\n command: \"<%= config.bin %> <%= command.id %> --source github:org/marketplace\",\n },\n {\n description: \"Force refresh skills from remote\",\n command: \"<%= config.bin %> <%= command.id %> --refresh\",\n },\n ];\n\n static flags = {\n ...BaseCommand.baseFlags,\n refresh: Flags.boolean({\n description: \"Force refresh from remote sources\",\n default: false,\n }),\n \"agent-source\": Flags.string({\n description: \"Remote agent partials source (default: local CLI)\",\n }),\n };\n\n async run(): Promise<void> {\n const { flags } = await this.parse(Edit);\n\n const installation = await detectInstallation();\n\n if (!installation) {\n this.error(ERROR_MESSAGES.NO_INSTALLATION, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const projectDir = installation.projectDir;\n\n enableBuffering();\n\n if (installation.projectDir === os.homedir()) {\n pushBufferMessage(\n \"info\",\n \"No project installation found. Using global installation from ~/.claude-src/\",\n );\n }\n let sourceResult;\n let startupMessages: StartupMessage[] = [];\n try {\n sourceResult = await loadSkillsMatrixFromSource({\n sourceFlag: flags.source,\n projectDir,\n forceRefresh: flags.refresh,\n });\n\n const sourceInfo = sourceResult.isLocal ? \"local\" : sourceResult.sourceConfig.sourceOrigin;\n pushBufferMessage(\n \"info\",\n `Loaded ${Object.keys(sourceResult.matrix.skills).length} skills (${sourceInfo})`,\n );\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n const projectConfig = await loadProjectConfig(projectDir);\n\n let currentSkillIds: SkillId[];\n try {\n const discoveredSkills = await discoverAllPluginSkills(projectDir);\n // Boundary cast: discoverAllPluginSkills keys are skill IDs from frontmatter\n currentSkillIds = Object.keys(discoveredSkills) as SkillId[];\n\n // In local mode, plugin discovery returns empty — fall back to project config skills\n if (currentSkillIds.length === 0 && projectConfig?.config?.skills?.length) {\n currentSkillIds = projectConfig.config.skills.map((s) => s.id);\n pushBufferMessage(\"info\", `Found ${currentSkillIds.length} skills from project config`);\n } else {\n pushBufferMessage(\"info\", `Current plugin has ${currentSkillIds.length} skills`);\n }\n } catch (error) {\n disableBuffering();\n this.handleError(error);\n }\n\n startupMessages = drainBuffer();\n disableBuffering();\n\n let wizardResult: WizardResultV2 | null = null;\n const marketplaceLabel = getMarketplaceLabel(sourceResult);\n\n // D9: In project context, existing global items are read-only (locked).\n // When editing from ~/ (global context), nothing is locked.\n const isGlobalDir = projectDir === GLOBAL_INSTALL_ROOT;\n const lockedSkillIds = isGlobalDir\n ? undefined\n : projectConfig?.config?.skills?.filter((s) => s.scope === \"global\").map((s) => s.id);\n const lockedAgentNames = isGlobalDir\n ? undefined\n : projectConfig?.config?.agents?.filter((a) => a.scope === \"global\").map((a) => a.name);\n\n const { waitUntilExit } = render(\n <Wizard\n matrix={sourceResult.matrix}\n version={this.config.version}\n marketplaceLabel={marketplaceLabel}\n logo={ASCII_LOGO}\n initialStep=\"build\"\n initialDomains={projectConfig?.config?.domains}\n initialAgents={projectConfig?.config?.selectedAgents}\n installedSkillIds={currentSkillIds}\n installedSkillConfigs={projectConfig?.config?.skills}\n lockedSkillIds={lockedSkillIds}\n lockedAgentNames={lockedAgentNames}\n projectDir={projectDir}\n startupMessages={startupMessages}\n onComplete={(result) => {\n wizardResult = result as WizardResultV2;\n }}\n onCancel={() => {\n this.log(\"\\nEdit cancelled\");\n }}\n />,\n );\n\n await waitUntilExit();\n\n const result = wizardResult as WizardResultV2 | null;\n\n if (!result || result.cancelled) {\n this.error(\"Cancelled\", { exit: EXIT_CODES.CANCELLED });\n }\n\n if (!result.validation.valid) {\n const errorMessages = result.validation.errors.map((e) => e.message).join(\"\\n \");\n this.error(`Selection has validation errors:\\n ${errorMessages}`, {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n const newSkillIds = result.skills.map((s) => s.id);\n const addedSkills = newSkillIds.filter((id) => !currentSkillIds.includes(id));\n const removedSkills = currentSkillIds.filter((id) => !newSkillIds.includes(id));\n\n const sourceChanges = new Map<SkillId, { from: string; to: string }>();\n const scopeChanges = new Map<\n SkillId,\n { from: \"project\" | \"global\"; to: \"project\" | \"global\" }\n >();\n if (projectConfig?.config?.skills) {\n for (const newSkill of result.skills) {\n const oldSkill = projectConfig.config.skills.find((s) => s.id === newSkill.id);\n if (oldSkill && oldSkill.source !== newSkill.source) {\n sourceChanges.set(newSkill.id, {\n from: oldSkill.source,\n to: newSkill.source,\n });\n }\n if (oldSkill && oldSkill.scope !== newSkill.scope) {\n scopeChanges.set(newSkill.id, {\n from: oldSkill.scope,\n to: newSkill.scope,\n });\n }\n }\n }\n\n const hasSourceChanges = sourceChanges.size > 0;\n const hasScopeChanges = scopeChanges.size > 0;\n const hasSkillChanges = addedSkills.length > 0 || removedSkills.length > 0;\n\n if (!hasSkillChanges && !hasSourceChanges && !hasScopeChanges) {\n this.log(INFO_MESSAGES.NO_CHANGES_MADE);\n this.log(\"Plugin unchanged\\n\");\n return;\n }\n\n this.log(\"\\nChanges:\");\n for (const skillId of addedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` + ${skill?.displayName || skillId}`);\n }\n for (const skillId of removedSkills) {\n const skill = sourceResult.matrix.skills[skillId];\n this.log(` - ${skill?.displayName || skillId}`);\n }\n for (const [skillId, change] of sourceChanges) {\n const fromLabel = formatSourceDisplayName(change.from);\n const toLabel = formatSourceDisplayName(change.to);\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n for (const [skillId, change] of scopeChanges) {\n const fromLabel = change.from === \"global\" ? \"[G]\" : \"[P]\";\n const toLabel = change.to === \"global\" ? \"[G]\" : \"[P]\";\n this.log(` ~ ${skillId} (${fromLabel} \\u2192 ${toLabel})`);\n }\n this.log(\"\");\n\n // Handle per-skill mode migrations (local <-> plugin)\n const oldSkills = projectConfig?.config?.skills ?? [];\n const migrationPlan = detectMigrations(oldSkills, result.skills);\n const hasMigrations = migrationPlan.toLocal.length > 0 || migrationPlan.toPlugin.length > 0;\n\n if (hasMigrations) {\n if (migrationPlan.toLocal.length > 0) {\n this.log(`Switching ${migrationPlan.toLocal.length} skill(s) to local:`);\n for (const migration of migrationPlan.toLocal) {\n this.log(` - ${migration.id}`);\n }\n }\n if (migrationPlan.toPlugin.length > 0) {\n this.log(`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin:`);\n for (const migration of migrationPlan.toPlugin) {\n this.log(` - ${migration.id}`);\n }\n }\n\n const migrationResult = await executeMigration(migrationPlan, projectDir, sourceResult);\n\n for (const warning of migrationResult.warnings) {\n this.warn(warning);\n }\n }\n\n const migratedSkillIds = new Set([\n ...migrationPlan.toLocal.map((m) => m.id),\n ...migrationPlan.toPlugin.map((m) => m.id),\n ]);\n\n // Handle scope migrations (P→G or G→P) for local-mode skills\n for (const [skillId, change] of scopeChanges) {\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (skillConfig?.source === \"local\") {\n await migrateLocalSkillScope(skillId, change.from, projectDir);\n } else if (sourceResult.marketplace && skillConfig) {\n // Plugin-mode scope change: uninstall from old scope, install to new scope\n const oldPluginScope = change.from === \"global\" ? \"user\" : \"project\";\n const newPluginScope = change.to === \"global\" ? \"user\" : \"project\";\n try {\n await claudePluginUninstall(skillId, oldPluginScope, projectDir);\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n await claudePluginInstall(pluginRef, newPluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to migrate plugin scope for ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Handle remaining non-migration source changes (e.g., marketplace A -> marketplace B)\n for (const [skillId, change] of sourceChanges) {\n // Skip skills already handled by mode migration\n if (migratedSkillIds.has(skillId)) {\n continue;\n }\n if (change.from === \"local\") {\n await deleteLocalSkill(projectDir, skillId);\n }\n }\n\n if (sourceResult.marketplace) {\n for (const skillId of addedSkills) {\n // Find the skill config to get its scope\n const skillConfig = result.skills.find((s) => s.id === skillId);\n if (!skillConfig || skillConfig.source === \"local\") continue;\n\n const pluginRef = `${skillId}@${sourceResult.marketplace}`;\n const pluginScope = skillConfig.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Installing plugin: ${pluginRef}...`);\n try {\n await claudePluginInstall(pluginRef, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to install plugin ${pluginRef}: ${getErrorMessage(error)}`);\n }\n }\n for (const skillId of removedSkills) {\n // For removed skills, use old config to determine scope\n const oldSkill = projectConfig?.config?.skills?.find((s) => s.id === skillId);\n const pluginScope = oldSkill?.scope === \"global\" ? \"user\" : \"project\";\n this.log(`Uninstalling plugin: ${skillId}...`);\n try {\n await claudePluginUninstall(skillId, pluginScope, projectDir);\n } catch (error) {\n this.warn(`Failed to uninstall plugin ${skillId}: ${getErrorMessage(error)}`);\n }\n }\n }\n\n // Persist wizard result to config.ts (split by scope when in project context)\n const isGlobalContext = projectDir === GLOBAL_INSTALL_ROOT;\n try {\n const mergeResult = await buildAndMergeConfig(result, sourceResult, projectDir, flags.source);\n\n if (isGlobalContext) {\n // Editing from ~/ — write directly to global config (no import preamble)\n await writeConfigFile(mergeResult.config, installation.configPath);\n verbose(`Updated global config at ${installation.configPath}`);\n } else {\n // Editing from project — split by scope and write to both locations\n const { global: globalConfig, project: projectSplitConfig } = splitConfigByScope(\n mergeResult.config,\n );\n\n // Write global config to ~/.claude-src/config.ts\n const globalConfigPath = path.join(\n GLOBAL_INSTALL_ROOT,\n CLAUDE_SRC_DIR,\n STANDARD_FILES.CONFIG_TS,\n );\n await writeConfigFile(globalConfig, globalConfigPath);\n verbose(`Updated global config at ${globalConfigPath}`);\n\n // Write project config with import from global\n await writeConfigFile(projectSplitConfig, installation.configPath, {\n isProjectConfig: true,\n });\n verbose(`Updated project config at ${installation.configPath}`);\n }\n } catch (error) {\n this.warn(`Could not update config: ${getErrorMessage(error)}`);\n }\n\n let sourcePath: string;\n this.log(\n flags[\"agent-source\"]\n ? STATUS_MESSAGES.FETCHING_AGENT_PARTIALS\n : STATUS_MESSAGES.LOADING_AGENT_PARTIALS,\n );\n try {\n const agentDefs = await getAgentDefinitions(flags[\"agent-source\"], {\n forceRefresh: flags.refresh,\n });\n sourcePath = agentDefs.sourcePath;\n this.log(flags[\"agent-source\"] ? \"✓ Agent partials fetched\\n\" : \"✓ Agent partials loaded\\n\");\n } catch (error) {\n this.handleError(error);\n }\n\n this.log(STATUS_MESSAGES.RECOMPILING_AGENTS);\n try {\n const recompileSkills = await discoverAllPluginSkills(projectDir);\n\n const recompileResult = await recompileAgents({\n pluginDir: projectDir,\n sourcePath,\n skills: recompileSkills,\n projectDir,\n outputDir: installation.agentsDir,\n installMode: deriveInstallMode(result.skills),\n });\n\n if (recompileResult.failed.length > 0) {\n this.log(\n `✓ Recompiled ${recompileResult.compiled.length} agents (${recompileResult.failed.length} failed)\\n`,\n );\n for (const warning of recompileResult.warnings) {\n this.warn(warning);\n }\n } else if (recompileResult.compiled.length > 0) {\n this.log(`✓ Recompiled ${recompileResult.compiled.length} agents\\n`);\n } else {\n this.log(\"✓ No agents to recompile\\n\");\n }\n } catch (error) {\n this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);\n this.log(`You can manually recompile with '${CLI_BIN_NAME} compile'.\\n`);\n }\n\n const summaryParts = [`${addedSkills.length} added`, `${removedSkills.length} removed`];\n if (hasSourceChanges) {\n summaryParts.push(`${sourceChanges.size} source${sourceChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n if (hasScopeChanges) {\n summaryParts.push(`${scopeChanges.size} scope${scopeChanges.size > 1 ? \"s\" : \"\"} changed`);\n }\n this.log(`\\n\\u2713 Plugin updated! (${summaryParts.join(\", \")})\\n`);\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,OAAO,QAAQ;AACf,OAAO,UAAU;AAEjB,SAAS,aAAa;AACtB,SAAS,cAAc;AAuJjB;AA/GN,SAAS,wBAAwB,YAA4B;AAC3D,SAAO,qBAAqB,UAAU,KAAK;AAC7C;AAEA,IAAqB,OAArB,MAAqB,cAAa,YAAY;AAAA,EAC5C,OAAO,UAAU;AAAA,EACjB,OAAO,cAAc;AAAA,EAErB,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,EACF;AAAA,EAEA,OAAO,QAAQ;AAAA,IACb,GAAG,YAAY;AAAA,IACf,SAAS,MAAM,QAAQ;AAAA,MACrB,aAAa;AAAA,MACb,SAAS;AAAA,IACX,CAAC;AAAA,IACD,gBAAgB,MAAM,OAAO;AAAA,MAC3B,aAAa;AAAA,IACf,CAAC;AAAA,EACH;AAAA,EAEA,MAAM,MAAqB;AACzB,UAAM,EAAE,MAAM,IAAI,MAAM,KAAK,MAAM,KAAI;AAEvC,UAAM,eAAe,M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@@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
BaseCommand,
|
|
4
|
-
EXIT_CODES
|
|
5
|
-
} from "../chunk-2BVZOYJP.js";
|
|
6
2
|
import {
|
|
7
3
|
copySkillsToLocalFlattened,
|
|
8
4
|
loadProjectSourceConfig,
|
|
9
5
|
loadSkillsMatrixFromSource,
|
|
10
6
|
resolveSource,
|
|
11
7
|
saveSourceToProjectConfig
|
|
12
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-TZXYBG3R.js";
|
|
9
|
+
import "../chunk-OCEFD7V6.js";
|
|
13
10
|
import {
|
|
14
11
|
typedKeys
|
|
15
12
|
} from "../chunk-T4EXUIBY.js";
|
|
13
|
+
import {
|
|
14
|
+
BaseCommand,
|
|
15
|
+
EXIT_CODES
|
|
16
|
+
} from "../chunk-VR3CDXDT.js";
|
|
16
17
|
import {
|
|
17
18
|
copy,
|
|
18
19
|
directoryExists,
|
|
@@ -20,16 +21,16 @@ import {
|
|
|
20
21
|
fileExists,
|
|
21
22
|
listDirectories,
|
|
22
23
|
writeFile
|
|
23
|
-
} from "../chunk-
|
|
24
|
+
} from "../chunk-LWXRUR6B.js";
|
|
24
25
|
import {
|
|
25
26
|
CLAUDE_SRC_DIR,
|
|
26
27
|
DEFAULT_BRANDING,
|
|
27
28
|
DIRS,
|
|
28
29
|
LOCAL_SKILLS_PATH,
|
|
29
30
|
PROJECT_ROOT,
|
|
30
|
-
STANDARD_FILES
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
STANDARD_FILES
|
|
32
|
+
} from "../chunk-6OWHQ7HM.js";
|
|
33
|
+
import "../chunk-EC3UJRKZ.js";
|
|
33
34
|
import {
|
|
34
35
|
init_esm_shims
|
|
35
36
|
} from "../chunk-DHET7RCE.js";
|
|
@@ -39,7 +40,6 @@ init_esm_shims();
|
|
|
39
40
|
import { Args, Flags } from "@oclif/core";
|
|
40
41
|
import path from "path";
|
|
41
42
|
import os from "os";
|
|
42
|
-
import { stringify as stringifyYaml } from "yaml";
|
|
43
43
|
var EJECT_TYPES = ["agent-partials", "templates", "skills", "all"];
|
|
44
44
|
var Eject = class _Eject extends BaseCommand {
|
|
45
45
|
static summary = "Eject skills, agent partials, or templates for local customization";
|
|
@@ -162,23 +162,22 @@ var Eject = class _Eject extends BaseCommand {
|
|
|
162
162
|
}
|
|
163
163
|
if (flags.source) {
|
|
164
164
|
await saveSourceToProjectConfig(projectDir, flags.source);
|
|
165
|
-
this.log(`Source saved to .claude-src/config.
|
|
165
|
+
this.log(`Source saved to .claude-src/config.ts`);
|
|
166
166
|
}
|
|
167
167
|
await this.ensureMinimalConfig(projectDir, flags.source, sourceResult);
|
|
168
168
|
this.log("");
|
|
169
169
|
this.logSuccess("Eject complete!");
|
|
170
170
|
this.log("");
|
|
171
171
|
}
|
|
172
|
-
// Ensures a minimal config
|
|
172
|
+
// Ensures a minimal config exists so `agentsinc compile` works after eject
|
|
173
173
|
async ensureMinimalConfig(projectDir, sourceFlag, sourceResult) {
|
|
174
|
-
const
|
|
175
|
-
if (await fileExists(
|
|
174
|
+
const tsConfigPath = path.join(projectDir, CLAUDE_SRC_DIR, STANDARD_FILES.CONFIG_TS);
|
|
175
|
+
if (await fileExists(tsConfigPath)) {
|
|
176
176
|
return;
|
|
177
177
|
}
|
|
178
178
|
const projectName = path.basename(projectDir);
|
|
179
179
|
const config = {
|
|
180
|
-
name: projectName
|
|
181
|
-
installMode: "local"
|
|
180
|
+
name: projectName
|
|
182
181
|
};
|
|
183
182
|
const resolvedConfig = sourceResult?.sourceConfig ?? await resolveSource(sourceFlag, projectDir);
|
|
184
183
|
if (sourceFlag) {
|
|
@@ -197,32 +196,12 @@ var Eject = class _Eject extends BaseCommand {
|
|
|
197
196
|
config.agentsSource = existingProjectConfig.agentsSource;
|
|
198
197
|
}
|
|
199
198
|
await ensureDir(path.join(projectDir, CLAUDE_SRC_DIR));
|
|
200
|
-
|
|
201
|
-
const
|
|
202
|
-
|
|
203
|
-
#
|
|
204
|
-
# skills:
|
|
205
|
-
# - web-framework-react
|
|
206
|
-
# - web-styling-scss-modules
|
|
207
|
-
# - api-framework-hono
|
|
208
|
-
# - api-database-drizzle
|
|
209
|
-
#
|
|
210
|
-
# agents:
|
|
211
|
-
# - web-developer
|
|
212
|
-
# - api-developer
|
|
213
|
-
# - web-reviewer
|
|
214
|
-
#
|
|
215
|
-
# stack:
|
|
216
|
-
# web-developer:
|
|
217
|
-
# framework: web-framework-react
|
|
218
|
-
# styling: web-styling-scss-modules
|
|
219
|
-
# api-developer:
|
|
220
|
-
# api: api-framework-hono
|
|
221
|
-
# database: api-database-drizzle
|
|
199
|
+
const cleaned = JSON.parse(JSON.stringify(config));
|
|
200
|
+
const body = JSON.stringify(cleaned, null, 2);
|
|
201
|
+
const content = `export default ${body};
|
|
222
202
|
`;
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
this.logSuccess(`Created ${CLAUDE_SRC_DIR}/config.yaml`);
|
|
203
|
+
await writeFile(tsConfigPath, content);
|
|
204
|
+
this.logSuccess(`Created ${CLAUDE_SRC_DIR}/config.ts`);
|
|
226
205
|
}
|
|
227
206
|
async ejectAgentPartials(outputBase, force, directOutput = false, templatesFlag = false) {
|
|
228
207
|
const sourceDir = templatesFlag ? path.join(PROJECT_ROOT, DIRS.templates) : path.join(PROJECT_ROOT, DIRS.agents);
|