agents-inc 0.151.0 → 0.152.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 +22 -0
- package/README.md +25 -25
- package/dist/{chunk-YA4QQKKE.js → chunk-5GUOIJSG.js} +3 -7
- package/dist/{chunk-YA4QQKKE.js.map → chunk-5GUOIJSG.js.map} +1 -1
- package/dist/{chunk-44LLPS2N.js → chunk-5UWKOOIS.js} +6 -26
- package/dist/chunk-5UWKOOIS.js.map +1 -0
- package/dist/{chunk-O5ASLZ2K.js → chunk-76ADG7LQ.js} +1 -5
- package/dist/{chunk-O5ASLZ2K.js.map → chunk-76ADG7LQ.js.map} +1 -1
- package/dist/{chunk-WK4J2CHH.js → chunk-BNSRA6HL.js} +13 -18
- package/dist/{chunk-WK4J2CHH.js.map → chunk-BNSRA6HL.js.map} +1 -1
- package/dist/{chunk-FYPUUYSG.js → chunk-DTSG5XZB.js} +3 -7
- package/dist/{chunk-FYPUUYSG.js.map → chunk-DTSG5XZB.js.map} +1 -1
- package/dist/{chunk-NGLQ5W7U.js → chunk-E5X6RJ4E.js} +5 -15
- package/dist/chunk-E5X6RJ4E.js.map +1 -0
- package/dist/{chunk-TVHRMRD3.js → chunk-EEPELKOM.js} +4008 -4084
- package/dist/chunk-EEPELKOM.js.map +1 -0
- package/dist/{chunk-NIKUMXE7.js → chunk-F7T5AFFN.js} +1 -5
- package/dist/{chunk-NIKUMXE7.js.map → chunk-F7T5AFFN.js.map} +1 -1
- package/dist/{chunk-LAXAQ3PZ.js → chunk-FVDKAVOL.js} +10 -14
- package/dist/{chunk-LAXAQ3PZ.js.map → chunk-FVDKAVOL.js.map} +1 -1
- package/dist/{chunk-BNE4HHIH.js → chunk-GRVKW3CC.js} +2 -6
- package/dist/{chunk-BNE4HHIH.js.map → chunk-GRVKW3CC.js.map} +1 -1
- package/dist/{chunk-3XFUQ6OL.js → chunk-IHUY4M22.js} +4 -8
- package/dist/{chunk-3XFUQ6OL.js.map → chunk-IHUY4M22.js.map} +1 -1
- package/dist/{chunk-OZZGXBCN.js → chunk-IUQBOCSU.js} +1 -5
- package/dist/{chunk-OZZGXBCN.js.map → chunk-IUQBOCSU.js.map} +1 -1
- package/dist/{chunk-LYYXX2W5.js → chunk-J27W6TXS.js} +4 -6
- package/dist/{chunk-LYYXX2W5.js.map → chunk-J27W6TXS.js.map} +1 -1
- package/dist/chunk-JFLVEFFP.js +16 -0
- package/dist/chunk-JFLVEFFP.js.map +1 -0
- package/dist/{chunk-PV2HNW4I.js → chunk-KFB5CRXZ.js} +7 -12
- package/dist/{chunk-PV2HNW4I.js.map → chunk-KFB5CRXZ.js.map} +1 -1
- package/dist/{chunk-SYUOXSPU.js → chunk-KR65TPKC.js} +168 -14
- package/dist/chunk-KR65TPKC.js.map +1 -0
- package/dist/{chunk-KOPEM3Q7.js → chunk-KXYVJGJP.js} +2 -6
- package/dist/{chunk-KOPEM3Q7.js.map → chunk-KXYVJGJP.js.map} +1 -1
- package/dist/{chunk-TYJLR32W.js → chunk-L7SZXUBJ.js} +9 -14
- package/dist/{chunk-TYJLR32W.js.map → chunk-L7SZXUBJ.js.map} +1 -1
- package/dist/{chunk-NHCGC6DG.js → chunk-LASI35KT.js} +4 -9
- package/dist/{chunk-NHCGC6DG.js.map → chunk-LASI35KT.js.map} +1 -1
- package/dist/{chunk-VG2TVBFN.js → chunk-LDP5ASDM.js} +2 -6
- package/dist/{chunk-VG2TVBFN.js.map → chunk-LDP5ASDM.js.map} +1 -1
- package/dist/{chunk-5V2O6C3T.js → chunk-LZ52XEPR.js} +4 -8
- package/dist/{chunk-5V2O6C3T.js.map → chunk-LZ52XEPR.js.map} +1 -1
- package/dist/{chunk-WFWCZEMS.js → chunk-M7HO7NBK.js} +4 -8
- package/dist/{chunk-WFWCZEMS.js.map → chunk-M7HO7NBK.js.map} +1 -1
- package/dist/{chunk-XA57SX4T.js → chunk-MJ2KHG24.js} +4 -8
- package/dist/{chunk-XA57SX4T.js.map → chunk-MJ2KHG24.js.map} +1 -1
- package/dist/{chunk-DAG2ULNF.js → chunk-MM7CTTAV.js} +2 -6
- package/dist/chunk-MM7CTTAV.js.map +1 -0
- package/dist/{chunk-UFURYGD3.js → chunk-MQ7FLIYS.js} +2 -6
- package/dist/{chunk-UFURYGD3.js.map → chunk-MQ7FLIYS.js.map} +1 -1
- package/dist/{chunk-SI5FOARI.js → chunk-MVR3SYMN.js} +6 -8
- package/dist/chunk-MVR3SYMN.js.map +1 -0
- package/dist/{chunk-UTFN6UJS.js → chunk-MWG4VU64.js} +12 -17
- package/dist/{chunk-UTFN6UJS.js.map → chunk-MWG4VU64.js.map} +1 -1
- package/dist/{chunk-ES3NJZON.js → chunk-NR3OZGL4.js} +1 -5
- package/dist/{chunk-ES3NJZON.js.map → chunk-NR3OZGL4.js.map} +1 -1
- package/dist/{chunk-GYG5SE2D.js → chunk-ODNDXQH2.js} +2 -6
- package/dist/{chunk-GYG5SE2D.js.map → chunk-ODNDXQH2.js.map} +1 -1
- package/dist/{chunk-2RSNKBXC.js → chunk-P44SXVH3.js} +6 -10
- package/dist/{chunk-2RSNKBXC.js.map → chunk-P44SXVH3.js.map} +1 -1
- package/dist/{chunk-3LIU2ZEF.js → chunk-PMM2MYMA.js} +3 -16
- package/dist/{chunk-3LIU2ZEF.js.map → chunk-PMM2MYMA.js.map} +1 -1
- package/dist/{chunk-QTFQEYDA.js → chunk-PZIZNMHK.js} +24 -36
- package/dist/chunk-PZIZNMHK.js.map +1 -0
- package/dist/{chunk-C55DN7GE.js → chunk-Q2KG7UV3.js} +3 -5
- package/dist/chunk-Q2KG7UV3.js.map +1 -0
- package/dist/{chunk-QQLRX4KI.js → chunk-Q45ZU6HD.js} +2 -6
- package/dist/{chunk-QQLRX4KI.js.map → chunk-Q45ZU6HD.js.map} +1 -1
- package/dist/{chunk-6RBQBOBS.js → chunk-QRDTLVXG.js} +9 -14
- package/dist/{chunk-6RBQBOBS.js.map → chunk-QRDTLVXG.js.map} +1 -1
- package/dist/{chunk-YBVA7GPW.js → chunk-QZZJFYUQ.js} +3 -7
- package/dist/{chunk-YBVA7GPW.js.map → chunk-QZZJFYUQ.js.map} +1 -1
- package/dist/{chunk-OJIESW5B.js → chunk-R5NOI2LP.js} +13 -17
- package/dist/{chunk-OJIESW5B.js.map → chunk-R5NOI2LP.js.map} +1 -1
- package/dist/{chunk-DUVWGO6E.js → chunk-RNJWAKMO.js} +3 -7
- package/dist/{chunk-DUVWGO6E.js.map → chunk-RNJWAKMO.js.map} +1 -1
- package/dist/{chunk-4R6PGHQQ.js → chunk-SBHBBZKF.js} +7 -23
- package/dist/chunk-SBHBBZKF.js.map +1 -0
- package/dist/{chunk-NM3EDGB5.js → chunk-SKQWRUPX.js} +10 -14
- package/dist/{chunk-NM3EDGB5.js.map → chunk-SKQWRUPX.js.map} +1 -1
- package/dist/{chunk-Y4CXDA3I.js → chunk-STMHDOZD.js} +4 -21
- package/dist/chunk-STMHDOZD.js.map +1 -0
- package/dist/{chunk-SHHOMVWC.js → chunk-SX5H6TSC.js} +7 -11
- package/dist/chunk-SX5H6TSC.js.map +1 -0
- package/dist/{chunk-RBHYLCUB.js → chunk-TJJPWUMA.js} +2 -6
- package/dist/{chunk-RBHYLCUB.js.map → chunk-TJJPWUMA.js.map} +1 -1
- package/dist/{chunk-IOJR5TOY.js → chunk-TSIU7DME.js} +1 -5
- package/dist/{chunk-IOJR5TOY.js.map → chunk-TSIU7DME.js.map} +1 -1
- package/dist/{chunk-EVXG3X6G.js → chunk-TUPYW2IQ.js} +3 -7
- package/dist/{chunk-EVXG3X6G.js.map → chunk-TUPYW2IQ.js.map} +1 -1
- package/dist/{chunk-YU2VGX5R.js → chunk-UBEDZ4FD.js} +1 -8
- package/dist/{chunk-YU2VGX5R.js.map → chunk-UBEDZ4FD.js.map} +1 -1
- package/dist/{chunk-VEP23B5W.js → chunk-VASLW636.js} +1 -5
- package/dist/{chunk-VEP23B5W.js.map → chunk-VASLW636.js.map} +1 -1
- package/dist/{chunk-PG4G4IIK.js → chunk-VY6MNOXL.js} +2 -6
- package/dist/{chunk-PG4G4IIK.js.map → chunk-VY6MNOXL.js.map} +1 -1
- package/dist/{chunk-IHO75PMZ.js → chunk-WBCPLH66.js} +15 -13
- package/dist/chunk-WBCPLH66.js.map +1 -0
- package/dist/{chunk-DG2NGZ7S.js → chunk-WKTHWQKM.js} +2 -7
- package/dist/{chunk-DG2NGZ7S.js.map → chunk-WKTHWQKM.js.map} +1 -1
- package/dist/{chunk-EZ7STXUV.js → chunk-XHUODHZ4.js} +19 -25
- package/dist/{chunk-EZ7STXUV.js.map → chunk-XHUODHZ4.js.map} +1 -1
- package/dist/{chunk-KIR7VYQD.js → chunk-XVAQG2CV.js} +1 -5
- package/dist/{chunk-KIR7VYQD.js.map → chunk-XVAQG2CV.js.map} +1 -1
- package/dist/{chunk-P3PN5SVI.js → chunk-ZL7PFNHN.js} +2 -6
- package/dist/{chunk-P3PN5SVI.js.map → chunk-ZL7PFNHN.js.map} +1 -1
- package/dist/{chunk-3YGUHWLR.js → chunk-ZPPHXXAP.js} +9 -15
- package/dist/{chunk-3YGUHWLR.js.map → chunk-ZPPHXXAP.js.map} +1 -1
- package/dist/commands/build/marketplace.js +10 -15
- package/dist/commands/build/marketplace.js.map +1 -1
- package/dist/commands/build/plugins.js +9 -14
- package/dist/commands/build/plugins.js.map +1 -1
- package/dist/commands/compile.js +14 -19
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/doctor.js +13 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/edit.js +51 -55
- package/dist/commands/edit.js.map +1 -1
- package/dist/commands/eject.js +13 -18
- package/dist/commands/eject.js.map +1 -1
- package/dist/commands/import/skill.js +9 -14
- package/dist/commands/import/skill.js.map +1 -1
- package/dist/commands/init.js +50 -51
- package/dist/commands/list.js +14 -16
- package/dist/commands/list.js.map +1 -1
- package/dist/commands/new/agent.js +12 -16
- package/dist/commands/new/agent.js.map +1 -1
- package/dist/commands/new/marketplace.js +15 -20
- package/dist/commands/new/marketplace.js.map +1 -1
- package/dist/commands/new/skill.js +11 -13
- package/dist/commands/search.js +14 -19
- package/dist/commands/search.js.map +1 -1
- package/dist/commands/uninstall.js +17 -21
- package/dist/commands/uninstall.js.map +1 -1
- package/dist/commands/update.js +17 -21
- package/dist/commands/update.js.map +1 -1
- package/dist/commands/validate.js +10 -16
- package/dist/commands/validate.js.map +1 -1
- package/dist/components/common/confirm.js +1 -2
- package/dist/components/common/prompt-confirm.js +2 -2
- package/dist/components/common/select-list.js +3 -4
- package/dist/components/common/spinner.js +1 -2
- package/dist/components/wizard/category-grid.js +8 -9
- package/dist/components/wizard/checkbox-grid.js +6 -7
- package/dist/components/wizard/domain-selection.js +14 -15
- package/dist/components/wizard/run-wizard-session.js +40 -40
- package/dist/components/wizard/scroll-affordance.js +2 -3
- package/dist/components/wizard/search-modal.js +6 -7
- package/dist/components/wizard/selection-card.js +2 -3
- package/dist/components/wizard/skill-agent-summary.js +8 -9
- package/dist/components/wizard/source-grid.js +13 -14
- package/dist/components/wizard/stack-selection.js +12 -13
- package/dist/components/wizard/step-agents.js +14 -15
- package/dist/components/wizard/step-build.js +14 -15
- package/dist/components/wizard/step-confirm.js +13 -14
- package/dist/components/wizard/step-settings.js +11 -12
- package/dist/components/wizard/step-sources.js +20 -21
- package/dist/components/wizard/step-stack.js +13 -14
- package/dist/components/wizard/summary-panel.js +12 -13
- package/dist/components/wizard/toast.js +2 -3
- package/dist/components/wizard/wizard-layout.js +18 -19
- package/dist/components/wizard/wizard-tabs.js +8 -9
- package/dist/components/wizard/wizard.js +38 -39
- package/dist/config-exports.js +1 -7
- package/dist/config-exports.js.map +1 -1
- package/dist/copy-local-skills-6EMVN7RB.js +14 -0
- package/dist/hooks/init.js +50 -54
- package/dist/hooks/init.js.map +1 -1
- package/dist/index.js +0 -4
- package/dist/index.js.map +1 -1
- package/dist/load-agent-defs-BWOUVEAR.js +15 -0
- package/dist/{loader-E2ERJYVA.js → loader-5JP4S7CJ.js} +4 -5
- package/dist/recompile-project-agents-6DL45TDI.js +19 -0
- package/dist/{source-loader-5UNRU7EZ.js → source-loader-MZYCPL2S.js} +7 -8
- package/dist/stores/wizard-store.js +7 -8
- package/package.json +15 -14
- package/dist/chunk-44LLPS2N.js.map +0 -1
- package/dist/chunk-4R6PGHQQ.js.map +0 -1
- package/dist/chunk-7QIHKQL5.js +0 -181
- package/dist/chunk-7QIHKQL5.js.map +0 -1
- package/dist/chunk-C55DN7GE.js.map +0 -1
- package/dist/chunk-DAG2ULNF.js.map +0 -1
- package/dist/chunk-DIBCRIMR.js +0 -36
- package/dist/chunk-DIBCRIMR.js.map +0 -1
- package/dist/chunk-EKWAUOQB.js +0 -96
- package/dist/chunk-EKWAUOQB.js.map +0 -1
- package/dist/chunk-I3XKEGHM.js +0 -16383
- package/dist/chunk-I3XKEGHM.js.map +0 -1
- package/dist/chunk-IHO75PMZ.js.map +0 -1
- package/dist/chunk-K3OU6TGX.js +0 -77
- package/dist/chunk-K3OU6TGX.js.map +0 -1
- package/dist/chunk-KSZ6PCY4.js +0 -43
- package/dist/chunk-KSZ6PCY4.js.map +0 -1
- package/dist/chunk-NGLQ5W7U.js.map +0 -1
- package/dist/chunk-P56WJ5FA.js +0 -50
- package/dist/chunk-P56WJ5FA.js.map +0 -1
- package/dist/chunk-QTFQEYDA.js.map +0 -1
- package/dist/chunk-SHHOMVWC.js.map +0 -1
- package/dist/chunk-SI5FOARI.js.map +0 -1
- package/dist/chunk-SYUOXSPU.js.map +0 -1
- package/dist/chunk-THKIOI32.js +0 -939
- package/dist/chunk-THKIOI32.js.map +0 -1
- package/dist/chunk-TVHRMRD3.js.map +0 -1
- package/dist/chunk-V7QOSGQA.js +0 -298
- package/dist/chunk-V7QOSGQA.js.map +0 -1
- package/dist/chunk-Y4CXDA3I.js.map +0 -1
- package/dist/components/common/confirm.test.js +0 -203
- package/dist/components/common/confirm.test.js.map +0 -1
- package/dist/components/wizard/category-grid.test.js +0 -1253
- package/dist/components/wizard/category-grid.test.js.map +0 -1
- package/dist/components/wizard/checkbox-grid.test.js +0 -264
- package/dist/components/wizard/checkbox-grid.test.js.map +0 -1
- package/dist/components/wizard/search-modal.test.js +0 -212
- package/dist/components/wizard/search-modal.test.js.map +0 -1
- package/dist/components/wizard/source-grid.test.js +0 -1094
- package/dist/components/wizard/source-grid.test.js.map +0 -1
- package/dist/components/wizard/step-agents.test.js +0 -204
- package/dist/components/wizard/step-agents.test.js.map +0 -1
- package/dist/components/wizard/step-build.test.js +0 -552
- package/dist/components/wizard/step-build.test.js.map +0 -1
- package/dist/components/wizard/step-confirm.test.js +0 -744
- package/dist/components/wizard/step-confirm.test.js.map +0 -1
- package/dist/components/wizard/step-settings.test.js +0 -244
- package/dist/components/wizard/step-settings.test.js.map +0 -1
- package/dist/components/wizard/step-sources.test.js +0 -155
- package/dist/components/wizard/step-sources.test.js.map +0 -1
- package/dist/components/wizard/step-stack.test.js +0 -262
- package/dist/components/wizard/step-stack.test.js.map +0 -1
- package/dist/components/wizard/summary-panel.test.js +0 -317
- package/dist/components/wizard/summary-panel.test.js.map +0 -1
- package/dist/components/wizard/wizard-layout.test.js +0 -200
- package/dist/components/wizard/wizard-layout.test.js.map +0 -1
- package/dist/components/wizard/wizard-tabs.test.js +0 -290
- package/dist/components/wizard/wizard-tabs.test.js.map +0 -1
- package/dist/copy-local-skills-UPA2GUZV.js +0 -15
- package/dist/dist-VNJNNJK7.js +0 -550
- package/dist/dist-VNJNNJK7.js.map +0 -1
- package/dist/load-agent-defs-SB4XAOVB.js +0 -16
- package/dist/magic-string.es-5TV73NJD.js +0 -1316
- package/dist/magic-string.es-5TV73NJD.js.map +0 -1
- package/dist/recompile-project-agents-U4ZY2GDX.js +0 -20
- package/dist/source-manager-3O54SIIB.js +0 -18
- package/dist/source-manager-3O54SIIB.js.map +0 -1
- package/dist/stores/d227-same-scope-tombstone-duplicate.test.js +0 -118
- package/dist/stores/d227-same-scope-tombstone-duplicate.test.js.map +0 -1
- package/dist/stores/wizard-store.test.js +0 -3053
- package/dist/stores/wizard-store.test.js.map +0 -1
- /package/dist/{copy-local-skills-UPA2GUZV.js.map → copy-local-skills-6EMVN7RB.js.map} +0 -0
- /package/dist/{load-agent-defs-SB4XAOVB.js.map → load-agent-defs-BWOUVEAR.js.map} +0 -0
- /package/dist/{loader-E2ERJYVA.js.map → loader-5JP4S7CJ.js.map} +0 -0
- /package/dist/{recompile-project-agents-U4ZY2GDX.js.map → recompile-project-agents-6DL45TDI.js.map} +0 -0
- /package/dist/{source-loader-5UNRU7EZ.js.map → source-loader-MZYCPL2S.js.map} +0 -0
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
promptValue
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Q2KG7UV3.js";
|
|
5
5
|
import {
|
|
6
6
|
runWizardSession
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
Spinner
|
|
10
|
-
} from "./chunk-OZZGXBCN.js";
|
|
7
|
+
} from "./chunk-MVR3SYMN.js";
|
|
11
8
|
import {
|
|
12
9
|
useTerminalDimensions
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-MWG4VU64.js";
|
|
14
11
|
import {
|
|
15
12
|
SelectList
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-RNJWAKMO.js";
|
|
14
|
+
import {
|
|
15
|
+
Spinner
|
|
16
|
+
} from "./chunk-IUQBOCSU.js";
|
|
17
17
|
import {
|
|
18
18
|
STATUS_MESSAGES,
|
|
19
19
|
SUCCESS_MESSAGES
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-ODNDXQH2.js";
|
|
21
21
|
import {
|
|
22
22
|
compileAgentsAllScopes,
|
|
23
23
|
loadSource,
|
|
24
24
|
writeProjectConfig
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-STMHDOZD.js";
|
|
26
26
|
import {
|
|
27
27
|
discoverInstalledSkills,
|
|
28
28
|
installPluginSkills,
|
|
29
29
|
pluginInstallFailureError
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-SBHBBZKF.js";
|
|
31
31
|
import {
|
|
32
32
|
copyLocalSkills
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-IHUY4M22.js";
|
|
34
34
|
import {
|
|
35
35
|
loadAgentDefs
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-QZZJFYUQ.js";
|
|
37
|
+
import {
|
|
38
|
+
render
|
|
39
|
+
} from "./chunk-JFLVEFFP.js";
|
|
37
40
|
import {
|
|
38
41
|
orderDomains
|
|
39
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-5UWKOOIS.js";
|
|
40
43
|
import {
|
|
41
44
|
BaseCommand,
|
|
42
45
|
EXIT_CODES
|
|
43
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-KR65TPKC.js";
|
|
44
47
|
import {
|
|
45
48
|
clearTerminalScreen
|
|
46
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-ZL7PFNHN.js";
|
|
47
50
|
import {
|
|
48
51
|
INSTALL_MODE_LABELS,
|
|
49
52
|
buildAgentScopeMap,
|
|
@@ -55,7 +58,7 @@ import {
|
|
|
55
58
|
loadProjectConfig,
|
|
56
59
|
loadProjectConfigFromDir,
|
|
57
60
|
resolveInstallPaths
|
|
58
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-EEPELKOM.js";
|
|
59
62
|
import {
|
|
60
63
|
AGENT_NAMES,
|
|
61
64
|
fileExists,
|
|
@@ -63,10 +66,10 @@ import {
|
|
|
63
66
|
readFileSafe,
|
|
64
67
|
settingsFileSchema,
|
|
65
68
|
warn
|
|
66
|
-
} from "./chunk-
|
|
69
|
+
} from "./chunk-PMM2MYMA.js";
|
|
67
70
|
import {
|
|
68
71
|
getCategoryDomain
|
|
69
|
-
} from "./chunk-
|
|
72
|
+
} from "./chunk-WKTHWQKM.js";
|
|
70
73
|
import {
|
|
71
74
|
ASCII_LOGO,
|
|
72
75
|
CLAUDE_DIR,
|
|
@@ -79,22 +82,14 @@ import {
|
|
|
79
82
|
EJECT_SOURCE,
|
|
80
83
|
MAX_CONFIG_FILE_SIZE,
|
|
81
84
|
STANDARD_FILES
|
|
82
|
-
} from "./chunk-
|
|
83
|
-
import {
|
|
84
|
-
init_esm_shims
|
|
85
|
-
} from "./chunk-P56WJ5FA.js";
|
|
85
|
+
} from "./chunk-76ADG7LQ.js";
|
|
86
86
|
|
|
87
87
|
// src/cli/commands/init.tsx
|
|
88
|
-
init_esm_shims();
|
|
89
88
|
import os from "os";
|
|
90
89
|
import { Flags } from "@oclif/core";
|
|
91
|
-
import {
|
|
92
|
-
|
|
93
|
-
// src/cli/lib/seed/fetch-seed.ts
|
|
94
|
-
init_esm_shims();
|
|
90
|
+
import { Box as Box2, Text as Text2, useApp } from "ink";
|
|
95
91
|
|
|
96
92
|
// src/cli/lib/seed/seed-schema.ts
|
|
97
|
-
init_esm_shims();
|
|
98
93
|
import { z } from "zod";
|
|
99
94
|
var SEED_VERSION = 3;
|
|
100
95
|
var seedModelSchema = z.enum(["opus", "fable", "sonnet", "haiku"]);
|
|
@@ -166,12 +161,6 @@ async function fetchSeedConfig(id) {
|
|
|
166
161
|
return { ok: true, payload: parsed.data };
|
|
167
162
|
}
|
|
168
163
|
|
|
169
|
-
// src/cli/lib/seed/seed-to-wizard.ts
|
|
170
|
-
init_esm_shims();
|
|
171
|
-
|
|
172
|
-
// src/cli/types/agents.ts
|
|
173
|
-
init_esm_shims();
|
|
174
|
-
|
|
175
164
|
// src/cli/lib/seed/seed-to-wizard.ts
|
|
176
165
|
var KNOWN_AGENTS = new Set(AGENT_NAMES);
|
|
177
166
|
function sourceForSkill(skill) {
|
|
@@ -271,7 +260,6 @@ function seedToWizardResult(payload, matrix) {
|
|
|
271
260
|
}
|
|
272
261
|
|
|
273
262
|
// src/cli/lib/permission-checker.tsx
|
|
274
|
-
init_esm_shims();
|
|
275
263
|
import { Text, Box } from "ink";
|
|
276
264
|
import path from "path";
|
|
277
265
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -786,4 +774,4 @@ export {
|
|
|
786
774
|
Init,
|
|
787
775
|
getDashboardData
|
|
788
776
|
};
|
|
789
|
-
//# sourceMappingURL=chunk-
|
|
777
|
+
//# sourceMappingURL=chunk-PZIZNMHK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/commands/init.tsx","../src/cli/lib/seed/seed-schema.ts","../src/cli/lib/seed/fetch-seed.ts","../src/cli/lib/seed/seed-to-wizard.ts","../src/cli/lib/permission-checker.tsx"],"sourcesContent":["import os from \"os\";\nimport React from \"react\";\n\nimport { Flags, type Interfaces } from \"@oclif/core\";\nimport { Box, Text, useApp } from \"ink\";\nimport { render } from \"../components/render.js\";\n\nimport { BaseCommand, type SourceRefreshFlags } from \"../base-command.js\";\nimport { type WizardResultV2 } from \"../components/wizard/wizard.js\";\nimport { runWizardSession } from \"../components/wizard/run-wizard-session.js\";\nimport { useTerminalDimensions } from \"../components/hooks/use-terminal-dimensions.js\";\nimport { type SourceLoadResult } from \"../lib/loading/index.js\";\nimport {\n loadSource,\n loadAgentDefs,\n copyLocalSkills,\n installPluginSkills,\n pluginInstallFailureError,\n writeProjectConfig,\n compileAgentsAllScopes,\n type CompilationResult,\n type SkillCopyResult,\n discoverInstalledSkills,\n} from \"../lib/operations/index.js\";\nimport type { GateReport } from \"../lib/config-gate/index.js\";\nimport { fetchSeedConfig } from \"../lib/seed/fetch-seed.js\";\nimport { seedToWizardResult } from \"../lib/seed/seed-to-wizard.js\";\nimport { getInstallationInfo } from \"../lib/plugins/plugin-info.js\";\nimport {\n loadProjectConfig,\n loadProjectConfigFromDir,\n} from \"../lib/configuration/project-config.js\";\nimport {\n type InstallMode,\n detectInstallation,\n detectGlobalInstallation,\n deriveInstallMode,\n resolveInstallPaths,\n buildAgentScopeMap,\n isHomeDirectory,\n INSTALL_MODE_LABELS,\n} from \"../lib/installation/index.js\";\nimport { checkPermissions } from \"../lib/permission-checker.js\";\nimport {\n ASCII_LOGO,\n CLAUDE_SRC_DIR,\n CLI_INVOKE_COMMAND,\n DEFAULT_BRANDING,\n EDIT_PROJECT_SETUP_FLAG,\n EJECT_SOURCE,\n STANDARD_FILES,\n} from \"../consts.js\";\nimport { clearTerminalScreen } from \"../utils/terminal.js\";\nimport { SelectList, type SelectListItem } from \"../components/common/select-list.js\";\nimport { promptValue } from \"../components/common/prompt-confirm.js\";\nimport { Spinner } from \"../components/common/spinner.js\";\nimport { getErrorMessage } from \"../utils/errors.js\";\nimport { EXIT_CODES } from \"../lib/exit-codes.js\";\nimport type { AgentName, ProjectConfig, SkillScope } from \"../types/index.js\";\nimport { type StartupMessage } from \"../utils/logger.js\";\nimport { SUCCESS_MESSAGES, STATUS_MESSAGES } from \"../utils/messages.js\";\n\nconst DASHBOARD_OPTIONS = [\n { label: \"Edit\", value: \"edit\" },\n { label: \"Compile\", value: \"compile\" },\n { label: \"Doctor\", value: \"doctor\" },\n { label: \"List\", value: \"list\" },\n] as const satisfies readonly SelectListItem<string>[];\n\n/** The commands offered by the project dashboard (single source: DASHBOARD_OPTIONS). */\nexport type DashboardCommand = (typeof DASHBOARD_OPTIONS)[number][\"value\"];\n\ntype DashboardProps = {\n onSelect: (command: DashboardCommand) => void;\n onCancel: () => void;\n};\n\nconst Dashboard: React.FC<DashboardProps> = ({ onSelect, onCancel }) => {\n const { exit } = useApp();\n const { rows: terminalHeight } = useTerminalDimensions();\n\n return (\n <Box flexDirection=\"column\" height={terminalHeight}>\n <Box marginBottom={1}>\n <Text>{ASCII_LOGO}</Text>\n </Box>\n <SelectList\n items={DASHBOARD_OPTIONS}\n onSelect={(command) => {\n onSelect(command);\n exit();\n }}\n onCancel={() => {\n onCancel();\n exit();\n }}\n />\n </Box>\n );\n};\n\n/** Formats the dashboard summary as plain text lines (for non-interactive/test output). */\nexport function formatDashboardText(data: DashboardData): string {\n const modeLabel = INSTALL_MODE_LABELS[data.mode];\n const lines = [\n DEFAULT_BRANDING.NAME,\n \"\",\n ` Skills: ${data.skillCount} installed`,\n ` Agents: ${data.agentCount} compiled`,\n ` Mode: ${modeLabel}`,\n ];\n if (data.source) {\n lines.push(` Source: ${data.source}`);\n }\n lines.push(\"\");\n lines.push(` [Edit] [Compile] [Doctor] [List]`);\n return lines.join(\"\\n\");\n}\n\n/**\n * Shows the project dashboard and returns the selected command (or null if cancelled).\n * In non-interactive environments (no TTY), prints the summary text and returns null.\n */\nexport async function showDashboard(\n projectDir: string,\n log?: (message: string) => void,\n): Promise<DashboardCommand | null> {\n const data = await getDashboardData(projectDir);\n\n // Non-interactive: print text summary and exit (CI, piped, tests)\n if (!process.stdin.isTTY) {\n const output = log ?? console.log;\n output(formatDashboardText(data));\n return null;\n }\n\n // First-wins resolution via promptValue; clearOnResolve repaints a clean\n // terminal before unmount (dashboard occupies the full height).\n const selectedCommand = await promptValue<DashboardCommand | null>(\n (resolve) => (\n <Dashboard onSelect={(command) => resolve(command)} onCancel={() => resolve(null)} />\n ),\n { onExit: null, clearOnResolve: true },\n );\n\n clearTerminalScreen();\n\n return selectedCommand;\n}\n\n/**\n * Why the dashboard is on screen.\n *\n * `\"init\"` — the user ran `cc init` in an already-installed directory. That is a request\n * to set this project up, so choosing Edit continues the setup: it must materialise the\n * project even if the wizard changes nothing.\n *\n * `\"standalone\"` — the bare `cc` dashboard. Edit is just an editor there; a pass with no\n * changes is an inspection and must leave the filesystem untouched.\n */\nexport type DashboardOrigin = \"init\" | \"standalone\";\n\n/** The extra argv a dashboard selection needs to carry its origin into the command. */\nfunction dashboardCommandArgv(command: DashboardCommand, origin: DashboardOrigin): string[] {\n if (command !== \"edit\" || origin !== \"init\") return [];\n return [`--${EDIT_PROJECT_SETUP_FLAG}`];\n}\n\n/**\n * Shared dashboard entry: when the project is already initialized, shows the\n * dashboard and runs the chosen command. Returns true when the project was\n * initialized (dashboard shown), false otherwise. Never exits the process —\n * callers decide (the init hook exits SUCCESS at its own call site).\n */\nexport async function runDashboardFlow(\n projectDir: string,\n config: Interfaces.Config,\n origin: DashboardOrigin,\n log?: (message: string) => void,\n): Promise<boolean> {\n const installation = await detectInstallation(projectDir);\n if (!installation) return false;\n\n const selectedCommand = await showDashboard(projectDir, log);\n if (selectedCommand) {\n await config.runCommand(selectedCommand, dashboardCommandArgv(selectedCommand, origin));\n }\n return true;\n}\n\n/**\n * What `init` decided to install, and the little each producer knows that the shared spine does\n * not. Keeping these on the value rather than branching on a flag downstream is what stops the\n * two paths growing separate copies of the install sequence.\n */\ntype Selection = {\n result: WizardResultV2;\n sourceResult: SourceLoadResult;\n /** Whether a person is at the terminal, so the permission notice may wait for them. */\n interactive: boolean;\n /** What to say if the selection turns out to be empty — only the producer knows why it is. */\n emptyMessage: string;\n};\n\nexport default class Init extends BaseCommand {\n static summary = `Initialize ${DEFAULT_BRANDING.NAME} in this project`;\n static description =\n \"Interactive wizard to set up skills and agents. Supports Plugin Mode (native install) and Eject Mode (copy to .claude/).\";\n\n static examples = [\n {\n description: \"Start the setup wizard\",\n command: \"<%= config.bin %> <%= command.id %>\",\n },\n {\n description: \"Initialize from a custom marketplace\",\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 source\",\n default: false,\n }),\n from: Flags.string({\n description: \"Install a configuration shared from agentsinc.sh by its id, without the wizard\",\n helpValue: \"<id>\",\n }),\n };\n\n /**\n * One spine, two producers. The wizard and a shared id differ only in *where the selection\n * comes from* — everything after it (the empty guard, the install pipeline) is identical, so it\n * lives here once rather than being written twice and drifting.\n */\n async run(): Promise<void> {\n const { flags } = await this.parse(Init);\n const projectDir = process.cwd();\n\n // Only a bare `init` is diverted to the dashboard. An id is an explicit instruction to install\n // *that* configuration, so it overrides an existing installation instead.\n if (!flags.from && (await this.showDashboardIfInitialized(projectDir))) return;\n\n const selection = flags.from\n ? await this.selectionFromSharedConfig(flags.from, flags)\n : await this.selectionFromWizard(flags, projectDir);\n\n if (!selection) this.exit(EXIT_CODES.CANCELLED);\n\n // A sub-agent is installable on its own — it has front-matter, a prompt and a compiled file\n // without owning a single skill — so only a selection with neither is nothing to install.\n if (selection.result.skills.length === 0 && selection.result.selectedAgents.length === 0) {\n // The producer supplies the wording because only it knows why empty means what it means:\n // nothing chosen, versus a payload this catalog cannot install.\n this.error(selection.emptyMessage, { exit: EXIT_CODES.ERROR });\n }\n\n await this.handleInstallation(\n selection.result,\n selection.sourceResult,\n flags,\n selection.interactive,\n );\n }\n\n /** The interactive producer: load the source, run the wizard, return what was chosen. */\n private async selectionFromWizard(\n flags: SourceRefreshFlags,\n projectDir: string,\n ): Promise<Selection | null> {\n // The blank global config is created by writeProjectConfig() once the\n // wizard succeeds, never before it renders: a cancelled init must leave no\n // artifact that the next run could mistake for an existing installation.\n const isGlobalRoot = isHomeDirectory(projectDir);\n\n const { unmount, clear: clearSpinner } = render(\n <Spinner label={STATUS_MESSAGES.LOADING_SKILLS} />,\n );\n const [{ sourceResult, startupMessages }, globalConfig] = await Promise.all([\n this.loadSourceOrFail(flags),\n this.loadGlobalConfigIfExists(),\n ]);\n clearSpinner();\n unmount();\n\n const result = await this.runWizard(\n sourceResult,\n startupMessages,\n projectDir,\n globalConfig,\n isGlobalRoot,\n );\n if (!result) return null;\n\n return {\n result,\n sourceResult,\n // A person is already at the terminal, so the permission notice can wait for them.\n interactive: true,\n emptyMessage: \"No skills selected\",\n };\n }\n\n /**\n * The `--from <id>` producer: fetch and map, no wizard. Nothing here may assume a TTY — running\n * headless is most of why the flag exists.\n */\n private async selectionFromSharedConfig(\n id: string,\n flags: SourceRefreshFlags,\n ): Promise<Selection> {\n this.log(`Fetching configuration ${id}...`);\n const fetched = await fetchSeedConfig(id);\n if (!fetched.ok) {\n this.error(fetched.error, { exit: EXIT_CODES.ERROR });\n }\n\n const { sourceResult } = await this.loadSourceOrFail(flags);\n const { result, skippedSkillIds, skippedAgentNames } = seedToWizardResult(\n fetched.payload,\n sourceResult.matrix,\n );\n\n // Named, not counted. \"3 skills were skipped\" cannot be acted on; the ids can, and this is the\n // one moment the user can tell whether what they shared is what they are getting.\n if (skippedSkillIds.length > 0) {\n this.warn(\n `Skipped ${skippedSkillIds.length} skill(s) this catalog does not know: ${skippedSkillIds.join(\", \")}`,\n );\n }\n if (skippedAgentNames.length > 0) {\n this.warn(\n `Skipped ${skippedAgentNames.length} unknown sub-agent(s): ${skippedAgentNames.join(\", \")}`,\n );\n }\n\n if (result.skills.length > 0) {\n this.log(\n `Installing ${result.skills.length} skill(s) across ${result.selectedAgents.length} sub-agent(s)\\n`,\n );\n }\n\n return {\n result,\n sourceResult,\n interactive: false,\n emptyMessage: `Configuration '${id}' contains no skills this catalog can install.`,\n };\n }\n\n private async showDashboardIfInitialized(projectDir: string): Promise<boolean> {\n return runDashboardFlow(projectDir, this.config, \"init\", (msg) => this.log(msg));\n }\n\n private async loadGlobalConfigIfExists(): Promise<ProjectConfig | null> {\n const globalInstall = await detectGlobalInstallation();\n if (!globalInstall) return null;\n const loaded = await loadProjectConfigFromDir(os.homedir());\n return loaded?.config ?? null;\n }\n\n private async loadSourceOrFail(flags: {\n source?: string;\n refresh: boolean;\n }): Promise<{ sourceResult: SourceLoadResult; startupMessages: StartupMessage[] }> {\n try {\n const loaded = await loadSource({\n sourceFlag: flags.source,\n projectDir: process.cwd(),\n forceRefresh: flags.refresh,\n captureStartupMessages: true,\n });\n return { sourceResult: loaded.sourceResult, startupMessages: loaded.startupMessages };\n } catch (error) {\n this.error(getErrorMessage(error), {\n exit: EXIT_CODES.ERROR,\n });\n }\n }\n\n private async runWizard(\n sourceResult: SourceLoadResult,\n startupMessages: StartupMessage[],\n projectDir: string,\n globalConfig: ProjectConfig | null,\n isGlobalRoot: boolean,\n ): Promise<WizardResultV2 | null> {\n return runWizardSession({\n hydrate: {\n initialAgents: globalConfig?.selectedAgents,\n installedSkillIds: globalConfig?.skills?.map((s) => s.id),\n installedSkillConfigs: globalConfig?.skills,\n installedAgentConfigs: globalConfig?.agents,\n isEditingFromGlobalScope: isGlobalRoot,\n },\n props: {\n version: this.config.version,\n logo: ASCII_LOGO,\n initialAgents: globalConfig?.selectedAgents,\n installedSkillIds: globalConfig?.skills?.map((s) => s.id),\n projectDir,\n startupMessages,\n },\n onCancel: () => this.log(\"Setup cancelled\"),\n clearTerminal: () => this.clearTerminal(),\n });\n }\n\n private async handleInstallation(\n result: WizardResultV2,\n sourceResult: SourceLoadResult,\n flags: SourceRefreshFlags,\n /**\n * Whether the caller can hold the terminal. The permission notice is an Ink app with no exit\n * of its own, so `waitUntilExit()` only ever resolves because a person is there to end it —\n * which is fine after the wizard and a hang everywhere else. `--from` sets this false: it has\n * to complete over a pipe and in CI.\n */\n interactive = true,\n ): Promise<void> {\n const projectDir = process.cwd();\n const activeSkills = result.skills.filter((s) => !s.excluded);\n const installMode = deriveInstallMode(activeSkills);\n const ejectedSkills = activeSkills.filter((s) => s.source === EJECT_SOURCE);\n const pluginSkills = activeSkills.filter((s) => s.source !== EJECT_SOURCE);\n\n this.logInstallPlan(installMode, ejectedSkills, pluginSkills);\n\n // Resolve marketplace up front — BEFORE any filesystem mutation. If\n // resolution fails in mixed mode, the hard-error must fire before\n // `copyEjectSkillsStep` copies anything to `.claude/skills/`, otherwise\n // we leave an orphaned half-install with no config.ts to recognise it.\n const resolvedMarketplace =\n pluginSkills.length > 0\n ? await this.requireMarketplaceOrExit(\n sourceResult,\n \"install plugin skills\",\n (marketplace) => this.log(`Registering marketplace \"${marketplace}\"...`),\n )\n : null;\n\n const copyResult =\n installMode === \"eject\" || installMode === \"mixed\"\n ? await this.copyEjectSkillsStep(ejectedSkills, projectDir, sourceResult, installMode)\n : null;\n\n if (resolvedMarketplace !== null) {\n await this.installPluginsStep(pluginSkills, resolvedMarketplace, projectDir);\n }\n // installPluginsStep hard-errors on any failure, so reaching here with a\n // resolved marketplace means plugin mode fully succeeded.\n const pluginModeSucceeded = resolvedMarketplace !== null;\n\n try {\n const { configResult, compileResult, agentScopeMap } = await this.writeConfigAndCompile(\n result,\n sourceResult,\n flags,\n );\n this.reportSuccess(\n configResult,\n compileResult,\n agentScopeMap,\n installMode,\n pluginModeSucceeded,\n copyResult,\n );\n\n const permissionWarning = await checkPermissions(projectDir);\n if (permissionWarning) {\n if (interactive) {\n const { waitUntilExit } = render(permissionWarning);\n await waitUntilExit();\n } else {\n // Render one frame and let go. The notice is information, not a prompt — there is\n // nothing to answer, so nothing to wait for.\n const { unmount } = render(permissionWarning);\n unmount();\n }\n }\n } catch (error) {\n this.handleError(error);\n }\n }\n\n private logInstallPlan(\n installMode: InstallMode,\n ejectedSkills: WizardResultV2[\"skills\"],\n pluginSkills: WizardResultV2[\"skills\"],\n ): void {\n this.log(\"\\n\");\n this.log(`Selected ${ejectedSkills.length + pluginSkills.length} skills`);\n this.log(\n `Install mode: ${\n installMode === \"plugin\"\n ? `${INSTALL_MODE_LABELS.plugin} (native install)`\n : installMode === \"mixed\"\n ? `${INSTALL_MODE_LABELS.mixed} (${ejectedSkills.length} eject, ${pluginSkills.length} plugin)`\n : `${INSTALL_MODE_LABELS.eject} (copy to .claude/skills/)`\n }`,\n );\n }\n\n private async copyEjectSkillsStep(\n localSkills: WizardResultV2[\"skills\"],\n projectDir: string,\n sourceResult: SourceLoadResult,\n installMode: InstallMode,\n ): Promise<SkillCopyResult> {\n this.log(\"Copying skills to local directory...\");\n const copyResult = await copyLocalSkills(localSkills, projectDir, sourceResult);\n\n if (installMode === \"mixed\") {\n if (copyResult.projectCopied.length > 0 && copyResult.globalCopied.length > 0) {\n this.log(\n `Copied ${copyResult.totalCopied} local skills (${copyResult.projectCopied.length} project, ${copyResult.globalCopied.length} global)`,\n );\n } else if (copyResult.globalCopied.length > 0) {\n this.log(`Copied ${copyResult.globalCopied.length} local skills to ~/.claude/skills/`);\n } else {\n this.log(`Copied ${copyResult.projectCopied.length} local skills to .claude/skills/`);\n }\n } else {\n this.log(`Copied ${copyResult.totalCopied} skills to .claude/skills/\\n`);\n }\n\n return copyResult;\n }\n\n private async installPluginsStep(\n pluginSkills: WizardResultV2[\"skills\"],\n marketplace: string,\n projectDir: string,\n ): Promise<void> {\n this.log(\"Installing skill plugins...\");\n const pluginResult = await installPluginSkills(pluginSkills, marketplace, projectDir);\n\n for (const item of pluginResult.installed) {\n this.log(` Installed ${item.ref}`);\n }\n for (const item of pluginResult.failed) {\n this.warn(`Failed to install plugin ${item.id}: ${item.error}`);\n }\n\n // Plugin install intent is inviolable — if any skill failed to install, hard-error\n // BEFORE `writeConfigAndCompile` writes config.ts with orphan entries claiming\n // the skill is installed. Matches the no-plugin-to-eject-fallback rule.\n if (pluginResult.failed.length > 0) {\n this.error(pluginInstallFailureError(pluginResult.failed.length), {\n exit: EXIT_CODES.ERROR,\n });\n }\n\n this.log(`Installed ${pluginResult.installed.length} skill plugins\\n`);\n }\n\n private async writeConfigAndCompile(\n result: WizardResultV2,\n sourceResult: SourceLoadResult,\n flags: SourceRefreshFlags,\n ): Promise<{\n configResult: Awaited<ReturnType<typeof writeProjectConfig>>;\n compileResult: CompilationResult;\n agentScopeMap: Map<AgentName, SkillScope>;\n }> {\n this.log(\"Generating configuration...\");\n const configResult = await writeProjectConfig({\n wizardResult: result,\n sourceResult,\n projectDir: process.cwd(),\n sourceFlag: flags.source,\n });\n\n if (configResult.wasMerged) {\n this.log(`Merged with existing config at ${configResult.existingConfigPath}`);\n }\n\n this.log(`Configuration saved (${configResult.config.agents.length} agents)\\n`);\n\n this.log(STATUS_MESSAGES.COMPILING_AGENTS);\n const cwd = process.cwd();\n const agentDefs = await loadAgentDefs();\n const { allSkills } = await discoverInstalledSkills(cwd);\n const agentScopeMap = buildAgentScopeMap(configResult.config);\n const compileResult = await compileAgentsAllScopes({\n projectDir: cwd,\n sourcePath: agentDefs.sourcePath,\n skills: allSkills,\n agentScopeMap,\n });\n this.log(`Compiled ${compileResult.compiled.length} agents\\n`);\n\n this.reportPropagatedRecompile(configResult.propagation);\n\n return { configResult, compileResult, agentScopeMap };\n }\n\n /**\n * Renders the recompile the gated write already performed on every OTHER\n * registered project this run's global change was propagated into.\n */\n private reportPropagatedRecompile(propagation: GateReport): void {\n if (propagation.propagated.updated.length === 0) return;\n\n const { recompiledCount, failedCount, warnings } = propagation.recompile;\n for (const warning of warnings) {\n this.warn(warning);\n }\n\n const failureSuffix = failedCount > 0 ? ` (${failedCount} failed)` : \"\";\n this.log(`Recompiled agents in ${recompiledCount} registered projects${failureSuffix}\\n`);\n }\n\n private reportSuccess(\n configResult: Awaited<ReturnType<typeof writeProjectConfig>>,\n compileResult: CompilationResult,\n agentScopeMap: Map<AgentName, SkillScope>,\n installMode: InstallMode,\n pluginModeSucceeded: boolean,\n copyResult: SkillCopyResult | null,\n ): void {\n this.log(`${SUCCESS_MESSAGES.INIT_SUCCESS}\\n`);\n\n const isEjectOutput =\n installMode === \"eject\" || (installMode === \"mixed\" && !pluginModeSucceeded);\n if (isEjectOutput && copyResult && copyResult.totalCopied > 0) {\n this.reportSkillsCopied(copyResult);\n }\n this.reportAgentsCompiled(compileResult.compiled, agentScopeMap);\n this.log(\"Configuration:\");\n this.log(` ${configResult.configPath}`);\n this.log(\"\");\n this.log(\"To customize agent-skill assignments:\");\n this.log(` 1. Edit ${CLAUDE_SRC_DIR}/${STANDARD_FILES.CONFIG_TS}`);\n this.log(` 2. Run '${CLI_INVOKE_COMMAND} compile' to regenerate agents`);\n this.log(\"\");\n }\n\n /**\n * Reports where the skills actually landed. `copyLocalSkills` splits by scope,\n * so a default install driven from a project directory writes every skill\n * under HOME — reporting the project path there names a directory that was\n * never written.\n *\n * This block is a filesystem listing, so the entries are the on-disk directory\n * names — skill ids, not display names. `copySkillsToLocalFlattened` names each\n * destination directory after `skill.id`, so a user can copy any line and `cd`\n * into it.\n */\n private reportSkillsCopied(copyResult: SkillCopyResult): void {\n const cwd = process.cwd();\n const groups = isHomeDirectory(cwd)\n ? [\n {\n dir: resolveInstallPaths(cwd, \"project\").skillsDir,\n copied: [...copyResult.globalCopied, ...copyResult.projectCopied],\n },\n ]\n : [\n { dir: resolveInstallPaths(cwd, \"global\").skillsDir, copied: copyResult.globalCopied },\n { dir: resolveInstallPaths(cwd, \"project\").skillsDir, copied: copyResult.projectCopied },\n ].filter((group) => group.copied.length > 0);\n\n for (const group of groups) {\n this.log(\"Skills copied to:\");\n this.log(` ${group.dir}`);\n for (const copied of group.copied) {\n this.log(` ${copied.skillId}/`);\n }\n this.log(\"\");\n }\n }\n\n /**\n * Reports where the agents actually landed, mirroring the scope split\n * `compileAgentsAllScopes` performs: one pass at the home root, otherwise a\n * global pass under HOME and a project pass under the project directory.\n */\n private reportAgentsCompiled(\n compiled: AgentName[],\n agentScopeMap: Map<AgentName, SkillScope>,\n ): void {\n const cwd = process.cwd();\n const groups = isHomeDirectory(cwd)\n ? [{ dir: resolveInstallPaths(cwd, \"project\").agentsDir, agents: compiled }]\n : [\n {\n dir: resolveInstallPaths(cwd, \"global\").agentsDir,\n agents: compiled.filter((name) => agentScopeMap.get(name) === \"global\"),\n },\n {\n dir: resolveInstallPaths(cwd, \"project\").agentsDir,\n agents: compiled.filter((name) => agentScopeMap.get(name) !== \"global\"),\n },\n ].filter((group) => group.agents.length > 0);\n\n for (const group of groups) {\n this.log(\"Agents compiled to:\");\n this.log(` ${group.dir}`);\n for (const agentName of group.agents) {\n this.log(` ${agentName}.md`);\n }\n this.log(\"\");\n }\n }\n}\n\nexport type DashboardData = {\n skillCount: number;\n agentCount: number;\n mode: InstallMode;\n source?: string;\n};\n\n/**\n * Gathers dashboard data from the installation and project config.\n *\n * Both counts come from the same scope-aware installation so the summary cannot\n * mix a project-only figure with a global one — a default install driven from a\n * project directory puts every skill and agent under HOME.\n */\nexport async function getDashboardData(projectDir: string): Promise<DashboardData> {\n const [info, loaded] = await Promise.all([getInstallationInfo(), loadProjectConfig(projectDir)]);\n\n const activeSkills = loaded?.config?.skills?.filter((s) => !s.excluded);\n const skillCount = info?.skillCount ?? 0;\n const agentCount = info?.agentCount ?? 0;\n const mode = info?.mode ?? (activeSkills ? deriveInstallMode(activeSkills) : \"eject\");\n const source = loaded?.config?.source;\n\n return { skillCount, agentCount, mode, source };\n}\n","import { z } from \"zod\";\n\n/**\n * VENDORED from `packages/matrix/src/seed.ts` — keep in sync.\n *\n * The wire contract for configs shared from agentsinc.sh. The web app POSTs a payload to the\n * config store and gets a short id back; `npx agents-inc init --from <id>` fetches that id and\n * validates it with this same schema.\n *\n * The reason for copying rather than depending has expired. It was that a shared package spanning\n * two repositories would need publishing and a release step for forty lines of Zod that no consumer\n * had exercised. The repositories merged on 2026-08-03, so `packages/matrix` is now a workspace\n * sibling: `@workspace/matrix` could be depended on directly, with no publish and no versioning.\n *\n * What keeps the copy is inertia, not that argument — nothing has re-examined it since the merge,\n * and this package deliberately ships to npm while `@workspace/matrix` is private, so a dependency\n * would have to be bundled rather than declared. De-duplicating is D-239's job, and D-239's premise\n * changed with the merge too.\n */\n\n/**\n * Bump when the payload shape changes. Only the current version is accepted: pre-1.0 policy is to\n * fail a stale id loudly rather than migrate it, so what installs is always what was shared.\n *\n * v3 gave the sub-agent its own scope. An additive-optional field would not normally need a\n * version, but this schema strips what it does not declare — so the version is what tells a\n * sharing app the field actually survives the trip.\n */\nexport const SEED_VERSION = 3;\n\nexport const seedModelSchema = z.enum([\"opus\", \"fable\", \"sonnet\", \"haiku\"]);\nexport const seedEffortSchema = z.enum([\"low\", \"medium\", \"high\", \"xhigh\", \"max\"]);\nexport const seedLoadStateSchema = z.enum([\"lazy\", \"preloaded\"]);\n\nexport const seedSkillSchema = z.object({\n install: z.enum([\"plugin\", \"eject\"]),\n scope: z.enum([\"project\", \"global\"]),\n /** Sub-agent id -> load state; presence is assignment. */\n assignments: z.record(z.string(), seedLoadStateSchema),\n});\n\n/**\n * What a shared configuration says about one sub-agent. Every field is optional because each says\n * something different on its own: `on: true` is the only way a sub-agent with no skills of its own\n * can travel, while model/effort are overrides for an agent an assignment already selects.\n */\nexport const seedAgentSchema = z.object({\n /** Explicitly switched on (bare) or off. Absent means \"whatever the assignments imply\". */\n on: z.boolean().optional(),\n model: seedModelSchema.optional(),\n effort: seedEffortSchema.optional(),\n /**\n * Which `.claude/agents` directory this sub-agent's front-matter is written to. Absent means\n * `project` — the CLI's own default, so a resting choice never has to travel.\n */\n scope: z.enum([\"project\", \"global\"]).optional(),\n});\n\n/**\n * Ids are full catalog slugs, never positional indices, so a payload survives catalog churn:\n * consumers warn and skip unknown ids rather than failing the whole decode.\n */\nexport const seedPayloadSchema = z.object({\n v: z.literal(SEED_VERSION),\n /**\n * Diagnostics only. A mismatch with this CLI's matrix must never fail a decode — it explains\n * why some ids were skipped, it does not decide whether to try.\n */\n matrixVersion: z.string(),\n stackId: z.string().nullable(),\n /** Sparse — presence is selection. `remembered` never leaves the browser. */\n skills: z.record(z.string(), seedSkillSchema),\n /** Sparse — an agent with nothing to say has no entry. */\n agents: z.record(z.string(), seedAgentSchema),\n});\n\nexport type SeedModel = z.infer<typeof seedModelSchema>;\nexport type SeedEffort = z.infer<typeof seedEffortSchema>;\nexport type SeedLoadState = z.infer<typeof seedLoadStateSchema>;\nexport type SeedSkill = z.infer<typeof seedSkillSchema>;\nexport type SeedAgent = z.infer<typeof seedAgentSchema>;\nexport type SeedPayload = z.infer<typeof seedPayloadSchema>;\n","import { seedPayloadSchema, type SeedPayload } from \"./seed-schema.js\";\n\n/** The config store behind agentsinc.sh. Overridable so tests never touch the network. */\nexport const SEED_API_URL = process.env.AGENTS_INC_API_URL ?? \"https://api.agentsinc.sh\";\n\n/**\n * Identifies this fetch as the CLI rather than a browser.\n *\n * `GET /configs/:id` is the only place either side can observe a config being *installed* rather\n * than merely built, and the worker can only separate that from someone opening a share link if\n * we say so. Without this the conversion signal does not exist.\n */\nexport const SEED_USER_AGENT = \"agents-inc-cli\";\n\nexport type FetchSeedResult = { ok: true; payload: SeedPayload } | { ok: false; error: string };\n\n/**\n * Fetches and validates a shared configuration.\n *\n * Every failure is a message rather than a throw: this runs before anything has been written, so\n * there is nothing to roll back and the caller's job is to explain rather than recover.\n */\nexport async function fetchSeedConfig(id: string): Promise<FetchSeedResult> {\n const url = `${SEED_API_URL}/configs/${encodeURIComponent(id)}`;\n\n let response: Response;\n try {\n response = await fetch(url, {\n headers: { accept: \"application/json\", \"user-agent\": SEED_USER_AGENT },\n });\n } catch {\n return { ok: false, error: `Could not reach ${SEED_API_URL} — check your connection.` };\n }\n\n if (response.status === 404) {\n return { ok: false, error: `No configuration found for id '${id}'.` };\n }\n if (!response.ok) {\n return { ok: false, error: `Fetching configuration failed (HTTP ${response.status}).` };\n }\n\n let body: unknown;\n try {\n body = await response.json();\n } catch {\n return { ok: false, error: \"The configuration store returned something that is not JSON.\" };\n }\n\n const parsed = seedPayloadSchema.safeParse(body);\n if (!parsed.success) {\n // Validated on the way in, so a stored payload that no longer parses means the contract moved\n // underneath it — worth saying plainly rather than reporting a generic failure.\n return {\n ok: false,\n error: `Configuration '${id}' does not match the expected format — it may have been created by a newer version.`,\n };\n }\n\n return { ok: true, payload: parsed.data };\n}\n","import { AGENT_NAMES } from \"../../types/agents.js\";\nimport { DEFAULT_PUBLIC_SOURCE_NAME } from \"../../consts.js\";\nimport { getCategoryDomain } from \"../matrix/matrix-provider.js\";\nimport { orderDomains } from \"../wizard/domain-order.js\";\n\nimport type { WizardResultV2 } from \"../../components/wizard/wizard.js\";\nimport type { AgentName } from \"../../types/agents.js\";\nimport type { AgentScopeConfig, SkillConfig } from \"../../types/config.js\";\nimport type {\n Category,\n Domain,\n DomainSelections,\n MergedSkillsMatrix,\n ResolvedSkill,\n} from \"../../types/matrix.js\";\nimport type { SkillAssignment, SkillId } from \"../../types/skills.js\";\nimport type { StackAgentConfig } from \"../../types/stacks.js\";\nimport type { SeedAgent, SeedLoadState, SeedPayload } from \"./seed-schema.js\";\n\nexport type SeedMapping = {\n result: WizardResultV2;\n /** Ids this matrix does not know. Reported, never fatal — see the decode policy. */\n skippedSkillIds: string[];\n skippedAgentNames: string[];\n};\n\nconst KNOWN_AGENTS = new Set<string>(AGENT_NAMES);\n\n/** A skill's primary source, or the default marketplace. Mirrors the wizard's own resolution. */\nfunction sourceForSkill(skill: ResolvedSkill | undefined): string {\n return skill?.availableSources?.find((s) => s.primary)?.name ?? DEFAULT_PUBLIC_SOURCE_NAME;\n}\n\nfunction addToDomainSelections(\n selections: DomainSelections,\n domain: Domain,\n category: Category,\n skillId: SkillId,\n): void {\n const categorySelections = (selections[domain] ??= {});\n const skillList = (categorySelections[category] ??= []);\n if (!skillList.includes(skillId)) skillList.push(skillId);\n}\n\n/**\n * The stack mirror of {@link addToDomainSelections}: one sub-agent's own category lists, appended\n * in payload order. A `(skill, sub-agent)` pair can only occur once — `skills` is keyed by id — so\n * there is nothing to de-duplicate here.\n */\nfunction addToAgentStack(\n stack: Partial<Record<AgentName, StackAgentConfig>>,\n agent: AgentName,\n category: Category,\n assignment: SkillAssignment,\n): void {\n const agentStack = (stack[agent] ??= {});\n const assignments = (agentStack[category] ??= []);\n assignments.push(assignment);\n}\n\n/** A load state is per `(skill, sub-agent)`; `preloaded` is the stack's word for the same thing. */\nfunction toSkillAssignment(skillId: SkillId, load: SeedLoadState): SkillAssignment {\n return { id: skillId, preloaded: load === \"preloaded\" };\n}\n\n/** The payload's `agents` map, split by what this catalog can do with each entry. */\ntype SeedAgentMap = {\n /** Known agents the map has something to say about, keyed by name. */\n known: Map<AgentName, SeedAgent>;\n /** Names explicitly switched off — dropped, and their assignment rows ignored with them. */\n switchedOff: Set<string>;\n /** Names this catalog does not know. Reported, never fatal — same policy as unknown skill ids. */\n unknown: string[];\n};\n\nfunction readAgentMap(agents: SeedPayload[\"agents\"]): SeedAgentMap {\n const known = new Map<AgentName, SeedAgent>();\n const switchedOff = new Set<string>();\n const unknown: string[] = [];\n\n for (const [name, entry] of Object.entries(agents)) {\n if (!KNOWN_AGENTS.has(name)) unknown.push(name);\n else if (entry.on === false) switchedOff.add(name);\n else known.set(name as AgentName, entry);\n }\n\n return { known, switchedOff, unknown };\n}\n\n/**\n * Where a sub-agent's front-matter is written is the payload's to say, per agent and\n * independently of any skill's scope: an entry may send its agent to the user's own ~/.claude,\n * and one that names no scope stays in the project, which is the CLI's default. Model and effort\n * ride along on the same terms — an absent key means \"keep whatever the agent's metadata says\".\n */\nfunction agentScopeConfig(name: AgentName, entry: SeedAgent | undefined): AgentScopeConfig {\n return {\n name,\n scope: entry?.scope ?? \"project\",\n ...(entry?.model !== undefined && { model: entry.model }),\n ...(entry?.effort !== undefined && { effort: entry.effort }),\n };\n}\n\n/**\n * Turns a shared configuration into the shape the install pipeline already consumes, so\n * `init --from` reuses `writeProjectConfig` -> skill install -> `compileAgentsAllScopes`\n * unchanged rather than growing a second path that can drift from the wizard's.\n *\n * Unknown ids are skipped, never fatal. Payloads carry catalog slugs precisely so they survive\n * catalog churn: a config shared before a skill was renamed should still install everything else,\n * and failing the whole decode would make every rename retroactively break every shared id.\n *\n * A sub-agent reaches the roster two ways: named by a surviving skill's assignment, or switched on\n * in the `agents` map. The map is the only place a configuration can say anything about an agent\n * no skill mentions, which is what makes a bare (skill-less) agent shareable at all; it also\n * carries that agent's model and effort onto its `AgentScopeConfig`.\n *\n * The `assignments` map is per `(skill, sub-agent)` and carries a load state, so it decides three\n * things the wizard cannot express separately: which sub-agents are selected, which skills land in\n * each one's stack entry, and which of those preload. That is why the result carries an\n * `assignedStack` — the install pipeline's ownership rules broadcast every scope-compatible skill\n * to every selected agent, which would hand a bare sub-agent someone else's skills.\n */\nexport function seedToWizardResult(payload: SeedPayload, matrix: MergedSkillsMatrix): SeedMapping {\n const domainSelections: DomainSelections = {};\n const assignedStack: Partial<Record<AgentName, StackAgentConfig>> = {};\n const skills: SkillConfig[] = [];\n const skippedSkillIds: string[] = [];\n const agentNames = new Set<AgentName>();\n const agentMap = readAgentMap(payload.agents);\n const skippedAgentNames = new Set<string>(agentMap.unknown);\n\n for (const [skillId, entry] of Object.entries(payload.skills)) {\n const skill = matrix.skills[skillId as SkillId];\n const domain = skill?.category ? getCategoryDomain(skill.category) : undefined;\n\n if (!skill?.category || !domain) {\n skippedSkillIds.push(skillId);\n continue;\n }\n\n // Past the guard the matrix knows this id, and its category is a real one: the `local`\n // pseudo-category has no domain, so it left with the skips.\n const id = skillId as SkillId;\n const category = skill.category as Category;\n\n addToDomainSelections(domainSelections, domain, category, id);\n\n skills.push({\n id,\n scope: entry.scope,\n // \"eject\" is a source in its own right; anything else names the marketplace it came from.\n source: entry.install === \"eject\" ? \"eject\" : sourceForSkill(skill),\n });\n\n // Only assignments on skills that survived — an agent should not be switched on by a skill\n // this catalog cannot install.\n for (const [agentName, load] of Object.entries(entry.assignments)) {\n if (agentMap.switchedOff.has(agentName)) continue;\n if (!KNOWN_AGENTS.has(agentName)) {\n skippedAgentNames.add(agentName);\n continue;\n }\n\n const agent = agentName as AgentName;\n agentNames.add(agent);\n // The assignment is the curation: this sub-agent holds this skill, at this load state, and\n // no sub-agent the payload did not name holds it at all.\n addToAgentStack(assignedStack, agent, category, toSkillAssignment(id, load));\n }\n }\n\n // Bare agents: switched on by the map alone, with no skill to carry them in.\n for (const [name, entry] of agentMap.known) {\n if (entry.on === true) agentNames.add(name);\n }\n\n const selectedAgents = [...agentNames];\n\n return {\n result: {\n skills,\n selectedAgents,\n agentConfigs: selectedAgents.map((name) => agentScopeConfig(name, agentMap.known.get(name))),\n assignedStack,\n selectedStackId: payload.stackId,\n domainSelections,\n selectedDomains: orderDomains(Object.keys(domainSelections) as Domain[]),\n // Nothing was dropped from a *saved config* — the skipped ids came off the wire and are\n // reported to the user directly, so there is no existing entry to preserve.\n unresolvableSkillIds: [],\n cancelled: false,\n // A shared configuration was already validated by the app that built it; this path has no\n // interactive step in which a validation warning could be acted on.\n validation: { valid: true, errors: [], warnings: [] },\n },\n skippedSkillIds,\n skippedAgentNames: [...skippedAgentNames],\n };\n}\n","import React from \"react\";\nimport { z } from \"zod\";\n\nimport { Text, Box } from \"ink\";\nimport path from \"path\";\n\nimport { CLAUDE_DIR, CLI_COLORS, MAX_CONFIG_FILE_SIZE, STANDARD_FILES } from \"../consts\";\nimport { fileExists, readFileSafe } from \"../utils/fs\";\nimport { warn } from \"../utils/logger\";\nimport { settingsFileSchema } from \"./schemas\";\n\ntype SettingsFile = z.infer<typeof settingsFileSchema>;\ntype PermissionConfig = NonNullable<SettingsFile[\"permissions\"]>;\n\n/**\n * Reads one settings file's permissions block; undefined when absent, malformed, or empty.\n *\n * settings.json belongs to Claude Code, which adds keys on its own release schedule. This CLI\n * consumes `permissions` and owns nothing else in the file, so it stays silent about every other\n * field rather than warning about settings it has no standing to judge (D-304).\n */\nasync function readSettingsPermissions(filePath: string): Promise<PermissionConfig | undefined> {\n if (!(await fileExists(filePath))) return undefined;\n try {\n const content = await readFileSafe(filePath, MAX_CONFIG_FILE_SIZE);\n const raw = JSON.parse(content);\n const result = settingsFileSchema.safeParse(raw);\n const parsed: SettingsFile = result.success ? result.data : {};\n return parsed.permissions;\n } catch {\n warn(`Malformed settings file at '${filePath}' — skipping`);\n return undefined;\n }\n}\n\n/** Permissions from the first settings file that defines them — settings.local.json wins. */\nasync function loadPermissions(projectRoot: string): Promise<PermissionConfig | undefined> {\n const settingsPath = path.join(projectRoot, CLAUDE_DIR, STANDARD_FILES.SETTINGS_JSON);\n const localSettingsPath = path.join(projectRoot, CLAUDE_DIR, STANDARD_FILES.SETTINGS_LOCAL_JSON);\n\n for (const filePath of [localSettingsPath, settingsPath]) {\n const permissions = await readSettingsPermissions(filePath);\n if (permissions) return permissions;\n }\n return undefined;\n}\n\nexport async function checkPermissions(projectRoot: string): Promise<React.ReactElement | null> {\n const permissions = await loadPermissions(projectRoot);\n\n if (!permissions) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Notice\n </Text>\n <Text>No permissions configured in .claude/settings.json</Text>\n <Text>Agents will prompt for approval on each tool use.</Text>\n <Text> </Text>\n <Text>For autonomous operation, add to .claude/settings.json:</Text>\n <Text> </Text>\n <Text color={CLI_COLORS.DIM}>{\"{\"}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"permissions\": {'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"allow\": ['}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Read(*)\",'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Bash(git *)\",'}</Text>\n <Text color={CLI_COLORS.DIM}>{' \"Bash(bun *)\"'}</Text>\n <Text color={CLI_COLORS.DIM}>{\" ]\"}</Text>\n <Text color={CLI_COLORS.DIM}>{\" }\"}</Text>\n <Text color={CLI_COLORS.DIM}>{\"}\"}</Text>\n </Box>\n );\n }\n\n const hasRestrictiveBash = permissions.deny?.some(\n (rule) => rule === \"Bash(*)\" || rule === \"Bash\",\n );\n const hasNoAllows = !permissions.allow || permissions.allow.length === 0;\n\n if (hasRestrictiveBash || hasNoAllows) {\n return (\n <Box flexDirection=\"column\" borderStyle=\"round\" borderColor={CLI_COLORS.WARNING} padding={1}>\n <Text bold color={CLI_COLORS.WARNING}>\n Permission Warnings\n </Text>\n {hasRestrictiveBash && (\n <Text>\n ⚠ Bash is denied in permissions. Some agents require Bash for git, testing, and build\n commands.\n </Text>\n )}\n {hasNoAllows && (\n <Text>⚠ No allow rules configured. Agents will prompt for each tool use.</Text>\n )}\n </Box>\n );\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,QAAQ;AAGf,SAAS,aAA8B;AACvC,SAAS,OAAAA,MAAK,QAAAC,OAAM,cAAc;;;ACJlC,SAAS,SAAS;AA4B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,IAAI,MAAM,QAAQ,IAAI,CAAC,oBAAoB,GAAG,kBAAkB,UAAU,CAAC,CAAC;AAE/F,QAAM,eAAe,QAAQ,QAAQ,QAAQ,OAAO,CAAC,MAAM,CAAC,EAAE,QAAQ;AACtE,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,aAAa,MAAM,cAAc;AACvC,QAAM,OAAO,MAAM,SAAS,eAAe,kBAAkB,YAAY,IAAI;AAC7E,QAAM,SAAS,QAAQ,QAAQ;AAE/B,SAAO,EAAE,YAAY,YAAY,MAAM,OAAO;AAChD;","names":["Box","Text","jsx","jsxs","Box","Text"]}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
} from "./chunk-
|
|
3
|
+
render
|
|
4
|
+
} from "./chunk-JFLVEFFP.js";
|
|
5
5
|
|
|
6
6
|
// src/cli/components/common/prompt-confirm.tsx
|
|
7
|
-
init_esm_shims();
|
|
8
|
-
import { render } from "ink";
|
|
9
7
|
async function promptValue(build, options) {
|
|
10
8
|
return new Promise((resolve) => {
|
|
11
9
|
const instance = render(
|
|
@@ -32,4 +30,4 @@ export {
|
|
|
32
30
|
promptValue,
|
|
33
31
|
promptConfirm
|
|
34
32
|
};
|
|
35
|
-
//# sourceMappingURL=chunk-
|
|
33
|
+
//# sourceMappingURL=chunk-Q2KG7UV3.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/common/prompt-confirm.tsx"],"sourcesContent":["import React from \"react\";\nimport { render } from \"../render.js\";\n\nexport type ConfirmHandlers = {\n onConfirm: () => void;\n onCancel: () => void;\n};\n\nexport type PromptValueOptions<T> = {\n /** Value resolved when the Ink app exits before any callback fires (Ctrl+C / render failure). */\n onExit: T;\n /** Call instance.clear() before unmount — repaints a clean terminal (used by the dashboard). */\n clearOnResolve?: boolean;\n};\n\n/**\n * Renders an Ink prompt and resolves with the value produced by its callbacks.\n * First-wins: the first resolve (a callback or the app-exit fallback) settles the\n * promise; later resolves are ignored. The element is unmounted at the resolution\n * site (optionally cleared first). Callers own exit policy (exit codes, logging).\n */\nexport async function promptValue<T>(\n build: (resolve: (value: T) => void) => React.ReactElement,\n options: PromptValueOptions<T>,\n): Promise<T> {\n return new Promise<T>((resolve) => {\n const instance = render(\n build((value) => {\n if (options.clearOnResolve) instance.clear();\n instance.unmount();\n resolve(value);\n }),\n );\n // App exit without a callback (e.g. Ctrl+C) or a render failure counts as the\n // fallback; resolve is first-wins, so a prior callback value is unaffected.\n instance.waitUntilExit().then(\n () => resolve(options.onExit),\n () => resolve(options.onExit),\n );\n });\n}\n\n/**\n * Renders a confirm UI and resolves with the user's choice. The element is\n * unmounted as soon as either handler fires; a clean exit or render failure\n * without a choice resolves as \"cancelled\". Callers own exit policy.\n */\nexport async function promptConfirm(\n build: (handlers: ConfirmHandlers) => React.ReactElement,\n): Promise<\"confirmed\" | \"cancelled\"> {\n return promptValue<\"confirmed\" | \"cancelled\">(\n (resolve) =>\n build({ onConfirm: () => resolve(\"confirmed\"), onCancel: () => resolve(\"cancelled\") }),\n { onExit: \"cancelled\" },\n );\n}\n"],"mappings":";;;;;;AAqBA,eAAsB,YACpB,OACA,SACY;AACZ,SAAO,IAAI,QAAW,CAAC,YAAY;AACjC,UAAM,WAAW;AAAA,MACf,MAAM,CAAC,UAAU;AACf,YAAI,QAAQ,eAAgB,UAAS,MAAM;AAC3C,iBAAS,QAAQ;AACjB,gBAAQ,KAAK;AAAA,MACf,CAAC;AAAA,IACH;AAGA,aAAS,cAAc,EAAE;AAAA,MACvB,MAAM,QAAQ,QAAQ,MAAM;AAAA,MAC5B,MAAM,QAAQ,QAAQ,MAAM;AAAA,IAC9B;AAAA,EACF,CAAC;AACH;AAOA,eAAsB,cACpB,OACoC;AACpC,SAAO;AAAA,IACL,CAAC,YACC,MAAM,EAAE,WAAW,MAAM,QAAQ,WAAW,GAAG,UAAU,MAAM,QAAQ,WAAW,EAAE,CAAC;AAAA,IACvF,EAAE,QAAQ,YAAY;AAAA,EACxB;AACF;","names":[]}
|
|
@@ -2,13 +2,9 @@
|
|
|
2
2
|
import {
|
|
3
3
|
CLI_COLORS,
|
|
4
4
|
UI_SYMBOLS
|
|
5
|
-
} from "./chunk-
|
|
6
|
-
import {
|
|
7
|
-
init_esm_shims
|
|
8
|
-
} from "./chunk-P56WJ5FA.js";
|
|
5
|
+
} from "./chunk-76ADG7LQ.js";
|
|
9
6
|
|
|
10
7
|
// src/cli/components/wizard/selection-card.tsx
|
|
11
|
-
init_esm_shims();
|
|
12
8
|
import { Box, Text } from "ink";
|
|
13
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
14
10
|
var SelectionCard = ({
|
|
@@ -38,4 +34,4 @@ var SelectionCard = ({
|
|
|
38
34
|
export {
|
|
39
35
|
SelectionCard
|
|
40
36
|
};
|
|
41
|
-
//# sourceMappingURL=chunk-
|
|
37
|
+
//# sourceMappingURL=chunk-Q45ZU6HD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/selection-card.tsx"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\n\ntype SelectionCardProps = {\n label: string;\n description: string | string[];\n isFocused: boolean;\n marginBottom?: number;\n};\n\nexport const SelectionCard: React.FC<SelectionCardProps> = ({\n label,\n description,\n isFocused,\n marginBottom,\n}) => {\n const descriptionLines = Array.isArray(description) ? description : [description];\n\n return (\n <Box\n borderStyle=\"round\"\n borderColor={isFocused ? CLI_COLORS.PRIMARY : CLI_COLORS.NEUTRAL}\n paddingX={2}\n paddingY={1}\n marginBottom={marginBottom}\n width=\"100%\"\n >\n <Box flexDirection=\"column\" gap={1}>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined} bold={isFocused}>\n {isFocused ? `${UI_SYMBOLS.CHEVRON} ${label}` : label}\n </Text>\n {descriptionLines.map((line, index) => (\n <Text key={index} dimColor>\n {line}\n </Text>\n ))}\n </Box>\n </Box>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/selection-card.tsx"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { CLI_COLORS, UI_SYMBOLS } from \"../../consts.js\";\n\ntype SelectionCardProps = {\n label: string;\n description: string | string[];\n isFocused: boolean;\n marginBottom?: number;\n};\n\nexport const SelectionCard: React.FC<SelectionCardProps> = ({\n label,\n description,\n isFocused,\n marginBottom,\n}) => {\n const descriptionLines = Array.isArray(description) ? description : [description];\n\n return (\n <Box\n borderStyle=\"round\"\n borderColor={isFocused ? CLI_COLORS.PRIMARY : CLI_COLORS.NEUTRAL}\n paddingX={2}\n paddingY={1}\n marginBottom={marginBottom}\n width=\"100%\"\n >\n <Box flexDirection=\"column\" gap={1}>\n <Text color={isFocused ? CLI_COLORS.PRIMARY : undefined} bold={isFocused}>\n {isFocused ? `${UI_SYMBOLS.CHEVRON} ${label}` : label}\n </Text>\n {descriptionLines.map((line, index) => (\n <Text key={index} dimColor>\n {line}\n </Text>\n ))}\n </Box>\n </Box>\n );\n};\n"],"mappings":";;;;;;;AAAA,SAAS,KAAK,YAAY;AA4BpB,SACE,KADF;AAjBC,IAAM,gBAA8C,CAAC;AAAA,EAC1D;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,mBAAmB,MAAM,QAAQ,WAAW,IAAI,cAAc,CAAC,WAAW;AAEhF,SACE;AAAA,IAAC;AAAA;AAAA,MACC,aAAY;AAAA,MACZ,aAAa,YAAY,WAAW,UAAU,WAAW;AAAA,MACzD,UAAU;AAAA,MACV,UAAU;AAAA,MACV;AAAA,MACA,OAAM;AAAA,MAEN,+BAAC,OAAI,eAAc,UAAS,KAAK,GAC/B;AAAA,4BAAC,QAAK,OAAO,YAAY,WAAW,UAAU,QAAW,MAAM,WAC5D,sBAAY,GAAG,WAAW,OAAO,IAAI,KAAK,KAAK,OAClD;AAAA,QACC,iBAAiB,IAAI,CAAC,MAAM,UAC3B,oBAAC,QAAiB,UAAQ,MACvB,kBADQ,KAEX,CACD;AAAA,SACH;AAAA;AAAA,EACF;AAEJ;","names":[]}
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
useFocusedListItem
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-J27W6TXS.js";
|
|
5
5
|
import {
|
|
6
6
|
useSectionScroll
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-MM7CTTAV.js";
|
|
8
8
|
import {
|
|
9
9
|
HOTKEY_FILTER_INCOMPATIBLE,
|
|
10
10
|
HOTKEY_TOGGLE_LABELS,
|
|
11
11
|
KEY_SPACE,
|
|
12
12
|
isHotkey
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LDP5ASDM.js";
|
|
14
14
|
import {
|
|
15
15
|
FEATURE_FLAGS
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-WBCPLH66.js";
|
|
17
17
|
import {
|
|
18
18
|
getSkillById
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WKTHWQKM.js";
|
|
20
20
|
import {
|
|
21
21
|
CLI_COLORS
|
|
22
|
-
} from "./chunk-
|
|
23
|
-
import {
|
|
24
|
-
init_esm_shims
|
|
25
|
-
} from "./chunk-P56WJ5FA.js";
|
|
22
|
+
} from "./chunk-76ADG7LQ.js";
|
|
26
23
|
|
|
27
24
|
// src/cli/components/wizard/category-grid.tsx
|
|
28
|
-
init_esm_shims();
|
|
29
25
|
import { useCallback as useCallback2, useEffect as useEffect2 } from "react";
|
|
30
26
|
import { Box, Text } from "ink";
|
|
31
27
|
|
|
32
28
|
// src/cli/components/hooks/use-category-grid-input.ts
|
|
33
|
-
|
|
34
|
-
import { useCallback, useEffect, useRef } from "react";
|
|
29
|
+
import { useCallback, useEffect, useMemo, useRef } from "react";
|
|
35
30
|
import { useInput } from "ink";
|
|
36
31
|
var findNextIndex = (items, currentIndex) => {
|
|
37
32
|
const length = items.length;
|
|
@@ -49,7 +44,7 @@ function useCategoryGridInput({
|
|
|
49
44
|
onToggleFilterIncompatible
|
|
50
45
|
}) {
|
|
51
46
|
const currentRow = categories[focusedRow];
|
|
52
|
-
const currentOptions = currentRow?.options
|
|
47
|
+
const currentOptions = useMemo(() => currentRow?.options ?? [], [currentRow]);
|
|
53
48
|
useEffect(() => {
|
|
54
49
|
if (!currentRow) return;
|
|
55
50
|
const maxCol = currentOptions.length - 1;
|
|
@@ -284,4 +279,4 @@ var CategoryGrid = ({
|
|
|
284
279
|
export {
|
|
285
280
|
CategoryGrid
|
|
286
281
|
};
|
|
287
|
-
//# sourceMappingURL=chunk-
|
|
282
|
+
//# sourceMappingURL=chunk-QRDTLVXG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/category-grid.tsx","../src/cli/components/hooks/use-category-grid-input.ts"],"sourcesContent":["import React, { useCallback, useEffect } from \"react\";\n\nimport { Box, Text } from \"ink\";\n\nimport { CLI_COLORS } from \"../../consts.js\";\nimport { getSkillById } from \"../../lib/matrix/matrix-provider.js\";\nimport type { Category, OptionState, SkillId, SkillScope } from \"../../types/index.js\";\nimport { useCategoryGridInput } from \"../hooks/use-category-grid-input.js\";\nimport { useFocusedListItem } from \"../hooks/use-focused-list-item.js\";\nimport { useSectionScroll } from \"../hooks/use-section-scroll.js\";\n\nexport type CategoryOption = {\n id: SkillId;\n state: OptionState;\n selected: boolean;\n local?: boolean;\n installed?: boolean;\n scope?: SkillScope;\n /** Secondary scope badge shown alongside primary (e.g. after G->P toggle, excluded tombstone) */\n secondaryScope?: SkillScope;\n source?: string;\n /** True when selected but has unmet dependency requirements (shown dimmed) */\n hasUnmetRequirements?: boolean;\n /** Explains unmet requirements (shown in label when D pressed) */\n unmetRequirementsReason?: string;\n /** Display name of the skill that requires this one (e.g. \"Next.js\") */\n requiredBy?: string;\n};\n\nexport type CategoryRow = {\n id: Category;\n displayName: string;\n required: boolean;\n exclusive: boolean;\n options: CategoryOption[];\n};\n\nexport type CategoryGridProps = {\n categories: CategoryRow[];\n /** Available height in terminal lines for the scrollable viewport. 0 = no constraint. */\n availableHeight?: number;\n showLabels: boolean;\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n onToggleFilterIncompatible?: () => void;\n /** Optional initial focus row (default: 0). Use with React `key` to reset. */\n defaultFocusedRow?: number;\n /** Optional initial focus col (default: 0). Use with React `key` to reset. */\n defaultFocusedCol?: number;\n /** Optional callback fired whenever the focused position changes */\n onFocusChange?: (row: number, col: number) => void;\n /** Optional callback fired with the resolved SkillId of the focused cell */\n onFocusedSkillChange?: (skillId: SkillId | null) => void;\n};\n\nconst SYMBOL_REQUIRED = \"*\";\n\n/** Next option index stepping cyclically from `currentIndex`; empty rows stay put. */\nconst wrapOptionIndex = (length: number, currentIndex: number, direction: 1 | -1): number => {\n if (length === 0) return currentIndex;\n return (currentIndex + direction + length) % length;\n};\n\ntype SkillTagProps = {\n option: CategoryOption;\n isFocused: boolean;\n showLabels: boolean;\n};\n\nconst getCompatibilityLabel = (option: CategoryOption): string | null => {\n if (option.selected && option.hasUnmetRequirements && option.unmetRequirementsReason) {\n return `(${option.unmetRequirementsReason})`;\n }\n if (option.selected) return null;\n if (option.requiredBy) return `(required by ${option.requiredBy})`;\n if (option.state.status === \"incompatible\") return \"(incompatible)\";\n if (option.state.status === \"recommended\") return \"(recommended)\";\n if (option.state.status === \"discouraged\") return \"(discouraged)\";\n return null;\n};\n\nconst STATUS_COLORS: Partial<Record<OptionState[\"status\"], string>> = {\n incompatible: CLI_COLORS.ERROR,\n recommended: CLI_COLORS.GRAY_1,\n discouraged: CLI_COLORS.WARNING,\n};\n\n/** Selected wins, then advisory status; `fallback` covers the plain \"normal\" state. */\nfunction resolveTagColor(option: CategoryOption, fallback: string): string {\n if (option.selected) return CLI_COLORS.PRIMARY;\n return STATUS_COLORS[option.state.status] ?? fallback;\n}\n\nconst SkillTag: React.FC<SkillTagProps> = ({ option, isFocused, showLabels }) => {\n const textColor = resolveTagColor(option, CLI_COLORS.DIM);\n const hasRequiredBy = option.selected && !!option.requiredBy;\n const hasUnmetDeps = option.selected && !!option.hasUnmetRequirements;\n const isDimmed = hasUnmetDeps || hasRequiredBy;\n const showCompatibility = hasRequiredBy || hasUnmetDeps || (showLabels && isFocused);\n const compatibilityLabel = showCompatibility ? getCompatibilityLabel(option) : null;\n\n return (\n <Box\n marginRight={1}\n borderColor={isFocused ? resolveTagColor(option, CLI_COLORS.UNFOCUSED) : textColor}\n borderDimColor={!isFocused}\n borderStyle=\"single\"\n flexShrink={0}\n paddingLeft={1}\n flexDirection=\"row\"\n >\n <>\n {option.scope && (\n <>\n {[option.scope, option.secondaryScope].filter(Boolean).map((badgeScope, i) => (\n <Text key={i} color={CLI_COLORS.WARNING} backgroundColor={CLI_COLORS.LABEL_BG}>\n {badgeScope === \"global\" ? \" G \" : \" P \"}\n </Text>\n ))}\n <Text> </Text>\n </>\n )}\n <Text color={textColor} bold dimColor={isDimmed}>\n {getSkillById(option.id).displayName}{\" \"}\n </Text>\n {compatibilityLabel && (\n <Text color={textColor} dimColor>\n {compatibilityLabel}{\" \"}\n </Text>\n )}\n </>\n </Box>\n );\n};\n\ntype CategorySectionProps = {\n isFirst: boolean;\n category: CategoryRow;\n isFocused: boolean;\n focusedOptionIndex: number;\n showLabels: boolean;\n};\n\nconst CategorySection: React.FC<CategorySectionProps> = ({\n isFirst,\n category,\n isFocused,\n focusedOptionIndex,\n showLabels,\n}) => {\n const { options } = category;\n const selectedCount = options.filter((o) => o.selected).length;\n\n const selectionCounter = category.exclusive ? `(${selectedCount} of 1)` : null;\n\n return (\n <Box flexDirection=\"column\" marginTop={isFirst ? 0 : 1}>\n <Box flexDirection=\"row\">\n {isFocused ? (\n <Text color={CLI_COLORS.WHITE} backgroundColor={CLI_COLORS.LABEL_BG}>\n {` ${category.displayName}${category.required ? ` ${SYMBOL_REQUIRED}` : \"\"}${selectionCounter ? ` ${selectionCounter}` : \"\"} `}\n </Text>\n ) : (\n <>\n <Text color={CLI_COLORS.NEUTRAL}>{category.displayName}</Text>\n {category.required && <Text color={CLI_COLORS.NEUTRAL}> {SYMBOL_REQUIRED}</Text>}\n {selectionCounter && <Text dimColor> {selectionCounter}</Text>}\n </>\n )}\n </Box>\n\n <Box flexDirection=\"row\" flexWrap=\"wrap\" marginTop={0}>\n {options.map((option, index) => (\n <SkillTag\n key={option.id}\n option={option}\n isFocused={isFocused && index === focusedOptionIndex}\n showLabels={showLabels}\n />\n ))}\n </Box>\n </Box>\n );\n};\n\nexport const CategoryGrid: React.FC<CategoryGridProps> = ({\n categories,\n availableHeight = 0,\n showLabels,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n defaultFocusedRow = 0,\n defaultFocusedCol = 0,\n onFocusChange,\n onFocusedSkillChange,\n}) => {\n const getColCount = useCallback(\n (row: number): number => categories[row]?.options.length ?? 0,\n [categories],\n );\n\n const findValidCol = useCallback(\n (row: number, currentCol: number, direction: 1 | -1): number =>\n wrapOptionIndex(categories[row]?.options.length ?? 0, currentCol, direction),\n [categories],\n );\n\n const handleFocusChange = useCallback(\n (row: number, col: number) => {\n if (showLabels) onToggleLabels();\n onFocusChange?.(row, col);\n },\n [showLabels, onToggleLabels, onFocusChange],\n );\n\n const { focusedRow, focusedCol, setFocused, moveFocus } = useFocusedListItem(\n categories.length,\n getColCount,\n {\n wrap: true,\n findValidCol,\n onChange: handleFocusChange,\n initialRow: defaultFocusedRow,\n initialCol: defaultFocusedCol,\n },\n );\n\n useCategoryGridInput({\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n });\n\n // Report the focused cell's skill on mount and whenever it changes — including\n // category reshapes that shift the cell without a navigation event. useFocusedListItem\n // only fires onChange during navigation, so the initially highlighted cell would\n // otherwise never reach the store, leaving focusedSkillId out of sync with the visual\n // focus and making the `s` scope hotkey no-op until the first arrow key.\n const focusedSkillId = categories[focusedRow]?.options[focusedCol]?.id ?? null;\n useEffect(() => {\n onFocusedSkillChange?.(focusedSkillId);\n }, [focusedSkillId, onFocusedSkillChange]);\n\n // `hiddenAbove` / `hiddenBelow` are discarded ON PURPOSE — the build grid has\n // no `ScrollAffordance` and is not getting one (owner decision). On a grid\n // this dense a half-cut card already says \"there is more\"; a counted hint\n // would be noise, and it would cost the viewport a row to say what the\n // clipped card says for free. Do not add one on the strength of the counts\n // merely being available here.\n const { setSectionRef, scrollEnabled, scrollTopPx } = useSectionScroll({\n sectionCount: categories.length,\n focusedIndex: focusedRow,\n availableHeight,\n });\n\n if (categories.length === 0) {\n return (\n <Box flexDirection=\"column\">\n <Text dimColor>No categories to display.</Text>\n </Box>\n );\n }\n\n const noShrink = scrollEnabled ? { flexShrink: 0 } : {};\n\n const sectionElements = categories.map((category, index) => (\n <Box key={category.id} ref={(el) => setSectionRef(index, el)} {...noShrink}>\n <CategorySection\n category={category}\n isFocused={index === focusedRow}\n focusedOptionIndex={focusedCol}\n showLabels={showLabels}\n isFirst={index === 0}\n />\n </Box>\n ));\n\n return (\n <Box\n flexDirection=\"column\"\n {...(scrollEnabled\n ? { height: availableHeight, overflow: \"hidden\" as const }\n : { flexGrow: 1 })}\n >\n <Box flexDirection=\"column\" marginTop={scrollTopPx > 0 ? -scrollTopPx : 0} {...noShrink}>\n {sectionElements}\n </Box>\n </Box>\n );\n};\n","import { useCallback, useEffect, useRef } from \"react\";\nimport { useInput, type Key } from \"ink\";\n\nimport type { Category, SkillId } from \"../../types/index.js\";\nimport { FEATURE_FLAGS } from \"../../lib/feature-flags.js\";\nimport type { CategoryRow } from \"../wizard/category-grid.js\";\nimport type { Direction } from \"./use-focused-list-item.js\";\nimport {\n HOTKEY_FILTER_INCOMPATIBLE,\n HOTKEY_TOGGLE_LABELS,\n KEY_SPACE,\n isHotkey,\n} from \"../wizard/hotkeys.js\";\n\n/** Find next section index (wrapping forward) */\nconst findNextIndex = (items: { length: number }, currentIndex: number): number => {\n const length = items.length;\n if (length === 0) return currentIndex;\n return (currentIndex + 1) % length;\n};\n\ntype UseCategoryGridInputOptions = {\n categories: CategoryRow[];\n focusedRow: number;\n focusedCol: number;\n setFocused: (row: number, col: number) => void;\n moveFocus: (direction: Direction) => void;\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n onToggleFilterIncompatible?: () => void;\n};\n\nexport function useCategoryGridInput({\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n}: UseCategoryGridInputOptions): void {\n const currentRow = categories[focusedRow];\n const currentOptions = currentRow?.options || [];\n\n // Adjust column when current row's options change externally (e.g. option becomes disabled)\n useEffect(() => {\n if (!currentRow) return;\n\n const maxCol = currentOptions.length - 1;\n if (focusedCol > maxCol) {\n const newCol = Math.max(0, maxCol);\n setFocused(focusedRow, newCol);\n }\n }, [focusedRow, currentOptions, focusedCol, setFocused, currentRow]);\n\n // Store the latest handler in a ref so that the useInput effect never needs to\n // re-register on the event emitter. This avoids a stale-closure race condition\n // where, after a domain switch (CategoryGrid remount via key={activeDomain}),\n // the useInput effect may not yet have re-registered the updated handler when\n // the first keypress arrives — causing the first space press to be silently lost.\n const handlerRef = useRef<((input: string, key: Key) => void) | null>(null);\n handlerRef.current = (input: string, key: Key) => {\n if (key.tab && key.shift) {\n onToggleLabels();\n return;\n }\n\n if (key.tab && !key.shift) {\n const nextSection = findNextIndex(categories, focusedRow);\n if (nextSection !== focusedRow) {\n setFocused(nextSection, 0);\n }\n return;\n }\n\n if (isHotkey(input, HOTKEY_TOGGLE_LABELS)) {\n onToggleLabels();\n return;\n }\n\n // Gated behind FEATURE_FLAGS.FILTER_INCOMPATIBLE (default off): pressing F is a\n // no-op until the flag is flipped back on. The store action stays intact for re-enable.\n if (\n FEATURE_FLAGS.FILTER_INCOMPATIBLE &&\n isHotkey(input, HOTKEY_FILTER_INCOMPATIBLE) &&\n onToggleFilterIncompatible\n ) {\n onToggleFilterIncompatible();\n return;\n }\n\n if (input === KEY_SPACE) {\n const currentOption = currentOptions[focusedCol];\n if (currentOption) {\n onToggle(currentRow.id, currentOption.id);\n }\n return;\n }\n\n const isLeft = key.leftArrow || input === \"h\";\n const isRight = key.rightArrow || input === \"l\";\n const isUp = key.upArrow || input === \"k\";\n const isDown = key.downArrow || input === \"j\";\n\n if (isLeft) {\n moveFocus(\"left\");\n } else if (isRight) {\n moveFocus(\"right\");\n } else if (isUp) {\n moveFocus(\"up\");\n } else if (isDown) {\n moveFocus(\"down\");\n }\n };\n\n // Stable handler reference — never changes, so useInput's effect registers once\n const stableHandler = useCallback((input: string, key: Key) => {\n handlerRef.current?.(input, key);\n }, []);\n\n useInput(stableHandler);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAgB,eAAAA,cAAa,aAAAC,kBAAiB;AAE9C,SAAS,KAAK,YAAY;;;ACF1B;AAAA,SAAS,aAAa,WAAW,cAAc;AAC/C,SAAS,gBAA0B;AAcnC,IAAM,gBAAgB,CAAC,OAA2B,iBAAiC;AACjF,QAAM,SAAS,MAAM;AACrB,MAAI,WAAW,EAAG,QAAO;AACzB,UAAQ,eAAe,KAAK;AAC9B;AAaO,SAAS,qBAAqB;AAAA,EACnC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAsC;AACpC,QAAM,aAAa,WAAW,UAAU;AACxC,QAAM,iBAAiB,YAAY,WAAW,CAAC;AAG/C,YAAU,MAAM;AACd,QAAI,CAAC,WAAY;AAEjB,UAAM,SAAS,eAAe,SAAS;AACvC,QAAI,aAAa,QAAQ;AACvB,YAAM,SAAS,KAAK,IAAI,GAAG,MAAM;AACjC,iB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AG,CAAC,gBAAgB,oBAAoB,CAAC;AAQzC,QAAM,EAAE,eAAe,eAAe,YAAY,IAAI,iBAAiB;AAAA,IACrE,cAAc,WAAW;AAAA,IACzB,cAAc;AAAA,IACd;AAAA,EACF,CAAC;AAED,MAAI,WAAW,WAAW,GAAG;AAC3B,WACE,oBAAC,OAAI,eAAc,UACjB,8BAAC,QAAK,UAAQ,MAAC,uCAAyB,GAC1C;AAAA,EAEJ;AAEA,QAAM,WAAW,gBAAgB,EAAE,YAAY,EAAE,IAAI,CAAC;AAEtD,QAAM,kBAAkB,WAAW,IAAI,CAAC,UAAU,UAChD,oBAAC,OAAsB,KAAK,CAAC,OAAO,cAAc,OAAO,EAAE,GAAI,GAAG,UAChE;AAAA,IAAC;AAAA;AAAA,MACC;AAAA,MACA,WAAW,UAAU;AAAA,MACrB,oBAAoB;AAAA,MACpB;AAAA,MACA,SAAS,UAAU;AAAA;AAAA,EACrB,KAPQ,SAAS,EAQnB,CACD;AAED,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACb,GAAI,gBACD,EAAE,QAAQ,iBAAiB,UAAU,SAAkB,IACvD,EAAE,UAAU,EAAE;AAAA,MAElB,8BAAC,OAAI,eAAc,UAAS,WAAW,cAAc,IAAI,CAAC,cAAc,GAAI,GAAG,UAC5E,2BACH;AAAA;AAAA,EACF;AAEJ;","names":["useCallback","useEffect","useCallback","useEffect"]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/category-grid.tsx","../src/cli/components/hooks/use-category-grid-input.ts"],"sourcesContent":["import React, { useCallback, useEffect } from \"react\";\n\nimport { Box, Text } from \"ink\";\n\nimport { CLI_COLORS } from \"../../consts.js\";\nimport { getSkillById } from \"../../lib/matrix/matrix-provider.js\";\nimport type { Category, OptionState, SkillId, SkillScope } from \"../../types/index.js\";\nimport { useCategoryGridInput } from \"../hooks/use-category-grid-input.js\";\nimport { useFocusedListItem } from \"../hooks/use-focused-list-item.js\";\nimport { useSectionScroll } from \"../hooks/use-section-scroll.js\";\n\nexport type CategoryOption = {\n id: SkillId;\n state: OptionState;\n selected: boolean;\n local?: boolean;\n installed?: boolean;\n scope?: SkillScope;\n /** Secondary scope badge shown alongside primary (e.g. after G->P toggle, excluded tombstone) */\n secondaryScope?: SkillScope;\n source?: string;\n /** True when selected but has unmet dependency requirements (shown dimmed) */\n hasUnmetRequirements?: boolean;\n /** Explains unmet requirements (shown in label when D pressed) */\n unmetRequirementsReason?: string;\n /** Display name of the skill that requires this one (e.g. \"Next.js\") */\n requiredBy?: string;\n};\n\nexport type CategoryRow = {\n id: Category;\n displayName: string;\n required: boolean;\n exclusive: boolean;\n options: CategoryOption[];\n};\n\nexport type CategoryGridProps = {\n categories: CategoryRow[];\n /** Available height in terminal lines for the scrollable viewport. 0 = no constraint. */\n availableHeight?: number;\n showLabels: boolean;\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n onToggleFilterIncompatible?: () => void;\n /** Optional initial focus row (default: 0). Use with React `key` to reset. */\n defaultFocusedRow?: number;\n /** Optional initial focus col (default: 0). Use with React `key` to reset. */\n defaultFocusedCol?: number;\n /** Optional callback fired whenever the focused position changes */\n onFocusChange?: (row: number, col: number) => void;\n /** Optional callback fired with the resolved SkillId of the focused cell */\n onFocusedSkillChange?: (skillId: SkillId | null) => void;\n};\n\nconst SYMBOL_REQUIRED = \"*\";\n\n/** Next option index stepping cyclically from `currentIndex`; empty rows stay put. */\nconst wrapOptionIndex = (length: number, currentIndex: number, direction: 1 | -1): number => {\n if (length === 0) return currentIndex;\n return (currentIndex + direction + length) % length;\n};\n\ntype SkillTagProps = {\n option: CategoryOption;\n isFocused: boolean;\n showLabels: boolean;\n};\n\nconst getCompatibilityLabel = (option: CategoryOption): string | null => {\n if (option.selected && option.hasUnmetRequirements && option.unmetRequirementsReason) {\n return `(${option.unmetRequirementsReason})`;\n }\n if (option.selected) return null;\n if (option.requiredBy) return `(required by ${option.requiredBy})`;\n if (option.state.status === \"incompatible\") return \"(incompatible)\";\n if (option.state.status === \"recommended\") return \"(recommended)\";\n if (option.state.status === \"discouraged\") return \"(discouraged)\";\n return null;\n};\n\nconst STATUS_COLORS: Partial<Record<OptionState[\"status\"], string>> = {\n incompatible: CLI_COLORS.ERROR,\n recommended: CLI_COLORS.GRAY_1,\n discouraged: CLI_COLORS.WARNING,\n};\n\n/** Selected wins, then advisory status; `fallback` covers the plain \"normal\" state. */\nfunction resolveTagColor(option: CategoryOption, fallback: string): string {\n if (option.selected) return CLI_COLORS.PRIMARY;\n return STATUS_COLORS[option.state.status] ?? fallback;\n}\n\nconst SkillTag: React.FC<SkillTagProps> = ({ option, isFocused, showLabels }) => {\n const textColor = resolveTagColor(option, CLI_COLORS.DIM);\n const hasRequiredBy = option.selected && !!option.requiredBy;\n const hasUnmetDeps = option.selected && !!option.hasUnmetRequirements;\n const isDimmed = hasUnmetDeps || hasRequiredBy;\n const showCompatibility = hasRequiredBy || hasUnmetDeps || (showLabels && isFocused);\n const compatibilityLabel = showCompatibility ? getCompatibilityLabel(option) : null;\n\n return (\n <Box\n marginRight={1}\n borderColor={isFocused ? resolveTagColor(option, CLI_COLORS.UNFOCUSED) : textColor}\n borderDimColor={!isFocused}\n borderStyle=\"single\"\n flexShrink={0}\n paddingLeft={1}\n flexDirection=\"row\"\n >\n <>\n {option.scope && (\n <>\n {[option.scope, option.secondaryScope].filter(Boolean).map((badgeScope, i) => (\n <Text key={i} color={CLI_COLORS.WARNING} backgroundColor={CLI_COLORS.LABEL_BG}>\n {badgeScope === \"global\" ? \" G \" : \" P \"}\n </Text>\n ))}\n <Text> </Text>\n </>\n )}\n <Text color={textColor} bold dimColor={isDimmed}>\n {getSkillById(option.id).displayName}{\" \"}\n </Text>\n {compatibilityLabel && (\n <Text color={textColor} dimColor>\n {compatibilityLabel}{\" \"}\n </Text>\n )}\n </>\n </Box>\n );\n};\n\ntype CategorySectionProps = {\n isFirst: boolean;\n category: CategoryRow;\n isFocused: boolean;\n focusedOptionIndex: number;\n showLabels: boolean;\n};\n\nconst CategorySection: React.FC<CategorySectionProps> = ({\n isFirst,\n category,\n isFocused,\n focusedOptionIndex,\n showLabels,\n}) => {\n const { options } = category;\n const selectedCount = options.filter((o) => o.selected).length;\n\n const selectionCounter = category.exclusive ? `(${selectedCount} of 1)` : null;\n\n return (\n <Box flexDirection=\"column\" marginTop={isFirst ? 0 : 1}>\n <Box flexDirection=\"row\">\n {isFocused ? (\n <Text color={CLI_COLORS.WHITE} backgroundColor={CLI_COLORS.LABEL_BG}>\n {` ${category.displayName}${category.required ? ` ${SYMBOL_REQUIRED}` : \"\"}${selectionCounter ? ` ${selectionCounter}` : \"\"} `}\n </Text>\n ) : (\n <>\n <Text color={CLI_COLORS.NEUTRAL}>{category.displayName}</Text>\n {category.required && <Text color={CLI_COLORS.NEUTRAL}> {SYMBOL_REQUIRED}</Text>}\n {selectionCounter && <Text dimColor> {selectionCounter}</Text>}\n </>\n )}\n </Box>\n\n <Box flexDirection=\"row\" flexWrap=\"wrap\" marginTop={0}>\n {options.map((option, index) => (\n <SkillTag\n key={option.id}\n option={option}\n isFocused={isFocused && index === focusedOptionIndex}\n showLabels={showLabels}\n />\n ))}\n </Box>\n </Box>\n );\n};\n\nexport const CategoryGrid: React.FC<CategoryGridProps> = ({\n categories,\n availableHeight = 0,\n showLabels,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n defaultFocusedRow = 0,\n defaultFocusedCol = 0,\n onFocusChange,\n onFocusedSkillChange,\n}) => {\n const getColCount = useCallback(\n (row: number): number => categories[row]?.options.length ?? 0,\n [categories],\n );\n\n const findValidCol = useCallback(\n (row: number, currentCol: number, direction: 1 | -1): number =>\n wrapOptionIndex(categories[row]?.options.length ?? 0, currentCol, direction),\n [categories],\n );\n\n const handleFocusChange = useCallback(\n (row: number, col: number) => {\n if (showLabels) onToggleLabels();\n onFocusChange?.(row, col);\n },\n [showLabels, onToggleLabels, onFocusChange],\n );\n\n const { focusedRow, focusedCol, setFocused, moveFocus } = useFocusedListItem(\n categories.length,\n getColCount,\n {\n wrap: true,\n findValidCol,\n onChange: handleFocusChange,\n initialRow: defaultFocusedRow,\n initialCol: defaultFocusedCol,\n },\n );\n\n useCategoryGridInput({\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n });\n\n // Report the focused cell's skill on mount and whenever it changes — including\n // category reshapes that shift the cell without a navigation event. useFocusedListItem\n // only fires onChange during navigation, so the initially highlighted cell would\n // otherwise never reach the store, leaving focusedSkillId out of sync with the visual\n // focus and making the `s` scope hotkey no-op until the first arrow key.\n const focusedSkillId = categories[focusedRow]?.options[focusedCol]?.id ?? null;\n useEffect(() => {\n onFocusedSkillChange?.(focusedSkillId);\n }, [focusedSkillId, onFocusedSkillChange]);\n\n // `hiddenAbove` / `hiddenBelow` are discarded ON PURPOSE — the build grid has\n // no `ScrollAffordance` and is not getting one (owner decision). On a grid\n // this dense a half-cut card already says \"there is more\"; a counted hint\n // would be noise, and it would cost the viewport a row to say what the\n // clipped card says for free. Do not add one on the strength of the counts\n // merely being available here.\n const { setSectionRef, scrollEnabled, scrollTopPx } = useSectionScroll({\n sectionCount: categories.length,\n focusedIndex: focusedRow,\n availableHeight,\n });\n\n if (categories.length === 0) {\n return (\n <Box flexDirection=\"column\">\n <Text dimColor>No categories to display.</Text>\n </Box>\n );\n }\n\n const noShrink = scrollEnabled ? { flexShrink: 0 } : {};\n\n const sectionElements = categories.map((category, index) => (\n <Box key={category.id} ref={(el) => setSectionRef(index, el)} {...noShrink}>\n <CategorySection\n category={category}\n isFocused={index === focusedRow}\n focusedOptionIndex={focusedCol}\n showLabels={showLabels}\n isFirst={index === 0}\n />\n </Box>\n ));\n\n return (\n <Box\n flexDirection=\"column\"\n {...(scrollEnabled\n ? { height: availableHeight, overflow: \"hidden\" as const }\n : { flexGrow: 1 })}\n >\n <Box flexDirection=\"column\" marginTop={scrollTopPx > 0 ? -scrollTopPx : 0} {...noShrink}>\n {sectionElements}\n </Box>\n </Box>\n );\n};\n","import { useCallback, useEffect, useMemo, useRef } from \"react\";\nimport { useInput, type Key } from \"ink\";\n\nimport type { Category, SkillId } from \"../../types/index.js\";\nimport { FEATURE_FLAGS } from \"../../lib/feature-flags.js\";\nimport type { CategoryRow } from \"../wizard/category-grid.js\";\nimport type { Direction } from \"./use-focused-list-item.js\";\nimport {\n HOTKEY_FILTER_INCOMPATIBLE,\n HOTKEY_TOGGLE_LABELS,\n KEY_SPACE,\n isHotkey,\n} from \"../wizard/hotkeys.js\";\n\n/** Find next section index (wrapping forward) */\nconst findNextIndex = (items: { length: number }, currentIndex: number): number => {\n const length = items.length;\n if (length === 0) return currentIndex;\n return (currentIndex + 1) % length;\n};\n\ntype UseCategoryGridInputOptions = {\n categories: CategoryRow[];\n focusedRow: number;\n focusedCol: number;\n setFocused: (row: number, col: number) => void;\n moveFocus: (direction: Direction) => void;\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n onToggleFilterIncompatible?: () => void;\n};\n\nexport function useCategoryGridInput({\n categories,\n focusedRow,\n focusedCol,\n setFocused,\n moveFocus,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n}: UseCategoryGridInputOptions): void {\n const currentRow = categories[focusedRow];\n // Memoised so the effect below keys on the row actually changing — the `[]`\n // fallback used to be a fresh array every render, re-running the effect for\n // nothing whenever no row was focused.\n const currentOptions = useMemo(() => currentRow?.options ?? [], [currentRow]);\n\n // Adjust column when current row's options change externally (e.g. option becomes disabled)\n useEffect(() => {\n if (!currentRow) return;\n\n const maxCol = currentOptions.length - 1;\n if (focusedCol > maxCol) {\n const newCol = Math.max(0, maxCol);\n setFocused(focusedRow, newCol);\n }\n }, [focusedRow, currentOptions, focusedCol, setFocused, currentRow]);\n\n // Store the latest handler in a ref so that the useInput effect never needs to\n // re-register on the event emitter. This avoids a stale-closure race condition\n // where, after a domain switch (CategoryGrid remount via key={activeDomain}),\n // the useInput effect may not yet have re-registered the updated handler when\n // the first keypress arrives — causing the first space press to be silently lost.\n const handlerRef = useRef<((input: string, key: Key) => void) | null>(null);\n handlerRef.current = (input: string, key: Key) => {\n if (key.tab && key.shift) {\n onToggleLabels();\n return;\n }\n\n if (key.tab && !key.shift) {\n const nextSection = findNextIndex(categories, focusedRow);\n if (nextSection !== focusedRow) {\n setFocused(nextSection, 0);\n }\n return;\n }\n\n if (isHotkey(input, HOTKEY_TOGGLE_LABELS)) {\n onToggleLabels();\n return;\n }\n\n // Gated behind FEATURE_FLAGS.FILTER_INCOMPATIBLE (default off): pressing F is a\n // no-op until the flag is flipped back on. The store action stays intact for re-enable.\n if (\n FEATURE_FLAGS.FILTER_INCOMPATIBLE &&\n isHotkey(input, HOTKEY_FILTER_INCOMPATIBLE) &&\n onToggleFilterIncompatible\n ) {\n onToggleFilterIncompatible();\n return;\n }\n\n if (input === KEY_SPACE) {\n const currentOption = currentOptions[focusedCol];\n if (currentOption) {\n onToggle(currentRow.id, currentOption.id);\n }\n return;\n }\n\n const isLeft = key.leftArrow || input === \"h\";\n const isRight = key.rightArrow || input === \"l\";\n const isUp = key.upArrow || input === \"k\";\n const isDown = key.downArrow || input === \"j\";\n\n if (isLeft) {\n moveFocus(\"left\");\n } else if (isRight) {\n moveFocus(\"right\");\n } else if (isUp) {\n moveFocus(\"up\");\n } else if (isDown) {\n moveFocus(\"down\");\n }\n };\n\n // Stable handler reference — never changes, so useInput's effect registers once\n const stableHandler = useCallback((input: string, key: Key) => {\n handlerRef.current?.(input, key);\n }, []);\n\n useInput(stableHandler);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAgB,eAAAA,cAAa,aAAAC,kBAAiB;AAE9C,SAAS,KAAK,YAAY;;;ACF1B,SAAS,aAAa,WAAW,SAAS,cAAc;AACxD,SAAS,gBAA0B;AAcnC,IAAM,gBAAgB,CAAC,OAA2B,iBAAiC;AACjF,QAAM,SAAS,MAAM;AACrB,MAAI,WAA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UAC5E,2BACH;AAAA;AAAA,EACF;AAEJ;","names":["useCallback","useEffect","useCallback","useEffect"]}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
getAgentDefinitions
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-E5X6RJ4E.js";
|
|
5
5
|
import {
|
|
6
6
|
loadMergedAgents
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import {
|
|
9
|
-
init_esm_shims
|
|
10
|
-
} from "./chunk-P56WJ5FA.js";
|
|
7
|
+
} from "./chunk-PMM2MYMA.js";
|
|
11
8
|
|
|
12
9
|
// src/cli/lib/operations/project/load-agent-defs.ts
|
|
13
|
-
init_esm_shims();
|
|
14
10
|
async function loadAgentDefs(options) {
|
|
15
11
|
const agentSourcePaths = await getAgentDefinitions(void 0, options);
|
|
16
12
|
const agents = await loadMergedAgents(agentSourcePaths.sourcePath);
|
|
@@ -24,4 +20,4 @@ async function loadAgentDefs(options) {
|
|
|
24
20
|
export {
|
|
25
21
|
loadAgentDefs
|
|
26
22
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-QZZJFYUQ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/operations/project/load-agent-defs.ts"],"sourcesContent":["import { getAgentDefinitions } from \"../../agents/index.js\";\nimport { loadMergedAgents } from \"../../loading/index.js\";\nimport type { AgentDefinition, AgentName, AgentSourcePaths } from \"../../../types/index.js\";\n\nexport type AgentDefs = {\n /** Merged agent definitions (CLI defaults + source overrides). Source takes precedence. */\n agents: Record<AgentName, AgentDefinition>;\n /** The sourcePath used to load agent partials (for compilation). */\n sourcePath: string;\n /** Full agent source paths (agentsDir, templatesDir, sourcePath). */\n agentSourcePaths: AgentSourcePaths;\n};\n\n/**\n * Loads agent definitions from the CLI and optionally from a remote source.\n *\n * Merges CLI built-in agents with source repository agents (source overrides CLI).\n * Returns the merged definitions plus the source path for compilation.\n */\nexport async function loadAgentDefs(options?: {\n projectDir?: string;\n forceRefresh?: boolean;\n}): Promise<AgentDefs> {\n const agentSourcePaths = await getAgentDefinitions(undefined, options);\n const agents = await loadMergedAgents(agentSourcePaths.sourcePath);\n\n return {\n agents,\n sourcePath: agentSourcePaths.sourcePath,\n agentSourcePaths,\n };\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/lib/operations/project/load-agent-defs.ts"],"sourcesContent":["import { getAgentDefinitions } from \"../../agents/index.js\";\nimport { loadMergedAgents } from \"../../loading/index.js\";\nimport type { AgentDefinition, AgentName, AgentSourcePaths } from \"../../../types/index.js\";\n\nexport type AgentDefs = {\n /** Merged agent definitions (CLI defaults + source overrides). Source takes precedence. */\n agents: Record<AgentName, AgentDefinition>;\n /** The sourcePath used to load agent partials (for compilation). */\n sourcePath: string;\n /** Full agent source paths (agentsDir, templatesDir, sourcePath). */\n agentSourcePaths: AgentSourcePaths;\n};\n\n/**\n * Loads agent definitions from the CLI and optionally from a remote source.\n *\n * Merges CLI built-in agents with source repository agents (source overrides CLI).\n * Returns the merged definitions plus the source path for compilation.\n */\nexport async function loadAgentDefs(options?: {\n projectDir?: string;\n forceRefresh?: boolean;\n}): Promise<AgentDefs> {\n const agentSourcePaths = await getAgentDefinitions(undefined, options);\n const agents = await loadMergedAgents(agentSourcePaths.sourcePath);\n\n return {\n agents,\n sourcePath: agentSourcePaths.sourcePath,\n agentSourcePaths,\n };\n}\n"],"mappings":";;;;;;;;;AAmBA,eAAsB,cAAc,SAGb;AACrB,QAAM,mBAAmB,MAAM,oBAAoB,QAAW,OAAO;AACrE,QAAM,SAAS,MAAM,iBAAiB,iBAAiB,UAAU;AAEjE,SAAO;AAAA,IACL;AAAA,IACA,YAAY,iBAAiB;AAAA,IAC7B;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,40 +1,36 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
useMeasuredHeight
|
|
4
|
-
} from "./chunk-IOJR5TOY.js";
|
|
5
|
-
import {
|
|
6
|
-
SelectionCard
|
|
7
|
-
} from "./chunk-QQLRX4KI.js";
|
|
8
2
|
import {
|
|
9
3
|
SourceGrid,
|
|
10
4
|
isRowInert
|
|
11
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BNSRA6HL.js";
|
|
6
|
+
import {
|
|
7
|
+
useMeasuredHeight
|
|
8
|
+
} from "./chunk-TSIU7DME.js";
|
|
12
9
|
import {
|
|
13
10
|
HOTKEY_SET_ALL_LOCAL,
|
|
14
11
|
HOTKEY_SET_ALL_PLUGIN,
|
|
15
12
|
isHotkey
|
|
16
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LDP5ASDM.js";
|
|
14
|
+
import {
|
|
15
|
+
SelectionCard
|
|
16
|
+
} from "./chunk-Q45ZU6HD.js";
|
|
17
17
|
import {
|
|
18
18
|
FEATURE_FLAGS
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-WBCPLH66.js";
|
|
20
20
|
import {
|
|
21
21
|
useWizardStore
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-5UWKOOIS.js";
|
|
23
23
|
import {
|
|
24
24
|
resolveAllSources,
|
|
25
25
|
searchExtraSources
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EEPELKOM.js";
|
|
27
27
|
import {
|
|
28
28
|
CLI_COLORS,
|
|
29
29
|
DEFAULT_BRANDING,
|
|
30
30
|
EJECT_SOURCE
|
|
31
|
-
} from "./chunk-
|
|
32
|
-
import {
|
|
33
|
-
init_esm_shims
|
|
34
|
-
} from "./chunk-P56WJ5FA.js";
|
|
31
|
+
} from "./chunk-76ADG7LQ.js";
|
|
35
32
|
|
|
36
33
|
// src/cli/components/wizard/step-sources.tsx
|
|
37
|
-
init_esm_shims();
|
|
38
34
|
import { Box, Text, useInput } from "ink";
|
|
39
35
|
import { useCallback, useState } from "react";
|
|
40
36
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -171,4 +167,4 @@ var StepSources = ({ projectDir, onContinue, onBack }) => {
|
|
|
171
167
|
export {
|
|
172
168
|
StepSources
|
|
173
169
|
};
|
|
174
|
-
//# sourceMappingURL=chunk-
|
|
170
|
+
//# sourceMappingURL=chunk-R5NOI2LP.js.map
|