@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,527 @@
1
+ import { z } from 'zod';
2
+ import { Feature } from '../feature';
3
+ export declare const RunpodStateSchema: z.ZodObject<{
4
+ enabled: z.ZodDefault<z.ZodBoolean>;
5
+ }, z.core.$loose>;
6
+ export type RunpodState = z.infer<typeof RunpodStateSchema>;
7
+ export declare const RunpodOptionsSchema: z.ZodObject<{
8
+ name: z.ZodOptional<z.ZodString>;
9
+ _cacheKey: z.ZodOptional<z.ZodString>;
10
+ cached: z.ZodOptional<z.ZodBoolean>;
11
+ enable: z.ZodOptional<z.ZodBoolean>;
12
+ apiKey: z.ZodOptional<z.ZodString>;
13
+ dataCenterId: z.ZodOptional<z.ZodString>;
14
+ }, z.core.$strip>;
15
+ export type RunpodOptions = z.infer<typeof RunpodOptionsSchema>;
16
+ /**
17
+ * RunPod feature — manage GPU cloud pods, templates, volumes, and SSH connections via the RunPod REST API.
18
+ *
19
+ * Provides a complete interface for provisioning and managing RunPod GPU instances.
20
+ * Supports creating pods from templates, managing network storage volumes, SSH access
21
+ * via the SecureShell feature, file transfers, and polling for pod readiness.
22
+ *
23
+ * @extends Feature
24
+ *
25
+ * @example
26
+ * ```typescript
27
+ * const runpod = container.feature('runpod', { enable: true })
28
+ * const pod = await runpod.createPod({ gpuTypeId: 'NVIDIA RTX 4090', templateId: 'abc123' })
29
+ * const ready = await runpod.waitForPod(pod.id)
30
+ * const shell = await runpod.getShell(pod.id)
31
+ * await shell.exec('nvidia-smi')
32
+ * ```
33
+ */
34
+ export declare class Runpod extends Feature<RunpodState, RunpodOptions> {
35
+ static shortcut: "features.runpod";
36
+ static envVars: string[];
37
+ static stateSchema: z.ZodObject<{
38
+ enabled: z.ZodDefault<z.ZodBoolean>;
39
+ }, z.core.$loose>;
40
+ static optionsSchema: z.ZodObject<{
41
+ name: z.ZodOptional<z.ZodString>;
42
+ _cacheKey: z.ZodOptional<z.ZodString>;
43
+ cached: z.ZodOptional<z.ZodBoolean>;
44
+ enable: z.ZodOptional<z.ZodBoolean>;
45
+ apiKey: z.ZodOptional<z.ZodString>;
46
+ dataCenterId: z.ZodOptional<z.ZodString>;
47
+ }, z.core.$strip>;
48
+ private _resolvedRunpodctlPath;
49
+ /** The proc feature used for executing CLI commands like runpodctl. */
50
+ get proc(): import("./proc.js").ChildProcess;
51
+ /** Resolve the runpodctl binary path via `which`, caching the result. */
52
+ get runpodctlPath(): string;
53
+ /** RunPod API key from options or the RUNPOD_API_KEY environment variable. */
54
+ get apiKey(): string;
55
+ /** Preferred data center ID, defaults to 'US-TX-3'. */
56
+ get dataCenterId(): string;
57
+ private api;
58
+ /**
59
+ * List available pod templates.
60
+ *
61
+ * @param options - Filter options for templates
62
+ * @param options.includePublic - Include public community templates (default: false)
63
+ * @param options.includeRunpod - Include RunPod official templates (default: true)
64
+ * @returns Array of template info objects
65
+ *
66
+ * @example
67
+ * ```typescript
68
+ * const templates = await runpod.listTemplates({ includeRunpod: true })
69
+ * console.log(templates.map(t => t.name))
70
+ * ```
71
+ */
72
+ listTemplates(options?: {
73
+ includePublic?: boolean;
74
+ includeRunpod?: boolean;
75
+ }): Promise<TemplateInfo[]>;
76
+ /**
77
+ * Get details for a specific template by ID.
78
+ *
79
+ * @param templateId - The template ID to look up
80
+ * @returns Template info object
81
+ *
82
+ * @example
83
+ * ```typescript
84
+ * const template = await runpod.getTemplate('abc123')
85
+ * console.log(template.imageName)
86
+ * ```
87
+ */
88
+ getTemplate(templateId: string): Promise<TemplateInfo>;
89
+ /**
90
+ * Create a new GPU pod on RunPod.
91
+ *
92
+ * @param options - Pod configuration options
93
+ * @returns The created pod info
94
+ *
95
+ * @example
96
+ * ```typescript
97
+ * const pod = await runpod.createPod({
98
+ * gpuTypeId: 'NVIDIA RTX 4090',
99
+ * templateId: 'abc123',
100
+ * volumeInGb: 50,
101
+ * })
102
+ * console.log(`Pod ${pod.id} created`)
103
+ * ```
104
+ */
105
+ createPod(options: CreatePodOptions): Promise<PodInfo>;
106
+ /**
107
+ * Stop a running pod.
108
+ *
109
+ * @param podId - The pod ID to stop
110
+ * @returns API response
111
+ *
112
+ * @example
113
+ * ```typescript
114
+ * await runpod.stopPod('pod-abc123')
115
+ * ```
116
+ */
117
+ stopPod(podId: string): Promise<any>;
118
+ /**
119
+ * Start a stopped pod.
120
+ *
121
+ * @param podId - The pod ID to start
122
+ * @returns API response
123
+ *
124
+ * @example
125
+ * ```typescript
126
+ * await runpod.startPod('pod-abc123')
127
+ * ```
128
+ */
129
+ startPod(podId: string): Promise<any>;
130
+ /**
131
+ * Permanently delete a pod.
132
+ *
133
+ * @param podId - The pod ID to remove
134
+ * @returns API response
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * await runpod.removePod('pod-abc123')
139
+ * ```
140
+ */
141
+ removePod(podId: string): Promise<any>;
142
+ /**
143
+ * Get all pods via the REST API.
144
+ *
145
+ * @param filters - Optional filters for name, image, or status
146
+ * @param filters.name - Filter by pod name
147
+ * @param filters.imageName - Filter by Docker image name
148
+ * @param filters.desiredStatus - Filter by status (RUNNING, EXITED, TERMINATED)
149
+ * @returns Array of pod info objects
150
+ *
151
+ * @example
152
+ * ```typescript
153
+ * const pods = await runpod.getpods({ desiredStatus: 'RUNNING' })
154
+ * console.log(pods.map(p => `${p.name}: ${p.desiredStatus}`))
155
+ * ```
156
+ */
157
+ getpods(filters?: {
158
+ name?: string;
159
+ imageName?: string;
160
+ desiredStatus?: string;
161
+ }): Promise<RestPodInfo[]>;
162
+ /**
163
+ * Get detailed pod info via the REST API.
164
+ *
165
+ * Returns richer data than the CLI-based `getPodInfo`, including port mappings and public IP.
166
+ *
167
+ * @param podId - The pod ID to look up
168
+ * @returns Detailed pod info with port mappings, costs, and GPU details
169
+ *
170
+ * @example
171
+ * ```typescript
172
+ * const pod = await runpod.getPod('pod-abc123')
173
+ * console.log(`${pod.name} - ${pod.desiredStatus} - $${pod.costPerHr}/hr`)
174
+ * ```
175
+ */
176
+ getPod(podId: string): Promise<RestPodInfo>;
177
+ /**
178
+ * Poll until a pod reaches a desired status.
179
+ *
180
+ * @param podId - The pod ID to monitor
181
+ * @param status - Target status to wait for (default: 'RUNNING')
182
+ * @param options - Polling configuration
183
+ * @param options.interval - Polling interval in ms (default: 5000)
184
+ * @param options.timeout - Max wait time in ms (default: 300000)
185
+ * @returns The pod info once it reaches the target status
186
+ * @throws If the pod does not reach the target status within the timeout
187
+ *
188
+ * @example
189
+ * ```typescript
190
+ * const pod = await runpod.createPod({ gpuTypeId: 'NVIDIA RTX 4090', templateId: 'abc' })
191
+ * const ready = await runpod.waitForPod(pod.id, 'RUNNING', { timeout: 120000 })
192
+ * ```
193
+ */
194
+ waitForPod(podId: string, status?: string, { interval, timeout }?: {
195
+ interval?: number | undefined;
196
+ timeout?: number | undefined;
197
+ }): Promise<RestPodInfo>;
198
+ /**
199
+ * List all network storage volumes on your account.
200
+ *
201
+ * @returns Array of volume info objects
202
+ *
203
+ * @example
204
+ * ```typescript
205
+ * const volumes = await runpod.listVolumes()
206
+ * console.log(volumes.map(v => `${v.name}: ${v.size}GB`))
207
+ * ```
208
+ */
209
+ listVolumes(): Promise<VolumeInfo[]>;
210
+ /**
211
+ * Get details for a specific network volume.
212
+ *
213
+ * @param volumeId - The volume ID to look up
214
+ * @returns Volume info object
215
+ *
216
+ * @example
217
+ * ```typescript
218
+ * const vol = await runpod.getVolume('vol-abc123')
219
+ * console.log(`${vol.name}: ${vol.size}GB in ${vol.dataCenterId}`)
220
+ * ```
221
+ */
222
+ getVolume(volumeId: string): Promise<VolumeInfo>;
223
+ /**
224
+ * Create a new network storage volume.
225
+ *
226
+ * @param options - Volume configuration
227
+ * @returns The created volume info
228
+ *
229
+ * @example
230
+ * ```typescript
231
+ * const vol = await runpod.createVolume({ name: 'my-models', size: 100 })
232
+ * console.log(`Created volume ${vol.id}`)
233
+ * ```
234
+ */
235
+ createVolume(options: CreateVolumeOptions): Promise<VolumeInfo>;
236
+ /**
237
+ * Delete a network storage volume.
238
+ *
239
+ * @param volumeId - The volume ID to delete
240
+ * @returns API response
241
+ *
242
+ * @example
243
+ * ```typescript
244
+ * await runpod.removeVolume('vol-abc123')
245
+ * ```
246
+ */
247
+ removeVolume(volumeId: string): Promise<any>;
248
+ /**
249
+ * Create an SSH connection to a pod using the runpodctl CLI.
250
+ *
251
+ * Prefer `getShell()` which uses the REST API and is more reliable.
252
+ *
253
+ * @param podId - The pod ID to connect to
254
+ * @returns A SecureShell feature instance connected to the pod
255
+ *
256
+ * @example
257
+ * ```typescript
258
+ * const shell = await runpod.createRemoteShell('pod-abc123')
259
+ * const output = await shell.exec('nvidia-smi')
260
+ * ```
261
+ */
262
+ createRemoteShell(podId: string): Promise<import("./secure-shell.js").SecureShell>;
263
+ /**
264
+ * Get an SSH connection to a pod using the REST API.
265
+ *
266
+ * Uses port mappings and public IP from the REST API, which is more reliable
267
+ * than the CLI-based `createRemoteShell`.
268
+ *
269
+ * @param podId - The pod ID to connect to
270
+ * @returns A SecureShell feature instance connected to the pod
271
+ * @throws If no SSH port mapping or public IP is found
272
+ *
273
+ * @example
274
+ * ```typescript
275
+ * const shell = await runpod.getShell('pod-abc123')
276
+ * const output = await shell.exec('ls /workspace')
277
+ * ```
278
+ */
279
+ getShell(podId: string): Promise<import("./secure-shell.js").SecureShell>;
280
+ /**
281
+ * Ensure a file exists on a pod's filesystem. If missing, kicks off a background
282
+ * download via a helper script and polls until the file appears.
283
+ *
284
+ * @param podId - The pod ID
285
+ * @param remotePath - Absolute path on the pod where the file should exist
286
+ * @param fallbackUrl - URL to download from (inside the pod) if the file doesn't exist
287
+ * @param options.pollInterval - How often to check in ms (default 5000)
288
+ * @param options.timeout - Max time to wait for download in ms (default 600000 / 10 min)
289
+ * @param options.onProgress - Called each poll with current file size in bytes
290
+ * @returns Object with `existed` (was already there) and `path`
291
+ *
292
+ * @example
293
+ * ```ts
294
+ * await runpod.ensureFileExists(
295
+ * podId,
296
+ * '/workspace/ComfyUI/models/checkpoints/juggernaut_xl.safetensors',
297
+ * 'https://civitai.com/api/download/models/456789',
298
+ * { onProgress: (bytes) => console.log(`${(bytes / 1e9).toFixed(2)} GB downloaded`) }
299
+ * )
300
+ * ```
301
+ */
302
+ ensureFileExists(podId: string, remotePath: string, fallbackUrl: string, options?: {
303
+ pollInterval?: number;
304
+ timeout?: number;
305
+ onProgress?: (bytes: number) => void;
306
+ }): Promise<{
307
+ existed: boolean;
308
+ path: string;
309
+ }>;
310
+ /**
311
+ * Get the public HTTP proxy URLs for a pod's exposed HTTP ports.
312
+ *
313
+ * @param podId - The pod ID
314
+ * @returns Array of public proxy URLs
315
+ *
316
+ * @example
317
+ * ```typescript
318
+ * const urls = await runpod.getPodHttpURLs('pod-abc123')
319
+ * // ['https://pod-abc123-8888.proxy.runpod.net']
320
+ * ```
321
+ */
322
+ getPodHttpURLs(podId: string): Promise<string[]>;
323
+ /**
324
+ * List all pods using the runpodctl CLI.
325
+ *
326
+ * Parses the tabular output from `runpodctl get pod`. For richer data, use `getpods()`.
327
+ *
328
+ * @param detailed - Reserved for future use
329
+ * @returns Array of pod info objects
330
+ *
331
+ * @example
332
+ * ```typescript
333
+ * const pods = await runpod.listPods()
334
+ * pods.forEach(p => console.log(`${p.name} (${p.gpu}): ${p.status}`))
335
+ * ```
336
+ */
337
+ listPods(detailed?: boolean): Promise<PodInfo[]>;
338
+ /**
339
+ * Get pod info using the runpodctl CLI.
340
+ *
341
+ * For richer data including port mappings and public IP, use `getPod()`.
342
+ *
343
+ * @param podId - The pod ID to look up
344
+ * @returns Pod info parsed from CLI output
345
+ *
346
+ * @example
347
+ * ```typescript
348
+ * const info = await runpod.getPodInfo('pod-abc123')
349
+ * console.log(`${info.name}: ${info.status}`)
350
+ * ```
351
+ */
352
+ getPodInfo(podId: string): Promise<PodInfo>;
353
+ /**
354
+ * List available secure GPU types with pricing.
355
+ *
356
+ * Uses the runpodctl CLI to query available secure cloud GPUs, filtering out reserved instances.
357
+ *
358
+ * @returns Array of GPU info with type, memory, CPU count, and pricing
359
+ *
360
+ * @example
361
+ * ```typescript
362
+ * const gpus = await runpod.listSecureGPUs()
363
+ * gpus.forEach(g => console.log(`${g.gpuType}: $${g.ondemandPrice}/hr`))
364
+ * ```
365
+ */
366
+ listSecureGPUs(): Promise<{
367
+ gpuType: string | undefined;
368
+ memory: number;
369
+ cpuCount: number;
370
+ spotPrice: number;
371
+ ondemandPrice: number;
372
+ }[]>;
373
+ }
374
+ export default Runpod;
375
+ type PortInfo = {
376
+ ip: string;
377
+ internal: number;
378
+ external: number;
379
+ serviceType: string;
380
+ isPublic: boolean;
381
+ };
382
+ /**
383
+ * {
384
+ "id": "vv32fbi9y21cxz",
385
+ "name": "RunPod Stable Diffusion",
386
+ "gpu": "1 RTX 4090",
387
+ "imageName": "runpod/stable-diffusion:web-ui-10.2.1",
388
+ "status": "RUNNING",
389
+ "podType": "RESERVED",
390
+ "cpu": "21",
391
+ "memory": "41",
392
+ "containerDisk": "10",
393
+ "volumeDisk": "0",
394
+ "spotPrice": "0.690",
395
+ "ports": [
396
+ {
397
+ "ip": "100.65.22.197",
398
+ "internal": "60014",
399
+ "external": "8888",
400
+ "serviceType": "http",
401
+ "isPublic": false
402
+ },
403
+ {
404
+ "ip": "100.65.22.197",
405
+ "internal": "60013",
406
+ "external": "19123",
407
+ "serviceType": "http",
408
+ "isPublic": false
409
+ },
410
+ {
411
+ "ip": "203.57.40.89",
412
+ "internal": "10020",
413
+ "external": "22",
414
+ "serviceType": "tcp",
415
+ "isPublic": true
416
+ },
417
+ {
418
+ "ip": "100.65.22.197",
419
+ "internal": "60015",
420
+ "external": "3001",
421
+ "serviceType": "http",
422
+ "isPublic": false
423
+ }
424
+ ]
425
+ }
426
+ */
427
+ type PodInfo = {
428
+ id: string;
429
+ name: string;
430
+ gpu: string;
431
+ imageName: string;
432
+ status: string;
433
+ podType: string;
434
+ cpu: string;
435
+ memory: string;
436
+ containerDisk: string;
437
+ volumeDisk: string;
438
+ spotPrice: string;
439
+ ports: PortInfo[];
440
+ };
441
+ type TemplateInfo = {
442
+ id: string;
443
+ name: string;
444
+ category: string;
445
+ imageName: string;
446
+ isPublic: boolean;
447
+ isRunpod: boolean;
448
+ isServerless: boolean;
449
+ containerDiskInGb: number;
450
+ volumeInGb: number;
451
+ volumeMountPath: string;
452
+ ports: string[];
453
+ env: Record<string, string>;
454
+ readme: string;
455
+ };
456
+ type VolumeInfo = {
457
+ id: string;
458
+ name: string;
459
+ size: number;
460
+ dataCenterId: string;
461
+ };
462
+ type CreateVolumeOptions = {
463
+ /** Display name for the volume */
464
+ name: string;
465
+ /** Size in GB */
466
+ size: number;
467
+ /** Data center to create in (defaults to feature's dataCenterId) */
468
+ dataCenterId?: string;
469
+ };
470
+ type RestPodInfo = {
471
+ id: string;
472
+ name: string;
473
+ desiredStatus: 'RUNNING' | 'EXITED' | 'TERMINATED';
474
+ costPerHr: number;
475
+ adjustedCostPerHr: number;
476
+ gpu: {
477
+ id: string;
478
+ count: number;
479
+ displayName: string;
480
+ };
481
+ machine: {
482
+ dataCenterId: string;
483
+ location: string;
484
+ gpuTypeId: string;
485
+ };
486
+ /** Public IP for SSH/TCP connections */
487
+ publicIp: string | null;
488
+ ports: string[];
489
+ /** Maps internal port (e.g. "22") to external port number (e.g. 22122) */
490
+ portMappings: Record<string, number> | null;
491
+ containerDiskInGb: number;
492
+ volumeInGb: number;
493
+ memoryInGb: number;
494
+ vcpuCount: number;
495
+ image: string;
496
+ };
497
+ type CreatePodOptions = {
498
+ /** Pod display name (default: 'luca-pod') */
499
+ name?: string;
500
+ /** Docker image name to run */
501
+ imageName?: string;
502
+ /** GPU type ID or array of acceptable GPU types */
503
+ gpuTypeId: string | string[];
504
+ /** Number of GPUs to allocate (default: 1) */
505
+ gpuCount?: number;
506
+ /** Template ID to use for pod configuration */
507
+ templateId?: string;
508
+ /** Cloud type: 'SECURE' for dedicated or 'COMMUNITY' for shared (default: 'SECURE') */
509
+ cloudType?: 'SECURE' | 'COMMUNITY';
510
+ /** Container disk size in GB (default: 50) */
511
+ containerDiskInGb?: number;
512
+ /** Persistent volume size in GB (default: 20) */
513
+ volumeInGb?: number;
514
+ /** Mount path for the volume (default: '/workspace') */
515
+ volumeMountPath?: string;
516
+ /** Port mappings like ['8888/http', '22/tcp'] */
517
+ ports?: string[];
518
+ /** Environment variables to set in the container */
519
+ env?: Record<string, string>;
520
+ /** Whether the pod can be preempted for spot pricing */
521
+ interruptible?: boolean;
522
+ /** ID of an existing network volume to attach */
523
+ networkVolumeId?: string;
524
+ /** Minimum RAM per GPU in GB */
525
+ minRAMPerGPU?: number;
526
+ };
527
+ //# sourceMappingURL=runpod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runpod.d.ts","sourceRoot":"","sources":["../../../src/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I,CAAA;IACvB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,0EAA0E;IAC1E,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAA;IAC3C,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;CACb,CAAA;AAED,KAAK,gBAAgB,GAAG;IACvB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+BAA+B;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,mDAAmD;IACnD,SAAS,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;IAC5B,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,+CAA+C;IAC/C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,uFAAuF;IACvF,SAAS,CAAC,EAAE,QAAQ,GAAG,WAAW,CAAA;IAClC,8CAA8C;IAC9C,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,wDAAwD;IACxD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,oDAAoD;IACpD,GAAG,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC5B,wDAAwD;IACxD,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,iDAAiD;IACjD,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,gCAAgC;IAChC,YAAY,CAAC,EAAE,MAAM,CAAA;CACrB,CAAA"}
@@ -0,0 +1,145 @@
1
+ import { z } from 'zod';
2
+ import { Feature } from '../feature.js';
3
+ export declare const SecureShellStateSchema: z.ZodObject<{
4
+ enabled: z.ZodDefault<z.ZodBoolean>;
5
+ connected: z.ZodBoolean;
6
+ }, z.core.$loose>;
7
+ export type SecureShellState = z.infer<typeof SecureShellStateSchema>;
8
+ export declare const SecureShellOptionsSchema: 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
+ host: z.ZodOptional<z.ZodString>;
14
+ port: z.ZodOptional<z.ZodNumber>;
15
+ username: z.ZodOptional<z.ZodString>;
16
+ password: z.ZodOptional<z.ZodString>;
17
+ key: z.ZodOptional<z.ZodString>;
18
+ }, z.core.$strip>;
19
+ export type SecureShellOptions = z.infer<typeof SecureShellOptionsSchema>;
20
+ /**
21
+ * SecureShell Feature -- SSH command execution and SCP file transfers.
22
+ *
23
+ * Uses the system `ssh` and `scp` binaries to run commands on remote hosts
24
+ * and transfer files. Supports key-based and password-based authentication
25
+ * through the container's `proc` feature.
26
+ *
27
+ * @example
28
+ * ```typescript
29
+ * const ssh = container.feature('secureShell', {
30
+ * host: '192.168.1.100',
31
+ * username: 'deploy',
32
+ * key: '~/.ssh/id_ed25519',
33
+ * })
34
+ *
35
+ * if (await ssh.testConnection()) {
36
+ * const uptime = await ssh.exec('uptime')
37
+ * console.log(uptime)
38
+ * }
39
+ * ```
40
+ *
41
+ * @extends Feature
42
+ */
43
+ export declare class SecureShell extends Feature<SecureShellState, SecureShellOptions> {
44
+ static shortcut: "features.secureShell";
45
+ static stateSchema: z.ZodObject<{
46
+ enabled: z.ZodDefault<z.ZodBoolean>;
47
+ connected: z.ZodBoolean;
48
+ }, z.core.$loose>;
49
+ static optionsSchema: z.ZodObject<{
50
+ name: z.ZodOptional<z.ZodString>;
51
+ _cacheKey: z.ZodOptional<z.ZodString>;
52
+ cached: z.ZodOptional<z.ZodBoolean>;
53
+ enable: z.ZodOptional<z.ZodBoolean>;
54
+ host: z.ZodOptional<z.ZodString>;
55
+ port: z.ZodOptional<z.ZodNumber>;
56
+ username: z.ZodOptional<z.ZodString>;
57
+ password: z.ZodOptional<z.ZodString>;
58
+ key: z.ZodOptional<z.ZodString>;
59
+ }, z.core.$strip>;
60
+ get initialState(): SecureShellState;
61
+ private _resolvedSshPath;
62
+ private _resolvedScpPath;
63
+ /**
64
+ * Get the proc feature for executing shell commands
65
+ */
66
+ private get proc();
67
+ /** Resolved path to the ssh binary */
68
+ get sshPath(): string;
69
+ /** Resolved path to the scp binary */
70
+ get scpPath(): string;
71
+ /**
72
+ * Validate that required options are provided
73
+ */
74
+ private validateOptions;
75
+ /**
76
+ * Build SSH connection string with authentication options
77
+ */
78
+ private buildSSHConnectionString;
79
+ /**
80
+ * Build SCP connection string for file transfers
81
+ */
82
+ private buildSCPConnectionString;
83
+ /**
84
+ * Test the SSH connection by running a simple echo command on the remote host.
85
+ *
86
+ * Updates `state.connected` based on the result.
87
+ *
88
+ * @returns `true` if the connection succeeds, `false` otherwise (never throws)
89
+ *
90
+ * @example
91
+ * ```typescript
92
+ * const ssh = container.feature('secureShell', { host: 'example.com', username: 'admin', key: '~/.ssh/id_rsa' })
93
+ * const ok = await ssh.testConnection()
94
+ * if (!ok) console.error('SSH connection failed')
95
+ * ```
96
+ */
97
+ testConnection(): Promise<boolean>;
98
+ /**
99
+ * Executes a command on the remote host.
100
+ *
101
+ * @param command - The command to execute on the remote shell
102
+ * @returns The trimmed stdout output of the command
103
+ * @throws {Error} When the SSH command exits with a non-zero code
104
+ *
105
+ * @example
106
+ * ```typescript
107
+ * const ssh = container.feature('secureShell', { host: 'example.com', username: 'admin', key: '~/.ssh/id_rsa' })
108
+ * const listing = await ssh.exec('ls -la /var/log')
109
+ * console.log(listing)
110
+ * ```
111
+ */
112
+ exec(command: string): Promise<string>;
113
+ /**
114
+ * Downloads a file from the remote host via SCP.
115
+ *
116
+ * @param source - The source file path on the remote host
117
+ * @param target - The target file path on the local machine
118
+ * @returns A confirmation message or the scp stdout output
119
+ * @throws {Error} When the SCP transfer fails
120
+ *
121
+ * @example
122
+ * ```typescript
123
+ * const ssh = container.feature('secureShell', { host: 'example.com', username: 'admin', key: '~/.ssh/id_rsa' })
124
+ * await ssh.download('/var/log/app.log', './logs/app.log')
125
+ * ```
126
+ */
127
+ download(source: string, target: string): Promise<string>;
128
+ /**
129
+ * Uploads a file to the remote host via SCP.
130
+ *
131
+ * @param source - The source file path on the local machine
132
+ * @param target - The target file path on the remote host
133
+ * @returns A confirmation message or the scp stdout output
134
+ * @throws {Error} When the SCP transfer fails
135
+ *
136
+ * @example
137
+ * ```typescript
138
+ * const ssh = container.feature('secureShell', { host: 'example.com', username: 'admin', key: '~/.ssh/id_rsa' })
139
+ * await ssh.upload('./build/app.tar.gz', '/opt/releases/app.tar.gz')
140
+ * ```
141
+ */
142
+ upload(source: string, target: string): Promise<string>;
143
+ }
144
+ export default SecureShell;
145
+ //# sourceMappingURL=secure-shell.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"secure-shell.d.ts","sourceRoot":"","sources":["../../../src/node/features/secure-shell.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAEvB,OAAO,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AAEvC,eAAO,MAAM,sBAAsB;;;iBAGjC,CAAA;AACF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AAErE,eAAO,MAAM,wBAAwB;;;;;;;;;;iBAWnC,CAAA;AACF,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,qBAAa,WAAY,SAAQ,OAAO,CAAC,gBAAgB,EAAE,kBAAkB,CAAC;IAC5E,OAAgB,QAAQ,EAAG,sBAAsB,CAAS;IAC1D,OAAgB,WAAW;;;sBAAyB;IACpD,OAAgB,aAAa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