glirastes 0.3.0 → 0.3.1

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 (310) hide show
  1. package/CHANGELOG.md +63 -0
  2. package/README.md +146 -9
  3. package/codegen/package.json +5 -0
  4. package/dist/cjs/codegen/asset-sync.d.ts +20 -0
  5. package/dist/cjs/codegen/asset-sync.js +28 -0
  6. package/dist/cjs/codegen/coverage.d.ts +66 -0
  7. package/dist/cjs/codegen/coverage.js +408 -0
  8. package/dist/cjs/codegen/endpoint-scanner.d.ts +16 -0
  9. package/dist/cjs/codegen/endpoint-scanner.js +197 -0
  10. package/dist/cjs/codegen/format.d.ts +17 -0
  11. package/dist/cjs/codegen/format.js +34 -0
  12. package/dist/cjs/codegen/fs-utils.d.ts +45 -0
  13. package/dist/cjs/codegen/fs-utils.js +165 -0
  14. package/dist/cjs/codegen/index.d.ts +13 -0
  15. package/dist/cjs/codegen/index.js +33 -0
  16. package/dist/cjs/codegen/mcp-generator.d.ts +50 -0
  17. package/dist/cjs/codegen/mcp-generator.js +803 -0
  18. package/dist/cjs/codegen/module-generator.d.ts +11 -0
  19. package/dist/cjs/codegen/module-generator.js +353 -0
  20. package/dist/cjs/codegen/nestjs-scanner.d.ts +43 -0
  21. package/dist/cjs/codegen/nestjs-scanner.js +241 -0
  22. package/dist/cjs/codegen/output-recommender.d.ts +23 -0
  23. package/dist/cjs/codegen/output-recommender.js +33 -0
  24. package/dist/cjs/codegen/scaffolder.d.ts +36 -0
  25. package/dist/cjs/codegen/scaffolder.js +262 -0
  26. package/dist/cjs/codegen/skill-generator.d.ts +49 -0
  27. package/dist/cjs/codegen/skill-generator.js +967 -0
  28. package/dist/cjs/codegen/types.d.ts +52 -0
  29. package/dist/cjs/codegen/types.js +16 -0
  30. package/dist/cjs/codegen/ui-scanner.d.ts +24 -0
  31. package/dist/cjs/codegen/ui-scanner.js +202 -0
  32. package/dist/cjs/codegen/validator.d.ts +35 -0
  33. package/dist/cjs/codegen/validator.js +292 -0
  34. package/dist/cjs/index.d.ts +1 -0
  35. package/dist/cjs/index.js +23 -0
  36. package/dist/cjs/openapi/index.d.ts +78 -0
  37. package/dist/cjs/openapi/index.js +347 -0
  38. package/dist/cjs/package.json +1 -0
  39. package/dist/cjs/react/audio-worklet-processor.d.ts +16 -0
  40. package/dist/cjs/react/audio-worklet-processor.js +27 -0
  41. package/dist/cjs/react/bridges/rest-session-bridge.d.ts +113 -0
  42. package/dist/cjs/react/bridges/rest-session-bridge.js +209 -0
  43. package/dist/cjs/react/components/ai-chat-panel.d.ts +12 -0
  44. package/dist/cjs/react/components/ai-chat-panel.js +67 -0
  45. package/dist/cjs/react/components/ai-trigger-button.d.ts +2 -0
  46. package/dist/cjs/react/components/ai-trigger-button.js +239 -0
  47. package/dist/cjs/react/components/approval-card.d.ts +9 -0
  48. package/dist/cjs/react/components/approval-card.js +24 -0
  49. package/dist/cjs/react/components/bulk-approval-card.d.ts +9 -0
  50. package/dist/cjs/react/components/bulk-approval-card.js +36 -0
  51. package/dist/cjs/react/components/chat-input.d.ts +10 -0
  52. package/dist/cjs/react/components/chat-input.js +60 -0
  53. package/dist/cjs/react/components/chat-window.d.ts +2 -0
  54. package/dist/cjs/react/components/chat-window.js +134 -0
  55. package/dist/cjs/react/components/confirm-dialog.d.ts +32 -0
  56. package/dist/cjs/react/components/confirm-dialog.js +48 -0
  57. package/dist/cjs/react/components/floating-chat-ui.d.ts +90 -0
  58. package/dist/cjs/react/components/floating-chat-ui.js +163 -0
  59. package/dist/cjs/react/components/mention-chip.d.ts +16 -0
  60. package/dist/cjs/react/components/mention-chip.js +42 -0
  61. package/dist/cjs/react/components/mention-input.d.ts +8 -0
  62. package/dist/cjs/react/components/mention-input.js +117 -0
  63. package/dist/cjs/react/components/message-bubble.d.ts +11 -0
  64. package/dist/cjs/react/components/message-bubble.js +171 -0
  65. package/dist/cjs/react/components/message-list.d.ts +8 -0
  66. package/dist/cjs/react/components/message-list.js +52 -0
  67. package/dist/cjs/react/components/pipeline-timeline.d.ts +7 -0
  68. package/dist/cjs/react/components/pipeline-timeline.js +72 -0
  69. package/dist/cjs/react/components/recording-bar.d.ts +2 -0
  70. package/dist/cjs/react/components/recording-bar.js +81 -0
  71. package/dist/cjs/react/components/recording-controls.d.ts +18 -0
  72. package/dist/cjs/react/components/recording-controls.js +38 -0
  73. package/dist/cjs/react/components/rich-mention-input.d.ts +2 -0
  74. package/dist/cjs/react/components/rich-mention-input.js +571 -0
  75. package/dist/cjs/react/components/session-switcher.d.ts +14 -0
  76. package/dist/cjs/react/components/session-switcher.js +133 -0
  77. package/dist/cjs/react/components/suggestion-bar.d.ts +9 -0
  78. package/dist/cjs/react/components/suggestion-bar.js +47 -0
  79. package/dist/cjs/react/components/suggestion-chip.d.ts +9 -0
  80. package/dist/cjs/react/components/suggestion-chip.js +14 -0
  81. package/dist/cjs/react/components/voice-input-addon.d.ts +13 -0
  82. package/dist/cjs/react/components/voice-input-addon.js +31 -0
  83. package/dist/cjs/react/components/voice-input-button.d.ts +2 -0
  84. package/dist/cjs/react/components/voice-input-button.js +55 -0
  85. package/dist/cjs/react/components/wavesurfer-loader.d.ts +5 -0
  86. package/dist/cjs/react/components/wavesurfer-loader.js +36 -0
  87. package/dist/cjs/react/hooks/use-ai-chat.d.ts +22 -0
  88. package/dist/cjs/react/hooks/use-ai-chat.js +51 -0
  89. package/dist/cjs/react/hooks/use-approvals.d.ts +23 -0
  90. package/dist/cjs/react/hooks/use-approvals.js +63 -0
  91. package/dist/cjs/react/hooks/use-deepgram-transcription.d.ts +2 -0
  92. package/dist/cjs/react/hooks/use-deepgram-transcription.js +329 -0
  93. package/dist/cjs/react/hooks/use-drag-resize-panel.d.ts +48 -0
  94. package/dist/cjs/react/hooks/use-drag-resize-panel.js +308 -0
  95. package/dist/cjs/react/hooks/use-draggable-position.d.ts +25 -0
  96. package/dist/cjs/react/hooks/use-draggable-position.js +134 -0
  97. package/dist/cjs/react/hooks/use-keyboard-shortcut.d.ts +20 -0
  98. package/dist/cjs/react/hooks/use-keyboard-shortcut.js +93 -0
  99. package/dist/cjs/react/hooks/use-mentions.d.ts +23 -0
  100. package/dist/cjs/react/hooks/use-mentions.js +42 -0
  101. package/dist/cjs/react/hooks/use-suggestions.d.ts +22 -0
  102. package/dist/cjs/react/hooks/use-suggestions.js +39 -0
  103. package/dist/cjs/react/index.d.ts +43 -0
  104. package/dist/cjs/react/index.js +111 -0
  105. package/dist/cjs/react/provider/ai-chat-provider.d.ts +45 -0
  106. package/dist/cjs/react/provider/ai-chat-provider.js +1024 -0
  107. package/dist/cjs/react/provider/chat-context.d.ts +84 -0
  108. package/dist/cjs/react/provider/chat-context.js +13 -0
  109. package/dist/cjs/react/template.d.ts +84 -0
  110. package/dist/cjs/react/template.js +90 -0
  111. package/dist/cjs/react/themes.d.ts +24 -0
  112. package/dist/cjs/react/themes.js +273 -0
  113. package/dist/cjs/react/transports/langgraph/index.d.ts +2 -0
  114. package/dist/cjs/react/transports/langgraph/index.js +8 -0
  115. package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.d.ts +62 -0
  116. package/dist/cjs/react/transports/langgraph/langgraph-ai-chat.js +94 -0
  117. package/dist/cjs/react/transports/langgraph.d.ts +71 -0
  118. package/dist/cjs/react/transports/langgraph.js +369 -0
  119. package/dist/cjs/react/transports/vercel/index.d.ts +2 -0
  120. package/dist/cjs/react/transports/vercel/index.js +8 -0
  121. package/dist/cjs/react/transports/vercel/vercel-ai-chat.d.ts +49 -0
  122. package/dist/cjs/react/transports/vercel/vercel-ai-chat.js +81 -0
  123. package/dist/cjs/react/transports/vercel.d.ts +30 -0
  124. package/dist/cjs/react/transports/vercel.js +69 -0
  125. package/dist/cjs/react/types.d.ts +760 -0
  126. package/dist/cjs/react/types.js +2 -0
  127. package/dist/cjs/react/ui.d.ts +73 -0
  128. package/dist/cjs/react/ui.js +183 -0
  129. package/dist/cjs/react/utils/create-approval-description.d.ts +53 -0
  130. package/dist/cjs/react/utils/create-approval-description.js +122 -0
  131. package/dist/cjs/react/utils/create-tool-result-handler.d.ts +90 -0
  132. package/dist/cjs/react/utils/create-tool-result-handler.js +168 -0
  133. package/dist/cjs/react/utils/mention-markup.d.ts +13 -0
  134. package/dist/cjs/react/utils/mention-markup.js +117 -0
  135. package/dist/cjs/react/utils/merge-pipeline-steps.d.ts +19 -0
  136. package/dist/cjs/react/utils/merge-pipeline-steps.js +81 -0
  137. package/dist/cjs/react/utils/sanitize-stored-messages.d.ts +23 -0
  138. package/dist/cjs/react/utils/sanitize-stored-messages.js +52 -0
  139. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.d.ts +10 -0
  140. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-auth.guard.js +42 -0
  141. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.d.ts +32 -0
  142. package/dist/cjs/server/adapters/nestjs/chat/ai-chat-module-options.interface.js +4 -0
  143. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.d.ts +11 -0
  144. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.controller.js +80 -0
  145. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.d.ts +9 -0
  146. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.module.js +119 -0
  147. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.d.ts +13 -0
  148. package/dist/cjs/server/adapters/nestjs/chat/ai-chat.service.js +131 -0
  149. package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.d.ts +7 -0
  150. package/dist/cjs/server/adapters/nestjs/chat/dto/ai-chat-request.dto.js +52 -0
  151. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.d.ts +19 -0
  152. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message-part.dto.js +108 -0
  153. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.d.ts +8 -0
  154. package/dist/cjs/server/adapters/nestjs/chat/dto/chat-message.dto.js +59 -0
  155. package/dist/cjs/server/adapters/nestjs/chat/dto/index.d.ts +3 -0
  156. package/dist/cjs/server/adapters/nestjs/chat/dto/index.js +9 -0
  157. package/dist/cjs/server/adapters/nestjs/chat/index.d.ts +3 -0
  158. package/dist/cjs/server/adapters/nestjs/chat/index.js +9 -0
  159. package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +4 -0
  160. package/dist/cjs/server/adapters/nestjs/chat/speech-stream.gateway.js +73 -0
  161. package/dist/cjs/server/adapters/nestjs/chat/ws-loader.d.ts +5 -0
  162. package/dist/cjs/server/adapters/nestjs/chat/ws-loader.js +72 -0
  163. package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.d.ts +6 -0
  164. package/dist/cjs/server/adapters/nestjs/decorators/ai-module.decorator.js +13 -0
  165. package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.d.ts +5 -0
  166. package/dist/cjs/server/adapters/nestjs/decorators/ai-param.decorator.js +15 -0
  167. package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.d.ts +6 -0
  168. package/dist/cjs/server/adapters/nestjs/decorators/ai-tool.decorator.js +22 -0
  169. package/dist/cjs/server/adapters/nestjs/decorators/constants.d.ts +4 -0
  170. package/dist/cjs/server/adapters/nestjs/decorators/constants.js +7 -0
  171. package/dist/cjs/server/adapters/nestjs/index.d.ts +14 -0
  172. package/dist/cjs/server/adapters/nestjs/index.js +42 -0
  173. package/dist/cjs/server/adapters/nestjs/metadata.d.ts +39 -0
  174. package/dist/cjs/server/adapters/nestjs/metadata.js +36 -0
  175. package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.d.ts +36 -0
  176. package/dist/cjs/server/adapters/nestjs/module/ai-tools-explorer.service.js +159 -0
  177. package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.d.ts +37 -0
  178. package/dist/cjs/server/adapters/nestjs/module/ai-tools.module.js +44 -0
  179. package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.d.ts +28 -0
  180. package/dist/cjs/server/adapters/nestjs/module/ai-tools.service.js +41 -0
  181. package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.d.ts +16 -0
  182. package/dist/cjs/server/adapters/nestjs/scanner/nestjs-scanner.js +117 -0
  183. package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.d.ts +26 -0
  184. package/dist/cjs/server/adapters/nestjs/scanner/schema-builder.js +259 -0
  185. package/dist/cjs/server/adapters/nestjs/swagger.d.ts +7 -0
  186. package/dist/cjs/server/adapters/nestjs/swagger.js +39 -0
  187. package/dist/cjs/server/adapters/nextjs/context-helpers.d.ts +22 -0
  188. package/dist/cjs/server/adapters/nextjs/context-helpers.js +60 -0
  189. package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.d.ts +94 -0
  190. package/dist/cjs/server/adapters/nextjs/create-ai-chat-handler.js +965 -0
  191. package/dist/cjs/server/adapters/nextjs/filter-fallback-error.d.ts +11 -0
  192. package/dist/cjs/server/adapters/nextjs/filter-fallback-error.js +41 -0
  193. package/dist/cjs/server/adapters/nextjs/index.d.ts +8 -0
  194. package/dist/cjs/server/adapters/nextjs/index.js +22 -0
  195. package/dist/cjs/server/adapters/nextjs/prepare-model-messages.d.ts +58 -0
  196. package/dist/cjs/server/adapters/nextjs/prepare-model-messages.js +114 -0
  197. package/dist/cjs/server/adapters/nextjs/sanitize-model-messages.d.ts +64 -0
  198. package/dist/cjs/server/adapters/nextjs/sanitize-model-messages.js +489 -0
  199. package/dist/cjs/server/adapters/nextjs/server-action-helper.d.ts +7 -0
  200. package/dist/cjs/server/adapters/nextjs/server-action-helper.js +40 -0
  201. package/dist/cjs/server/adapters/nextjs/types.d.ts +246 -0
  202. package/dist/cjs/server/adapters/nextjs/types.js +2 -0
  203. package/dist/cjs/server/adapters/nextjs/with-ai-tool.d.ts +9 -0
  204. package/dist/cjs/server/adapters/nextjs/with-ai-tool.js +12 -0
  205. package/dist/cjs/server/core/followup-tool.d.ts +9 -0
  206. package/dist/cjs/server/core/followup-tool.js +82 -0
  207. package/dist/cjs/server/core/index.d.ts +139 -0
  208. package/dist/cjs/server/core/index.js +818 -0
  209. package/dist/cjs/server/core/intent-classifier.d.ts +94 -0
  210. package/dist/cjs/server/core/intent-classifier.js +324 -0
  211. package/dist/cjs/server/core/model-selector.d.ts +12 -0
  212. package/dist/cjs/server/core/model-selector.js +48 -0
  213. package/dist/cjs/server/core/module-router.d.ts +14 -0
  214. package/dist/cjs/server/core/module-router.js +110 -0
  215. package/dist/cjs/server/core/zod-compact.d.ts +18 -0
  216. package/dist/cjs/server/core/zod-compact.js +129 -0
  217. package/dist/cjs/server/index.d.ts +6 -0
  218. package/dist/cjs/server/index.js +28 -0
  219. package/dist/cjs/server/lancer/cache.d.ts +9 -0
  220. package/dist/cjs/server/lancer/cache.js +33 -0
  221. package/dist/cjs/server/lancer/client.d.ts +2 -0
  222. package/dist/cjs/server/lancer/client.js +279 -0
  223. package/dist/cjs/server/lancer/errors.d.ts +13 -0
  224. package/dist/cjs/server/lancer/errors.js +21 -0
  225. package/dist/cjs/server/lancer/index.d.ts +3 -0
  226. package/dist/cjs/server/lancer/index.js +7 -0
  227. package/dist/cjs/server/lancer/telemetry-buffer.d.ts +15 -0
  228. package/dist/cjs/server/lancer/telemetry-buffer.js +64 -0
  229. package/dist/cjs/server/lancer/types.d.ts +201 -0
  230. package/dist/cjs/server/lancer/types.js +5 -0
  231. package/dist/cjs/server/pii-shield/aegis-detector.d.ts +26 -0
  232. package/dist/cjs/server/pii-shield/aegis-detector.js +26 -0
  233. package/dist/cjs/server/pii-shield/create-pii-shield.d.ts +2 -0
  234. package/dist/cjs/server/pii-shield/create-pii-shield.js +191 -0
  235. package/dist/cjs/server/pii-shield/deep-walk.d.ts +1 -0
  236. package/dist/cjs/server/pii-shield/deep-walk.js +19 -0
  237. package/dist/cjs/server/pii-shield/fake-data.d.ts +5 -0
  238. package/dist/cjs/server/pii-shield/fake-data.js +170 -0
  239. package/dist/cjs/server/pii-shield/index.d.ts +4 -0
  240. package/dist/cjs/server/pii-shield/index.js +9 -0
  241. package/dist/cjs/server/pii-shield/leakage.d.ts +1 -0
  242. package/dist/cjs/server/pii-shield/leakage.js +15 -0
  243. package/dist/cjs/server/pii-shield/session-mapping.d.ts +12 -0
  244. package/dist/cjs/server/pii-shield/session-mapping.js +70 -0
  245. package/dist/cjs/server/pipeline.d.ts +26 -0
  246. package/dist/cjs/server/pipeline.js +127 -0
  247. package/dist/cjs/server/testing/approvals.d.ts +11 -0
  248. package/dist/cjs/server/testing/approvals.js +41 -0
  249. package/dist/cjs/server/testing/combination.d.ts +3 -0
  250. package/dist/cjs/server/testing/combination.js +83 -0
  251. package/dist/cjs/server/testing/create-test-suite.d.ts +29 -0
  252. package/dist/cjs/server/testing/create-test-suite.js +81 -0
  253. package/dist/cjs/server/testing/edge-cases.d.ts +8 -0
  254. package/dist/cjs/server/testing/edge-cases.js +277 -0
  255. package/dist/cjs/server/testing/guardrails.d.ts +14 -0
  256. package/dist/cjs/server/testing/guardrails.js +152 -0
  257. package/dist/cjs/server/testing/helpers.d.ts +14 -0
  258. package/dist/cjs/server/testing/helpers.js +119 -0
  259. package/dist/cjs/server/testing/index.d.ts +12 -0
  260. package/dist/cjs/server/testing/index.js +37 -0
  261. package/dist/cjs/server/testing/mock-executor.d.ts +8 -0
  262. package/dist/cjs/server/testing/mock-executor.js +40 -0
  263. package/dist/cjs/server/testing/regression.d.ts +7 -0
  264. package/dist/cjs/server/testing/regression.js +27 -0
  265. package/dist/cjs/server/testing/routing.d.ts +12 -0
  266. package/dist/cjs/server/testing/routing.js +63 -0
  267. package/dist/cjs/server/testing/schema-consistency.d.ts +6 -0
  268. package/dist/cjs/server/testing/schema-consistency.js +56 -0
  269. package/dist/cjs/server/testing/smoke.d.ts +11 -0
  270. package/dist/cjs/server/testing/smoke.js +64 -0
  271. package/dist/cjs/server/testing/types.d.ts +156 -0
  272. package/dist/cjs/server/testing/types.js +2 -0
  273. package/dist/cjs/types.d.ts +696 -0
  274. package/dist/cjs/types.js +91 -0
  275. package/dist/cli/commands/install-skills.d.ts +17 -0
  276. package/dist/cli/commands/install-skills.js +185 -0
  277. package/dist/cli/commands/install-skills.js.map +1 -0
  278. package/dist/cli/index.js +25 -0
  279. package/dist/cli/index.js.map +1 -1
  280. package/dist/react/components/ai-trigger-button.js +4 -6
  281. package/dist/react/components/ai-trigger-button.js.map +1 -1
  282. package/dist/react/components/recording-bar.js +4 -6
  283. package/dist/react/components/recording-bar.js.map +1 -1
  284. package/dist/react/components/wavesurfer-loader.d.ts +5 -0
  285. package/dist/react/components/wavesurfer-loader.js +34 -0
  286. package/dist/react/components/wavesurfer-loader.js.map +1 -0
  287. package/dist/server/adapters/nestjs/chat/ai-chat.module.d.ts +1 -1
  288. package/dist/server/adapters/nestjs/chat/ai-chat.module.js +3 -2
  289. package/dist/server/adapters/nestjs/chat/ai-chat.module.js.map +1 -1
  290. package/dist/server/adapters/nestjs/chat/speech-stream.gateway.d.ts +1 -1
  291. package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js +10 -8
  292. package/dist/server/adapters/nestjs/chat/speech-stream.gateway.js.map +1 -1
  293. package/dist/server/adapters/nestjs/chat/ws-loader.d.ts +5 -0
  294. package/dist/server/adapters/nestjs/chat/ws-loader.js +37 -0
  295. package/dist/server/adapters/nestjs/chat/ws-loader.js.map +1 -0
  296. package/openapi/package.json +5 -0
  297. package/package.json +59 -16
  298. package/react/langgraph/package.json +5 -0
  299. package/react/package.json +5 -0
  300. package/react/vercel/package.json +5 -0
  301. package/server/nestjs/package.json +5 -0
  302. package/server/nextjs/package.json +5 -0
  303. package/server/package.json +5 -0
  304. package/server/testing/package.json +5 -0
  305. package/skills/README.md +107 -0
  306. package/skills/building-glirastes-chat-ui/SKILL.md +378 -0
  307. package/skills/integrating-glirastes-nestjs/SKILL.md +346 -0
  308. package/skills/integrating-glirastes-nextjs/SKILL.md +306 -0
  309. package/skills/integrating-glirastes-nextjs-with-nestjs-backend/SKILL.md +359 -0
  310. package/skills/maintaining-glirastes-tools/SKILL.md +463 -0
package/CHANGELOG.md CHANGED
@@ -7,6 +7,69 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.3.1] - 2026-04-28
11
+
12
+ ### Added
13
+
14
+ - Dual-bundle output (CJS + ESM). The package now ships a CommonJS build at
15
+ `dist/cjs/` alongside the ESM build at `dist/`, so legacy NestJS backends
16
+ on `module: commonjs` can consume `glirastes/server/nestjs` without an ESM
17
+ migration. The `exports` map uses conditional `import`/`require` branches
18
+ with their own typings.
19
+ - Legacy subpath shim directories at the package root (`server/`, `react/`,
20
+ `codegen/`, `openapi/`) so consumers on `moduleResolution: node` (without
21
+ `exports`-map support) still resolve subpaths.
22
+ - Pre-built agent skills under `skills/` (shipped in the npm tarball):
23
+ `integrating-glirastes-nextjs`, `integrating-glirastes-nestjs`,
24
+ `integrating-glirastes-nextjs-with-nestjs-backend`,
25
+ `maintaining-glirastes-tools`, `building-glirastes-chat-ui`. Drop into
26
+ `.claude/skills/` (or `.codex/skills/`) to give a coding agent
27
+ framework-specific guidance for integrating, maintaining, and customizing
28
+ the SDK.
29
+ - New CLI command `glirastes install-skills` — installs the bundled agent
30
+ skills into a target directory. Flags:
31
+ - default: `./.claude/skills` (project-local)
32
+ - `-g` / `--global`: `~/.claude/skills` (shared across all projects on the
33
+ machine; mutually exclusive with `--target`)
34
+ - `--target <dir>`: override the destination (accepts relative, absolute,
35
+ or `~/`-prefixed paths)
36
+ - `--stack nextjs|nestjs|nextjs+nestjs|all` (default `all`): filter
37
+ - `--symlink`: track the installed SDK version automatically
38
+ - `--force`: overwrite existing
39
+ - `--dry-run`: preview without writing
40
+ - Adapter-selection guidance in the README: when both a frontend and a
41
+ separate backend exist, put the chat route on the backend.
42
+ - Scaling-up section in the README explaining the `glirastes scaffold` →
43
+ `generate-tools` → registry-import codegen workflow.
44
+
45
+ ### Changed
46
+
47
+ - `@ai-sdk/react` and `react-markdown` moved from `dependencies` to optional
48
+ `peerDependencies`. Backend-only consumers no longer pull a phantom React
49
+ tree into `node_modules`. Frontend consumers must install them themselves
50
+ (the README install section is split per stack).
51
+ - `dependencies.zod` bumped to `^3.25.76` to match what `ai@6` and
52
+ `@ai-sdk/openai` require.
53
+ - `AiChatModule.attachWebSockets()` is now `async`. Consumers that enable
54
+ the speech-to-text feature must `await` the call.
55
+
56
+ ### Fixed
57
+
58
+ - Optional peer `wavesurfer.js` is now truly optional. The voice
59
+ components load it via a runtime `Function('s', 'return import(s)')`
60
+ helper so browser-side bundlers (Webpack, Turbopack, Vite, esbuild)
61
+ don't try to resolve the specifier at build time when the package is
62
+ not installed. Note: requires `script-src 'unsafe-eval'` CSP — projects
63
+ with strict CSP should install `wavesurfer.js` unconditionally to
64
+ bypass the runtime trick. See `skills/building-glirastes-chat-ui` for
65
+ details.
66
+ - Optional peer `ws` is now truly optional. The NestJS speech-to-text
67
+ gateway uses a plain dynamic `import('ws')` inside `attachWebSockets`,
68
+ guarded by try/catch — backends that don't enable speech-to-text no
69
+ longer crash with `ERR_MODULE_NOT_FOUND` at startup. (Bundled NestJS
70
+ deployments must either install `ws` unconditionally or mark it as a
71
+ bundler external.)
72
+
10
73
  ## [0.3.0] - 2026-04-28
11
74
 
12
75
  ### Fixed
package/README.md CHANGED
@@ -10,11 +10,13 @@
10
10
  </p>
11
11
 
12
12
  <p align="center">
13
- <a href="#quick-start"><strong>Quick Start</strong></a> ·
13
+ <a href="#quick-start-nextjs-or-nestjs"><strong>Quick Start</strong></a> ·
14
14
  <a href="#core-concepts"><strong>Concepts</strong></a> ·
15
15
  <a href="#examples"><strong>Examples</strong></a> ·
16
16
  <a href="#advanced"><strong>Advanced</strong></a> ·
17
- <a href="#cli"><strong>CLI</strong></a>
17
+ <a href="#scaling-up--codegen-workflow"><strong>Scaling up</strong></a> ·
18
+ <a href="#cli"><strong>CLI</strong></a> ·
19
+ <a href="#agent-skills"><strong>Skills</strong></a>
18
20
  </p>
19
21
 
20
22
  <p align="center">
@@ -85,17 +87,42 @@ Building an AI feature means wiring together **tool definitions**, **API calls**
85
87
 
86
88
  ## Quick Start ([Next.js](https://nextjs.org/) or [NestJS](https://nestjs.com/))
87
89
 
90
+ ### Which adapter should I use?
91
+
92
+ If you only have one server, the answer is "that one". If you have **both** a Next.js frontend *and* a separate backend (NestJS, Express, …), put the chat route on the **backend**:
93
+
94
+ | Setup | Use this adapter |
95
+ |---|---|
96
+ | Next.js full-stack (no separate backend) | `glirastes/server/nextjs` |
97
+ | Next.js frontend + NestJS backend | `glirastes/server/nestjs` ✅ |
98
+ | Pure NestJS (Swagger UI as client) | `glirastes/server/nestjs` |
99
+ | Express backend + any frontend | `glirastes/server` (manual wiring) |
100
+
101
+ **Why prefer the real backend over a Next.js Route Handler?**
102
+
103
+ - **Tools are annotated controllers.** Your existing endpoints become AI-callable in place — no second code path, no `defineEndpointTool` mirroring controller URLs.
104
+ - **One auth source.** Your JWT guard / tenant context already runs there. Don't re-validate tokens in a Next.js route just to forward them.
105
+ - **No extra HTTP hop.** Browser → backend → DB instead of Browser → Next.js → backend → DB on every tool call.
106
+ - **Tools can call services directly.** No HTTP membrane between the AI tool and your business logic.
107
+ - **One observability pipeline.** Logs, traces, rate limits where they already live.
108
+
109
+ The Next.js Route Handler is right when Next.js *is* your backend, when you're prototyping, or when every tool is an external API call anyway.
110
+
88
111
  Pick your stack — both come up in the same four steps.
89
112
 
90
113
  ### 1. Install
91
114
 
92
115
  ```bash
116
+ # Backend only (NestJS / Next.js Route Handlers)
93
117
  npm install glirastes
118
+
119
+ # Frontend / chat UI consumers — add the React UI peers
120
+ npm install glirastes @ai-sdk/react react-markdown
94
121
  ```
95
122
 
96
- That's it. The Vercel AI SDK (`ai`), React bindings (`@ai-sdk/react`), and Markdown rendering (`react-markdown`) come included so you can copy-paste any example below. Bundlers tree-shake whatever you don't import.
123
+ The Vercel AI SDK (`ai`) is bundled. `@ai-sdk/react` and `react-markdown` are declared as **optional peer dependencies** so backend-only consumers don't have a phantom React tree in their `node_modules`. Install them yourself when you use any `glirastes/react/*` subpath.
97
124
 
98
- > **Requirements:** Node.js `>=20`. The React chat UI needs `react` and `react-dom` `^19` — Next.js apps already have these, and modern npm/bun auto-installs them otherwise.
125
+ > **Requirements:** Node.js `>=20`. The React chat UI needs `react` and `react-dom` `^19` — Next.js apps already have these.
99
126
  >
100
127
  > **Optional** — only if you want voice input with a live waveform:
101
128
  > ```bash
@@ -221,9 +248,11 @@ Done. AI chat is live, streaming, and your `list_tasks` tool is callable. Add mo
221
248
 
222
249
  ### Setup notes
223
250
 
224
- #### Recommended `tsconfig.json` for consumers
251
+ #### tsconfig — modern is best, legacy still works
225
252
 
226
- Glirastes ships ESM with subpath `exports`. Your tsconfig must support that:
253
+ Glirastes ships **both** ESM (`dist/`) and CommonJS (`dist/cjs/`) with a conditional `exports` map, plus subpath shim directories at the package root for legacy resolvers. Both setups below are supported:
254
+
255
+ **Modern (recommended):**
227
256
 
228
257
  ```jsonc
229
258
  {
@@ -238,9 +267,7 @@ Glirastes ships ESM with subpath `exports`. Your tsconfig must support that:
238
267
  }
239
268
  ```
240
269
 
241
- If you see `Cannot find module 'glirastes/server/nestjs'`, your `moduleResolution` is too old (legacy `"node"` does not understand `exports` maps).
242
-
243
- > **NestJS users on the default CommonJS template:** glirastes is published as ESM only. If your backend's `tsconfig` is `"module": "commonjs"`, you'll hit `TS1479: ECMAScript module cannot be imported with require`. Migrate the backend to `module: "node16"` / `"nodenext"` or follow https://github.com/chainmatics/glirastes/issues for dual-bundle progress.
270
+ **Legacy NestJS template (default `module: commonjs`):** works as-is — no tsconfig changes required. The shim directories under `glirastes/server/`, `glirastes/react/` etc. let the classic Node resolver find each subpath, and the CommonJS build under `dist/cjs/` provides the runtime artifacts.
244
271
 
245
272
  #### Which subpath do I import from?
246
273
 
@@ -745,6 +772,65 @@ The voice button streams audio to your backend, which proxies it to a speech-to-
745
772
 
746
773
  <br/>
747
774
 
775
+ ## Scaling up — codegen workflow
776
+
777
+ Hand-importing 50 tool definitions into your chat route doesn't scale. The CLI generates a registry from co-located `*.ai-tool.ts` files so you can stay co-located while still wiring everything centrally.
778
+
779
+ ### 1. Bootstrap a tool from an existing route
780
+
781
+ ```bash
782
+ npx glirastes scaffold --route src/app/api/tasks/route.ts
783
+ # --dry-run to preview, --force to overwrite
784
+ ```
785
+
786
+ Produces `src/app/api/tasks/ai-tool.ts` with a starter `defineEndpointTool({ ... })` call — input schema derived from your route, TODO description, sensible defaults. Edit, save.
787
+
788
+ ### 2. Wire the codegen into your scripts
789
+
790
+ ```json
791
+ {
792
+ "scripts": {
793
+ "predev": "glirastes generate-tools --quiet",
794
+ "prebuild": "glirastes generate-tools --quiet",
795
+ "ai:scaffold": "glirastes scaffold",
796
+ "ai:coverage": "glirastes coverage",
797
+ "ai:coverage:ci": "glirastes coverage --ci",
798
+ "ai:validate": "glirastes validate-tools",
799
+ "ai:validate:ci": "glirastes validate-tools --ci",
800
+ "ai:test": "glirastes test"
801
+ }
802
+ }
803
+ ```
804
+
805
+ `predev` / `prebuild` regenerate `src/generated/ai-tools/{endpoint,ui,modules,action-ids}.generated.ts` on every dev start and CI build — the generated registry becomes source-of-truth.
806
+
807
+ ### 3. Import the registry in your chat route
808
+
809
+ ```ts
810
+ // app/api/chat/route.ts (Next.js)
811
+ import { createAiChatHandler } from 'glirastes/server/nextjs';
812
+ import { endpointToolRegistry } from '@/generated/ai-tools/endpoint.generated';
813
+ import { uiToolRegistry } from '@/generated/ai-tools/ui.generated';
814
+
815
+ export const POST = createAiChatHandler({
816
+ tools: { ...endpointToolRegistry, ...uiToolRegistry },
817
+ model: openai('gpt-4o-mini'),
818
+ });
819
+ ```
820
+
821
+ NestJS users skip this entire workflow: `scanNestJsControllers` reads your `@AiTool`-decorated controllers at runtime. No co-located files, no `*.generated.ts`. See [NestJS with decorators](#nestjs-with-decorators).
822
+
823
+ ### 4. CI gates
824
+
825
+ ```bash
826
+ npm run ai:coverage:ci # fails if any route lacks an ai-tool.ts (or has an orphan handler)
827
+ npm run ai:validate:ci # fails if a tool definition is malformed or path-mismatched
828
+ ```
829
+
830
+ For the full deep-dive — UI patterns, intent modules, approval flow, naming conventions, deterministic testing — drop the [`maintaining-glirastes-tools`](./skills/maintaining-glirastes-tools/SKILL.md) skill into your agent. See [Agent skills](#agent-skills) below.
831
+
832
+ <br/>
833
+
748
834
  ## CLI
749
835
 
750
836
  The SDK includes a `glirastes` CLI for scaffolding, code generation, and validation. Run any command with `npx glirastes <command>` or `bunx glirastes <command>`:
@@ -759,6 +845,7 @@ The SDK includes a `glirastes` CLI for scaffolding, code generation, and validat
759
845
  | `generate-skills` | Export tools as Claude Code / Codex skill files |
760
846
  | `generate-mcp-server` | Export tools as a standalone MCP server project |
761
847
  | `generate-auto` | Auto-detect layout and run the right generator |
848
+ | `install-skills` | Install the bundled agent skills under `skills/` into your repo (e.g. `.claude/skills/`) |
762
849
  | `validate` | Validate OpenAPI spec for `x-ai` correctness |
763
850
  | `validate-tools` | Validate AI tool configuration |
764
851
  | `coverage` | Report which API routes have AI tools and which don't |
@@ -769,6 +856,56 @@ The SDK includes a `glirastes` CLI for scaffolding, code generation, and validat
769
856
 
770
857
  <br/>
771
858
 
859
+ ## Agent skills
860
+
861
+ Glirastes ships pre-built [agent skills](https://docs.claude.com/en/docs/claude-code/skills) under [`skills/`](./skills) that teach a coding agent (Claude Code, Codex, Cursor, …) how to integrate, maintain, and customize the SDK. Drop them into your repo and the agent picks the right one automatically.
862
+
863
+ | Skill | Use when |
864
+ |---|---|
865
+ | [`integrating-glirastes-nextjs`](./skills/integrating-glirastes-nextjs/SKILL.md) | Adding chat to a Next.js app where Next.js is the backend |
866
+ | [`integrating-glirastes-nestjs`](./skills/integrating-glirastes-nestjs/SKILL.md) | Adding chat to a NestJS backend (with or without a frontend) |
867
+ | [`integrating-glirastes-nextjs-with-nestjs-backend`](./skills/integrating-glirastes-nextjs-with-nestjs-backend/SKILL.md) | Full-stack setup: Next.js frontend + separate NestJS backend |
868
+ | [`maintaining-glirastes-tools`](./skills/maintaining-glirastes-tools/SKILL.md) | Authoring `ai-tool.ts`, intent modules, codegen, all CLI commands |
869
+ | [`building-glirastes-chat-ui`](./skills/building-glirastes-chat-ui/SKILL.md) | Customizing the chat UI — theming, mentions, voice input, action bus |
870
+
871
+ ### Install via the bundled CLI
872
+
873
+ After `npm install glirastes`, run the bundled installer. Two scopes:
874
+
875
+ - **Project-local** (default): writes to `./.claude/skills`. Each project gets the skills tied to its own installed `glirastes` version. Best for teams checking the directory into git.
876
+ - **Global** (`-g`): writes to `~/.claude/skills`. Shared across every project on the machine. Best for solo work across multiple Glirastes projects.
877
+
878
+ ```bash
879
+ # Project-local — installs into ./.claude/skills (default)
880
+ npx glirastes install-skills
881
+
882
+ # Global — installs into ~/.claude/skills (shared across all projects on this machine)
883
+ npx glirastes install-skills -g
884
+
885
+ # Only the skills relevant to your stack
886
+ npx glirastes install-skills --stack nextjs # Next.js standalone
887
+ npx glirastes install-skills --stack nestjs # NestJS standalone
888
+ npx glirastes install-skills --stack nextjs+nestjs # full-stack monorepo
889
+
890
+ # Different agent? Pass --target
891
+ npx glirastes install-skills --target .codex/skills
892
+
893
+ # Auto-update with the SDK on every npm install
894
+ npx glirastes install-skills --symlink
895
+
896
+ # Preview without writing
897
+ npx glirastes install-skills --dry-run
898
+
899
+ # Overwrite previously installed skills
900
+ npx glirastes install-skills --force
901
+ ```
902
+
903
+ `install-skills` reads the bundled skills under `node_modules/glirastes/skills/` and writes them to your repo. The `--symlink` mode keeps them auto-fresh — bumping `glirastes` and rerunning `npm install` updates the skill content without re-running the installer.
904
+
905
+ > **`generate-skills` (CLI command) ≠ these skills.** `generate-skills` exports *your tools* as skill files so external agents can call them. The skills under `skills/` instruct an agent on how to *integrate Glirastes itself*. Both ship in the npm package; they don't conflict.
906
+
907
+ <br/>
908
+
772
909
  ## License
773
910
 
774
911
  Licensed under the [Apache License, Version 2.0](./LICENSE). You may use, modify, and distribute this SDK freely in commercial and non-commercial projects.
@@ -0,0 +1,5 @@
1
+ {
2
+ "main": "../dist/cjs/codegen/index.js",
3
+ "module": "../dist/codegen/index.js",
4
+ "types": "../dist/codegen/index.d.ts"
5
+ }
@@ -0,0 +1,20 @@
1
+ export interface AssetSyncOptions {
2
+ apiKey: string;
3
+ glirasterUrl: string;
4
+ name: string;
5
+ type: 'skill' | 'mcp-server';
6
+ version: string;
7
+ toolCount: number;
8
+ config: Record<string, unknown>;
9
+ toolManifest: Record<string, unknown>;
10
+ /** Pre-generated files to upload alongside the manifest */
11
+ generatedFiles?: Array<{
12
+ path: string;
13
+ content: string;
14
+ }>;
15
+ }
16
+ export interface AssetSyncResult {
17
+ action: 'created' | 'updated';
18
+ assetId: string;
19
+ }
20
+ export declare function syncAssetToGlirastes(options: AssetSyncOptions): Promise<AssetSyncResult>;
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.syncAssetToGlirastes = syncAssetToGlirastes;
4
+ async function syncAssetToGlirastes(options) {
5
+ const url = `${options.glirasterUrl}/v1/registry/assets/sync`;
6
+ const response = await fetch(url, {
7
+ method: 'POST',
8
+ headers: {
9
+ 'Content-Type': 'application/json',
10
+ 'x-api-key': options.apiKey,
11
+ },
12
+ body: JSON.stringify({
13
+ name: options.name,
14
+ type: options.type,
15
+ version: options.version,
16
+ toolCount: options.toolCount,
17
+ config: options.config,
18
+ toolManifest: options.toolManifest,
19
+ generatedFiles: options.generatedFiles,
20
+ }),
21
+ });
22
+ if (!response.ok) {
23
+ const text = await response.text();
24
+ throw new Error(`Glirastes sync failed (${response.status}): ${text}`);
25
+ }
26
+ const data = await response.json();
27
+ return { action: data.action, assetId: data.asset.id };
28
+ }
@@ -0,0 +1,66 @@
1
+ import type { GenerateOptions } from './types.js';
2
+ export interface CoverageReport {
3
+ endpointToolCount: number;
4
+ endpointFileCount: number;
5
+ uiToolCount: number;
6
+ uiFileCount: number;
7
+ actionIdCount: number;
8
+ routeTotal: number;
9
+ routeCovered: number;
10
+ routeIgnored: number;
11
+ routeCoveragePercent: number;
12
+ componentDirTotal: number;
13
+ componentDirCovered: number;
14
+ componentDirIgnored: number;
15
+ componentCoveragePercent: number;
16
+ sharedWithConfigs: Array<{
17
+ toolName: string;
18
+ primaryModule: string;
19
+ sharedWith: string[];
20
+ }>;
21
+ /** Handler coverage: how many actionIds have registered handlers in source */
22
+ handlerActionIds: string[];
23
+ handlerCoveredCount: number;
24
+ handlerTotalCount: number;
25
+ handlerCoveragePercent: number;
26
+ /** Orphan handlers: useAiClientAction calls without a matching UI tool actionId */
27
+ orphanHandlers: Array<{
28
+ actionId: string;
29
+ sourceFile: string;
30
+ }>;
31
+ /** Routes without a corresponding ai-tool.ts (relative paths) */
32
+ uncoveredRoutes: string[];
33
+ /** Component directories without ai-ui-tool.ts (relative paths) */
34
+ uncoveredComponents: string[];
35
+ /** Action IDs that have no registered useAiClientAction handler */
36
+ missingHandlers: Array<{
37
+ actionId: string;
38
+ toolName: string;
39
+ sourceFile: string;
40
+ }>;
41
+ /** NestJS controller coverage */
42
+ nestControllerTotal: number;
43
+ nestControllerCovered: number;
44
+ nestControllerIgnored: number;
45
+ nestControllerCoveragePercent: number;
46
+ /** Number of @AiTool-decorated methods found across NestJS controllers */
47
+ nestToolCount: number;
48
+ /** NestJS controllers found without @AiTool decorators (not ignored) */
49
+ uncoveredNestControllers: Array<{
50
+ controllerFile: string;
51
+ controllerName: string;
52
+ httpMethodCount: number;
53
+ }>;
54
+ }
55
+ /**
56
+ * Check AI tool coverage across the project.
57
+ * Reports on endpoint tools, UI tools, route coverage,
58
+ * component coverage, and sharedWith configurations.
59
+ */
60
+ export declare function checkAiCoverage(options: GenerateOptions): Promise<CoverageReport>;
61
+ /**
62
+ * Format a coverage report as a rich, color-coded human-readable string.
63
+ */
64
+ export declare function formatCoverageReport(report: CoverageReport, options?: {
65
+ quiet?: boolean;
66
+ }): string;