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
package/dist/chunk-7QIHKQL5.js
DELETED
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
source_default
|
|
4
|
-
} from "./chunk-SYUOXSPU.js";
|
|
5
|
-
import {
|
|
6
|
-
clearTerminalScreen,
|
|
7
|
-
formatTerminalTooSmallMessage,
|
|
8
|
-
isTerminalLargeEnough
|
|
9
|
-
} from "./chunk-P3PN5SVI.js";
|
|
10
|
-
import {
|
|
11
|
-
claudePluginMarketplaceAdd,
|
|
12
|
-
claudePluginMarketplaceExists,
|
|
13
|
-
claudePluginMarketplaceUpdate,
|
|
14
|
-
fetchMarketplace
|
|
15
|
-
} from "./chunk-TVHRMRD3.js";
|
|
16
|
-
import {
|
|
17
|
-
directoryExists,
|
|
18
|
-
getErrorMessage,
|
|
19
|
-
warn
|
|
20
|
-
} from "./chunk-3LIU2ZEF.js";
|
|
21
|
-
import {
|
|
22
|
-
CLI_COLORS,
|
|
23
|
-
MIN_TERMINAL_SIZE
|
|
24
|
-
} from "./chunk-O5ASLZ2K.js";
|
|
25
|
-
import {
|
|
26
|
-
init_esm_shims
|
|
27
|
-
} from "./chunk-P56WJ5FA.js";
|
|
28
|
-
|
|
29
|
-
// src/cli/lib/exit-codes.ts
|
|
30
|
-
init_esm_shims();
|
|
31
|
-
var EXIT_CODES = {
|
|
32
|
-
SUCCESS: 0,
|
|
33
|
-
ERROR: 1,
|
|
34
|
-
INVALID_ARGS: 2,
|
|
35
|
-
NETWORK_ERROR: 3,
|
|
36
|
-
CANCELLED: 4
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
// src/cli/base-command.ts
|
|
40
|
-
init_esm_shims();
|
|
41
|
-
import { Command, Flags } from "@oclif/core";
|
|
42
|
-
|
|
43
|
-
// src/cli/lib/operations/source/require-marketplace.ts
|
|
44
|
-
init_esm_shims();
|
|
45
|
-
|
|
46
|
-
// src/cli/lib/operations/source/ensure-marketplace.ts
|
|
47
|
-
init_esm_shims();
|
|
48
|
-
async function ensureMarketplace(sourceResult) {
|
|
49
|
-
if (!sourceResult.marketplace) {
|
|
50
|
-
try {
|
|
51
|
-
const marketplaceResult = await fetchMarketplace(sourceResult.sourceConfig.source, {});
|
|
52
|
-
sourceResult.marketplace = marketplaceResult.marketplace.name;
|
|
53
|
-
} catch {
|
|
54
|
-
return { marketplace: null, registered: false };
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
const marketplace = sourceResult.marketplace;
|
|
58
|
-
const exists = await claudePluginMarketplaceExists(marketplace);
|
|
59
|
-
if (!exists) {
|
|
60
|
-
const marketplaceSource = sourceResult.sourceConfig.source.replace(/^github:/, "");
|
|
61
|
-
await claudePluginMarketplaceAdd(marketplaceSource);
|
|
62
|
-
return { marketplace, registered: true };
|
|
63
|
-
}
|
|
64
|
-
try {
|
|
65
|
-
await claudePluginMarketplaceUpdate(marketplace);
|
|
66
|
-
} catch {
|
|
67
|
-
warn("Could not update marketplace \u2014 continuing with cached version");
|
|
68
|
-
}
|
|
69
|
-
return { marketplace, registered: false };
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// src/cli/lib/operations/source/require-marketplace.ts
|
|
73
|
-
async function requireMarketplace(sourceResult, purpose) {
|
|
74
|
-
const mpResult = await ensureMarketplace(sourceResult);
|
|
75
|
-
if (!mpResult.marketplace) {
|
|
76
|
-
return {
|
|
77
|
-
ok: false,
|
|
78
|
-
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.`
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
return { ok: true, marketplace: mpResult.marketplace, registered: mpResult.registered };
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
// src/cli/lib/assert-dir-overwritable.ts
|
|
85
|
-
init_esm_shims();
|
|
86
|
-
async function assertDirOverwritable(dir) {
|
|
87
|
-
return await directoryExists(dir) ? { ok: false, exists: true } : { ok: true };
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
// src/cli/base-command.ts
|
|
91
|
-
var BaseCommand = class extends Command {
|
|
92
|
-
static baseFlags = {
|
|
93
|
-
source: Flags.string({
|
|
94
|
-
char: "s",
|
|
95
|
-
description: "Skills source path or URL",
|
|
96
|
-
required: false
|
|
97
|
-
})
|
|
98
|
-
};
|
|
99
|
-
async init() {
|
|
100
|
-
await super.init();
|
|
101
|
-
await this.ensureTerminalSize();
|
|
102
|
-
}
|
|
103
|
-
get sourceConfig() {
|
|
104
|
-
return this.config.sourceConfig;
|
|
105
|
-
}
|
|
106
|
-
/**
|
|
107
|
-
* Blocks the command from launching in a terminal below
|
|
108
|
-
* {@link MIN_TERMINAL_SIZE}. This runs once, before Ink mounts; the terminal
|
|
109
|
-
* shrinking mid-session is caught by the matching guard in `WizardLayout`.
|
|
110
|
-
*/
|
|
111
|
-
async ensureTerminalSize() {
|
|
112
|
-
const currentColumns = () => process.stdout.columns ?? MIN_TERMINAL_SIZE.COLS;
|
|
113
|
-
const isValid = () => isTerminalLargeEnough(currentColumns(), process.stdout.rows ?? MIN_TERMINAL_SIZE.ROWS);
|
|
114
|
-
if (isValid()) return;
|
|
115
|
-
this.clearTerminal();
|
|
116
|
-
this.log(source_default.hex(CLI_COLORS.WARNING)(formatTerminalTooSmallMessage(currentColumns())));
|
|
117
|
-
await new Promise((resolve) => {
|
|
118
|
-
const check = () => {
|
|
119
|
-
if (isValid()) {
|
|
120
|
-
clearInterval(interval);
|
|
121
|
-
process.stdout.off("resize", check);
|
|
122
|
-
resolve();
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
const interval = setInterval(check, 500);
|
|
126
|
-
process.stdout.on("resize", check);
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
handleError(error) {
|
|
130
|
-
const message = getErrorMessage(error);
|
|
131
|
-
this.error(message, { exit: EXIT_CODES.ERROR });
|
|
132
|
-
}
|
|
133
|
-
logSuccess(message) {
|
|
134
|
-
this.log(`\u2713 ${message}`);
|
|
135
|
-
}
|
|
136
|
-
logWarning(message) {
|
|
137
|
-
this.warn(message);
|
|
138
|
-
}
|
|
139
|
-
logInfo(message) {
|
|
140
|
-
this.log(message);
|
|
141
|
-
}
|
|
142
|
-
clearTerminal() {
|
|
143
|
-
clearTerminalScreen();
|
|
144
|
-
}
|
|
145
|
-
/**
|
|
146
|
-
* Resolves the marketplace required for a plugin operation, or hard-exits with
|
|
147
|
-
* an actionable error when it cannot be resolved. `onRegistered` is invoked
|
|
148
|
-
* (when provided) if the marketplace had to be registered — init uses it to log.
|
|
149
|
-
*/
|
|
150
|
-
async requireMarketplaceOrExit(sourceResult, purpose, onRegistered) {
|
|
151
|
-
const required = await requireMarketplace(sourceResult, purpose);
|
|
152
|
-
if (!required.ok) {
|
|
153
|
-
this.error(required.error, { exit: EXIT_CODES.ERROR });
|
|
154
|
-
}
|
|
155
|
-
if (required.registered) {
|
|
156
|
-
onRegistered?.(required.marketplace);
|
|
157
|
-
}
|
|
158
|
-
return required.marketplace;
|
|
159
|
-
}
|
|
160
|
-
/**
|
|
161
|
-
* Guards a fresh-write target directory. When `dir` already exists, hard-exits
|
|
162
|
-
* with `${messages.exists}\nUse --force to overwrite.` unless `force` is set —
|
|
163
|
-
* in which case it warns with `messages.overwriting` and proceeds. Callers own
|
|
164
|
-
* the wording because it differs per entity (skill / agent / directory).
|
|
165
|
-
*/
|
|
166
|
-
async ensureDirOverwritable(dir, force, messages) {
|
|
167
|
-
const result = await assertDirOverwritable(dir);
|
|
168
|
-
if (result.ok) return;
|
|
169
|
-
if (!force) {
|
|
170
|
-
this.error(`${messages.exists}
|
|
171
|
-
Use --force to overwrite.`, { exit: EXIT_CODES.ERROR });
|
|
172
|
-
}
|
|
173
|
-
this.warn(messages.overwriting);
|
|
174
|
-
}
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
export {
|
|
178
|
-
EXIT_CODES,
|
|
179
|
-
BaseCommand
|
|
180
|
-
};
|
|
181
|
-
//# sourceMappingURL=chunk-7QIHKQL5.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/exit-codes.ts","../src/cli/base-command.ts","../src/cli/lib/operations/source/require-marketplace.ts","../src/cli/lib/operations/source/ensure-marketplace.ts","../src/cli/lib/assert-dir-overwritable.ts"],"sourcesContent":["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 { 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 {\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 { 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;AAAO,IAAM,aAAa;AAAA,EACxB,SAAS;AAAA,EACT,OAAO;AAAA,EACP,cAAc;AAAA,EACd,eAAe;AAAA,EACf,WAAW;AACb;;;ACNA;AAAA,SAAS,SAAS,aAAa;;;ACA/B;;;ACAA;AAyBA,eAAsB,kBACp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K,MAAM,SAAS,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":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/common/prompt-confirm.tsx"],"sourcesContent":["import React from \"react\";\nimport { render } from \"ink\";\n\nexport type ConfirmHandlers = {\n onConfirm: () => void;\n onCancel: () => void;\n};\n\nexport type PromptValueOptions<T> = {\n /** Value resolved when the Ink app exits before any callback fires (Ctrl+C / render failure). */\n onExit: T;\n /** Call instance.clear() before unmount — repaints a clean terminal (used by the dashboard). */\n clearOnResolve?: boolean;\n};\n\n/**\n * Renders an Ink prompt and resolves with the value produced by its callbacks.\n * First-wins: the first resolve (a callback or the app-exit fallback) settles the\n * promise; later resolves are ignored. The element is unmounted at the resolution\n * site (optionally cleared first). Callers own exit policy (exit codes, logging).\n */\nexport async function promptValue<T>(\n build: (resolve: (value: T) => void) => React.ReactElement,\n options: PromptValueOptions<T>,\n): Promise<T> {\n return new Promise<T>((resolve) => {\n const instance = render(\n build((value) => {\n if (options.clearOnResolve) instance.clear();\n instance.unmount();\n resolve(value);\n }),\n );\n // App exit without a callback (e.g. Ctrl+C) or a render failure counts as the\n // fallback; resolve is first-wins, so a prior callback value is unaffected.\n instance.waitUntilExit().then(\n () => resolve(options.onExit),\n () => resolve(options.onExit),\n );\n });\n}\n\n/**\n * Renders a confirm UI and resolves with the user's choice. The element is\n * unmounted as soon as either handler fires; a clean exit or render failure\n * without a choice resolves as \"cancelled\". Callers own exit policy.\n */\nexport async function promptConfirm(\n build: (handlers: ConfirmHandlers) => React.ReactElement,\n): Promise<\"confirmed\" | \"cancelled\"> {\n return promptValue<\"confirmed\" | \"cancelled\">(\n (resolve) =>\n build({ onConfirm: () => resolve(\"confirmed\"), onCancel: () => resolve(\"cancelled\") }),\n { onExit: \"cancelled\" },\n );\n}\n"],"mappings":";;;;;;AAAA;AACA,SAAS,cAAc;AAoBvB,eAAsB,YACpB,OACA,SACY;AACZ,SAAO,IAAI,QAAW,CAAC,YAAY;AACjC,UAAM,WAAW;AAAA,MACf,MAAM,CAAC,UAAU;AACf,YAAI,QAAQ,eAAgB,UAAS,MAAM;AAC3C,iBAAS,QAAQ;AACjB,gBAAQ,KAAK;AAAA,MACf,CAAC;AAAA,IACH;AAGA,aAAS,cAAc,EAAE;AAAA,MACvB,MAAM,QAAQ,QAAQ,MAAM;AAAA,MAC5B,MAAM,QAAQ,QAAQ,MAAM;AAAA,IAC9B;AAAA,EACF,CAAC;AACH;AAOA,eAAsB,cACpB,OACoC;AACpC,SAAO;AAAA,IACL,CAAC,YACC,MAAM,EAAE,WAAW,MAAM,QAAQ,WAAW,GAAG,UAAU,MAAM,QAAQ,WAAW,EAAE,CAAC;AAAA,IACvF,EAAE,QAAQ,YAAY;AAAA,EACxB;AACF;","names":[]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/components/hooks/use-section-scroll.ts"],"sourcesContent":["import { useCallback, useEffect, useRef, useState } from \"react\";\nimport { type DOMElement, measureElement } from \"ink\";\nimport { SCROLL_VIEWPORT } from \"../../consts.js\";\n\nexport type UseSectionScrollOptions = {\n sectionCount: number;\n focusedIndex: number;\n availableHeight: number;\n /**\n * Minimum viewport rows before clipping engages (default {@link SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS}).\n * Views that must clip rather than bleed at very short heights (source-grid, which pairs the clip\n * with an overflow affordance) pass a lower value so the gate does not fall back to a bleeding\n * flex layout.\n */\n minViewportRows?: number;\n};\n\nexport type UseSectionScrollResult = {\n setSectionRef: (index: number, el: DOMElement | null) => void;\n /** Attach to the clipping viewport box so overflow counts exclude header/affordance chrome. */\n setViewportRef: (el: DOMElement | null) => void;\n /**\n * Attach to the scrolled content box so overflow counts measure the WHOLE rendered content —\n * section-group margins and labels included — not just the sum of per-section row heights.\n */\n setContentRef: (el: DOMElement | null) => void;\n scrollEnabled: boolean;\n scrollTopPx: number;\n /** Content lines scrolled off the top of the viewport (0 when not scrolling). */\n hiddenAbove: number;\n /** Content lines clipped below the viewport (0 when everything fits). */\n hiddenBelow: number;\n /** Scroll the viewport past the focus-following position to reveal clipped rows (e.g. trailing inert rows). */\n scrollBy: (deltaRows: number) => void;\n};\n\n/**\n * Shared pixel-offset scroll hook for views with variable-height sections.\n *\n * Manages section refs, height measurement, and scroll position to keep the\n * focused section visible within a constrained viewport. Extracted from the\n * identical scroll plumbing in category-grid.tsx and source-grid.tsx.\n *\n * On top of focus-following it exposes an overscroll channel (`scrollBy`) that\n * moves the viewport BEYOND the focused row so rows that can never take focus —\n * trailing inert Sources rows — can still be scrolled into view, plus the\n * `hidden{Above,Below}` counts. Overscroll resets whenever focus moves, so the\n * viewport snaps back to follow focus.\n *\n * The counts are OFFERED, not obligatory. `source-grid.tsx` feeds them to a\n * `ScrollAffordance` sibling; `category-grid.tsx` (the build grid) discards them\n * deliberately — on a grid that dense a half-cut card is self-evidently \"there\n * is more\", so a counted hint would be noise and would cost the viewport a row.\n * A consumer that ignores them is exercising that choice, not overlooking one.\n */\nexport function useSectionScroll({\n sectionCount,\n focusedIndex,\n availableHeight,\n minViewportRows = SCROLL_VIEWPORT.MIN_VIEWPORT_ROWS,\n}: UseSectionScrollOptions): UseSectionScrollResult {\n const sectionRefs = useRef<(DOMElement | null)[]>([]);\n const viewportRef = useRef<DOMElement | null>(null);\n const contentRef = useRef<DOMElement | null>(null);\n const [sectionHeights, setSectionHeights] = useState<number[]>([]);\n const [viewportHeight, setViewportHeight] = useState(0);\n const [contentBoxHeight, setContentBoxHeight] = useState(0);\n const [focusScrollPx, setFocusScrollPx] = useState(0);\n const [overscrollPx, setOverscrollPx] = useState(0);\n\n const setSectionRef = useCallback((index: number, el: DOMElement | null) => {\n sectionRefs.current[index] = el;\n }, []);\n\n const setViewportRef = useCallback((el: DOMElement | null) => {\n viewportRef.current = el;\n }, []);\n\n const setContentRef = useCallback((el: DOMElement | null) => {\n contentRef.current = el;\n }, []);\n\n // A new row set (section count change) invalidates the monotonic content-height reading.\n useEffect(() => {\n setContentBoxHeight(0);\n }, [sectionCount]);\n\n // Measure section, viewport and content heights on every render\n useEffect(() => {\n const heights = sectionRefs.current.map((el) => {\n if (el) {\n const { height } = measureElement(el);\n return height;\n }\n return 0;\n });\n setSectionHeights((prev) => {\n if (prev.length === heights.length && prev.every((h, i) => h === heights[i])) {\n return prev;\n }\n return heights;\n });\n if (viewportRef.current) {\n const { height } = measureElement(viewportRef.current);\n setViewportHeight((prev) => (prev !== height ? height : prev));\n }\n if (contentRef.current) {\n const { height } = measureElement(contentRef.current);\n // Yoga under-reports a wrapped/clipped subtree in some layout passes, so the tallest reading\n // is the trustworthy one — mirrors info-panel/step-confirm. Reset above on row-set change.\n setContentBoxHeight((prev) => (height > prev ? height : prev));\n }\n });\n\n const scrollEnabled = availableHeight > 0 && availableHeight >= minViewportRows;\n\n // The measured content box includes section-group margins and labels; the per-section sum omits\n // them, so it is only the fallback for consumers that do not attach a content ref (category-grid).\n const contentHeight =\n contentBoxHeight > 0 ? contentBoxHeight : sectionHeights.reduce((sum, h) => sum + h, 0);\n // The measured viewport box excludes the header and affordance rows (both\n // siblings of it), so it is the height the sections actually get. Before the\n // first measurement, fall back to availableHeight (which category-grid always\n // uses — it has no separate header outside the viewport).\n const effectiveViewport = viewportHeight > 0 ? viewportHeight : availableHeight;\n const maxScrollPx = scrollEnabled ? Math.max(0, contentHeight - effectiveViewport) : 0;\n\n // Mirror the latest values into refs so `scrollBy` can clamp against them while\n // staying a stable callback (no re-created handler per render).\n const maxScrollRef = useRef(0);\n maxScrollRef.current = maxScrollPx;\n const focusScrollRef = useRef(0);\n focusScrollRef.current = focusScrollPx;\n\n // Keep focused section visible\n useEffect(() => {\n if (!scrollEnabled || sectionHeights.length === 0) return;\n\n let topOfFocused = 0;\n for (let i = 0; i < focusedIndex; i++) {\n topOfFocused += sectionHeights[i] ?? 0;\n }\n const focusedHeight = sectionHeights[focusedIndex] ?? 0;\n const bottomOfFocused = topOfFocused + focusedHeight;\n\n setFocusScrollPx((prev) => {\n if (topOfFocused < prev) {\n return topOfFocused;\n }\n if (bottomOfFocused > prev + effectiveViewport) {\n return bottomOfFocused - effectiveViewport;\n }\n return prev;\n });\n }, [focusedIndex, sectionHeights, scrollEnabled, effectiveViewport]);\n\n // Overscroll is user travel beyond the focus-following position. It resets on\n // focus movement so the viewport tracks the focused row again.\n useEffect(() => {\n setOverscrollPx(0);\n }, [focusedIndex]);\n\n const scrollBy = useCallback((deltaRows: number) => {\n setOverscrollPx((prev) => {\n const maxOverscroll = Math.max(0, maxScrollRef.current - focusScrollRef.current);\n return Math.min(maxOverscroll, Math.max(0, prev + deltaRows));\n });\n }, []);\n\n const scrollTopPx = Math.min(maxScrollPx, focusScrollPx + overscrollPx);\n const hiddenAbove = scrollEnabled ? scrollTopPx : 0;\n const hiddenBelow = scrollEnabled ? Math.max(0, maxScrollPx - scrollTopPx) : 0;\n\n return {\n setSectionRef,\n setViewportRef,\n setContentRef,\n scrollEnabled,\n scrollTopPx,\n hiddenAbove,\n hiddenBelow,\n scrollBy,\n };\n}\n\n/**\n * Pure function for row-based scroll offset computation.\n *\n * For views with uniform 1-line rows (step-agents, checkbox-grid, step-settings),\n * computes the scroll offset (in rows) to keep `focusedRow` visible within\n * a viewport of `viewportHeight` rows.\n */\nexport function computeRowScrollTop(\n focusedRow: number,\n currentScrollTop: number,\n viewportHeight: number,\n): number {\n if (focusedRow < currentScrollTop) {\n return focusedRow;\n }\n if (focusedRow + 1 > currentScrollTop + viewportHeight) {\n return focusedRow + 1 - viewportHeight;\n }\n return currentScrollTop;\n}\n"],"mappings":";;;;;;;;;AAAA;AAAA,SAAS,aAAa,WAAW,QAAQ,gBAAgB;AACzD,SAA0B,sBAAsB;AAsDzC,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA,kBAAkB,gBAAgB;AACpC,GAAoD;AAClD,QAAM,cAAc,OAA8B,CAAC,CAAC;AACpD,QAAM,cAAc,OAA0B,IAAI;AAClD,QAAM,aAAa,OAA0B,IAAI;AACjD,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAmB,CAAC,CAAC;AACjE,QAAM,CAAC,gBAAgB,iBAAiB,IAAI,SAAS,CAAC;AACtD,QAAM,CAAC,kBAAkB,mBAAmB,IAAI,SAAS,CAAC;AAC1D,QAAM,CAAC,eAAe,gBAAgB,IAAI,SAAS,CAAC;AACpD,QAAM,CAAC,cAAc,eAAe,IAAI,SAAS,CAAC;AAElD,QAAM,gBAAgB,YAAY,CAAC,OAAe,OAA0B;AAC1E,gBAAY,QAAQ,KAAK,IAAI;AAAA,EAC/B,GAAG,CAAC,CAAC;AAEL,QAAM,iBAAiB,YAAY,CAAC,OAA0B;AAC5D,gBAAY,UAAU;AAAA,EACxB,GAAG,CAAC,CAAC;AAEL,QAAM,gBAAgB,YAAY,CAAC,OAA0B;AAC3D,eAAW,UAAU;AAAA,EACvB,GAAG,CAAC,CAAC;AAGL,YAAU,MAAM;AACd,wBAAoB,CAAC;AAAA,EACvB,GAAG,CAAC,YAAY,CAAC;AAGjB,YAAU,MAAM;AACd,UAAM,UAAU,YAAY,QAAQ,IAAI,CAAC,OAAO;AAC9C,UAAI,IAAI;AACN,cAAM,EAAE,OAAO,IAAI,eAAe,EAAE;AACpC,eAAO;AAAA,MACT;AACA,aAAO;AAAA,IACT,CA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AAG,CAAC,cAAc,gBAAgB,eAAe,iBAAiB,CAAC;AAInE,YAAU,MAAM;AACd,oBAAgB,CAAC;AAAA,EACnB,GAAG,CAAC,YAAY,CAAC;AAEjB,QAAM,WAAW,YAAY,CAAC,cAAsB;AAClD,oBAAgB,CAAC,SAAS;AACxB,YAAM,gBAAgB,KAAK,IAAI,GAAG,aAAa,UAAU,eAAe,OAAO;AAC/E,aAAO,KAAK,IAAI,eAAe,KAAK,IAAI,GAAG,OAAO,SAAS,CAAC;AAAA,IAC9D,CAAC;AAAA,EACH,GAAG,CAAC,CAAC;AAEL,QAAM,cAAc,KAAK,IAAI,aAAa,gBAAgB,YAAY;AACtE,QAAM,cAAc,gBAAgB,cAAc;AAClD,QAAM,cAAc,gBAAgB,KAAK,IAAI,GAAG,cAAc,WAAW,IAAI;AAE7E,SAAO;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACF;AACF;AASO,SAAS,oBACd,YACA,kBACA,gBACQ;AACR,MAAI,aAAa,kBAAkB;AACjC,WAAO;AAAA,EACT;AACA,MAAI,aAAa,IAAI,mBAAmB,gBAAgB;AACtD,WAAO,aAAa,IAAI;AAAA,EAC1B;AACA,SAAO;AACT;","names":[]}
|
package/dist/chunk-DIBCRIMR.js
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
init_esm_shims
|
|
4
|
-
} from "./chunk-P56WJ5FA.js";
|
|
5
|
-
|
|
6
|
-
// src/cli/lib/__tests__/helpers/wizard-simulation.ts
|
|
7
|
-
init_esm_shims();
|
|
8
|
-
function buildSkillConfig(id, overrides) {
|
|
9
|
-
return {
|
|
10
|
-
id,
|
|
11
|
-
scope: overrides?.scope ?? "project",
|
|
12
|
-
source: overrides?.source ?? "eject",
|
|
13
|
-
...overrides?.excluded !== void 0 && { excluded: overrides.excluded }
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
function buildSkillConfigs(skillIds, overrides) {
|
|
17
|
-
return skillIds.map((id) => buildSkillConfig(id, overrides));
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
// src/cli/lib/__tests__/factories/config-factories.ts
|
|
21
|
-
init_esm_shims();
|
|
22
|
-
function buildAgentConfigs(agentNames, overrides) {
|
|
23
|
-
return agentNames.map((name) => ({
|
|
24
|
-
name,
|
|
25
|
-
scope: overrides?.scope ?? "project",
|
|
26
|
-
...overrides?.excluded !== void 0 && { excluded: overrides.excluded },
|
|
27
|
-
...overrides?.model !== void 0 && { model: overrides.model },
|
|
28
|
-
...overrides?.effort !== void 0 && { effort: overrides.effort }
|
|
29
|
-
}));
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
export {
|
|
33
|
-
buildSkillConfigs,
|
|
34
|
-
buildAgentConfigs
|
|
35
|
-
};
|
|
36
|
-
//# sourceMappingURL=chunk-DIBCRIMR.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/cli/lib/__tests__/helpers/wizard-simulation.ts","../src/cli/lib/__tests__/factories/config-factories.ts"],"sourcesContent":["import type {\n Category,\n Domain,\n DomainSelections,\n MergedSkillsMatrix,\n SkillConfig,\n SkillId,\n} from \"../../../types\";\nimport { resolveSelectedSkillIds, type WizardResultV2 } from \"../../../components/wizard/wizard\";\nimport { useWizardStore } from \"../../../stores/wizard-store\";\nimport { validateSelection } from \"../../matrix\";\nimport { DEFAULT_PUBLIC_SOURCE_NAME } from \"../../../consts\";\n\n/** Build a single SkillConfig from an id with default scope and source */\nexport function buildSkillConfig(\n id: SkillId,\n overrides?: Partial<Omit<SkillConfig, \"id\">>,\n): SkillConfig {\n return {\n id,\n scope: overrides?.scope ?? \"project\",\n source: overrides?.source ?? \"eject\",\n ...(overrides?.excluded !== undefined && { excluded: overrides.excluded }),\n };\n}\n\n/** Build a SkillConfig array from skill IDs with default scope and source */\nexport function buildSkillConfigs(\n skillIds: SkillId[],\n overrides?: Partial<Omit<SkillConfig, \"id\">>,\n): SkillConfig[] {\n return skillIds.map((id) => buildSkillConfig(id, overrides));\n}\n\n/**\n * Simulates a user selecting specific skills via the wizard store.\n *\n * Sets up domainSelections as if the user toggled each skill in the build step,\n * using the matrix to look up the correct domain and category per skill.\n */\nexport function simulateSkillSelections(\n skillIds: SkillId[],\n matrix: MergedSkillsMatrix,\n selectedDomains: string[],\n): void {\n const domainSelections = skillIds.reduce<DomainSelections>((acc, skillId) => {\n const skill = matrix.skills[skillId];\n if (!skill) return acc;\n // Boundary cast: skill.category is a Category at runtime\n const category = skill.category as Category;\n const domain = matrix.categories[category]?.domain;\n if (!domain) return acc;\n const domainObj = acc[domain] ?? {};\n const subcatList = domainObj[category] ?? [];\n if (subcatList.includes(skillId)) return acc;\n return {\n ...acc,\n [domain]: { ...domainObj, [category]: [...subcatList, skillId] },\n };\n }, {});\n\n useWizardStore.setState({\n domainSelections,\n selectedDomains: selectedDomains as Domain[],\n approach: \"scratch\",\n step: \"confirm\",\n });\n}\n\n/**\n * Replicates `handleComplete` from wizard.tsx for the \"customize\" path.\n *\n * Given the wizard store state (after simulated user selections), this builds\n * the same WizardResultV2 that the real wizard produces, delegating skill-id\n * resolution to the wizard's own `resolveSelectedSkillIds` (stack defaults or\n * per-domain selections), then running validation. Requires the matrix\n * provider to be initialized (as the real wizard does).\n */\nexport function buildWizardResultFromStore(overrides?: Partial<WizardResultV2>): WizardResultV2 {\n const store = useWizardStore.getState();\n\n const allSkills = resolveSelectedSkillIds(store);\n\n const validation = validateSelection(allSkills);\n\n // Auto-scope skills to match agent scope when every agent is global — this mirrors\n // a home-dir install where both sides of the stack equation live at global scope.\n // Without alignment, the stack mutator correctly rejects the scope mismatch and\n // integration tests that simulate home installs end up with empty stacks.\n // Tests that verify cross-scope mismatch behavior must pass skills explicitly via\n // `skillConfigs` rather than relying on this synthesis path.\n const allAgentsGlobal =\n store.agentConfigs.length > 0 && store.agentConfigs.every((ac) => ac.scope === \"global\");\n const synthesizedSkills = allAgentsGlobal\n ? buildSkillConfigs(allSkills, { scope: \"global\", source: DEFAULT_PUBLIC_SOURCE_NAME })\n : buildSkillConfigs(allSkills);\n\n return {\n skills: store.skillConfigs.length > 0 ? store.skillConfigs : synthesizedSkills,\n selectedAgents: store.selectedAgents,\n agentConfigs: store.agentConfigs,\n selectedStackId: store.selectedStackId,\n domainSelections: store.domainSelections,\n selectedDomains: store.selectedDomains,\n unresolvableSkillIds: store.unresolvableSkillIds,\n cancelled: false,\n validation,\n ...overrides,\n };\n}\n\n/**\n * Extracts skill IDs from a stack assignment value, which may be:\n * - A bare string (e.g., \"web-framework-react\")\n * - An object with .id (e.g., { id: \"web-framework-react\", preloaded: true })\n * - An array of strings or objects\n */\nexport function extractSkillIdsFromAssignment(assignment: unknown): string[] {\n if (typeof assignment === \"string\") {\n return [assignment];\n }\n if (Array.isArray(assignment)) {\n return assignment.flatMap((item) => extractSkillIdsFromAssignment(item));\n }\n if (typeof assignment === \"object\" && assignment !== null && \"id\" in assignment) {\n return [String((assignment as { id: string }).id)];\n }\n return [];\n}\n","import type {\n AgentName,\n AgentScopeConfig,\n DomainSelections,\n MergedSkillsMatrix,\n ProjectConfig,\n SkillConfig,\n SkillId,\n} from \"../../../types\";\nimport type { WizardResultV2 } from \"../../../components/wizard/wizard\";\nimport type { SourceLoadResult } from \"../../loading/source-loader\";\nimport type { ResolvedConfig } from \"../../configuration/config\";\nimport type { GateReport } from \"../../config-gate/index.js\";\nimport type { TestProjectConfig } from \"../fixtures/create-test-source\";\nimport { initializeMatrix } from \"../../matrix/matrix-provider\";\nimport { NO_CHANGES } from \"../../config-gate/classify.js\";\nimport { NOTHING_RECOMPILED } from \"../../config-gate/recompile.js\";\nimport { buildSkillConfigs } from \"../helpers/wizard-simulation.js\";\n\nexport function buildSourceConfig(\n overrides?: Partial<ResolvedConfig> & Record<string, unknown>,\n): Record<string, unknown> {\n // Record return kept: source config is parse-boundary data callers vary with arbitrary fields.\n return {\n source: \"github:test-org/skills\",\n ...overrides,\n };\n}\n\n/**\n * The report a gated config write returns. Defaults to a write that changed the\n * global pair and reached nobody; pass `propagatedTo` for a fan-out, whose\n * projects are all reported as recompiled.\n */\nexport function buildGateReport(\n propagatedTo: string[] = [],\n overrides?: Partial<GateReport>,\n): GateReport {\n return {\n globalWritten: true,\n changes: NO_CHANGES,\n propagated: { updated: propagatedTo, skipped: [] },\n recompile: { ...NOTHING_RECOMPILED, recompiledCount: propagatedTo.length },\n ...overrides,\n };\n}\n\nexport function buildProjectConfig(overrides?: Partial<ProjectConfig>): ProjectConfig {\n return {\n name: \"test-project\",\n agents: [{ name: \"web-developer\", scope: \"project\" }],\n skills: buildSkillConfigs([\"web-framework-react\"]),\n ...overrides,\n };\n}\n\nexport function buildWizardResult(\n skills: SkillConfig[],\n overrides?: Partial<WizardResultV2>,\n): WizardResultV2 {\n const selectedAgents = overrides?.selectedAgents ?? [];\n // Keep agentConfigs in sync with selectedAgents by default — the production\n // pipeline (generateProjectConfigFromSkills) requires every selected agent\n // to have a matching AgentScopeConfig. Callers can override agentConfigs\n // explicitly to test mismatch behavior.\n const defaultAgentConfigs =\n selectedAgents.length > 0 ? buildAgentConfigs([...selectedAgents]) : [];\n return {\n skills,\n selectedAgents: [],\n agentConfigs: defaultAgentConfigs,\n selectedStackId: null,\n domainSelections: {} as DomainSelections,\n selectedDomains: [],\n unresolvableSkillIds: [],\n cancelled: false,\n validation: { valid: true, errors: [], warnings: [] },\n ...overrides,\n };\n}\n\nexport function buildAgentConfigs(\n agentNames: AgentName[],\n overrides?: Partial<Omit<AgentScopeConfig, \"name\">>,\n): AgentScopeConfig[] {\n return agentNames.map((name) => ({\n name,\n scope: overrides?.scope ?? \"project\",\n ...(overrides?.excluded !== undefined && { excluded: overrides.excluded }),\n ...(overrides?.model !== undefined && { model: overrides.model }),\n ...(overrides?.effort !== undefined && { effort: overrides.effort }),\n }));\n}\n\nexport function buildSourceResult(\n matrix: MergedSkillsMatrix,\n sourcePath: string,\n overrides?: Partial<SourceLoadResult>,\n): SourceLoadResult {\n const sourceConfig: ResolvedConfig = {\n source: sourcePath,\n sourceOrigin: \"flag\",\n };\n return {\n matrix,\n sourceConfig,\n sourcePath,\n isLocal: true,\n ...overrides,\n };\n}\n\n/**\n * Registers the matrix with the provider and returns a SourceLoadResult for it.\n * Composes initializeMatrix + buildSourceResult — the common per-test arrange\n * step for integration tests that both set the active matrix and pass a source\n * result into an install/copy operation.\n */\nexport function initMatrixAndSource(\n matrix: MergedSkillsMatrix,\n sourcePath: string,\n overrides?: Partial<SourceLoadResult>,\n): SourceLoadResult {\n initializeMatrix(matrix);\n return buildSourceResult(matrix, sourcePath, overrides);\n}\n\nexport function buildTestProjectConfig(\n agents: string[],\n skills: Array<string | { id: string }>,\n overrides?: Partial<TestProjectConfig>,\n): TestProjectConfig {\n const skillIds = skills.map((s) => (typeof s === \"string\" ? s : s.id));\n return {\n name: \"test-project\",\n description: \"Test project\",\n // Boundary cast: test callers pass loose string agent/skill identifiers\n // (some fictional). Emit the object-shaped config the loader schema requires —\n // buildAgentConfigs/buildSkillConfigs do no matrix lookups, so loose IDs are safe.\n agents: buildAgentConfigs(agents as AgentName[]),\n skills: buildSkillConfigs(skillIds as SkillId[]),\n ...overrides,\n };\n}\n"],"mappings":";;;;;;AAAA;AAcO,SAAS,iBACd,IACA,WACa;AACb,SAAO;AAAA,IACL;AAAA,IACA,OAAO,WAAW,SAAS;AAAA,IAC3B,QAAQ,WAAW,UAAU;AAAA,IAC7B,GAAI,WAAW,aAAa,UAAa,EAAE,UAAU,UAAU,SAAS;AAAA,EAC1E;AACF;AAGO,SAAS,kBACd,UACA,WACe;AACf,SAAO,SAAS,IAAI,CAAC,OAAO,iBAAiB,IAAI,SAAS,CAAC;AAC7D;;;AChCA;AAiFO,SAAS,kBACd,YACA,WACoB;AACpB,SAAO,WAAW,IAAI,CAAC,UAAU;AAAA,IAC/B;AAAA,IACA,OAAO,WAAW,SAAS;AAAA,IAC3B,GAAI,WAAW,aAAa,UAAa,EAAE,UAAU,UAAU,SAAS;AAAA,IACxE,GAAI,WAAW,UAAU,UAAa,EAAE,OAAO,UAAU,MAAM;AAAA,IAC/D,GAAI,WAAW,WAAW,UAAa,EAAE,QAAQ,UAAU,OAAO;AAAA,EACpE,EAAE;AACJ;","names":[]}
|
package/dist/chunk-EKWAUOQB.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
3
|
-
init_esm_shims
|
|
4
|
-
} from "./chunk-P56WJ5FA.js";
|
|
5
|
-
|
|
6
|
-
// ../../node_modules/ink-testing-library/build/index.js
|
|
7
|
-
init_esm_shims();
|
|
8
|
-
import { EventEmitter } from "events";
|
|
9
|
-
import { render as inkRender } from "ink";
|
|
10
|
-
var Stdout = class extends EventEmitter {
|
|
11
|
-
get columns() {
|
|
12
|
-
return 100;
|
|
13
|
-
}
|
|
14
|
-
frames = [];
|
|
15
|
-
_lastFrame;
|
|
16
|
-
write = (frame) => {
|
|
17
|
-
this.frames.push(frame);
|
|
18
|
-
this._lastFrame = frame;
|
|
19
|
-
};
|
|
20
|
-
lastFrame = () => this._lastFrame;
|
|
21
|
-
};
|
|
22
|
-
var Stderr = class extends EventEmitter {
|
|
23
|
-
frames = [];
|
|
24
|
-
_lastFrame;
|
|
25
|
-
write = (frame) => {
|
|
26
|
-
this.frames.push(frame);
|
|
27
|
-
this._lastFrame = frame;
|
|
28
|
-
};
|
|
29
|
-
lastFrame = () => this._lastFrame;
|
|
30
|
-
};
|
|
31
|
-
var Stdin = class extends EventEmitter {
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
33
|
-
isTTY = true;
|
|
34
|
-
data = null;
|
|
35
|
-
// eslint-disable-line @typescript-eslint/ban-types
|
|
36
|
-
constructor(options = {}) {
|
|
37
|
-
super();
|
|
38
|
-
this.isTTY = options.isTTY ?? true;
|
|
39
|
-
}
|
|
40
|
-
write = (data) => {
|
|
41
|
-
this.data = data;
|
|
42
|
-
this.emit("readable");
|
|
43
|
-
this.emit("data", data);
|
|
44
|
-
};
|
|
45
|
-
setEncoding() {
|
|
46
|
-
}
|
|
47
|
-
setRawMode() {
|
|
48
|
-
}
|
|
49
|
-
resume() {
|
|
50
|
-
}
|
|
51
|
-
pause() {
|
|
52
|
-
}
|
|
53
|
-
ref() {
|
|
54
|
-
}
|
|
55
|
-
unref() {
|
|
56
|
-
}
|
|
57
|
-
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
58
|
-
read = () => {
|
|
59
|
-
const { data } = this;
|
|
60
|
-
this.data = null;
|
|
61
|
-
return data;
|
|
62
|
-
};
|
|
63
|
-
};
|
|
64
|
-
var instances = [];
|
|
65
|
-
var render = (tree) => {
|
|
66
|
-
const stdout = new Stdout();
|
|
67
|
-
const stderr = new Stderr();
|
|
68
|
-
const stdin = new Stdin();
|
|
69
|
-
const instance = inkRender(tree, {
|
|
70
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
71
|
-
stdout,
|
|
72
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
73
|
-
stderr,
|
|
74
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
75
|
-
stdin,
|
|
76
|
-
debug: true,
|
|
77
|
-
exitOnCtrlC: false,
|
|
78
|
-
patchConsole: false
|
|
79
|
-
});
|
|
80
|
-
instances.push(instance);
|
|
81
|
-
return {
|
|
82
|
-
rerender: instance.rerender,
|
|
83
|
-
unmount: instance.unmount,
|
|
84
|
-
cleanup: instance.cleanup,
|
|
85
|
-
stdout,
|
|
86
|
-
stderr,
|
|
87
|
-
stdin,
|
|
88
|
-
frames: stdout.frames,
|
|
89
|
-
lastFrame: stdout.lastFrame
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
|
|
93
|
-
export {
|
|
94
|
-
render
|
|
95
|
-
};
|
|
96
|
-
//# sourceMappingURL=chunk-EK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