@katlux/toolkit 0.1.1-alpha.144 → 0.1.1-alpha.146
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/bin/ai-init.mjs +517 -0
- package/bin/ai-tokens.mjs +1043 -0
- package/bin/cli.mjs +80 -43
- package/bin/create-preset.mjs +1 -0
- package/bin/preset-contracts.json +2941 -0
- package/dist/compiled/composables/locales.mjs +204 -25
- package/dist/compiled/composables/useDataProvider.mjs +36 -25
- package/dist/compiled/composables/useFilterLogic.mjs +10 -2
- package/dist/compiled/composables/useKatluxForm.mjs +6 -4
- package/dist/compiled/composables/useVirtualDataset.mjs +689 -0
- package/dist/compiled/composables/useVirtualScroll.mjs +29 -9
- package/dist/module.cjs +63 -77
- package/dist/module.d.cts +5 -0
- package/dist/module.d.mts +4 -1
- package/dist/module.json +1 -1
- package/dist/module.mjs +60 -78
- package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +2 -2
- package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +2 -2
- package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +1 -1
- package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +1 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +7 -3
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +4 -1
- package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +7 -3
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +4 -2
- package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +70 -37
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +2 -2
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +2 -2
- package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
- package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +19 -10
- package/dist/runtime/components/KCalendar/KCalendar.global.vue +7 -2
- package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +19 -10
- package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +14 -201
- package/dist/runtime/components/KCalendar/KCalendar.logic.js +60 -11
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +11 -1
- package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +25 -5
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +19 -3
- package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +115 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +9 -9
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +9 -9
- package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +7 -1
- package/dist/runtime/components/KCombobox/KCombobox.logic.js +1 -1
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +14 -14
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +14 -14
- package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +5 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +22 -18
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +23 -16
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +22 -18
- package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +13 -10
- package/dist/runtime/components/KDatatable/KDataIterator.logic.js +25 -20
- package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +9 -13
- package/dist/runtime/components/KDatatable/KDatatable.global.vue +6 -5
- package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +9 -13
- package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -6
- package/dist/runtime/components/KDatatable/KDatatable.logic.js +26 -19
- package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +31 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +38 -13
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +31 -15
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +28 -6
- package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +197 -53
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +3 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +3 -3
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +2 -0
- package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +1 -1
- package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +55 -6
- package/dist/runtime/components/KGantt/KGantt.global.vue +12 -3
- package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +55 -6
- package/dist/runtime/components/KGantt/KGantt.logic.d.ts +33 -5
- package/dist/runtime/components/KGantt/KGantt.logic.js +39 -6
- package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
- package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +1 -1
- package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +1 -1
- package/dist/runtime/components/KLoader/KLoader.global.vue +2 -0
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +2 -2
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +2 -2
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.d.vue.ts +23 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +22 -0
- package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue.d.ts +23 -0
- package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +4 -2
- package/dist/runtime/components/KPagination/KPagination.global.vue +2 -1
- package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +4 -2
- package/dist/runtime/components/KPagination/KPagination.logic.d.ts +1 -0
- package/dist/runtime/components/KPagination/KPagination.logic.js +57 -5
- package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +1 -1
- package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTabs/KTabs.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTabs/KTabs.global.vue.d.ts +2 -2
- package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +3 -3
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +3 -3
- package/dist/runtime/components/KToast/KToast.global.d.vue.ts +3 -3
- package/dist/runtime/components/KToast/KToast.global.vue.d.ts +3 -3
- package/dist/runtime/components/KTooltip/KTooltip.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTooltip/KTooltip.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTree/KTree.global.d.vue.ts +7 -7
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +7 -7
- package/dist/runtime/components/KTree/KTree.logic.d.ts +2 -2
- package/dist/runtime/components/KTree/KTree.logic.js +16 -12
- package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +7 -9
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +1 -5
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +7 -9
- package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +39 -5
- package/dist/runtime/components/KTreeView/KTreeView.global.vue +19 -1
- package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +39 -5
- package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +23 -3
- package/dist/runtime/components/KTreeView/KTreeView.logic.js +76 -6
- package/dist/runtime/composables/locales.js +204 -25
- package/dist/runtime/composables/useDataProvider.d.ts +5 -3
- package/dist/runtime/composables/useDataProvider.js +36 -25
- package/dist/runtime/composables/useFilterLogic.d.ts +16 -4
- package/dist/runtime/composables/useFilterLogic.js +10 -2
- package/dist/runtime/composables/useKatluxForm.d.ts +4 -4
- package/dist/runtime/composables/useKatluxForm.js +6 -4
- package/dist/runtime/composables/useSortLogic.d.ts +1 -1
- package/dist/runtime/composables/useVirtualDataset.d.ts +121 -0
- package/dist/runtime/composables/useVirtualDataset.js +689 -0
- package/dist/runtime/composables/useVirtualScroll.d.ts +8 -4
- package/dist/runtime/composables/useVirtualScroll.js +29 -9
- package/dist/runtime/plugins/nuxtCompatPlugin.js +9 -1
- package/dist/runtime/presets/default/assets/scss/css-variables.css +3 -0
- package/dist/runtime/presets/default/assets/scss/css-variables.scss +6 -1
- package/dist/runtime/presets/default/assets/scss/index.css +3 -0
- package/dist/runtime/presets/default/assets/svg/katlux-logo.svg +7 -0
- package/dist/runtime/presets/default/assets/svg/katlux.svg +6 -0
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +3 -2
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +31 -3
- package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +3 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +6 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +3 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +5 -0
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +33 -2
- package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +5 -0
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +7 -1
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +30 -8
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +80 -164
- package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +30 -8
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +16 -9
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +99 -394
- package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +16 -9
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +6 -0
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +71 -4
- package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +6 -0
- package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +11 -12
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue +77 -14
- package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +11 -12
- package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +1 -0
- package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +2 -2
- package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +2 -2
- package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +4 -4
- package/dist/runtime/presets/default/components/KTree/KTree.vue +48 -14
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +4 -4
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +11 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +14 -2
- package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +11 -2
- package/dist/skills/KATLUX_INDEX.md +9 -6
- package/dist/skills/katlux-components/SKILL.md +2 -0
- package/dist/skills/katlux-components/components/KBulkActions.md +25 -1
- package/dist/skills/katlux-components/components/KCombobox.md +2 -2
- package/dist/skills/katlux-components/components/KDataIterator.md +12 -4
- package/dist/skills/katlux-components/components/KDatatable.md +38 -0
- package/dist/skills/katlux-components/components/KDatePicker.md +3 -1
- package/dist/skills/katlux-components/components/KGantt.md +9 -0
- package/dist/skills/katlux-components/components/KIcon.md +1 -1
- package/dist/skills/katlux-components/components/KLineChart.md +3 -0
- package/dist/skills/katlux-components/components/KProductList.md +0 -1
- package/dist/skills/katlux-components/components/KScatterChart.md +3 -0
- package/dist/skills/katlux-components/components/KTreePicker.md +2 -1
- package/dist/skills/katlux-components/components/KTreeView.md +12 -0
- package/dist/skills/katlux-config/SKILL.md +19 -8
- package/dist/skills/katlux-presets/SKILL.md +121 -1
- package/dist/skills/katlux-presets/creating-a-preset.md +67 -0
- package/dist/skills/katlux-providers/SKILL.md +7 -5
- package/dist/skills/katlux-providers/providers/ADataProvider.md +16 -9
- package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +27 -3
- package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +11 -1
- package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +19 -4
- package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +4 -2
- package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +2 -2
- package/dist/skills/katlux-providers/providers/RequestProvider.md +10 -0
- package/dist/skills/katlux-providers/providers/encryption-field-level.md +63 -19
- package/dist/skills/katlux-providers/providers/encryption-key-management.md +20 -2
- package/dist/skills/katlux-providers/providers/encryption-key-pinning.md +25 -11
- package/dist/skills/katlux-providers/providers/encryption-searchable.md +218 -0
- package/dist/skills/katlux-providers/providers/encryption-symmetric.md +25 -1
- package/dist/skills/katlux-providers/providers/encryption-threat-model.md +63 -0
- package/dist/skills/katlux-providers/providers/encryption.md +26 -1
- package/dist/skills/katlux-providers/providers/types.md +3 -1
- package/dist/skills/katlux-providers/providers/useDataProvider.md +2 -1
- package/dist/skills/katlux-providers/providers/useVirtualDataset.md +154 -0
- package/dist/skills/katlux-tokens/SKILL.md +2 -1
- package/dist/types.d.mts +1 -1
- package/package.json +9 -3
- package/bin/add-ai-reference.mjs +0 -259
package/bin/cli.mjs
CHANGED
|
@@ -4,16 +4,16 @@
|
|
|
4
4
|
*
|
|
5
5
|
* Supported commands:
|
|
6
6
|
* npx @katlux/toolkit create-preset <preset-name> [--base=<base>]
|
|
7
|
-
* npx @katlux/toolkit katlux-
|
|
8
|
-
*
|
|
9
|
-
* katlux
|
|
10
|
-
* and scaffolds AGENTS.md + .agents/rules/rules.md if they don't exist.
|
|
7
|
+
* npx @katlux/toolkit katlux-ai-init [options]
|
|
8
|
+
* npx @katlux/toolkit tokens [--report]
|
|
9
|
+
* npx @katlux/toolkit mcp [args...]
|
|
11
10
|
*/
|
|
12
11
|
|
|
13
12
|
import { spawn } from 'child_process'
|
|
14
13
|
import { existsSync } from 'fs'
|
|
15
14
|
import { resolve, dirname } from 'path'
|
|
16
15
|
import { fileURLToPath } from 'url'
|
|
16
|
+
import { resolvePackageVersions } from './ai-init.mjs'
|
|
17
17
|
|
|
18
18
|
const __dirname = dirname(fileURLToPath(import.meta.url))
|
|
19
19
|
|
|
@@ -21,11 +21,10 @@ const RESET = '\x1b[0m'
|
|
|
21
21
|
const CYAN = '\x1b[36m'
|
|
22
22
|
const BOLD = '\x1b[1m'
|
|
23
23
|
const RED = '\x1b[31m'
|
|
24
|
+
const YELLOW = '\x1b[33m'
|
|
25
|
+
const DIM = '\x1b[2m'
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
const command = args[0]
|
|
27
|
-
|
|
28
|
-
function printHelp() {
|
|
27
|
+
export function printHelp() {
|
|
29
28
|
console.log(`
|
|
30
29
|
${BOLD}Katlux Toolkit CLI${RESET}
|
|
31
30
|
|
|
@@ -37,55 +36,93 @@ ${BOLD}Commands:${RESET}
|
|
|
37
36
|
Scaffold a new custom preset (e.g. "cyber-brand --base=modern").
|
|
38
37
|
Any preset can be token-only. Base presets leverage cascading inheritance without copying files.
|
|
39
38
|
|
|
40
|
-
${CYAN}katlux-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
${CYAN}katlux-ai-init [options]${RESET}
|
|
40
|
+
Initialize Katlux AI skills, context (AGENTS.md), and configure MCP server.
|
|
41
|
+
Flags: --cursor, --vscode, --all, --scripts, --dry-run, --force.
|
|
42
|
+
|
|
43
|
+
${CYAN}tokens [--report] [-w <week>] [-p <page>]${RESET}
|
|
44
|
+
Analyze AI conversation token usage, week-by-week trends, and session logs.
|
|
43
45
|
|
|
44
46
|
${CYAN}mcp${RESET}
|
|
45
47
|
Start the Katlux Model Context Protocol (MCP) server over stdio for AI coding assistants.
|
|
48
|
+
Pins @katlux/mcp version to match installed @katlux/toolkit.
|
|
46
49
|
|
|
47
50
|
${BOLD}Examples:${RESET}
|
|
51
|
+
npx @katlux/toolkit katlux-ai-init --all
|
|
52
|
+
npx @katlux/toolkit katlux-ai-init --cursor
|
|
53
|
+
npx @katlux/toolkit tokens --report
|
|
48
54
|
npx @katlux/toolkit create-preset cyber-brand --base=modern
|
|
49
|
-
npx @katlux/toolkit create-preset my-theme
|
|
50
|
-
npx @katlux/toolkit katlux-add-ref
|
|
51
55
|
npx @katlux/toolkit mcp
|
|
52
56
|
`)
|
|
53
57
|
}
|
|
54
58
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Resolves the pinned MCP command and arguments for spawning npx.
|
|
61
|
+
*/
|
|
62
|
+
export function resolveMcpCommand(projectRoot = process.cwd(), extraArgs = []) {
|
|
63
|
+
const { mcpVersion } = resolvePackageVersions(projectRoot)
|
|
64
|
+
const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx'
|
|
65
|
+
return {
|
|
66
|
+
command: npxCmd,
|
|
67
|
+
args: ['-y', `@katlux/mcp@${mcpVersion}`, ...extraArgs],
|
|
68
|
+
mcpVersion
|
|
69
|
+
}
|
|
58
70
|
}
|
|
59
71
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
72
|
+
/**
|
|
73
|
+
* Main dispatcher logic
|
|
74
|
+
*/
|
|
75
|
+
export function runCli(argv = process.argv.slice(2)) {
|
|
76
|
+
const command = argv[0]
|
|
77
|
+
|
|
78
|
+
if (!command || command === '--help' || command === '-h' || command === 'help') {
|
|
79
|
+
printHelp()
|
|
80
|
+
return { status: 'help' }
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
let scriptPath = null
|
|
84
|
+
let forwardedArgs = []
|
|
85
|
+
|
|
86
|
+
if (command === 'create-preset') {
|
|
87
|
+
scriptPath = resolve(__dirname, 'create-preset.mjs')
|
|
88
|
+
forwardedArgs = argv.slice(1)
|
|
89
|
+
} else if (command === 'katlux-ai-init' || command === 'ai-init') {
|
|
90
|
+
scriptPath = resolve(__dirname, 'ai-init.mjs')
|
|
91
|
+
forwardedArgs = argv.slice(1)
|
|
92
|
+
} else if (command === 'tokens' || command === 'ai-tokens') {
|
|
93
|
+
scriptPath = resolve(__dirname, 'ai-tokens.mjs')
|
|
94
|
+
forwardedArgs = argv.slice(1)
|
|
95
|
+
} else if (command === 'mcp') {
|
|
96
|
+
const { command: npxCmd, args: mcpArgs, mcpVersion } = resolveMcpCommand(process.cwd(), argv.slice(1))
|
|
97
|
+
const child = spawn(npxCmd, mcpArgs, { stdio: 'inherit' })
|
|
77
98
|
child.on('exit', (code) => process.exit(code ?? 0))
|
|
99
|
+
return { status: 'spawned', child, command: npxCmd, args: mcpArgs, mcpVersion }
|
|
100
|
+
} else {
|
|
101
|
+
console.log(`${RED}${BOLD}[katlux] ✖${RESET} Unknown command: "${command}"`)
|
|
102
|
+
printHelp()
|
|
103
|
+
process.exit(1)
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
if (scriptPath) {
|
|
107
|
+
const child = spawn(process.execPath, [scriptPath, ...forwardedArgs], {
|
|
108
|
+
stdio: 'inherit',
|
|
109
|
+
})
|
|
110
|
+
|
|
111
|
+
child.on('exit', (code) => {
|
|
112
|
+
process.exit(code ?? 0)
|
|
113
|
+
})
|
|
114
|
+
return { status: 'spawned', child, scriptPath, args: forwardedArgs }
|
|
78
115
|
}
|
|
79
|
-
} else {
|
|
80
|
-
console.log(`${RED}${BOLD}[katlux] ✖${RESET} Unknown command: "${command}"`)
|
|
81
|
-
printHelp()
|
|
82
|
-
process.exit(1)
|
|
83
116
|
}
|
|
84
117
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
118
|
+
// Execute directly if run as CLI script
|
|
119
|
+
const isMain = process.argv[1] && (
|
|
120
|
+
process.argv[1].endsWith('cli.mjs') ||
|
|
121
|
+
process.argv[1].endsWith('katlux') ||
|
|
122
|
+
process.argv[1].endsWith('katlux-toolkit') ||
|
|
123
|
+
process.argv[1].endsWith('toolkit')
|
|
124
|
+
)
|
|
88
125
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}
|
|
126
|
+
if (isMain) {
|
|
127
|
+
runCli()
|
|
128
|
+
}
|
package/bin/create-preset.mjs
CHANGED