agents-inc 0.149.2 → 0.151.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 +2287 -0
- package/LICENSE +21 -0
- package/README.md +136 -19
- package/assets/demo.gif +0 -0
- package/assets/demo.tape +266 -0
- package/assets/logo.svg +75 -0
- package/dist/chunk-2RSNKBXC.js +84 -0
- package/dist/chunk-2RSNKBXC.js.map +1 -0
- package/dist/chunk-3LIU2ZEF.js +1355 -0
- package/dist/chunk-3LIU2ZEF.js.map +1 -0
- package/dist/chunk-3XFUQ6OL.js +68 -0
- package/dist/chunk-3XFUQ6OL.js.map +1 -0
- package/dist/chunk-3YGUHWLR.js +258 -0
- package/dist/chunk-3YGUHWLR.js.map +1 -0
- package/dist/chunk-44LLPS2N.js +1135 -0
- package/dist/chunk-44LLPS2N.js.map +1 -0
- package/dist/chunk-4R6PGHQQ.js +300 -0
- package/dist/chunk-4R6PGHQQ.js.map +1 -0
- package/dist/chunk-5V2O6C3T.js +112 -0
- package/dist/chunk-5V2O6C3T.js.map +1 -0
- package/dist/chunk-6RBQBOBS.js +287 -0
- package/dist/chunk-6RBQBOBS.js.map +1 -0
- package/dist/chunk-7QIHKQL5.js +181 -0
- package/dist/chunk-7QIHKQL5.js.map +1 -0
- package/dist/chunk-BNE4HHIH.js +28 -0
- package/dist/chunk-BNE4HHIH.js.map +1 -0
- package/dist/chunk-C55DN7GE.js +35 -0
- package/dist/chunk-C55DN7GE.js.map +1 -0
- package/dist/chunk-DAG2ULNF.js +125 -0
- package/dist/chunk-DAG2ULNF.js.map +1 -0
- package/dist/chunk-DG2NGZ7S.js +10929 -0
- package/dist/chunk-DG2NGZ7S.js.map +1 -0
- package/dist/chunk-DIBCRIMR.js +36 -0
- package/dist/chunk-DIBCRIMR.js.map +1 -0
- package/dist/chunk-DUVWGO6E.js +54 -0
- package/dist/chunk-DUVWGO6E.js.map +1 -0
- package/dist/chunk-EKWAUOQB.js +96 -0
- package/dist/chunk-EKWAUOQB.js.map +1 -0
- package/dist/chunk-ES3NJZON.js +31 -0
- package/dist/chunk-ES3NJZON.js.map +1 -0
- package/dist/chunk-EVXG3X6G.js +179 -0
- package/dist/chunk-EVXG3X6G.js.map +1 -0
- package/dist/chunk-EZ7STXUV.js +349 -0
- package/dist/chunk-EZ7STXUV.js.map +1 -0
- package/dist/chunk-FYPUUYSG.js +31 -0
- package/dist/chunk-FYPUUYSG.js.map +1 -0
- package/dist/chunk-GYG5SE2D.js +81 -0
- package/dist/chunk-GYG5SE2D.js.map +1 -0
- package/dist/chunk-I3XKEGHM.js +16383 -0
- package/dist/chunk-I3XKEGHM.js.map +1 -0
- package/dist/chunk-IHO75PMZ.js +40 -0
- package/dist/chunk-IHO75PMZ.js.map +1 -0
- package/dist/chunk-IOJR5TOY.js +47 -0
- package/dist/chunk-IOJR5TOY.js.map +1 -0
- package/dist/chunk-K3OU6TGX.js +77 -0
- package/dist/chunk-K3OU6TGX.js.map +1 -0
- package/dist/chunk-KIR7VYQD.js +63 -0
- package/dist/chunk-KIR7VYQD.js.map +1 -0
- package/dist/chunk-KOPEM3Q7.js +27 -0
- package/dist/chunk-KOPEM3Q7.js.map +1 -0
- package/dist/chunk-KSZ6PCY4.js +43 -0
- package/dist/chunk-KSZ6PCY4.js.map +1 -0
- package/dist/chunk-LAXAQ3PZ.js +235 -0
- package/dist/chunk-LAXAQ3PZ.js.map +1 -0
- package/dist/chunk-LYYXX2W5.js +87 -0
- package/dist/chunk-LYYXX2W5.js.map +1 -0
- package/dist/chunk-NGLQ5W7U.js +339 -0
- package/dist/chunk-NGLQ5W7U.js.map +1 -0
- package/dist/chunk-NHCGC6DG.js +111 -0
- package/dist/chunk-NHCGC6DG.js.map +1 -0
- package/dist/chunk-NIKUMXE7.js +24 -0
- package/dist/chunk-NIKUMXE7.js.map +1 -0
- package/dist/chunk-NM3EDGB5.js +300 -0
- package/dist/chunk-NM3EDGB5.js.map +1 -0
- package/dist/chunk-O5ASLZ2K.js +270 -0
- package/dist/chunk-O5ASLZ2K.js.map +1 -0
- package/dist/chunk-OJIESW5B.js +174 -0
- package/dist/chunk-OJIESW5B.js.map +1 -0
- package/dist/chunk-OZZGXBCN.js +15 -0
- package/dist/chunk-OZZGXBCN.js.map +1 -0
- package/dist/chunk-P3PN5SVI.js +27 -0
- package/dist/chunk-P3PN5SVI.js.map +1 -0
- package/dist/chunk-P56WJ5FA.js +50 -0
- package/dist/chunk-P56WJ5FA.js.map +1 -0
- package/dist/chunk-PG4G4IIK.js +24 -0
- package/dist/chunk-PG4G4IIK.js.map +1 -0
- package/dist/chunk-PV2HNW4I.js +382 -0
- package/dist/chunk-PV2HNW4I.js.map +1 -0
- package/dist/chunk-QQLRX4KI.js +41 -0
- package/dist/chunk-QQLRX4KI.js.map +1 -0
- package/dist/chunk-QTFQEYDA.js +789 -0
- package/dist/chunk-QTFQEYDA.js.map +1 -0
- package/dist/chunk-RBHYLCUB.js +31 -0
- package/dist/chunk-RBHYLCUB.js.map +1 -0
- package/dist/chunk-SHHOMVWC.js +62 -0
- package/dist/chunk-SHHOMVWC.js.map +1 -0
- package/dist/chunk-SI5FOARI.js +42 -0
- package/dist/chunk-SI5FOARI.js.map +1 -0
- package/dist/chunk-SYUOXSPU.js +510 -0
- package/dist/chunk-SYUOXSPU.js.map +1 -0
- package/dist/chunk-THKIOI32.js +939 -0
- package/dist/chunk-THKIOI32.js.map +1 -0
- package/dist/chunk-TVHRMRD3.js +6014 -0
- package/dist/chunk-TVHRMRD3.js.map +1 -0
- package/dist/chunk-TYJLR32W.js +128 -0
- package/dist/chunk-TYJLR32W.js.map +1 -0
- package/dist/chunk-UFURYGD3.js +20 -0
- package/dist/chunk-UFURYGD3.js.map +1 -0
- package/dist/chunk-UTFN6UJS.js +253 -0
- package/dist/chunk-UTFN6UJS.js.map +1 -0
- package/dist/chunk-V7QOSGQA.js +298 -0
- package/dist/chunk-V7QOSGQA.js.map +1 -0
- package/dist/chunk-VEP23B5W.js +27 -0
- package/dist/chunk-VEP23B5W.js.map +1 -0
- package/dist/chunk-VG2TVBFN.js +52 -0
- package/dist/chunk-VG2TVBFN.js.map +1 -0
- package/dist/chunk-WFWCZEMS.js +92 -0
- package/dist/chunk-WFWCZEMS.js.map +1 -0
- package/dist/chunk-WK4J2CHH.js +430 -0
- package/dist/chunk-WK4J2CHH.js.map +1 -0
- package/dist/chunk-XA57SX4T.js +115 -0
- package/dist/chunk-XA57SX4T.js.map +1 -0
- package/dist/chunk-Y4CXDA3I.js +181 -0
- package/dist/chunk-Y4CXDA3I.js.map +1 -0
- package/dist/chunk-YA4QQKKE.js +51 -0
- package/dist/chunk-YA4QQKKE.js.map +1 -0
- package/dist/chunk-YBVA7GPW.js +27 -0
- package/dist/chunk-YBVA7GPW.js.map +1 -0
- package/dist/chunk-YU2VGX5R.js +4205 -0
- package/dist/chunk-YU2VGX5R.js.map +1 -0
- package/dist/commands/build/marketplace.js +250 -0
- package/dist/commands/build/marketplace.js.map +1 -0
- package/dist/commands/build/plugins.js +176 -0
- package/dist/commands/build/plugins.js.map +1 -0
- package/dist/commands/compile.js +331 -0
- package/dist/commands/compile.js.map +1 -0
- package/dist/commands/doctor.js +475 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/edit.js +765 -0
- package/dist/commands/edit.js.map +1 -0
- package/dist/commands/eject.js +393 -0
- package/dist/commands/eject.js.map +1 -0
- package/dist/commands/import/skill.js +349 -0
- package/dist/commands/import/skill.js.map +1 -0
- package/dist/commands/init.js +66 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/commands/list.js +115 -0
- package/dist/commands/list.js.map +1 -0
- package/dist/commands/new/agent.js +304 -0
- package/dist/commands/new/agent.js.map +1 -0
- package/dist/commands/new/marketplace.js +315 -0
- package/dist/commands/new/marketplace.js.map +1 -0
- package/dist/commands/new/skill.js +28 -0
- package/dist/commands/new/skill.js.map +1 -0
- package/dist/commands/search.js +176 -0
- package/dist/commands/search.js.map +1 -0
- package/dist/commands/uninstall.js +570 -0
- package/dist/commands/uninstall.js.map +1 -0
- package/dist/commands/update.js +368 -0
- package/dist/commands/update.js.map +1 -0
- package/dist/commands/validate.js +581 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/components/common/confirm.js +9 -0
- package/dist/components/common/confirm.js.map +1 -0
- package/dist/components/common/confirm.test.js +203 -0
- package/dist/components/common/confirm.test.js.map +1 -0
- package/dist/components/common/prompt-confirm.js +11 -0
- package/dist/components/common/prompt-confirm.js.map +1 -0
- package/dist/components/common/select-list.js +11 -0
- package/dist/components/common/select-list.js.map +1 -0
- package/dist/components/common/spinner.js +9 -0
- package/dist/components/common/spinner.js.map +1 -0
- package/dist/components/wizard/category-grid.js +16 -0
- package/dist/components/wizard/category-grid.js.map +1 -0
- package/dist/components/wizard/category-grid.test.js +1253 -0
- package/dist/components/wizard/category-grid.test.js.map +1 -0
- package/dist/components/wizard/checkbox-grid.js +14 -0
- package/dist/components/wizard/checkbox-grid.js.map +1 -0
- package/dist/components/wizard/checkbox-grid.test.js +264 -0
- package/dist/components/wizard/checkbox-grid.test.js.map +1 -0
- package/dist/components/wizard/domain-selection.js +22 -0
- package/dist/components/wizard/domain-selection.js.map +1 -0
- package/dist/components/wizard/run-wizard-session.js +47 -0
- package/dist/components/wizard/run-wizard-session.js.map +1 -0
- package/dist/components/wizard/scroll-affordance.js +10 -0
- package/dist/components/wizard/scroll-affordance.js.map +1 -0
- package/dist/components/wizard/search-modal.js +14 -0
- package/dist/components/wizard/search-modal.js.map +1 -0
- package/dist/components/wizard/search-modal.test.js +212 -0
- package/dist/components/wizard/search-modal.test.js.map +1 -0
- package/dist/components/wizard/selection-card.js +10 -0
- package/dist/components/wizard/selection-card.js.map +1 -0
- package/dist/components/wizard/skill-agent-summary.js +16 -0
- package/dist/components/wizard/skill-agent-summary.js.map +1 -0
- package/dist/components/wizard/source-grid.js +23 -0
- package/dist/components/wizard/source-grid.js.map +1 -0
- package/dist/components/wizard/source-grid.test.js +1094 -0
- package/dist/components/wizard/source-grid.test.js.map +1 -0
- package/dist/components/wizard/stack-selection.js +20 -0
- package/dist/components/wizard/stack-selection.js.map +1 -0
- package/dist/components/wizard/step-agents.js +22 -0
- package/dist/components/wizard/step-agents.js.map +1 -0
- package/dist/components/wizard/step-agents.test.js +204 -0
- package/dist/components/wizard/step-agents.test.js.map +1 -0
- package/dist/components/wizard/step-build.js +22 -0
- package/dist/components/wizard/step-build.js.map +1 -0
- package/dist/components/wizard/step-build.test.js +552 -0
- package/dist/components/wizard/step-build.test.js.map +1 -0
- package/dist/components/wizard/step-confirm.js +21 -0
- package/dist/components/wizard/step-confirm.js.map +1 -0
- package/dist/components/wizard/step-confirm.test.js +744 -0
- package/dist/components/wizard/step-confirm.test.js.map +1 -0
- package/dist/components/wizard/step-settings.js +19 -0
- package/dist/components/wizard/step-settings.js.map +1 -0
- package/dist/components/wizard/step-settings.test.js +244 -0
- package/dist/components/wizard/step-settings.test.js.map +1 -0
- package/dist/components/wizard/step-sources.js +28 -0
- package/dist/components/wizard/step-sources.js.map +1 -0
- package/dist/components/wizard/step-sources.test.js +155 -0
- package/dist/components/wizard/step-sources.test.js.map +1 -0
- package/dist/components/wizard/step-stack.js +21 -0
- package/dist/components/wizard/step-stack.js.map +1 -0
- package/dist/components/wizard/step-stack.test.js +262 -0
- package/dist/components/wizard/step-stack.test.js.map +1 -0
- package/dist/components/wizard/summary-panel.js +20 -0
- package/dist/components/wizard/summary-panel.js.map +1 -0
- package/dist/components/wizard/summary-panel.test.js +317 -0
- package/dist/components/wizard/summary-panel.test.js.map +1 -0
- package/dist/components/wizard/toast.js +10 -0
- package/dist/components/wizard/toast.js.map +1 -0
- package/dist/components/wizard/wizard-layout.js +26 -0
- package/dist/components/wizard/wizard-layout.js.map +1 -0
- package/dist/components/wizard/wizard-layout.test.js +200 -0
- package/dist/components/wizard/wizard-layout.test.js.map +1 -0
- package/dist/components/wizard/wizard-tabs.js +20 -0
- package/dist/components/wizard/wizard-tabs.js.map +1 -0
- package/dist/components/wizard/wizard-tabs.test.js +290 -0
- package/dist/components/wizard/wizard-tabs.test.js.map +1 -0
- package/dist/components/wizard/wizard.js +48 -0
- package/dist/components/wizard/wizard.js.map +1 -0
- package/dist/config-exports.js +20 -0
- package/dist/config-exports.js.map +1 -0
- package/dist/copy-local-skills-UPA2GUZV.js +15 -0
- package/dist/copy-local-skills-UPA2GUZV.js.map +1 -0
- package/dist/dist-VNJNNJK7.js +550 -0
- package/dist/dist-VNJNNJK7.js.map +1 -0
- package/dist/hooks/init.js +90 -0
- package/dist/hooks/init.js.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/load-agent-defs-SB4XAOVB.js +16 -0
- package/dist/load-agent-defs-SB4XAOVB.js.map +1 -0
- package/dist/loader-E2ERJYVA.js +23 -0
- package/dist/loader-E2ERJYVA.js.map +1 -0
- package/dist/magic-string.es-5TV73NJD.js +1316 -0
- package/dist/magic-string.es-5TV73NJD.js.map +1 -0
- package/dist/recompile-project-agents-U4ZY2GDX.js +20 -0
- package/dist/recompile-project-agents-U4ZY2GDX.js.map +1 -0
- package/dist/source-loader-5UNRU7EZ.js +20 -0
- package/dist/source-loader-5UNRU7EZ.js.map +1 -0
- package/dist/source-manager-3O54SIIB.js +18 -0
- package/dist/source-manager-3O54SIIB.js.map +1 -0
- package/dist/src/agents/_templates/agent.liquid +161 -0
- package/dist/src/agents/_templates/methodologies/anti-over-engineering.liquid +121 -0
- package/dist/src/agents/_templates/methodologies/context-management.liquid +162 -0
- package/dist/src/agents/_templates/methodologies/improvement-protocol.liquid +150 -0
- package/dist/src/agents/_templates/methodologies/investigation-requirements.liquid +49 -0
- package/dist/src/agents/_templates/methodologies/success-criteria.liquid +111 -0
- package/dist/src/agents/_templates/methodologies/write-verification.liquid +43 -0
- package/dist/src/agents/developer/ai-developer/critical-reminders.md +54 -0
- package/dist/src/agents/developer/ai-developer/critical-requirements.md +59 -0
- package/dist/src/agents/developer/ai-developer/identity.md +51 -0
- package/dist/src/agents/developer/ai-developer/metadata.yaml +12 -0
- package/dist/src/agents/developer/ai-developer/output.md +366 -0
- package/dist/src/agents/developer/ai-developer/playbook.md +335 -0
- package/dist/src/agents/developer/api-developer/critical-reminders.md +46 -0
- package/dist/src/agents/developer/api-developer/critical-requirements.md +44 -0
- package/dist/src/agents/developer/api-developer/identity.md +49 -0
- package/dist/src/agents/developer/api-developer/metadata.yaml +12 -0
- package/dist/src/agents/developer/api-developer/output.md +432 -0
- package/dist/src/agents/developer/api-developer/playbook.md +352 -0
- package/dist/src/agents/developer/cli-developer/critical-reminders.md +51 -0
- package/dist/src/agents/developer/cli-developer/critical-requirements.md +51 -0
- package/dist/src/agents/developer/cli-developer/identity.md +51 -0
- package/dist/src/agents/developer/cli-developer/metadata.yaml +12 -0
- package/dist/src/agents/developer/cli-developer/output.md +285 -0
- package/dist/src/agents/developer/cli-developer/playbook.md +386 -0
- package/dist/src/agents/developer/web-architecture/critical-reminders.md +48 -0
- package/dist/src/agents/developer/web-architecture/critical-requirements.md +65 -0
- package/dist/src/agents/developer/web-architecture/identity.md +64 -0
- package/dist/src/agents/developer/web-architecture/metadata.yaml +12 -0
- package/dist/src/agents/developer/web-architecture/output.md +449 -0
- package/dist/src/agents/developer/web-architecture/playbook.md +481 -0
- package/dist/src/agents/developer/web-developer/critical-reminders.md +40 -0
- package/dist/src/agents/developer/web-developer/critical-requirements.md +39 -0
- package/dist/src/agents/developer/web-developer/identity.md +32 -0
- package/dist/src/agents/developer/web-developer/metadata.yaml +12 -0
- package/dist/src/agents/developer/web-developer/output.md +323 -0
- package/dist/src/agents/developer/web-developer/playbook.md +349 -0
- package/dist/src/agents/meta/agent-summoner/critical-reminders.md +45 -0
- package/dist/src/agents/meta/agent-summoner/critical-requirements.md +52 -0
- package/dist/src/agents/meta/agent-summoner/identity.md +34 -0
- package/dist/src/agents/meta/agent-summoner/metadata.yaml +12 -0
- package/dist/src/agents/meta/agent-summoner/output.md +296 -0
- package/dist/src/agents/meta/agent-summoner/playbook.md +1469 -0
- package/dist/src/agents/meta/codex-keeper/critical-reminders.md +39 -0
- package/dist/src/agents/meta/codex-keeper/critical-requirements.md +29 -0
- package/dist/src/agents/meta/codex-keeper/identity.md +45 -0
- package/dist/src/agents/meta/codex-keeper/metadata.yaml +12 -0
- package/dist/src/agents/meta/codex-keeper/output.md +384 -0
- package/dist/src/agents/meta/codex-keeper/playbook.md +1183 -0
- package/dist/src/agents/meta/convention-keeper/critical-reminders.md +32 -0
- package/dist/src/agents/meta/convention-keeper/critical-requirements.md +32 -0
- package/dist/src/agents/meta/convention-keeper/identity.md +33 -0
- package/dist/src/agents/meta/convention-keeper/metadata.yaml +12 -0
- package/dist/src/agents/meta/convention-keeper/output.md +206 -0
- package/dist/src/agents/meta/convention-keeper/playbook.md +180 -0
- package/dist/src/agents/meta/skill-summoner/critical-reminders.md +112 -0
- package/dist/src/agents/meta/skill-summoner/critical-requirements.md +62 -0
- package/dist/src/agents/meta/skill-summoner/identity.md +31 -0
- package/dist/src/agents/meta/skill-summoner/metadata.yaml +13 -0
- package/dist/src/agents/meta/skill-summoner/output.md +390 -0
- package/dist/src/agents/meta/skill-summoner/playbook.md +1457 -0
- package/dist/src/agents/pattern/pattern-scout/critical-reminders.md +71 -0
- package/dist/src/agents/pattern/pattern-scout/critical-requirements.md +31 -0
- package/dist/src/agents/pattern/pattern-scout/identity.md +25 -0
- package/dist/src/agents/pattern/pattern-scout/metadata.yaml +10 -0
- package/dist/src/agents/pattern/pattern-scout/output.md +290 -0
- package/dist/src/agents/pattern/pattern-scout/playbook.md +1806 -0
- package/dist/src/agents/pattern/web-pattern-critique/critical-reminders.md +30 -0
- package/dist/src/agents/pattern/web-pattern-critique/critical-requirements.md +28 -0
- package/dist/src/agents/pattern/web-pattern-critique/identity.md +41 -0
- package/dist/src/agents/pattern/web-pattern-critique/metadata.yaml +12 -0
- package/dist/src/agents/pattern/web-pattern-critique/output.md +314 -0
- package/dist/src/agents/pattern/web-pattern-critique/playbook.md +572 -0
- package/dist/src/agents/planning/api-pm/critical-reminders.md +48 -0
- package/dist/src/agents/planning/api-pm/critical-requirements.md +41 -0
- package/dist/src/agents/planning/api-pm/identity.md +39 -0
- package/dist/src/agents/planning/api-pm/metadata.yaml +12 -0
- package/dist/src/agents/planning/api-pm/output.md +475 -0
- package/dist/src/agents/planning/api-pm/playbook.md +129 -0
- package/dist/src/agents/planning/web-pm/critical-reminders.md +36 -0
- package/dist/src/agents/planning/web-pm/critical-requirements.md +32 -0
- package/dist/src/agents/planning/web-pm/identity.md +26 -0
- package/dist/src/agents/planning/web-pm/metadata.yaml +12 -0
- package/dist/src/agents/planning/web-pm/output.md +314 -0
- package/dist/src/agents/planning/web-pm/playbook.md +318 -0
- package/dist/src/agents/researcher/api-researcher/critical-reminders.md +27 -0
- package/dist/src/agents/researcher/api-researcher/critical-requirements.md +28 -0
- package/dist/src/agents/researcher/api-researcher/identity.md +71 -0
- package/dist/src/agents/researcher/api-researcher/metadata.yaml +10 -0
- package/dist/src/agents/researcher/api-researcher/output.md +254 -0
- package/dist/src/agents/researcher/api-researcher/playbook.md +201 -0
- package/dist/src/agents/researcher/web-researcher/critical-reminders.md +39 -0
- package/dist/src/agents/researcher/web-researcher/critical-requirements.md +26 -0
- package/dist/src/agents/researcher/web-researcher/identity.md +69 -0
- package/dist/src/agents/researcher/web-researcher/metadata.yaml +10 -0
- package/dist/src/agents/researcher/web-researcher/output.md +241 -0
- package/dist/src/agents/researcher/web-researcher/playbook.md +217 -0
- package/dist/src/agents/reviewer/ai-reviewer/critical-reminders.md +40 -0
- package/dist/src/agents/reviewer/ai-reviewer/critical-requirements.md +37 -0
- package/dist/src/agents/reviewer/ai-reviewer/identity.md +51 -0
- package/dist/src/agents/reviewer/ai-reviewer/metadata.yaml +10 -0
- package/dist/src/agents/reviewer/ai-reviewer/output.md +395 -0
- package/dist/src/agents/reviewer/ai-reviewer/playbook.md +90 -0
- package/dist/src/agents/reviewer/api-reviewer/critical-reminders.md +31 -0
- package/dist/src/agents/reviewer/api-reviewer/critical-requirements.md +27 -0
- package/dist/src/agents/reviewer/api-reviewer/identity.md +51 -0
- package/dist/src/agents/reviewer/api-reviewer/metadata.yaml +12 -0
- package/dist/src/agents/reviewer/api-reviewer/output.md +343 -0
- package/dist/src/agents/reviewer/api-reviewer/playbook.md +288 -0
- package/dist/src/agents/reviewer/cli-reviewer/critical-reminders.md +33 -0
- package/dist/src/agents/reviewer/cli-reviewer/critical-requirements.md +30 -0
- package/dist/src/agents/reviewer/cli-reviewer/identity.md +44 -0
- package/dist/src/agents/reviewer/cli-reviewer/metadata.yaml +12 -0
- package/dist/src/agents/reviewer/cli-reviewer/output.md +414 -0
- package/dist/src/agents/reviewer/cli-reviewer/playbook.md +218 -0
- package/dist/src/agents/reviewer/infra-reviewer/critical-reminders.md +38 -0
- package/dist/src/agents/reviewer/infra-reviewer/critical-requirements.md +38 -0
- package/dist/src/agents/reviewer/infra-reviewer/identity.md +53 -0
- package/dist/src/agents/reviewer/infra-reviewer/metadata.yaml +10 -0
- package/dist/src/agents/reviewer/infra-reviewer/output.md +364 -0
- package/dist/src/agents/reviewer/infra-reviewer/playbook.md +161 -0
- package/dist/src/agents/reviewer/web-reviewer/critical-reminders.md +31 -0
- package/dist/src/agents/reviewer/web-reviewer/critical-requirements.md +26 -0
- package/dist/src/agents/reviewer/web-reviewer/identity.md +40 -0
- package/dist/src/agents/reviewer/web-reviewer/metadata.yaml +12 -0
- package/dist/src/agents/reviewer/web-reviewer/output.md +333 -0
- package/dist/src/agents/reviewer/web-reviewer/playbook.md +156 -0
- package/dist/src/agents/tester/api-tester/critical-reminders.md +41 -0
- package/dist/src/agents/tester/api-tester/critical-requirements.md +41 -0
- package/dist/src/agents/tester/api-tester/identity.md +47 -0
- package/dist/src/agents/tester/api-tester/metadata.yaml +12 -0
- package/dist/src/agents/tester/api-tester/output.md +284 -0
- package/dist/src/agents/tester/api-tester/playbook.md +275 -0
- package/dist/src/agents/tester/cli-tester/critical-reminders.md +36 -0
- package/dist/src/agents/tester/cli-tester/critical-requirements.md +36 -0
- package/dist/src/agents/tester/cli-tester/identity.md +43 -0
- package/dist/src/agents/tester/cli-tester/metadata.yaml +12 -0
- package/dist/src/agents/tester/cli-tester/output.md +313 -0
- package/dist/src/agents/tester/cli-tester/playbook.md +221 -0
- package/dist/src/agents/tester/web-tester/critical-reminders.md +31 -0
- package/dist/src/agents/tester/web-tester/critical-requirements.md +28 -0
- package/dist/src/agents/tester/web-tester/identity.md +41 -0
- package/dist/src/agents/tester/web-tester/metadata.yaml +12 -0
- package/dist/src/agents/tester/web-tester/output.md +321 -0
- package/dist/src/agents/tester/web-tester/playbook.md +428 -0
- package/dist/stores/d227-same-scope-tombstone-duplicate.test.js +118 -0
- package/dist/stores/d227-same-scope-tombstone-duplicate.test.js.map +1 -0
- package/dist/stores/wizard-store.js +21 -0
- package/dist/stores/wizard-store.js.map +1 -0
- package/dist/stores/wizard-store.test.js +3053 -0
- package/dist/stores/wizard-store.test.js.map +1 -0
- package/package.json +130 -12
- package/src/agents/_templates/agent.liquid +161 -0
- package/src/agents/_templates/methodologies/anti-over-engineering.liquid +121 -0
- package/src/agents/_templates/methodologies/context-management.liquid +162 -0
- package/src/agents/_templates/methodologies/improvement-protocol.liquid +150 -0
- package/src/agents/_templates/methodologies/investigation-requirements.liquid +49 -0
- package/src/agents/_templates/methodologies/success-criteria.liquid +111 -0
- package/src/agents/_templates/methodologies/write-verification.liquid +43 -0
- package/src/agents/developer/ai-developer/critical-reminders.md +54 -0
- package/src/agents/developer/ai-developer/critical-requirements.md +59 -0
- package/src/agents/developer/ai-developer/identity.md +51 -0
- package/src/agents/developer/ai-developer/metadata.yaml +12 -0
- package/src/agents/developer/ai-developer/output.md +366 -0
- package/src/agents/developer/ai-developer/playbook.md +335 -0
- package/src/agents/developer/api-developer/critical-reminders.md +46 -0
- package/src/agents/developer/api-developer/critical-requirements.md +44 -0
- package/src/agents/developer/api-developer/identity.md +49 -0
- package/src/agents/developer/api-developer/metadata.yaml +12 -0
- package/src/agents/developer/api-developer/output.md +432 -0
- package/src/agents/developer/api-developer/playbook.md +352 -0
- package/src/agents/developer/cli-developer/critical-reminders.md +51 -0
- package/src/agents/developer/cli-developer/critical-requirements.md +51 -0
- package/src/agents/developer/cli-developer/identity.md +51 -0
- package/src/agents/developer/cli-developer/metadata.yaml +12 -0
- package/src/agents/developer/cli-developer/output.md +285 -0
- package/src/agents/developer/cli-developer/playbook.md +386 -0
- package/src/agents/developer/web-architecture/critical-reminders.md +48 -0
- package/src/agents/developer/web-architecture/critical-requirements.md +65 -0
- package/src/agents/developer/web-architecture/identity.md +64 -0
- package/src/agents/developer/web-architecture/metadata.yaml +12 -0
- package/src/agents/developer/web-architecture/output.md +449 -0
- package/src/agents/developer/web-architecture/playbook.md +481 -0
- package/src/agents/developer/web-developer/critical-reminders.md +40 -0
- package/src/agents/developer/web-developer/critical-requirements.md +39 -0
- package/src/agents/developer/web-developer/identity.md +32 -0
- package/src/agents/developer/web-developer/metadata.yaml +12 -0
- package/src/agents/developer/web-developer/output.md +323 -0
- package/src/agents/developer/web-developer/playbook.md +349 -0
- package/src/agents/meta/agent-summoner/critical-reminders.md +45 -0
- package/src/agents/meta/agent-summoner/critical-requirements.md +52 -0
- package/src/agents/meta/agent-summoner/identity.md +34 -0
- package/src/agents/meta/agent-summoner/metadata.yaml +12 -0
- package/src/agents/meta/agent-summoner/output.md +296 -0
- package/src/agents/meta/agent-summoner/playbook.md +1469 -0
- package/src/agents/meta/codex-keeper/critical-reminders.md +39 -0
- package/src/agents/meta/codex-keeper/critical-requirements.md +29 -0
- package/src/agents/meta/codex-keeper/identity.md +45 -0
- package/src/agents/meta/codex-keeper/metadata.yaml +12 -0
- package/src/agents/meta/codex-keeper/output.md +384 -0
- package/src/agents/meta/codex-keeper/playbook.md +1183 -0
- package/src/agents/meta/convention-keeper/critical-reminders.md +32 -0
- package/src/agents/meta/convention-keeper/critical-requirements.md +32 -0
- package/src/agents/meta/convention-keeper/identity.md +33 -0
- package/src/agents/meta/convention-keeper/metadata.yaml +12 -0
- package/src/agents/meta/convention-keeper/output.md +206 -0
- package/src/agents/meta/convention-keeper/playbook.md +180 -0
- package/src/agents/meta/skill-summoner/critical-reminders.md +112 -0
- package/src/agents/meta/skill-summoner/critical-requirements.md +62 -0
- package/src/agents/meta/skill-summoner/identity.md +31 -0
- package/src/agents/meta/skill-summoner/metadata.yaml +13 -0
- package/src/agents/meta/skill-summoner/output.md +390 -0
- package/src/agents/meta/skill-summoner/playbook.md +1457 -0
- package/src/agents/pattern/pattern-scout/critical-reminders.md +71 -0
- package/src/agents/pattern/pattern-scout/critical-requirements.md +31 -0
- package/src/agents/pattern/pattern-scout/identity.md +25 -0
- package/src/agents/pattern/pattern-scout/metadata.yaml +10 -0
- package/src/agents/pattern/pattern-scout/output.md +290 -0
- package/src/agents/pattern/pattern-scout/playbook.md +1806 -0
- package/src/agents/pattern/web-pattern-critique/critical-reminders.md +30 -0
- package/src/agents/pattern/web-pattern-critique/critical-requirements.md +28 -0
- package/src/agents/pattern/web-pattern-critique/identity.md +41 -0
- package/src/agents/pattern/web-pattern-critique/metadata.yaml +12 -0
- package/src/agents/pattern/web-pattern-critique/output.md +314 -0
- package/src/agents/pattern/web-pattern-critique/playbook.md +572 -0
- package/src/agents/planning/api-pm/critical-reminders.md +48 -0
- package/src/agents/planning/api-pm/critical-requirements.md +41 -0
- package/src/agents/planning/api-pm/identity.md +39 -0
- package/src/agents/planning/api-pm/metadata.yaml +12 -0
- package/src/agents/planning/api-pm/output.md +475 -0
- package/src/agents/planning/api-pm/playbook.md +129 -0
- package/src/agents/planning/web-pm/critical-reminders.md +36 -0
- package/src/agents/planning/web-pm/critical-requirements.md +32 -0
- package/src/agents/planning/web-pm/identity.md +26 -0
- package/src/agents/planning/web-pm/metadata.yaml +12 -0
- package/src/agents/planning/web-pm/output.md +314 -0
- package/src/agents/planning/web-pm/playbook.md +318 -0
- package/src/agents/researcher/api-researcher/critical-reminders.md +27 -0
- package/src/agents/researcher/api-researcher/critical-requirements.md +28 -0
- package/src/agents/researcher/api-researcher/identity.md +71 -0
- package/src/agents/researcher/api-researcher/metadata.yaml +10 -0
- package/src/agents/researcher/api-researcher/output.md +254 -0
- package/src/agents/researcher/api-researcher/playbook.md +201 -0
- package/src/agents/researcher/web-researcher/critical-reminders.md +39 -0
- package/src/agents/researcher/web-researcher/critical-requirements.md +26 -0
- package/src/agents/researcher/web-researcher/identity.md +69 -0
- package/src/agents/researcher/web-researcher/metadata.yaml +10 -0
- package/src/agents/researcher/web-researcher/output.md +241 -0
- package/src/agents/researcher/web-researcher/playbook.md +217 -0
- package/src/agents/reviewer/ai-reviewer/critical-reminders.md +40 -0
- package/src/agents/reviewer/ai-reviewer/critical-requirements.md +37 -0
- package/src/agents/reviewer/ai-reviewer/identity.md +51 -0
- package/src/agents/reviewer/ai-reviewer/metadata.yaml +10 -0
- package/src/agents/reviewer/ai-reviewer/output.md +395 -0
- package/src/agents/reviewer/ai-reviewer/playbook.md +90 -0
- package/src/agents/reviewer/api-reviewer/critical-reminders.md +31 -0
- package/src/agents/reviewer/api-reviewer/critical-requirements.md +27 -0
- package/src/agents/reviewer/api-reviewer/identity.md +51 -0
- package/src/agents/reviewer/api-reviewer/metadata.yaml +12 -0
- package/src/agents/reviewer/api-reviewer/output.md +343 -0
- package/src/agents/reviewer/api-reviewer/playbook.md +288 -0
- package/src/agents/reviewer/cli-reviewer/critical-reminders.md +33 -0
- package/src/agents/reviewer/cli-reviewer/critical-requirements.md +30 -0
- package/src/agents/reviewer/cli-reviewer/identity.md +44 -0
- package/src/agents/reviewer/cli-reviewer/metadata.yaml +12 -0
- package/src/agents/reviewer/cli-reviewer/output.md +414 -0
- package/src/agents/reviewer/cli-reviewer/playbook.md +218 -0
- package/src/agents/reviewer/infra-reviewer/critical-reminders.md +38 -0
- package/src/agents/reviewer/infra-reviewer/critical-requirements.md +38 -0
- package/src/agents/reviewer/infra-reviewer/identity.md +53 -0
- package/src/agents/reviewer/infra-reviewer/metadata.yaml +10 -0
- package/src/agents/reviewer/infra-reviewer/output.md +364 -0
- package/src/agents/reviewer/infra-reviewer/playbook.md +161 -0
- package/src/agents/reviewer/web-reviewer/critical-reminders.md +31 -0
- package/src/agents/reviewer/web-reviewer/critical-requirements.md +26 -0
- package/src/agents/reviewer/web-reviewer/identity.md +40 -0
- package/src/agents/reviewer/web-reviewer/metadata.yaml +12 -0
- package/src/agents/reviewer/web-reviewer/output.md +333 -0
- package/src/agents/reviewer/web-reviewer/playbook.md +156 -0
- package/src/agents/tester/api-tester/critical-reminders.md +41 -0
- package/src/agents/tester/api-tester/critical-requirements.md +41 -0
- package/src/agents/tester/api-tester/identity.md +47 -0
- package/src/agents/tester/api-tester/metadata.yaml +12 -0
- package/src/agents/tester/api-tester/output.md +284 -0
- package/src/agents/tester/api-tester/playbook.md +275 -0
- package/src/agents/tester/cli-tester/critical-reminders.md +36 -0
- package/src/agents/tester/cli-tester/critical-requirements.md +36 -0
- package/src/agents/tester/cli-tester/identity.md +43 -0
- package/src/agents/tester/cli-tester/metadata.yaml +12 -0
- package/src/agents/tester/cli-tester/output.md +313 -0
- package/src/agents/tester/cli-tester/playbook.md +221 -0
- package/src/agents/tester/web-tester/critical-reminders.md +31 -0
- package/src/agents/tester/web-tester/critical-requirements.md +28 -0
- package/src/agents/tester/web-tester/identity.md +41 -0
- package/src/agents/tester/web-tester/metadata.yaml +12 -0
- package/src/agents/tester/web-tester/output.md +321 -0
- package/src/agents/tester/web-tester/playbook.md +428 -0
- package/src/schemas/agent-frontmatter.schema.json +88 -0
- package/src/schemas/agent.schema.json +103 -0
- package/src/schemas/custom-metadata.schema.json +74 -0
- package/src/schemas/hooks.schema.json +47 -0
- package/src/schemas/marketplace.schema.json +119 -0
- package/src/schemas/metadata.schema.json +387 -0
- package/src/schemas/plugin.schema.json +127 -0
- package/src/schemas/project-config.schema.json +189 -0
- package/src/schemas/project-source-config.schema.json +96 -0
- package/src/schemas/skill-frontmatter.schema.json +42 -0
- package/src/schemas/stack.schema.json +191 -0
- package/src/schemas/stacks.schema.json +107 -0
- package/bin/run.js +0 -3
|
@@ -0,0 +1,765 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import {
|
|
3
|
+
runWizardSession
|
|
4
|
+
} from "../chunk-SI5FOARI.js";
|
|
5
|
+
import {
|
|
6
|
+
Spinner
|
|
7
|
+
} from "../chunk-OZZGXBCN.js";
|
|
8
|
+
import "../chunk-EZ7STXUV.js";
|
|
9
|
+
import "../chunk-UTFN6UJS.js";
|
|
10
|
+
import "../chunk-EVXG3X6G.js";
|
|
11
|
+
import "../chunk-OJIESW5B.js";
|
|
12
|
+
import "../chunk-UFURYGD3.js";
|
|
13
|
+
import "../chunk-RBHYLCUB.js";
|
|
14
|
+
import "../chunk-LAXAQ3PZ.js";
|
|
15
|
+
import "../chunk-NM3EDGB5.js";
|
|
16
|
+
import "../chunk-NHCGC6DG.js";
|
|
17
|
+
import "../chunk-BNE4HHIH.js";
|
|
18
|
+
import "../chunk-TYJLR32W.js";
|
|
19
|
+
import "../chunk-IOJR5TOY.js";
|
|
20
|
+
import "../chunk-3YGUHWLR.js";
|
|
21
|
+
import "../chunk-QQLRX4KI.js";
|
|
22
|
+
import "../chunk-WK4J2CHH.js";
|
|
23
|
+
import "../chunk-NIKUMXE7.js";
|
|
24
|
+
import "../chunk-KOPEM3Q7.js";
|
|
25
|
+
import "../chunk-2RSNKBXC.js";
|
|
26
|
+
import "../chunk-DUVWGO6E.js";
|
|
27
|
+
import "../chunk-KIR7VYQD.js";
|
|
28
|
+
import "../chunk-6RBQBOBS.js";
|
|
29
|
+
import "../chunk-LYYXX2W5.js";
|
|
30
|
+
import "../chunk-SHHOMVWC.js";
|
|
31
|
+
import "../chunk-YA4QQKKE.js";
|
|
32
|
+
import "../chunk-XA57SX4T.js";
|
|
33
|
+
import "../chunk-FYPUUYSG.js";
|
|
34
|
+
import "../chunk-DAG2ULNF.js";
|
|
35
|
+
import "../chunk-VG2TVBFN.js";
|
|
36
|
+
import "../chunk-IHO75PMZ.js";
|
|
37
|
+
import {
|
|
38
|
+
ERROR_MESSAGES,
|
|
39
|
+
STATUS_MESSAGES
|
|
40
|
+
} from "../chunk-GYG5SE2D.js";
|
|
41
|
+
import {
|
|
42
|
+
compileAgentsAllScopes,
|
|
43
|
+
detectProject,
|
|
44
|
+
loadSource,
|
|
45
|
+
writeProjectConfig
|
|
46
|
+
} from "../chunk-Y4CXDA3I.js";
|
|
47
|
+
import {
|
|
48
|
+
discoverInstalledSkills,
|
|
49
|
+
installPluginSkills,
|
|
50
|
+
pluginInstallFailureError,
|
|
51
|
+
uninstallPluginSkills
|
|
52
|
+
} from "../chunk-4R6PGHQQ.js";
|
|
53
|
+
import {
|
|
54
|
+
copyLocalSkills
|
|
55
|
+
} from "../chunk-3XFUQ6OL.js";
|
|
56
|
+
import {
|
|
57
|
+
loadAgentDefs
|
|
58
|
+
} from "../chunk-YBVA7GPW.js";
|
|
59
|
+
import "../chunk-NGLQ5W7U.js";
|
|
60
|
+
import "../chunk-5V2O6C3T.js";
|
|
61
|
+
import {
|
|
62
|
+
formatScopeTag
|
|
63
|
+
} from "../chunk-44LLPS2N.js";
|
|
64
|
+
import {
|
|
65
|
+
BaseCommand,
|
|
66
|
+
EXIT_CODES
|
|
67
|
+
} from "../chunk-7QIHKQL5.js";
|
|
68
|
+
import {
|
|
69
|
+
source_default
|
|
70
|
+
} from "../chunk-SYUOXSPU.js";
|
|
71
|
+
import "../chunk-P3PN5SVI.js";
|
|
72
|
+
import {
|
|
73
|
+
activeAgentScopeMap,
|
|
74
|
+
applyMigratedGlobalSources,
|
|
75
|
+
buildMarketplacePluginRef,
|
|
76
|
+
claudePluginInstall,
|
|
77
|
+
claudePluginUninstall,
|
|
78
|
+
deleteLocalSkill,
|
|
79
|
+
detectMigrations,
|
|
80
|
+
discoverAllPluginSkills,
|
|
81
|
+
executeMigration,
|
|
82
|
+
installBaseDir,
|
|
83
|
+
isActiveAt,
|
|
84
|
+
isHomeDirectory,
|
|
85
|
+
migrateLocalSkillScope,
|
|
86
|
+
mutateGlobal,
|
|
87
|
+
resolveInstallPaths,
|
|
88
|
+
toClaudePluginScope
|
|
89
|
+
} from "../chunk-TVHRMRD3.js";
|
|
90
|
+
import {
|
|
91
|
+
getErrorMessage,
|
|
92
|
+
remove
|
|
93
|
+
} from "../chunk-3LIU2ZEF.js";
|
|
94
|
+
import {
|
|
95
|
+
getSkillById,
|
|
96
|
+
getSkillDisplayName,
|
|
97
|
+
matrix
|
|
98
|
+
} from "../chunk-DG2NGZ7S.js";
|
|
99
|
+
import {
|
|
100
|
+
typedKeys
|
|
101
|
+
} from "../chunk-VEP23B5W.js";
|
|
102
|
+
import {
|
|
103
|
+
CLI_COLORS,
|
|
104
|
+
CLI_INVOKE_COMMAND,
|
|
105
|
+
EDIT_PROJECT_SETUP_FLAG,
|
|
106
|
+
EJECT_SOURCE,
|
|
107
|
+
formatSourceDisplayName
|
|
108
|
+
} from "../chunk-O5ASLZ2K.js";
|
|
109
|
+
import "../chunk-YU2VGX5R.js";
|
|
110
|
+
import {
|
|
111
|
+
init_esm_shims
|
|
112
|
+
} from "../chunk-P56WJ5FA.js";
|
|
113
|
+
|
|
114
|
+
// src/cli/commands/edit.tsx
|
|
115
|
+
init_esm_shims();
|
|
116
|
+
import path from "path";
|
|
117
|
+
import { Flags } from "@oclif/core";
|
|
118
|
+
import { render } from "ink";
|
|
119
|
+
import { difference, indexBy } from "remeda";
|
|
120
|
+
import { jsx } from "react/jsx-runtime";
|
|
121
|
+
function formatDualScopeTransition(displayName, to) {
|
|
122
|
+
const isAdd = to === "project";
|
|
123
|
+
const prefix = isAdd ? "+" : "-";
|
|
124
|
+
const color = isAdd ? CLI_COLORS.SUCCESS : CLI_COLORS.ERROR;
|
|
125
|
+
return source_default.hex(color)(` ${prefix} ${displayName} [P]`);
|
|
126
|
+
}
|
|
127
|
+
var Edit = class _Edit extends BaseCommand {
|
|
128
|
+
static summary = "Edit skills in the plugin";
|
|
129
|
+
static description = "Modify the currently installed skills via interactive wizard";
|
|
130
|
+
static examples = [
|
|
131
|
+
{
|
|
132
|
+
description: "Open the edit wizard",
|
|
133
|
+
command: "<%= config.bin %> <%= command.id %>"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
description: "Edit with a custom source",
|
|
137
|
+
command: "<%= config.bin %> <%= command.id %> --source github:org/marketplace"
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
description: "Force refresh skills from remote",
|
|
141
|
+
command: "<%= config.bin %> <%= command.id %> --refresh"
|
|
142
|
+
}
|
|
143
|
+
];
|
|
144
|
+
static flags = {
|
|
145
|
+
...BaseCommand.baseFlags,
|
|
146
|
+
refresh: Flags.boolean({
|
|
147
|
+
description: "Force refresh from remote sources",
|
|
148
|
+
default: false
|
|
149
|
+
}),
|
|
150
|
+
[EDIT_PROJECT_SETUP_FLAG]: Flags.boolean({
|
|
151
|
+
description: "Internal: this run continues an `init` project setup",
|
|
152
|
+
default: false,
|
|
153
|
+
hidden: true
|
|
154
|
+
})
|
|
155
|
+
};
|
|
156
|
+
async run() {
|
|
157
|
+
const { flags } = await this.parse(_Edit);
|
|
158
|
+
const cwd = process.cwd();
|
|
159
|
+
const { unmount, clear: clearSpinner } = render(
|
|
160
|
+
/* @__PURE__ */ jsx(Spinner, { label: STATUS_MESSAGES.LOADING_SKILLS })
|
|
161
|
+
);
|
|
162
|
+
const context = await this.loadContext(flags);
|
|
163
|
+
clearSpinner();
|
|
164
|
+
unmount();
|
|
165
|
+
const result = await this.runEditWizard(context, cwd);
|
|
166
|
+
if (!result) this.error("Cancelled", { exit: EXIT_CODES.CANCELLED });
|
|
167
|
+
this.reportValidationErrors(result);
|
|
168
|
+
const activeNewSkills = result.skills.filter((s) => !s.excluded);
|
|
169
|
+
const activeNewAgents = result.agentConfigs.filter((a) => !a.excluded);
|
|
170
|
+
const activeOldSkills = (context.projectConfig?.skills ?? []).filter((s) => !s.excluded);
|
|
171
|
+
const activeOldAgents = (context.projectConfig?.agents ?? []).filter((a) => !a.excluded);
|
|
172
|
+
const filteredResult = {
|
|
173
|
+
...result,
|
|
174
|
+
skills: activeNewSkills,
|
|
175
|
+
agentConfigs: activeNewAgents
|
|
176
|
+
};
|
|
177
|
+
const filteredOldConfig = context.projectConfig ? { ...context.projectConfig, skills: activeOldSkills, agents: activeOldAgents } : null;
|
|
178
|
+
const changes = detectConfigChanges(filteredOldConfig, filteredResult, {
|
|
179
|
+
newSkills: result.skills,
|
|
180
|
+
oldSkills: context.projectConfig?.skills ?? [],
|
|
181
|
+
newAgents: result.agentConfigs,
|
|
182
|
+
oldAgents: context.projectConfig?.agents ?? []
|
|
183
|
+
});
|
|
184
|
+
const isProjectSetup = flags[EDIT_PROJECT_SETUP_FLAG] && !isHomeDirectory(cwd);
|
|
185
|
+
if (!hasAnyChanges(changes)) {
|
|
186
|
+
this.log(source_default.hex(CLI_COLORS.NEUTRAL)("No changes made."));
|
|
187
|
+
if (!isProjectSetup) return;
|
|
188
|
+
await this.writeConfigAndCompile(result, context, flags, cwd);
|
|
189
|
+
this.logCompletionSummary(changes);
|
|
190
|
+
return;
|
|
191
|
+
}
|
|
192
|
+
this.logChangeSummary(changes, filteredResult.skills, filteredOldConfig?.skills ?? []);
|
|
193
|
+
const migratedSkillIds = await this.applyMigrations(
|
|
194
|
+
changes,
|
|
195
|
+
filteredResult,
|
|
196
|
+
activeOldSkills,
|
|
197
|
+
context,
|
|
198
|
+
cwd
|
|
199
|
+
);
|
|
200
|
+
await this.recordGlobalSourceMigrations(migratedSkillIds, filteredResult.skills, cwd, context);
|
|
201
|
+
await this.applyScopeChanges(changes, filteredResult, context, cwd);
|
|
202
|
+
await this.applySourceChanges(changes, activeOldSkills, cwd, migratedSkillIds);
|
|
203
|
+
await this.applyPluginChanges(changes, filteredResult, activeOldSkills, context, cwd);
|
|
204
|
+
await this.copyNewLocalSkills(changes, filteredResult, context, cwd);
|
|
205
|
+
await this.removeDeletedLocalSkills(changes, activeOldSkills, cwd);
|
|
206
|
+
await this.writeConfigAndCompile(result, context, flags, cwd);
|
|
207
|
+
await this.cleanupStaleAgentFiles(changes, activeOldAgents, cwd);
|
|
208
|
+
this.logCompletionSummary(changes);
|
|
209
|
+
}
|
|
210
|
+
async loadContext(flags) {
|
|
211
|
+
const detected = await detectProject();
|
|
212
|
+
if (!detected) {
|
|
213
|
+
this.error(ERROR_MESSAGES.NO_INSTALLATION, {
|
|
214
|
+
exit: EXIT_CODES.ERROR
|
|
215
|
+
});
|
|
216
|
+
}
|
|
217
|
+
const { installation, config: projectConfig } = detected;
|
|
218
|
+
const projectDir = installation.projectDir;
|
|
219
|
+
let sourceResult;
|
|
220
|
+
let startupMessages = [];
|
|
221
|
+
try {
|
|
222
|
+
const loaded = await loadSource({
|
|
223
|
+
sourceFlag: flags.source,
|
|
224
|
+
projectDir,
|
|
225
|
+
forceRefresh: flags.refresh,
|
|
226
|
+
captureStartupMessages: true
|
|
227
|
+
});
|
|
228
|
+
sourceResult = loaded.sourceResult;
|
|
229
|
+
startupMessages = loaded.startupMessages;
|
|
230
|
+
const sourceInfo = sourceResult.isLocal ? "local" : sourceResult.sourceConfig.sourceOrigin;
|
|
231
|
+
startupMessages.push({
|
|
232
|
+
level: "info",
|
|
233
|
+
text: `Loaded ${Object.keys(matrix.skills).length} skills (${sourceInfo})`
|
|
234
|
+
});
|
|
235
|
+
} catch (error) {
|
|
236
|
+
this.handleError(error);
|
|
237
|
+
}
|
|
238
|
+
let currentSkillIds;
|
|
239
|
+
try {
|
|
240
|
+
const discoveredSkills = await discoverAllPluginSkills(projectDir);
|
|
241
|
+
const pluginSkillIds = typedKeys(discoveredSkills);
|
|
242
|
+
const excludedConfigIds = new Set(
|
|
243
|
+
projectConfig?.skills?.filter((s) => s.excluded).map((s) => s.id) ?? []
|
|
244
|
+
);
|
|
245
|
+
const configSkillIds = projectConfig?.skills?.filter((s) => !s.excluded).map((s) => s.id) ?? [];
|
|
246
|
+
const filteredPluginSkillIds = pluginSkillIds.filter((id) => !excludedConfigIds.has(id));
|
|
247
|
+
const mergedIds = /* @__PURE__ */ new Set([...filteredPluginSkillIds, ...configSkillIds]);
|
|
248
|
+
currentSkillIds = [...mergedIds];
|
|
249
|
+
startupMessages.push({
|
|
250
|
+
level: "info",
|
|
251
|
+
text: `Found ${currentSkillIds.length} installed skills`
|
|
252
|
+
});
|
|
253
|
+
} catch (error) {
|
|
254
|
+
this.handleError(error);
|
|
255
|
+
}
|
|
256
|
+
return {
|
|
257
|
+
installation,
|
|
258
|
+
projectConfig,
|
|
259
|
+
projectDir,
|
|
260
|
+
sourceResult,
|
|
261
|
+
startupMessages,
|
|
262
|
+
currentSkillIds
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
async runEditWizard(context, cwd) {
|
|
266
|
+
const { projectConfig, projectDir, currentSkillIds } = context;
|
|
267
|
+
return runWizardSession({
|
|
268
|
+
hydrate: {
|
|
269
|
+
initialStep: "build",
|
|
270
|
+
initialDomains: projectConfig?.domains,
|
|
271
|
+
initialAgents: projectConfig?.selectedAgents,
|
|
272
|
+
installedSkillIds: currentSkillIds,
|
|
273
|
+
installedSkillConfigs: projectConfig?.skills,
|
|
274
|
+
installedAgentConfigs: projectConfig?.agents,
|
|
275
|
+
isEditingFromGlobalScope: isHomeDirectory(cwd)
|
|
276
|
+
},
|
|
277
|
+
props: {
|
|
278
|
+
version: this.config.version,
|
|
279
|
+
initialAgents: projectConfig?.selectedAgents,
|
|
280
|
+
installedSkillIds: currentSkillIds,
|
|
281
|
+
projectDir,
|
|
282
|
+
startupMessages: context.startupMessages
|
|
283
|
+
},
|
|
284
|
+
onCancel: () => this.log("\nEdit cancelled"),
|
|
285
|
+
clearTerminal: () => this.clearTerminal()
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
/**
|
|
289
|
+
* Records, in the GLOBAL config, the install-mode migrations this run already performed
|
|
290
|
+
* under `$HOME`.
|
|
291
|
+
*
|
|
292
|
+
* A project-context edit otherwise never writes global config (commit 403df46, "never
|
|
293
|
+
* modify global config from project-level operations"), and `authoritativeScope: "owned"`
|
|
294
|
+
* enforces that for the roster — an inherited global-active entry is read-only, so
|
|
295
|
+
* `mergeGlobalConfigs` preserves it verbatim. That protection is correct for selection and
|
|
296
|
+
* scope, but `executeMigration` resolves each skill's paths from ITS OWN scope: switching a
|
|
297
|
+
* global-scoped skill's source has already copied it under `$HOME` (or deleted it) and
|
|
298
|
+
* added/removed its user-scope plugin registration by the time the config is written.
|
|
299
|
+
* Leaving the global config alone there protects nothing — it only makes the recorded
|
|
300
|
+
* source contradict the filesystem and the plugin registry.
|
|
301
|
+
*
|
|
302
|
+
* So authority follows the work actually performed, and no further: only ids
|
|
303
|
+
* `executeMigration` acted on this run are rewritten, and only their `source` field. Global
|
|
304
|
+
* entries this session merely displayed, re-scoped or deselected are untouched, as are
|
|
305
|
+
* `marketplace`, `stack`, `agents` and every other registered project's view of them.
|
|
306
|
+
* Refusing the switch instead is not an option — driving a global-scope migration from a
|
|
307
|
+
* project directory is a supported flow (`scope-aware-local-copy` lifecycle tests).
|
|
308
|
+
*
|
|
309
|
+
* Runs BEFORE `writeConfigAndCompile`, so the global config written here is the one
|
|
310
|
+
* the wizard write reloads, keeps (existing wins in `mergeGlobalConfigs`) and inlines
|
|
311
|
+
* into the project config — both files then tell the same story. That second write
|
|
312
|
+
* classifies as a no-op against what this one left on disk, so the fan-out below
|
|
313
|
+
* happens once.
|
|
314
|
+
*
|
|
315
|
+
* The migrated `source` decides the reference form a compiled agent emits, so every
|
|
316
|
+
* OTHER registered project's config and agents are stale until this write fans out —
|
|
317
|
+
* which is why it goes through the gate rather than straight to the file.
|
|
318
|
+
*/
|
|
319
|
+
async recordGlobalSourceMigrations(migratedSkillIds, newSkills, cwd, context) {
|
|
320
|
+
if (isHomeDirectory(cwd)) return;
|
|
321
|
+
const migratedSources = new Map(
|
|
322
|
+
newSkills.filter((s) => migratedSkillIds.has(s.id) && isActiveAt(s, "global")).map((s) => [s.id, s.source])
|
|
323
|
+
);
|
|
324
|
+
if (migratedSources.size === 0) return;
|
|
325
|
+
try {
|
|
326
|
+
const report = await mutateGlobal(
|
|
327
|
+
{ kind: "migrate-skill-sources", sources: migratedSources },
|
|
328
|
+
{
|
|
329
|
+
loadMatrix: async () => context.sourceResult.matrix,
|
|
330
|
+
loadAgents: async () => (await loadAgentDefs({ projectDir: cwd })).agents
|
|
331
|
+
}
|
|
332
|
+
);
|
|
333
|
+
this.reportPropagatedRecompile(report);
|
|
334
|
+
} catch (error) {
|
|
335
|
+
this.warn(`Could not record global source change: ${getErrorMessage(error)}`);
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
reportValidationErrors(result) {
|
|
339
|
+
if (result.validation.errors.length > 0) {
|
|
340
|
+
for (const err of result.validation.errors) {
|
|
341
|
+
this.warn(err.message);
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
logChangeSummary(changes, newSkills, oldSkills) {
|
|
346
|
+
const {
|
|
347
|
+
addedSkills,
|
|
348
|
+
removedSkills,
|
|
349
|
+
addedAgents,
|
|
350
|
+
removedAgents,
|
|
351
|
+
sourceChanges,
|
|
352
|
+
scopeChanges,
|
|
353
|
+
agentScopeChanges,
|
|
354
|
+
dualScopeSkillTransitions,
|
|
355
|
+
dualScopeAgentTransitions
|
|
356
|
+
} = changes;
|
|
357
|
+
this.log(`
|
|
358
|
+
${source_default.hex(CLI_COLORS.WHITE).bold("Changes:")}`);
|
|
359
|
+
for (const skillId of addedSkills) {
|
|
360
|
+
const scope = newSkills.find((s) => s.id === skillId)?.scope;
|
|
361
|
+
const scopeLabel = scope ? ` ${formatScopeTag(scope)}` : "";
|
|
362
|
+
this.log(
|
|
363
|
+
source_default.hex(CLI_COLORS.SUCCESS)(` + ${getSkillById(skillId).displayName}${scopeLabel}`)
|
|
364
|
+
);
|
|
365
|
+
}
|
|
366
|
+
for (const skillId of removedSkills) {
|
|
367
|
+
const scope = oldSkills.find((s) => s.id === skillId)?.scope;
|
|
368
|
+
const scopeLabel = scope ? ` ${formatScopeTag(scope)}` : "";
|
|
369
|
+
this.log(source_default.hex(CLI_COLORS.ERROR)(` - ${getSkillDisplayName(skillId)}${scopeLabel}`));
|
|
370
|
+
}
|
|
371
|
+
for (const agentName of addedAgents) {
|
|
372
|
+
this.log(
|
|
373
|
+
source_default.hex(CLI_COLORS.SUCCESS)(` + ${agentName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(" (agent)")
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
for (const agentName of removedAgents) {
|
|
377
|
+
this.log(
|
|
378
|
+
source_default.hex(CLI_COLORS.ERROR)(` - ${agentName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(" (agent)")
|
|
379
|
+
);
|
|
380
|
+
}
|
|
381
|
+
for (const [skillId, change] of sourceChanges) {
|
|
382
|
+
const displayName = getSkillDisplayName(skillId);
|
|
383
|
+
const fromLabel = formatSourceDisplayName(change.from);
|
|
384
|
+
const toLabel = formatSourceDisplayName(change.to);
|
|
385
|
+
this.log(
|
|
386
|
+
source_default.hex(CLI_COLORS.WARNING)(` ~ ${displayName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(` (${fromLabel} \u2192 ${toLabel})`)
|
|
387
|
+
);
|
|
388
|
+
}
|
|
389
|
+
for (const [skillId, change] of scopeChanges) {
|
|
390
|
+
const displayName = getSkillDisplayName(skillId);
|
|
391
|
+
if (dualScopeSkillTransitions.has(skillId)) {
|
|
392
|
+
this.log(formatDualScopeTransition(displayName, change.to));
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
const fromLabel = formatScopeTag(change.from);
|
|
396
|
+
const toLabel = formatScopeTag(change.to);
|
|
397
|
+
const isGlobalToProject = change.from === "global" && change.to === "project";
|
|
398
|
+
const prefix = isGlobalToProject ? "+" : "~";
|
|
399
|
+
const color = isGlobalToProject ? CLI_COLORS.SUCCESS : CLI_COLORS.WARNING;
|
|
400
|
+
this.log(
|
|
401
|
+
source_default.hex(color)(` ${prefix} ${displayName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(` (${fromLabel} \u2192 ${toLabel})`)
|
|
402
|
+
);
|
|
403
|
+
}
|
|
404
|
+
for (const [agentName, change] of agentScopeChanges) {
|
|
405
|
+
if (dualScopeAgentTransitions.has(agentName)) {
|
|
406
|
+
this.log(
|
|
407
|
+
formatDualScopeTransition(agentName, change.to) + source_default.hex(CLI_COLORS.NEUTRAL)(" (agent)")
|
|
408
|
+
);
|
|
409
|
+
continue;
|
|
410
|
+
}
|
|
411
|
+
const fromLabel = formatScopeTag(change.from);
|
|
412
|
+
const toLabel = formatScopeTag(change.to);
|
|
413
|
+
this.log(
|
|
414
|
+
source_default.hex(CLI_COLORS.WARNING)(` ~ ${agentName}`) + source_default.hex(CLI_COLORS.NEUTRAL)(` (${fromLabel} \u2192 ${toLabel})`)
|
|
415
|
+
);
|
|
416
|
+
}
|
|
417
|
+
this.log("");
|
|
418
|
+
}
|
|
419
|
+
async applyMigrations(_changes, filteredResult, activeOldSkills, context, cwd) {
|
|
420
|
+
const migrationPlan = detectMigrations(activeOldSkills, filteredResult.skills);
|
|
421
|
+
const hasMigrations = migrationPlan.toEject.length > 0 || migrationPlan.toPlugin.length > 0;
|
|
422
|
+
if (hasMigrations) {
|
|
423
|
+
if (migrationPlan.toEject.length > 0) {
|
|
424
|
+
this.log(
|
|
425
|
+
source_default.hex(CLI_COLORS.NEUTRAL)(
|
|
426
|
+
`Switching ${migrationPlan.toEject.length} skill(s) to eject`
|
|
427
|
+
)
|
|
428
|
+
);
|
|
429
|
+
}
|
|
430
|
+
if (migrationPlan.toPlugin.length > 0) {
|
|
431
|
+
this.log(
|
|
432
|
+
source_default.hex(CLI_COLORS.NEUTRAL)(
|
|
433
|
+
`Switching ${migrationPlan.toPlugin.length} skill(s) to plugin`
|
|
434
|
+
)
|
|
435
|
+
);
|
|
436
|
+
await this.requireMarketplaceOrExit(context.sourceResult, "migrate skills to plugin mode");
|
|
437
|
+
}
|
|
438
|
+
const migrationResult = await executeMigration(migrationPlan, cwd, context.sourceResult);
|
|
439
|
+
for (const warning of migrationResult.warnings) {
|
|
440
|
+
this.warn(warning);
|
|
441
|
+
}
|
|
442
|
+
for (const item of migrationResult.failedPluginInstalls) {
|
|
443
|
+
this.warn(`Failed to install plugin ${item.id}: ${item.error}`);
|
|
444
|
+
}
|
|
445
|
+
if (migrationResult.failedPluginInstalls.length > 0) {
|
|
446
|
+
this.error(pluginInstallFailureError(migrationResult.failedPluginInstalls.length), {
|
|
447
|
+
exit: EXIT_CODES.ERROR
|
|
448
|
+
});
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
return /* @__PURE__ */ new Set([
|
|
452
|
+
...migrationPlan.toEject.map((m) => m.id),
|
|
453
|
+
...migrationPlan.toPlugin.map((m) => m.id)
|
|
454
|
+
]);
|
|
455
|
+
}
|
|
456
|
+
async applyScopeChanges(changes, filteredResult, context, cwd) {
|
|
457
|
+
const { scopeChanges } = changes;
|
|
458
|
+
for (const [skillId, change] of scopeChanges) {
|
|
459
|
+
const skillConfig = filteredResult.skills.find((s) => s.id === skillId);
|
|
460
|
+
if (skillConfig?.source === EJECT_SOURCE) {
|
|
461
|
+
await migrateLocalSkillScope(skillId, change.from, cwd);
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
const hasPluginScopeChanges = [...scopeChanges.keys()].some((skillId) => {
|
|
465
|
+
const skillConfig = filteredResult.skills.find((s) => s.id === skillId);
|
|
466
|
+
return skillConfig && skillConfig.source !== EJECT_SOURCE;
|
|
467
|
+
});
|
|
468
|
+
if (!hasPluginScopeChanges) return;
|
|
469
|
+
const marketplace = await this.requireMarketplaceOrExit(
|
|
470
|
+
context.sourceResult,
|
|
471
|
+
"migrate plugin skill scopes"
|
|
472
|
+
);
|
|
473
|
+
const pluginScopeResult = await migratePluginSkillScopes(
|
|
474
|
+
scopeChanges,
|
|
475
|
+
filteredResult.skills,
|
|
476
|
+
marketplace,
|
|
477
|
+
cwd
|
|
478
|
+
);
|
|
479
|
+
for (const item of pluginScopeResult.failed) {
|
|
480
|
+
this.warn(`Failed to migrate plugin scope for ${item.id}: ${item.error}`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
async applySourceChanges(changes, activeOldSkills, cwd, migratedSkillIds) {
|
|
484
|
+
const { sourceChanges } = changes;
|
|
485
|
+
for (const [skillId, change] of sourceChanges) {
|
|
486
|
+
if (migratedSkillIds.has(skillId)) {
|
|
487
|
+
continue;
|
|
488
|
+
}
|
|
489
|
+
if (change.from === EJECT_SOURCE) {
|
|
490
|
+
const oldSkill = activeOldSkills.find((s) => s.id === skillId);
|
|
491
|
+
const deleteDir = installBaseDir(cwd, oldSkill?.scope);
|
|
492
|
+
await deleteLocalSkill(deleteDir, skillId);
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
async applyPluginChanges(changes, filteredResult, activeOldSkills, context, cwd) {
|
|
497
|
+
const { addedSkills, removedSkills } = changes;
|
|
498
|
+
const addedPluginSkills = filteredResult.skills.filter(
|
|
499
|
+
(s) => addedSkills.includes(s.id) && s.source !== EJECT_SOURCE
|
|
500
|
+
);
|
|
501
|
+
const removedPluginSkills = removedSkills.filter(
|
|
502
|
+
(id) => activeOldSkills.find((s) => s.id === id)?.source !== EJECT_SOURCE
|
|
503
|
+
);
|
|
504
|
+
if (addedPluginSkills.length === 0 && removedPluginSkills.length === 0) return;
|
|
505
|
+
const marketplace = await this.requireMarketplaceOrExit(
|
|
506
|
+
context.sourceResult,
|
|
507
|
+
"install or uninstall plugin skills"
|
|
508
|
+
);
|
|
509
|
+
if (addedPluginSkills.length > 0) {
|
|
510
|
+
const pluginResult = await installPluginSkills(addedPluginSkills, marketplace, cwd);
|
|
511
|
+
if (pluginResult.installed.length > 0) {
|
|
512
|
+
this.log(
|
|
513
|
+
source_default.hex(CLI_COLORS.NEUTRAL)(`Installed ${pluginResult.installed.length} plugin(s)`)
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
for (const item of pluginResult.failed) {
|
|
517
|
+
this.warn(`Failed to install plugin ${item.id}: ${item.error}`);
|
|
518
|
+
}
|
|
519
|
+
if (pluginResult.failed.length > 0) {
|
|
520
|
+
this.error(pluginInstallFailureError(pluginResult.failed.length), {
|
|
521
|
+
exit: EXIT_CODES.ERROR
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
if (removedPluginSkills.length > 0) {
|
|
526
|
+
const uninstallResult = await uninstallPluginSkills(
|
|
527
|
+
removedPluginSkills,
|
|
528
|
+
activeOldSkills,
|
|
529
|
+
marketplace,
|
|
530
|
+
cwd
|
|
531
|
+
);
|
|
532
|
+
if (uninstallResult.uninstalled.length > 0) {
|
|
533
|
+
this.log(
|
|
534
|
+
source_default.hex(CLI_COLORS.NEUTRAL)(`Removed ${uninstallResult.uninstalled.length} plugin(s)`)
|
|
535
|
+
);
|
|
536
|
+
}
|
|
537
|
+
for (const item of uninstallResult.failed) {
|
|
538
|
+
this.warn(`Failed to uninstall plugin ${item.id}: ${item.error}`);
|
|
539
|
+
}
|
|
540
|
+
}
|
|
541
|
+
}
|
|
542
|
+
async copyNewLocalSkills(changes, filteredResult, context, cwd) {
|
|
543
|
+
const { addedSkills } = changes;
|
|
544
|
+
const addedLocalSkills = filteredResult.skills.filter(
|
|
545
|
+
(s) => addedSkills.includes(s.id) && s.source === EJECT_SOURCE
|
|
546
|
+
);
|
|
547
|
+
if (addedLocalSkills.length > 0) {
|
|
548
|
+
const copyResult = await copyLocalSkills(addedLocalSkills, cwd, context.sourceResult);
|
|
549
|
+
this.log(source_default.hex(CLI_COLORS.NEUTRAL)(`Copied ${copyResult.totalCopied} local skill(s)`));
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
async removeDeletedLocalSkills(changes, activeOldSkills, cwd) {
|
|
553
|
+
const { removedSkills } = changes;
|
|
554
|
+
for (const skillId of removedSkills) {
|
|
555
|
+
const oldSkill = activeOldSkills.find((s) => s.id === skillId);
|
|
556
|
+
if (oldSkill?.source !== EJECT_SOURCE) continue;
|
|
557
|
+
const deleteDir = installBaseDir(cwd, oldSkill.scope);
|
|
558
|
+
await deleteLocalSkill(deleteDir, skillId);
|
|
559
|
+
}
|
|
560
|
+
}
|
|
561
|
+
async writeConfigAndCompile(result, context, flags, cwd) {
|
|
562
|
+
let agentDefsResult;
|
|
563
|
+
try {
|
|
564
|
+
agentDefsResult = await loadAgentDefs({
|
|
565
|
+
forceRefresh: flags.refresh
|
|
566
|
+
});
|
|
567
|
+
} catch (error) {
|
|
568
|
+
this.handleError(error);
|
|
569
|
+
}
|
|
570
|
+
let configResult;
|
|
571
|
+
try {
|
|
572
|
+
configResult = await writeProjectConfig({
|
|
573
|
+
wizardResult: result,
|
|
574
|
+
sourceResult: context.sourceResult,
|
|
575
|
+
projectDir: cwd,
|
|
576
|
+
sourceFlag: flags.source,
|
|
577
|
+
agents: agentDefsResult.agents,
|
|
578
|
+
// A full `cc edit` pass is authoritative over the roster it owns, so deselected entries
|
|
579
|
+
// are removed rather than union-preserved (D-233 Scenario C). Global-context edit owns
|
|
580
|
+
// the entire config ("all"); a project edit owns only project-scoped entries and its own
|
|
581
|
+
// tombstones ("owned"), never inherited global-active entries.
|
|
582
|
+
authoritativeScope: isHomeDirectory(cwd) ? "all" : "owned"
|
|
583
|
+
});
|
|
584
|
+
} catch (error) {
|
|
585
|
+
this.warn(`Could not update config: ${getErrorMessage(error)}`);
|
|
586
|
+
}
|
|
587
|
+
try {
|
|
588
|
+
const agentScopeMap = activeAgentScopeMap(result.agentConfigs);
|
|
589
|
+
const { allSkills } = await discoverInstalledSkills(cwd);
|
|
590
|
+
const compilationResult = await compileAgentsAllScopes({
|
|
591
|
+
projectDir: cwd,
|
|
592
|
+
sourcePath: agentDefsResult.sourcePath,
|
|
593
|
+
skills: allSkills,
|
|
594
|
+
agentScopeMap
|
|
595
|
+
});
|
|
596
|
+
if (compilationResult.failed.length > 0) {
|
|
597
|
+
this.log(
|
|
598
|
+
source_default.hex(CLI_COLORS.NEUTRAL)(`Recompiled ${compilationResult.compiled.length} agents`) + source_default.hex(CLI_COLORS.WARNING)(` (${compilationResult.failed.length} failed)`)
|
|
599
|
+
);
|
|
600
|
+
for (const warning of compilationResult.warnings) {
|
|
601
|
+
this.warn(warning);
|
|
602
|
+
}
|
|
603
|
+
} else if (compilationResult.compiled.length > 0) {
|
|
604
|
+
this.log(
|
|
605
|
+
source_default.hex(CLI_COLORS.NEUTRAL)(`Recompiled ${compilationResult.compiled.length} agents`)
|
|
606
|
+
);
|
|
607
|
+
} else {
|
|
608
|
+
this.log(source_default.hex(CLI_COLORS.NEUTRAL)("No agents to recompile"));
|
|
609
|
+
}
|
|
610
|
+
} catch (error) {
|
|
611
|
+
this.warn(`Agent recompilation failed: ${getErrorMessage(error)}`);
|
|
612
|
+
this.log(`You can manually recompile with '${CLI_INVOKE_COMMAND} compile'.`);
|
|
613
|
+
}
|
|
614
|
+
if (configResult) {
|
|
615
|
+
this.reportPropagatedRecompile(configResult.propagation);
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* Renders the recompile the gated write already performed on every OTHER
|
|
620
|
+
* registered project this run's global change was propagated into.
|
|
621
|
+
*/
|
|
622
|
+
reportPropagatedRecompile(propagation) {
|
|
623
|
+
if (propagation.propagated.updated.length === 0) return;
|
|
624
|
+
const { recompiledCount, failedCount, warnings } = propagation.recompile;
|
|
625
|
+
for (const warning of warnings) {
|
|
626
|
+
this.warn(warning);
|
|
627
|
+
}
|
|
628
|
+
const summary = source_default.hex(CLI_COLORS.NEUTRAL)(
|
|
629
|
+
`Recompiled agents in ${recompiledCount} registered project(s)`
|
|
630
|
+
);
|
|
631
|
+
this.log(
|
|
632
|
+
failedCount > 0 ? summary + source_default.hex(CLI_COLORS.WARNING)(` (${failedCount} failed)`) : summary
|
|
633
|
+
);
|
|
634
|
+
}
|
|
635
|
+
async cleanupStaleAgentFiles(changes, oldAgents, cwd) {
|
|
636
|
+
const { agentScopeChanges, removedAgents } = changes;
|
|
637
|
+
for (const [agentName, change] of agentScopeChanges) {
|
|
638
|
+
if (change.from === "global") continue;
|
|
639
|
+
const oldAgentPath = path.join(
|
|
640
|
+
resolveInstallPaths(cwd, "project").agentsDir,
|
|
641
|
+
`${agentName}.md`
|
|
642
|
+
);
|
|
643
|
+
try {
|
|
644
|
+
await remove(oldAgentPath);
|
|
645
|
+
} catch (error) {
|
|
646
|
+
this.warn(`Could not remove old agent file ${oldAgentPath}: ${getErrorMessage(error)}`);
|
|
647
|
+
}
|
|
648
|
+
}
|
|
649
|
+
for (const agentName of removedAgents) {
|
|
650
|
+
const oldScope = oldAgents.find((a) => a.name === agentName)?.scope ?? "project";
|
|
651
|
+
const agentPath = path.join(resolveInstallPaths(cwd, oldScope).agentsDir, `${agentName}.md`);
|
|
652
|
+
try {
|
|
653
|
+
await remove(agentPath);
|
|
654
|
+
} catch (error) {
|
|
655
|
+
this.warn(`Could not remove agent file ${agentPath}: ${getErrorMessage(error)}`);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
logCompletionSummary(_changes) {
|
|
660
|
+
this.log(`
|
|
661
|
+
${source_default.hex(CLI_COLORS.SUCCESS)("\u2713 Done")}
|
|
662
|
+
`);
|
|
663
|
+
}
|
|
664
|
+
};
|
|
665
|
+
function detectConfigChanges(oldConfig, wizardResult, fullEntries) {
|
|
666
|
+
const oldSkillIds = oldConfig?.skills?.map((s) => s.id) ?? [];
|
|
667
|
+
const newSkillIds = wizardResult.skills.map((s) => s.id);
|
|
668
|
+
const oldAgentNames = oldConfig?.agents?.map((a) => a.name) ?? [];
|
|
669
|
+
const newAgentNames = wizardResult.agentConfigs.map((a) => a.name);
|
|
670
|
+
const oldSkillsById = indexBy(oldConfig?.skills ?? [], (s) => s.id);
|
|
671
|
+
const oldAgentsByName = indexBy(oldConfig?.agents ?? [], (a) => a.name);
|
|
672
|
+
const scopeChanges = detectPropertyChanges(
|
|
673
|
+
wizardResult.skills,
|
|
674
|
+
oldSkillsById,
|
|
675
|
+
(s) => s.id,
|
|
676
|
+
(s) => s.scope
|
|
677
|
+
);
|
|
678
|
+
const agentScopeChanges = detectPropertyChanges(
|
|
679
|
+
wizardResult.agentConfigs,
|
|
680
|
+
oldAgentsByName,
|
|
681
|
+
(a) => a.name,
|
|
682
|
+
(a) => a.scope
|
|
683
|
+
);
|
|
684
|
+
return {
|
|
685
|
+
addedSkills: difference(newSkillIds, oldSkillIds),
|
|
686
|
+
removedSkills: difference(oldSkillIds, newSkillIds),
|
|
687
|
+
addedAgents: difference(newAgentNames, oldAgentNames),
|
|
688
|
+
removedAgents: difference(oldAgentNames, newAgentNames),
|
|
689
|
+
sourceChanges: detectPropertyChanges(
|
|
690
|
+
wizardResult.skills,
|
|
691
|
+
oldSkillsById,
|
|
692
|
+
(s) => s.id,
|
|
693
|
+
(s) => s.source
|
|
694
|
+
),
|
|
695
|
+
scopeChanges,
|
|
696
|
+
agentScopeChanges,
|
|
697
|
+
dualScopeSkillTransitions: detectDualScopeTransitions(
|
|
698
|
+
scopeChanges,
|
|
699
|
+
fullEntries?.newSkills ?? [],
|
|
700
|
+
fullEntries?.oldSkills ?? [],
|
|
701
|
+
(s) => s.id
|
|
702
|
+
),
|
|
703
|
+
dualScopeAgentTransitions: detectDualScopeTransitions(
|
|
704
|
+
agentScopeChanges,
|
|
705
|
+
fullEntries?.newAgents ?? [],
|
|
706
|
+
fullEntries?.oldAgents ?? [],
|
|
707
|
+
(a) => a.name
|
|
708
|
+
)
|
|
709
|
+
};
|
|
710
|
+
}
|
|
711
|
+
function detectPropertyChanges(newItems, oldByKey, getKey, getValue) {
|
|
712
|
+
const changes = /* @__PURE__ */ new Map();
|
|
713
|
+
for (const item of newItems) {
|
|
714
|
+
const key = getKey(item);
|
|
715
|
+
const old = oldByKey[key];
|
|
716
|
+
if (old && getValue(old) !== getValue(item)) {
|
|
717
|
+
changes.set(key, { from: getValue(old), to: getValue(item) });
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
return changes;
|
|
721
|
+
}
|
|
722
|
+
function detectDualScopeTransitions(scopeChanges, fullNew, fullOld, getKey) {
|
|
723
|
+
const hasGlobalTombstone = (items, key) => items.some((item) => getKey(item) === key && item.scope === "global" && item.excluded === true);
|
|
724
|
+
const result = /* @__PURE__ */ new Set();
|
|
725
|
+
for (const [key, change] of scopeChanges) {
|
|
726
|
+
if (change.from === "global" && change.to === "project" && hasGlobalTombstone(fullNew, key)) {
|
|
727
|
+
result.add(key);
|
|
728
|
+
} else if (change.from === "project" && change.to === "global" && hasGlobalTombstone(fullOld, key)) {
|
|
729
|
+
result.add(key);
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return result;
|
|
733
|
+
}
|
|
734
|
+
function hasAnyChanges(changes) {
|
|
735
|
+
return 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;
|
|
736
|
+
}
|
|
737
|
+
async function migratePluginSkillScopes(scopeChanges, skills, marketplace, projectDir) {
|
|
738
|
+
const migrated = [];
|
|
739
|
+
const failed = [];
|
|
740
|
+
for (const [skillId, change] of scopeChanges) {
|
|
741
|
+
const skillConfig = skills.find((s) => s.id === skillId);
|
|
742
|
+
if (!skillConfig || skillConfig.source === EJECT_SOURCE) {
|
|
743
|
+
continue;
|
|
744
|
+
}
|
|
745
|
+
const newPluginScope = toClaudePluginScope(change.to);
|
|
746
|
+
const pluginRef = buildMarketplacePluginRef(skillId, marketplace);
|
|
747
|
+
try {
|
|
748
|
+
if (change.from === "project") {
|
|
749
|
+
await claudePluginUninstall(pluginRef, "project", projectDir);
|
|
750
|
+
}
|
|
751
|
+
await claudePluginInstall(pluginRef, newPluginScope, projectDir);
|
|
752
|
+
migrated.push(skillId);
|
|
753
|
+
} catch (error) {
|
|
754
|
+
failed.push({ id: skillId, error: getErrorMessage(error) });
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
return { migrated, failed };
|
|
758
|
+
}
|
|
759
|
+
export {
|
|
760
|
+
applyMigratedGlobalSources,
|
|
761
|
+
Edit as default,
|
|
762
|
+
detectConfigChanges,
|
|
763
|
+
migratePluginSkillScopes
|
|
764
|
+
};
|
|
765
|
+
//# sourceMappingURL=edit.js.map
|