@katlux/toolkit 0.1.1-alpha.142 → 0.1.1-alpha.144

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.
Files changed (61) hide show
  1. package/bin/add-ai-reference.mjs +17 -0
  2. package/bin/create-preset.mjs +20 -1
  3. package/dist/module.cjs +170 -6
  4. package/dist/module.json +1 -1
  5. package/dist/module.mjs +171 -7
  6. package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +2 -2
  7. package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +2 -2
  8. package/dist/runtime/components/KAlert/KAlert.global.d.vue.ts +1 -1
  9. package/dist/runtime/components/KAlert/KAlert.global.vue.d.ts +1 -1
  10. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +2 -2
  11. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +2 -2
  12. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  13. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +2 -2
  14. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +2 -2
  15. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +7 -7
  16. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +7 -7
  17. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +14 -14
  18. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +14 -14
  19. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
  20. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +1 -1
  21. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +1 -1
  22. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +8 -8
  23. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +8 -8
  24. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +4 -4
  25. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +4 -4
  26. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +1 -1
  27. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +1 -1
  28. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
  29. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
  30. package/dist/runtime/components/KHourSelect/KHourSelect.global.d.vue.ts +1 -1
  31. package/dist/runtime/components/KHourSelect/KHourSelect.global.vue.d.ts +1 -1
  32. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +2 -2
  33. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +2 -2
  34. package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +3 -3
  35. package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +3 -3
  36. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
  37. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
  38. package/dist/runtime/components/KRangeSlider/KRangeSlider.global.d.vue.ts +1 -1
  39. package/dist/runtime/components/KRangeSlider/KRangeSlider.global.vue.d.ts +1 -1
  40. package/dist/runtime/components/KSlider/KSlider.global.d.vue.ts +1 -1
  41. package/dist/runtime/components/KSlider/KSlider.global.vue.d.ts +1 -1
  42. package/dist/runtime/components/KTabs/KTabs.global.d.vue.ts +2 -2
  43. package/dist/runtime/components/KTabs/KTabs.global.vue.d.ts +2 -2
  44. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +1 -1
  45. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +1 -1
  46. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +3 -3
  47. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +3 -3
  48. package/dist/runtime/components/KToast/KToast.global.d.vue.ts +3 -3
  49. package/dist/runtime/components/KToast/KToast.global.vue.d.ts +3 -3
  50. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +3 -3
  51. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +3 -3
  52. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +6 -6
  53. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +6 -6
  54. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.d.vue.ts +2 -2
  55. package/dist/runtime/presets/default/components/KCheckbox/KCheckbox.vue.d.ts +2 -2
  56. package/dist/runtime/presets/default/components/KToast/KToast.d.vue.ts +2 -2
  57. package/dist/runtime/presets/default/components/KToast/KToast.vue.d.ts +2 -2
  58. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +1 -1
  59. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +1 -1
  60. package/dist/skills/katlux-config/SKILL.md +7 -7
  61. package/package.json +2 -2
@@ -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} When AI pairing, use compact test reporters (e.g. Vitest ${CYAN}--reporter=agent${RESET}, Jest ${CYAN}--reporters=summary${RESET}) or git-changed flags (${CYAN}-o${RESET} / ${CYAN}--changed${RESET}) to prevent log noise 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}`)
@@ -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)
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. **Template**: Always use **Pug** (\`lang="pug"\`). Use **Tabs** for indentation.
215
- 2. **Styling**: Use CSS variables (e.g. \`var(--primary-500)\`, \`var(--border-radius-md)\`). Never hardcode colors or sizes.
216
- 3. **Preset Selectors**: Scope CSS rules under \`[data-preset~="preset-name"]\`. Avoid \`!important\`.
217
- 4. **Imports**: Use workspace aliases (e.g. \`#toolkit/composables/...\`). Avoid deep relative imports.
218
- 5. **i18n**: Use \`t('...')\` for all user-facing strings and ARIA labels.
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,7 +392,20 @@ 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
  }
244
- console.log(`[Katlux] Auto-synced ${copied} AI skills and MCP server configuration to .agents/`);
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
+ }
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.`);
245
409
  }
246
410
 
247
411
  module.exports = module$1;
package/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@katlux/toolkit",
3
3
  "configKey": "katluxToolkit",
4
- "version": "0.1.1-alpha.142",
4
+ "version": "0.1.1-alpha.144",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.2",
7
7
  "unbuild": "3.6.1"
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. **Template**: Always use **Pug** (\`lang="pug"\`). Use **Tabs** for indentation.
212
- 2. **Styling**: Use CSS variables (e.g. \`var(--primary-500)\`, \`var(--border-radius-md)\`). Never hardcode colors or sizes.
213
- 3. **Preset Selectors**: Scope CSS rules under \`[data-preset~="preset-name"]\`. Avoid \`!important\`.
214
- 4. **Imports**: Use workspace aliases (e.g. \`#toolkit/composables/...\`). Avoid deep relative imports.
215
- 5. **i18n**: Use \`t('...')\` for all user-facing strings and ARIA labels.
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,7 +389,20 @@ 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
  }
241
- console.log(`[Katlux] Auto-synced ${copied} AI skills and MCP server configuration to .agents/`);
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
+ }
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.`);
242
406
  }
243
407
 
244
408
  export { module$1 as default };
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
12
12
  toggleItem: (id: string) => void;
13
13
  isOpen: (id: string) => boolean;
14
14
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
- "update:modelValue": (value: any) => any;
16
15
  change: (value: any) => any;
16
+ "update:modelValue": (value: any) => any;
17
17
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  multiOpen: {
19
19
  type: BooleanConstructor;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
24
24
  default: undefined;
25
25
  };
26
26
  }>> & Readonly<{
27
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
28
27
  onChange?: ((value: any) => any) | undefined;
28
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
29
29
  }>, {
30
30
  multiOpen: boolean;
31
31
  modelValue: string | number | string[] | number[];
@@ -12,8 +12,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
12
12
  toggleItem: (id: string) => void;
13
13
  isOpen: (id: string) => boolean;
14
14
  }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
15
- "update:modelValue": (value: any) => any;
16
15
  change: (value: any) => any;
16
+ "update:modelValue": (value: any) => any;
17
17
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
18
18
  multiOpen: {
19
19
  type: BooleanConstructor;
@@ -24,8 +24,8 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
24
24
  default: undefined;
25
25
  };
26
26
  }>> & Readonly<{
27
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
28
27
  onChange?: ((value: any) => any) | undefined;
28
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
29
29
  }>, {
30
30
  multiOpen: boolean;
31
31
  modelValue: string | number | string[] | number[];
@@ -6,8 +6,8 @@ declare const __VLS_export: import("vue").DefineComponent<KAlertProps, {}, {}, {
6
6
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
7
7
  onDismiss?: (() => any) | undefined;
8
8
  }>, {
9
- modelValue: boolean;
10
9
  type: import("./KAlert.logic.js").KAlertType;
10
+ modelValue: boolean;
11
11
  dismissible: boolean;
12
12
  hideIcon: boolean;
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -6,8 +6,8 @@ declare const __VLS_export: import("vue").DefineComponent<KAlertProps, {}, {}, {
6
6
  "onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
7
7
  onDismiss?: (() => any) | undefined;
8
8
  }>, {
9
- modelValue: boolean;
10
9
  type: import("./KAlert.logic.js").KAlertType;
10
+ modelValue: boolean;
11
11
  dismissible: boolean;
12
12
  hideIcon: boolean;
13
13
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
@@ -54,9 +54,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
54
54
  }>> & Readonly<{
55
55
  onClick?: (() => any) | undefined;
56
56
  }>, {
57
- size: "small" | "large" | "medium" | undefined;
58
- type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
59
57
  iconOnly: boolean;
58
+ type: "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | undefined;
59
+ size: "small" | "large" | "medium" | undefined;
60
60
  disabled: boolean;
61
61
  href: string;
62
62
  loading: boolean;
@@ -54,9 +54,9 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
54
54
  }>> & Readonly<{
55
55
  onClick?: (() => any) | undefined;
56
56
  }>, {
57
- size: "small" | "large" | "medium" | undefined;
58
- type: "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | undefined;
59
57
  iconOnly: boolean;
58
+ type: "default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | undefined;
59
+ size: "small" | "large" | "medium" | undefined;
60
60
  disabled: boolean;
61
61
  href: string;
62
62
  loading: boolean;
@@ -23,7 +23,7 @@ export interface KButtonEmits {
23
23
  export declare function useKButtonLogic(props: KButtonProps, emit: KButtonEmits): {
24
24
  isLink: import("vue").ComputedRef<boolean>;
25
25
  isDisabled: import("vue").ComputedRef<boolean | undefined>;
26
- buttonClasses: import("vue").ComputedRef<("small" | "default" | "info" | "success" | "warning" | "danger" | "primary" | "light" | "dark" | "large" | "medium" | {
26
+ buttonClasses: import("vue").ComputedRef<("default" | "primary" | "danger" | "success" | "warning" | "info" | "light" | "dark" | "small" | "large" | "medium" | {
27
27
  disabled: boolean | undefined;
28
28
  'icon-only': boolean | undefined;
29
29
  })[]>;
@@ -71,13 +71,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
71
71
  type: import("vue").PropType<any>;
72
72
  };
73
73
  }>> & Readonly<{
74
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
75
74
  onBlur?: ((event: FocusEvent) => any) | undefined;
75
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
76
76
  "onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
77
77
  }>, {
78
78
  label: string;
79
79
  disabled: boolean;
80
- validation: "error" | "success" | "warning" | null | undefined;
80
+ validation: "success" | "warning" | "error" | null | undefined;
81
81
  validationText: string;
82
82
  idKey: string;
83
83
  indeterminate: boolean;
@@ -71,13 +71,13 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
71
71
  type: import("vue").PropType<any>;
72
72
  };
73
73
  }>> & Readonly<{
74
- "onUpdate:modelValue"?: ((value: any) => any) | undefined;
75
74
  onBlur?: ((event: FocusEvent) => any) | undefined;
75
+ "onUpdate:modelValue"?: ((value: any) => any) | undefined;
76
76
  "onUpdate:indeterminate"?: ((value: boolean) => any) | undefined;
77
77
  }>, {
78
78
  label: string;
79
79
  disabled: boolean;
80
- validation: "error" | "success" | "warning" | null | undefined;
80
+ validation: "success" | "warning" | "error" | null | undefined;
81
81
  validationText: string;
82
82
  idKey: string;
83
83
  indeterminate: boolean;