@katlux/toolkit 0.1.1-alpha.141 → 0.1.1-alpha.143
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/add-ai-reference.mjs +17 -0
- package/bin/create-preset.mjs +20 -1
- package/dist/compiled/composables/useKatluxForm.mjs +29 -21
- package/dist/module.cjs +168 -5
- package/dist/module.json +1 -1
- package/dist/module.mjs +169 -6
- package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
- package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -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 +1 -1
- package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
- package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
- 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/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/KTreePicker/KTreePicker.global.d.vue.ts +1 -1
- package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +1 -1
- package/dist/runtime/composables/useKatluxForm.d.ts +11 -11
- package/dist/runtime/composables/useKatluxForm.js +29 -21
- package/dist/skills/katlux-components/components/KAreaChart.md +1 -1
- package/dist/skills/katlux-components/components/KBarChart.md +1 -1
- package/dist/skills/katlux-components/components/KBulkActions.md +3 -3
- package/dist/skills/katlux-components/components/KCheckbox.md +2 -2
- package/dist/skills/katlux-components/components/KCombobox.md +3 -3
- package/dist/skills/katlux-components/components/KCompositeInput.md +4 -4
- package/dist/skills/katlux-components/components/KDataIterator.md +3 -3
- package/dist/skills/katlux-components/components/KDatatable.md +7 -7
- package/dist/skills/katlux-components/components/KDatePicker.md +3 -3
- package/dist/skills/katlux-components/components/KGantt.md +12 -12
- package/dist/skills/katlux-components/components/KHeatMap.md +1 -1
- package/dist/skills/katlux-components/components/KLineChart.md +1 -1
- package/dist/skills/katlux-components/components/KPieChart.md +1 -1
- package/dist/skills/katlux-components/components/KScatterChart.md +1 -1
- package/dist/skills/katlux-components/components/KTree.md +8 -8
- package/dist/skills/katlux-components/components/KTreePicker.md +3 -3
- package/dist/skills/katlux-components/components/KTreeView.md +3 -3
- package/dist/skills/katlux-config/SKILL.md +7 -7
- package/dist/skills/katlux-presets/SKILL.md +1 -1
- package/dist/skills/katlux-presets/creating-a-preset.md +1 -1
- package/dist/skills/katlux-providers/providers/ADataProvider.md +3 -3
- package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +3 -3
- package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +3 -3
- package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +4 -4
- package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +1 -1
- package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +2 -2
- package/dist/skills/katlux-providers/providers/RequestProvider.md +4 -4
- package/dist/skills/katlux-providers/providers/caching.md +11 -11
- package/dist/skills/katlux-providers/providers/encryption-threat-model.md +2 -2
- package/dist/skills/katlux-providers/providers/types.md +5 -5
- package/dist/skills/katlux-providers/providers/useDataProvider.md +1 -1
- package/package.json +2 -2
package/bin/add-ai-reference.mjs
CHANGED
|
@@ -225,6 +225,22 @@ if (existsSync(vscodeDir)) {
|
|
|
225
225
|
log(GREEN, ' configured', '.vscode/mcp.json (VS Code MCP server enabled)')
|
|
226
226
|
}
|
|
227
227
|
|
|
228
|
+
// ── 6. Inject AI-Condensed Typechecker Script (`npm run ai:check`) ─────────────
|
|
229
|
+
const pkgJsonPath = resolve(projectRoot, 'package.json')
|
|
230
|
+
if (existsSync(pkgJsonPath)) {
|
|
231
|
+
try {
|
|
232
|
+
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'))
|
|
233
|
+
if (!pkg.scripts) pkg.scripts = {}
|
|
234
|
+
if (!pkg.scripts['ai:check']) {
|
|
235
|
+
pkg.scripts['ai:check'] = "vue-tsc --noEmit --pretty false | grep -E 'error TS' | head -n 15"
|
|
236
|
+
writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + '\n', 'utf-8')
|
|
237
|
+
log(GREEN, ' injected', 'package.json "ai:check" script (token-efficient typechecker)')
|
|
238
|
+
}
|
|
239
|
+
} catch {
|
|
240
|
+
// Ignore package.json read/parse errors
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
228
244
|
// ── Done ─────────────────────────────────────────────────────────────────────
|
|
229
245
|
console.log()
|
|
230
246
|
log(GREEN, '[katlux-add-ref] ✔', `Done! ${installedFilesCount} skill files (including atomic components & providers) + index installed and MCP server configured.`)
|
|
@@ -236,6 +252,7 @@ console.log(` ${CYAN}Index:${RESET} .agents/skills/KATLUX_INDEX.md ${DIM}(aut
|
|
|
236
252
|
console.log(` ${CYAN}MCP:${RESET} @katlux/mcp server ready on stdio`)
|
|
237
253
|
console.log()
|
|
238
254
|
console.log(` ${YELLOW}Next:${RESET} Add your project-specific rules to ${CYAN}.agents/rules/rules.md${RESET}`)
|
|
255
|
+
console.log(` ${YELLOW}💡 AI Token Tip:${RESET} If using Vitest, run with ${CYAN}--reporter=agent${RESET} or ${CYAN}--changed${RESET} during AI pairing to suppress passing logs and save context tokens.`)
|
|
239
256
|
console.log()
|
|
240
257
|
console.log(` Re-run any time to update to the latest version:`)
|
|
241
258
|
console.log(` ${CYAN}npx @katlux/toolkit katlux-add-ref${RESET}`)
|
package/bin/create-preset.mjs
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* npx @katlux/toolkit create-preset cyber-brand --base=modern
|
|
11
11
|
*/
|
|
12
12
|
|
|
13
|
-
import { existsSync, mkdirSync, writeFileSync } from 'fs'
|
|
13
|
+
import { existsSync, mkdirSync, writeFileSync, readFileSync } from 'fs'
|
|
14
14
|
import { resolve, join, relative } from 'path'
|
|
15
15
|
|
|
16
16
|
const RESET = '\x1b[0m'
|
|
@@ -438,6 +438,21 @@ export function createPreset({ name, base = null, cwd = process.cwd() }) {
|
|
|
438
438
|
|
|
439
439
|
writeFileSync(cssVarsFile, scssContent, 'utf-8')
|
|
440
440
|
|
|
441
|
+
// Optionally ensure ai:check is present in consumer package.json for token-efficient typechecking
|
|
442
|
+
let injectedAiCheck = false
|
|
443
|
+
const pkgJsonPath = resolve(cwd, 'package.json')
|
|
444
|
+
if (existsSync(pkgJsonPath)) {
|
|
445
|
+
try {
|
|
446
|
+
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf-8'))
|
|
447
|
+
if (!pkg.scripts) pkg.scripts = {}
|
|
448
|
+
if (!pkg.scripts['ai:check']) {
|
|
449
|
+
pkg.scripts['ai:check'] = "vue-tsc --noEmit --pretty false | grep -E 'error TS' | head -n 15"
|
|
450
|
+
writeFileSync(pkgJsonPath, JSON.stringify(pkg, null, 2) + '\n', 'utf-8')
|
|
451
|
+
injectedAiCheck = true
|
|
452
|
+
}
|
|
453
|
+
} catch {}
|
|
454
|
+
}
|
|
455
|
+
|
|
441
456
|
return {
|
|
442
457
|
presetName: trimmedName,
|
|
443
458
|
basePreset: base ? base.trim().toLowerCase() : null,
|
|
@@ -446,6 +461,7 @@ export function createPreset({ name, base = null, cwd = process.cwd() }) {
|
|
|
446
461
|
componentsDir,
|
|
447
462
|
cssVarsFile,
|
|
448
463
|
hasAppDir,
|
|
464
|
+
injectedAiCheck,
|
|
449
465
|
}
|
|
450
466
|
}
|
|
451
467
|
|
|
@@ -521,6 +537,9 @@ ${BOLD}Examples:${RESET}
|
|
|
521
537
|
console.log(` ${CYAN}Directory:${RESET} ${relTarget}`)
|
|
522
538
|
console.log(` ${CYAN}Tokens File:${RESET} ${relFile}`)
|
|
523
539
|
console.log(` ${CYAN}Components:${RESET} ${relComponents} (empty for custom overrides)`)
|
|
540
|
+
if (result.injectedAiCheck) {
|
|
541
|
+
console.log(` ${CYAN}Diagnostics:${RESET} Injected "ai:check" script into package.json (token-efficient typechecker)`)
|
|
542
|
+
}
|
|
524
543
|
console.log()
|
|
525
544
|
|
|
526
545
|
const presetTitle = toTitleCase(result.presetName)
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { ref, reactive, computed, nextTick } from "vue";
|
|
2
2
|
function getByPath(obj, path) {
|
|
3
|
-
if (!obj || !path) return void 0;
|
|
3
|
+
if (!obj || !path || typeof obj !== "object") return void 0;
|
|
4
4
|
const parts = path.replace(/\[(\w+)\]/g, ".$1").split(".");
|
|
5
5
|
let current = obj;
|
|
6
6
|
for (const part of parts) {
|
|
7
|
-
if (current == null) return void 0;
|
|
7
|
+
if (current == null || typeof current !== "object") return void 0;
|
|
8
8
|
current = current[part];
|
|
9
9
|
}
|
|
10
10
|
return current;
|
|
11
11
|
}
|
|
12
12
|
function setByPath(obj, path, value) {
|
|
13
|
-
if (!obj || !path) return;
|
|
13
|
+
if (!obj || !path || typeof obj !== "object") return;
|
|
14
14
|
const parts = path.replace(/\[(\w+)\]/g, ".$1").split(".");
|
|
15
15
|
let current = obj;
|
|
16
16
|
for (let i = 0; i < parts.length - 1; i++) {
|
|
@@ -62,26 +62,28 @@ export function useKatluxForm(options = {}) {
|
|
|
62
62
|
}
|
|
63
63
|
function parseValidationResult(rawResult, schemaType, dataToValidate) {
|
|
64
64
|
if (schemaType === "standard") {
|
|
65
|
-
|
|
65
|
+
const res = rawResult;
|
|
66
|
+
if (res.issues && res.issues.length > 0) {
|
|
66
67
|
const errorMap = {};
|
|
67
|
-
for (const issue of
|
|
68
|
-
const pathStr = issue.path && issue.path.length > 0 ? issue.path.map((seg) => typeof seg === "object" && seg !== null && "key" in seg ? seg.key : seg).join(".") : "";
|
|
68
|
+
for (const issue of res.issues) {
|
|
69
|
+
const pathStr = issue.path && issue.path.length > 0 ? issue.path.map((seg) => typeof seg === "object" && seg !== null && "key" in seg ? String(seg.key) : String(seg)).join(".") : "";
|
|
69
70
|
registerErrorPaths(errorMap, pathStr, issue.message);
|
|
70
71
|
}
|
|
71
72
|
return { valid: false, output: dataToValidate, errors: errorMap };
|
|
72
73
|
}
|
|
73
|
-
return { valid: true, output:
|
|
74
|
+
return { valid: true, output: res.value ?? dataToValidate, errors: {} };
|
|
74
75
|
}
|
|
75
76
|
if (schemaType === "zod") {
|
|
76
|
-
|
|
77
|
+
const res = rawResult;
|
|
78
|
+
if (!res.success) {
|
|
77
79
|
const errorMap = {};
|
|
78
|
-
for (const issue of
|
|
80
|
+
for (const issue of res.error.issues) {
|
|
79
81
|
const pathStr = issue.path ? issue.path.join(".") : "";
|
|
80
82
|
registerErrorPaths(errorMap, pathStr, issue.message);
|
|
81
83
|
}
|
|
82
84
|
return { valid: false, output: dataToValidate, errors: errorMap };
|
|
83
85
|
}
|
|
84
|
-
return { valid: true, output:
|
|
86
|
+
return { valid: true, output: res.data ?? dataToValidate, errors: {} };
|
|
85
87
|
}
|
|
86
88
|
if (schemaType === "custom") {
|
|
87
89
|
const errorMap = {};
|
|
@@ -99,19 +101,25 @@ export function useKatluxForm(options = {}) {
|
|
|
99
101
|
if (!schema) {
|
|
100
102
|
return { valid: true, output: dataToValidate, errors: {} };
|
|
101
103
|
}
|
|
102
|
-
if ("
|
|
103
|
-
const
|
|
104
|
-
if (
|
|
105
|
-
|
|
104
|
+
if (typeof schema === "object" && schema !== null && "~standard" in schema) {
|
|
105
|
+
const standardSchema = schema;
|
|
106
|
+
if (typeof standardSchema["~standard"]?.validate === "function") {
|
|
107
|
+
const res = standardSchema["~standard"].validate(dataToValidate);
|
|
108
|
+
if (res && typeof res.then === "function") {
|
|
109
|
+
return res.then((r) => parseValidationResult(r, "standard", dataToValidate));
|
|
110
|
+
}
|
|
111
|
+
return parseValidationResult(res, "standard", dataToValidate);
|
|
106
112
|
}
|
|
107
|
-
return parseValidationResult(res, "standard", dataToValidate);
|
|
108
|
-
}
|
|
109
|
-
if (typeof schema.safeParse === "function") {
|
|
110
|
-
const res = schema.safeParse(dataToValidate);
|
|
111
|
-
return parseValidationResult(res, "zod", dataToValidate);
|
|
112
113
|
}
|
|
113
|
-
if (typeof schema
|
|
114
|
-
|
|
114
|
+
if (typeof schema === "object" && schema !== null) {
|
|
115
|
+
const zodSchema = schema;
|
|
116
|
+
if (typeof zodSchema.safeParse === "function") {
|
|
117
|
+
const res = zodSchema.safeParse(dataToValidate);
|
|
118
|
+
return parseValidationResult(res, "zod", dataToValidate);
|
|
119
|
+
}
|
|
120
|
+
if (typeof zodSchema.safeParseAsync === "function") {
|
|
121
|
+
return zodSchema.safeParseAsync(dataToValidate).then((res) => parseValidationResult(res, "zod", dataToValidate));
|
|
122
|
+
}
|
|
115
123
|
}
|
|
116
124
|
if (typeof schema === "function") {
|
|
117
125
|
const res = schema(dataToValidate);
|
package/dist/module.cjs
CHANGED
|
@@ -43,6 +43,150 @@ const module$1 = kit.defineNuxtModule({
|
|
|
43
43
|
global: true
|
|
44
44
|
});
|
|
45
45
|
kit.addImportsDir(resolve("./runtime/composables"));
|
|
46
|
+
const providerRuntimeExports = [
|
|
47
|
+
// Data Providers
|
|
48
|
+
"CFlatClientDataProvider",
|
|
49
|
+
"CFlatServerDataProvider",
|
|
50
|
+
"CAPIFlatClientDataProvider",
|
|
51
|
+
"CAPIFlatServerDataProvider",
|
|
52
|
+
"CTreeClientDataProvider",
|
|
53
|
+
"CTreeServerDataProvider",
|
|
54
|
+
"CAPITreeClientDataProvider",
|
|
55
|
+
"CAPITreeServerDataProvider",
|
|
56
|
+
"ADataProvider",
|
|
57
|
+
"AEncryptedClientProvider",
|
|
58
|
+
"AAPIDataProvider",
|
|
59
|
+
// Encryption & Security
|
|
60
|
+
"CWebCryptoEncryptionProvider",
|
|
61
|
+
"CWebCryptoAESCBCProvider",
|
|
62
|
+
"CECDHEncryptionProvider",
|
|
63
|
+
"CRSAEncryptionProvider",
|
|
64
|
+
"CNodeCryptoEncryptionProvider",
|
|
65
|
+
"AEncryptionProvider",
|
|
66
|
+
"CKeyManager",
|
|
67
|
+
"CSearchIndex",
|
|
68
|
+
"CWebCryptoStreamCipher",
|
|
69
|
+
"CKeyPinningStore",
|
|
70
|
+
"isEncrypted",
|
|
71
|
+
"createEncryptionProvider",
|
|
72
|
+
"rewriteEncryptedFilters",
|
|
73
|
+
"reencryptDataset",
|
|
74
|
+
// HTTP, Cache & Queue Providers
|
|
75
|
+
"RequestProvider",
|
|
76
|
+
"RequestQueue",
|
|
77
|
+
"RequestProviderRegistry",
|
|
78
|
+
"QueueStorageFactory",
|
|
79
|
+
"CApplicationCache",
|
|
80
|
+
"CBrowserSessionCache",
|
|
81
|
+
"CServerSessionCache",
|
|
82
|
+
"CMemoryCache",
|
|
83
|
+
"CLocalStorageCache",
|
|
84
|
+
"CIndexedDBCache",
|
|
85
|
+
"CCookieCache",
|
|
86
|
+
"CacheProviderFactory",
|
|
87
|
+
"KatluxIndexedDB",
|
|
88
|
+
// Runtime Enums
|
|
89
|
+
"ECacheStrategy",
|
|
90
|
+
"EDataFilterOperator",
|
|
91
|
+
"EQueueStorage"
|
|
92
|
+
];
|
|
93
|
+
let providersImportPath = "@katlux/providers";
|
|
94
|
+
try {
|
|
95
|
+
providersImportPath = await kit.resolvePath("@katlux/providers");
|
|
96
|
+
} catch {
|
|
97
|
+
try {
|
|
98
|
+
providersImportPath = kit.resolveModule("@katlux/providers");
|
|
99
|
+
} catch {
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
kit.addImports(
|
|
103
|
+
providerRuntimeExports.map((name) => ({
|
|
104
|
+
name,
|
|
105
|
+
as: name,
|
|
106
|
+
from: providersImportPath
|
|
107
|
+
}))
|
|
108
|
+
);
|
|
109
|
+
kit.addServerImports(
|
|
110
|
+
providerRuntimeExports.map((name) => ({
|
|
111
|
+
name,
|
|
112
|
+
as: name,
|
|
113
|
+
from: "@katlux/providers"
|
|
114
|
+
}))
|
|
115
|
+
);
|
|
116
|
+
kit.addTypeTemplate({
|
|
117
|
+
filename: "types/katlux-providers-global.d.ts",
|
|
118
|
+
getContents: () => `
|
|
119
|
+
import type {
|
|
120
|
+
IDataFilter as _IDataFilter,
|
|
121
|
+
IDataSort as _IDataSort,
|
|
122
|
+
IDataResult as _IDataResult,
|
|
123
|
+
IDataProviderOptions as _IDataProviderOptions,
|
|
124
|
+
IDataProviderState as _IDataProviderState,
|
|
125
|
+
TDataRow as _TDataRow,
|
|
126
|
+
TPageDataHandler as _TPageDataHandler,
|
|
127
|
+
TDataProviderListener as _TDataProviderListener,
|
|
128
|
+
TUnsubscribe as _TUnsubscribe,
|
|
129
|
+
ITreeNode as _ITreeNode,
|
|
130
|
+
ITreeNodeStatic as _ITreeNodeStatic,
|
|
131
|
+
ITreeDataProvider as _ITreeDataProvider,
|
|
132
|
+
ITreeDataProviderOptions as _ITreeDataProviderOptions,
|
|
133
|
+
TreePaginationMode as _TreePaginationMode,
|
|
134
|
+
TTreeRow as _TTreeRow,
|
|
135
|
+
IKDatatableAction as _IKDatatableAction,
|
|
136
|
+
KProductItemData as _KProductItemData,
|
|
137
|
+
KProductRowAction as _KProductRowAction,
|
|
138
|
+
ICacheEntry as _ICacheEntry,
|
|
139
|
+
ICacheQuotaOptions as _ICacheQuotaOptions,
|
|
140
|
+
ICookieCacheOptions as _ICookieCacheOptions,
|
|
141
|
+
IRequestOptions as _IRequestOptions,
|
|
142
|
+
IQueuedOperation as _IQueuedOperation,
|
|
143
|
+
IDeadLetterItem as _IDeadLetterItem,
|
|
144
|
+
IFlushOptions as _IFlushOptions,
|
|
145
|
+
IEncryptedPayload as _IEncryptedPayload,
|
|
146
|
+
IEncryptionContext as _IEncryptionContext,
|
|
147
|
+
IFieldEncryptionConfig as _IFieldEncryptionConfig,
|
|
148
|
+
IHybridKeyExport as _IHybridKeyExport,
|
|
149
|
+
IExportedKeyStore as _IExportedKeyStore,
|
|
150
|
+
ISearchIndexDump as _ISearchIndexDump
|
|
151
|
+
} from '@katlux/providers'
|
|
152
|
+
|
|
153
|
+
declare global {
|
|
154
|
+
type IDataFilter = _IDataFilter
|
|
155
|
+
type IDataSort = _IDataSort
|
|
156
|
+
type IDataResult<TRow = _TDataRow> = _IDataResult<TRow>
|
|
157
|
+
type IDataProviderOptions<TRow = _TDataRow> = _IDataProviderOptions
|
|
158
|
+
type IDataProviderState<TRow = _TDataRow> = _IDataProviderState<TRow>
|
|
159
|
+
type TDataRow = _TDataRow
|
|
160
|
+
type TPageDataHandler<TRow = _TDataRow> = _TPageDataHandler<TRow>
|
|
161
|
+
type TDataProviderListener<T = unknown> = _TDataProviderListener<T>
|
|
162
|
+
type TUnsubscribe = _TUnsubscribe
|
|
163
|
+
type ITreeNode<TRow = _TDataRow> = _ITreeNode<TRow>
|
|
164
|
+
type ITreeNodeStatic<TRow = _TDataRow> = _ITreeNodeStatic<TRow>
|
|
165
|
+
type ITreeDataProvider<TRow = _TDataRow> = _ITreeDataProvider<TRow>
|
|
166
|
+
type ITreeDataProviderOptions = _ITreeDataProviderOptions
|
|
167
|
+
type TreePaginationMode = _TreePaginationMode
|
|
168
|
+
type TTreeRow<TRow = _TDataRow> = _TTreeRow<TRow>
|
|
169
|
+
type IKDatatableAction = _IKDatatableAction
|
|
170
|
+
type KProductItemData = _KProductItemData
|
|
171
|
+
type KProductRowAction = _KProductRowAction
|
|
172
|
+
type ICacheEntry<T = any> = _ICacheEntry<T>
|
|
173
|
+
type ICacheQuotaOptions = _ICacheQuotaOptions
|
|
174
|
+
type ICookieCacheOptions = _ICookieCacheOptions
|
|
175
|
+
type IRequestOptions = _IRequestOptions
|
|
176
|
+
type IQueuedOperation = _IQueuedOperation
|
|
177
|
+
type IDeadLetterItem = _IDeadLetterItem
|
|
178
|
+
type IFlushOptions = _IFlushOptions
|
|
179
|
+
type IEncryptedPayload = _IEncryptedPayload
|
|
180
|
+
type IEncryptionContext = _IEncryptionContext
|
|
181
|
+
type IFieldEncryptionConfig = _IFieldEncryptionConfig
|
|
182
|
+
type IHybridKeyExport = _IHybridKeyExport
|
|
183
|
+
type IExportedKeyStore = _IExportedKeyStore
|
|
184
|
+
type ISearchIndexDump = _ISearchIndexDump
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
export {}
|
|
188
|
+
`
|
|
189
|
+
});
|
|
46
190
|
kit.addPlugin(resolve("./runtime/plugins/registerDirectives"));
|
|
47
191
|
kit.addPlugin(resolve("./runtime/plugins/PresetPlugin"));
|
|
48
192
|
kit.addPlugin(resolve("./runtime/plugins/nuxtCompatPlugin"));
|
|
@@ -122,6 +266,12 @@ export default defineNuxtPlugin(() => {
|
|
|
122
266
|
nuxt.hook("prepare:types", (options2) => {
|
|
123
267
|
options2.tsConfig.compilerOptions = options2.tsConfig.compilerOptions || {};
|
|
124
268
|
options2.tsConfig.compilerOptions.allowArbitraryExtensions = true;
|
|
269
|
+
if (!options2.references.some((ref) => ref?.types === "@katlux/providers/global")) {
|
|
270
|
+
options2.references.push({ types: "@katlux/providers/global" });
|
|
271
|
+
}
|
|
272
|
+
if (!options2.references.some((ref) => ref?.path?.includes("katlux-providers-global.d.ts"))) {
|
|
273
|
+
options2.references.push({ path: "./types/katlux-providers-global.d.ts" });
|
|
274
|
+
}
|
|
125
275
|
});
|
|
126
276
|
if (nuxt.options.dev && options.autoAiReference !== false) {
|
|
127
277
|
try {
|
|
@@ -211,11 +361,12 @@ This file serves as the main entry point for AI agents to understand the workspa
|
|
|
211
361
|
|
|
212
362
|
## Katlux Code Standards
|
|
213
363
|
|
|
214
|
-
1. **
|
|
215
|
-
2. **
|
|
216
|
-
3. **
|
|
217
|
-
4. **
|
|
218
|
-
5. **
|
|
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.
|
|
219
370
|
`, "utf-8");
|
|
220
371
|
}
|
|
221
372
|
const KATLUX_MCP_SERVER = { command: "npx", args: ["-y", "@katlux/mcp"] };
|
|
@@ -241,6 +392,18 @@ This file serves as the main entry point for AI agents to understand the workspa
|
|
|
241
392
|
if (node_fs.existsSync(vscodeDir)) {
|
|
242
393
|
updateMcpConfig(resolve(vscodeDir, "mcp.json"));
|
|
243
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 {
|
|
405
|
+
}
|
|
406
|
+
}
|
|
244
407
|
console.log(`[Katlux] Auto-synced ${copied} AI skills and MCP server configuration to .agents/`);
|
|
245
408
|
}
|
|
246
409
|
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineNuxtModule, createResolver, addComponentsDir, addImportsDir, addPlugin, addServerHandler, addPluginTemplate } from '@nuxt/kit';
|
|
1
|
+
import { defineNuxtModule, createResolver, addComponentsDir, 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';
|
|
@@ -40,6 +40,150 @@ const module$1 = defineNuxtModule({
|
|
|
40
40
|
global: true
|
|
41
41
|
});
|
|
42
42
|
addImportsDir(resolve("./runtime/composables"));
|
|
43
|
+
const providerRuntimeExports = [
|
|
44
|
+
// Data Providers
|
|
45
|
+
"CFlatClientDataProvider",
|
|
46
|
+
"CFlatServerDataProvider",
|
|
47
|
+
"CAPIFlatClientDataProvider",
|
|
48
|
+
"CAPIFlatServerDataProvider",
|
|
49
|
+
"CTreeClientDataProvider",
|
|
50
|
+
"CTreeServerDataProvider",
|
|
51
|
+
"CAPITreeClientDataProvider",
|
|
52
|
+
"CAPITreeServerDataProvider",
|
|
53
|
+
"ADataProvider",
|
|
54
|
+
"AEncryptedClientProvider",
|
|
55
|
+
"AAPIDataProvider",
|
|
56
|
+
// Encryption & Security
|
|
57
|
+
"CWebCryptoEncryptionProvider",
|
|
58
|
+
"CWebCryptoAESCBCProvider",
|
|
59
|
+
"CECDHEncryptionProvider",
|
|
60
|
+
"CRSAEncryptionProvider",
|
|
61
|
+
"CNodeCryptoEncryptionProvider",
|
|
62
|
+
"AEncryptionProvider",
|
|
63
|
+
"CKeyManager",
|
|
64
|
+
"CSearchIndex",
|
|
65
|
+
"CWebCryptoStreamCipher",
|
|
66
|
+
"CKeyPinningStore",
|
|
67
|
+
"isEncrypted",
|
|
68
|
+
"createEncryptionProvider",
|
|
69
|
+
"rewriteEncryptedFilters",
|
|
70
|
+
"reencryptDataset",
|
|
71
|
+
// HTTP, Cache & Queue Providers
|
|
72
|
+
"RequestProvider",
|
|
73
|
+
"RequestQueue",
|
|
74
|
+
"RequestProviderRegistry",
|
|
75
|
+
"QueueStorageFactory",
|
|
76
|
+
"CApplicationCache",
|
|
77
|
+
"CBrowserSessionCache",
|
|
78
|
+
"CServerSessionCache",
|
|
79
|
+
"CMemoryCache",
|
|
80
|
+
"CLocalStorageCache",
|
|
81
|
+
"CIndexedDBCache",
|
|
82
|
+
"CCookieCache",
|
|
83
|
+
"CacheProviderFactory",
|
|
84
|
+
"KatluxIndexedDB",
|
|
85
|
+
// Runtime Enums
|
|
86
|
+
"ECacheStrategy",
|
|
87
|
+
"EDataFilterOperator",
|
|
88
|
+
"EQueueStorage"
|
|
89
|
+
];
|
|
90
|
+
let providersImportPath = "@katlux/providers";
|
|
91
|
+
try {
|
|
92
|
+
providersImportPath = await resolvePath("@katlux/providers");
|
|
93
|
+
} catch {
|
|
94
|
+
try {
|
|
95
|
+
providersImportPath = resolveModule("@katlux/providers");
|
|
96
|
+
} catch {
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
addImports(
|
|
100
|
+
providerRuntimeExports.map((name) => ({
|
|
101
|
+
name,
|
|
102
|
+
as: name,
|
|
103
|
+
from: providersImportPath
|
|
104
|
+
}))
|
|
105
|
+
);
|
|
106
|
+
addServerImports(
|
|
107
|
+
providerRuntimeExports.map((name) => ({
|
|
108
|
+
name,
|
|
109
|
+
as: name,
|
|
110
|
+
from: "@katlux/providers"
|
|
111
|
+
}))
|
|
112
|
+
);
|
|
113
|
+
addTypeTemplate({
|
|
114
|
+
filename: "types/katlux-providers-global.d.ts",
|
|
115
|
+
getContents: () => `
|
|
116
|
+
import type {
|
|
117
|
+
IDataFilter as _IDataFilter,
|
|
118
|
+
IDataSort as _IDataSort,
|
|
119
|
+
IDataResult as _IDataResult,
|
|
120
|
+
IDataProviderOptions as _IDataProviderOptions,
|
|
121
|
+
IDataProviderState as _IDataProviderState,
|
|
122
|
+
TDataRow as _TDataRow,
|
|
123
|
+
TPageDataHandler as _TPageDataHandler,
|
|
124
|
+
TDataProviderListener as _TDataProviderListener,
|
|
125
|
+
TUnsubscribe as _TUnsubscribe,
|
|
126
|
+
ITreeNode as _ITreeNode,
|
|
127
|
+
ITreeNodeStatic as _ITreeNodeStatic,
|
|
128
|
+
ITreeDataProvider as _ITreeDataProvider,
|
|
129
|
+
ITreeDataProviderOptions as _ITreeDataProviderOptions,
|
|
130
|
+
TreePaginationMode as _TreePaginationMode,
|
|
131
|
+
TTreeRow as _TTreeRow,
|
|
132
|
+
IKDatatableAction as _IKDatatableAction,
|
|
133
|
+
KProductItemData as _KProductItemData,
|
|
134
|
+
KProductRowAction as _KProductRowAction,
|
|
135
|
+
ICacheEntry as _ICacheEntry,
|
|
136
|
+
ICacheQuotaOptions as _ICacheQuotaOptions,
|
|
137
|
+
ICookieCacheOptions as _ICookieCacheOptions,
|
|
138
|
+
IRequestOptions as _IRequestOptions,
|
|
139
|
+
IQueuedOperation as _IQueuedOperation,
|
|
140
|
+
IDeadLetterItem as _IDeadLetterItem,
|
|
141
|
+
IFlushOptions as _IFlushOptions,
|
|
142
|
+
IEncryptedPayload as _IEncryptedPayload,
|
|
143
|
+
IEncryptionContext as _IEncryptionContext,
|
|
144
|
+
IFieldEncryptionConfig as _IFieldEncryptionConfig,
|
|
145
|
+
IHybridKeyExport as _IHybridKeyExport,
|
|
146
|
+
IExportedKeyStore as _IExportedKeyStore,
|
|
147
|
+
ISearchIndexDump as _ISearchIndexDump
|
|
148
|
+
} from '@katlux/providers'
|
|
149
|
+
|
|
150
|
+
declare global {
|
|
151
|
+
type IDataFilter = _IDataFilter
|
|
152
|
+
type IDataSort = _IDataSort
|
|
153
|
+
type IDataResult<TRow = _TDataRow> = _IDataResult<TRow>
|
|
154
|
+
type IDataProviderOptions<TRow = _TDataRow> = _IDataProviderOptions
|
|
155
|
+
type IDataProviderState<TRow = _TDataRow> = _IDataProviderState<TRow>
|
|
156
|
+
type TDataRow = _TDataRow
|
|
157
|
+
type TPageDataHandler<TRow = _TDataRow> = _TPageDataHandler<TRow>
|
|
158
|
+
type TDataProviderListener<T = unknown> = _TDataProviderListener<T>
|
|
159
|
+
type TUnsubscribe = _TUnsubscribe
|
|
160
|
+
type ITreeNode<TRow = _TDataRow> = _ITreeNode<TRow>
|
|
161
|
+
type ITreeNodeStatic<TRow = _TDataRow> = _ITreeNodeStatic<TRow>
|
|
162
|
+
type ITreeDataProvider<TRow = _TDataRow> = _ITreeDataProvider<TRow>
|
|
163
|
+
type ITreeDataProviderOptions = _ITreeDataProviderOptions
|
|
164
|
+
type TreePaginationMode = _TreePaginationMode
|
|
165
|
+
type TTreeRow<TRow = _TDataRow> = _TTreeRow<TRow>
|
|
166
|
+
type IKDatatableAction = _IKDatatableAction
|
|
167
|
+
type KProductItemData = _KProductItemData
|
|
168
|
+
type KProductRowAction = _KProductRowAction
|
|
169
|
+
type ICacheEntry<T = any> = _ICacheEntry<T>
|
|
170
|
+
type ICacheQuotaOptions = _ICacheQuotaOptions
|
|
171
|
+
type ICookieCacheOptions = _ICookieCacheOptions
|
|
172
|
+
type IRequestOptions = _IRequestOptions
|
|
173
|
+
type IQueuedOperation = _IQueuedOperation
|
|
174
|
+
type IDeadLetterItem = _IDeadLetterItem
|
|
175
|
+
type IFlushOptions = _IFlushOptions
|
|
176
|
+
type IEncryptedPayload = _IEncryptedPayload
|
|
177
|
+
type IEncryptionContext = _IEncryptionContext
|
|
178
|
+
type IFieldEncryptionConfig = _IFieldEncryptionConfig
|
|
179
|
+
type IHybridKeyExport = _IHybridKeyExport
|
|
180
|
+
type IExportedKeyStore = _IExportedKeyStore
|
|
181
|
+
type ISearchIndexDump = _ISearchIndexDump
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
export {}
|
|
185
|
+
`
|
|
186
|
+
});
|
|
43
187
|
addPlugin(resolve("./runtime/plugins/registerDirectives"));
|
|
44
188
|
addPlugin(resolve("./runtime/plugins/PresetPlugin"));
|
|
45
189
|
addPlugin(resolve("./runtime/plugins/nuxtCompatPlugin"));
|
|
@@ -119,6 +263,12 @@ export default defineNuxtPlugin(() => {
|
|
|
119
263
|
nuxt.hook("prepare:types", (options2) => {
|
|
120
264
|
options2.tsConfig.compilerOptions = options2.tsConfig.compilerOptions || {};
|
|
121
265
|
options2.tsConfig.compilerOptions.allowArbitraryExtensions = true;
|
|
266
|
+
if (!options2.references.some((ref) => ref?.types === "@katlux/providers/global")) {
|
|
267
|
+
options2.references.push({ types: "@katlux/providers/global" });
|
|
268
|
+
}
|
|
269
|
+
if (!options2.references.some((ref) => ref?.path?.includes("katlux-providers-global.d.ts"))) {
|
|
270
|
+
options2.references.push({ path: "./types/katlux-providers-global.d.ts" });
|
|
271
|
+
}
|
|
122
272
|
});
|
|
123
273
|
if (nuxt.options.dev && options.autoAiReference !== false) {
|
|
124
274
|
try {
|
|
@@ -208,11 +358,12 @@ This file serves as the main entry point for AI agents to understand the workspa
|
|
|
208
358
|
|
|
209
359
|
## Katlux Code Standards
|
|
210
360
|
|
|
211
|
-
1. **
|
|
212
|
-
2. **
|
|
213
|
-
3. **
|
|
214
|
-
4. **
|
|
215
|
-
5. **
|
|
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.
|
|
216
367
|
`, "utf-8");
|
|
217
368
|
}
|
|
218
369
|
const KATLUX_MCP_SERVER = { command: "npx", args: ["-y", "@katlux/mcp"] };
|
|
@@ -238,6 +389,18 @@ This file serves as the main entry point for AI agents to understand the workspa
|
|
|
238
389
|
if (existsSync(vscodeDir)) {
|
|
239
390
|
updateMcpConfig(resolve(vscodeDir, "mcp.json"));
|
|
240
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 {
|
|
402
|
+
}
|
|
403
|
+
}
|
|
241
404
|
console.log(`[Katlux] Auto-synced ${copied} AI skills and MCP server configuration to .agents/`);
|
|
242
405
|
}
|
|
243
406
|
|
|
@@ -56,10 +56,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
56
56
|
}>, {
|
|
57
57
|
size: "small" | "large" | "medium" | undefined;
|
|
58
58
|
type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
|
|
59
|
+
iconOnly: boolean;
|
|
59
60
|
disabled: boolean;
|
|
60
61
|
href: string;
|
|
61
62
|
loading: boolean;
|
|
62
|
-
iconOnly: boolean;
|
|
63
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
64
|
declare const _default: typeof __VLS_export;
|
|
65
65
|
export default _default;
|
|
@@ -56,10 +56,10 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
56
56
|
}>, {
|
|
57
57
|
size: "small" | "large" | "medium" | undefined;
|
|
58
58
|
type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
|
|
59
|
+
iconOnly: boolean;
|
|
59
60
|
disabled: boolean;
|
|
60
61
|
href: string;
|
|
61
62
|
loading: boolean;
|
|
62
|
-
iconOnly: boolean;
|
|
63
63
|
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
64
64
|
declare const _default: typeof __VLS_export;
|
|
65
65
|
export default _default;
|
|
@@ -75,8 +75,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
75
75
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
76
76
|
"onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
disabled: boolean;
|
|
79
78
|
label: string;
|
|
79
|
+
disabled: boolean;
|
|
80
80
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
81
81
|
validationText: string;
|
|
82
82
|
idKey: string;
|
|
@@ -75,8 +75,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
75
75
|
onBlur?: ((event: FocusEvent) => any) | undefined;
|
|
76
76
|
"onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
|
|
77
77
|
}>, {
|
|
78
|
-
disabled: boolean;
|
|
79
78
|
label: string;
|
|
79
|
+
disabled: boolean;
|
|
80
80
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
81
81
|
validationText: string;
|
|
82
82
|
idKey: string;
|
|
@@ -223,8 +223,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
223
223
|
}) => any) | undefined;
|
|
224
224
|
}>, {
|
|
225
225
|
modelValue: any;
|
|
226
|
-
disabled: boolean;
|
|
227
226
|
label: string;
|
|
227
|
+
disabled: boolean;
|
|
228
228
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
229
229
|
validationText: string;
|
|
230
230
|
searchbox: boolean;
|
|
@@ -223,8 +223,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
|
|
|
223
223
|
}) => any) | undefined;
|
|
224
224
|
}>, {
|
|
225
225
|
modelValue: any;
|
|
226
|
-
disabled: boolean;
|
|
227
226
|
label: string;
|
|
227
|
+
disabled: boolean;
|
|
228
228
|
validation: "error" | "success" | "warning" | null | undefined;
|
|
229
229
|
validationText: string;
|
|
230
230
|
searchbox: boolean;
|