@katlux/toolkit 0.1.1-alpha.145 → 0.1.1-alpha.147

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 (298) hide show
  1. package/README.md +32 -22
  2. package/bin/ai-init.mjs +575 -0
  3. package/bin/ai-tokens/adapters/antigravityAdapter.mjs +22 -0
  4. package/bin/ai-tokens/adapters/claudeCodeAdapter.mjs +192 -0
  5. package/bin/ai-tokens/adapters/codexAdapter.mjs +176 -0
  6. package/bin/ai-tokens/adapters/cursorAdapter.mjs +202 -0
  7. package/bin/ai-tokens/adapters/index.mjs +30 -0
  8. package/bin/ai-tokens/cliViews.mjs +301 -0
  9. package/bin/ai-tokens/formatAndDates.mjs +89 -0
  10. package/bin/ai-tokens/reportGenerator.mjs +232 -0
  11. package/bin/ai-tokens/transcriptParser.mjs +299 -0
  12. package/bin/ai-tokens.mjs +38 -872
  13. package/bin/cli.mjs +81 -48
  14. package/bin/create-preset.mjs +1 -0
  15. package/bin/preset-contracts.json +2997 -0
  16. package/dist/compiled/composables/locales/asianAndPacific.mjs +296 -0
  17. package/dist/compiled/composables/locales/northernAndEasternEuropean.mjs +342 -0
  18. package/dist/compiled/composables/locales/westernEuropean.mjs +268 -0
  19. package/dist/compiled/composables/locales.mjs +32 -720
  20. package/dist/compiled/composables/useDataProvider.mjs +39 -26
  21. package/dist/compiled/composables/useFilterLogic.mjs +10 -2
  22. package/dist/compiled/composables/useKatluxForm.mjs +13 -11
  23. package/dist/compiled/composables/usePresetComponent.mjs +2 -0
  24. package/dist/compiled/composables/useRequestQueue.mjs +3 -1
  25. package/dist/compiled/composables/useVirtualDataset.mjs +657 -0
  26. package/dist/compiled/composables/useVirtualScroll.mjs +93 -66
  27. package/dist/compiled/composables/virtualDataset/cacheStateHelpers.mjs +76 -0
  28. package/dist/compiled/composables/virtualDataset/keyboardNavHelpers.mjs +60 -0
  29. package/dist/compiled/composables/virtualDataset/treeSelectionHelpers.mjs +103 -0
  30. package/dist/compiled/composables/virtualDataset/types.mjs +0 -0
  31. package/dist/compiled/utils/deprecation.mjs +44 -0
  32. package/dist/compiled/utils/dom.mjs +124 -0
  33. package/dist/module.cjs +58 -77
  34. package/dist/module.d.cts +5 -0
  35. package/dist/module.d.mts +4 -1
  36. package/dist/module.json +1 -1
  37. package/dist/module.mjs +54 -77
  38. package/dist/runtime/app.config.d.ts +3 -0
  39. package/dist/runtime/components/KAccordion/KAccordion.global.d.vue.ts +1 -1
  40. package/dist/runtime/components/KAccordion/KAccordion.global.vue.d.ts +1 -1
  41. package/dist/runtime/components/KBulkActions/KBulkActions.global.d.vue.ts +7 -3
  42. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue +4 -1
  43. package/dist/runtime/components/KBulkActions/KBulkActions.global.vue.d.ts +7 -3
  44. package/dist/runtime/components/KBulkActions/KBulkActions.logic.d.ts +12 -2
  45. package/dist/runtime/components/KBulkActions/KBulkActions.logic.js +40 -41
  46. package/dist/runtime/components/KButton/KButton.global.d.vue.ts +1 -1
  47. package/dist/runtime/components/KButton/KButton.global.vue.d.ts +1 -1
  48. package/dist/runtime/components/KButton/KButton.logic.d.ts +1 -1
  49. package/dist/runtime/components/KCalendar/KCalendar.global.d.vue.ts +19 -10
  50. package/dist/runtime/components/KCalendar/KCalendar.global.vue +7 -2
  51. package/dist/runtime/components/KCalendar/KCalendar.global.vue.d.ts +19 -10
  52. package/dist/runtime/components/KCalendar/KCalendar.logic.d.ts +14 -201
  53. package/dist/runtime/components/KCalendar/KCalendar.logic.js +67 -14
  54. package/dist/runtime/components/KCalendar/KCalendarMonth.global.d.vue.ts +25 -5
  55. package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue +15 -1
  56. package/dist/runtime/components/KCalendar/KCalendarMonth.global.vue.d.ts +25 -5
  57. package/dist/runtime/components/KCalendar/KCalendarMonth.logic.d.ts +21 -3
  58. package/dist/runtime/components/KCalendar/KCalendarMonth.logic.js +136 -7
  59. package/dist/runtime/components/KCalendar/recurringUtils.js +6 -5
  60. package/dist/runtime/components/KCheckbox/KCheckbox.global.d.vue.ts +2 -2
  61. package/dist/runtime/components/KCheckbox/KCheckbox.global.vue.d.ts +2 -2
  62. package/dist/runtime/components/KCombobox/KCombobox.global.d.vue.ts +18 -3
  63. package/dist/runtime/components/KCombobox/KCombobox.global.vue +9 -4
  64. package/dist/runtime/components/KCombobox/KCombobox.global.vue.d.ts +18 -3
  65. package/dist/runtime/components/KCombobox/KCombobox.logic.d.ts +16 -2
  66. package/dist/runtime/components/KCombobox/KCombobox.logic.js +32 -13
  67. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.d.vue.ts +8 -8
  68. package/dist/runtime/components/KCompositeInput/KCompositeInput.global.vue.d.ts +8 -8
  69. package/dist/runtime/components/KCompositeInput/KCompositeInput.logic.d.ts +3 -3
  70. package/dist/runtime/components/KContextMenu/KContextMenu.global.d.vue.ts +3 -3
  71. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue +4 -1
  72. package/dist/runtime/components/KContextMenu/KContextMenu.global.vue.d.ts +3 -3
  73. package/dist/runtime/components/KContextMenu/KContextMenu.logic.d.ts +24 -4
  74. package/dist/runtime/components/KContextMenu/KContextMenu.logic.js +43 -22
  75. package/dist/runtime/components/KDatatable/KDataIterator.global.d.vue.ts +38 -11
  76. package/dist/runtime/components/KDatatable/KDataIterator.global.vue +39 -20
  77. package/dist/runtime/components/KDatatable/KDataIterator.global.vue.d.ts +38 -11
  78. package/dist/runtime/components/KDatatable/KDataIterator.logic.d.ts +31 -8
  79. package/dist/runtime/components/KDatatable/KDataIterator.logic.js +69 -24
  80. package/dist/runtime/components/KDatatable/KDatatable.global.d.vue.ts +10 -14
  81. package/dist/runtime/components/KDatatable/KDatatable.global.vue +6 -5
  82. package/dist/runtime/components/KDatatable/KDatatable.global.vue.d.ts +10 -14
  83. package/dist/runtime/components/KDatatable/KDatatable.logic.d.ts +4 -6
  84. package/dist/runtime/components/KDatatable/KDatatable.logic.js +32 -24
  85. package/dist/runtime/components/KDatePicker/KDatePicker.global.d.vue.ts +33 -15
  86. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue +60 -16
  87. package/dist/runtime/components/KDatePicker/KDatePicker.global.vue.d.ts +33 -15
  88. package/dist/runtime/components/KDatePicker/KDatePicker.logic.d.ts +30 -6
  89. package/dist/runtime/components/KDatePicker/KDatePicker.logic.js +249 -59
  90. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.d.vue.ts +2 -2
  91. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.global.vue.d.ts +2 -2
  92. package/dist/runtime/components/KDateTimePicker/KDateTimePicker.logic.js +2 -0
  93. package/dist/runtime/components/KDropdown/KDropdown.global.d.vue.ts +4 -4
  94. package/dist/runtime/components/KDropdown/KDropdown.global.vue.d.ts +4 -4
  95. package/dist/runtime/components/KDropdown/KDropdown.logic.d.ts +3 -2
  96. package/dist/runtime/components/KDropdown/KDropdown.logic.js +14 -13
  97. package/dist/runtime/components/KGantt/KGantt.global.d.vue.ts +55 -4
  98. package/dist/runtime/components/KGantt/KGantt.global.vue +18 -3
  99. package/dist/runtime/components/KGantt/KGantt.global.vue.d.ts +55 -4
  100. package/dist/runtime/components/KGantt/KGantt.logic.d.ts +33 -5
  101. package/dist/runtime/components/KGantt/KGantt.logic.js +39 -6
  102. package/dist/runtime/components/KGrid/KGrid.global.d.vue.ts +1 -1
  103. package/dist/runtime/components/KGrid/KGrid.global.vue.d.ts +1 -1
  104. package/dist/runtime/components/KHourPicker/KHourPicker.global.d.vue.ts +2 -2
  105. package/dist/runtime/components/KHourPicker/KHourPicker.global.vue.d.ts +2 -2
  106. package/dist/runtime/components/KIcon/KIcon.global.d.vue.ts +1 -1
  107. package/dist/runtime/components/KIcon/KIcon.global.vue.d.ts +1 -1
  108. package/dist/runtime/components/KLayout/KLayout.global.d.vue.ts +4 -1
  109. package/dist/runtime/components/KLayout/KLayout.global.vue +4 -1
  110. package/dist/runtime/components/KLayout/KLayout.global.vue.d.ts +4 -1
  111. package/dist/runtime/components/KLoader/KLoader.global.d.vue.ts +9 -0
  112. package/dist/runtime/components/KLoader/KLoader.global.vue +3 -0
  113. package/dist/runtime/components/KLoader/KLoader.global.vue.d.ts +9 -0
  114. package/dist/runtime/components/KLoader/KLoader.logic.d.ts +5 -0
  115. package/dist/runtime/components/KLoader/KLoader.logic.js +4 -0
  116. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.d.vue.ts +2 -2
  117. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.global.vue.d.ts +2 -2
  118. package/dist/runtime/components/KMaskTextbox/KMaskTextbox.logic.js +30 -7
  119. package/dist/runtime/components/KMultiTabs/KMultiTabs.logic.d.ts +1 -0
  120. package/dist/runtime/components/KMultiTabs/MultiTabs.global.d.vue.ts +23 -0
  121. package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue +24 -0
  122. package/dist/runtime/components/KMultiTabs/MultiTabs.global.vue.d.ts +23 -0
  123. package/dist/runtime/components/KPagination/KPagination.global.d.vue.ts +3 -1
  124. package/dist/runtime/components/KPagination/KPagination.global.vue +2 -1
  125. package/dist/runtime/components/KPagination/KPagination.global.vue.d.ts +3 -1
  126. package/dist/runtime/components/KPagination/KPagination.logic.d.ts +2 -1
  127. package/dist/runtime/components/KPagination/KPagination.logic.js +74 -14
  128. package/dist/runtime/components/KRadiobox/KRadiobox.global.d.vue.ts +1 -1
  129. package/dist/runtime/components/KRadiobox/KRadiobox.global.vue.d.ts +1 -1
  130. package/dist/runtime/components/KTabs/KTabs.logic.js +33 -11
  131. package/dist/runtime/components/KTextarea/KTextarea.global.d.vue.ts +2 -2
  132. package/dist/runtime/components/KTextarea/KTextarea.global.vue.d.ts +2 -2
  133. package/dist/runtime/components/KTextbox/KTextbox.global.d.vue.ts +15 -4
  134. package/dist/runtime/components/KTextbox/KTextbox.global.vue +8 -2
  135. package/dist/runtime/components/KTextbox/KTextbox.global.vue.d.ts +15 -4
  136. package/dist/runtime/components/KTextbox/KTextbox.logic.d.ts +5 -0
  137. package/dist/runtime/components/KTextbox/KTextbox.logic.js +4 -0
  138. package/dist/runtime/components/KTooltip/KTooltip.logic.d.ts +11 -2
  139. package/dist/runtime/components/KTooltip/KTooltip.logic.js +7 -5
  140. package/dist/runtime/components/KTree/KTree.global.d.vue.ts +4 -4
  141. package/dist/runtime/components/KTree/KTree.global.vue.d.ts +4 -4
  142. package/dist/runtime/components/KTree/KTree.logic.d.ts +2 -2
  143. package/dist/runtime/components/KTree/KTree.logic.js +37 -13
  144. package/dist/runtime/components/KTreePicker/KTreePicker.global.d.vue.ts +7 -5
  145. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue +4 -6
  146. package/dist/runtime/components/KTreePicker/KTreePicker.global.vue.d.ts +7 -5
  147. package/dist/runtime/components/KTreePicker/KTreePicker.logic.d.ts +3 -2
  148. package/dist/runtime/components/KTreePicker/KTreePicker.logic.js +10 -1
  149. package/dist/runtime/components/KTreeView/KTreeView.global.d.vue.ts +40 -6
  150. package/dist/runtime/components/KTreeView/KTreeView.global.vue +19 -1
  151. package/dist/runtime/components/KTreeView/KTreeView.global.vue.d.ts +40 -6
  152. package/dist/runtime/components/KTreeView/KTreeView.logic.d.ts +24 -4
  153. package/dist/runtime/components/KTreeView/KTreeView.logic.js +105 -11
  154. package/dist/runtime/composables/locales/asianAndPacific.d.ts +11 -0
  155. package/dist/runtime/composables/locales/asianAndPacific.js +296 -0
  156. package/dist/runtime/composables/locales/northernAndEasternEuropean.d.ts +12 -0
  157. package/dist/runtime/composables/locales/northernAndEasternEuropean.js +342 -0
  158. package/dist/runtime/composables/locales/westernEuropean.d.ts +10 -0
  159. package/dist/runtime/composables/locales/westernEuropean.js +268 -0
  160. package/dist/runtime/composables/locales.d.ts +4 -24
  161. package/dist/runtime/composables/locales.js +32 -720
  162. package/dist/runtime/composables/useDataProvider.d.ts +5 -3
  163. package/dist/runtime/composables/useDataProvider.js +39 -26
  164. package/dist/runtime/composables/useFilterLogic.d.ts +16 -4
  165. package/dist/runtime/composables/useFilterLogic.js +10 -2
  166. package/dist/runtime/composables/useKatluxForm.d.ts +4 -4
  167. package/dist/runtime/composables/useKatluxForm.js +13 -11
  168. package/dist/runtime/composables/usePresetComponent.js +2 -0
  169. package/dist/runtime/composables/useRequestQueue.d.ts +2 -0
  170. package/dist/runtime/composables/useRequestQueue.js +3 -1
  171. package/dist/runtime/composables/useSortLogic.d.ts +1 -1
  172. package/dist/runtime/composables/useVirtualDataset.d.ts +9 -0
  173. package/dist/runtime/composables/useVirtualDataset.js +657 -0
  174. package/dist/runtime/composables/useVirtualScroll.d.ts +14 -10
  175. package/dist/runtime/composables/useVirtualScroll.js +93 -66
  176. package/dist/runtime/composables/virtualDataset/cacheStateHelpers.d.ts +49 -0
  177. package/dist/runtime/composables/virtualDataset/cacheStateHelpers.js +76 -0
  178. package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.d.ts +26 -0
  179. package/dist/runtime/composables/virtualDataset/keyboardNavHelpers.js +60 -0
  180. package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.d.ts +24 -0
  181. package/dist/runtime/composables/virtualDataset/treeSelectionHelpers.js +103 -0
  182. package/dist/runtime/composables/virtualDataset/types.d.ts +113 -0
  183. package/dist/runtime/composables/virtualDataset/types.js +0 -0
  184. package/dist/runtime/directives/clickOutside.d.ts +1 -1
  185. package/dist/runtime/directives/clickOutside.js +41 -13
  186. package/dist/runtime/plugins/nuxtCompatPlugin.d.ts +2 -1
  187. package/dist/runtime/plugins/nuxtCompatPlugin.js +16 -1
  188. package/dist/runtime/plugins/toastPlugin.client.js +2 -2
  189. package/dist/runtime/presets/default/assets/scss/css-variables.css +3 -0
  190. package/dist/runtime/presets/default/assets/scss/css-variables.scss +6 -1
  191. package/dist/runtime/presets/default/assets/scss/index.css +3 -0
  192. package/dist/runtime/presets/default/assets/svg/katlux-logo.svg +7 -0
  193. package/dist/runtime/presets/default/assets/svg/katlux.svg +6 -0
  194. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.d.vue.ts +3 -2
  195. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue +31 -3
  196. package/dist/runtime/presets/default/components/KBulkActions/KBulkActions.vue.d.ts +3 -2
  197. package/dist/runtime/presets/default/components/KCalendar/KCalendar.d.vue.ts +3 -0
  198. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue +6 -0
  199. package/dist/runtime/presets/default/components/KCalendar/KCalendar.vue.d.ts +3 -0
  200. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.d.vue.ts +7 -0
  201. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue +57 -2
  202. package/dist/runtime/presets/default/components/KCalendar/KCalendarMonth.vue.d.ts +7 -0
  203. package/dist/runtime/presets/default/components/KCalendar/KCalendarWeek.vue +6 -5
  204. package/dist/runtime/presets/default/components/KCombobox/KCombobox.d.vue.ts +4 -1
  205. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue +27 -17
  206. package/dist/runtime/presets/default/components/KCombobox/KCombobox.vue.d.ts +4 -1
  207. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.d.vue.ts +1 -1
  208. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue +10 -10
  209. package/dist/runtime/presets/default/components/KCombobox/KComboboxList.vue.d.ts +1 -1
  210. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.d.vue.ts +2 -0
  211. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue +67 -22
  212. package/dist/runtime/presets/default/components/KContextMenu/KContextMenu.vue.d.ts +2 -0
  213. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.d.vue.ts +41 -8
  214. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue +184 -174
  215. package/dist/runtime/presets/default/components/KDataIterator/KDataIterator.vue.d.ts +41 -8
  216. package/dist/runtime/presets/default/components/KDatatable/KDatatable.d.vue.ts +17 -10
  217. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue +113 -394
  218. package/dist/runtime/presets/default/components/KDatatable/KDatatable.vue.d.ts +17 -10
  219. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.d.vue.ts +6 -0
  220. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue +71 -4
  221. package/dist/runtime/presets/default/components/KDatePicker/KDatePicker.vue.d.ts +6 -0
  222. package/dist/runtime/presets/default/components/KDropdown/KDropdown.d.vue.ts +5 -2
  223. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue +15 -12
  224. package/dist/runtime/presets/default/components/KDropdown/KDropdown.vue.d.ts +5 -2
  225. package/dist/runtime/presets/default/components/KGantt/KGantt.d.vue.ts +11 -2
  226. package/dist/runtime/presets/default/components/KGantt/KGantt.vue +46 -29
  227. package/dist/runtime/presets/default/components/KGantt/KGantt.vue.d.ts +11 -2
  228. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.d.vue.ts +6 -2
  229. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue +23 -8
  230. package/dist/runtime/presets/default/components/KGantt/KGanttTimeline.vue.d.ts +6 -2
  231. package/dist/runtime/presets/default/components/KLayout/KLayout.vue +2 -2
  232. package/dist/runtime/presets/default/components/KLoader/KLoader.d.vue.ts +1 -0
  233. package/dist/runtime/presets/default/components/KLoader/KLoader.vue +13 -2
  234. package/dist/runtime/presets/default/components/KLoader/KLoader.vue.d.ts +1 -0
  235. package/dist/runtime/presets/default/components/KMaskTextbox/KMaskTextbox.vue +1 -94
  236. package/dist/runtime/presets/default/components/KMultiTabs/KMultiTabs.vue +69 -4
  237. package/dist/runtime/presets/default/components/KRangeSlider/KRangeSlider.vue +18 -46
  238. package/dist/runtime/presets/default/components/KSlider/KSlider.vue +11 -23
  239. package/dist/runtime/presets/default/components/KTextbox/KTextbox.d.vue.ts +4 -1
  240. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue +24 -8
  241. package/dist/runtime/presets/default/components/KTextbox/KTextbox.vue.d.ts +4 -1
  242. package/dist/runtime/presets/default/components/KTree/KTree.d.vue.ts +3 -3
  243. package/dist/runtime/presets/default/components/KTree/KTree.vue +61 -56
  244. package/dist/runtime/presets/default/components/KTree/KTree.vue.d.ts +3 -3
  245. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.d.vue.ts +1 -0
  246. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue +12 -2
  247. package/dist/runtime/presets/default/components/KTree/KTreeNodeItem.vue.d.ts +1 -0
  248. package/dist/runtime/presets/default/components/KTreeView/KTreeView.d.vue.ts +11 -2
  249. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue +14 -2
  250. package/dist/runtime/presets/default/components/KTreeView/KTreeView.vue.d.ts +11 -2
  251. package/dist/runtime/server/middleware/session.js +7 -0
  252. package/dist/runtime/utils/deprecation.d.ts +14 -0
  253. package/dist/runtime/utils/deprecation.js +44 -0
  254. package/dist/runtime/utils/dom.d.ts +31 -0
  255. package/dist/runtime/utils/dom.js +124 -0
  256. package/dist/skills/KATLUX_INDEX.md +18 -19
  257. package/dist/skills/katlux-components/SKILL.md +2 -0
  258. package/dist/skills/katlux-components/components/KBulkActions.md +26 -2
  259. package/dist/skills/katlux-components/components/KCombobox.md +2 -2
  260. package/dist/skills/katlux-components/components/KDataIterator.md +17 -4
  261. package/dist/skills/katlux-components/components/KDatatable.md +38 -0
  262. package/dist/skills/katlux-components/components/KDatePicker.md +3 -1
  263. package/dist/skills/katlux-components/components/KGantt.md +9 -0
  264. package/dist/skills/katlux-components/components/KIcon.md +1 -1
  265. package/dist/skills/katlux-components/components/KLayout.md +4 -0
  266. package/dist/skills/katlux-components/components/KLineChart.md +3 -0
  267. package/dist/skills/katlux-components/components/KLoader.md +3 -0
  268. package/dist/skills/katlux-components/components/KProductList.md +0 -1
  269. package/dist/skills/katlux-components/components/KScatterChart.md +3 -0
  270. package/dist/skills/katlux-components/components/KTextbox.md +1 -0
  271. package/dist/skills/katlux-components/components/KTreePicker.md +2 -1
  272. package/dist/skills/katlux-components/components/KTreeView.md +12 -0
  273. package/dist/skills/katlux-config/SKILL.md +27 -8
  274. package/dist/skills/katlux-presets/SKILL.md +163 -3
  275. package/dist/skills/katlux-presets/creating-a-preset.md +67 -0
  276. package/dist/skills/katlux-providers/SKILL.md +19 -5
  277. package/dist/skills/katlux-providers/providers/ADataProvider.md +17 -9
  278. package/dist/skills/katlux-providers/providers/CAPIFlatClientDataProvider.md +27 -3
  279. package/dist/skills/katlux-providers/providers/CAPIFlatServerDataProvider.md +11 -1
  280. package/dist/skills/katlux-providers/providers/CAPITreeServerDataProvider.md +13 -0
  281. package/dist/skills/katlux-providers/providers/CFlatClientDataProvider.md +19 -4
  282. package/dist/skills/katlux-providers/providers/CFlatServerDataProvider.md +4 -2
  283. package/dist/skills/katlux-providers/providers/CTreeClientDataProvider.md +2 -2
  284. package/dist/skills/katlux-providers/providers/RequestProvider.md +10 -0
  285. package/dist/skills/katlux-providers/providers/encryption-field-level.md +67 -20
  286. package/dist/skills/katlux-providers/providers/encryption-key-management.md +23 -2
  287. package/dist/skills/katlux-providers/providers/encryption-key-pinning.md +25 -11
  288. package/dist/skills/katlux-providers/providers/encryption-searchable.md +341 -0
  289. package/dist/skills/katlux-providers/providers/encryption-symmetric.md +29 -2
  290. package/dist/skills/katlux-providers/providers/encryption-threat-model.md +70 -1
  291. package/dist/skills/katlux-providers/providers/encryption.md +26 -1
  292. package/dist/skills/katlux-providers/providers/types.md +3 -1
  293. package/dist/skills/katlux-providers/providers/useDataProvider.md +2 -1
  294. package/dist/skills/katlux-providers/providers/useVirtualDataset.md +154 -0
  295. package/dist/skills/katlux-tokens/SKILL.md +2 -1
  296. package/dist/types.d.mts +1 -1
  297. package/package.json +7 -3
  298. package/bin/add-ai-reference.mjs +0 -259
@@ -0,0 +1,299 @@
1
+ import { existsSync, readdirSync, statSync, readFileSync, openSync, readSync, closeSync } from 'node:fs'
2
+ import { join, basename } from 'node:path'
3
+ import {
4
+ BRAIN_DIRS,
5
+ cleanString,
6
+ estimateTokens,
7
+ formatDateTime,
8
+ getWeekKey
9
+ } from './formatAndDates.mjs'
10
+
11
+ /**
12
+ * Performs fast 16KB header inspection of a conversation transcript without loading the full JSONL.
13
+ */
14
+ export function getConversationPreviewFast(dirPath, searchQuery = '') {
15
+ const pFull = join(dirPath, '.system_generated/logs/transcript_full.jsonl')
16
+ const pNorm = join(dirPath, '.system_generated/logs/transcript.jsonl')
17
+ const p = existsSync(pFull) ? pFull : pNorm
18
+ if (!existsSync(p)) return { project: 'Unknown', title: '(empty transcript)', fullTitle: '', rawSize: 0, estimatedTokens: 0, matchesSearch: false, stepsCount: 0 }
19
+
20
+ try {
21
+ const stat = statSync(p)
22
+ if (stat.size === 0) return { project: 'Unknown', title: '(empty transcript)', fullTitle: '', rawSize: 0, estimatedTokens: 0, matchesSearch: false, stepsCount: 0 }
23
+
24
+ let fd
25
+ let chunk = ''
26
+ try {
27
+ fd = openSync(p, 'r')
28
+ const buf = Buffer.alloc(16384)
29
+ const bytesRead = readSync(fd, buf, 0, 16384, 0)
30
+ closeSync(fd)
31
+ chunk = buf.toString('utf-8', 0, bytesRead)
32
+ } catch {
33
+ if (fd !== undefined) try { closeSync(fd) } catch {}
34
+ }
35
+
36
+ let project = 'Unknown'
37
+ const m1 = chunk.match(/\[URI\] -> \[CorpusName\]:\s*\n([^\s\n\r]+)\s*->/)
38
+ if (m1) {
39
+ project = basename(m1[1])
40
+ } else {
41
+ const m2 = chunk.match(/\/Desktop\/projects\/([a-zA-Z0-9_\-]+)/)
42
+ if (m2) project = m2[1]
43
+ else {
44
+ const m3 = chunk.match(/\/projects\/([a-zA-Z0-9_\-]+)/)
45
+ if (m3) project = m3[1]
46
+ }
47
+ }
48
+
49
+ let title = '(no user prompt recorded)'
50
+ const reqMatch = chunk.match(/<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/)
51
+ if (reqMatch) {
52
+ title = reqMatch[1].replace(/\\n/g, ' ').replace(/[\r\n\t]+/g, ' ').trim()
53
+ } else {
54
+ const contentMatch = chunk.match(/"type":"USER_INPUT"[\s\S]*?"content":"([^"]+)"/)
55
+ if (contentMatch) title = contentMatch[1].replace(/\\n/g, ' ').replace(/[\r\n\t]+/g, ' ').trim()
56
+ }
57
+
58
+ let matchesSearch = false
59
+ if (searchQuery) {
60
+ matchesSearch = chunk.toLowerCase().includes(searchQuery)
61
+ }
62
+
63
+ const estimatedTokens = Math.ceil(stat.size / 3.75)
64
+ const approxSteps = Math.max(1, Math.round(stat.size / 1450))
65
+
66
+ return {
67
+ project,
68
+ title: title.slice(0, 42),
69
+ fullTitle: title,
70
+ rawSize: stat.size,
71
+ estimatedTokens,
72
+ matchesSearch,
73
+ stepsCount: approxSteps
74
+ }
75
+ } catch {
76
+ return { project: 'Unknown', title: '(read error)', fullTitle: '', rawSize: 0, estimatedTokens: 0, matchesSearch: false, stepsCount: 0 }
77
+ }
78
+ }
79
+
80
+ /**
81
+ * Lists all Antigravity conversation directories sorted newest-first by activity time.
82
+ */
83
+ export function getConversations() {
84
+ const validDirs = BRAIN_DIRS.filter(d => existsSync(d))
85
+ if (validDirs.length === 0) return []
86
+
87
+ const seen = new Set()
88
+ const results = []
89
+
90
+ for (const bDir of validDirs) {
91
+ const entries = readdirSync(bDir, { withFileTypes: true })
92
+ for (const e of entries) {
93
+ if (!e.isDirectory() || e.name === 'tempmediaStorage' || e.name.startsWith('.')) continue
94
+ if (seen.has(e.name)) continue
95
+ seen.add(e.name)
96
+
97
+ const dirPath = join(bDir, e.name)
98
+ const transcriptPath = join(dirPath, '.system_generated/logs/transcript.jsonl')
99
+ const dirStat = statSync(dirPath)
100
+ let lastActive = dirStat.mtime
101
+ if (existsSync(transcriptPath)) {
102
+ try {
103
+ lastActive = statSync(transcriptPath).mtime
104
+ } catch {}
105
+ }
106
+ results.push({
107
+ id: e.name,
108
+ path: dirPath,
109
+ createdAt: dirStat.mtime,
110
+ lastActive,
111
+ mtime: lastActive,
112
+ weekKey: getWeekKey(lastActive)
113
+ })
114
+ }
115
+ }
116
+
117
+ return results.sort((a, b) => b.lastActive.getTime() - a.lastActive.getTime())
118
+ }
119
+
120
+ /**
121
+ * Parses a conversation's JSONL transcript into structured step entries.
122
+ */
123
+ export function parseTranscript(conversationDir) {
124
+ const transcriptFullPath = join(conversationDir, '.system_generated/logs/transcript_full.jsonl')
125
+ const transcriptPath = join(conversationDir, '.system_generated/logs/transcript.jsonl')
126
+ const targetPath = existsSync(transcriptFullPath) ? transcriptFullPath : transcriptPath
127
+ if (!existsSync(targetPath)) return null
128
+
129
+ const raw = readFileSync(targetPath, 'utf-8')
130
+ const lines = raw.trim().split('\n').filter(Boolean)
131
+
132
+ const steps = []
133
+ for (let i = 0; i < lines.length; i++) {
134
+ try {
135
+ const obj = JSON.parse(lines[i])
136
+ steps.push(obj)
137
+ } catch {}
138
+ }
139
+ return steps
140
+ }
141
+
142
+ function resolveStepContent(step) {
143
+ const type = step.type || 'OTHER'
144
+ if (type === 'PLANNER_RESPONSE') {
145
+ const parts = []
146
+ if (typeof step.content === 'string' && step.content) parts.push(step.content)
147
+ else if (step.content && typeof step.content !== 'string') parts.push(JSON.stringify(step.content))
148
+ if (step.thinking && typeof step.thinking === 'string') parts.push(step.thinking)
149
+ if (step.tool_calls) parts.push(JSON.stringify(step.tool_calls))
150
+ return parts.join('\n')
151
+ }
152
+ if (typeof step.content === 'string') return step.content
153
+ if (step.tool_calls) return JSON.stringify(step.tool_calls)
154
+ if (step.content) return JSON.stringify(step.content)
155
+ return ''
156
+ }
157
+
158
+ function mapGenericToolCategory(toolName) {
159
+ if (toolName === 'read_file' || toolName === 'view_file') return 'VIEW_FILE'
160
+ if (toolName === 'run_command' || toolName === 'manage_task') return 'RUN_COMMAND'
161
+ if (['edit_file', 'write_file', 'replace_file_content', 'multi_replace_file_content', 'write_to_file'].includes(toolName)) {
162
+ return 'CODE_ACTION'
163
+ }
164
+ if (toolName === 'call_mcp_tool' || toolName.startsWith('mcp_') || toolName.startsWith('katlux_')) return 'MCP_TOOL'
165
+ if (toolName === 'grep_search') return 'GREP_SEARCH'
166
+ if (toolName === 'list_dir' || toolName === 'find_by_name') return 'LIST_DIRECTORY'
167
+ return 'OTHER'
168
+ }
169
+
170
+ /**
171
+ * Analyzes parsed session steps to compute token totals, category splits, MCP usage, and spikes.
172
+ */
173
+ export function analyzeSession(steps, conversationId, mtime = new Date(), previewProject = 'Unknown') {
174
+ let totalChars = 0
175
+ let inputChars = 0
176
+ let outputChars = 0
177
+
178
+ const categories = {
179
+ USER_INPUT: { count: 0, chars: 0, tokens: 0, label: 'User Prompts' },
180
+ PLANNER_RESPONSE: { count: 0, chars: 0, tokens: 0, label: 'Assistant / Model' },
181
+ VIEW_FILE: { count: 0, chars: 0, tokens: 0, label: 'view_file / read_file' },
182
+ MCP_TOOL: { count: 0, chars: 0, tokens: 0, label: 'MCP Tools' },
183
+ CODE_ACTION: { count: 0, chars: 0, tokens: 0, label: 'Code Edit / Write' },
184
+ RUN_COMMAND: { count: 0, chars: 0, tokens: 0, label: 'run_command Outputs' },
185
+ GREP_SEARCH: { count: 0, chars: 0, tokens: 0, label: 'grep_search Outputs' },
186
+ LIST_DIRECTORY: { count: 0, chars: 0, tokens: 0, label: 'list_dir Outputs' },
187
+ CONVERSATION_HISTORY: { count: 0, chars: 0, tokens: 0, label: 'Injected History' },
188
+ SYSTEM_MESSAGE: { count: 0, chars: 0, tokens: 0, label: 'System Notifications' },
189
+ OTHER: { count: 0, chars: 0, tokens: 0, label: 'Other Metadata' }
190
+ }
191
+
192
+ const spikes = []
193
+ const userPrompts = []
194
+ const filesViewed = new Map()
195
+ const filesModified = new Map()
196
+ const mcpCalls = { inspectProject: 0, validateCode: 0, otherMcp: 0, total: 0 }
197
+ let sessionTitle = ''
198
+ let detectedProject = previewProject
199
+ const pendingToolCalls = []
200
+
201
+ steps.forEach(step => {
202
+ const type = step.type || 'OTHER'
203
+ const content = resolveStepContent(step)
204
+
205
+ if (detectedProject === 'Unknown' && content) {
206
+ const m1 = content.match(/\[URI\] -> \[CorpusName\]:\s*\n([^\s\n\r]+)\s*->/)
207
+ if (m1) detectedProject = basename(m1[1])
208
+ else {
209
+ const m2 = content.match(/\/Desktop\/projects\/([a-zA-Z0-9_\-]+)/)
210
+ if (m2) detectedProject = m2[1]
211
+ }
212
+ }
213
+
214
+ if (type === 'USER_INPUT' && content) {
215
+ const match = content.match(/<USER_REQUEST>([\s\S]*?)<\/USER_REQUEST>/)
216
+ const promptText = (match ? match[1] : content).replace(/[\r\n\t]+/g, ' ').trim()
217
+ if (!sessionTitle) sessionTitle = promptText
218
+ const timeStr = step.created_at ? formatDateTime(new Date(step.created_at)) : ''
219
+ userPrompts.push({ step: step.step_index, text: promptText, time: timeStr })
220
+ }
221
+
222
+ if (step.tool_calls && Array.isArray(step.tool_calls)) {
223
+ step.tool_calls.forEach(tc => {
224
+ pendingToolCalls.push(tc)
225
+ const args = tc.args || {}
226
+ let toolName = tc.name
227
+ if (tc.name === 'call_mcp_tool') toolName = cleanString(args.ToolName)
228
+ if (toolName === 'katlux_inspect_project') {
229
+ mcpCalls.inspectProject++
230
+ mcpCalls.total++
231
+ } else if (toolName === 'katlux_validate_code') {
232
+ mcpCalls.validateCode++
233
+ mcpCalls.total++
234
+ } else if (tc.name === 'call_mcp_tool' || (toolName && toolName.startsWith('katlux_'))) {
235
+ mcpCalls.otherMcp++
236
+ mcpCalls.total++
237
+ }
238
+
239
+ if ((tc.name === 'view_file' || tc.name === 'read_file') && (args.AbsolutePath || args.Path)) {
240
+ const fn = basename(cleanString(args.AbsolutePath || args.Path))
241
+ if (fn) filesViewed.set(fn, (filesViewed.get(fn) || 0) + 1)
242
+ } else if (['replace_file_content', 'multi_replace_file_content', 'write_to_file', 'edit_file', 'write_file'].includes(tc.name) && (args.TargetFile || args.Path)) {
243
+ const fn = basename(cleanString(args.TargetFile || args.Path))
244
+ if (fn) filesModified.set(fn, (filesModified.get(fn) || 0) + 1)
245
+ }
246
+ })
247
+ }
248
+
249
+ const chars = content.length
250
+ const tokens = estimateTokens(chars)
251
+ totalChars += chars
252
+ if (type === 'PLANNER_RESPONSE') outputChars += chars
253
+ else inputChars += chars
254
+
255
+ let catType = type
256
+ if (type === 'READ_FILE') catType = 'VIEW_FILE'
257
+ if (type === 'MCP_TOOL' || type === 'CALL_MCP_TOOL') catType = 'MCP_TOOL'
258
+ if (type === 'GENERIC') {
259
+ const correspondingTool = pendingToolCalls.shift()
260
+ catType = correspondingTool ? mapGenericToolCategory(correspondingTool.name || '') : 'OTHER'
261
+ }
262
+
263
+ const cat = categories[catType] || categories.OTHER
264
+ cat.count++
265
+ cat.chars += chars
266
+ cat.tokens += tokens
267
+
268
+ spikes.push({
269
+ step_index: step.step_index,
270
+ type: type === 'GENERIC' && catType !== 'OTHER' ? `${type} (${catType})` : type,
271
+ tokens,
272
+ chars,
273
+ preview: content.replace(/[\r\n\t]+/g, ' ').slice(0, 80).trim()
274
+ })
275
+ })
276
+
277
+ spikes.sort((a, b) => b.tokens - a.tokens)
278
+ return {
279
+ conversationId,
280
+ project: detectedProject,
281
+ sessionTitle: sessionTitle || '(no title)',
282
+ mtime,
283
+ weekKey: getWeekKey(mtime),
284
+ totalSteps: steps.length,
285
+ totalChars,
286
+ totalTokens: estimateTokens(totalChars),
287
+ inputTokens: estimateTokens(inputChars),
288
+ outputTokens: estimateTokens(outputChars),
289
+ categories,
290
+ mcpCalls,
291
+ spikes: spikes.slice(0, 5),
292
+ userPrompts,
293
+ topViewedFiles: [...filesViewed.entries()].sort((a, b) => b[1] - a[1]).slice(0, 5),
294
+ topModifiedFiles: [...filesModified.entries()].sort((a, b) => b[1] - a[1]).slice(0, 5),
295
+ allFilesViewed: filesViewed,
296
+ allFilesModified: filesModified
297
+ }
298
+ }
299
+