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,13 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
clearTerminalScreen,
|
|
4
|
+
formatTerminalTooSmallMessage,
|
|
5
|
+
isTerminalLargeEnough
|
|
6
|
+
} from "./chunk-ZL7PFNHN.js";
|
|
7
|
+
import {
|
|
8
|
+
claudePluginMarketplaceAdd,
|
|
9
|
+
claudePluginMarketplaceExists,
|
|
10
|
+
claudePluginMarketplaceUpdate,
|
|
11
|
+
fetchMarketplace
|
|
12
|
+
} from "./chunk-EEPELKOM.js";
|
|
13
|
+
import {
|
|
14
|
+
directoryExists,
|
|
15
|
+
getErrorMessage,
|
|
16
|
+
warn
|
|
17
|
+
} from "./chunk-PMM2MYMA.js";
|
|
18
|
+
import {
|
|
19
|
+
CLI_COLORS,
|
|
20
|
+
MIN_TERMINAL_SIZE
|
|
21
|
+
} from "./chunk-76ADG7LQ.js";
|
|
8
22
|
|
|
9
23
|
// ../../node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
10
|
-
init_esm_shims();
|
|
11
24
|
var ANSI_BACKGROUND_OFFSET = 10;
|
|
12
25
|
var wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
13
26
|
var wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
@@ -194,17 +207,16 @@ var ansiStyles = assembleStyles();
|
|
|
194
207
|
var ansi_styles_default = ansiStyles;
|
|
195
208
|
|
|
196
209
|
// ../../node_modules/chalk/source/vendor/supports-color/index.js
|
|
197
|
-
|
|
198
|
-
import process from "process";
|
|
210
|
+
import process2 from "process";
|
|
199
211
|
import os from "os";
|
|
200
212
|
import tty from "tty";
|
|
201
|
-
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args :
|
|
213
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
202
214
|
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
203
215
|
const position = argv.indexOf(prefix + flag);
|
|
204
216
|
const terminatorPosition = argv.indexOf("--");
|
|
205
217
|
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
206
218
|
}
|
|
207
|
-
var { env } =
|
|
219
|
+
var { env } = process2;
|
|
208
220
|
var flagForceColor;
|
|
209
221
|
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
210
222
|
flagForceColor = 0;
|
|
@@ -260,7 +272,7 @@ function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
|
260
272
|
if (env.TERM === "dumb") {
|
|
261
273
|
return min;
|
|
262
274
|
}
|
|
263
|
-
if (
|
|
275
|
+
if (process2.platform === "win32") {
|
|
264
276
|
const osRelease = os.release().split(".");
|
|
265
277
|
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
266
278
|
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
@@ -327,7 +339,6 @@ var supportsColor = {
|
|
|
327
339
|
var supports_color_default = supportsColor;
|
|
328
340
|
|
|
329
341
|
// ../../node_modules/chalk/source/utilities.js
|
|
330
|
-
init_esm_shims();
|
|
331
342
|
function stringReplaceAll(string, substring, replacer) {
|
|
332
343
|
let index = string.indexOf(substring);
|
|
333
344
|
if (index === -1) {
|
|
@@ -504,7 +515,150 @@ var chalk = createChalk();
|
|
|
504
515
|
var chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
505
516
|
var source_default = chalk;
|
|
506
517
|
|
|
518
|
+
// src/cli/lib/exit-codes.ts
|
|
519
|
+
var EXIT_CODES = {
|
|
520
|
+
SUCCESS: 0,
|
|
521
|
+
ERROR: 1,
|
|
522
|
+
INVALID_ARGS: 2,
|
|
523
|
+
NETWORK_ERROR: 3,
|
|
524
|
+
CANCELLED: 4
|
|
525
|
+
};
|
|
526
|
+
|
|
527
|
+
// src/cli/base-command.ts
|
|
528
|
+
import { Command, Flags } from "@oclif/core";
|
|
529
|
+
|
|
530
|
+
// src/cli/lib/operations/source/ensure-marketplace.ts
|
|
531
|
+
async function ensureMarketplace(sourceResult) {
|
|
532
|
+
if (!sourceResult.marketplace) {
|
|
533
|
+
try {
|
|
534
|
+
const marketplaceResult = await fetchMarketplace(sourceResult.sourceConfig.source, {});
|
|
535
|
+
sourceResult.marketplace = marketplaceResult.marketplace.name;
|
|
536
|
+
} catch {
|
|
537
|
+
return { marketplace: null, registered: false };
|
|
538
|
+
}
|
|
539
|
+
}
|
|
540
|
+
const marketplace = sourceResult.marketplace;
|
|
541
|
+
const exists = await claudePluginMarketplaceExists(marketplace);
|
|
542
|
+
if (!exists) {
|
|
543
|
+
const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, "");
|
|
544
|
+
await claudePluginMarketplaceAdd(marketplaceSource);
|
|
545
|
+
return { marketplace, registered: true };
|
|
546
|
+
}
|
|
547
|
+
try {
|
|
548
|
+
await claudePluginMarketplaceUpdate(marketplace);
|
|
549
|
+
} catch {
|
|
550
|
+
warn("Could not update marketplace \u2014 continuing with cached version");
|
|
551
|
+
}
|
|
552
|
+
return { marketplace, registered: false };
|
|
553
|
+
}
|
|
554
|
+
|
|
555
|
+
// src/cli/lib/operations/source/require-marketplace.ts
|
|
556
|
+
async function requireMarketplace(sourceResult, purpose) {
|
|
557
|
+
const mpResult = await ensureMarketplace(sourceResult);
|
|
558
|
+
if (!mpResult.marketplace) {
|
|
559
|
+
return {
|
|
560
|
+
ok: false,
|
|
561
|
+
error: `Cannot ${purpose}: marketplace could not be resolved from source '${sourceResult.sourceConfig.source}'. Plugin install mode requires a marketplace \u2014 fix the source or switch the affected skills to eject mode.`
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
return { ok: true, marketplace: mpResult.marketplace, registered: mpResult.registered };
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
// src/cli/lib/assert-dir-overwritable.ts
|
|
568
|
+
async function assertDirOverwritable(dir) {
|
|
569
|
+
return await directoryExists(dir) ? { ok: false, exists: true } : { ok: true };
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
// src/cli/base-command.ts
|
|
573
|
+
var BaseCommand = class extends Command {
|
|
574
|
+
static baseFlags = {
|
|
575
|
+
source: Flags.string({
|
|
576
|
+
char: "s",
|
|
577
|
+
description: "Skills source path or URL",
|
|
578
|
+
required: false
|
|
579
|
+
})
|
|
580
|
+
};
|
|
581
|
+
async init() {
|
|
582
|
+
await super.init();
|
|
583
|
+
await this.ensureTerminalSize();
|
|
584
|
+
}
|
|
585
|
+
get sourceConfig() {
|
|
586
|
+
return this.config.sourceConfig;
|
|
587
|
+
}
|
|
588
|
+
/**
|
|
589
|
+
* Blocks the command from launching in a terminal below
|
|
590
|
+
* {@link MIN_TERMINAL_SIZE}. This runs once, before Ink mounts; the terminal
|
|
591
|
+
* shrinking mid-session is caught by the matching guard in `WizardLayout`.
|
|
592
|
+
*/
|
|
593
|
+
async ensureTerminalSize() {
|
|
594
|
+
const currentColumns = () => process.stdout.columns ?? MIN_TERMINAL_SIZE.COLS;
|
|
595
|
+
const isValid = () => isTerminalLargeEnough(currentColumns(), process.stdout.rows ?? MIN_TERMINAL_SIZE.ROWS);
|
|
596
|
+
if (isValid()) return;
|
|
597
|
+
this.clearTerminal();
|
|
598
|
+
this.log(source_default.hex(CLI_COLORS.WARNING)(formatTerminalTooSmallMessage(currentColumns())));
|
|
599
|
+
await new Promise((resolve) => {
|
|
600
|
+
const check = () => {
|
|
601
|
+
if (isValid()) {
|
|
602
|
+
clearInterval(interval);
|
|
603
|
+
process.stdout.off("resize", check);
|
|
604
|
+
resolve();
|
|
605
|
+
}
|
|
606
|
+
};
|
|
607
|
+
const interval = setInterval(check, 500);
|
|
608
|
+
process.stdout.on("resize", check);
|
|
609
|
+
});
|
|
610
|
+
}
|
|
611
|
+
handleError(error) {
|
|
612
|
+
const message = getErrorMessage(error);
|
|
613
|
+
this.error(message, { exit: EXIT_CODES.ERROR });
|
|
614
|
+
}
|
|
615
|
+
logSuccess(message) {
|
|
616
|
+
this.log(`\u2713 ${message}`);
|
|
617
|
+
}
|
|
618
|
+
logWarning(message) {
|
|
619
|
+
this.warn(message);
|
|
620
|
+
}
|
|
621
|
+
logInfo(message) {
|
|
622
|
+
this.log(message);
|
|
623
|
+
}
|
|
624
|
+
clearTerminal() {
|
|
625
|
+
clearTerminalScreen();
|
|
626
|
+
}
|
|
627
|
+
/**
|
|
628
|
+
* Resolves the marketplace required for a plugin operation, or hard-exits with
|
|
629
|
+
* an actionable error when it cannot be resolved. `onRegistered` is invoked
|
|
630
|
+
* (when provided) if the marketplace had to be registered — init uses it to log.
|
|
631
|
+
*/
|
|
632
|
+
async requireMarketplaceOrExit(sourceResult, purpose, onRegistered) {
|
|
633
|
+
const required = await requireMarketplace(sourceResult, purpose);
|
|
634
|
+
if (!required.ok) {
|
|
635
|
+
this.error(required.error, { exit: EXIT_CODES.ERROR });
|
|
636
|
+
}
|
|
637
|
+
if (required.registered) {
|
|
638
|
+
onRegistered?.(required.marketplace);
|
|
639
|
+
}
|
|
640
|
+
return required.marketplace;
|
|
641
|
+
}
|
|
642
|
+
/**
|
|
643
|
+
* Guards a fresh-write target directory. When `dir` already exists, hard-exits
|
|
644
|
+
* with `${messages.exists}\nUse --force to overwrite.` unless `force` is set —
|
|
645
|
+
* in which case it warns with `messages.overwriting` and proceeds. Callers own
|
|
646
|
+
* the wording because it differs per entity (skill / agent / directory).
|
|
647
|
+
*/
|
|
648
|
+
async ensureDirOverwritable(dir, force, messages) {
|
|
649
|
+
const result = await assertDirOverwritable(dir);
|
|
650
|
+
if (result.ok) return;
|
|
651
|
+
if (!force) {
|
|
652
|
+
this.error(`${messages.exists}
|
|
653
|
+
Use --force to overwrite.`, { exit: EXIT_CODES.ERROR });
|
|
654
|
+
}
|
|
655
|
+
this.warn(messages.overwriting);
|
|
656
|
+
}
|
|
657
|
+
};
|
|
658
|
+
|
|
507
659
|
export {
|
|
508
|
-
source_default
|
|
660
|
+
source_default,
|
|
661
|
+
EXIT_CODES,
|
|
662
|
+
BaseCommand
|
|
509
663
|
};
|
|
510
|
-
//# sourceMappingURL=chunk-
|
|
664
|
+
//# sourceMappingURL=chunk-KR65TPKC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../../node_modules/chalk/source/vendor/ansi-styles/index.js","../../../node_modules/chalk/source/vendor/supports-color/index.js","../../../node_modules/chalk/source/utilities.js","../../../node_modules/chalk/source/index.js","../src/cli/lib/exit-codes.ts","../src/cli/base-command.ts","../src/cli/lib/operations/source/ensure-marketplace.ts","../src/cli/lib/operations/source/require-marketplace.ts","../src/cli/lib/assert-dir-overwritable.ts"],"sourcesContent":["const ANSI_BACKGROUND_OFFSET = 10;\n\nconst wrapAnsi16 = (offset = 0) => code => `\\u001B[${code + offset}m`;\n\nconst wrapAnsi256 = (offset = 0) => code => `\\u001B[${38 + offset};5;${code}m`;\n\nconst wrapAnsi16m = (offset = 0) => (red, green, blue) => `\\u001B[${38 + offset};2;${red};${green};${blue}m`;\n\nconst styles = {\n\tmodifier: {\n\t\treset: [0, 0],\n\t\t// 21 isn't widely supported and 22 does the same thing\n\t\tbold: [1, 22],\n\t\tdim: [2, 22],\n\t\titalic: [3, 23],\n\t\tunderline: [4, 24],\n\t\toverline: [53, 55],\n\t\tinverse: [7, 27],\n\t\thidden: [8, 28],\n\t\tstrikethrough: [9, 29],\n\t},\n\tcolor: {\n\t\tblack: [30, 39],\n\t\tred: [31, 39],\n\t\tgreen: [32, 39],\n\t\tyellow: [33, 39],\n\t\tblue: [34, 39],\n\t\tmagenta: [35, 39],\n\t\tcyan: [36, 39],\n\t\twhite: [37, 39],\n\n\t\t// Bright color\n\t\tblackBright: [90, 39],\n\t\tgray: [90, 39], // Alias of `blackBright`\n\t\tgrey: [90, 39], // Alias of `blackBright`\n\t\tredBright: [91, 39],\n\t\tgreenBright: [92, 39],\n\t\tyellowBright: [93, 39],\n\t\tblueBright: [94, 39],\n\t\tmagentaBright: [95, 39],\n\t\tcyanBright: [96, 39],\n\t\twhiteBright: [97, 39],\n\t},\n\tbgColor: {\n\t\tbgBlack: [40, 49],\n\t\tbgRed: [41, 49],\n\t\tbgGreen: [42, 49],\n\t\tbgYellow: [43, 49],\n\t\tbgBlue: [44, 49],\n\t\tbgMagenta: [45, 49],\n\t\tbgCyan: [46, 49],\n\t\tbgWhite: [47, 49],\n\n\t\t// Bright color\n\t\tbgBlackBright: [100, 49],\n\t\tbgGray: [100, 49], // Alias of `bgBlackBright`\n\t\tbgGrey: [100, 49], // Alias of `bgBlackBright`\n\t\tbgRedBright: [101, 49],\n\t\tbgGreenBright: [102, 49],\n\t\tbgYellowBright: [103, 49],\n\t\tbgBlueBright: [104, 49],\n\t\tbgMagentaBright: [105, 49],\n\t\tbgCyanBright: [106, 49],\n\t\tbgWhiteBright: [107, 49],\n\t},\n};\n\nexport const modifierNames = Object.keys(styles.modifier);\nexport const foregroundColorNames = Object.keys(styles.color);\nexport const backgroundColorNames = Object.keys(styles.bgColor);\nexport const colorNames = [...foregroundColorNames, ...backgroundColorNames];\n\nfunction assembleStyles() {\n\tconst codes = new Map();\n\n\tfor (const [groupName, group] of Object.entries(styles)) {\n\t\tfor (const [styleName, style] of Object.entries(group)) {\n\t\t\tstyles[styleName] = {\n\t\t\t\topen: `\\u001B[${style[0]}m`,\n\t\t\t\tclose: `\\u001B[${style[1]}m`,\n\t\t\t};\n\n\t\t\tgroup[styleName] = styles[styleName];\n\n\t\t\tcodes.set(style[0], style[1]);\n\t\t}\n\n\t\tObject.defineProperty(styles, groupName, {\n\t\t\tvalue: group,\n\t\t\tenumerable: false,\n\t\t});\n\t}\n\n\tObject.defineProperty(styles, 'codes', {\n\t\tvalue: codes,\n\t\tenumerable: false,\n\t});\n\n\tstyles.color.close = '\\u001B[39m';\n\tstyles.bgColor.close = '\\u001B[49m';\n\n\tstyles.color.ansi = wrapAnsi16();\n\tstyles.color.ansi256 = wrapAnsi256();\n\tstyles.color.ansi16m = wrapAnsi16m();\n\tstyles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);\n\tstyles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);\n\n\t// From https://github.com/Qix-/color-convert/blob/3f0e0d4e92e235796ccb17f6e85c72094a651f49/conversions.js\n\tObject.defineProperties(styles, {\n\t\trgbToAnsi256: {\n\t\t\tvalue(red, green, blue) {\n\t\t\t\t// We use the extended greyscale palette here, with the exception of\n\t\t\t\t// black and white. normal palette only has 4 greyscale shades.\n\t\t\t\tif (red === green && green === blue) {\n\t\t\t\t\tif (red < 8) {\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\t}\n\n\t\t\t\t\tif (red > 248) {\n\t\t\t\t\t\treturn 231;\n\t\t\t\t\t}\n\n\t\t\t\t\treturn Math.round(((red - 8) / 247) * 24) + 232;\n\t\t\t\t}\n\n\t\t\t\treturn 16\n\t\t\t\t\t+ (36 * Math.round(red / 255 * 5))\n\t\t\t\t\t+ (6 * Math.round(green / 255 * 5))\n\t\t\t\t\t+ Math.round(blue / 255 * 5);\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToRgb: {\n\t\t\tvalue(hex) {\n\t\t\t\tconst matches = /[a-f\\d]{6}|[a-f\\d]{3}/i.exec(hex.toString(16));\n\t\t\t\tif (!matches) {\n\t\t\t\t\treturn [0, 0, 0];\n\t\t\t\t}\n\n\t\t\t\tlet [colorString] = matches;\n\n\t\t\t\tif (colorString.length === 3) {\n\t\t\t\t\tcolorString = [...colorString].map(character => character + character).join('');\n\t\t\t\t}\n\n\t\t\t\tconst integer = Number.parseInt(colorString, 16);\n\n\t\t\t\treturn [\n\t\t\t\t\t/* eslint-disable no-bitwise */\n\t\t\t\t\t(integer >> 16) & 0xFF,\n\t\t\t\t\t(integer >> 8) & 0xFF,\n\t\t\t\t\tinteger & 0xFF,\n\t\t\t\t\t/* eslint-enable no-bitwise */\n\t\t\t\t];\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi256: {\n\t\t\tvalue: hex => styles.rgbToAnsi256(...styles.hexToRgb(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t\tansi256ToAnsi: {\n\t\t\tvalue(code) {\n\t\t\t\tif (code < 8) {\n\t\t\t\t\treturn 30 + code;\n\t\t\t\t}\n\n\t\t\t\tif (code < 16) {\n\t\t\t\t\treturn 90 + (code - 8);\n\t\t\t\t}\n\n\t\t\t\tlet red;\n\t\t\t\tlet green;\n\t\t\t\tlet blue;\n\n\t\t\t\tif (code >= 232) {\n\t\t\t\t\tred = (((code - 232) * 10) + 8) / 255;\n\t\t\t\t\tgreen = red;\n\t\t\t\t\tblue = red;\n\t\t\t\t} else {\n\t\t\t\t\tcode -= 16;\n\n\t\t\t\t\tconst remainder = code % 36;\n\n\t\t\t\t\tred = Math.floor(code / 36) / 5;\n\t\t\t\t\tgreen = Math.floor(remainder / 6) / 5;\n\t\t\t\t\tblue = (remainder % 6) / 5;\n\t\t\t\t}\n\n\t\t\t\tconst value = Math.max(red, green, blue) * 2;\n\n\t\t\t\tif (value === 0) {\n\t\t\t\t\treturn 30;\n\t\t\t\t}\n\n\t\t\t\t// eslint-disable-next-line no-bitwise\n\t\t\t\tlet result = 30 + ((Math.round(blue) << 2) | (Math.round(green) << 1) | Math.round(red));\n\n\t\t\t\tif (value === 2) {\n\t\t\t\t\tresult += 60;\n\t\t\t\t}\n\n\t\t\t\treturn result;\n\t\t\t},\n\t\t\tenumerable: false,\n\t\t},\n\t\trgbToAnsi: {\n\t\t\tvalue: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),\n\t\t\tenumerable: false,\n\t\t},\n\t\thexToAnsi: {\n\t\t\tvalue: hex => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),\n\t\t\tenumerable: false,\n\t\t},\n\t});\n\n\treturn styles;\n}\n\nconst ansiStyles = assembleStyles();\n\nexport default ansiStyles;\n","import process from 'node:process';\nimport os from 'node:os';\nimport tty from 'node:tty';\n\n// From: https://github.com/sindresorhus/has-flag/blob/main/index.js\n/// function hasFlag(flag, argv = globalThis.Deno?.args ?? process.argv) {\nfunction hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process.argv) {\n\tconst prefix = flag.startsWith('-') ? '' : (flag.length === 1 ? '-' : '--');\n\tconst position = argv.indexOf(prefix + flag);\n\tconst terminatorPosition = argv.indexOf('--');\n\treturn position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);\n}\n\nconst {env} = process;\n\nlet flagForceColor;\nif (\n\thasFlag('no-color')\n\t|| hasFlag('no-colors')\n\t|| hasFlag('color=false')\n\t|| hasFlag('color=never')\n) {\n\tflagForceColor = 0;\n} else if (\n\thasFlag('color')\n\t|| hasFlag('colors')\n\t|| hasFlag('color=true')\n\t|| hasFlag('color=always')\n) {\n\tflagForceColor = 1;\n}\n\nfunction envForceColor() {\n\tif ('FORCE_COLOR' in env) {\n\t\tif (env.FORCE_COLOR === 'true') {\n\t\t\treturn 1;\n\t\t}\n\n\t\tif (env.FORCE_COLOR === 'false') {\n\t\t\treturn 0;\n\t\t}\n\n\t\treturn env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);\n\t}\n}\n\nfunction translateLevel(level) {\n\tif (level === 0) {\n\t\treturn false;\n\t}\n\n\treturn {\n\t\tlevel,\n\t\thasBasic: true,\n\t\thas256: level >= 2,\n\t\thas16m: level >= 3,\n\t};\n}\n\nfunction _supportsColor(haveStream, {streamIsTTY, sniffFlags = true} = {}) {\n\tconst noFlagForceColor = envForceColor();\n\tif (noFlagForceColor !== undefined) {\n\t\tflagForceColor = noFlagForceColor;\n\t}\n\n\tconst forceColor = sniffFlags ? flagForceColor : noFlagForceColor;\n\n\tif (forceColor === 0) {\n\t\treturn 0;\n\t}\n\n\tif (sniffFlags) {\n\t\tif (hasFlag('color=16m')\n\t\t\t|| hasFlag('color=full')\n\t\t\t|| hasFlag('color=truecolor')) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (hasFlag('color=256')) {\n\t\t\treturn 2;\n\t\t}\n\t}\n\n\t// Check for Azure DevOps pipelines.\n\t// Has to be above the `!streamIsTTY` check.\n\tif ('TF_BUILD' in env && 'AGENT_NAME' in env) {\n\t\treturn 1;\n\t}\n\n\tif (haveStream && !streamIsTTY && forceColor === undefined) {\n\t\treturn 0;\n\t}\n\n\tconst min = forceColor || 0;\n\n\tif (env.TERM === 'dumb') {\n\t\treturn min;\n\t}\n\n\tif (process.platform === 'win32') {\n\t\t// Windows 10 build 10586 is the first Windows release that supports 256 colors.\n\t\t// Windows 10 build 14931 is the first release that supports 16m/TrueColor.\n\t\tconst osRelease = os.release().split('.');\n\t\tif (\n\t\t\tNumber(osRelease[0]) >= 10\n\t\t\t&& Number(osRelease[2]) >= 10_586\n\t\t) {\n\t\t\treturn Number(osRelease[2]) >= 14_931 ? 3 : 2;\n\t\t}\n\n\t\treturn 1;\n\t}\n\n\tif ('CI' in env) {\n\t\tif (['GITHUB_ACTIONS', 'GITEA_ACTIONS', 'CIRCLECI'].some(key => key in env)) {\n\t\t\treturn 3;\n\t\t}\n\n\t\tif (['TRAVIS', 'APPVEYOR', 'GITLAB_CI', 'BUILDKITE', 'DRONE'].some(sign => sign in env) || env.CI_NAME === 'codeship') {\n\t\t\treturn 1;\n\t\t}\n\n\t\treturn min;\n\t}\n\n\tif ('TEAMCITY_VERSION' in env) {\n\t\treturn /^(9\\.(0*[1-9]\\d*)\\.|\\d{2,}\\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;\n\t}\n\n\tif (env.COLORTERM === 'truecolor') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-kitty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'xterm-ghostty') {\n\t\treturn 3;\n\t}\n\n\tif (env.TERM === 'wezterm') {\n\t\treturn 3;\n\t}\n\n\tif ('TERM_PROGRAM' in env) {\n\t\tconst version = Number.parseInt((env.TERM_PROGRAM_VERSION || '').split('.')[0], 10);\n\n\t\tswitch (env.TERM_PROGRAM) {\n\t\t\tcase 'iTerm.app': {\n\t\t\t\treturn version >= 3 ? 3 : 2;\n\t\t\t}\n\n\t\t\tcase 'Apple_Terminal': {\n\t\t\t\treturn 2;\n\t\t\t}\n\t\t\t// No default\n\t\t}\n\t}\n\n\tif (/-256(color)?$/i.test(env.TERM)) {\n\t\treturn 2;\n\t}\n\n\tif (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {\n\t\treturn 1;\n\t}\n\n\tif ('COLORTERM' in env) {\n\t\treturn 1;\n\t}\n\n\treturn min;\n}\n\nexport function createSupportsColor(stream, options = {}) {\n\tconst level = _supportsColor(stream, {\n\t\tstreamIsTTY: stream && stream.isTTY,\n\t\t...options,\n\t});\n\n\treturn translateLevel(level);\n}\n\nconst supportsColor = {\n\tstdout: createSupportsColor({isTTY: tty.isatty(1)}),\n\tstderr: createSupportsColor({isTTY: tty.isatty(2)}),\n};\n\nexport default supportsColor;\n","// TODO: When targeting Node.js 16, use `String.prototype.replaceAll`.\nexport function stringReplaceAll(string, substring, replacer) {\n\tlet index = string.indexOf(substring);\n\tif (index === -1) {\n\t\treturn string;\n\t}\n\n\tconst substringLength = substring.length;\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\treturnValue += string.slice(endIndex, index) + substring + replacer;\n\t\tendIndex = index + substringLength;\n\t\tindex = string.indexOf(substring, endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n\nexport function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index) {\n\tlet endIndex = 0;\n\tlet returnValue = '';\n\tdo {\n\t\tconst gotCR = string[index - 1] === '\\r';\n\t\treturnValue += string.slice(endIndex, (gotCR ? index - 1 : index)) + prefix + (gotCR ? '\\r\\n' : '\\n') + postfix;\n\t\tendIndex = index + 1;\n\t\tindex = string.indexOf('\\n', endIndex);\n\t} while (index !== -1);\n\n\treturnValue += string.slice(endIndex);\n\treturn returnValue;\n}\n","import ansiStyles from '#ansi-styles';\nimport supportsColor from '#supports-color';\nimport { // eslint-disable-line import/order\n\tstringReplaceAll,\n\tstringEncaseCRLFWithFirstIndex,\n} from './utilities.js';\n\nconst {stdout: stdoutColor, stderr: stderrColor} = supportsColor;\n\nconst GENERATOR = Symbol('GENERATOR');\nconst STYLER = Symbol('STYLER');\nconst IS_EMPTY = Symbol('IS_EMPTY');\n\n// `supportsColor.level` → `ansiStyles.color[name]` mapping\nconst levelMapping = [\n\t'ansi',\n\t'ansi',\n\t'ansi256',\n\t'ansi16m',\n];\n\nconst styles = Object.create(null);\n\nconst applyOptions = (object, options = {}) => {\n\tif (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {\n\t\tthrow new Error('The `level` option should be an integer from 0 to 3');\n\t}\n\n\t// Detect level if not set manually\n\tconst colorLevel = stdoutColor ? stdoutColor.level : 0;\n\tobject.level = options.level === undefined ? colorLevel : options.level;\n};\n\nexport class Chalk {\n\tconstructor(options) {\n\t\t// eslint-disable-next-line no-constructor-return\n\t\treturn chalkFactory(options);\n\t}\n}\n\nconst chalkFactory = options => {\n\tconst chalk = (...strings) => strings.join(' ');\n\tapplyOptions(chalk, options);\n\n\tObject.setPrototypeOf(chalk, createChalk.prototype);\n\n\treturn chalk;\n};\n\nfunction createChalk(options) {\n\treturn chalkFactory(options);\n}\n\nObject.setPrototypeOf(createChalk.prototype, Function.prototype);\n\nfor (const [styleName, style] of Object.entries(ansiStyles)) {\n\tstyles[styleName] = {\n\t\tget() {\n\t\t\tconst builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);\n\t\t\tObject.defineProperty(this, styleName, {value: builder});\n\t\t\treturn builder;\n\t\t},\n\t};\n}\n\nstyles.visible = {\n\tget() {\n\t\tconst builder = createBuilder(this, this[STYLER], true);\n\t\tObject.defineProperty(this, 'visible', {value: builder});\n\t\treturn builder;\n\t},\n};\n\nconst getModelAnsi = (model, level, type, ...arguments_) => {\n\tif (model === 'rgb') {\n\t\tif (level === 'ansi16m') {\n\t\t\treturn ansiStyles[type].ansi16m(...arguments_);\n\t\t}\n\n\t\tif (level === 'ansi256') {\n\t\t\treturn ansiStyles[type].ansi256(ansiStyles.rgbToAnsi256(...arguments_));\n\t\t}\n\n\t\treturn ansiStyles[type].ansi(ansiStyles.rgbToAnsi(...arguments_));\n\t}\n\n\tif (model === 'hex') {\n\t\treturn getModelAnsi('rgb', level, type, ...ansiStyles.hexToRgb(...arguments_));\n\t}\n\n\treturn ansiStyles[type][model](...arguments_);\n};\n\nconst usedModels = ['rgb', 'hex', 'ansi256'];\n\nfor (const model of usedModels) {\n\tstyles[model] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'color', ...arguments_), ansiStyles.color.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n\n\tconst bgModel = 'bg' + model[0].toUpperCase() + model.slice(1);\n\tstyles[bgModel] = {\n\t\tget() {\n\t\t\tconst {level} = this;\n\t\t\treturn function (...arguments_) {\n\t\t\t\tconst styler = createStyler(getModelAnsi(model, levelMapping[level], 'bgColor', ...arguments_), ansiStyles.bgColor.close, this[STYLER]);\n\t\t\t\treturn createBuilder(this, styler, this[IS_EMPTY]);\n\t\t\t};\n\t\t},\n\t};\n}\n\nconst proto = Object.defineProperties(() => {}, {\n\t...styles,\n\tlevel: {\n\t\tenumerable: true,\n\t\tget() {\n\t\t\treturn this[GENERATOR].level;\n\t\t},\n\t\tset(level) {\n\t\t\tthis[GENERATOR].level = level;\n\t\t},\n\t},\n});\n\nconst createStyler = (open, close, parent) => {\n\tlet openAll;\n\tlet closeAll;\n\tif (parent === undefined) {\n\t\topenAll = open;\n\t\tcloseAll = close;\n\t} else {\n\t\topenAll = parent.openAll + open;\n\t\tcloseAll = close + parent.closeAll;\n\t}\n\n\treturn {\n\t\topen,\n\t\tclose,\n\t\topenAll,\n\t\tcloseAll,\n\t\tparent,\n\t};\n};\n\nconst createBuilder = (self, _styler, _isEmpty) => {\n\t// Single argument is hot path, implicit coercion is faster than anything\n\t// eslint-disable-next-line no-implicit-coercion\n\tconst builder = (...arguments_) => applyStyle(builder, (arguments_.length === 1) ? ('' + arguments_[0]) : arguments_.join(' '));\n\n\t// We alter the prototype because we must return a function, but there is\n\t// no way to create a function with a different prototype\n\tObject.setPrototypeOf(builder, proto);\n\n\tbuilder[GENERATOR] = self;\n\tbuilder[STYLER] = _styler;\n\tbuilder[IS_EMPTY] = _isEmpty;\n\n\treturn builder;\n};\n\nconst applyStyle = (self, string) => {\n\tif (self.level <= 0 || !string) {\n\t\treturn self[IS_EMPTY] ? '' : string;\n\t}\n\n\tlet styler = self[STYLER];\n\n\tif (styler === undefined) {\n\t\treturn string;\n\t}\n\n\tconst {openAll, closeAll} = styler;\n\tif (string.includes('\\u001B')) {\n\t\twhile (styler !== undefined) {\n\t\t\t// Replace any instances already present with a re-opening code\n\t\t\t// otherwise only the part of the string until said closing code\n\t\t\t// will be colored, and the rest will simply be 'plain'.\n\t\t\tstring = stringReplaceAll(string, styler.close, styler.open);\n\n\t\t\tstyler = styler.parent;\n\t\t}\n\t}\n\n\t// We can move both next actions out of loop, because remaining actions in loop won't have\n\t// any/visible effect on parts we add here. Close the styling before a linebreak and reopen\n\t// after next line to fix a bleed issue on macOS: https://github.com/chalk/chalk/pull/92\n\tconst lfIndex = string.indexOf('\\n');\n\tif (lfIndex !== -1) {\n\t\tstring = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);\n\t}\n\n\treturn openAll + string + closeAll;\n};\n\nObject.defineProperties(createChalk.prototype, styles);\n\nconst chalk = createChalk();\nexport const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});\n\nexport {\n\tmodifierNames,\n\tforegroundColorNames,\n\tbackgroundColorNames,\n\tcolorNames,\n\n\t// TODO: Remove these aliases in the next major version\n\tmodifierNames as modifiers,\n\tforegroundColorNames as foregroundColors,\n\tbackgroundColorNames as backgroundColors,\n\tcolorNames as colors,\n} from './vendor/ansi-styles/index.js';\n\nexport {\n\tstdoutColor as supportsColor,\n\tstderrColor as supportsColorStderr,\n};\n\nexport default chalk;\n","export const EXIT_CODES = {\n SUCCESS: 0,\n ERROR: 1,\n INVALID_ARGS: 2,\n NETWORK_ERROR: 3,\n CANCELLED: 4,\n} as const;\n","import { Command, Flags } from \"@oclif/core\";\n\nimport chalk from \"chalk\";\n\nimport { CLI_COLORS, MIN_TERMINAL_SIZE } from \"./consts.js\";\nimport { getErrorMessage } from \"./utils/errors.js\";\nimport {\n clearTerminalScreen,\n formatTerminalTooSmallMessage,\n isTerminalLargeEnough,\n} from \"./utils/terminal.js\";\nimport { EXIT_CODES } from \"./lib/exit-codes.js\";\nimport type { ResolvedConfig } from \"./lib/configuration/index.js\";\nimport { requireMarketplace } from \"./lib/operations/source/require-marketplace.js\";\nimport type { SourceLoadResult } from \"./lib/loading/source-loader.js\";\nimport { assertDirOverwritable } from \"./lib/assert-dir-overwritable.js\";\n\n/** Narrow interface for the sourceConfig we attach to oclif's Config in the init hook. */\nexport interface ConfigWithSource {\n sourceConfig?: ResolvedConfig;\n}\n\n/** Shared source/refresh flag shape for commands that load a skills source. */\nexport type SourceRefreshFlags = { source?: string; refresh: boolean };\n\nexport abstract class BaseCommand extends Command {\n static baseFlags = {\n source: Flags.string({\n char: \"s\",\n description: \"Skills source path or URL\",\n required: false,\n }),\n };\n\n async init(): Promise<void> {\n await super.init();\n await this.ensureTerminalSize();\n }\n\n public get sourceConfig(): ResolvedConfig | undefined {\n // Boundary cast: oclif Config is a class (not augmentable); we attach sourceConfig in the init hook\n return (this.config as unknown as ConfigWithSource).sourceConfig;\n }\n\n /**\n * Blocks the command from launching in a terminal below\n * {@link MIN_TERMINAL_SIZE}. This runs once, before Ink mounts; the terminal\n * shrinking mid-session is caught by the matching guard in `WizardLayout`.\n */\n protected async ensureTerminalSize(): Promise<void> {\n const currentColumns = () => process.stdout.columns ?? MIN_TERMINAL_SIZE.COLS;\n const isValid = () =>\n isTerminalLargeEnough(currentColumns(), process.stdout.rows ?? MIN_TERMINAL_SIZE.ROWS);\n\n if (isValid()) return;\n\n this.clearTerminal();\n this.log(chalk.hex(CLI_COLORS.WARNING)(formatTerminalTooSmallMessage(currentColumns())));\n\n await new Promise<void>((resolve) => {\n const check = () => {\n if (isValid()) {\n clearInterval(interval);\n process.stdout.off(\"resize\", check);\n resolve();\n }\n };\n const interval = setInterval(check, 500);\n process.stdout.on(\"resize\", check);\n });\n }\n\n protected handleError(error: unknown): never {\n const message = getErrorMessage(error);\n this.error(message, { exit: EXIT_CODES.ERROR });\n }\n\n protected logSuccess(message: string): void {\n this.log(`✓ ${message}`);\n }\n\n protected logWarning(message: string): void {\n this.warn(message);\n }\n\n protected logInfo(message: string): void {\n this.log(message);\n }\n\n protected clearTerminal(): void {\n clearTerminalScreen();\n }\n\n /**\n * Resolves the marketplace required for a plugin operation, or hard-exits with\n * an actionable error when it cannot be resolved. `onRegistered` is invoked\n * (when provided) if the marketplace had to be registered — init uses it to log.\n */\n protected async requireMarketplaceOrExit(\n sourceResult: SourceLoadResult,\n purpose: string,\n onRegistered?: (marketplace: string) => void,\n ): Promise<string> {\n const required = await requireMarketplace(sourceResult, purpose);\n if (!required.ok) {\n this.error(required.error, { exit: EXIT_CODES.ERROR });\n }\n if (required.registered) {\n onRegistered?.(required.marketplace);\n }\n return required.marketplace;\n }\n\n /**\n * Guards a fresh-write target directory. When `dir` already exists, hard-exits\n * with `${messages.exists}\\nUse --force to overwrite.` unless `force` is set —\n * in which case it warns with `messages.overwriting` and proceeds. Callers own\n * the wording because it differs per entity (skill / agent / directory).\n */\n protected async ensureDirOverwritable(\n dir: string,\n force: boolean,\n messages: { exists: string; overwriting: string },\n ): Promise<void> {\n const result = await assertDirOverwritable(dir);\n if (result.ok) return;\n if (!force) {\n this.error(`${messages.exists}\\nUse --force to overwrite.`, { exit: EXIT_CODES.ERROR });\n }\n this.warn(messages.overwriting);\n }\n}\n","import {\n claudePluginMarketplaceExists,\n claudePluginMarketplaceAdd,\n claudePluginMarketplaceUpdate,\n} from \"../../../utils/exec.js\";\nimport { fetchMarketplace } from \"../../loading/index.js\";\nimport { warn } from \"../../../utils/logger.js\";\nimport type { SourceLoadResult } from \"../../loading/source-loader.js\";\n\nexport type MarketplaceResult = {\n /** The resolved marketplace name, or null if no marketplace is configured. */\n marketplace: string | null;\n /** Whether a new marketplace was registered (vs. updated or already existed). */\n registered: boolean;\n};\n\n/**\n * Ensures the marketplace is registered with the Claude CLI.\n *\n * If the marketplace does not exist, registers it. If it exists, updates it.\n * Handles lazy marketplace name resolution when sourceResult.marketplace is undefined.\n *\n * Operation is intentionally SILENT — commands decide what to log based on the\n * `registered` flag.\n */\nexport async function ensureMarketplace(\n sourceResult: SourceLoadResult,\n): Promise<MarketplaceResult> {\n if (!sourceResult.marketplace) {\n try {\n const marketplaceResult = await fetchMarketplace(sourceResult.sourceConfig.source, {});\n sourceResult.marketplace = marketplaceResult.marketplace.name;\n } catch {\n return { marketplace: null, registered: false };\n }\n }\n\n const marketplace = sourceResult.marketplace;\n const exists = await claudePluginMarketplaceExists(marketplace);\n\n if (!exists) {\n const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, \"\");\n await claudePluginMarketplaceAdd(marketplaceSource);\n return { marketplace, registered: true };\n }\n\n try {\n await claudePluginMarketplaceUpdate(marketplace);\n } catch {\n warn(\"Could not update marketplace — continuing with cached version\");\n }\n\n return { marketplace, registered: false };\n}\n","import { ensureMarketplace } from \"./ensure-marketplace.js\";\nimport type { SourceLoadResult } from \"../../loading/source-loader.js\";\n\nexport type MarketplaceRequirement =\n { ok: true; marketplace: string; registered: boolean } | { ok: false; error: string };\n\n/**\n * Resolves the marketplace required for plugin operations. Plugin install\n * intent is inviolable — callers must hard-error on `ok: false` rather than\n * silently falling back to eject or skipping, and must do so BEFORE any\n * filesystem mutation so a failure leaves no partial state on disk.\n */\nexport async function requireMarketplace(\n sourceResult: SourceLoadResult,\n purpose: string,\n): Promise<MarketplaceRequirement> {\n const mpResult = await ensureMarketplace(sourceResult);\n if (!mpResult.marketplace) {\n return {\n ok: false,\n error:\n `Cannot ${purpose}: marketplace could not be resolved from source '${sourceResult.sourceConfig.source}'. ` +\n `Plugin install mode requires a marketplace — fix the source or switch the affected skills to eject mode.`,\n };\n }\n return { ok: true, marketplace: mpResult.marketplace, registered: mpResult.registered };\n}\n","import { directoryExists } from \"../utils/fs.js\";\n\nexport type DirOverwritable = { ok: true } | { ok: false; exists: true };\n\n/**\n * Checks whether `dir` can be written fresh. `{ok: false, exists: true}` when a\n * directory already occupies the path — callers own the error wording and the\n * force/overwrite policy.\n */\nexport async function assertDirOverwritable(dir: string): Promise<DirOverwritable> {\n return (await directoryExists(dir)) ? { ok: false, exists: true } : { ok: true };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAM,yBAAyB;AAE/B,IAAM,a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S,OAAO,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACvD;AACA,QAAI,SAAS,YAAY;AACvB,qBAAe,SAAS,WAAW;AAAA,IACrC;AACA,WAAO,SAAS;AAAA,EAClB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,MAAgB,sBACd,KACA,OACA,UACe;AACf,UAAM,SAAS,MAAM,sBAAsB,GAAG;AAC9C,QAAI,OAAO,GAAI;AACf,QAAI,CAAC,OAAO;AACV,WAAK,MAAM,GAAG,SAAS,MAAM;AAAA,4BAA+B,EAAE,MAAM,WAAW,MAAM,CAAC;AAAA,IACxF;AACA,SAAK,KAAK,SAAS,WAAW;AAAA,EAChC;AACF;","names":["process","styles","chalk","styles"]}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
SCROLL_VIEWPORT
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
init_esm_shims
|
|
7
|
-
} from "./chunk-P56WJ5FA.js";
|
|
4
|
+
} from "./chunk-76ADG7LQ.js";
|
|
8
5
|
|
|
9
6
|
// src/cli/components/wizard/scroll-affordance.tsx
|
|
10
|
-
init_esm_shims();
|
|
11
7
|
import { Box, Text } from "ink";
|
|
12
8
|
import { jsx } from "react/jsx-runtime";
|
|
13
9
|
function formatHiddenCounts(hiddenAbove, hiddenBelow) {
|
|
@@ -24,4 +20,4 @@ var ScrollAffordance = ({ hiddenAbove, hiddenBelow }) => {
|
|
|
24
20
|
export {
|
|
25
21
|
ScrollAffordance
|
|
26
22
|
};
|
|
27
|
-
//# sourceMappingURL=chunk-
|
|
23
|
+
//# sourceMappingURL=chunk-KXYVJGJP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/scroll-affordance.tsx"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { SCROLL_VIEWPORT } from \"../../consts.js\";\n\nexport type ScrollAffordanceProps = {\n /** Content lines scrolled off the top of the viewport. */\n hiddenAbove: number;\n /** Content lines that do not fit below the viewport. */\n hiddenBelow: number;\n};\n\nfunction formatHiddenCounts(hiddenAbove: number, hiddenBelow: number): string {\n return [\n hiddenAbove > 0 ? `${hiddenAbove} more above` : null,\n hiddenBelow > 0 ? `${hiddenBelow} more below` : null,\n ]\n .filter((part) => part !== null)\n .join(\" \");\n}\n\n/**\n * One pinned line telling the user the viewport is clipping content.\n *\n * Render this as a SIBLING of the clipped viewport, never inside it: a\n * viewport that clips its own overflow would clip this line too. Its fixed\n * `SCROLL_INDICATOR_HEIGHT` row is taken out of the space the viewport grows\n * into, so the viewport shrinks by exactly one row while the affordance shows.\n */\nexport const ScrollAffordance: React.FC<ScrollAffordanceProps> = ({ hiddenAbove, hiddenBelow }) => {\n if (hiddenAbove <= 0 && hiddenBelow <= 0) return null;\n\n return (\n <Box height={SCROLL_VIEWPORT.SCROLL_INDICATOR_HEIGHT} flexShrink={0}>\n <Text dimColor>{formatHiddenCounts(hiddenAbove, hiddenBelow)}</Text>\n </Box>\n );\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/scroll-affordance.tsx"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { SCROLL_VIEWPORT } from \"../../consts.js\";\n\nexport type ScrollAffordanceProps = {\n /** Content lines scrolled off the top of the viewport. */\n hiddenAbove: number;\n /** Content lines that do not fit below the viewport. */\n hiddenBelow: number;\n};\n\nfunction formatHiddenCounts(hiddenAbove: number, hiddenBelow: number): string {\n return [\n hiddenAbove > 0 ? `${hiddenAbove} more above` : null,\n hiddenBelow > 0 ? `${hiddenBelow} more below` : null,\n ]\n .filter((part) => part !== null)\n .join(\" \");\n}\n\n/**\n * One pinned line telling the user the viewport is clipping content.\n *\n * Render this as a SIBLING of the clipped viewport, never inside it: a\n * viewport that clips its own overflow would clip this line too. Its fixed\n * `SCROLL_INDICATOR_HEIGHT` row is taken out of the space the viewport grows\n * into, so the viewport shrinks by exactly one row while the affordance shows.\n */\nexport const ScrollAffordance: React.FC<ScrollAffordanceProps> = ({ hiddenAbove, hiddenBelow }) => {\n if (hiddenAbove <= 0 && hiddenBelow <= 0) return null;\n\n return (\n <Box height={SCROLL_VIEWPORT.SCROLL_INDICATOR_HEIGHT} flexShrink={0}>\n <Text dimColor>{formatHiddenCounts(hiddenAbove, hiddenBelow)}</Text>\n </Box>\n );\n};\n"],"mappings":";;;;;;AAAA,SAAS,KAAK,YAAY;AAiCpB;AAtBN,SAAS,mBAAmB,aAAqB,aAA6B;AAC5E,SAAO;AAAA,IACL,cAAc,IAAI,GAAG,WAAW,gBAAgB;AAAA,IAChD,cAAc,IAAI,GAAG,WAAW,gBAAgB;AAAA,EAClD,EACG,OAAO,CAAC,SAAS,SAAS,IAAI,EAC9B,KAAK,KAAK;AACf;AAUO,IAAM,mBAAoD,CAAC,EAAE,aAAa,YAAY,MAAM;AACjG,MAAI,eAAe,KAAK,eAAe,EAAG,QAAO;AAEjD,SACE,oBAAC,OAAI,QAAQ,gBAAgB,yBAAyB,YAAY,GAChE,8BAAC,QAAK,UAAQ,MAAE,6BAAmB,aAAa,WAAW,GAAE,GAC/D;AAEJ;","names":[]}
|
|
@@ -1,37 +1,32 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
useMeasuredHeight
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
ScrollAffordance
|
|
7
|
-
} from "./chunk-KOPEM3Q7.js";
|
|
4
|
+
} from "./chunk-TSIU7DME.js";
|
|
8
5
|
import {
|
|
9
6
|
getStackName
|
|
10
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5GUOIJSG.js";
|
|
8
|
+
import {
|
|
9
|
+
ScrollAffordance
|
|
10
|
+
} from "./chunk-KXYVJGJP.js";
|
|
11
11
|
import {
|
|
12
12
|
SkillAgentSummary
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-LZ52XEPR.js";
|
|
14
14
|
import {
|
|
15
15
|
useWizardStore
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-5UWKOOIS.js";
|
|
17
17
|
import {
|
|
18
18
|
ALL_SKILLS_EJECTED_LABEL,
|
|
19
19
|
CLI_COLORS,
|
|
20
20
|
DEFAULT_PUBLIC_SOURCE_NAME,
|
|
21
21
|
EJECT_SOURCE,
|
|
22
22
|
formatSourceDisplayName
|
|
23
|
-
} from "./chunk-
|
|
24
|
-
import {
|
|
25
|
-
init_esm_shims
|
|
26
|
-
} from "./chunk-P56WJ5FA.js";
|
|
23
|
+
} from "./chunk-76ADG7LQ.js";
|
|
27
24
|
|
|
28
25
|
// src/cli/components/wizard/summary-panel.tsx
|
|
29
|
-
init_esm_shims();
|
|
30
26
|
import { Box, Text } from "ink";
|
|
31
27
|
import { unique } from "remeda";
|
|
32
28
|
|
|
33
29
|
// src/cli/components/hooks/use-panel-scroll.ts
|
|
34
|
-
init_esm_shims();
|
|
35
30
|
import { useEffect, useRef, useState } from "react";
|
|
36
31
|
import { measureElement, useInput } from "ink";
|
|
37
32
|
function usePanelScroll() {
|
|
@@ -125,4 +120,4 @@ var SummaryPanel = () => {
|
|
|
125
120
|
export {
|
|
126
121
|
SummaryPanel
|
|
127
122
|
};
|
|
128
|
-
//# sourceMappingURL=chunk-
|
|
123
|
+
//# sourceMappingURL=chunk-L7SZXUBJ.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/summary-panel.tsx","../src/cli/components/hooks/use-panel-scroll.ts"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { unique } from \"remeda\";\nimport {\n ALL_SKILLS_EJECTED_LABEL,\n CLI_COLORS,\n DEFAULT_PUBLIC_SOURCE_NAME,\n EJECT_SOURCE,\n formatSourceDisplayName,\n} from \"../../consts.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport type { SkillConfig } from \"../../types/config.js\";\nimport { usePanelScroll } from \"../hooks/use-panel-scroll.js\";\nimport { ScrollAffordance } from \"./scroll-affordance.js\";\nimport { SkillAgentSummary } from \"./skill-agent-summary.js\";\nimport { getStackName } from \"./utils.js\";\n\n/**\n * The Marketplace row's value: the distinct marketplaces the summarised skills come from.\n *\n * `SkillConfig.source` is authoritative for where a skill came from (D-217) and holds exactly one\n * of two things: {@link EJECT_SOURCE}, meaning the files were copied locally, or the marketplace's\n * own name as its `marketplace.json` declares it — which is why a project initialised from a\n * different marketplace names that marketplace here without any extra plumbing.\n *\n * Three cases, and the two zero-marketplace ones are NOT the same state:\n * - **No skills at all.** Reachable — the `I` overlay opens from the stack step before anything is\n * selected. Nothing is claimed yet, so the default public marketplace stands in.\n * - **Skills, but every one ejected.** \"eject\" names no marketplace, so there is none to list;\n * naming the default would assert an origin none of those skills has.\n * - **Any marketplace-sourced skill.** Its marketplace is named. Ejected siblings contribute no\n * name but do not suppress the ones that do.\n *\n * Tombstoned (`excluded`) entries count. One still records a real global install and the\n * marketplace it came from, and `computeScopeDiff` renders it as a row in the summary below, so\n * dropping it here would leave the header disowning a row it sits above.\n *\n * Sorted, so the row cannot reorder between renders on config iteration order alone.\n */\nfunction formatSkillMarketplaces(skillConfigs: SkillConfig[]): string {\n if (skillConfigs.length === 0) return formatSourceDisplayName(DEFAULT_PUBLIC_SOURCE_NAME);\n\n const marketplaceNames = unique(\n skillConfigs.map((config) => config.source).filter((source) => source !== EJECT_SOURCE),\n );\n if (marketplaceNames.length === 0) return ALL_SKILLS_EJECTED_LABEL;\n\n return marketplaceNames\n .map((name) => formatSourceDisplayName(name))\n .sort()\n .join(\" · \");\n}\n\ntype PanelHeaderProps = {\n sourceNames: string;\n stackName: string | undefined;\n};\n\n/**\n * Which marketplaces and which stack the summary below was built from.\n *\n * Rendered inside the scrolled content, so its `marginBottom` scrolls away\n * rather than permanently costing the viewport a row.\n *\n * `flexShrink={0}` is load-bearing: Ink defaults every box to `flexShrink: 1`,\n * so on a short terminal Yoga squeezes this block to fit instead of letting the\n * viewport clip it, and the Marketplace and Stack rows overprint into one\n * unreadable line. Clipping is the panel's job; the header must keep its height.\n */\nconst PanelHeader: React.FC<PanelHeaderProps> = ({ sourceNames, stackName }) => (\n <Box\n flexDirection=\"column\"\n flexShrink={0}\n borderStyle=\"single\"\n borderBottom={true}\n borderTop={false}\n borderLeft={false}\n borderRight={false}\n borderColor={CLI_COLORS.NEUTRAL}\n borderBottomDimColor\n paddingBottom={1}\n marginBottom={1}\n >\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Marketplace\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{sourceNames}</Text>\n </Box>\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Stack\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{stackName ?? \"none\"}</Text>\n </Box>\n </Box>\n);\n\n/**\n * Marketplace/stack header above a clipped, arrow-scrollable\n * `SkillAgentSummary` — the one panel both summary surfaces render: the `I`\n * overlay in `wizard-layout.tsx` and the confirm step.\n *\n * It owns the `↑`/`↓` keys through `usePanelScroll`. A host that needs other\n * keys adds its own `useInput` alongside it — `StepConfirm` claims `Enter` and\n * `Esc` that way.\n *\n * Horizontal padding only. Vertical padding is unshrinkable, so on a short\n * terminal it claims the last row the viewport has and the content measures 0\n * before it has ever been laid out — the panel then paints neither a summary\n * row nor the affordance that would say rows are missing.\n */\nexport const SummaryPanel: React.FC = () => {\n const skillConfigs = useWizardStore((s) => s.skillConfigs);\n const agentConfigs = useWizardStore((s) => s.agentConfigs);\n const selectedStackId = useWizardStore((s) => s.selectedStackId);\n const { viewportRef, contentRef, contentMarginTop, hiddenAbove, hiddenBelow } = usePanelScroll();\n\n const sourceNames = formatSkillMarketplaces(skillConfigs);\n const stackName = getStackName(selectedStackId);\n\n return (\n <Box\n flexDirection=\"column\"\n flexGrow={1}\n flexBasis={0}\n borderStyle=\"single\"\n borderColor={CLI_COLORS.NEUTRAL}\n paddingX={2}\n >\n <Box ref={viewportRef} flexDirection=\"column\" flexGrow={1} flexBasis={0} overflow=\"hidden\">\n <Box ref={contentRef} flexDirection=\"column\" flexShrink={0} marginTop={contentMarginTop}>\n <PanelHeader sourceNames={sourceNames} stackName={stackName} />\n\n <Box width=\"100%\">\n <SkillAgentSummary skillConfigs={skillConfigs} agentConfigs={agentConfigs} />\n </Box>\n </Box>\n </Box>\n <ScrollAffordance hiddenAbove={hiddenAbove} hiddenBelow={hiddenBelow} />\n </Box>\n );\n};\n","import { useEffect, useRef, useState } from \"react\";\nimport type { Ref, RefObject } from \"react\";\nimport { type DOMElement, measureElement, useInput } from \"ink\";\nimport { useMeasuredHeight } from \"./use-measured-height.js\";\n\nexport type UsePanelScrollResult = {\n /** Attach to the clipping box — the one with `overflow=\"hidden\"`. */\n viewportRef: Ref<DOMElement>;\n /** Attach to the scrolled content box inside the viewport. */\n contentRef: RefObject<DOMElement | null>;\n /** Apply as the content box's `marginTop`; negative by the number of lines scrolled off the top. */\n contentMarginTop: number;\n /** Content lines scrolled off the top of the viewport. */\n hiddenAbove: number;\n /** Content lines clipped below the viewport. */\n hiddenBelow: number;\n};\n\n/**\n * Line scrolling for a single clipped viewport, driven by the `↑`/`↓` keys.\n *\n * The caller renders viewport, content and a `ScrollAffordance` sibling; this\n * owns the offset those three agree on. Distinct from `useSectionScroll`, which\n * moves a viewport to follow focus across variable-height sections — here there\n * is no focus, only the arrow keys.\n *\n * A host that needs other keys adds its own `useInput` alongside it, on keys\n * disjoint from `↑`/`↓`.\n */\nexport function usePanelScroll(): UsePanelScrollResult {\n // Measured on the clipping box itself, inside the border and padding, so it\n // is the height the content actually gets.\n const { ref: viewportRef, measuredHeight: viewportHeight } = useMeasuredHeight();\n const contentRef = useRef<DOMElement>(null);\n const [contentHeight, setContentHeight] = useState(0);\n const [scrollOffset, setScrollOffset] = useState(0);\n\n useEffect(() => {\n if (!contentRef.current) return;\n const { height } = measureElement(contentRef.current);\n // Yoga under-reports a wrapped subtree measured inside a viewport too\n // short to lay it out, and reports 0 inside a zero-height one, so the\n // tallest reading is the trustworthy one. Believing a squeezed reading\n // would shrink the hidden-line count until the affordance disappeared,\n // which hands its row back and grows the count again — a render loop.\n setContentHeight((prev) => Math.max(prev, height));\n });\n\n // contentHeight only ever sizes the scroll range and the affordance count.\n // It must never gate the clip — which is why it is not returned: a viewport\n // that stops clipping when it looks too small grows to content height, which\n // makes it look big enough to stop clipping — a stable wrong answer that\n // paints the content over the border.\n const maxScroll = Math.max(0, contentHeight - viewportHeight);\n const hiddenBelow = Math.max(0, maxScroll - scrollOffset);\n\n useInput((_input, key) => {\n if (key.upArrow) setScrollOffset((prev) => Math.max(0, prev - 1));\n if (key.downArrow) setScrollOffset((prev) => Math.min(maxScroll, prev + 1));\n });\n\n return {\n viewportRef,\n contentRef,\n contentMarginTop: scrollOffset > 0 ? -scrollOffset : 0,\n hiddenAbove: scrollOffset,\n hiddenBelow,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA,SAAS,KAAK,YAAY;AAE1B,SAAS,cAAc;;;ACFvB;AAAA,SAAS,WAAW,QAAQ,gBAAgB;AAE5C,SAA0B,gBAAgB,gBAAgB;AA2BnD,SAAS,iBAAuC;AAGrD,QAAM,EAAE,KAAK,aAAa,gBAAgB,eAAe,IAAI,kBAAkB;AAC/E,QAAM,aAAa,OAAmB,IAAI;AAC1C,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AACpD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,CAAC;AAElD,YAAU,MAAM;AACd,QAAI,CAAC,WAAW,QAAS;AACzB,UAAM,EAAE,OAAO,IAAI,eAAe,WAAW,OAAO;AAMpD,qBAAiB,CAAC,SAAS,KAAK,IAAI,MAAM,MAAM,CAAC;AAAA,EACnD,CAAC;AAOD,QAAM,YAAY,KAAK,IAAI,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AAW,GAClC;AAAA,4BAAC,QAAK,OAAO,WAAW,SAAS,MAAI,MAAC,mBAEtC;AAAA,QACA,oBAAC,QAAK,OAAO,WAAW,SAAU,uBAAa,QAAO;AAAA,SACxD;AAAA;AAAA;AACF;AAiBK,IAAM,eAAyB,MAAM;AAC1C,QAAM,eAAe,eAAe,CAAC,MAAM,EAAE,YAAY;AACzD,QAAM,eAAe,eAAe,CAAC,MAAM,EAAE,YAAY;AACzD,QAAM,kBAAkB,eAAe,CAAC,MAAM,EAAE,eAAe;AAC/D,QAAM,EAAE,aAAa,YAAY,kBAAkB,aAAa,YAAY,IAAI,eAAe;AAE/F,QAAM,cAAc,wBAAwB,YAAY;AACxD,QAAM,YAAY,aAAa,eAAe;AAE9C,SACE;AAAA,IAAC;AAAA;AAAA,MACC,eAAc;AAAA,MACd,UAAU;AAAA,MACV,WAAW;AAAA,MACX,aAAY;AAAA,MACZ,aAAa,WAAW;AAAA,MACxB,UAAU;AAAA,MAEV;AAAA,4BAAC,OAAI,KAAK,aAAa,eAAc,UAAS,UAAU,GAAG,WAAW,GAAG,UAAS,UAChF,+BAAC,OAAI,KAAK,YAAY,eAAc,UAAS,YAAY,GAAG,WAAW,kBACrE;AAAA,8BAAC,eAAY,aAA0B,WAAsB;AAAA,UAE7D,oBAAC,OAAI,OAAM,QACT,8BAAC,qBAAkB,cAA4B,cAA4B,GAC7E;AAAA,WACF,GACF;AAAA,QACA,oBAAC,oBAAiB,aAA0B,aAA0B;AAAA;AAAA;AAAA,EACxE;AAEJ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/summary-panel.tsx","../src/cli/components/hooks/use-panel-scroll.ts"],"sourcesContent":["import { Box, Text } from \"ink\";\nimport React from \"react\";\nimport { unique } from \"remeda\";\nimport {\n ALL_SKILLS_EJECTED_LABEL,\n CLI_COLORS,\n DEFAULT_PUBLIC_SOURCE_NAME,\n EJECT_SOURCE,\n formatSourceDisplayName,\n} from \"../../consts.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport type { SkillConfig } from \"../../types/config.js\";\nimport { usePanelScroll } from \"../hooks/use-panel-scroll.js\";\nimport { ScrollAffordance } from \"./scroll-affordance.js\";\nimport { SkillAgentSummary } from \"./skill-agent-summary.js\";\nimport { getStackName } from \"./utils.js\";\n\n/**\n * The Marketplace row's value: the distinct marketplaces the summarised skills come from.\n *\n * `SkillConfig.source` is authoritative for where a skill came from (D-217) and holds exactly one\n * of two things: {@link EJECT_SOURCE}, meaning the files were copied locally, or the marketplace's\n * own name as its `marketplace.json` declares it — which is why a project initialised from a\n * different marketplace names that marketplace here without any extra plumbing.\n *\n * Three cases, and the two zero-marketplace ones are NOT the same state:\n * - **No skills at all.** Reachable — the `I` overlay opens from the stack step before anything is\n * selected. Nothing is claimed yet, so the default public marketplace stands in.\n * - **Skills, but every one ejected.** \"eject\" names no marketplace, so there is none to list;\n * naming the default would assert an origin none of those skills has.\n * - **Any marketplace-sourced skill.** Its marketplace is named. Ejected siblings contribute no\n * name but do not suppress the ones that do.\n *\n * Tombstoned (`excluded`) entries count. One still records a real global install and the\n * marketplace it came from, and `computeScopeDiff` renders it as a row in the summary below, so\n * dropping it here would leave the header disowning a row it sits above.\n *\n * Sorted, so the row cannot reorder between renders on config iteration order alone.\n */\nfunction formatSkillMarketplaces(skillConfigs: SkillConfig[]): string {\n if (skillConfigs.length === 0) return formatSourceDisplayName(DEFAULT_PUBLIC_SOURCE_NAME);\n\n const marketplaceNames = unique(\n skillConfigs.map((config) => config.source).filter((source) => source !== EJECT_SOURCE),\n );\n if (marketplaceNames.length === 0) return ALL_SKILLS_EJECTED_LABEL;\n\n return marketplaceNames\n .map((name) => formatSourceDisplayName(name))\n .sort()\n .join(\" · \");\n}\n\ntype PanelHeaderProps = {\n sourceNames: string;\n stackName: string | undefined;\n};\n\n/**\n * Which marketplaces and which stack the summary below was built from.\n *\n * Rendered inside the scrolled content, so its `marginBottom` scrolls away\n * rather than permanently costing the viewport a row.\n *\n * `flexShrink={0}` is load-bearing: Ink defaults every box to `flexShrink: 1`,\n * so on a short terminal Yoga squeezes this block to fit instead of letting the\n * viewport clip it, and the Marketplace and Stack rows overprint into one\n * unreadable line. Clipping is the panel's job; the header must keep its height.\n */\nconst PanelHeader: React.FC<PanelHeaderProps> = ({ sourceNames, stackName }) => (\n <Box\n flexDirection=\"column\"\n flexShrink={0}\n borderStyle=\"single\"\n borderBottom={true}\n borderTop={false}\n borderLeft={false}\n borderRight={false}\n borderColor={CLI_COLORS.NEUTRAL}\n borderBottomDimColor\n paddingBottom={1}\n marginBottom={1}\n >\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Marketplace\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{sourceNames}</Text>\n </Box>\n <Box flexDirection=\"row\" columnGap={1}>\n <Text color={CLI_COLORS.WARNING} bold>\n Stack\n </Text>\n <Text color={CLI_COLORS.NEUTRAL}>{stackName ?? \"none\"}</Text>\n </Box>\n </Box>\n);\n\n/**\n * Marketplace/stack header above a clipped, arrow-scrollable\n * `SkillAgentSummary` — the one panel both summary surfaces render: the `I`\n * overlay in `wizard-layout.tsx` and the confirm step.\n *\n * It owns the `↑`/`↓` keys through `usePanelScroll`. A host that needs other\n * keys adds its own `useInput` alongside it — `StepConfirm` claims `Enter` and\n * `Esc` that way.\n *\n * Horizontal padding only. Vertical padding is unshrinkable, so on a short\n * terminal it claims the last row the viewport has and the content measures 0\n * before it has ever been laid out — the panel then paints neither a summary\n * row nor the affordance that would say rows are missing.\n */\nexport const SummaryPanel: React.FC = () => {\n const skillConfigs = useWizardStore((s) => s.skillConfigs);\n const agentConfigs = useWizardStore((s) => s.agentConfigs);\n const selectedStackId = useWizardStore((s) => s.selectedStackId);\n const { viewportRef, contentRef, contentMarginTop, hiddenAbove, hiddenBelow } = usePanelScroll();\n\n const sourceNames = formatSkillMarketplaces(skillConfigs);\n const stackName = getStackName(selectedStackId);\n\n return (\n <Box\n flexDirection=\"column\"\n flexGrow={1}\n flexBasis={0}\n borderStyle=\"single\"\n borderColor={CLI_COLORS.NEUTRAL}\n paddingX={2}\n >\n <Box ref={viewportRef} flexDirection=\"column\" flexGrow={1} flexBasis={0} overflow=\"hidden\">\n <Box ref={contentRef} flexDirection=\"column\" flexShrink={0} marginTop={contentMarginTop}>\n <PanelHeader sourceNames={sourceNames} stackName={stackName} />\n\n <Box width=\"100%\">\n <SkillAgentSummary skillConfigs={skillConfigs} agentConfigs={agentConfigs} />\n </Box>\n </Box>\n </Box>\n <ScrollAffordance hiddenAbove={hiddenAbove} hiddenBelow={hiddenBelow} />\n </Box>\n );\n};\n","import { useEffect, useRef, useState } from \"react\";\nimport type { Ref, RefObject } from \"react\";\nimport { type DOMElement, measureElement, useInput } from \"ink\";\nimport { useMeasuredHeight } from \"./use-measured-height.js\";\n\nexport type UsePanelScrollResult = {\n /** Attach to the clipping box — the one with `overflow=\"hidden\"`. */\n viewportRef: Ref<DOMElement>;\n /** Attach to the scrolled content box inside the viewport. */\n contentRef: RefObject<DOMElement | null>;\n /** Apply as the content box's `marginTop`; negative by the number of lines scrolled off the top. */\n contentMarginTop: number;\n /** Content lines scrolled off the top of the viewport. */\n hiddenAbove: number;\n /** Content lines clipped below the viewport. */\n hiddenBelow: number;\n};\n\n/**\n * Line scrolling for a single clipped viewport, driven by the `↑`/`↓` keys.\n *\n * The caller renders viewport, content and a `ScrollAffordance` sibling; this\n * owns the offset those three agree on. Distinct from `useSectionScroll`, which\n * moves a viewport to follow focus across variable-height sections — here there\n * is no focus, only the arrow keys.\n *\n * A host that needs other keys adds its own `useInput` alongside it, on keys\n * disjoint from `↑`/`↓`.\n */\nexport function usePanelScroll(): UsePanelScrollResult {\n // Measured on the clipping box itself, inside the border and padding, so it\n // is the height the content actually gets.\n const { ref: viewportRef, measuredHeight: viewportHeight } = useMeasuredHeight();\n const contentRef = useRef<DOMElement>(null);\n const [contentHeight, setContentHeight] = useState(0);\n const [scrollOffset, setScrollOffset] = useState(0);\n\n // Ink's measurement idiom: re-measure on every render, no dependency array\n // on purpose. The setState inside is guarded to fire only when the measured\n // height actually changed, so the chain converges instead of looping — a\n // dependency array here would skip re-measures after layout changes React\n // cannot see.\n // eslint-disable-next-line react-hooks/exhaustive-deps\n useEffect(() => {\n if (!contentRef.current) return;\n const { height } = measureElement(contentRef.current);\n // Yoga under-reports a wrapped subtree measured inside a viewport too\n // short to lay it out, and reports 0 inside a zero-height one, so the\n // tallest reading is the trustworthy one. Believing a squeezed reading\n // would shrink the hidden-line count until the affordance disappeared,\n // which hands its row back and grows the count again — a render loop.\n setContentHeight((prev) => Math.max(prev, height));\n });\n\n // contentHeight only ever sizes the scroll range and the affordance count.\n // It must never gate the clip — which is why it is not returned: a viewport\n // that stops clipping when it looks too small grows to content height, which\n // makes it look big enough to stop clipping — a stable wrong answer that\n // paints the content over the border.\n const maxScroll = Math.max(0, contentHeight - viewportHeight);\n const hiddenBelow = Math.max(0, maxScroll - scrollOffset);\n\n useInput((_input, key) => {\n if (key.upArrow) setScrollOffset((prev) => Math.max(0, prev - 1));\n if (key.downArrow) setScrollOffset((prev) => Math.min(maxScroll, prev + 1));\n });\n\n return {\n viewportRef,\n contentRef,\n contentMarginTop: scrollOffset > 0 ? -scrollOffset : 0,\n hiddenAbove: scrollOffset,\n hiddenBelow,\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,KAAK,YAAY;AAE1B,SAAS,cAAc;;;ACFvB,SAAS,WAAW,QAAQ,gBAAgB;AAE5C,SAA0B,gBAAgB,gBAAgB;AA2BnD,SAAS,iBAAuC;AAGrD,QAAM,EAAE,KAAK,aAAa,gBAAgB,eAAe,IAAI,kBAAkB;AAC/E,QAAM,aAAa,OAAmB,IAAI;AAC1C,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AACpD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,CAAC;AAQlD,YAAU,MAAM;AACd,QAAI,CAAC,WA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|
|
4
|
+
} from "./chunk-TSIU7DME.js";
|
|
5
5
|
import {
|
|
6
6
|
CategoryGrid
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-QRDTLVXG.js";
|
|
8
8
|
import {
|
|
9
9
|
buildCategoriesForDomain,
|
|
10
10
|
useWizardStore
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import {
|
|
13
|
-
init_esm_shims
|
|
14
|
-
} from "./chunk-P56WJ5FA.js";
|
|
11
|
+
} from "./chunk-5UWKOOIS.js";
|
|
15
12
|
|
|
16
13
|
// src/cli/components/wizard/step-build.tsx
|
|
17
|
-
init_esm_shims();
|
|
18
14
|
import { Box, useInput } from "ink";
|
|
19
15
|
import { useCallback, useMemo as useMemo2 } from "react";
|
|
20
16
|
|
|
21
17
|
// src/cli/components/hooks/use-framework-filtering.ts
|
|
22
|
-
init_esm_shims();
|
|
23
18
|
import { useMemo } from "react";
|
|
24
19
|
function useFrameworkFiltering({
|
|
25
20
|
domain,
|
|
@@ -108,4 +103,4 @@ var StepBuild = ({
|
|
|
108
103
|
export {
|
|
109
104
|
StepBuild
|
|
110
105
|
};
|
|
111
|
-
//# sourceMappingURL=chunk-
|
|
106
|
+
//# sourceMappingURL=chunk-LASI35KT.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/step-build.tsx","../src/cli/components/hooks/use-framework-filtering.ts"],"sourcesContent":["import { Box, useInput } from \"ink\";\nimport React, { useCallback, useMemo } from \"react\";\nimport type { Domain, SkillId, Category, CategorySelections } from \"../../types/index.js\";\nimport { useFrameworkFiltering } from \"../hooks/use-framework-filtering.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { CategoryGrid } from \"./category-grid.js\";\n\nexport type StepBuildProps = {\n domain: Domain;\n selectedDomains: Domain[];\n selections: CategorySelections;\n allSelections: SkillId[];\n showLabels: boolean;\n filterIncompatible: boolean;\n /** Skill IDs already installed on disk, shown with a dimmed checkmark */\n installedSkillIds?: SkillId[];\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n onToggleFilterIncompatible: () => void;\n onContinue: () => void;\n onBack: () => void;\n};\n\nexport const StepBuild: React.FC<StepBuildProps> = ({\n domain: activeDomain,\n selections,\n allSelections,\n showLabels,\n filterIncompatible,\n installedSkillIds,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n onContinue,\n onBack,\n}) => {\n const { ref: gridRef, measuredHeight: gridHeight } = useMeasuredHeight();\n const skillConfigs = useWizardStore((s) => s.skillConfigs);\n\n const handleFocusedSkillChange = useCallback(\n (id: SkillId | null) => useWizardStore.getState().setFocusedSkillId(id),\n [],\n );\n\n const categories = useFrameworkFiltering({\n domain: activeDomain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n });\n\n const { initialRow, initialCol } = useMemo(() => {\n const skillId = useWizardStore.getState().focusedSkillId;\n if (!skillId) return { initialRow: 0, initialCol: 0 };\n const row = categories.findIndex((cat) => cat.options.some((o) => o.id === skillId));\n if (row < 0) return { initialRow: 0, initialCol: 0 };\n return {\n initialRow: row,\n initialCol: categories[row].options.findIndex((o) => o.id === skillId),\n };\n }, [categories]);\n\n useInput((_input, key) => {\n if (key.return) {\n onContinue();\n } else if (key.escape) {\n onBack();\n }\n });\n\n return (\n <Box flexDirection=\"column\" width=\"100%\" flexGrow={1} flexBasis={0}>\n <Box ref={gridRef} flexGrow={1} flexBasis={0}>\n <CategoryGrid\n key={activeDomain}\n categories={categories}\n availableHeight={gridHeight}\n showLabels={showLabels}\n defaultFocusedRow={initialRow}\n defaultFocusedCol={initialCol}\n onToggle={onToggle}\n onToggleLabels={onToggleLabels}\n onToggleFilterIncompatible={onToggleFilterIncompatible}\n onFocusedSkillChange={handleFocusedSkillChange}\n />\n </Box>\n </Box>\n );\n};\n","import { useMemo } from \"react\";\nimport type { Domain, SkillId, CategorySelections } from \"../../types/index.js\";\nimport type { SkillConfig } from \"../../types/config.js\";\nimport { buildCategoriesForDomain } from \"../../lib/wizard/index.js\";\nimport type { CategoryRow } from \"../wizard/category-grid.js\";\n\ntype UseFrameworkFilteringOptions = {\n domain: Domain;\n allSelections: SkillId[];\n selections: CategorySelections;\n installedSkillIds?: SkillId[];\n skillConfigs?: SkillConfig[];\n filterIncompatible?: boolean;\n};\n\nexport function useFrameworkFiltering({\n domain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n}: UseFrameworkFilteringOptions): CategoryRow[] {\n return useMemo(\n () =>\n buildCategoriesForDomain(\n domain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n ),\n [domain, allSelections, selections, installedSkillIds, skillConfigs, filterIncompatible],\n );\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/step-build.tsx","../src/cli/components/hooks/use-framework-filtering.ts"],"sourcesContent":["import { Box, useInput } from \"ink\";\nimport React, { useCallback, useMemo } from \"react\";\nimport type { Domain, SkillId, Category, CategorySelections } from \"../../types/index.js\";\nimport { useFrameworkFiltering } from \"../hooks/use-framework-filtering.js\";\nimport { useMeasuredHeight } from \"../hooks/use-measured-height.js\";\nimport { useWizardStore } from \"../../stores/wizard-store.js\";\nimport { CategoryGrid } from \"./category-grid.js\";\n\nexport type StepBuildProps = {\n domain: Domain;\n selectedDomains: Domain[];\n selections: CategorySelections;\n allSelections: SkillId[];\n showLabels: boolean;\n filterIncompatible: boolean;\n /** Skill IDs already installed on disk, shown with a dimmed checkmark */\n installedSkillIds?: SkillId[];\n onToggle: (categoryId: Category, technologyId: SkillId) => void;\n onToggleLabels: () => void;\n onToggleFilterIncompatible: () => void;\n onContinue: () => void;\n onBack: () => void;\n};\n\nexport const StepBuild: React.FC<StepBuildProps> = ({\n domain: activeDomain,\n selections,\n allSelections,\n showLabels,\n filterIncompatible,\n installedSkillIds,\n onToggle,\n onToggleLabels,\n onToggleFilterIncompatible,\n onContinue,\n onBack,\n}) => {\n const { ref: gridRef, measuredHeight: gridHeight } = useMeasuredHeight();\n const skillConfigs = useWizardStore((s) => s.skillConfigs);\n\n const handleFocusedSkillChange = useCallback(\n (id: SkillId | null) => useWizardStore.getState().setFocusedSkillId(id),\n [],\n );\n\n const categories = useFrameworkFiltering({\n domain: activeDomain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n });\n\n const { initialRow, initialCol } = useMemo(() => {\n const skillId = useWizardStore.getState().focusedSkillId;\n if (!skillId) return { initialRow: 0, initialCol: 0 };\n const row = categories.findIndex((cat) => cat.options.some((o) => o.id === skillId));\n if (row < 0) return { initialRow: 0, initialCol: 0 };\n return {\n initialRow: row,\n initialCol: categories[row].options.findIndex((o) => o.id === skillId),\n };\n }, [categories]);\n\n useInput((_input, key) => {\n if (key.return) {\n onContinue();\n } else if (key.escape) {\n onBack();\n }\n });\n\n return (\n <Box flexDirection=\"column\" width=\"100%\" flexGrow={1} flexBasis={0}>\n <Box ref={gridRef} flexGrow={1} flexBasis={0}>\n <CategoryGrid\n key={activeDomain}\n categories={categories}\n availableHeight={gridHeight}\n showLabels={showLabels}\n defaultFocusedRow={initialRow}\n defaultFocusedCol={initialCol}\n onToggle={onToggle}\n onToggleLabels={onToggleLabels}\n onToggleFilterIncompatible={onToggleFilterIncompatible}\n onFocusedSkillChange={handleFocusedSkillChange}\n />\n </Box>\n </Box>\n );\n};\n","import { useMemo } from \"react\";\nimport type { Domain, SkillId, CategorySelections } from \"../../types/index.js\";\nimport type { SkillConfig } from \"../../types/config.js\";\nimport { buildCategoriesForDomain } from \"../../lib/wizard/index.js\";\nimport type { CategoryRow } from \"../wizard/category-grid.js\";\n\ntype UseFrameworkFilteringOptions = {\n domain: Domain;\n allSelections: SkillId[];\n selections: CategorySelections;\n installedSkillIds?: SkillId[];\n skillConfigs?: SkillConfig[];\n filterIncompatible?: boolean;\n};\n\nexport function useFrameworkFiltering({\n domain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n}: UseFrameworkFilteringOptions): CategoryRow[] {\n return useMemo(\n () =>\n buildCategoriesForDomain(\n domain,\n allSelections,\n selections,\n installedSkillIds,\n skillConfigs,\n filterIncompatible,\n ),\n [domain, allSelections, selections, installedSkillIds, skillConfigs, filterIncompatible],\n );\n}\n"],"mappings":";;;;;;;;;;;;;AAAA,SAAS,KAAK,gBAAgB;AAC9B,SAAgB,aAAa,WAAAA,gBAAe;;;ACD5C,SAAS,eAAe;AAejB,SAAS,sBAAsB;AAAA,EACpC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAAgD;AAC9C,SAAO;AAAA,IACL,MACE;AAAA,MACE;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IACF;AAAA,IACF,CAAC,QAAQ,eAAe,YAAY,mBAAmB,cAAc,kBAAkB;AAAA,EACzF;AACF;;;ADyCQ;AApDD,IAAM,YAAsC,CAAC;AAAA,EAClD,QAAQ;AAAA,EACR;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,MAAM;AACJ,QAAM,EAAE,KAAK,SAAS,gBAAgB,WAAW,IAAI,kBAAkB;AACvE,QAAM,eAAe,eAAe,CAAC,MAAM,EAAE,YAAY;AAEzD,QAAM,2BAA2B;AAAA,IAC/B,CAAC,OAAuB,eAAe,SAAS,EAAE,kBAAkB,EAAE;AAAA,IACtE,CAAC;AAAA,EACH;AAEA,QAAM,aAAa,sBAAsB;AAAA,IACvC,QAAQ;AAAA,IACR;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF,CAAC;AAED,QAAM,EAAE,YAAY,WAAW,IAAIC,SAAQ,MAAM;AAC/C,UAAM,UAAU,eAAe,SAAS,EAAE;AAC1C,QAAI,CAAC,QAAS,QAAO,EAAE,YAAY,GAAG,YAAY,EAAE;AACpD,UAAM,MAAM,WAAW,UAAU,CAAC,QAAQ,IAAI,QAAQ,KAAK,CAAC,MAAM,EAAE,OAAO,OAAO,CAAC;AACnF,QAAI,MAAM,EAAG,QAAO,EAAE,YAAY,GAAG,YAAY,EAAE;AACnD,WAAO;AAAA,MACL,YAAY;AAAA,MACZ,YAAY,WAAW,GAAG,EAAE,QAAQ,UAAU,CAAC,MAAM,EAAE,OAAO,OAAO;AAAA,IACvE;AAAA,EACF,GAAG,CAAC,UAAU,CAAC;AAEf,WAAS,CAAC,QAAQ,QAAQ;AACxB,QAAI,IAAI,QAAQ;AACd,iBAAW;AAAA,IACb,WAAW,IAAI,QAAQ;AACrB,aAAO;AAAA,IACT;AAAA,EACF,CAAC;AAED,SACE,oBAAC,OAAI,eAAc,UAAS,OAAM,QAAO,UAAU,GAAG,WAAW,GAC/D,8BAAC,OAAI,KAAK,SAAS,UAAU,GAAG,WAAW,GACzC;AAAA,IAAC;AAAA;AAAA,MAEC;AAAA,MACA,iBAAiB;AAAA,MACjB;AAAA,MACA,mBAAmB;AAAA,MACnB,mBAAmB;AAAA,MACnB;AAAA,MACA;AAAA,MACA;AAAA,MACA,sBAAsB;AAAA;AAAA,IATjB;AAAA,EAUP,GACF,GACF;AAEJ;","names":["useMemo","useMemo"]}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
FEATURE_FLAGS
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
init_esm_shims
|
|
7
|
-
} from "./chunk-P56WJ5FA.js";
|
|
4
|
+
} from "./chunk-WBCPLH66.js";
|
|
8
5
|
|
|
9
6
|
// src/cli/components/wizard/hotkeys.ts
|
|
10
|
-
init_esm_shims();
|
|
11
7
|
var HOTKEY_INFO = { key: "i", label: "I" };
|
|
12
8
|
var HOTKEY_ACCEPT_DEFAULTS = { key: "a", label: "A" };
|
|
13
9
|
var HOTKEY_SCOPE = { key: "s", label: "S" };
|
|
@@ -49,4 +45,4 @@ export {
|
|
|
49
45
|
isHotkey,
|
|
50
46
|
isInfoPanelAvailable
|
|
51
47
|
};
|
|
52
|
-
//# sourceMappingURL=chunk-
|
|
48
|
+
//# sourceMappingURL=chunk-LDP5ASDM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/wizard/hotkeys.ts"],"sourcesContent":["/**\n * Centralized hotkey registry for wizard components.\n *\n * Every character-based hotkey and its display label lives here so that\n * changing a binding updates the key check, the footer hint, and the\n * info panel in one place.\n */\n\nimport { FEATURE_FLAGS } from \"../../lib/feature-flags.js\";\nimport type { WizardStep } from \"../../stores/wizard-store.js\";\n\n// ---------------------------------------------------------------------------\n// Global hotkeys (active across multiple wizard steps)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_INFO = { key: \"i\", label: \"I\" } as const;\nexport const HOTKEY_ACCEPT_DEFAULTS = { key: \"a\", label: \"A\" } as const;\n// HOTKEY_SCOPE and HOTKEY_SETTINGS deliberately share \"s\" — they are context-gated\n// (scope acts on the build/agents grids, settings on the settings step; never both active).\nexport const HOTKEY_SCOPE = { key: \"s\", label: \"S\" } as const;\nexport const HOTKEY_SETTINGS = { key: \"s\", label: \"S\" } as const;\n\n// ---------------------------------------------------------------------------\n// Build step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_TOGGLE_LABELS = { key: \"d\", label: \"D\" } as const;\nexport const HOTKEY_FILTER_INCOMPATIBLE = { key: \"f\", label: \"F\" } as const;\n\n// ---------------------------------------------------------------------------\n// Sources step hotkeys (customize view)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_SET_ALL_LOCAL = { key: \"l\", label: \"L\" } as const;\nexport const HOTKEY_SET_ALL_PLUGIN = { key: \"p\", label: \"P\" } as const;\n\n// ---------------------------------------------------------------------------\n// Settings step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_ADD_SOURCE = { key: \"a\", label: \"A\" } as const;\n\n// ---------------------------------------------------------------------------\n// Common key labels (for structural keys handled via Ink key objects)\n// ---------------------------------------------------------------------------\n\n/** The spacebar input character (Ink delivers a literal space for the space key). */\nexport const KEY_SPACE = \" \";\n\nexport const KEY_LABEL_ENTER = \"ENTER\" as const;\nexport const KEY_LABEL_ESC = \"ESC\" as const;\nexport const KEY_LABEL_SPACE = \"SPACE\" as const;\nexport const KEY_LABEL_DEL = \"DEL\" as const;\nexport const KEY_LABEL_ARROWS_VERT = \"\\u2191/\\u2193\" as const;\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Case-insensitive check for a character hotkey. */\nexport function isHotkey(input: string, hotkey: { key: string }): boolean {\n return input.toLowerCase() === hotkey.key.toLowerCase();\n}\n\n/**\n * Whether `HOTKEY_INFO` does anything on `step` — the single answer both the\n * key handler in `wizard.tsx` and the footer hint in `wizard-layout.tsx` read,\n * so the wizard never advertises a key it ignores.\n *\n * The confirm step is excluded because it already renders the panel the\n * overlay would show, and the overlay REPLACES the step rather than sitting\n * over it: opening it there would unmount the confirm step's `Enter` handler\n * and strand the user on a screen nothing can complete.\n */\nexport function isInfoPanelAvailable(step: WizardStep): boolean {\n return FEATURE_FLAGS.INFO_PANEL && step !== \"confirm\";\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../src/cli/components/wizard/hotkeys.ts"],"sourcesContent":["/**\n * Centralized hotkey registry for wizard components.\n *\n * Every character-based hotkey and its display label lives here so that\n * changing a binding updates the key check, the footer hint, and the\n * info panel in one place.\n */\n\nimport { FEATURE_FLAGS } from \"../../lib/feature-flags.js\";\nimport type { WizardStep } from \"../../stores/wizard-store.js\";\n\n// ---------------------------------------------------------------------------\n// Global hotkeys (active across multiple wizard steps)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_INFO = { key: \"i\", label: \"I\" } as const;\nexport const HOTKEY_ACCEPT_DEFAULTS = { key: \"a\", label: \"A\" } as const;\n// HOTKEY_SCOPE and HOTKEY_SETTINGS deliberately share \"s\" — they are context-gated\n// (scope acts on the build/agents grids, settings on the settings step; never both active).\nexport const HOTKEY_SCOPE = { key: \"s\", label: \"S\" } as const;\nexport const HOTKEY_SETTINGS = { key: \"s\", label: \"S\" } as const;\n\n// ---------------------------------------------------------------------------\n// Build step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_TOGGLE_LABELS = { key: \"d\", label: \"D\" } as const;\nexport const HOTKEY_FILTER_INCOMPATIBLE = { key: \"f\", label: \"F\" } as const;\n\n// ---------------------------------------------------------------------------\n// Sources step hotkeys (customize view)\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_SET_ALL_LOCAL = { key: \"l\", label: \"L\" } as const;\nexport const HOTKEY_SET_ALL_PLUGIN = { key: \"p\", label: \"P\" } as const;\n\n// ---------------------------------------------------------------------------\n// Settings step hotkeys\n// ---------------------------------------------------------------------------\n\nexport const HOTKEY_ADD_SOURCE = { key: \"a\", label: \"A\" } as const;\n\n// ---------------------------------------------------------------------------\n// Common key labels (for structural keys handled via Ink key objects)\n// ---------------------------------------------------------------------------\n\n/** The spacebar input character (Ink delivers a literal space for the space key). */\nexport const KEY_SPACE = \" \";\n\nexport const KEY_LABEL_ENTER = \"ENTER\" as const;\nexport const KEY_LABEL_ESC = \"ESC\" as const;\nexport const KEY_LABEL_SPACE = \"SPACE\" as const;\nexport const KEY_LABEL_DEL = \"DEL\" as const;\nexport const KEY_LABEL_ARROWS_VERT = \"\\u2191/\\u2193\" as const;\n\n// ---------------------------------------------------------------------------\n// Helpers\n// ---------------------------------------------------------------------------\n\n/** Case-insensitive check for a character hotkey. */\nexport function isHotkey(input: string, hotkey: { key: string }): boolean {\n return input.toLowerCase() === hotkey.key.toLowerCase();\n}\n\n/**\n * Whether `HOTKEY_INFO` does anything on `step` — the single answer both the\n * key handler in `wizard.tsx` and the footer hint in `wizard-layout.tsx` read,\n * so the wizard never advertises a key it ignores.\n *\n * The confirm step is excluded because it already renders the panel the\n * overlay would show, and the overlay REPLACES the step rather than sitting\n * over it: opening it there would unmount the confirm step's `Enter` handler\n * and strand the user on a screen nothing can complete.\n */\nexport function isInfoPanelAvailable(step: WizardStep): boolean {\n return FEATURE_FLAGS.INFO_PANEL && step !== \"confirm\";\n}\n"],"mappings":";;;;;;AAeO,IAAM,cAAc,EAAE,KAAK,KAAK,OAAO,IAAI;AAC3C,IAAM,yBAAyB,EAAE,KAAK,KAAK,OAAO,IAAI;AAGtD,IAAM,eAAe,EAAE,KAAK,KAAK,OAAO,IAAI;AAC5C,IAAM,kBAAkB,EAAE,KAAK,KAAK,OAAO,IAAI;AAM/C,IAAM,uBAAuB,EAAE,KAAK,KAAK,OAAO,IAAI;AACpD,IAAM,6BAA6B,EAAE,KAAK,KAAK,OAAO,IAAI;AAM1D,IAAM,uBAAuB,EAAE,KAAK,KAAK,OAAO,IAAI;AACpD,IAAM,wBAAwB,EAAE,KAAK,KAAK,OAAO,IAAI;AAMrD,IAAM,oBAAoB,EAAE,KAAK,KAAK,OAAO,IAAI;AAOjD,IAAM,YAAY;AAElB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AACtB,IAAM,kBAAkB;AACxB,IAAM,gBAAgB;AACtB,IAAM,wBAAwB;AAO9B,SAAS,SAAS,OAAe,QAAkC;AACxE,SAAO,MAAM,YAAY,MAAM,OAAO,IAAI,YAAY;AACxD;AAYO,SAAS,qBAAqB,MAA2B;AAC9D,SAAO,cAAc,cAAc,SAAS;AAC9C;","names":[]}
|
|
@@ -2,21 +2,17 @@
|
|
|
2
2
|
import {
|
|
3
3
|
computeScopeDiff,
|
|
4
4
|
useWizardStore
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5UWKOOIS.js";
|
|
6
6
|
import {
|
|
7
7
|
getSkillDisplayName
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-WKTHWQKM.js";
|
|
9
9
|
import {
|
|
10
10
|
CLI_COLORS,
|
|
11
11
|
EJECT_SOURCE,
|
|
12
12
|
UI_SYMBOLS
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import {
|
|
15
|
-
init_esm_shims
|
|
16
|
-
} from "./chunk-P56WJ5FA.js";
|
|
13
|
+
} from "./chunk-76ADG7LQ.js";
|
|
17
14
|
|
|
18
15
|
// src/cli/components/wizard/skill-agent-summary.tsx
|
|
19
|
-
init_esm_shims();
|
|
20
16
|
import { Box, Text } from "ink";
|
|
21
17
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
22
18
|
var TableHeader = ({ children }) => /* @__PURE__ */ jsx(Text, { bold: true, color: CLI_COLORS.WARNING, children });
|
|
@@ -109,4 +105,4 @@ var SkillAgentSummary = ({
|
|
|
109
105
|
export {
|
|
110
106
|
SkillAgentSummary
|
|
111
107
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
108
|
+
//# sourceMappingURL=chunk-LZ52XEPR.js.map
|