@soederpop/luca 0.1.2 → 0.2.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 (381) hide show
  1. package/.github/workflows/release.yaml +167 -0
  2. package/CLAUDE.md +2 -0
  3. package/README.md +3 -0
  4. package/assistants/codingAssistant/ABOUT.md +3 -0
  5. package/assistants/codingAssistant/CORE.md +22 -17
  6. package/assistants/codingAssistant/hooks.ts +17 -4
  7. package/assistants/codingAssistant/tools.ts +1 -106
  8. package/assistants/inkbot/ABOUT.md +5 -0
  9. package/assistants/inkbot/CORE.md +71 -0
  10. package/assistants/inkbot/hooks.ts +14 -0
  11. package/assistants/inkbot/tools.ts +47 -0
  12. package/bun.lock +20 -4
  13. package/commands/inkbot.ts +353 -0
  14. package/commands/release.ts +75 -181
  15. package/dist/agi/container.server.d.ts +63 -0
  16. package/dist/agi/container.server.d.ts.map +1 -0
  17. package/dist/agi/endpoints/ask.d.ts +20 -0
  18. package/dist/agi/endpoints/ask.d.ts.map +1 -0
  19. package/dist/agi/endpoints/conversations/[id].d.ts +27 -0
  20. package/dist/agi/endpoints/conversations/[id].d.ts.map +1 -0
  21. package/dist/agi/endpoints/conversations.d.ts +18 -0
  22. package/dist/agi/endpoints/conversations.d.ts.map +1 -0
  23. package/dist/agi/endpoints/experts.d.ts +8 -0
  24. package/dist/agi/endpoints/experts.d.ts.map +1 -0
  25. package/dist/agi/feature.d.ts +9 -0
  26. package/dist/agi/feature.d.ts.map +1 -0
  27. package/dist/agi/features/assistant.d.ts +509 -0
  28. package/dist/agi/features/assistant.d.ts.map +1 -0
  29. package/dist/agi/features/assistants-manager.d.ts +236 -0
  30. package/dist/agi/features/assistants-manager.d.ts.map +1 -0
  31. package/dist/agi/features/autonomous-assistant.d.ts +281 -0
  32. package/dist/agi/features/autonomous-assistant.d.ts.map +1 -0
  33. package/dist/agi/features/browser-use.d.ts +479 -0
  34. package/dist/agi/features/browser-use.d.ts.map +1 -0
  35. package/dist/agi/features/claude-code.d.ts +824 -0
  36. package/dist/agi/features/claude-code.d.ts.map +1 -0
  37. package/dist/agi/features/conversation-history.d.ts +245 -0
  38. package/dist/agi/features/conversation-history.d.ts.map +1 -0
  39. package/dist/agi/features/conversation.d.ts +464 -0
  40. package/dist/agi/features/conversation.d.ts.map +1 -0
  41. package/dist/agi/features/docs-reader.d.ts +72 -0
  42. package/dist/agi/features/docs-reader.d.ts.map +1 -0
  43. package/dist/agi/features/file-tools.d.ts +110 -0
  44. package/dist/agi/features/file-tools.d.ts.map +1 -0
  45. package/dist/agi/features/luca-coder.d.ts +323 -0
  46. package/dist/agi/features/luca-coder.d.ts.map +1 -0
  47. package/dist/agi/features/openai-codex.d.ts +381 -0
  48. package/dist/agi/features/openai-codex.d.ts.map +1 -0
  49. package/dist/agi/features/openapi.d.ts +200 -0
  50. package/dist/agi/features/openapi.d.ts.map +1 -0
  51. package/dist/agi/features/skills-library.d.ts +167 -0
  52. package/dist/agi/features/skills-library.d.ts.map +1 -0
  53. package/dist/agi/index.d.ts +5 -0
  54. package/dist/agi/index.d.ts.map +1 -0
  55. package/dist/agi/lib/interceptor-chain.d.ts +44 -0
  56. package/dist/agi/lib/interceptor-chain.d.ts.map +1 -0
  57. package/dist/agi/lib/token-counter.d.ts +13 -0
  58. package/dist/agi/lib/token-counter.d.ts.map +1 -0
  59. package/dist/bootstrap/generated.d.ts +5 -0
  60. package/dist/bootstrap/generated.d.ts.map +1 -0
  61. package/dist/browser.d.ts +12 -0
  62. package/dist/browser.d.ts.map +1 -0
  63. package/dist/bus.d.ts +29 -0
  64. package/dist/bus.d.ts.map +1 -0
  65. package/dist/cli/build-info.d.ts +4 -0
  66. package/dist/cli/build-info.d.ts.map +1 -0
  67. package/dist/cli/cli.d.ts +3 -0
  68. package/dist/cli/cli.d.ts.map +1 -0
  69. package/dist/client.d.ts +60 -0
  70. package/dist/client.d.ts.map +1 -0
  71. package/dist/clients/civitai/index.d.ts +472 -0
  72. package/dist/clients/civitai/index.d.ts.map +1 -0
  73. package/dist/clients/client-template.d.ts +30 -0
  74. package/dist/clients/client-template.d.ts.map +1 -0
  75. package/dist/clients/comfyui/index.d.ts +281 -0
  76. package/dist/clients/comfyui/index.d.ts.map +1 -0
  77. package/dist/clients/elevenlabs/index.d.ts +197 -0
  78. package/dist/clients/elevenlabs/index.d.ts.map +1 -0
  79. package/dist/clients/graph.d.ts +64 -0
  80. package/dist/clients/graph.d.ts.map +1 -0
  81. package/dist/clients/openai/index.d.ts +247 -0
  82. package/dist/clients/openai/index.d.ts.map +1 -0
  83. package/dist/clients/rest.d.ts +92 -0
  84. package/dist/clients/rest.d.ts.map +1 -0
  85. package/dist/clients/supabase/index.d.ts +176 -0
  86. package/dist/clients/supabase/index.d.ts.map +1 -0
  87. package/dist/clients/websocket.d.ts +127 -0
  88. package/dist/clients/websocket.d.ts.map +1 -0
  89. package/dist/command.d.ts +163 -0
  90. package/dist/command.d.ts.map +1 -0
  91. package/dist/commands/bootstrap.d.ts +20 -0
  92. package/dist/commands/bootstrap.d.ts.map +1 -0
  93. package/dist/commands/chat.d.ts +37 -0
  94. package/dist/commands/chat.d.ts.map +1 -0
  95. package/dist/commands/code.d.ts +28 -0
  96. package/dist/commands/code.d.ts.map +1 -0
  97. package/dist/commands/console.d.ts +22 -0
  98. package/dist/commands/console.d.ts.map +1 -0
  99. package/dist/commands/describe.d.ts +50 -0
  100. package/dist/commands/describe.d.ts.map +1 -0
  101. package/dist/commands/eval.d.ts +23 -0
  102. package/dist/commands/eval.d.ts.map +1 -0
  103. package/dist/commands/help.d.ts +25 -0
  104. package/dist/commands/help.d.ts.map +1 -0
  105. package/dist/commands/index.d.ts +18 -0
  106. package/dist/commands/index.d.ts.map +1 -0
  107. package/dist/commands/introspect.d.ts +24 -0
  108. package/dist/commands/introspect.d.ts.map +1 -0
  109. package/dist/commands/mcp.d.ts +35 -0
  110. package/dist/commands/mcp.d.ts.map +1 -0
  111. package/dist/commands/prompt.d.ts +38 -0
  112. package/dist/commands/prompt.d.ts.map +1 -0
  113. package/dist/commands/run.d.ts +24 -0
  114. package/dist/commands/run.d.ts.map +1 -0
  115. package/dist/commands/sandbox-mcp.d.ts +34 -0
  116. package/dist/commands/sandbox-mcp.d.ts.map +1 -0
  117. package/dist/commands/save-api-docs.d.ts +21 -0
  118. package/dist/commands/save-api-docs.d.ts.map +1 -0
  119. package/dist/commands/scaffold.d.ts +24 -0
  120. package/dist/commands/scaffold.d.ts.map +1 -0
  121. package/dist/commands/select.d.ts +22 -0
  122. package/dist/commands/select.d.ts.map +1 -0
  123. package/dist/commands/serve.d.ts +29 -0
  124. package/dist/commands/serve.d.ts.map +1 -0
  125. package/dist/container-describer.d.ts +144 -0
  126. package/dist/container-describer.d.ts.map +1 -0
  127. package/dist/container.d.ts +451 -0
  128. package/dist/container.d.ts.map +1 -0
  129. package/dist/endpoint.d.ts +113 -0
  130. package/dist/endpoint.d.ts.map +1 -0
  131. package/dist/feature.d.ts +47 -0
  132. package/dist/feature.d.ts.map +1 -0
  133. package/dist/graft.d.ts +29 -0
  134. package/dist/graft.d.ts.map +1 -0
  135. package/dist/hash-object.d.ts +8 -0
  136. package/dist/hash-object.d.ts.map +1 -0
  137. package/dist/helper.d.ts +209 -0
  138. package/dist/helper.d.ts.map +1 -0
  139. package/dist/introspection/generated.node.d.ts +44623 -0
  140. package/dist/introspection/generated.node.d.ts.map +1 -0
  141. package/dist/introspection/generated.web.d.ts +1412 -0
  142. package/dist/introspection/generated.web.d.ts.map +1 -0
  143. package/dist/introspection/index.d.ts +156 -0
  144. package/dist/introspection/index.d.ts.map +1 -0
  145. package/dist/introspection/scan.d.ts +147 -0
  146. package/dist/introspection/scan.d.ts.map +1 -0
  147. package/dist/node/container.d.ts +256 -0
  148. package/dist/node/container.d.ts.map +1 -0
  149. package/dist/node/feature.d.ts +9 -0
  150. package/dist/node/feature.d.ts.map +1 -0
  151. package/dist/node/features/container-link.d.ts +213 -0
  152. package/dist/node/features/container-link.d.ts.map +1 -0
  153. package/dist/node/features/content-db.d.ts +354 -0
  154. package/dist/node/features/content-db.d.ts.map +1 -0
  155. package/dist/node/features/disk-cache.d.ts +236 -0
  156. package/dist/node/features/disk-cache.d.ts.map +1 -0
  157. package/dist/node/features/dns.d.ts +511 -0
  158. package/dist/node/features/dns.d.ts.map +1 -0
  159. package/dist/node/features/docker.d.ts +485 -0
  160. package/dist/node/features/docker.d.ts.map +1 -0
  161. package/dist/node/features/downloader.d.ts +73 -0
  162. package/dist/node/features/downloader.d.ts.map +1 -0
  163. package/dist/node/features/figlet-fonts.d.ts +4 -0
  164. package/dist/node/features/figlet-fonts.d.ts.map +1 -0
  165. package/dist/node/features/file-manager.d.ts +177 -0
  166. package/dist/node/features/file-manager.d.ts.map +1 -0
  167. package/dist/node/features/fs.d.ts +635 -0
  168. package/dist/node/features/fs.d.ts.map +1 -0
  169. package/dist/node/features/git.d.ts +329 -0
  170. package/dist/node/features/git.d.ts.map +1 -0
  171. package/dist/node/features/google-auth.d.ts +200 -0
  172. package/dist/node/features/google-auth.d.ts.map +1 -0
  173. package/dist/node/features/google-calendar.d.ts +194 -0
  174. package/dist/node/features/google-calendar.d.ts.map +1 -0
  175. package/dist/node/features/google-docs.d.ts +138 -0
  176. package/dist/node/features/google-docs.d.ts.map +1 -0
  177. package/dist/node/features/google-drive.d.ts +202 -0
  178. package/dist/node/features/google-drive.d.ts.map +1 -0
  179. package/dist/node/features/google-mail.d.ts +221 -0
  180. package/dist/node/features/google-mail.d.ts.map +1 -0
  181. package/dist/node/features/google-sheets.d.ts +157 -0
  182. package/dist/node/features/google-sheets.d.ts.map +1 -0
  183. package/dist/node/features/grep.d.ts +207 -0
  184. package/dist/node/features/grep.d.ts.map +1 -0
  185. package/dist/node/features/helpers.d.ts +236 -0
  186. package/dist/node/features/helpers.d.ts.map +1 -0
  187. package/dist/node/features/ink.d.ts +332 -0
  188. package/dist/node/features/ink.d.ts.map +1 -0
  189. package/dist/node/features/ipc-socket.d.ts +298 -0
  190. package/dist/node/features/ipc-socket.d.ts.map +1 -0
  191. package/dist/node/features/json-tree.d.ts +140 -0
  192. package/dist/node/features/json-tree.d.ts.map +1 -0
  193. package/dist/node/features/networking.d.ts +373 -0
  194. package/dist/node/features/networking.d.ts.map +1 -0
  195. package/dist/node/features/nlp.d.ts +125 -0
  196. package/dist/node/features/nlp.d.ts.map +1 -0
  197. package/dist/node/features/opener.d.ts +93 -0
  198. package/dist/node/features/opener.d.ts.map +1 -0
  199. package/dist/node/features/os.d.ts +168 -0
  200. package/dist/node/features/os.d.ts.map +1 -0
  201. package/dist/node/features/package-finder.d.ts +419 -0
  202. package/dist/node/features/package-finder.d.ts.map +1 -0
  203. package/dist/node/features/postgres.d.ts +173 -0
  204. package/dist/node/features/postgres.d.ts.map +1 -0
  205. package/dist/node/features/proc.d.ts +285 -0
  206. package/dist/node/features/proc.d.ts.map +1 -0
  207. package/dist/node/features/process-manager.d.ts +427 -0
  208. package/dist/node/features/process-manager.d.ts.map +1 -0
  209. package/dist/node/features/python.d.ts +477 -0
  210. package/dist/node/features/python.d.ts.map +1 -0
  211. package/dist/node/features/redis.d.ts +247 -0
  212. package/dist/node/features/redis.d.ts.map +1 -0
  213. package/dist/node/features/repl.d.ts +84 -0
  214. package/dist/node/features/repl.d.ts.map +1 -0
  215. package/dist/node/features/runpod.d.ts +527 -0
  216. package/dist/node/features/runpod.d.ts.map +1 -0
  217. package/dist/node/features/secure-shell.d.ts +145 -0
  218. package/dist/node/features/secure-shell.d.ts.map +1 -0
  219. package/dist/node/features/semantic-search.d.ts +207 -0
  220. package/dist/node/features/semantic-search.d.ts.map +1 -0
  221. package/dist/node/features/sqlite.d.ts +180 -0
  222. package/dist/node/features/sqlite.d.ts.map +1 -0
  223. package/dist/node/features/telegram.d.ts +173 -0
  224. package/dist/node/features/telegram.d.ts.map +1 -0
  225. package/dist/node/features/transpiler.d.ts +51 -0
  226. package/dist/node/features/transpiler.d.ts.map +1 -0
  227. package/dist/node/features/tts.d.ts +108 -0
  228. package/dist/node/features/tts.d.ts.map +1 -0
  229. package/dist/node/features/ui.d.ts +562 -0
  230. package/dist/node/features/ui.d.ts.map +1 -0
  231. package/dist/node/features/vault.d.ts +90 -0
  232. package/dist/node/features/vault.d.ts.map +1 -0
  233. package/dist/node/features/vm.d.ts +285 -0
  234. package/dist/node/features/vm.d.ts.map +1 -0
  235. package/dist/node/features/yaml-tree.d.ts +118 -0
  236. package/dist/node/features/yaml-tree.d.ts.map +1 -0
  237. package/dist/node/features/yaml.d.ts +127 -0
  238. package/dist/node/features/yaml.d.ts.map +1 -0
  239. package/dist/node.d.ts +67 -0
  240. package/dist/node.d.ts.map +1 -0
  241. package/dist/python/generated.d.ts +2 -0
  242. package/dist/python/generated.d.ts.map +1 -0
  243. package/dist/react/index.d.ts +36 -0
  244. package/dist/react/index.d.ts.map +1 -0
  245. package/dist/registry.d.ts +97 -0
  246. package/dist/registry.d.ts.map +1 -0
  247. package/dist/scaffolds/generated.d.ts +13 -0
  248. package/dist/scaffolds/generated.d.ts.map +1 -0
  249. package/dist/scaffolds/template.d.ts +11 -0
  250. package/dist/scaffolds/template.d.ts.map +1 -0
  251. package/dist/schemas/base.d.ts +254 -0
  252. package/dist/schemas/base.d.ts.map +1 -0
  253. package/dist/selector.d.ts +130 -0
  254. package/dist/selector.d.ts.map +1 -0
  255. package/dist/server.d.ts +89 -0
  256. package/dist/server.d.ts.map +1 -0
  257. package/dist/servers/express.d.ts +104 -0
  258. package/dist/servers/express.d.ts.map +1 -0
  259. package/dist/servers/mcp.d.ts +201 -0
  260. package/dist/servers/mcp.d.ts.map +1 -0
  261. package/dist/servers/socket.d.ts +121 -0
  262. package/dist/servers/socket.d.ts.map +1 -0
  263. package/dist/state.d.ts +24 -0
  264. package/dist/state.d.ts.map +1 -0
  265. package/dist/web/clients/socket.d.ts +37 -0
  266. package/dist/web/clients/socket.d.ts.map +1 -0
  267. package/dist/web/container.d.ts +55 -0
  268. package/dist/web/container.d.ts.map +1 -0
  269. package/dist/web/extension.d.ts +4 -0
  270. package/dist/web/extension.d.ts.map +1 -0
  271. package/dist/web/feature.d.ts +8 -0
  272. package/dist/web/feature.d.ts.map +1 -0
  273. package/dist/web/features/asset-loader.d.ts +35 -0
  274. package/dist/web/features/asset-loader.d.ts.map +1 -0
  275. package/dist/web/features/container-link.d.ts +167 -0
  276. package/dist/web/features/container-link.d.ts.map +1 -0
  277. package/dist/web/features/esbuild.d.ts +51 -0
  278. package/dist/web/features/esbuild.d.ts.map +1 -0
  279. package/dist/web/features/helpers.d.ts +140 -0
  280. package/dist/web/features/helpers.d.ts.map +1 -0
  281. package/dist/web/features/network.d.ts +69 -0
  282. package/dist/web/features/network.d.ts.map +1 -0
  283. package/dist/web/features/speech.d.ts +71 -0
  284. package/dist/web/features/speech.d.ts.map +1 -0
  285. package/dist/web/features/vault.d.ts +62 -0
  286. package/dist/web/features/vault.d.ts.map +1 -0
  287. package/dist/web/features/vm.d.ts +48 -0
  288. package/dist/web/features/vm.d.ts.map +1 -0
  289. package/dist/web/features/voice-recognition.d.ts +96 -0
  290. package/dist/web/features/voice-recognition.d.ts.map +1 -0
  291. package/dist/web/shims/isomorphic-vm.d.ts +22 -0
  292. package/dist/web/shims/isomorphic-vm.d.ts.map +1 -0
  293. package/docs/apis/features/agi/assistant.md +1 -0
  294. package/docs/apis/features/agi/assistants-manager.md +62 -2
  295. package/docs/apis/features/agi/auto-assistant.md +11 -109
  296. package/docs/apis/features/agi/claude-code.md +138 -0
  297. package/docs/apis/features/agi/conversation.md +60 -31
  298. package/docs/apis/features/agi/luca-coder.md +407 -0
  299. package/docs/apis/features/agi/openapi.md +2 -2
  300. package/docs/apis/features/agi/skills-library.md +12 -0
  301. package/docs/apis/features/node/python.md +81 -11
  302. package/docs/apis/features/node/transpiler.md +74 -0
  303. package/docs/apis/features/web/esbuild.md +0 -6
  304. package/docs/apis/servers/mcp.md +2 -2
  305. package/docs/examples/entity.md +124 -0
  306. package/docs/ideas/assistant-factory-pattern.md +142 -0
  307. package/package.json +74 -21
  308. package/src/agi/container.server.ts +10 -0
  309. package/src/agi/feature.ts +13 -0
  310. package/src/agi/features/agent-memory.ts +694 -0
  311. package/src/agi/features/assistant.ts +37 -26
  312. package/src/agi/features/assistants-manager.ts +95 -5
  313. package/src/agi/features/autonomous-assistant.ts +1 -5
  314. package/src/agi/features/browser-use.ts +32 -2
  315. package/src/agi/features/claude-code.ts +165 -1
  316. package/src/agi/features/coding-tools.ts +175 -0
  317. package/src/agi/features/conversation-history.ts +2 -6
  318. package/src/agi/features/conversation.ts +95 -3
  319. package/src/agi/features/docs-reader.ts +2 -1
  320. package/src/agi/features/file-tools.ts +35 -28
  321. package/src/agi/features/luca-coder.ts +1 -5
  322. package/src/agi/features/openai-codex.ts +1 -1
  323. package/src/agi/features/openapi.ts +3 -3
  324. package/src/agi/features/skills-library.ts +111 -13
  325. package/src/agi/lib/interceptor-chain.ts +10 -0
  326. package/src/agi/lib/token-counter.ts +1 -1
  327. package/src/bootstrap/generated.ts +126 -1
  328. package/src/bus.ts +27 -5
  329. package/src/cli/build-info.ts +2 -2
  330. package/src/client.ts +2 -2
  331. package/src/clients/elevenlabs/index.ts +5 -0
  332. package/src/clients/voicebox/index.ts +300 -0
  333. package/src/commands/bootstrap.ts +2 -1
  334. package/src/commands/chat.ts +1 -0
  335. package/src/commands/code.ts +4 -2
  336. package/src/commands/prompt.ts +34 -34
  337. package/src/commands/sandbox-mcp.ts +69 -163
  338. package/src/commands/save-api-docs.ts +10 -8
  339. package/src/commands/select.ts +8 -3
  340. package/src/container-describer.ts +70 -84
  341. package/src/container.ts +93 -3
  342. package/src/endpoint.ts +1 -1
  343. package/src/entity.ts +173 -0
  344. package/src/feature.ts +3 -3
  345. package/src/helper.ts +8 -4
  346. package/src/introspection/generated.agi.ts +3012 -1356
  347. package/src/introspection/generated.node.ts +179 -33
  348. package/src/introspection/generated.web.ts +95 -3
  349. package/src/introspection/scan.ts +1 -1
  350. package/src/node/container.ts +1 -1
  351. package/src/node/features/content-db.ts +57 -30
  352. package/src/node/features/file-manager.ts +10 -9
  353. package/src/node/features/git.ts +5 -5
  354. package/src/node/features/helpers.ts +1 -1
  355. package/src/node/features/json-tree.ts +1 -1
  356. package/src/node/features/os.ts +3 -3
  357. package/src/node/features/package-finder.ts +1 -1
  358. package/src/node/features/process-manager.ts +51 -18
  359. package/src/node/features/python.ts +3 -3
  360. package/src/node/features/redis.ts +1 -1
  361. package/src/node/features/repl.ts +2 -2
  362. package/src/node/features/transpiler.ts +2 -2
  363. package/src/node/features/ui.ts +1 -1
  364. package/src/node/features/vm.ts +3 -3
  365. package/src/node/features/yaml-tree.ts +1 -1
  366. package/src/node.ts +1 -0
  367. package/src/python/generated.ts +1 -1
  368. package/src/scaffolds/generated.ts +1 -1
  369. package/src/selector.ts +74 -4
  370. package/src/server.ts +2 -2
  371. package/src/servers/mcp.ts +6 -6
  372. package/src/web/features/helpers.ts +1 -1
  373. package/src/web/features/network.ts +1 -0
  374. package/test/assistant.test.ts +14 -5
  375. package/test/conversation.test.ts +220 -0
  376. package/test-integration/memory.test.ts +204 -0
  377. package/tsconfig.build.json +12 -0
  378. package/tsconfig.json +1 -1
  379. package/scripts/examples/telegram-ink-ui.ts +0 -302
  380. package/scripts/examples/using-openai-codex.ts +0 -23
  381. package/scripts/examples/vm-loading-esm-modules.ts +0 -16
@@ -0,0 +1,247 @@
1
+ import { z } from 'zod';
2
+ import Redis from 'ioredis';
3
+ import { Feature } from '../feature.js';
4
+ import type { ContainerContext } from '../../container.js';
5
+ export declare const RedisStateSchema: z.ZodObject<{
6
+ enabled: z.ZodDefault<z.ZodBoolean>;
7
+ connected: z.ZodDefault<z.ZodBoolean>;
8
+ url: z.ZodDefault<z.ZodString>;
9
+ subscriberConnected: z.ZodDefault<z.ZodBoolean>;
10
+ subscribedChannels: z.ZodDefault<z.ZodArray<z.ZodString>>;
11
+ lastError: z.ZodOptional<z.ZodString>;
12
+ }, z.core.$loose>;
13
+ export declare const RedisOptionsSchema: z.ZodObject<{
14
+ name: z.ZodOptional<z.ZodString>;
15
+ _cacheKey: z.ZodOptional<z.ZodString>;
16
+ cached: z.ZodOptional<z.ZodBoolean>;
17
+ enable: z.ZodOptional<z.ZodBoolean>;
18
+ url: z.ZodOptional<z.ZodString>;
19
+ prefix: z.ZodOptional<z.ZodString>;
20
+ lazyConnect: z.ZodDefault<z.ZodBoolean>;
21
+ }, z.core.$strip>;
22
+ export type RedisState = z.infer<typeof RedisStateSchema>;
23
+ export type RedisOptions = z.infer<typeof RedisOptionsSchema>;
24
+ export declare const RedisEventsSchema: z.ZodObject<{
25
+ stateChange: z.ZodTuple<[z.ZodAny], null>;
26
+ enabled: z.ZodTuple<[], null>;
27
+ message: z.ZodTuple<[z.ZodString, z.ZodString], null>;
28
+ subscribed: z.ZodTuple<[z.ZodString], null>;
29
+ unsubscribed: z.ZodTuple<[z.ZodString], null>;
30
+ error: z.ZodTuple<[z.ZodString], null>;
31
+ closed: z.ZodTuple<[], null>;
32
+ }, z.core.$strip>;
33
+ type MessageHandler = (channel: string, message: string) => void;
34
+ /**
35
+ * Redis feature for shared state and pub/sub communication between container instances.
36
+ *
37
+ * Wraps ioredis with a focused API for the primitives that matter most:
38
+ * key/value state, pub/sub messaging, and cross-instance coordination.
39
+ *
40
+ * Uses a dedicated subscriber connection for pub/sub (ioredis requirement),
41
+ * created lazily on first subscribe call.
42
+ *
43
+ * @example
44
+ * ```typescript
45
+ * const redis = container.feature('redis', { url: 'redis://localhost:6379' })
46
+ *
47
+ * // Shared state
48
+ * await redis.set('worker:status', 'active')
49
+ * const status = await redis.get('worker:status')
50
+ *
51
+ * // Pub/sub between instances
52
+ * redis.on('message', (channel, msg) => console.log(`${channel}: ${msg}`))
53
+ * await redis.subscribe('tasks')
54
+ * await redis.publish('tasks', JSON.stringify({ type: 'ping' }))
55
+ *
56
+ * // JSON helpers
57
+ * await redis.setJSON('config', { workers: 4, debug: true })
58
+ * const config = await redis.getJSON<{ workers: number }>('config')
59
+ * ```
60
+ */
61
+ export declare class RedisFeature extends Feature<RedisState, RedisOptions> {
62
+ static shortcut: "features.redis";
63
+ static stateSchema: z.ZodObject<{
64
+ enabled: z.ZodDefault<z.ZodBoolean>;
65
+ connected: z.ZodDefault<z.ZodBoolean>;
66
+ url: z.ZodDefault<z.ZodString>;
67
+ subscriberConnected: z.ZodDefault<z.ZodBoolean>;
68
+ subscribedChannels: z.ZodDefault<z.ZodArray<z.ZodString>>;
69
+ lastError: z.ZodOptional<z.ZodString>;
70
+ }, z.core.$loose>;
71
+ static optionsSchema: z.ZodObject<{
72
+ name: z.ZodOptional<z.ZodString>;
73
+ _cacheKey: z.ZodOptional<z.ZodString>;
74
+ cached: z.ZodOptional<z.ZodBoolean>;
75
+ enable: z.ZodOptional<z.ZodBoolean>;
76
+ url: z.ZodOptional<z.ZodString>;
77
+ prefix: z.ZodOptional<z.ZodString>;
78
+ lazyConnect: z.ZodDefault<z.ZodBoolean>;
79
+ }, z.core.$strip>;
80
+ static eventsSchema: z.ZodObject<{
81
+ stateChange: z.ZodTuple<[z.ZodAny], null>;
82
+ enabled: z.ZodTuple<[], null>;
83
+ message: z.ZodTuple<[z.ZodString, z.ZodString], null>;
84
+ subscribed: z.ZodTuple<[z.ZodString], null>;
85
+ unsubscribed: z.ZodTuple<[z.ZodString], null>;
86
+ error: z.ZodTuple<[z.ZodString], null>;
87
+ closed: z.ZodTuple<[], null>;
88
+ }, z.core.$strip>;
89
+ private _client;
90
+ private _subscriber;
91
+ private _prefix;
92
+ private _messageHandlers;
93
+ get initialState(): RedisState;
94
+ constructor(options: RedisOptions, context: ContainerContext);
95
+ /** The underlying ioredis client for advanced operations. */
96
+ get client(): Redis;
97
+ /** The dedicated subscriber connection, if pub/sub is active. */
98
+ get subscriber(): Redis | null;
99
+ private _key;
100
+ /**
101
+ * Set a key to a string value with optional TTL.
102
+ *
103
+ * @param key - The key name
104
+ * @param value - The string value to store
105
+ * @param ttl - Optional time-to-live in seconds
106
+ */
107
+ set(key: string, value: string, ttl?: number): Promise<void>;
108
+ /**
109
+ * Get a key's value. Returns null if the key doesn't exist.
110
+ *
111
+ * @param key - The key name
112
+ * @returns The stored value, or null
113
+ */
114
+ get(key: string): Promise<string | null>;
115
+ /**
116
+ * Delete one or more keys.
117
+ *
118
+ * @param keys - One or more key names to delete
119
+ * @returns Number of keys that were deleted
120
+ */
121
+ del(...keys: string[]): Promise<number>;
122
+ /**
123
+ * Check if a key exists.
124
+ *
125
+ * @param key - The key name
126
+ */
127
+ exists(key: string): Promise<boolean>;
128
+ /**
129
+ * Set a key's TTL in seconds.
130
+ *
131
+ * @param key - The key name
132
+ * @param seconds - TTL in seconds
133
+ */
134
+ expire(key: string, seconds: number): Promise<boolean>;
135
+ /**
136
+ * Find keys matching a glob pattern (respects prefix).
137
+ *
138
+ * @param pattern - Glob pattern, e.g. "worker:*"
139
+ * @returns Array of matching key names (with prefix stripped)
140
+ */
141
+ keys(pattern?: string): Promise<string[]>;
142
+ /**
143
+ * Store a value as JSON.
144
+ *
145
+ * @param key - The key name
146
+ * @param value - Any JSON-serializable value
147
+ * @param ttl - Optional TTL in seconds
148
+ */
149
+ setJSON(key: string, value: unknown, ttl?: number): Promise<void>;
150
+ /**
151
+ * Retrieve and parse a JSON value.
152
+ *
153
+ * @param key - The key name
154
+ * @returns The parsed value, or null if the key doesn't exist
155
+ */
156
+ getJSON<T = unknown>(key: string): Promise<T | null>;
157
+ /**
158
+ * Set fields on a hash.
159
+ *
160
+ * @param key - The hash key
161
+ * @param fields - Object of field/value pairs
162
+ */
163
+ hset(key: string, fields: Record<string, string>): Promise<void>;
164
+ /**
165
+ * Get all fields from a hash.
166
+ *
167
+ * @param key - The hash key
168
+ * @returns Object of field/value pairs
169
+ */
170
+ hgetall(key: string): Promise<Record<string, string>>;
171
+ /**
172
+ * Get a single field from a hash.
173
+ *
174
+ * @param key - The hash key
175
+ * @param field - The field name
176
+ */
177
+ hget(key: string, field: string): Promise<string | null>;
178
+ /**
179
+ * Ensures the dedicated subscriber connection exists.
180
+ * ioredis requires a separate connection for subscriptions.
181
+ */
182
+ private _ensureSubscriber;
183
+ /**
184
+ * Subscribe to one or more channels.
185
+ *
186
+ * Optionally pass a handler that fires only for these channels.
187
+ * The feature also emits a `message` event for all messages.
188
+ *
189
+ * @param channels - Channel name(s) to subscribe to
190
+ * @param handler - Optional per-channel message handler
191
+ *
192
+ * @example
193
+ * ```typescript
194
+ * await redis.subscribe('tasks', (channel, msg) => {
195
+ * console.log(`Got ${msg} on ${channel}`)
196
+ * })
197
+ * ```
198
+ */
199
+ subscribe(channels: string | string[], handler?: MessageHandler): Promise<void>;
200
+ /**
201
+ * Unsubscribe from one or more channels.
202
+ *
203
+ * @param channels - Channel name(s) to unsubscribe from
204
+ */
205
+ unsubscribe(...channels: string[]): Promise<void>;
206
+ /**
207
+ * Publish a message to a channel.
208
+ *
209
+ * @param channel - The channel to publish to
210
+ * @param message - The message string (use JSON.stringify for objects)
211
+ * @returns Number of subscribers that received the message
212
+ */
213
+ publish(channel: string, message: string): Promise<number>;
214
+ /**
215
+ * Spin up a local Redis instance via Docker. Checks if a container with
216
+ * the given name already exists and starts it if stopped, or creates a
217
+ * new one from redis:alpine.
218
+ *
219
+ * Requires the docker feature to be available on the container.
220
+ *
221
+ * @param options - Container name and host port
222
+ * @returns The docker container ID
223
+ *
224
+ * @example
225
+ * ```typescript
226
+ * const redis = container.feature('redis', { url: 'redis://localhost:6379', lazyConnect: true })
227
+ * await redis.ensureLocalDocker()
228
+ * ```
229
+ */
230
+ ensureLocalDocker(options?: {
231
+ name?: string;
232
+ port?: number;
233
+ image?: string;
234
+ }): Promise<string>;
235
+ /**
236
+ * Close all redis connections (main client + subscriber).
237
+ */
238
+ close(): Promise<this>;
239
+ }
240
+ export { RedisFeature as Redis };
241
+ export default RedisFeature;
242
+ declare module '../../feature.js' {
243
+ interface AvailableFeatures {
244
+ redis: typeof RedisFeature;
245
+ }
246
+ }
247
+ //# sourceMappingURL=redis.d.ts.map
@@ -0,0 +1 @@
1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MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAM9D;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAkCzB;;;;;;;;;;;;;;;OAeG;IACG,SAAS,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC;IAwBrF;;;;OAIG;IACG,WAAW,CAAC,GAAG,QAAQ,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBvD;;;;;;OAMG;IACG,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAMhE;;;;;;;;;;;;;;;OAeG;IACG,iBAAiB,CAAC,OAAO,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,OAAO,CAAC,MAAM,CAAC;IA0BxG;;OAEG;IACG,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAe7B;AAED,OAAO,EAAE,YAAY,IAAI,KAAK,EAAE,CAAA;AAChC,eAAe,YAAY,CAAA;AAE3B,OAAO,QAAQ,kBAAkB,CAAC;IAChC,UAAU,iBAAiB;QACzB,KAAK,EAAE,OAAO,YAAY,CAAA;KAC3B;CACF"}
@@ -0,0 +1,84 @@
1
+ import { z } from 'zod';
2
+ import { Feature } from "../feature.js";
3
+ import vm from 'vm';
4
+ import readline from 'readline';
5
+ export declare const ReplStateSchema: z.ZodObject<{
6
+ enabled: z.ZodDefault<z.ZodBoolean>;
7
+ started: z.ZodOptional<z.ZodBoolean>;
8
+ }, z.core.$loose>;
9
+ export type ReplState = z.infer<typeof ReplStateSchema>;
10
+ export declare const ReplOptionsSchema: z.ZodObject<{
11
+ name: z.ZodOptional<z.ZodString>;
12
+ _cacheKey: z.ZodOptional<z.ZodString>;
13
+ cached: z.ZodOptional<z.ZodBoolean>;
14
+ enable: z.ZodOptional<z.ZodBoolean>;
15
+ prompt: z.ZodOptional<z.ZodString>;
16
+ historyPath: z.ZodOptional<z.ZodString>;
17
+ }, z.core.$strip>;
18
+ export type ReplOptions = z.infer<typeof ReplOptionsSchema>;
19
+ /**
20
+ * REPL feature — provides an interactive read-eval-print loop with tab completion and history.
21
+ *
22
+ * Launches a REPL session that evaluates JavaScript/TypeScript expressions in a sandboxed
23
+ * VM context populated with the container and its helpers. Supports tab completion for
24
+ * dot-notation property access, command history persistence, and async/await.
25
+ *
26
+ * @example
27
+ * ```typescript
28
+ * const repl = container.feature('repl', { enable: true })
29
+ * await repl.start({ context: { myVar: 42 } })
30
+ * ```
31
+ */
32
+ export declare class Repl<T extends ReplState = ReplState, K extends ReplOptions = ReplOptions> extends Feature<T, K> {
33
+ static shortcut: "features.repl";
34
+ static stateSchema: z.ZodObject<{
35
+ enabled: z.ZodDefault<z.ZodBoolean>;
36
+ started: z.ZodOptional<z.ZodBoolean>;
37
+ }, z.core.$loose>;
38
+ static optionsSchema: z.ZodObject<{
39
+ name: z.ZodOptional<z.ZodString>;
40
+ _cacheKey: z.ZodOptional<z.ZodString>;
41
+ cached: z.ZodOptional<z.ZodBoolean>;
42
+ enable: z.ZodOptional<z.ZodBoolean>;
43
+ prompt: z.ZodOptional<z.ZodString>;
44
+ historyPath: z.ZodOptional<z.ZodString>;
45
+ }, z.core.$strip>;
46
+ /** Whether the REPL session is currently running. */
47
+ get isStarted(): boolean;
48
+ _rl?: readline.Interface;
49
+ _vmContext?: vm.Context;
50
+ _history: string[];
51
+ _historyPath?: string;
52
+ /** The VM context object used for evaluating expressions in the REPL. */
53
+ get vmContext(): vm.Context | undefined;
54
+ /**
55
+ * Start the REPL session.
56
+ *
57
+ * Creates a VM context populated with the container and its helpers, sets up
58
+ * readline with tab completion and history, then enters the interactive loop.
59
+ * Type `.exit` or `exit` to quit. Supports top-level await.
60
+ *
61
+ * @param options - Configuration for the REPL session
62
+ * @param options.historyPath - Custom path for the history file (defaults to ~/.cache/luca/repl-{cwdHash}.history)
63
+ * @param options.context - Additional variables to inject into the VM context
64
+ * @returns The Repl instance
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const repl = container.feature('repl', { enable: true })
69
+ * await repl.start({
70
+ * context: { db: myDatabase },
71
+ * historyPath: '.repl-history'
72
+ * })
73
+ * ```
74
+ */
75
+ start(options?: {
76
+ historyPath?: string;
77
+ context?: any;
78
+ }): Promise<this>;
79
+ /** Open a fresh readline and enter the REPL loop using the existing VM context. */
80
+ private _resume;
81
+ private _saveHistory;
82
+ }
83
+ export default Repl;
84
+ //# sourceMappingURL=repl.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repl.d.ts","sourceRoot":"","sources":["../../../src/node/features/repl.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AACxC,OAAO,EAAE,MAAM,IAAI,CAAA;AACnB,OAAO,QAAQ,MAAM,UAAU,CAAA;AAG/B,eAAO,MAAM,eAAe;;;iBAE1B,CAAA;AACF,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAA;AAEvD,eAAO,MAAM,iBAAiB;;;;;;;iBAG5B,CAAA;AACF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAE3D;;;;;;;;;;;;GAYG;AACH,qBAAa,IAAI,CACf,CAAC,SAAS,SAAS,GAAG,SAAS,EAC/B,CAAC,SAAS,WAAW,GAAG,WAAW,CACnC,SAAQ,OAAO,CAAC,CAAC,EAAE,CAAC,CAAC;IACrB,OAAgB,QAAQ,EAAG,eAAe,CAAS;IACnD,OAAgB,WAAW;;;sBAAkB;IAC7C,OAAgB,aAAa;;;;;;;sBAAoB;IAGjD,qDA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