@katlux/toolkit 0.1.1-alpha.145 → 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 +212 -54
- package/bin/cli.mjs +76 -47
- 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.mjs +60 -78
- 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 +1 -1
- package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +3 -3
- package/dist/runtime/components/KCombobox/KCombobox.global.vue +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +3 -3
- 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 +2 -2
- package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +2 -2
- package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +5 -0
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +21 -17
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue +23 -16
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +21 -17
- 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 +30 -14
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +38 -13
- package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +30 -14
- 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 +2 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
- package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +2 -0
- 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 +1 -1
- package/dist/runtime/components/KHourPicker/KHourPicker.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 +1 -1
- package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +1 -1
- 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 +3 -1
- package/dist/runtime/components/KPagination/KPagination.global.vue +2 -1
- package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +3 -1
- 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/KTextarea/KTextarea.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +1 -1
- 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 +4 -4
- package/dist/runtime/components/KTree/KTree.global.vue.d.ts +4 -4
- 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 +5 -7
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +1 -5
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +5 -7
- 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/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/KTree/KTree.d.vue.ts +3 -3
- package/dist/runtime/presets/default/components/KTree/KTree.vue +48 -14
- package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +3 -3
- 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 +7 -3
- package/bin/add-ai-reference.mjs +0 -259
|
@@ -9,7 +9,15 @@ export function useVirtualScroll(options) {
|
|
|
9
9
|
return unref(options.items) || [];
|
|
10
10
|
};
|
|
11
11
|
const allItems = computed(() => resolveItems());
|
|
12
|
-
const
|
|
12
|
+
const resolveTotalCount = () => {
|
|
13
|
+
if (options.totalCount !== void 0) {
|
|
14
|
+
if (typeof options.totalCount === "function") return options.totalCount();
|
|
15
|
+
const val = unref(options.totalCount);
|
|
16
|
+
return typeof val === "number" && val >= 0 ? val : 0;
|
|
17
|
+
}
|
|
18
|
+
return allItems.value.length;
|
|
19
|
+
};
|
|
20
|
+
const totalCount = computed(() => resolveTotalCount());
|
|
13
21
|
const isVirtual = computed(() => {
|
|
14
22
|
if (options.virtualScroll === void 0) return false;
|
|
15
23
|
return unref(options.virtualScroll) === true;
|
|
@@ -24,11 +32,11 @@ export function useVirtualScroll(options) {
|
|
|
24
32
|
});
|
|
25
33
|
const defaultHeight = 40;
|
|
26
34
|
const getItemHeight = (item, index) => {
|
|
27
|
-
|
|
28
|
-
|
|
35
|
+
const raw = unref(options.itemHeight);
|
|
36
|
+
if (typeof raw === "function") {
|
|
37
|
+
return raw(item, index);
|
|
29
38
|
}
|
|
30
|
-
|
|
31
|
-
return typeof h === "number" && h > 0 ? h : defaultHeight;
|
|
39
|
+
return typeof raw === "number" && raw > 0 ? raw : defaultHeight;
|
|
32
40
|
};
|
|
33
41
|
const baseItemHeight = computed(() => {
|
|
34
42
|
const h = unref(options.itemHeight);
|
|
@@ -79,15 +87,17 @@ export function useVirtualScroll(options) {
|
|
|
79
87
|
}
|
|
80
88
|
});
|
|
81
89
|
}
|
|
82
|
-
const isDynamicHeight = computed(() => typeof options.itemHeight === "function");
|
|
90
|
+
const isDynamicHeight = computed(() => typeof unref(options.itemHeight) === "function");
|
|
83
91
|
const rowOffsets = computed(() => {
|
|
84
92
|
if (!isDynamicHeight.value || colCount.value > 1) return [];
|
|
93
|
+
const count = totalCount.value;
|
|
85
94
|
const items = allItems.value;
|
|
86
|
-
const offsets = new Array(
|
|
95
|
+
const offsets = new Array(count + 1);
|
|
87
96
|
offsets[0] = 0;
|
|
88
97
|
let current = 0;
|
|
89
|
-
for (let i = 0; i <
|
|
90
|
-
|
|
98
|
+
for (let i = 0; i < count; i++) {
|
|
99
|
+
const item = items[i] ?? (typeof options.getItem === "function" ? options.getItem(i) : void 0);
|
|
100
|
+
current += getItemHeight(item, i);
|
|
91
101
|
offsets[i + 1] = current;
|
|
92
102
|
}
|
|
93
103
|
return offsets;
|
|
@@ -154,6 +164,16 @@ export function useVirtualScroll(options) {
|
|
|
154
164
|
});
|
|
155
165
|
const visibleItems = computed(() => {
|
|
156
166
|
if (!isVirtual.value) return allItems.value;
|
|
167
|
+
if (typeof options.getItem === "function") {
|
|
168
|
+
const start = startIndex.value;
|
|
169
|
+
const end = endIndex.value;
|
|
170
|
+
const count = Math.max(0, end - start);
|
|
171
|
+
const res = new Array(count);
|
|
172
|
+
for (let i = 0; i < count; i++) {
|
|
173
|
+
res[i] = options.getItem(start + i);
|
|
174
|
+
}
|
|
175
|
+
return res;
|
|
176
|
+
}
|
|
157
177
|
return allItems.value.slice(startIndex.value, endIndex.value);
|
|
158
178
|
});
|
|
159
179
|
const topSpacerHeight = computed(() => {
|
package/dist/module.cjs
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
3
5
|
const kit = require('@nuxt/kit');
|
|
4
6
|
const node_fs = require('node:fs');
|
|
5
7
|
const node_path = require('node:path');
|
|
6
8
|
const node_module = require('node:module');
|
|
9
|
+
const node_crypto = require('node:crypto');
|
|
7
10
|
|
|
8
11
|
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null;
|
|
9
12
|
const module$1 = kit.defineNuxtModule({
|
|
@@ -12,7 +15,7 @@ const module$1 = kit.defineNuxtModule({
|
|
|
12
15
|
configKey: "katluxToolkit"
|
|
13
16
|
},
|
|
14
17
|
defaults: {
|
|
15
|
-
autoAiReference:
|
|
18
|
+
autoAiReference: false
|
|
16
19
|
},
|
|
17
20
|
async setup(options, nuxt) {
|
|
18
21
|
const { resolve } = kit.createResolver((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('module.cjs', document.baseURI).href)));
|
|
@@ -42,6 +45,11 @@ const module$1 = kit.defineNuxtModule({
|
|
|
42
45
|
extensions: ["vue"],
|
|
43
46
|
global: true
|
|
44
47
|
});
|
|
48
|
+
kit.addComponent({
|
|
49
|
+
name: "MultiTabs",
|
|
50
|
+
filePath: resolve("./runtime/components/KMultiTabs/MultiTabs.global.vue"),
|
|
51
|
+
global: true
|
|
52
|
+
});
|
|
45
53
|
kit.addImportsDir(resolve("./runtime/composables"));
|
|
46
54
|
const providerRuntimeExports = [
|
|
47
55
|
// Data Providers
|
|
@@ -67,6 +75,9 @@ const module$1 = kit.defineNuxtModule({
|
|
|
67
75
|
"CSearchIndex",
|
|
68
76
|
"CWebCryptoStreamCipher",
|
|
69
77
|
"CKeyPinningStore",
|
|
78
|
+
"CMemoryKeyPinningStore",
|
|
79
|
+
"CLocalStorageKeyPinningStore",
|
|
80
|
+
"CIndexedDBKeyPinningStore",
|
|
70
81
|
"isEncrypted",
|
|
71
82
|
"createEncryptionProvider",
|
|
72
83
|
"rewriteEncryptedFilters",
|
|
@@ -106,6 +117,10 @@ const module$1 = kit.defineNuxtModule({
|
|
|
106
117
|
from: providersImportPath
|
|
107
118
|
}))
|
|
108
119
|
);
|
|
120
|
+
nuxt.options.imports = nuxt.options.imports || {};
|
|
121
|
+
nuxt.options.imports.transform = nuxt.options.imports.transform || {};
|
|
122
|
+
nuxt.options.imports.transform.exclude = nuxt.options.imports.transform.exclude || [];
|
|
123
|
+
nuxt.options.imports.transform.exclude.push(/[\\/]packages[\\/]katlux-providers[\\/]/);
|
|
109
124
|
kit.addServerImports(
|
|
110
125
|
providerRuntimeExports.map((name) => ({
|
|
111
126
|
name,
|
|
@@ -237,7 +252,7 @@ export {}
|
|
|
237
252
|
getContents() {
|
|
238
253
|
return `
|
|
239
254
|
import { defineNuxtPlugin } from '#app'
|
|
240
|
-
import { registerPresetComponents } from '#
|
|
255
|
+
import { registerPresetComponents } from '#toolkit/composables/usePresetComponent'
|
|
241
256
|
|
|
242
257
|
export default defineNuxtPlugin(() => {
|
|
243
258
|
const userPresetLoaders = import.meta.glob([
|
|
@@ -273,7 +288,7 @@ export default defineNuxtPlugin(() => {
|
|
|
273
288
|
options2.references.push({ path: "./types/katlux-providers-global.d.ts" });
|
|
274
289
|
}
|
|
275
290
|
});
|
|
276
|
-
if (nuxt.options.dev && options.autoAiReference
|
|
291
|
+
if (nuxt.options.dev && options.autoAiReference === true) {
|
|
277
292
|
try {
|
|
278
293
|
const isMonorepo = node_fs.existsSync(resolve(nuxt.options.rootDir, "packages/katlux-toolkit")) || node_fs.existsSync(resolve(nuxt.options.rootDir, "../../packages/katlux-toolkit"));
|
|
279
294
|
if (!isMonorepo) {
|
|
@@ -285,6 +300,9 @@ export default defineNuxtPlugin(() => {
|
|
|
285
300
|
}
|
|
286
301
|
}
|
|
287
302
|
});
|
|
303
|
+
function hashContent(content) {
|
|
304
|
+
return node_crypto.createHash("sha256").update(content, "utf-8").digest("hex");
|
|
305
|
+
}
|
|
288
306
|
function syncAiReference(rootDir, resolve) {
|
|
289
307
|
const possibleSkillsDirs = [
|
|
290
308
|
resolve("./skills"),
|
|
@@ -309,8 +327,16 @@ function syncAiReference(rootDir, resolve) {
|
|
|
309
327
|
}
|
|
310
328
|
const agentsDir = resolve(rootDir, ".agents");
|
|
311
329
|
const skillsDir = resolve(agentsDir, "skills");
|
|
312
|
-
const
|
|
330
|
+
const manifestFile = resolve(skillsDir, ".katlux-manifest.json");
|
|
313
331
|
const versionFile = resolve(skillsDir, ".katlux-version");
|
|
332
|
+
let manifest = {};
|
|
333
|
+
if (node_fs.existsSync(manifestFile)) {
|
|
334
|
+
try {
|
|
335
|
+
manifest = JSON.parse(node_fs.readFileSync(manifestFile, "utf-8"));
|
|
336
|
+
} catch {
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
if (!manifest.hashes) manifest.hashes = {};
|
|
314
340
|
if (node_fs.existsSync(versionFile) && node_fs.existsSync(resolve(skillsDir, "KATLUX_INDEX.md"))) {
|
|
315
341
|
try {
|
|
316
342
|
const recordedVersion = node_fs.readFileSync(versionFile, "utf-8").trim();
|
|
@@ -321,91 +347,51 @@ function syncAiReference(rootDir, resolve) {
|
|
|
321
347
|
}
|
|
322
348
|
}
|
|
323
349
|
if (!node_fs.existsSync(skillsDir)) node_fs.mkdirSync(skillsDir, { recursive: true });
|
|
324
|
-
|
|
325
|
-
|
|
350
|
+
let copied = 0;
|
|
351
|
+
let skippedUserModified = 0;
|
|
352
|
+
function syncDirRecursive(src, dest, relBase = "") {
|
|
326
353
|
if (!node_fs.existsSync(dest)) node_fs.mkdirSync(dest, { recursive: true });
|
|
327
354
|
const entries = node_fs.readdirSync(src, { withFileTypes: true });
|
|
328
|
-
let count = 0;
|
|
329
355
|
for (const entry of entries) {
|
|
356
|
+
const relPath = relBase ? `${relBase}/${entry.name}` : entry.name;
|
|
357
|
+
if (!relBase && entry.name !== "KATLUX_INDEX.md" && !entry.name.startsWith("katlux-")) {
|
|
358
|
+
continue;
|
|
359
|
+
}
|
|
330
360
|
const srcPath = node_path.join(src, entry.name);
|
|
331
361
|
const destPath = node_path.join(dest, entry.name);
|
|
332
362
|
if (entry.isDirectory()) {
|
|
333
|
-
|
|
363
|
+
syncDirRecursive(srcPath, destPath, relPath);
|
|
334
364
|
} else if (entry.name.endsWith(".md")) {
|
|
335
|
-
|
|
336
|
-
|
|
365
|
+
const srcContent = node_fs.readFileSync(srcPath, "utf-8");
|
|
366
|
+
const newHash = hashContent(srcContent);
|
|
367
|
+
if (node_fs.existsSync(destPath)) {
|
|
368
|
+
const diskContent = node_fs.readFileSync(destPath, "utf-8");
|
|
369
|
+
const diskHash = hashContent(diskContent);
|
|
370
|
+
const prevHash = manifest.hashes?.[relPath];
|
|
371
|
+
if (prevHash && diskHash !== prevHash && diskHash !== newHash) {
|
|
372
|
+
skippedUserModified++;
|
|
373
|
+
continue;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
node_fs.writeFileSync(destPath, srcContent, "utf-8");
|
|
377
|
+
if (!manifest.hashes) manifest.hashes = {};
|
|
378
|
+
manifest.hashes[relPath] = newHash;
|
|
379
|
+
copied++;
|
|
337
380
|
}
|
|
338
381
|
}
|
|
339
|
-
return count;
|
|
340
382
|
}
|
|
341
|
-
|
|
383
|
+
syncDirRecursive(packagedSkillsDir, skillsDir);
|
|
384
|
+
manifest.version = packageVersion;
|
|
385
|
+
node_fs.writeFileSync(manifestFile, JSON.stringify(manifest, null, 2), "utf-8");
|
|
342
386
|
node_fs.writeFileSync(versionFile, packageVersion, "utf-8");
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
This file serves as the main entry point for AI agents to understand the workspace structure and guidelines.
|
|
348
|
-
|
|
349
|
-
- [Project Rules](.agents/rules/rules.md)
|
|
350
|
-
- [Katlux Skills Index](.agents/skills/KATLUX_INDEX.md)
|
|
351
|
-
`, "utf-8");
|
|
352
|
-
}
|
|
353
|
-
const rulesMdPath = resolve(rulesDir, "rules.md");
|
|
354
|
-
if (!node_fs.existsSync(rulesMdPath)) {
|
|
355
|
-
node_fs.writeFileSync(rulesMdPath, `# Agent Rules
|
|
356
|
-
|
|
357
|
-
## Project-Specific Rules
|
|
358
|
-
|
|
359
|
-
<!-- Add your own project rules here. -->
|
|
360
|
-
<!-- Example: always use the "users" Pinia store for auth state. -->
|
|
361
|
-
|
|
362
|
-
## Katlux Code Standards
|
|
363
|
-
|
|
364
|
-
1. **Zero-Import Standard**: All \`K*\` components (\`KDatatable\`, \`KModal\`, etc.), \`C*\` provider classes (\`CAPIFlatServerDataProvider\`, \`CFlatClientDataProvider\`, etc.), and \`E*\` enums (\`ECacheStrategy\`, \`EDataFilterOperator\`) are globally auto-imported by the Nuxt module. **DO NOT generate top-level import statements for Katlux components, providers, or enums in Vue SFC files.**
|
|
365
|
-
2. **Template**: Always use **Pug** (\`lang="pug"\`). Use **Tabs** for indentation.
|
|
366
|
-
3. **Styling**: Use CSS variables (e.g. \`var(--primary-500)\`, \`var(--border-radius-md)\`). Never hardcode colors or sizes.
|
|
367
|
-
4. **Preset Selectors**: Scope CSS rules under \`[data-preset~="preset-name"]\`. Avoid \`!important\`.
|
|
368
|
-
5. **Imports**: Use workspace aliases (e.g. \`#toolkit/composables/...\`). Avoid deep relative imports.
|
|
369
|
-
6. **i18n**: Use \`t('...')\` for all user-facing strings and ARIA labels.
|
|
370
|
-
`, "utf-8");
|
|
371
|
-
}
|
|
372
|
-
const KATLUX_MCP_SERVER = { command: "npx", args: ["-y", "@katlux/mcp"] };
|
|
373
|
-
function updateMcpConfig(filePath) {
|
|
374
|
-
let config = {};
|
|
375
|
-
if (node_fs.existsSync(filePath)) {
|
|
376
|
-
try {
|
|
377
|
-
config = JSON.parse(node_fs.readFileSync(filePath, "utf-8"));
|
|
378
|
-
} catch {
|
|
379
|
-
config = {};
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
if (!config.mcpServers) config.mcpServers = {};
|
|
383
|
-
config.mcpServers.katlux = KATLUX_MCP_SERVER;
|
|
384
|
-
node_fs.writeFileSync(filePath, JSON.stringify(config, null, 2), "utf-8");
|
|
385
|
-
}
|
|
386
|
-
updateMcpConfig(resolve(agentsDir, "mcp_config.json"));
|
|
387
|
-
const cursorDir = resolve(rootDir, ".cursor");
|
|
388
|
-
if (node_fs.existsSync(cursorDir)) {
|
|
389
|
-
updateMcpConfig(resolve(cursorDir, "mcp.json"));
|
|
390
|
-
}
|
|
391
|
-
const vscodeDir = resolve(rootDir, ".vscode");
|
|
392
|
-
if (node_fs.existsSync(vscodeDir)) {
|
|
393
|
-
updateMcpConfig(resolve(vscodeDir, "mcp.json"));
|
|
394
|
-
}
|
|
395
|
-
const pkgJsonPath = resolve(rootDir, "package.json");
|
|
396
|
-
if (node_fs.existsSync(pkgJsonPath)) {
|
|
397
|
-
try {
|
|
398
|
-
const pkg = JSON.parse(node_fs.readFileSync(pkgJsonPath, "utf-8"));
|
|
399
|
-
if (!pkg.scripts) pkg.scripts = {};
|
|
400
|
-
if (!pkg.scripts["ai:check"]) {
|
|
401
|
-
pkg.scripts["ai:check"] = "vue-tsc --noEmit --pretty false | grep -E 'error TS' | head -n 15";
|
|
402
|
-
node_fs.writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
|
|
403
|
-
}
|
|
404
|
-
} catch {
|
|
387
|
+
if (copied > 0) {
|
|
388
|
+
console.log(`[Katlux] Synced ${copied} AI skill files to .agents/skills/ (enabled via katluxToolkit: { autoAiReference: true })`);
|
|
389
|
+
if (skippedUserModified > 0) {
|
|
390
|
+
console.log(`[Katlux] Preserved ${skippedUserModified} locally modified skill files.`);
|
|
405
391
|
}
|
|
406
392
|
}
|
|
407
|
-
console.log(`[Katlux] Auto-synced ${copied} AI skills and MCP server configuration (v${packageVersion}) to .agents/`);
|
|
408
|
-
console.log(`[Katlux] \u{1F4A1} AI Token Tip: When AI pairing, use compact test reporters (e.g. Vitest --reporter=agent, Jest --reporters=summary) or git-changed flags (-o / --changed) to prevent log noise and save context tokens.`);
|
|
409
393
|
}
|
|
410
394
|
|
|
411
|
-
|
|
395
|
+
exports.default = module$1;
|
|
396
|
+
exports.hashContent = hashContent;
|
|
397
|
+
exports.syncAiReference = syncAiReference;
|
package/dist/module.d.cts
CHANGED
|
@@ -6,5 +6,10 @@ interface ModuleOptions {
|
|
|
6
6
|
}
|
|
7
7
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
8
8
|
|
|
9
|
+
declare function hashContent(content: string): string;
|
|
10
|
+
declare function syncAiReference(rootDir: string, resolve: (...paths: string[]) => string): void;
|
|
11
|
+
|
|
12
|
+
// @ts-ignore
|
|
9
13
|
export = _default;
|
|
14
|
+
export { hashContent, syncAiReference };
|
|
10
15
|
export type { ModuleOptions };
|
package/dist/module.d.mts
CHANGED
|
@@ -6,5 +6,8 @@ interface ModuleOptions {
|
|
|
6
6
|
}
|
|
7
7
|
declare const _default: _nuxt_schema.NuxtModule<ModuleOptions, ModuleOptions, false>;
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
declare function hashContent(content: string): string;
|
|
10
|
+
declare function syncAiReference(rootDir: string, resolve: (...paths: string[]) => string): void;
|
|
11
|
+
|
|
12
|
+
export { _default as default, hashContent, syncAiReference };
|
|
10
13
|
export type { ModuleOptions };
|
package/dist/module.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir, resolvePath, resolveModule, addImports, addServerImports, addTypeTemplate, addPlugin, addServerHandler, addPluginTemplate } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponentsDir, addComponent, addImportsDir, resolvePath, resolveModule, addImports, addServerImports, addTypeTemplate, addPlugin, addServerHandler, addPluginTemplate } from '@nuxt/kit';
|
|
2
2
|
import { existsSync, readFileSync, mkdirSync, writeFileSync, readdirSync } from 'node:fs';
|
|
3
3
|
import { join } from 'node:path';
|
|
4
4
|
import { createRequire } from 'node:module';
|
|
5
|
+
import { createHash } from 'node:crypto';
|
|
5
6
|
|
|
6
7
|
const module$1 = defineNuxtModule({
|
|
7
8
|
meta: {
|
|
@@ -9,7 +10,7 @@ const module$1 = defineNuxtModule({
|
|
|
9
10
|
configKey: "katluxToolkit"
|
|
10
11
|
},
|
|
11
12
|
defaults: {
|
|
12
|
-
autoAiReference:
|
|
13
|
+
autoAiReference: false
|
|
13
14
|
},
|
|
14
15
|
async setup(options, nuxt) {
|
|
15
16
|
const { resolve } = createResolver(import.meta.url);
|
|
@@ -39,6 +40,11 @@ const module$1 = defineNuxtModule({
|
|
|
39
40
|
extensions: ["vue"],
|
|
40
41
|
global: true
|
|
41
42
|
});
|
|
43
|
+
addComponent({
|
|
44
|
+
name: "MultiTabs",
|
|
45
|
+
filePath: resolve("./runtime/components/KMultiTabs/MultiTabs.global.vue"),
|
|
46
|
+
global: true
|
|
47
|
+
});
|
|
42
48
|
addImportsDir(resolve("./runtime/composables"));
|
|
43
49
|
const providerRuntimeExports = [
|
|
44
50
|
// Data Providers
|
|
@@ -64,6 +70,9 @@ const module$1 = defineNuxtModule({
|
|
|
64
70
|
"CSearchIndex",
|
|
65
71
|
"CWebCryptoStreamCipher",
|
|
66
72
|
"CKeyPinningStore",
|
|
73
|
+
"CMemoryKeyPinningStore",
|
|
74
|
+
"CLocalStorageKeyPinningStore",
|
|
75
|
+
"CIndexedDBKeyPinningStore",
|
|
67
76
|
"isEncrypted",
|
|
68
77
|
"createEncryptionProvider",
|
|
69
78
|
"rewriteEncryptedFilters",
|
|
@@ -103,6 +112,10 @@ const module$1 = defineNuxtModule({
|
|
|
103
112
|
from: providersImportPath
|
|
104
113
|
}))
|
|
105
114
|
);
|
|
115
|
+
nuxt.options.imports = nuxt.options.imports || {};
|
|
116
|
+
nuxt.options.imports.transform = nuxt.options.imports.transform || {};
|
|
117
|
+
nuxt.options.imports.transform.exclude = nuxt.options.imports.transform.exclude || [];
|
|
118
|
+
nuxt.options.imports.transform.exclude.push(/[\\/]packages[\\/]katlux-providers[\\/]/);
|
|
106
119
|
addServerImports(
|
|
107
120
|
providerRuntimeExports.map((name) => ({
|
|
108
121
|
name,
|
|
@@ -234,7 +247,7 @@ export {}
|
|
|
234
247
|
getContents() {
|
|
235
248
|
return `
|
|
236
249
|
import { defineNuxtPlugin } from '#app'
|
|
237
|
-
import { registerPresetComponents } from '#
|
|
250
|
+
import { registerPresetComponents } from '#toolkit/composables/usePresetComponent'
|
|
238
251
|
|
|
239
252
|
export default defineNuxtPlugin(() => {
|
|
240
253
|
const userPresetLoaders = import.meta.glob([
|
|
@@ -270,7 +283,7 @@ export default defineNuxtPlugin(() => {
|
|
|
270
283
|
options2.references.push({ path: "./types/katlux-providers-global.d.ts" });
|
|
271
284
|
}
|
|
272
285
|
});
|
|
273
|
-
if (nuxt.options.dev && options.autoAiReference
|
|
286
|
+
if (nuxt.options.dev && options.autoAiReference === true) {
|
|
274
287
|
try {
|
|
275
288
|
const isMonorepo = existsSync(resolve(nuxt.options.rootDir, "packages/katlux-toolkit")) || existsSync(resolve(nuxt.options.rootDir, "../../packages/katlux-toolkit"));
|
|
276
289
|
if (!isMonorepo) {
|
|
@@ -282,6 +295,9 @@ export default defineNuxtPlugin(() => {
|
|
|
282
295
|
}
|
|
283
296
|
}
|
|
284
297
|
});
|
|
298
|
+
function hashContent(content) {
|
|
299
|
+
return createHash("sha256").update(content, "utf-8").digest("hex");
|
|
300
|
+
}
|
|
285
301
|
function syncAiReference(rootDir, resolve) {
|
|
286
302
|
const possibleSkillsDirs = [
|
|
287
303
|
resolve("./skills"),
|
|
@@ -306,8 +322,16 @@ function syncAiReference(rootDir, resolve) {
|
|
|
306
322
|
}
|
|
307
323
|
const agentsDir = resolve(rootDir, ".agents");
|
|
308
324
|
const skillsDir = resolve(agentsDir, "skills");
|
|
309
|
-
const
|
|
325
|
+
const manifestFile = resolve(skillsDir, ".katlux-manifest.json");
|
|
310
326
|
const versionFile = resolve(skillsDir, ".katlux-version");
|
|
327
|
+
let manifest = {};
|
|
328
|
+
if (existsSync(manifestFile)) {
|
|
329
|
+
try {
|
|
330
|
+
manifest = JSON.parse(readFileSync(manifestFile, "utf-8"));
|
|
331
|
+
} catch {
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
if (!manifest.hashes) manifest.hashes = {};
|
|
311
335
|
if (existsSync(versionFile) && existsSync(resolve(skillsDir, "KATLUX_INDEX.md"))) {
|
|
312
336
|
try {
|
|
313
337
|
const recordedVersion = readFileSync(versionFile, "utf-8").trim();
|
|
@@ -318,91 +342,49 @@ function syncAiReference(rootDir, resolve) {
|
|
|
318
342
|
}
|
|
319
343
|
}
|
|
320
344
|
if (!existsSync(skillsDir)) mkdirSync(skillsDir, { recursive: true });
|
|
321
|
-
|
|
322
|
-
|
|
345
|
+
let copied = 0;
|
|
346
|
+
let skippedUserModified = 0;
|
|
347
|
+
function syncDirRecursive(src, dest, relBase = "") {
|
|
323
348
|
if (!existsSync(dest)) mkdirSync(dest, { recursive: true });
|
|
324
349
|
const entries = readdirSync(src, { withFileTypes: true });
|
|
325
|
-
let count = 0;
|
|
326
350
|
for (const entry of entries) {
|
|
351
|
+
const relPath = relBase ? `${relBase}/${entry.name}` : entry.name;
|
|
352
|
+
if (!relBase && entry.name !== "KATLUX_INDEX.md" && !entry.name.startsWith("katlux-")) {
|
|
353
|
+
continue;
|
|
354
|
+
}
|
|
327
355
|
const srcPath = join(src, entry.name);
|
|
328
356
|
const destPath = join(dest, entry.name);
|
|
329
357
|
if (entry.isDirectory()) {
|
|
330
|
-
|
|
358
|
+
syncDirRecursive(srcPath, destPath, relPath);
|
|
331
359
|
} else if (entry.name.endsWith(".md")) {
|
|
332
|
-
|
|
333
|
-
|
|
360
|
+
const srcContent = readFileSync(srcPath, "utf-8");
|
|
361
|
+
const newHash = hashContent(srcContent);
|
|
362
|
+
if (existsSync(destPath)) {
|
|
363
|
+
const diskContent = readFileSync(destPath, "utf-8");
|
|
364
|
+
const diskHash = hashContent(diskContent);
|
|
365
|
+
const prevHash = manifest.hashes?.[relPath];
|
|
366
|
+
if (prevHash && diskHash !== prevHash && diskHash !== newHash) {
|
|
367
|
+
skippedUserModified++;
|
|
368
|
+
continue;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
writeFileSync(destPath, srcContent, "utf-8");
|
|
372
|
+
if (!manifest.hashes) manifest.hashes = {};
|
|
373
|
+
manifest.hashes[relPath] = newHash;
|
|
374
|
+
copied++;
|
|
334
375
|
}
|
|
335
376
|
}
|
|
336
|
-
return count;
|
|
337
377
|
}
|
|
338
|
-
|
|
378
|
+
syncDirRecursive(packagedSkillsDir, skillsDir);
|
|
379
|
+
manifest.version = packageVersion;
|
|
380
|
+
writeFileSync(manifestFile, JSON.stringify(manifest, null, 2), "utf-8");
|
|
339
381
|
writeFileSync(versionFile, packageVersion, "utf-8");
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
This file serves as the main entry point for AI agents to understand the workspace structure and guidelines.
|
|
345
|
-
|
|
346
|
-
- [Project Rules](.agents/rules/rules.md)
|
|
347
|
-
- [Katlux Skills Index](.agents/skills/KATLUX_INDEX.md)
|
|
348
|
-
`, "utf-8");
|
|
349
|
-
}
|
|
350
|
-
const rulesMdPath = resolve(rulesDir, "rules.md");
|
|
351
|
-
if (!existsSync(rulesMdPath)) {
|
|
352
|
-
writeFileSync(rulesMdPath, `# Agent Rules
|
|
353
|
-
|
|
354
|
-
## Project-Specific Rules
|
|
355
|
-
|
|
356
|
-
<!-- Add your own project rules here. -->
|
|
357
|
-
<!-- Example: always use the "users" Pinia store for auth state. -->
|
|
358
|
-
|
|
359
|
-
## Katlux Code Standards
|
|
360
|
-
|
|
361
|
-
1. **Zero-Import Standard**: All \`K*\` components (\`KDatatable\`, \`KModal\`, etc.), \`C*\` provider classes (\`CAPIFlatServerDataProvider\`, \`CFlatClientDataProvider\`, etc.), and \`E*\` enums (\`ECacheStrategy\`, \`EDataFilterOperator\`) are globally auto-imported by the Nuxt module. **DO NOT generate top-level import statements for Katlux components, providers, or enums in Vue SFC files.**
|
|
362
|
-
2. **Template**: Always use **Pug** (\`lang="pug"\`). Use **Tabs** for indentation.
|
|
363
|
-
3. **Styling**: Use CSS variables (e.g. \`var(--primary-500)\`, \`var(--border-radius-md)\`). Never hardcode colors or sizes.
|
|
364
|
-
4. **Preset Selectors**: Scope CSS rules under \`[data-preset~="preset-name"]\`. Avoid \`!important\`.
|
|
365
|
-
5. **Imports**: Use workspace aliases (e.g. \`#toolkit/composables/...\`). Avoid deep relative imports.
|
|
366
|
-
6. **i18n**: Use \`t('...')\` for all user-facing strings and ARIA labels.
|
|
367
|
-
`, "utf-8");
|
|
368
|
-
}
|
|
369
|
-
const KATLUX_MCP_SERVER = { command: "npx", args: ["-y", "@katlux/mcp"] };
|
|
370
|
-
function updateMcpConfig(filePath) {
|
|
371
|
-
let config = {};
|
|
372
|
-
if (existsSync(filePath)) {
|
|
373
|
-
try {
|
|
374
|
-
config = JSON.parse(readFileSync(filePath, "utf-8"));
|
|
375
|
-
} catch {
|
|
376
|
-
config = {};
|
|
377
|
-
}
|
|
378
|
-
}
|
|
379
|
-
if (!config.mcpServers) config.mcpServers = {};
|
|
380
|
-
config.mcpServers.katlux = KATLUX_MCP_SERVER;
|
|
381
|
-
writeFileSync(filePath, JSON.stringify(config, null, 2), "utf-8");
|
|
382
|
-
}
|
|
383
|
-
updateMcpConfig(resolve(agentsDir, "mcp_config.json"));
|
|
384
|
-
const cursorDir = resolve(rootDir, ".cursor");
|
|
385
|
-
if (existsSync(cursorDir)) {
|
|
386
|
-
updateMcpConfig(resolve(cursorDir, "mcp.json"));
|
|
387
|
-
}
|
|
388
|
-
const vscodeDir = resolve(rootDir, ".vscode");
|
|
389
|
-
if (existsSync(vscodeDir)) {
|
|
390
|
-
updateMcpConfig(resolve(vscodeDir, "mcp.json"));
|
|
391
|
-
}
|
|
392
|
-
const pkgJsonPath = resolve(rootDir, "package.json");
|
|
393
|
-
if (existsSync(pkgJsonPath)) {
|
|
394
|
-
try {
|
|
395
|
-
const pkg = JSON.parse(readFileSync(pkgJsonPath, "utf-8"));
|
|
396
|
-
if (!pkg.scripts) pkg.scripts = {};
|
|
397
|
-
if (!pkg.scripts["ai:check"]) {
|
|
398
|
-
pkg.scripts["ai:check"] = "vue-tsc --noEmit --pretty false | grep -E 'error TS' | head -n 15";
|
|
399
|
-
writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + "\n", "utf-8");
|
|
400
|
-
}
|
|
401
|
-
} catch {
|
|
382
|
+
if (copied > 0) {
|
|
383
|
+
console.log(`[Katlux] Synced ${copied} AI skill files to .agents/skills/ (enabled via katluxToolkit: { autoAiReference: true })`);
|
|
384
|
+
if (skippedUserModified > 0) {
|
|
385
|
+
console.log(`[Katlux] Preserved ${skippedUserModified} locally modified skill files.`);
|
|
402
386
|
}
|
|
403
387
|
}
|
|
404
|
-
console.log(`[Katlux] Auto-synced ${copied} AI skills and MCP server configuration (v${packageVersion}) to .agents/`);
|
|
405
|
-
console.log(`[Katlux] \u{1F4A1} AI Token Tip: When AI pairing, use compact test reporters (e.g. Vitest --reporter=agent, Jest --reporters=summary) or git-changed flags (-o / --changed) to prevent log noise and save context tokens.`);
|
|
406
388
|
}
|
|
407
389
|
|
|
408
|
-
export { module$1 as default };
|
|
390
|
+
export { module$1 as default, hashContent, syncAiReference };
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import type { IKDatatableAction, TDataRow } from '@katlux/providers';
|
|
1
|
+
import type { IKDatatableAction, TDataRow, IDataFilter, CFlatClientDataProvider } from '@katlux/providers';
|
|
2
2
|
interface Props {
|
|
3
3
|
bulkActions?: IKDatatableAction[];
|
|
4
4
|
selectedRows?: TDataRow[];
|
|
5
5
|
selectAll?: boolean;
|
|
6
6
|
unselectedRows?: TDataRow[];
|
|
7
|
-
|
|
7
|
+
totalCount?: number;
|
|
8
|
+
filter?: IDataFilter | null;
|
|
9
|
+
dataProvider?: CFlatClientDataProvider;
|
|
8
10
|
}
|
|
9
11
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
10
|
-
filter:
|
|
12
|
+
filter: IDataFilter | null;
|
|
11
13
|
selectedRows: TDataRow[];
|
|
12
14
|
unselectedRows: TDataRow[];
|
|
13
15
|
bulkActions: IKDatatableAction[];
|
|
14
16
|
selectAll: boolean;
|
|
17
|
+
totalCount: number;
|
|
18
|
+
dataProvider: CFlatClientDataProvider;
|
|
15
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
20
|
declare const _default: typeof __VLS_export;
|
|
17
21
|
export default _default;
|
|
@@ -8,7 +8,9 @@ const props = defineProps({
|
|
|
8
8
|
selectedRows: { type: Array, required: false, default: () => [] },
|
|
9
9
|
selectAll: { type: Boolean, required: false, default: false },
|
|
10
10
|
unselectedRows: { type: Array, required: false, default: () => [] },
|
|
11
|
-
|
|
11
|
+
totalCount: { type: Number, required: false, default: void 0 },
|
|
12
|
+
filter: { type: [Object, null], required: false, default: void 0 },
|
|
13
|
+
dataProvider: { type: Object, required: false, default: void 0 }
|
|
12
14
|
});
|
|
13
15
|
const { selected, dp, doAction, visibleBulkActions } = useKBulkActionsLogic(props);
|
|
14
16
|
const presetComponent = usePresetComponent("KBulkActions", KBulkActionsDefault);
|
|
@@ -17,6 +19,7 @@ const templateProps = computed(() => ({
|
|
|
17
19
|
selectedRows: props.selectedRows,
|
|
18
20
|
selectAll: props.selectAll,
|
|
19
21
|
unselectedRows: props.unselectedRows,
|
|
22
|
+
totalCount: props.totalCount,
|
|
20
23
|
filter: props.filter,
|
|
21
24
|
selected: selected.value,
|
|
22
25
|
dp,
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import type { IKDatatableAction, TDataRow } from '@katlux/providers';
|
|
1
|
+
import type { IKDatatableAction, TDataRow, IDataFilter, CFlatClientDataProvider } from '@katlux/providers';
|
|
2
2
|
interface Props {
|
|
3
3
|
bulkActions?: IKDatatableAction[];
|
|
4
4
|
selectedRows?: TDataRow[];
|
|
5
5
|
selectAll?: boolean;
|
|
6
6
|
unselectedRows?: TDataRow[];
|
|
7
|
-
|
|
7
|
+
totalCount?: number;
|
|
8
|
+
filter?: IDataFilter | null;
|
|
9
|
+
dataProvider?: CFlatClientDataProvider;
|
|
8
10
|
}
|
|
9
11
|
declare const __VLS_export: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
10
|
-
filter:
|
|
12
|
+
filter: IDataFilter | null;
|
|
11
13
|
selectedRows: TDataRow[];
|
|
12
14
|
unselectedRows: TDataRow[];
|
|
13
15
|
bulkActions: IKDatatableAction[];
|
|
14
16
|
selectAll: boolean;
|
|
17
|
+
totalCount: number;
|
|
18
|
+
dataProvider: CFlatClientDataProvider;
|
|
15
19
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
20
|
declare const _default: typeof __VLS_export;
|
|
17
21
|
export default _default;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
import type { IKDatatableAction, TDataRow } from '@katlux/providers';
|
|
1
|
+
import type { IKDatatableAction, TDataRow, IDataFilter } from '@katlux/providers';
|
|
2
2
|
import { CFlatClientDataProvider } from '@katlux/providers';
|
|
3
3
|
export interface KBulkActionsProps {
|
|
4
4
|
bulkActions: IKDatatableAction[];
|
|
5
5
|
selectedRows: TDataRow[];
|
|
6
6
|
selectAll: boolean;
|
|
7
7
|
unselectedRows?: TDataRow[];
|
|
8
|
-
|
|
8
|
+
totalCount?: number;
|
|
9
|
+
filter?: IDataFilter | null;
|
|
9
10
|
idKey?: string;
|
|
11
|
+
dataProvider?: CFlatClientDataProvider;
|
|
10
12
|
}
|
|
11
13
|
export declare const KBulkActionsDefaultProps: {};
|
|
12
14
|
export declare function getApplicableRows(action: IKDatatableAction, selectedRows: TDataRow[], selectAll: boolean): TDataRow[];
|