@soederpop/luca 0.1.2 → 0.1.3

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 (366) hide show
  1. package/CLAUDE.md +2 -0
  2. package/assistants/codingAssistant/hooks.ts +1 -5
  3. package/assistants/inkbot/CORE.md +69 -0
  4. package/assistants/inkbot/hooks.ts +14 -0
  5. package/assistants/inkbot/tools.ts +47 -0
  6. package/commands/inkbot.ts +353 -0
  7. package/dist/agi/container.server.d.ts +63 -0
  8. package/dist/agi/container.server.d.ts.map +1 -0
  9. package/dist/agi/endpoints/ask.d.ts +20 -0
  10. package/dist/agi/endpoints/ask.d.ts.map +1 -0
  11. package/dist/agi/endpoints/conversations/[id].d.ts +27 -0
  12. package/dist/agi/endpoints/conversations/[id].d.ts.map +1 -0
  13. package/dist/agi/endpoints/conversations.d.ts +18 -0
  14. package/dist/agi/endpoints/conversations.d.ts.map +1 -0
  15. package/dist/agi/endpoints/experts.d.ts +8 -0
  16. package/dist/agi/endpoints/experts.d.ts.map +1 -0
  17. package/dist/agi/feature.d.ts +9 -0
  18. package/dist/agi/feature.d.ts.map +1 -0
  19. package/dist/agi/features/assistant.d.ts +509 -0
  20. package/dist/agi/features/assistant.d.ts.map +1 -0
  21. package/dist/agi/features/assistants-manager.d.ts +236 -0
  22. package/dist/agi/features/assistants-manager.d.ts.map +1 -0
  23. package/dist/agi/features/autonomous-assistant.d.ts +281 -0
  24. package/dist/agi/features/autonomous-assistant.d.ts.map +1 -0
  25. package/dist/agi/features/browser-use.d.ts +479 -0
  26. package/dist/agi/features/browser-use.d.ts.map +1 -0
  27. package/dist/agi/features/claude-code.d.ts +824 -0
  28. package/dist/agi/features/claude-code.d.ts.map +1 -0
  29. package/dist/agi/features/conversation-history.d.ts +245 -0
  30. package/dist/agi/features/conversation-history.d.ts.map +1 -0
  31. package/dist/agi/features/conversation.d.ts +464 -0
  32. package/dist/agi/features/conversation.d.ts.map +1 -0
  33. package/dist/agi/features/docs-reader.d.ts +72 -0
  34. package/dist/agi/features/docs-reader.d.ts.map +1 -0
  35. package/dist/agi/features/file-tools.d.ts +110 -0
  36. package/dist/agi/features/file-tools.d.ts.map +1 -0
  37. package/dist/agi/features/luca-coder.d.ts +323 -0
  38. package/dist/agi/features/luca-coder.d.ts.map +1 -0
  39. package/dist/agi/features/openai-codex.d.ts +381 -0
  40. package/dist/agi/features/openai-codex.d.ts.map +1 -0
  41. package/dist/agi/features/openapi.d.ts +200 -0
  42. package/dist/agi/features/openapi.d.ts.map +1 -0
  43. package/dist/agi/features/skills-library.d.ts +167 -0
  44. package/dist/agi/features/skills-library.d.ts.map +1 -0
  45. package/dist/agi/index.d.ts +5 -0
  46. package/dist/agi/index.d.ts.map +1 -0
  47. package/dist/agi/lib/interceptor-chain.d.ts +44 -0
  48. package/dist/agi/lib/interceptor-chain.d.ts.map +1 -0
  49. package/dist/agi/lib/token-counter.d.ts +13 -0
  50. package/dist/agi/lib/token-counter.d.ts.map +1 -0
  51. package/dist/bootstrap/generated.d.ts +5 -0
  52. package/dist/bootstrap/generated.d.ts.map +1 -0
  53. package/dist/browser.d.ts +12 -0
  54. package/dist/browser.d.ts.map +1 -0
  55. package/dist/bus.d.ts +29 -0
  56. package/dist/bus.d.ts.map +1 -0
  57. package/dist/cli/build-info.d.ts +4 -0
  58. package/dist/cli/build-info.d.ts.map +1 -0
  59. package/dist/cli/cli.d.ts +3 -0
  60. package/dist/cli/cli.d.ts.map +1 -0
  61. package/dist/client.d.ts +60 -0
  62. package/dist/client.d.ts.map +1 -0
  63. package/dist/clients/civitai/index.d.ts +472 -0
  64. package/dist/clients/civitai/index.d.ts.map +1 -0
  65. package/dist/clients/client-template.d.ts +30 -0
  66. package/dist/clients/client-template.d.ts.map +1 -0
  67. package/dist/clients/comfyui/index.d.ts +281 -0
  68. package/dist/clients/comfyui/index.d.ts.map +1 -0
  69. package/dist/clients/elevenlabs/index.d.ts +197 -0
  70. package/dist/clients/elevenlabs/index.d.ts.map +1 -0
  71. package/dist/clients/graph.d.ts +64 -0
  72. package/dist/clients/graph.d.ts.map +1 -0
  73. package/dist/clients/openai/index.d.ts +247 -0
  74. package/dist/clients/openai/index.d.ts.map +1 -0
  75. package/dist/clients/rest.d.ts +92 -0
  76. package/dist/clients/rest.d.ts.map +1 -0
  77. package/dist/clients/supabase/index.d.ts +176 -0
  78. package/dist/clients/supabase/index.d.ts.map +1 -0
  79. package/dist/clients/websocket.d.ts +127 -0
  80. package/dist/clients/websocket.d.ts.map +1 -0
  81. package/dist/command.d.ts +163 -0
  82. package/dist/command.d.ts.map +1 -0
  83. package/dist/commands/bootstrap.d.ts +20 -0
  84. package/dist/commands/bootstrap.d.ts.map +1 -0
  85. package/dist/commands/chat.d.ts +37 -0
  86. package/dist/commands/chat.d.ts.map +1 -0
  87. package/dist/commands/code.d.ts +28 -0
  88. package/dist/commands/code.d.ts.map +1 -0
  89. package/dist/commands/console.d.ts +22 -0
  90. package/dist/commands/console.d.ts.map +1 -0
  91. package/dist/commands/describe.d.ts +50 -0
  92. package/dist/commands/describe.d.ts.map +1 -0
  93. package/dist/commands/eval.d.ts +23 -0
  94. package/dist/commands/eval.d.ts.map +1 -0
  95. package/dist/commands/help.d.ts +25 -0
  96. package/dist/commands/help.d.ts.map +1 -0
  97. package/dist/commands/index.d.ts +18 -0
  98. package/dist/commands/index.d.ts.map +1 -0
  99. package/dist/commands/introspect.d.ts +24 -0
  100. package/dist/commands/introspect.d.ts.map +1 -0
  101. package/dist/commands/mcp.d.ts +35 -0
  102. package/dist/commands/mcp.d.ts.map +1 -0
  103. package/dist/commands/prompt.d.ts +38 -0
  104. package/dist/commands/prompt.d.ts.map +1 -0
  105. package/dist/commands/run.d.ts +24 -0
  106. package/dist/commands/run.d.ts.map +1 -0
  107. package/dist/commands/sandbox-mcp.d.ts +34 -0
  108. package/dist/commands/sandbox-mcp.d.ts.map +1 -0
  109. package/dist/commands/save-api-docs.d.ts +21 -0
  110. package/dist/commands/save-api-docs.d.ts.map +1 -0
  111. package/dist/commands/scaffold.d.ts +24 -0
  112. package/dist/commands/scaffold.d.ts.map +1 -0
  113. package/dist/commands/select.d.ts +22 -0
  114. package/dist/commands/select.d.ts.map +1 -0
  115. package/dist/commands/serve.d.ts +29 -0
  116. package/dist/commands/serve.d.ts.map +1 -0
  117. package/dist/container-describer.d.ts +144 -0
  118. package/dist/container-describer.d.ts.map +1 -0
  119. package/dist/container.d.ts +451 -0
  120. package/dist/container.d.ts.map +1 -0
  121. package/dist/endpoint.d.ts +113 -0
  122. package/dist/endpoint.d.ts.map +1 -0
  123. package/dist/feature.d.ts +47 -0
  124. package/dist/feature.d.ts.map +1 -0
  125. package/dist/graft.d.ts +29 -0
  126. package/dist/graft.d.ts.map +1 -0
  127. package/dist/hash-object.d.ts +8 -0
  128. package/dist/hash-object.d.ts.map +1 -0
  129. package/dist/helper.d.ts +209 -0
  130. package/dist/helper.d.ts.map +1 -0
  131. package/dist/introspection/generated.node.d.ts +44623 -0
  132. package/dist/introspection/generated.node.d.ts.map +1 -0
  133. package/dist/introspection/generated.web.d.ts +1412 -0
  134. package/dist/introspection/generated.web.d.ts.map +1 -0
  135. package/dist/introspection/index.d.ts +156 -0
  136. package/dist/introspection/index.d.ts.map +1 -0
  137. package/dist/introspection/scan.d.ts +147 -0
  138. package/dist/introspection/scan.d.ts.map +1 -0
  139. package/dist/node/container.d.ts +256 -0
  140. package/dist/node/container.d.ts.map +1 -0
  141. package/dist/node/feature.d.ts +9 -0
  142. package/dist/node/feature.d.ts.map +1 -0
  143. package/dist/node/features/container-link.d.ts +213 -0
  144. package/dist/node/features/container-link.d.ts.map +1 -0
  145. package/dist/node/features/content-db.d.ts +354 -0
  146. package/dist/node/features/content-db.d.ts.map +1 -0
  147. package/dist/node/features/disk-cache.d.ts +236 -0
  148. package/dist/node/features/disk-cache.d.ts.map +1 -0
  149. package/dist/node/features/dns.d.ts +511 -0
  150. package/dist/node/features/dns.d.ts.map +1 -0
  151. package/dist/node/features/docker.d.ts +485 -0
  152. package/dist/node/features/docker.d.ts.map +1 -0
  153. package/dist/node/features/downloader.d.ts +73 -0
  154. package/dist/node/features/downloader.d.ts.map +1 -0
  155. package/dist/node/features/figlet-fonts.d.ts +4 -0
  156. package/dist/node/features/figlet-fonts.d.ts.map +1 -0
  157. package/dist/node/features/file-manager.d.ts +177 -0
  158. package/dist/node/features/file-manager.d.ts.map +1 -0
  159. package/dist/node/features/fs.d.ts +635 -0
  160. package/dist/node/features/fs.d.ts.map +1 -0
  161. package/dist/node/features/git.d.ts +329 -0
  162. package/dist/node/features/git.d.ts.map +1 -0
  163. package/dist/node/features/google-auth.d.ts +200 -0
  164. package/dist/node/features/google-auth.d.ts.map +1 -0
  165. package/dist/node/features/google-calendar.d.ts +194 -0
  166. package/dist/node/features/google-calendar.d.ts.map +1 -0
  167. package/dist/node/features/google-docs.d.ts +138 -0
  168. package/dist/node/features/google-docs.d.ts.map +1 -0
  169. package/dist/node/features/google-drive.d.ts +202 -0
  170. package/dist/node/features/google-drive.d.ts.map +1 -0
  171. package/dist/node/features/google-mail.d.ts +221 -0
  172. package/dist/node/features/google-mail.d.ts.map +1 -0
  173. package/dist/node/features/google-sheets.d.ts +157 -0
  174. package/dist/node/features/google-sheets.d.ts.map +1 -0
  175. package/dist/node/features/grep.d.ts +207 -0
  176. package/dist/node/features/grep.d.ts.map +1 -0
  177. package/dist/node/features/helpers.d.ts +236 -0
  178. package/dist/node/features/helpers.d.ts.map +1 -0
  179. package/dist/node/features/ink.d.ts +332 -0
  180. package/dist/node/features/ink.d.ts.map +1 -0
  181. package/dist/node/features/ipc-socket.d.ts +298 -0
  182. package/dist/node/features/ipc-socket.d.ts.map +1 -0
  183. package/dist/node/features/json-tree.d.ts +140 -0
  184. package/dist/node/features/json-tree.d.ts.map +1 -0
  185. package/dist/node/features/networking.d.ts +373 -0
  186. package/dist/node/features/networking.d.ts.map +1 -0
  187. package/dist/node/features/nlp.d.ts +125 -0
  188. package/dist/node/features/nlp.d.ts.map +1 -0
  189. package/dist/node/features/opener.d.ts +93 -0
  190. package/dist/node/features/opener.d.ts.map +1 -0
  191. package/dist/node/features/os.d.ts +168 -0
  192. package/dist/node/features/os.d.ts.map +1 -0
  193. package/dist/node/features/package-finder.d.ts +419 -0
  194. package/dist/node/features/package-finder.d.ts.map +1 -0
  195. package/dist/node/features/postgres.d.ts +173 -0
  196. package/dist/node/features/postgres.d.ts.map +1 -0
  197. package/dist/node/features/proc.d.ts +285 -0
  198. package/dist/node/features/proc.d.ts.map +1 -0
  199. package/dist/node/features/process-manager.d.ts +427 -0
  200. package/dist/node/features/process-manager.d.ts.map +1 -0
  201. package/dist/node/features/python.d.ts +477 -0
  202. package/dist/node/features/python.d.ts.map +1 -0
  203. package/dist/node/features/redis.d.ts +247 -0
  204. package/dist/node/features/redis.d.ts.map +1 -0
  205. package/dist/node/features/repl.d.ts +84 -0
  206. package/dist/node/features/repl.d.ts.map +1 -0
  207. package/dist/node/features/runpod.d.ts +527 -0
  208. package/dist/node/features/runpod.d.ts.map +1 -0
  209. package/dist/node/features/secure-shell.d.ts +145 -0
  210. package/dist/node/features/secure-shell.d.ts.map +1 -0
  211. package/dist/node/features/semantic-search.d.ts +207 -0
  212. package/dist/node/features/semantic-search.d.ts.map +1 -0
  213. package/dist/node/features/sqlite.d.ts +180 -0
  214. package/dist/node/features/sqlite.d.ts.map +1 -0
  215. package/dist/node/features/telegram.d.ts +173 -0
  216. package/dist/node/features/telegram.d.ts.map +1 -0
  217. package/dist/node/features/transpiler.d.ts +51 -0
  218. package/dist/node/features/transpiler.d.ts.map +1 -0
  219. package/dist/node/features/tts.d.ts +108 -0
  220. package/dist/node/features/tts.d.ts.map +1 -0
  221. package/dist/node/features/ui.d.ts +562 -0
  222. package/dist/node/features/ui.d.ts.map +1 -0
  223. package/dist/node/features/vault.d.ts +90 -0
  224. package/dist/node/features/vault.d.ts.map +1 -0
  225. package/dist/node/features/vm.d.ts +285 -0
  226. package/dist/node/features/vm.d.ts.map +1 -0
  227. package/dist/node/features/yaml-tree.d.ts +118 -0
  228. package/dist/node/features/yaml-tree.d.ts.map +1 -0
  229. package/dist/node/features/yaml.d.ts +127 -0
  230. package/dist/node/features/yaml.d.ts.map +1 -0
  231. package/dist/node.d.ts +67 -0
  232. package/dist/node.d.ts.map +1 -0
  233. package/dist/python/generated.d.ts +2 -0
  234. package/dist/python/generated.d.ts.map +1 -0
  235. package/dist/react/index.d.ts +36 -0
  236. package/dist/react/index.d.ts.map +1 -0
  237. package/dist/registry.d.ts +97 -0
  238. package/dist/registry.d.ts.map +1 -0
  239. package/dist/scaffolds/generated.d.ts +13 -0
  240. package/dist/scaffolds/generated.d.ts.map +1 -0
  241. package/dist/scaffolds/template.d.ts +11 -0
  242. package/dist/scaffolds/template.d.ts.map +1 -0
  243. package/dist/schemas/base.d.ts +254 -0
  244. package/dist/schemas/base.d.ts.map +1 -0
  245. package/dist/selector.d.ts +130 -0
  246. package/dist/selector.d.ts.map +1 -0
  247. package/dist/server.d.ts +89 -0
  248. package/dist/server.d.ts.map +1 -0
  249. package/dist/servers/express.d.ts +104 -0
  250. package/dist/servers/express.d.ts.map +1 -0
  251. package/dist/servers/mcp.d.ts +201 -0
  252. package/dist/servers/mcp.d.ts.map +1 -0
  253. package/dist/servers/socket.d.ts +121 -0
  254. package/dist/servers/socket.d.ts.map +1 -0
  255. package/dist/state.d.ts +24 -0
  256. package/dist/state.d.ts.map +1 -0
  257. package/dist/web/clients/socket.d.ts +37 -0
  258. package/dist/web/clients/socket.d.ts.map +1 -0
  259. package/dist/web/container.d.ts +55 -0
  260. package/dist/web/container.d.ts.map +1 -0
  261. package/dist/web/extension.d.ts +4 -0
  262. package/dist/web/extension.d.ts.map +1 -0
  263. package/dist/web/feature.d.ts +8 -0
  264. package/dist/web/feature.d.ts.map +1 -0
  265. package/dist/web/features/asset-loader.d.ts +35 -0
  266. package/dist/web/features/asset-loader.d.ts.map +1 -0
  267. package/dist/web/features/container-link.d.ts +167 -0
  268. package/dist/web/features/container-link.d.ts.map +1 -0
  269. package/dist/web/features/esbuild.d.ts +51 -0
  270. package/dist/web/features/esbuild.d.ts.map +1 -0
  271. package/dist/web/features/helpers.d.ts +140 -0
  272. package/dist/web/features/helpers.d.ts.map +1 -0
  273. package/dist/web/features/network.d.ts +69 -0
  274. package/dist/web/features/network.d.ts.map +1 -0
  275. package/dist/web/features/speech.d.ts +71 -0
  276. package/dist/web/features/speech.d.ts.map +1 -0
  277. package/dist/web/features/vault.d.ts +62 -0
  278. package/dist/web/features/vault.d.ts.map +1 -0
  279. package/dist/web/features/vm.d.ts +48 -0
  280. package/dist/web/features/vm.d.ts.map +1 -0
  281. package/dist/web/features/voice-recognition.d.ts +96 -0
  282. package/dist/web/features/voice-recognition.d.ts.map +1 -0
  283. package/dist/web/shims/isomorphic-vm.d.ts +22 -0
  284. package/dist/web/shims/isomorphic-vm.d.ts.map +1 -0
  285. package/docs/apis/features/agi/assistant.md +1 -0
  286. package/docs/apis/features/agi/assistants-manager.md +62 -2
  287. package/docs/apis/features/agi/auto-assistant.md +11 -109
  288. package/docs/apis/features/agi/claude-code.md +138 -0
  289. package/docs/apis/features/agi/conversation.md +60 -31
  290. package/docs/apis/features/agi/luca-coder.md +407 -0
  291. package/docs/apis/features/agi/openapi.md +2 -2
  292. package/docs/apis/features/agi/skills-library.md +12 -0
  293. package/docs/apis/features/node/python.md +81 -11
  294. package/docs/apis/features/node/transpiler.md +74 -0
  295. package/docs/apis/features/web/esbuild.md +0 -6
  296. package/docs/apis/servers/mcp.md +2 -2
  297. package/docs/examples/entity.md +124 -0
  298. package/package.json +73 -21
  299. package/src/agi/feature.ts +13 -0
  300. package/src/agi/features/assistant.ts +36 -25
  301. package/src/agi/features/assistants-manager.ts +70 -5
  302. package/src/agi/features/autonomous-assistant.ts +1 -5
  303. package/src/agi/features/browser-use.ts +2 -2
  304. package/src/agi/features/claude-code.ts +165 -1
  305. package/src/agi/features/conversation-history.ts +2 -6
  306. package/src/agi/features/conversation.ts +95 -3
  307. package/src/agi/features/docs-reader.ts +2 -1
  308. package/src/agi/features/file-tools.ts +2 -2
  309. package/src/agi/features/luca-coder.ts +1 -5
  310. package/src/agi/features/openai-codex.ts +1 -1
  311. package/src/agi/features/openapi.ts +3 -3
  312. package/src/agi/features/skills-library.ts +87 -6
  313. package/src/agi/lib/interceptor-chain.ts +10 -0
  314. package/src/agi/lib/token-counter.ts +1 -1
  315. package/src/bootstrap/generated.ts +126 -1
  316. package/src/bus.ts +27 -5
  317. package/src/cli/build-info.ts +2 -2
  318. package/src/client.ts +2 -2
  319. package/src/clients/elevenlabs/index.ts +5 -0
  320. package/src/commands/bootstrap.ts +2 -1
  321. package/src/commands/chat.ts +1 -0
  322. package/src/commands/code.ts +4 -2
  323. package/src/commands/prompt.ts +34 -34
  324. package/src/commands/sandbox-mcp.ts +69 -163
  325. package/src/commands/save-api-docs.ts +10 -8
  326. package/src/commands/select.ts +8 -3
  327. package/src/container-describer.ts +70 -84
  328. package/src/container.ts +93 -3
  329. package/src/endpoint.ts +1 -1
  330. package/src/entity.ts +173 -0
  331. package/src/feature.ts +3 -3
  332. package/src/helper.ts +8 -4
  333. package/src/introspection/generated.agi.ts +1246 -798
  334. package/src/introspection/generated.node.ts +892 -798
  335. package/src/introspection/generated.web.ts +95 -3
  336. package/src/introspection/scan.ts +1 -1
  337. package/src/node/container.ts +1 -1
  338. package/src/node/features/content-db.ts +3 -3
  339. package/src/node/features/file-manager.ts +10 -9
  340. package/src/node/features/git.ts +5 -5
  341. package/src/node/features/helpers.ts +1 -1
  342. package/src/node/features/json-tree.ts +1 -1
  343. package/src/node/features/os.ts +3 -3
  344. package/src/node/features/package-finder.ts +1 -1
  345. package/src/node/features/process-manager.ts +1 -1
  346. package/src/node/features/python.ts +3 -3
  347. package/src/node/features/redis.ts +1 -1
  348. package/src/node/features/repl.ts +2 -2
  349. package/src/node/features/transpiler.ts +2 -2
  350. package/src/node/features/ui.ts +1 -1
  351. package/src/node/features/vm.ts +3 -3
  352. package/src/node/features/yaml-tree.ts +1 -1
  353. package/src/node.ts +1 -0
  354. package/src/python/generated.ts +1 -1
  355. package/src/scaffolds/generated.ts +1 -1
  356. package/src/selector.ts +74 -4
  357. package/src/server.ts +2 -2
  358. package/src/servers/mcp.ts +6 -6
  359. package/src/web/features/helpers.ts +1 -1
  360. package/src/web/features/network.ts +1 -0
  361. package/test/conversation.test.ts +220 -0
  362. package/tsconfig.build.json +12 -0
  363. package/tsconfig.json +1 -1
  364. package/scripts/examples/telegram-ink-ui.ts +0 -302
  365. package/scripts/examples/using-openai-codex.ts +0 -23
  366. package/scripts/examples/vm-loading-esm-modules.ts +0 -16
@@ -0,0 +1,236 @@
1
+ import { z } from 'zod';
2
+ import { Feature } from '../feature.js';
3
+ export declare const HelpersStateSchema: z.ZodObject<{
4
+ enabled: z.ZodDefault<z.ZodBoolean>;
5
+ discovered: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
6
+ registered: z.ZodDefault<z.ZodArray<z.ZodString>>;
7
+ }, z.core.$loose>;
8
+ export type HelpersState = z.infer<typeof HelpersStateSchema>;
9
+ export declare const HelpersOptionsSchema: z.ZodObject<{
10
+ name: z.ZodOptional<z.ZodString>;
11
+ _cacheKey: z.ZodOptional<z.ZodString>;
12
+ cached: z.ZodOptional<z.ZodBoolean>;
13
+ enable: z.ZodOptional<z.ZodBoolean>;
14
+ rootDir: z.ZodOptional<z.ZodString>;
15
+ }, z.core.$strip>;
16
+ export type HelpersOptions = z.infer<typeof HelpersOptionsSchema>;
17
+ export declare const HelpersEventsSchema: z.ZodObject<{
18
+ stateChange: z.ZodTuple<[z.ZodAny], null>;
19
+ enabled: z.ZodTuple<[], null>;
20
+ discovered: z.ZodTuple<[z.ZodString, z.ZodArray<z.ZodString>], null>;
21
+ registered: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodAny], null>;
22
+ }, z.core.$strip>;
23
+ type RegistryType = 'features' | 'clients' | 'servers' | 'commands' | 'endpoints' | 'selectors';
24
+ /**
25
+ * The Helpers feature is a unified gateway for discovering and registering
26
+ * project-level helpers from conventional folder locations.
27
+ *
28
+ * It scans known folder names (features/, clients/, servers/, commands/, endpoints/, selectors/)
29
+ * and handles registration differently based on the helper type:
30
+ *
31
+ * - Class-based (features, clients, servers): Dynamic import, validate subclass, register
32
+ * - Config-based (commands, endpoints, selectors): Delegate to existing discovery mechanisms
33
+ *
34
+ * @example
35
+ * ```typescript
36
+ * const helpers = container.feature('helpers', { enable: true })
37
+ *
38
+ * // Discover all helper types
39
+ * await helpers.discoverAll()
40
+ *
41
+ * // Discover a specific type
42
+ * await helpers.discover('features')
43
+ *
44
+ * // Unified view of all available helpers
45
+ * console.log(helpers.available)
46
+ * ```
47
+ */
48
+ export declare class Helpers extends Feature<HelpersState, HelpersOptions> {
49
+ static shortcut: "features.helpers";
50
+ static description: string;
51
+ static stateSchema: z.ZodObject<{
52
+ enabled: z.ZodDefault<z.ZodBoolean>;
53
+ discovered: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodBoolean>>;
54
+ registered: z.ZodDefault<z.ZodArray<z.ZodString>>;
55
+ }, z.core.$loose>;
56
+ static optionsSchema: z.ZodObject<{
57
+ name: z.ZodOptional<z.ZodString>;
58
+ _cacheKey: z.ZodOptional<z.ZodString>;
59
+ cached: z.ZodOptional<z.ZodBoolean>;
60
+ enable: z.ZodOptional<z.ZodBoolean>;
61
+ rootDir: z.ZodOptional<z.ZodString>;
62
+ }, z.core.$strip>;
63
+ static eventsSchema: z.ZodObject<{
64
+ stateChange: z.ZodTuple<[z.ZodAny], null>;
65
+ enabled: z.ZodTuple<[], null>;
66
+ discovered: z.ZodTuple<[z.ZodString, z.ZodArray<z.ZodString>], null>;
67
+ registered: z.ZodTuple<[z.ZodString, z.ZodString, z.ZodAny], null>;
68
+ }, z.core.$strip>;
69
+ /** In-flight or completed discovery promises, keyed by registry type */
70
+ private _discoveryPromises;
71
+ /** Cached results from completed discoveries */
72
+ private _discoveryResults;
73
+ /** In-flight or completed discoverAll promise */
74
+ private _discoverAllPromise;
75
+ /**
76
+ * Returns a mapping from registry type name to its registry singleton, base class, and conventional folder candidates.
77
+ */
78
+ private get registryMap();
79
+ /** The root directory to scan for helper folders. */
80
+ get rootDir(): string;
81
+ /**
82
+ * Whether to use native `import()` for loading project helpers.
83
+ * True only if `@soederpop/luca` is actually resolvable in `node_modules`.
84
+ * Warns when `node_modules` exists but the package is missing.
85
+ */
86
+ get useNativeImport(): boolean;
87
+ /** Prevent repeated warnings about missing @soederpop/luca */
88
+ private _warnedNativeImport;
89
+ /** Track whether we've seeded the VM with virtual modules */
90
+ private _vmSeeded;
91
+ /**
92
+ * Seeds the VM feature with virtual modules so that project-level files
93
+ * can `import` / `require('@soederpop/luca')`, `zod`, etc. without
94
+ * needing them in `node_modules`.
95
+ *
96
+ * Called automatically when `useNativeImport` is false.
97
+ * Can also be called externally (e.g. from the CLI) to pre-seed before discovery.
98
+ */
99
+ seedVirtualModules(): void;
100
+ /**
101
+ * Returns a unified view of all available helpers across all registries.
102
+ * Each key is a registry type, each value is the list of helper names in that registry.
103
+ *
104
+ * @example
105
+ * ```typescript
106
+ * container.helpers.available
107
+ * // { features: ['fs', 'git', ...], clients: ['rest', 'websocket'], ... }
108
+ * ```
109
+ */
110
+ get available(): Record<string, string[]>;
111
+ /**
112
+ * Ensures the fileManager feature is started before using it for discovery.
113
+ *
114
+ * @returns The started fileManager instance
115
+ */
116
+ private ensureFileManager;
117
+ /**
118
+ * Resolves which conventional folder path exists for a given registry type.
119
+ * Tries each candidate folder in order and returns the first one that exists.
120
+ *
121
+ * @param type - The registry type to resolve the folder for
122
+ * @returns Absolute path to the folder, or null if none exist
123
+ */
124
+ private resolveFolderPath;
125
+ /**
126
+ * Discover and register project-level helpers of the given type.
127
+ *
128
+ * Idempotent: the first caller triggers the actual scan. Subsequent callers
129
+ * receive the cached results. If discovery is in-flight, callers await the
130
+ * same promise — no duplicate work.
131
+ *
132
+ * @param type - Which type of helpers to discover
133
+ * @param options - Optional overrides
134
+ * @param options.directory - Override the directory to scan
135
+ * @returns Names of helpers that were discovered and registered
136
+ *
137
+ * @example
138
+ * ```typescript
139
+ * const names = await container.helpers.discover('features')
140
+ * console.log(names) // ['myCustomFeature']
141
+ * ```
142
+ */
143
+ discover(type: RegistryType, options?: {
144
+ directory?: string;
145
+ }): Promise<string[]>;
146
+ /** Internal: performs the actual discovery work for a single type. */
147
+ private _doDiscover;
148
+ /**
149
+ * Discover all helper types from their conventional folder locations.
150
+ *
151
+ * Idempotent: safe to call from multiple places (luca.cli.ts, commands, etc.).
152
+ * The first caller triggers discovery; all others receive the same results.
153
+ *
154
+ * @returns Map of registry type to discovered helper names
155
+ *
156
+ * @example
157
+ * ```typescript
158
+ * const results = await container.helpers.discoverAll()
159
+ * // { features: ['myFeature'], clients: [], servers: [], commands: ['deploy'], endpoints: [] }
160
+ * ```
161
+ */
162
+ discoverAll(): Promise<Record<string, string[]>>;
163
+ /** Internal: performs the actual discoverAll work. */
164
+ private _doDiscoverAll;
165
+ /**
166
+ * Look up a helper class by type and name.
167
+ *
168
+ * @param type - The registry type (features, clients, servers, commands, endpoints)
169
+ * @param name - The helper name within that registry
170
+ * @returns The helper constructor
171
+ *
172
+ * @example
173
+ * ```typescript
174
+ * const FsClass = container.helpers.lookup('features', 'fs')
175
+ * ```
176
+ */
177
+ lookup(type: RegistryType, name: string): any;
178
+ /**
179
+ * Get the introspection description for a specific helper.
180
+ *
181
+ * @param type - The registry type
182
+ * @param name - The helper name
183
+ * @returns Markdown description of the helper's interface
184
+ */
185
+ describe(type: RegistryType, name: string): string;
186
+ /**
187
+ * Load a module either via native `import()` or the VM's virtual module system.
188
+ * Uses the same `useNativeImport` check as discovery to decide the loading strategy.
189
+ *
190
+ * @param absPath - Absolute path to the module file
191
+ * @param options - Optional settings
192
+ * @param options.cacheBust - When true, appends a timestamp query to bypass the native import cache (useful for hot reload)
193
+ * @returns The module's exports
194
+ */
195
+ loadModuleExports(absPath: string, options?: {
196
+ cacheBust?: boolean;
197
+ }): Promise<Record<string, any>>;
198
+ /**
199
+ * Discovers class-based helpers (features, clients, servers) from a directory.
200
+ * Uses fileManager when available (fast in git repos), falls back to Glob.
201
+ */
202
+ private discoverClassBased;
203
+ /**
204
+ * Discovers config-based helpers (commands, endpoints) by delegating
205
+ * to existing discovery mechanisms.
206
+ */
207
+ private discoverConfigBased;
208
+ /**
209
+ * Discovers commands using the VM's virtual module system.
210
+ * Mirrors CommandsRegistry.discover() but uses vm.loadModule() instead of import().
211
+ */
212
+ private discoverCommandsViaVM;
213
+ /**
214
+ * Discovers selectors using the VM's virtual module system.
215
+ * Mirrors discoverCommandsViaVM but uses selectors registry and Selector base class.
216
+ */
217
+ private discoverSelectorsViaVM;
218
+ /**
219
+ * Discovers endpoints from a directory, registering them for discoverability.
220
+ * Actual mounting to an express server is handled separately by ExpressServer.useEndpoints().
221
+ */
222
+ private discoverEndpoints;
223
+ /**
224
+ * Check if a class is a subclass of a given base class by walking the prototype chain.
225
+ * Uses identity comparison first, then falls back to name comparison to handle
226
+ * cross-module boundaries (e.g. compiled binary vs dynamically imported modules
227
+ * that resolve to separate module instances of the same class).
228
+ */
229
+ private isSubclassOf;
230
+ /**
231
+ * Convert a kebab-case or snake_case filename to a camelCase registry name.
232
+ */
233
+ private fileNameToRegistryName;
234
+ }
235
+ export default Helpers;
236
+ //# sourceMappingURL=helpers.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/node/features/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAmBvC,eAAO,MAAM,kBAAkB;;;;iBAG7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D,eAAO,MAAM,oBAAoB;;;;;;iBAE/B,CAAA;AAEF,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C,MAAM,EAAE,CAAC;IA6B3F,sEAAsE;YACxD,WAAW;IA2BzB;;;;;;;;;;;;;OAaG;IACG,WAAW,IAAI,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAStD,sDAAsD;YACxC,cAAc;IAU5B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,GAAG;IAK7C;;;;;;OAMG;IACH,QAAQ,CAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM;IAKlD;;;;;;;;OAQG;IACG,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAYzG;;;OAGG;YACW,kBAAkB;IAyFhC;;;OAGG;YACW,mBAAmB;IAwBjC;;;OAGG;YACW,qBAAqB;IAsEnC;;;OAGG;YACW,sBAAsB;IA2CpC;;;OAGG;YACW,iBAAiB;IAuB/B;;;;;OAKG;IACH,OAAO,CAAC,YAAY;IAYpB;;OAEG;IACH,OAAO,CAAC,sBAAsB;CAK/B;AAED,eAAe,OAAO,CAAA"}
@@ -0,0 +1,332 @@
1
+ import { z } from 'zod';
2
+ import { Feature } from '../feature.js';
3
+ export declare const InkStateSchema: z.ZodObject<{
4
+ enabled: z.ZodDefault<z.ZodBoolean>;
5
+ mounted: z.ZodBoolean;
6
+ }, z.core.$loose>;
7
+ type InkState = z.infer<typeof InkStateSchema>;
8
+ export declare const InkOptionsSchema: z.ZodObject<{
9
+ name: z.ZodOptional<z.ZodString>;
10
+ _cacheKey: z.ZodOptional<z.ZodString>;
11
+ cached: z.ZodOptional<z.ZodBoolean>;
12
+ enable: z.ZodOptional<z.ZodBoolean>;
13
+ maxFps: z.ZodOptional<z.ZodNumber>;
14
+ patchConsole: z.ZodOptional<z.ZodBoolean>;
15
+ incrementalRendering: z.ZodOptional<z.ZodBoolean>;
16
+ concurrent: z.ZodOptional<z.ZodBoolean>;
17
+ }, z.core.$strip>;
18
+ type InkOptions = z.infer<typeof InkOptionsSchema>;
19
+ export declare const InkEventsSchema: z.ZodObject<{
20
+ stateChange: z.ZodTuple<[z.ZodAny], null>;
21
+ enabled: z.ZodTuple<[], null>;
22
+ mounted: z.ZodTuple<[], null>;
23
+ unmounted: z.ZodTuple<[], null>;
24
+ }, z.core.$strip>;
25
+ /**
26
+ * Ink Feature — React-powered Terminal UI via Ink
27
+ *
28
+ * Exposes the Ink library (React for CLIs) through the container so any
29
+ * feature, script, or application can build rich terminal user interfaces
30
+ * using React components rendered directly in the terminal.
31
+ *
32
+ * This feature is intentionally a thin pass-through. It re-exports all of
33
+ * Ink's components, hooks, and the render function, plus a few convenience
34
+ * methods for mounting / unmounting apps. The actual UI composition is left
35
+ * entirely to the consumer — the feature just makes Ink available.
36
+ *
37
+ * **What you get:**
38
+ * - `ink.render(element)` — mount a React element to the terminal
39
+ * - `ink.components` — { Box, Text, Static, Transform, Newline, Spacer }
40
+ * - `ink.hooks` — { useInput, useApp, useStdin, useStdout, useStderr, useFocus, useFocusManager }
41
+ * - `ink.React` — the React module itself (createElement, useState, etc.)
42
+ * - `ink.unmount()` — tear down the currently mounted app
43
+ * - `ink.waitUntilExit()` — await the mounted app's exit
44
+ *
45
+ * **Quick start:**
46
+ * ```tsx
47
+ * const ink = container.feature('ink', { enable: true })
48
+ * const { Box, Text } = ink.components
49
+ * const { React } = ink
50
+ *
51
+ * ink.render(
52
+ * React.createElement(Box, { flexDirection: 'column' },
53
+ * React.createElement(Text, { color: 'green' }, 'hello from ink'),
54
+ * React.createElement(Text, { dimColor: true }, 'powered by luca'),
55
+ * )
56
+ * )
57
+ *
58
+ * await ink.waitUntilExit()
59
+ * ```
60
+ *
61
+ * Or if you're in a .tsx file:
62
+ * ```tsx
63
+ * import React from 'react'
64
+ * const ink = container.feature('ink', { enable: true })
65
+ * const { Box, Text } = ink.components
66
+ *
67
+ * ink.render(
68
+ * <Box flexDirection="column">
69
+ * <Text color="green">hello from ink</Text>
70
+ * <Text dimColor>powered by luca</Text>
71
+ * </Box>
72
+ * )
73
+ * ```
74
+ *
75
+ * @extends Feature
76
+ */
77
+ export declare class Ink extends Feature<InkState, InkOptions> {
78
+ static shortcut: "features.ink";
79
+ static stateSchema: z.ZodObject<{
80
+ enabled: z.ZodDefault<z.ZodBoolean>;
81
+ mounted: z.ZodBoolean;
82
+ }, z.core.$loose>;
83
+ static optionsSchema: z.ZodObject<{
84
+ name: z.ZodOptional<z.ZodString>;
85
+ _cacheKey: z.ZodOptional<z.ZodString>;
86
+ cached: z.ZodOptional<z.ZodBoolean>;
87
+ enable: z.ZodOptional<z.ZodBoolean>;
88
+ maxFps: z.ZodOptional<z.ZodNumber>;
89
+ patchConsole: z.ZodOptional<z.ZodBoolean>;
90
+ incrementalRendering: z.ZodOptional<z.ZodBoolean>;
91
+ concurrent: z.ZodOptional<z.ZodBoolean>;
92
+ }, z.core.$strip>;
93
+ static eventsSchema: z.ZodObject<{
94
+ stateChange: z.ZodTuple<[z.ZodAny], null>;
95
+ enabled: z.ZodTuple<[], null>;
96
+ mounted: z.ZodTuple<[], null>;
97
+ unmounted: z.ZodTuple<[], null>;
98
+ }, z.core.$strip>;
99
+ private _instance;
100
+ private _inkModule;
101
+ private _reactModule;
102
+ private _blocks;
103
+ get initialState(): InkState;
104
+ /**
105
+ * The raw ink module. Lazy-loaded on first access.
106
+ */
107
+ private _getInk;
108
+ /**
109
+ * The raw react module. Lazy-loaded on first access.
110
+ */
111
+ private _getReact;
112
+ /**
113
+ * The React module (createElement, useState, useEffect, etc.)
114
+ *
115
+ * Exposed so consumers don't need a separate react import.
116
+ * Lazy-loaded — first access triggers the import.
117
+ */
118
+ get React(): typeof import('react');
119
+ /**
120
+ * Pre-load ink + react modules so the sync getters work.
121
+ * Called automatically by render(), but you can call it early.
122
+ *
123
+ * @returns This Ink feature instance for method chaining
124
+ *
125
+ * @example
126
+ * ```typescript
127
+ * const ink = container.feature('ink', { enable: true })
128
+ * await ink.loadModules()
129
+ * // Now sync getters like ink.React, ink.components, ink.hooks work
130
+ * const { Box, Text } = ink.components
131
+ * ```
132
+ */
133
+ loadModules(): Promise<this>;
134
+ /**
135
+ * All Ink components as a single object for destructuring.
136
+ *
137
+ * ```ts
138
+ * const { Box, Text, Static, Spacer } = ink.components
139
+ * ```
140
+ */
141
+ get components(): {
142
+ Box: typeof import('ink').Box;
143
+ Text: typeof import('ink').Text;
144
+ Static: typeof import('ink').Static;
145
+ Transform: typeof import('ink').Transform;
146
+ Newline: typeof import('ink').Newline;
147
+ Spacer: typeof import('ink').Spacer;
148
+ };
149
+ /**
150
+ * All Ink hooks as a single object for destructuring.
151
+ *
152
+ * ```ts
153
+ * const { useInput, useApp, useFocus } = ink.hooks
154
+ * ```
155
+ */
156
+ get hooks(): {
157
+ useInput: typeof import('ink').useInput;
158
+ useApp: typeof import('ink').useApp;
159
+ useStdin: typeof import('ink').useStdin;
160
+ useStdout: typeof import('ink').useStdout;
161
+ useStderr: typeof import('ink').useStderr;
162
+ useFocus: typeof import('ink').useFocus;
163
+ useFocusManager: typeof import('ink').useFocusManager;
164
+ useCursor: typeof import('ink').useCursor;
165
+ };
166
+ /**
167
+ * The Ink measureElement utility.
168
+ */
169
+ get measureElement(): typeof import('ink').measureElement;
170
+ /**
171
+ * Mount a React element to the terminal.
172
+ *
173
+ * Wraps `ink.render()` — automatically loads modules if needed,
174
+ * tracks the instance for unmount / waitUntilExit, and updates state.
175
+ *
176
+ * @param node - A React element (JSX or React.createElement)
177
+ * @param options - Ink render options (stdout, stdin, debug, etc.)
178
+ * @returns The Ink instance with rerender, unmount, waitUntilExit, clear
179
+ */
180
+ render(node: any, options?: Record<string, any>): Promise<any>;
181
+ /**
182
+ * Re-render the currently mounted app with a new root element.
183
+ *
184
+ * @returns void
185
+ *
186
+ * @example
187
+ * ```typescript
188
+ * const ink = container.feature('ink', { enable: true })
189
+ * const { React } = await ink.loadModules()
190
+ * const { Text } = ink.components
191
+ *
192
+ * await ink.render(React.createElement(Text, null, 'Hello'))
193
+ * ink.rerender(React.createElement(Text, null, 'Updated!'))
194
+ * ```
195
+ */
196
+ rerender(node: any): void;
197
+ /**
198
+ * Unmount the currently mounted Ink app.
199
+ *
200
+ * Tears down the React tree rendered in the terminal and resets state.
201
+ * Safe to call when no app is mounted (no-op).
202
+ *
203
+ * @returns void
204
+ *
205
+ * @example
206
+ * ```typescript
207
+ * const ink = container.feature('ink', { enable: true })
208
+ * await ink.render(myElement)
209
+ * // ... later
210
+ * ink.unmount()
211
+ * console.log(ink.isMounted) // false
212
+ * ```
213
+ */
214
+ unmount(): void;
215
+ /**
216
+ * Returns a promise that resolves when the mounted app exits.
217
+ *
218
+ * Useful for keeping a script alive while the terminal UI is active.
219
+ *
220
+ * @returns Promise that resolves when the Ink app exits
221
+ * @throws {Error} When no app is currently mounted
222
+ *
223
+ * @example
224
+ * ```typescript
225
+ * const ink = container.feature('ink', { enable: true })
226
+ * await ink.render(myElement)
227
+ * await ink.waitUntilExit()
228
+ * console.log('App exited')
229
+ * ```
230
+ */
231
+ waitUntilExit(): Promise<void>;
232
+ /**
233
+ * Clear the terminal output of the mounted app.
234
+ *
235
+ * Erases all Ink-rendered content from the terminal. Safe to call
236
+ * when no app is mounted (no-op).
237
+ *
238
+ * @returns void
239
+ *
240
+ * @example
241
+ * ```typescript
242
+ * const ink = container.feature('ink', { enable: true })
243
+ * await ink.render(myElement)
244
+ * // ... later, wipe the screen
245
+ * ink.clear()
246
+ * ```
247
+ */
248
+ clear(): void;
249
+ /**
250
+ * Whether an ink app is currently mounted.
251
+ */
252
+ get isMounted(): boolean;
253
+ /**
254
+ * The raw ink render instance if you need low-level access.
255
+ */
256
+ get instance(): any | null;
257
+ /**
258
+ * Register a named React function component as a renderable block.
259
+ *
260
+ * @param name - Unique block name
261
+ * @param component - A React function component
262
+ * @returns This Ink feature instance for method chaining
263
+ *
264
+ * @example
265
+ * ```typescript
266
+ * ink.registerBlock('Greeting', ({ name }) =>
267
+ * React.createElement(Text, { color: 'green' }, `Hello ${name}!`)
268
+ * )
269
+ * ```
270
+ */
271
+ registerBlock(name: string, component: Function): this;
272
+ /**
273
+ * Render a registered block by name with optional props.
274
+ *
275
+ * Looks up the component, creates a React element, renders it via ink,
276
+ * then immediately unmounts so the static output stays on screen while
277
+ * freeing the React tree.
278
+ *
279
+ * @param name - The registered block name
280
+ * @param data - Props to pass to the component
281
+ *
282
+ * @example
283
+ * ```typescript
284
+ * await ink.renderBlock('Greeting', { name: 'Jon' })
285
+ * ```
286
+ */
287
+ renderBlock(name: string, data?: Record<string, any>): Promise<void>;
288
+ /**
289
+ * Render a registered block that needs to stay mounted for async work.
290
+ *
291
+ * The component receives a `done` prop — a callback it must invoke when
292
+ * it has finished rendering its final output. The React tree stays alive
293
+ * until `done()` is called or the timeout expires.
294
+ *
295
+ * @param name - The registered block name
296
+ * @param data - Props to pass to the component (a `done` prop is added automatically)
297
+ * @param options - `timeout` in ms before force-unmounting (default 30 000)
298
+ *
299
+ * @example
300
+ * ```tsx
301
+ * // In a ## Blocks section:
302
+ * function AsyncChart({ url, done }) {
303
+ * const [rows, setRows] = React.useState(null)
304
+ * React.useEffect(() => {
305
+ * fetch(url).then(r => r.json()).then(data => {
306
+ * setRows(data)
307
+ * done()
308
+ * })
309
+ * }, [])
310
+ * if (!rows) return <Text dimColor>Loading...</Text>
311
+ * return <Box><Text>{JSON.stringify(rows)}</Text></Box>
312
+ * }
313
+ *
314
+ * // In a code block:
315
+ * await renderAsync('AsyncChart', { url: 'https://api.example.com/data' })
316
+ * ```
317
+ */
318
+ renderBlockAsync(name: string, data?: Record<string, any>, options?: {
319
+ timeout?: number;
320
+ }): Promise<void>;
321
+ /**
322
+ * List all registered block names.
323
+ */
324
+ get blocks(): string[];
325
+ }
326
+ export default Ink;
327
+ declare module '../../feature' {
328
+ interface AvailableFeatures {
329
+ ink: typeof Ink;
330
+ }
331
+ }
332
+ //# sourceMappingURL=ink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ink.d.ts","sourceRoot":"","sources":["../../../src/node/features/ink.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAIvC,eAAO,MAAM,cAAc;;;iBAGzB,CAAA;AACF,KAAK,QAAQ,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAA;AAE9C,eAAO,MAAM,gBAAgB;;;;;;;;;iBAS3B,CAAA;AACF,KAAK,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAA;AAElD,eAAO,MAAM,eAAe;;;;;iBAG1B,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmDG;AACH,qBAAa,GAAI,SAAQ,OAAO,CAAC,QAAQ,EAAE,UAAU,CAAC;IACpD,OAAgB,QAAQ,EAAG,cAAc,CAAS;IAClD,OAAgB,WAAW;;;sBAAiB;IAC5C,OAAgB,aAAa;;;;;;;;;sBAAmB;IAChD,OAAgB,YAAY;;;;;sBAAkB;IAG9C,OAAO,CAAC,SAAS,CAAmB;IACpC,OAAO,CAAC,UAAU,CAAoC;IACtD,OAAO,CAAC,YAAY,CAAsC;IAC1D,OAAO,CAAC,OAAO,CAA8B;IAE7C,IAAa,YAAY,IAAI,QAAQ,CAKpC;IAID;;OAEG;YACW,OAAO;IAOrB;;OAEG;YACW,SAAS;IASvB;;;;;OAKG;IACH,IAAI,KAAK,IAAI,cAAc,OAAO,CAAC,CAOlC;IAED;;;;;;;;;;;;;OAaG;IACG,WAAW,IAAI,OAAO,CAAC,IAAI,CAAC;IAKlC;;;;;;OAMG;IACH,IAAI,UAAU,IAAI;QAAE,GAAG,EAAE,cA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