@dreamlake/dreamlake-cli 0.88.0 → 0.89.0

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 (535) hide show
  1. package/dist/api/access.d.ts +83 -0
  2. package/dist/api/access.js +77 -0
  3. package/dist/api/agent.d.ts +156 -0
  4. package/dist/api/agent.js +111 -0
  5. package/dist/api/browser.d.ts +90 -0
  6. package/dist/api/browser.js +102 -0
  7. package/dist/api/client.d.ts +53 -0
  8. package/dist/api/client.js +102 -0
  9. package/dist/api/common.d.ts +28 -0
  10. package/dist/api/common.js +16 -0
  11. package/dist/api/content.d.ts +195 -0
  12. package/dist/api/content.js +147 -0
  13. package/dist/api/execution.d.ts +84 -0
  14. package/dist/api/execution.js +73 -0
  15. package/dist/api/http.d.ts +19 -0
  16. package/dist/api/http.js +66 -0
  17. package/dist/api/index.d.ts +2330 -0
  18. package/dist/api/index.js +114 -0
  19. package/dist/api/infra.d.ts +2 -0
  20. package/dist/api/infra.js +2 -0
  21. package/dist/api/jobs.d.ts +2 -0
  22. package/dist/api/jobs.js +2 -0
  23. package/dist/api/layout.d.ts +2 -0
  24. package/dist/api/layout.js +2 -0
  25. package/dist/api/library-edit.d.ts +3 -0
  26. package/dist/api/library-edit.js +3 -0
  27. package/dist/api/library-manifest.d.ts +2 -0
  28. package/dist/api/library-manifest.js +2 -0
  29. package/dist/api/note-character-plan.d.ts +2 -0
  30. package/dist/api/note-character-plan.js +2 -0
  31. package/dist/api/note-editing.d.ts +2 -0
  32. package/dist/api/note-editing.js +2 -0
  33. package/dist/api/note-edits.d.ts +21 -0
  34. package/dist/api/note-edits.js +10 -0
  35. package/dist/api/note-events.d.ts +5 -0
  36. package/dist/api/note-events.js +11 -0
  37. package/dist/api/note-files.d.ts +75 -0
  38. package/dist/api/note-files.js +65 -0
  39. package/dist/api/note-html-read.d.ts +2 -0
  40. package/dist/api/note-html-read.js +2 -0
  41. package/dist/api/note-html.d.ts +2 -0
  42. package/dist/api/note-html.js +2 -0
  43. package/dist/api/note-toc.d.ts +2 -0
  44. package/dist/api/note-toc.js +2 -0
  45. package/dist/api/notes.d.ts +304 -0
  46. package/dist/api/notes.js +181 -0
  47. package/dist/api/open-resources.d.ts +27 -0
  48. package/dist/api/open-resources.js +102 -0
  49. package/dist/api/ownership.d.ts +12 -0
  50. package/dist/api/ownership.js +24 -0
  51. package/dist/api/platform.d.ts +83 -0
  52. package/dist/api/platform.js +56 -0
  53. package/dist/api/presigned-transfer.d.ts +2 -0
  54. package/dist/api/presigned-transfer.js +2 -0
  55. package/dist/api/registered-runs.d.ts +48 -0
  56. package/dist/api/registered-runs.js +33 -0
  57. package/dist/api/sessions.d.ts +299 -0
  58. package/dist/api/sessions.js +105 -0
  59. package/dist/api/storage.d.ts +46 -0
  60. package/dist/api/storage.js +34 -0
  61. package/dist/api/streams.d.ts +18 -0
  62. package/dist/api/streams.js +70 -0
  63. package/dist/api/vault.d.ts +93 -0
  64. package/dist/api/vault.js +79 -0
  65. package/dist/api/workspace.d.ts +180 -0
  66. package/dist/api/workspace.js +146 -0
  67. package/dist/cli/agent-identity.d.ts +4 -0
  68. package/dist/cli/agent-identity.js +21 -0
  69. package/dist/cli/agents/identity.d.ts +50 -0
  70. package/dist/cli/agents/identity.js +105 -0
  71. package/dist/cli/agents/index.d.ts +31 -0
  72. package/dist/cli/agents/index.js +580 -0
  73. package/dist/cli/agents/manage.d.ts +43 -0
  74. package/dist/cli/agents/manage.js +376 -0
  75. package/dist/cli/agents/spec.d.ts +104 -0
  76. package/dist/cli/agents/spec.js +280 -0
  77. package/dist/cli/agents/web.d.ts +7 -0
  78. package/dist/cli/agents/web.js +109 -0
  79. package/dist/cli/artifact/incremental.d.ts +21 -0
  80. package/dist/cli/artifact/incremental.js +80 -0
  81. package/dist/cli/artifact/index.d.ts +52 -0
  82. package/dist/cli/artifact/index.js +405 -0
  83. package/dist/cli/artifact/meta.d.ts +69 -0
  84. package/dist/cli/artifact/meta.js +189 -0
  85. package/dist/cli/auth/commands.d.ts +29 -0
  86. package/dist/cli/auth/commands.js +327 -0
  87. package/dist/cli/auth/constants.d.ts +13 -0
  88. package/dist/cli/auth/constants.js +18 -0
  89. package/dist/cli/auth/credentials.d.ts +37 -0
  90. package/dist/cli/auth/credentials.js +155 -0
  91. package/dist/cli/auth/device-flow.d.ts +32 -0
  92. package/dist/cli/auth/device-flow.js +154 -0
  93. package/dist/cli/auth/device-secret.d.ts +6 -0
  94. package/dist/cli/auth/device-secret.js +26 -0
  95. package/dist/cli/auth/machine.d.ts +15 -0
  96. package/dist/cli/auth/machine.js +126 -0
  97. package/dist/cli/auth/materialized.d.ts +32 -0
  98. package/dist/cli/auth/materialized.js +102 -0
  99. package/dist/cli/auth/migrate.d.ts +10 -0
  100. package/dist/cli/auth/migrate.js +75 -0
  101. package/dist/cli/client.d.ts +102 -0
  102. package/dist/cli/client.js +206 -0
  103. package/dist/cli/collection-list.d.ts +3 -0
  104. package/dist/cli/collection-list.js +25 -0
  105. package/dist/cli/compat/ctx.d.ts +26 -0
  106. package/dist/cli/compat/ctx.js +76 -0
  107. package/dist/cli/compat/dreamdb-wasm-embedded.d.ts +2 -0
  108. package/dist/cli/compat/dreamdb-wasm-embedded.js +8 -0
  109. package/dist/cli/compat/dreamdb-wasm.d.ts +1 -0
  110. package/dist/cli/compat/dreamdb-wasm.js +26 -0
  111. package/dist/cli/compat/dreamdb.d.ts +112 -0
  112. package/dist/cli/compat/dreamdb.js +219 -0
  113. package/dist/cli/compat/flags.d.ts +2 -0
  114. package/dist/cli/compat/flags.js +13 -0
  115. package/dist/cli/compat/http.d.ts +23 -0
  116. package/dist/cli/compat/http.js +137 -0
  117. package/dist/cli/compat/presignedTransfer.d.ts +139 -0
  118. package/dist/cli/compat/presignedTransfer.js +580 -0
  119. package/dist/cli/compat/s3-backend.d.ts +73 -0
  120. package/dist/cli/compat/s3-backend.js +132 -0
  121. package/dist/cli/config.d.ts +22 -0
  122. package/dist/cli/config.js +96 -0
  123. package/dist/cli/connection/dto.d.ts +159 -0
  124. package/dist/cli/connection/dto.js +497 -0
  125. package/dist/cli/connection/index.d.ts +50 -0
  126. package/dist/cli/connection/index.js +413 -0
  127. package/dist/cli/connection/oauth.d.ts +23 -0
  128. package/dist/cli/connection/oauth.js +290 -0
  129. package/dist/cli/connection/write.d.ts +47 -0
  130. package/dist/cli/connection/write.js +573 -0
  131. package/dist/cli/create/index.d.ts +19 -0
  132. package/dist/cli/create/index.js +209 -0
  133. package/dist/cli/declare/index.d.ts +29 -0
  134. package/dist/cli/declare/index.js +304 -0
  135. package/dist/cli/delete/index.d.ts +18 -0
  136. package/dist/cli/delete/index.js +232 -0
  137. package/dist/cli/download/index.d.ts +9 -0
  138. package/dist/cli/download/index.js +128 -0
  139. package/dist/cli/env/compose.d.ts +88 -0
  140. package/dist/cli/env/compose.js +402 -0
  141. package/dist/cli/env/index.d.ts +176 -0
  142. package/dist/cli/env/index.js +1011 -0
  143. package/dist/cli/experiments/index.d.ts +11 -0
  144. package/dist/cli/experiments/index.js +168 -0
  145. package/dist/cli/glob.d.ts +1 -0
  146. package/dist/cli/glob.js +45 -0
  147. package/dist/cli/graphql-helpers.d.ts +23 -0
  148. package/dist/cli/graphql-helpers.js +42 -0
  149. package/dist/cli/graphql.d.ts +10 -0
  150. package/dist/cli/graphql.js +47 -0
  151. package/dist/cli/help-examples.generated.d.ts +1 -0
  152. package/dist/cli/help-examples.generated.js +192 -0
  153. package/dist/cli/helpers.d.ts +8 -0
  154. package/dist/cli/helpers.js +106 -0
  155. package/dist/cli/hosts/api.d.ts +29 -0
  156. package/dist/cli/hosts/api.js +54 -0
  157. package/dist/cli/hosts/bootstrap-source.d.ts +1 -0
  158. package/dist/cli/hosts/bootstrap-source.js +2 -0
  159. package/dist/cli/hosts/catalog.d.ts +26 -0
  160. package/dist/cli/hosts/catalog.js +55 -0
  161. package/dist/cli/hosts/config.d.ts +45 -0
  162. package/dist/cli/hosts/config.js +179 -0
  163. package/dist/cli/hosts/credentials.d.ts +19 -0
  164. package/dist/cli/hosts/credentials.js +173 -0
  165. package/dist/cli/hosts/enroll.d.ts +17 -0
  166. package/dist/cli/hosts/enroll.js +109 -0
  167. package/dist/cli/hosts/enrollments.d.ts +25 -0
  168. package/dist/cli/hosts/enrollments.js +54 -0
  169. package/dist/cli/hosts/index.d.ts +6 -0
  170. package/dist/cli/hosts/index.js +279 -0
  171. package/dist/cli/hosts/inventory.d.ts +40 -0
  172. package/dist/cli/hosts/inventory.js +91 -0
  173. package/dist/cli/hosts/lifecycle.d.ts +15 -0
  174. package/dist/cli/hosts/lifecycle.js +108 -0
  175. package/dist/cli/hosts/metrics-source.d.ts +12 -0
  176. package/dist/cli/hosts/metrics-source.js +89 -0
  177. package/dist/cli/hosts/observations.d.ts +39 -0
  178. package/dist/cli/hosts/observations.js +102 -0
  179. package/dist/cli/hosts/remote.d.ts +5 -0
  180. package/dist/cli/hosts/remote.js +66 -0
  181. package/dist/cli/hosts/ssh.d.ts +63 -0
  182. package/dist/cli/hosts/ssh.js +276 -0
  183. package/dist/cli/index.d.ts +1 -0
  184. package/dist/cli/index.js +288 -0
  185. package/dist/cli/infra/api.d.ts +95 -0
  186. package/dist/cli/infra/api.js +291 -0
  187. package/dist/cli/infra/index.d.ts +5 -0
  188. package/dist/cli/infra/index.js +102 -0
  189. package/dist/cli/infra/move.d.ts +15 -0
  190. package/dist/cli/infra/move.js +123 -0
  191. package/dist/cli/infra/transfer.d.ts +15 -0
  192. package/dist/cli/infra/transfer.js +280 -0
  193. package/dist/cli/jobs/api.d.ts +69 -0
  194. package/dist/cli/jobs/api.js +121 -0
  195. package/dist/cli/jobs/index.d.ts +5 -0
  196. package/dist/cli/jobs/index.js +140 -0
  197. package/dist/cli/lakeshore/index.d.ts +98 -0
  198. package/dist/cli/lakeshore/index.js +502 -0
  199. package/dist/cli/launch/index.d.ts +43 -0
  200. package/dist/cli/launch/index.js +270 -0
  201. package/dist/cli/layout/index.d.ts +2 -0
  202. package/dist/cli/layout/index.js +44 -0
  203. package/dist/cli/layout/transport.d.ts +12 -0
  204. package/dist/cli/layout/transport.js +70 -0
  205. package/dist/cli/library/add.d.ts +60 -0
  206. package/dist/cli/library/add.js +348 -0
  207. package/dist/cli/library/cache.d.ts +26 -0
  208. package/dist/cli/library/cache.js +88 -0
  209. package/dist/cli/library/config.d.ts +75 -0
  210. package/dist/cli/library/config.js +198 -0
  211. package/dist/cli/library/digest.d.ts +5 -0
  212. package/dist/cli/library/digest.js +19 -0
  213. package/dist/cli/library/discover.d.ts +87 -0
  214. package/dist/cli/library/discover.js +534 -0
  215. package/dist/cli/library/freshness.d.ts +35 -0
  216. package/dist/cli/library/freshness.js +109 -0
  217. package/dist/cli/library/generation.d.ts +35 -0
  218. package/dist/cli/library/generation.js +211 -0
  219. package/dist/cli/library/index.d.ts +2 -0
  220. package/dist/cli/library/index.js +36 -0
  221. package/dist/cli/library/info.d.ts +69 -0
  222. package/dist/cli/library/info.js +311 -0
  223. package/dist/cli/library/list.d.ts +33 -0
  224. package/dist/cli/library/list.js +86 -0
  225. package/dist/cli/library/manifest.d.ts +81 -0
  226. package/dist/cli/library/manifest.js +200 -0
  227. package/dist/cli/library/manifestCache.d.ts +45 -0
  228. package/dist/cli/library/manifestCache.js +169 -0
  229. package/dist/cli/library/pull.d.ts +30 -0
  230. package/dist/cli/library/pull.js +438 -0
  231. package/dist/cli/library/push.d.ts +72 -0
  232. package/dist/cli/library/push.js +642 -0
  233. package/dist/cli/library/rm.d.ts +31 -0
  234. package/dist/cli/library/rm.js +200 -0
  235. package/dist/cli/library/search.d.ts +18 -0
  236. package/dist/cli/library/search.js +181 -0
  237. package/dist/cli/library/stat.d.ts +15 -0
  238. package/dist/cli/library/stat.js +127 -0
  239. package/dist/cli/library/tools.d.ts +104 -0
  240. package/dist/cli/library/tools.js +163 -0
  241. package/dist/cli/library/wire.d.ts +47 -0
  242. package/dist/cli/library/wire.js +120 -0
  243. package/dist/cli/list/index.d.ts +26 -0
  244. package/dist/cli/list/index.js +256 -0
  245. package/dist/cli/notes/character-plan.d.ts +22 -0
  246. package/dist/cli/notes/character-plan.js +232 -0
  247. package/dist/cli/notes/document.d.ts +73 -0
  248. package/dist/cli/notes/document.js +306 -0
  249. package/dist/cli/notes/edit-commands.d.ts +106 -0
  250. package/dist/cli/notes/edit-commands.js +623 -0
  251. package/dist/cli/notes/editing.d.ts +81 -0
  252. package/dist/cli/notes/editing.js +305 -0
  253. package/dist/cli/notes/events.d.ts +36 -0
  254. package/dist/cli/notes/events.js +54 -0
  255. package/dist/cli/notes/files-commands.d.ts +120 -0
  256. package/dist/cli/notes/files-commands.js +554 -0
  257. package/dist/cli/notes/html-read.d.ts +9 -0
  258. package/dist/cli/notes/html-read.js +90 -0
  259. package/dist/cli/notes/html.d.ts +73 -0
  260. package/dist/cli/notes/html.js +381 -0
  261. package/dist/cli/notes/index.d.ts +123 -0
  262. package/dist/cli/notes/index.js +1303 -0
  263. package/dist/cli/notes/linger.d.ts +59 -0
  264. package/dist/cli/notes/linger.js +339 -0
  265. package/dist/cli/notes/media-commands.d.ts +5 -0
  266. package/dist/cli/notes/media-commands.js +51 -0
  267. package/dist/cli/notes/move-command.d.ts +83 -0
  268. package/dist/cli/notes/move-command.js +259 -0
  269. package/dist/cli/notes/rm-command.d.ts +22 -0
  270. package/dist/cli/notes/rm-command.js +110 -0
  271. package/dist/cli/notes/select-command.d.ts +12 -0
  272. package/dist/cli/notes/select-command.js +84 -0
  273. package/dist/cli/notes/suggest-diff.d.ts +56 -0
  274. package/dist/cli/notes/suggest-diff.js +311 -0
  275. package/dist/cli/notes/toc.d.ts +38 -0
  276. package/dist/cli/notes/toc.js +144 -0
  277. package/dist/cli/notes/transfer-command.d.ts +6 -0
  278. package/dist/cli/notes/transfer-command.js +9 -0
  279. package/dist/cli/notes/version-commands.d.ts +19 -0
  280. package/dist/cli/notes/version-commands.js +178 -0
  281. package/dist/cli/nymph/index.d.ts +74 -0
  282. package/dist/cli/nymph/index.js +349 -0
  283. package/dist/cli/org/index.d.ts +34 -0
  284. package/dist/cli/org/index.js +341 -0
  285. package/dist/cli/ownership/index.d.ts +12 -0
  286. package/dist/cli/ownership/index.js +122 -0
  287. package/dist/cli/ownership/metadata-transfer.d.ts +20 -0
  288. package/dist/cli/ownership/metadata-transfer.js +159 -0
  289. package/dist/cli/page/index.d.ts +58 -0
  290. package/dist/cli/page/index.js +387 -0
  291. package/dist/cli/pipeline/index.d.ts +69 -0
  292. package/dist/cli/pipeline/index.js +604 -0
  293. package/dist/cli/progress.d.ts +60 -0
  294. package/dist/cli/progress.js +276 -0
  295. package/dist/cli/project/attachments.d.ts +10 -0
  296. package/dist/cli/project/attachments.js +39 -0
  297. package/dist/cli/project/grants.d.ts +10 -0
  298. package/dist/cli/project/grants.js +39 -0
  299. package/dist/cli/project/index.d.ts +8 -0
  300. package/dist/cli/project/index.js +92 -0
  301. package/dist/cli/project/move.d.ts +57 -0
  302. package/dist/cli/project/move.js +242 -0
  303. package/dist/cli/project/output.d.ts +2 -0
  304. package/dist/cli/project/output.js +29 -0
  305. package/dist/cli/project/stream.d.ts +55 -0
  306. package/dist/cli/project/stream.js +207 -0
  307. package/dist/cli/project/transfer-preview.d.ts +8 -0
  308. package/dist/cli/project/transfer-preview.js +10 -0
  309. package/dist/cli/prompt.d.ts +1 -0
  310. package/dist/cli/prompt.js +17 -0
  311. package/dist/cli/provider/dreamdir.d.ts +52 -0
  312. package/dist/cli/provider/dreamdir.js +138 -0
  313. package/dist/cli/provider/index.d.ts +4 -0
  314. package/dist/cli/provider/index.js +419 -0
  315. package/dist/cli/provider/jump-worker.d.ts +9 -0
  316. package/dist/cli/provider/jump-worker.js +141 -0
  317. package/dist/cli/provider/lifecycle.d.ts +149 -0
  318. package/dist/cli/provider/lifecycle.js +1390 -0
  319. package/dist/cli/provider/machine.d.ts +17 -0
  320. package/dist/cli/provider/machine.js +116 -0
  321. package/dist/cli/provider/ssh.d.ts +105 -0
  322. package/dist/cli/provider/ssh.js +305 -0
  323. package/dist/cli/provider/terraform.d.ts +140 -0
  324. package/dist/cli/provider/terraform.js +288 -0
  325. package/dist/cli/providers/index.d.ts +18 -0
  326. package/dist/cli/providers/index.js +422 -0
  327. package/dist/cli/python.d.ts +61 -0
  328. package/dist/cli/python.js +255 -0
  329. package/dist/cli/queues/index.d.ts +33 -0
  330. package/dist/cli/queues/index.js +248 -0
  331. package/dist/cli/queues/slurm.d.ts +10 -0
  332. package/dist/cli/queues/slurm.js +134 -0
  333. package/dist/cli/resources.d.ts +72 -0
  334. package/dist/cli/resources.js +137 -0
  335. package/dist/cli/run/index.d.ts +15 -0
  336. package/dist/cli/run/index.js +163 -0
  337. package/dist/cli/run/input.d.ts +34 -0
  338. package/dist/cli/run/input.js +135 -0
  339. package/dist/cli/run/recovery.d.ts +2 -0
  340. package/dist/cli/run/recovery.js +18 -0
  341. package/dist/cli/run/setup.d.ts +3 -0
  342. package/dist/cli/run/setup.js +62 -0
  343. package/dist/cli/runconfig/index.d.ts +12 -0
  344. package/dist/cli/runconfig/index.js +130 -0
  345. package/dist/cli/runnable/index.d.ts +35 -0
  346. package/dist/cli/runnable/index.js +575 -0
  347. package/dist/cli/runnable/path.d.ts +115 -0
  348. package/dist/cli/runnable/path.js +288 -0
  349. package/dist/cli/runnable/run.d.ts +91 -0
  350. package/dist/cli/runnable/run.js +239 -0
  351. package/dist/cli/runnable/upload.d.ts +43 -0
  352. package/dist/cli/runnable/upload.js +342 -0
  353. package/dist/cli/runnable/worker.d.ts +1 -0
  354. package/dist/cli/runnable/worker.js +44 -0
  355. package/dist/cli/schemas/workflow-spec.schema.json +335 -0
  356. package/dist/cli/self-update/index.d.ts +5 -0
  357. package/dist/cli/self-update/index.js +107 -0
  358. package/dist/cli/self-update/install.d.ts +60 -0
  359. package/dist/cli/self-update/install.js +428 -0
  360. package/dist/cli/self-update/paths.d.ts +40 -0
  361. package/dist/cli/self-update/paths.js +87 -0
  362. package/dist/cli/self-update/releases.d.ts +41 -0
  363. package/dist/cli/self-update/releases.js +153 -0
  364. package/dist/cli/self-update/settings.d.ts +16 -0
  365. package/dist/cli/self-update/settings.js +68 -0
  366. package/dist/cli/self-update/update.d.ts +18 -0
  367. package/dist/cli/self-update/update.js +241 -0
  368. package/dist/cli/service-accounts/index.d.ts +3 -0
  369. package/dist/cli/service-accounts/index.js +149 -0
  370. package/dist/cli/session-affiliation.d.ts +26 -0
  371. package/dist/cli/session-affiliation.js +135 -0
  372. package/dist/cli/sessions/affiliation.d.ts +8 -0
  373. package/dist/cli/sessions/affiliation.js +66 -0
  374. package/dist/cli/sessions/api.d.ts +55 -0
  375. package/dist/cli/sessions/api.js +88 -0
  376. package/dist/cli/sessions/control.d.ts +6 -0
  377. package/dist/cli/sessions/control.js +159 -0
  378. package/dist/cli/sessions/conversation.d.ts +15 -0
  379. package/dist/cli/sessions/conversation.js +118 -0
  380. package/dist/cli/sessions/index.d.ts +2 -0
  381. package/dist/cli/sessions/index.js +209 -0
  382. package/dist/cli/sessions/managed.d.ts +39 -0
  383. package/dist/cli/sessions/managed.js +63 -0
  384. package/dist/cli/sessions/redaction.d.ts +2 -0
  385. package/dist/cli/sessions/redaction.js +11 -0
  386. package/dist/cli/sessions/runner/exec.d.ts +108 -0
  387. package/dist/cli/sessions/runner/exec.js +335 -0
  388. package/dist/cli/sessions/runner/journal.d.ts +26 -0
  389. package/dist/cli/sessions/runner/journal.js +49 -0
  390. package/dist/cli/sessions/runner/native.d.ts +48 -0
  391. package/dist/cli/sessions/runner/native.js +170 -0
  392. package/dist/cli/sessions/runner/pod.d.ts +30 -0
  393. package/dist/cli/sessions/runner/pod.js +129 -0
  394. package/dist/cli/sessions/runner/serve.d.ts +85 -0
  395. package/dist/cli/sessions/runner/serve.js +558 -0
  396. package/dist/cli/sessions/sync.d.ts +47 -0
  397. package/dist/cli/sessions/sync.js +80 -0
  398. package/dist/cli/sessions/transport.d.ts +14 -0
  399. package/dist/cli/sessions/transport.js +116 -0
  400. package/dist/cli/share.d.ts +15 -0
  401. package/dist/cli/share.js +139 -0
  402. package/dist/cli/skill/catalog.d.ts +141 -0
  403. package/dist/cli/skill/catalog.js +442 -0
  404. package/dist/cli/skill/files.d.ts +89 -0
  405. package/dist/cli/skill/files.js +264 -0
  406. package/dist/cli/skill/index.d.ts +268 -0
  407. package/dist/cli/skill/index.js +1216 -0
  408. package/dist/cli/skill/manifest.d.ts +30 -0
  409. package/dist/cli/skill/manifest.js +101 -0
  410. package/dist/cli/skill/prefs.d.ts +9 -0
  411. package/dist/cli/skill/prefs.js +32 -0
  412. package/dist/cli/skill/reminders.d.ts +15 -0
  413. package/dist/cli/skill/reminders.js +105 -0
  414. package/dist/cli/skill/tar.d.ts +17 -0
  415. package/dist/cli/skill/tar.js +195 -0
  416. package/dist/cli/snapshot/index.d.ts +24 -0
  417. package/dist/cli/snapshot/index.js +146 -0
  418. package/dist/cli/source/access.d.ts +45 -0
  419. package/dist/cli/source/access.js +563 -0
  420. package/dist/cli/source/control.d.ts +103 -0
  421. package/dist/cli/source/control.js +546 -0
  422. package/dist/cli/source/delete.d.ts +89 -0
  423. package/dist/cli/source/delete.js +463 -0
  424. package/dist/cli/source/index.d.ts +288 -0
  425. package/dist/cli/source/index.js +1348 -0
  426. package/dist/cli/source/share.d.ts +65 -0
  427. package/dist/cli/source/share.js +530 -0
  428. package/dist/cli/source/upload.d.ts +62 -0
  429. package/dist/cli/source/upload.js +258 -0
  430. package/dist/cli/source/write.d.ts +77 -0
  431. package/dist/cli/source/write.js +335 -0
  432. package/dist/cli/spawn.d.ts +28 -0
  433. package/dist/cli/spawn.js +81 -0
  434. package/dist/cli/target.d.ts +22 -0
  435. package/dist/cli/target.js +85 -0
  436. package/dist/cli/tasks/index.d.ts +38 -0
  437. package/dist/cli/tasks/index.js +365 -0
  438. package/dist/cli/team/index.d.ts +37 -0
  439. package/dist/cli/team/index.js +407 -0
  440. package/dist/cli/telemetry.d.ts +23 -0
  441. package/dist/cli/telemetry.js +262 -0
  442. package/dist/cli/telemetryJournal.d.ts +26 -0
  443. package/dist/cli/telemetryJournal.js +104 -0
  444. package/dist/cli/update/index.d.ts +21 -0
  445. package/dist/cli/update/index.js +284 -0
  446. package/dist/cli/upload/index.d.ts +11 -0
  447. package/dist/cli/upload/index.js +261 -0
  448. package/dist/cli/upload/kinds.d.ts +10 -0
  449. package/dist/cli/upload/kinds.js +85 -0
  450. package/dist/cli/upload/multipart.d.ts +21 -0
  451. package/dist/cli/upload/multipart.js +248 -0
  452. package/dist/cli/vault/affected-preview.d.ts +15 -0
  453. package/dist/cli/vault/affected-preview.js +38 -0
  454. package/dist/cli/vault/cloud.d.ts +55 -0
  455. package/dist/cli/vault/cloud.js +287 -0
  456. package/dist/cli/vault/format.d.ts +18 -0
  457. package/dist/cli/vault/format.js +104 -0
  458. package/dist/cli/vault/hostCredentials.d.ts +21 -0
  459. package/dist/cli/vault/hostCredentials.js +71 -0
  460. package/dist/cli/vault/hostSupersessions.d.ts +18 -0
  461. package/dist/cli/vault/hostSupersessions.js +68 -0
  462. package/dist/cli/vault/import.d.ts +3 -0
  463. package/dist/cli/vault/import.js +79 -0
  464. package/dist/cli/vault/index.d.ts +14 -0
  465. package/dist/cli/vault/index.js +225 -0
  466. package/dist/cli/vault/keys.d.ts +5 -0
  467. package/dist/cli/vault/keys.js +165 -0
  468. package/dist/cli/vault/kms.d.ts +6 -0
  469. package/dist/cli/vault/kms.js +169 -0
  470. package/dist/cli/vault/list.d.ts +13 -0
  471. package/dist/cli/vault/list.js +60 -0
  472. package/dist/cli/vault/listView.d.ts +21 -0
  473. package/dist/cli/vault/listView.js +123 -0
  474. package/dist/cli/vault/managementMetadata.d.ts +2 -0
  475. package/dist/cli/vault/managementMetadata.js +23 -0
  476. package/dist/cli/vault/mutations.d.ts +8 -0
  477. package/dist/cli/vault/mutations.js +151 -0
  478. package/dist/cli/vault/otp.d.ts +6 -0
  479. package/dist/cli/vault/otp.js +62 -0
  480. package/dist/cli/vault/otpIntent.d.ts +23 -0
  481. package/dist/cli/vault/otpIntent.js +76 -0
  482. package/dist/cli/vault/passImport.d.ts +25 -0
  483. package/dist/cli/vault/passImport.js +129 -0
  484. package/dist/cli/vault/passOtp.d.ts +51 -0
  485. package/dist/cli/vault/passOtp.js +101 -0
  486. package/dist/cli/vault/passStore.d.ts +26 -0
  487. package/dist/cli/vault/passStore.js +134 -0
  488. package/dist/cli/vault/passwordCommand.d.ts +39 -0
  489. package/dist/cli/vault/passwordCommand.js +101 -0
  490. package/dist/cli/vault/passwordProbe.d.ts +27 -0
  491. package/dist/cli/vault/passwordProbe.js +282 -0
  492. package/dist/cli/vault/passwordRotation.d.ts +9 -0
  493. package/dist/cli/vault/passwordRotation.js +273 -0
  494. package/dist/cli/vault/rotationApi.d.ts +13 -0
  495. package/dist/cli/vault/rotationApi.js +58 -0
  496. package/dist/cli/vault/rotationCommand.d.ts +2 -0
  497. package/dist/cli/vault/rotationCommand.js +75 -0
  498. package/dist/cli/vault/rotationEngine.d.ts +19 -0
  499. package/dist/cli/vault/rotationEngine.js +65 -0
  500. package/dist/cli/vault/rotationHelperSource.d.ts +2 -0
  501. package/dist/cli/vault/rotationHelperSource.js +3 -0
  502. package/dist/cli/vault/rotationInput.d.ts +11 -0
  503. package/dist/cli/vault/rotationInput.js +48 -0
  504. package/dist/cli/vault/rotationJournal.d.ts +16 -0
  505. package/dist/cli/vault/rotationJournal.js +183 -0
  506. package/dist/cli/vault/rotationKeys.d.ts +4 -0
  507. package/dist/cli/vault/rotationKeys.js +48 -0
  508. package/dist/cli/vault/rotationPrepare.d.ts +17 -0
  509. package/dist/cli/vault/rotationPrepare.js +108 -0
  510. package/dist/cli/vault/rotationRemote.d.ts +33 -0
  511. package/dist/cli/vault/rotationRemote.js +156 -0
  512. package/dist/cli/vault/rotationState.d.ts +42 -0
  513. package/dist/cli/vault/rotationState.js +115 -0
  514. package/dist/cli/vault/rotationTransport.d.ts +18 -0
  515. package/dist/cli/vault/rotationTransport.js +71 -0
  516. package/dist/cli/vault/sshSource.d.ts +18 -0
  517. package/dist/cli/vault/sshSource.js +196 -0
  518. package/dist/cli/vault/sshSync.d.ts +17 -0
  519. package/dist/cli/vault/sshSync.js +224 -0
  520. package/dist/cli/vault/sshTransfer.d.ts +22 -0
  521. package/dist/cli/vault/sshTransfer.js +140 -0
  522. package/dist/cli/vault/terraformState.d.ts +66 -0
  523. package/dist/cli/vault/terraformState.js +252 -0
  524. package/dist/cli/vault/terraformStateCommand.d.ts +2 -0
  525. package/dist/cli/vault/terraformStateCommand.js +61 -0
  526. package/dist/cli/vault/tree.d.ts +43 -0
  527. package/dist/cli/vault/tree.js +292 -0
  528. package/dist/cli/version.d.ts +1 -0
  529. package/dist/cli/version.js +9 -0
  530. package/dist/cli/workflow/index.d.ts +76 -0
  531. package/dist/cli/workflow/index.js +826 -0
  532. package/dist/cli/workflow/validate.d.ts +19 -0
  533. package/dist/cli/workflow/validate.js +353 -0
  534. package/dist/package.json +1 -0
  535. package/package.json +28 -10
@@ -0,0 +1,502 @@
1
+ // The engine behind `dreamlake provider|storage|queue-def …` — one generic
2
+ // implementation of the five verbs dreamlake-server exposes for its three
3
+ // lakeshore resource collections.
4
+ //
5
+ // WHY A GENERIC ENGINE BEHIND NOUN GROUPS, and not either one alone.
6
+ //
7
+ // The server has exactly one registrar: `routes/lakeshore-resources.ts:183-478`
8
+ // emits five identical routes for three specs that differ only in
9
+ // path / permission / model / label / listKey / hasSecret / defaultKind
10
+ // (LAKESHORE_COLLECTIONS, :59-95). `declare`'s own header comment already ruled
11
+ // on that shape once — "Five groups would be five copies of one function."
12
+ //
13
+ // But `dreamlake lakeshore lakeshore-providers list` is not a command anybody
14
+ // types, and every other group in this CLI is a noun: runnable, runconfig,
15
+ // pipeline, dataset, project, source, org, team. So the LOGIC lives here, once,
16
+ // and `provider/index.ts` spends its lines on help text rather than on copies.
17
+ //
18
+ // This file deliberately registers nothing with Commander. Tests across this
19
+ // whole suite import the `run*` functions directly and assert on the returned
20
+ // exit code; the registration wrappers are untested by convention.
21
+ //
22
+ // THREE SERVER BEHAVIOURS ARE EASY TO GET WRONG, and each is called out again
23
+ // at the point of use below:
24
+ //
25
+ // 1. PATCH replaces `config` WHOLESALE (lakeshore-resources.ts:431). It is
26
+ // not a deep merge. A partial `--config` silently drops every key you
27
+ // left out, so `update` prints a warning before it writes.
28
+ // 2. DELETE is a SOFT delete that answers 200 `{ success: true }` — never a
29
+ // 204. The body is the only signal there is, so a 200 without it is not
30
+ // treated as success.
31
+ // 3. The encrypted secret blob is never returned by any route (:17, :153).
32
+ // `hasSecret` is the whole story. Nothing here can print a credential
33
+ // back, and no output implies that it could.
34
+ //
35
+ // Permissions (permissions.config.ts:54-57): read → ADMIN | READ;
36
+ // create / update / delete → ADMIN only. A member with READ gets a 403 on
37
+ // every write verb, which is why the 403 messages name the verb rather than
38
+ // saying "forbidden".
39
+ import { HttpError, requestJson } from "../client.js";
40
+ import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
41
+ import { emitJson, fail, loadStructuredFile, ok, renderTable, warn } from "../helpers.js";
42
+ import { confirm } from "../prompt.js";
43
+ export const PROVIDER_SPEC = {
44
+ group: "provider",
45
+ path: "lakeshore-providers",
46
+ listKey: "providers",
47
+ label: "lakeshore provider",
48
+ plural: "providers",
49
+ hasSecret: true,
50
+ kindRequired: true,
51
+ };
52
+ export const STORAGE_SPEC = {
53
+ group: "storage",
54
+ path: "lakeshore-storages",
55
+ listKey: "storages",
56
+ label: "lakeshore storage",
57
+ plural: "storages",
58
+ hasSecret: true,
59
+ kindRequired: true,
60
+ };
61
+ export const QUEUE_DEF_SPEC = {
62
+ group: "queue-def",
63
+ path: "lakeshore-queue-defs",
64
+ listKey: "queueDefs",
65
+ label: "lakeshore queue definition",
66
+ plural: "queue definitions",
67
+ hasSecret: false,
68
+ kindRequired: false,
69
+ defaultKind: "fifo",
70
+ };
71
+ export const COLLECTIONS = [
72
+ PROVIDER_SPEC,
73
+ STORAGE_SPEC,
74
+ QUEUE_DEF_SPEC,
75
+ ];
76
+ // ─── shared context resolution ───────────────────────────────────────────────
77
+ //
78
+ // Copied byte-for-byte from runconfig/index.ts:48-60, declare/index.ts:100-113
79
+ // and runnable/index.ts:65-78. Four copies of ten lines is cheaper than a
80
+ // shared module that every group would then have to agree about.
81
+ async function ctx(nsFlag) {
82
+ const token = resolveToken();
83
+ if (!token) {
84
+ fail("not authenticated — run 'dreamlake login' first");
85
+ return null;
86
+ }
87
+ const remote = resolveRemote();
88
+ const ns = await resolveNamespace(nsFlag, { token, remote });
89
+ if (!ns) {
90
+ fail("could not resolve namespace — run 'dreamlake login' or pass --namespace");
91
+ return null;
92
+ }
93
+ return { token, remote, ns };
94
+ }
95
+ /** A resource name is user-supplied and goes in a path segment. */
96
+ function seg(value) {
97
+ return encodeURIComponent(value);
98
+ }
99
+ /**
100
+ * `--config` / `--secret` take either inline JSON or `@path/to/file.json`.
101
+ * The `@` form goes through loadStructuredFile, so YAML works too.
102
+ */
103
+ function parseObjectFlag(flag, raw) {
104
+ if (raw.startsWith("@")) {
105
+ return loadStructuredFile(raw.slice(1));
106
+ }
107
+ let parsed;
108
+ try {
109
+ parsed = JSON.parse(raw);
110
+ }
111
+ catch (err) {
112
+ throw new Error(`${flag} is not valid JSON: ${err.message}. ` +
113
+ `Pass inline JSON or @file.json`);
114
+ }
115
+ if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) {
116
+ throw new Error(`${flag} must be a JSON object, e.g. '{"region":"us-west-2"}'`);
117
+ }
118
+ return parsed;
119
+ }
120
+ /**
121
+ * The one line that describes a stored secret. It says "stored", never the
122
+ * value, because no route on the server can return one — the ciphertext is
123
+ * stripped by sanitize() before the row leaves the process.
124
+ */
125
+ function secretLine(row) {
126
+ return row?.hasSecret
127
+ ? "stored (encrypted at rest; no route ever returns it)"
128
+ : "none";
129
+ }
130
+ /** A 403 on this collection is always a role problem, so say which verb. */
131
+ function forbidden(spec, action, ns) {
132
+ return (`writing to ${spec.path} needs ${action} permission on namespace '${ns}' — ` +
133
+ `READ is not enough`);
134
+ }
135
+ export async function runResourceCreate(spec, opts) {
136
+ // Everything below this line and above the ctx() call is validated with no
137
+ // network at all, exactly as declare/index.ts:148-152 does it: a bad flag
138
+ // must not cost a request, and a missing `kind` must not reach the server
139
+ // just to come back as a 400.
140
+ const ifExists = opts.ifExists ?? "fail";
141
+ if (ifExists !== "ok" && ifExists !== "fail") {
142
+ fail(`--if-exists must be 'ok' or 'fail' (got '${ifExists}')`);
143
+ return 1;
144
+ }
145
+ let payload = {};
146
+ if (opts.file) {
147
+ try {
148
+ payload = loadStructuredFile(opts.file);
149
+ }
150
+ catch (err) {
151
+ fail(err.message);
152
+ return 1;
153
+ }
154
+ }
155
+ // Scalar flags override the file, so one checked-in file can seed several
156
+ // rows that differ only by name.
157
+ if (opts.name !== undefined)
158
+ payload.name = opts.name;
159
+ if (opts.kind !== undefined)
160
+ payload.kind = opts.kind;
161
+ if (opts.description !== undefined)
162
+ payload.description = opts.description;
163
+ try {
164
+ if (opts.config !== undefined)
165
+ payload.config = parseObjectFlag("--config", opts.config);
166
+ if (opts.secret !== undefined)
167
+ payload.secret = parseObjectFlag("--secret", opts.secret);
168
+ if (opts.metadata !== undefined) {
169
+ payload.metadata = parseObjectFlag("--metadata", opts.metadata);
170
+ }
171
+ }
172
+ catch (err) {
173
+ fail(err.message);
174
+ return 1;
175
+ }
176
+ const name = typeof payload.name === "string" ? payload.name.trim() : "";
177
+ if (!name) {
178
+ fail(`name is required — pass --name or put "name" in --file`);
179
+ return 1;
180
+ }
181
+ const kind = typeof payload.kind === "string" ? payload.kind.trim() : "";
182
+ if (!kind && spec.kindRequired) {
183
+ fail(`kind is required for a ${spec.label} — pass --kind. ` +
184
+ `This collection has no server-side default.`);
185
+ return 1;
186
+ }
187
+ if (!spec.hasSecret && payload.secret !== undefined) {
188
+ fail(`a ${spec.label} stores no secret — drop --secret`);
189
+ return 1;
190
+ }
191
+ // Only the keys that were actually supplied. An explicit `undefined` would
192
+ // serialize away, but an explicit `null` would not, and the server treats
193
+ // "absent" and "null" differently on several fields.
194
+ const body = { name };
195
+ if (kind)
196
+ body.kind = kind;
197
+ if (payload.description !== undefined)
198
+ body.description = payload.description;
199
+ if (payload.config !== undefined)
200
+ body.config = payload.config;
201
+ if (payload.secret !== undefined)
202
+ body.secret = payload.secret;
203
+ if (payload.metadata !== undefined)
204
+ body.metadata = payload.metadata;
205
+ const c = await ctx(opts.namespace);
206
+ if (!c)
207
+ return 1;
208
+ // The target is printed BEFORE the write, never after — the same rule
209
+ // declare/index.ts:205-211 states. If the operator is about to hit the wrong
210
+ // server, the line that tells them has to come first.
211
+ if (!opts.json) {
212
+ process.stdout.write(`create ${spec.label}\n`);
213
+ process.stdout.write(` remote: ${c.remote}\n`);
214
+ process.stdout.write(` namespace: ${c.ns}\n`);
215
+ process.stdout.write(` collection: ${spec.path}\n`);
216
+ process.stdout.write(` name: ${name}\n`);
217
+ }
218
+ try {
219
+ const row = await requestJson(c.remote, `/namespaces/${c.ns}/${spec.path}`, { method: "POST", token: c.token, json: body });
220
+ if (opts.json) {
221
+ emitJson({ status: "created", ...row });
222
+ return 0;
223
+ }
224
+ ok(`created ${spec.label} ${row?.name ?? name}${row?.id ? ` (id ${row.id})` : ""}`);
225
+ if (spec.hasSecret) {
226
+ process.stdout.write(` secret: ${secretLine(row)}\n`);
227
+ }
228
+ return 0;
229
+ }
230
+ catch (err) {
231
+ if (err instanceof HttpError && err.status === 409) {
232
+ // Every head row on the server is create-only. A 409 means the name is
233
+ // taken and nothing was touched — a failure for a human, a success for a
234
+ // re-runnable script.
235
+ if (ifExists === "ok") {
236
+ if (opts.json)
237
+ emitJson({ status: "exists", name });
238
+ else
239
+ warn(`a ${spec.label} named '${name}' already exists — nothing was overwritten`);
240
+ return 0;
241
+ }
242
+ fail(err.message);
243
+ return 1;
244
+ }
245
+ if (err instanceof HttpError && err.status === 403) {
246
+ fail(forbidden(spec, "create", c.ns));
247
+ return 1;
248
+ }
249
+ if (err instanceof HttpError && err.status === 404) {
250
+ fail(`namespace '${c.ns}' not found on ${c.remote}`);
251
+ return 1;
252
+ }
253
+ if (err instanceof HttpError && err.body.includes("SOURCE_ENCRYPTION_KEY")) {
254
+ fail(`${err.message} — the server cannot store credentials, so the row was ` +
255
+ `not created. Re-run without --secret, or configure the key server-side.`);
256
+ return 1;
257
+ }
258
+ fail(err.message);
259
+ return 1;
260
+ }
261
+ }
262
+ export async function runResourceList(spec, opts) {
263
+ const c = await ctx(opts.namespace);
264
+ if (!c)
265
+ return 1;
266
+ try {
267
+ const res = await requestJson(c.remote, `/namespaces/${c.ns}/${spec.path}`, {
268
+ token: c.token,
269
+ // requestJson skips undefined/null query values (client.ts:63-66), so
270
+ // an absent filter is absent rather than an empty string.
271
+ query: { kind: opts.kind, page: opts.page, pageSize: opts.pageSize ?? 200 },
272
+ });
273
+ const rows = res?.[spec.listKey] ?? [];
274
+ if (opts.json) {
275
+ emitJson(rows);
276
+ return 0;
277
+ }
278
+ if (rows.length === 0) {
279
+ process.stdout.write(`No ${spec.plural} found.\n`);
280
+ return 0;
281
+ }
282
+ const table = rows.map((r) => ({
283
+ name: r.name,
284
+ kind: r.kind,
285
+ secret: r.hasSecret ? "yes" : "—",
286
+ description: r.description ?? "—",
287
+ }));
288
+ const cols = spec.hasSecret
289
+ ? ["name", "kind", "secret", "description"]
290
+ : ["name", "kind", "description"];
291
+ process.stdout.write(renderTable(table, cols));
292
+ const total = typeof res?.total === "number" ? res.total : rows.length;
293
+ process.stdout.write(`\n ${rows.length} of ${total} ${spec.plural}\n`);
294
+ if (typeof res?.totalPages === "number" && res.totalPages > 1) {
295
+ process.stdout.write(` page ${res.page} of ${res.totalPages} — pass --page to walk the rest\n`);
296
+ }
297
+ return 0;
298
+ }
299
+ catch (err) {
300
+ if (err instanceof HttpError && err.status === 403) {
301
+ fail(`reading ${spec.path} needs read permission on namespace '${c.ns}'`);
302
+ return 1;
303
+ }
304
+ if (err instanceof HttpError && err.status === 404) {
305
+ fail(`namespace '${c.ns}' not found on ${c.remote}`);
306
+ return 1;
307
+ }
308
+ fail(err.message);
309
+ return 1;
310
+ }
311
+ }
312
+ // ─── show ────────────────────────────────────────────────────────────────────
313
+ export async function runResourceShow(spec, id, opts) {
314
+ const c = await ctx(opts.namespace);
315
+ if (!c)
316
+ return 1;
317
+ try {
318
+ // `:id` accepts an id OR a name — findResource() tries a 24-hex id first,
319
+ // then falls back to the name (lakeshore-resources.ts:171-179).
320
+ const r = await requestJson(c.remote, `/namespaces/${c.ns}/${spec.path}/${seg(id)}`, { token: c.token });
321
+ if (opts.json) {
322
+ emitJson(r);
323
+ return 0;
324
+ }
325
+ process.stdout.write(`${spec.label}: ${r.name}\n`);
326
+ process.stdout.write(` id: ${r.id}\n`);
327
+ process.stdout.write(` kind: ${r.kind}\n`);
328
+ process.stdout.write(` description: ${r.description || "—"}\n`);
329
+ if (spec.hasSecret) {
330
+ process.stdout.write(` secret: ${secretLine(r)}\n`);
331
+ }
332
+ process.stdout.write(` created: ${r.createdAt?.slice(0, 10) ?? "—"}\n`);
333
+ process.stdout.write(` updated: ${r.updatedAt?.slice(0, 10) ?? "—"}\n`);
334
+ process.stdout.write("\nconfig:\n");
335
+ process.stdout.write(JSON.stringify(r.config ?? {}, null, 2) + "\n");
336
+ if (r.metadata != null) {
337
+ process.stdout.write("\nmetadata:\n");
338
+ process.stdout.write(JSON.stringify(r.metadata, null, 2) + "\n");
339
+ }
340
+ return 0;
341
+ }
342
+ catch (err) {
343
+ if (err instanceof HttpError && err.status === 404) {
344
+ fail(`${spec.label} '${id}' not found in namespace '${c.ns}'`);
345
+ return 1;
346
+ }
347
+ if (err instanceof HttpError && err.status === 403) {
348
+ fail(`reading ${spec.path} needs read permission on namespace '${c.ns}'`);
349
+ return 1;
350
+ }
351
+ fail(err.message);
352
+ return 1;
353
+ }
354
+ }
355
+ const CONFIG_REPLACE_WARNING = "--config REPLACES the stored config wholesale — this is not a deep merge, " +
356
+ "the server assigns it (lakeshore-resources.ts:431). Any key you left out is " +
357
+ "being dropped.";
358
+ export async function runResourceUpdate(spec, id, opts) {
359
+ if (opts.clearSecret && opts.secret !== undefined) {
360
+ fail("--secret and --clear-secret contradict each other — pass one");
361
+ return 1;
362
+ }
363
+ if (opts.clearSecret && !spec.hasSecret) {
364
+ fail(`a ${spec.label} stores no secret — drop --clear-secret`);
365
+ return 1;
366
+ }
367
+ // Every field on PATCH is optional, and the body must carry ONLY what was
368
+ // asked for: the server branches on `!== undefined` for each key, so an
369
+ // accidental null would clear a field rather than leave it alone.
370
+ const body = {};
371
+ if (opts.file) {
372
+ let fromFile;
373
+ try {
374
+ fromFile = loadStructuredFile(opts.file);
375
+ }
376
+ catch (err) {
377
+ fail(err.message);
378
+ return 1;
379
+ }
380
+ for (const key of ["name", "kind", "description", "config", "metadata", "secret"]) {
381
+ if (fromFile[key] !== undefined)
382
+ body[key] = fromFile[key];
383
+ }
384
+ }
385
+ if (opts.name !== undefined)
386
+ body.name = opts.name;
387
+ if (opts.kind !== undefined)
388
+ body.kind = opts.kind;
389
+ if (opts.description !== undefined)
390
+ body.description = opts.description;
391
+ try {
392
+ if (opts.config !== undefined)
393
+ body.config = parseObjectFlag("--config", opts.config);
394
+ if (opts.secret !== undefined)
395
+ body.secret = parseObjectFlag("--secret", opts.secret);
396
+ if (opts.metadata !== undefined)
397
+ body.metadata = parseObjectFlag("--metadata", opts.metadata);
398
+ }
399
+ catch (err) {
400
+ fail(err.message);
401
+ return 1;
402
+ }
403
+ // omit = keep, null = clear, object = rotate (lakeshore-resources.ts:434-440).
404
+ if (opts.clearSecret)
405
+ body.secret = null;
406
+ if (!spec.hasSecret)
407
+ delete body.secret;
408
+ if (Object.keys(body).length === 0) {
409
+ fail("nothing to update — pass at least one of " +
410
+ "--name / --kind / --description / --config / --metadata / --secret / " +
411
+ "--clear-secret / --file");
412
+ return 1;
413
+ }
414
+ const c = await ctx(opts.namespace);
415
+ if (!c)
416
+ return 1;
417
+ if (!opts.json) {
418
+ process.stdout.write(`update ${spec.label} ${id}\n`);
419
+ process.stdout.write(` remote: ${c.remote}\n`);
420
+ process.stdout.write(` namespace: ${c.ns}\n`);
421
+ process.stdout.write(` fields: ${Object.keys(body).join(", ")}\n`);
422
+ // Printed before the write, not after, for the same reason the target is.
423
+ if (body.config !== undefined)
424
+ warn(CONFIG_REPLACE_WARNING);
425
+ }
426
+ try {
427
+ const r = await requestJson(c.remote, `/namespaces/${c.ns}/${spec.path}/${seg(id)}`, { method: "PATCH", token: c.token, json: body });
428
+ if (opts.json) {
429
+ emitJson(r);
430
+ return 0;
431
+ }
432
+ ok(`updated ${spec.label} ${r?.name ?? id}`);
433
+ if (spec.hasSecret) {
434
+ process.stdout.write(` secret: ${secretLine(r)}\n`);
435
+ }
436
+ return 0;
437
+ }
438
+ catch (err) {
439
+ if (err instanceof HttpError && err.status === 404) {
440
+ fail(`${spec.label} '${id}' not found in namespace '${c.ns}'`);
441
+ return 1;
442
+ }
443
+ if (err instanceof HttpError && err.status === 403) {
444
+ fail(forbidden(spec, "update", c.ns));
445
+ return 1;
446
+ }
447
+ if (err instanceof HttpError && err.body.includes("SOURCE_ENCRYPTION_KEY")) {
448
+ fail(`${err.message} — nothing was written. Re-run without --secret, or ` +
449
+ `configure the key server-side.`);
450
+ return 1;
451
+ }
452
+ fail(err.message);
453
+ return 1;
454
+ }
455
+ }
456
+ // ─── delete ──────────────────────────────────────────────────────────────────
457
+ export async function runResourceDelete(spec, id, opts) {
458
+ const c = await ctx(opts.namespace);
459
+ if (!c)
460
+ return 1;
461
+ if (!opts.yes) {
462
+ // confirm() returns the default (false) without prompting on a non-TTY
463
+ // (prompt.ts:12-14), so a scripted run neither hangs nor deletes.
464
+ const proceed = await confirm(`Delete ${spec.label} '${id}' from namespace '${c.ns}'?`, false);
465
+ if (!proceed) {
466
+ if (opts.json)
467
+ emitJson({ success: false, cancelled: true, name: id });
468
+ else
469
+ process.stdout.write("Cancelled.\n");
470
+ return 0;
471
+ }
472
+ }
473
+ try {
474
+ const res = await requestJson(c.remote, `/namespaces/${c.ns}/${spec.path}/${seg(id)}`, { method: "DELETE", token: c.token });
475
+ // A SOFT delete answering 200 { success: true } — never a 204. The body is
476
+ // the only signal, so a 200 without it is not a success.
477
+ if (res?.success !== true) {
478
+ fail(`the server did not confirm the delete of ${spec.label} '${id}'`);
479
+ return 1;
480
+ }
481
+ if (opts.json) {
482
+ emitJson({ success: true, name: id });
483
+ return 0;
484
+ }
485
+ ok(`deleted ${spec.label} ${id}`);
486
+ process.stdout.write(" soft delete — the row is hidden from every read, not removed, and the\n" +
487
+ " name is freed for a new create\n");
488
+ return 0;
489
+ }
490
+ catch (err) {
491
+ if (err instanceof HttpError && err.status === 404) {
492
+ fail(`${spec.label} '${id}' not found in namespace '${c.ns}'`);
493
+ return 1;
494
+ }
495
+ if (err instanceof HttpError && err.status === 403) {
496
+ fail(forbidden(spec, "delete", c.ns));
497
+ return 1;
498
+ }
499
+ fail(err.message);
500
+ return 1;
501
+ }
502
+ }
@@ -0,0 +1,43 @@
1
+ import type { Command } from "commander";
2
+ import { type BridgeDeps } from "../python.js";
3
+ export interface LaunchSnapshotRef {
4
+ id?: string;
5
+ commit?: string;
6
+ created?: boolean;
7
+ sizeBytes?: number;
8
+ }
9
+ export interface LaunchResult {
10
+ status: "launched" | "completed" | "failed" | "error";
11
+ script: string;
12
+ server: string;
13
+ namespace: string;
14
+ queue: string;
15
+ waited: boolean;
16
+ invocationId?: string;
17
+ snapshot?: LaunchSnapshotRef;
18
+ exitCode?: number;
19
+ stdout?: string;
20
+ stderr?: string;
21
+ error?: string;
22
+ kind?: string;
23
+ }
24
+ export interface LaunchOptions {
25
+ queue?: string;
26
+ snapshot?: string;
27
+ arg?: string[];
28
+ wait?: boolean;
29
+ server?: string;
30
+ namespace?: string;
31
+ json?: boolean;
32
+ }
33
+ export declare function isSnapshotRef(value: string): boolean;
34
+ /**
35
+ * `--queue` → `LAKESHORE_QUEUE` → the `queue:` key of the nearest `.dreamrc`.
36
+ *
37
+ * A `.dreamrc` that will not parse is treated as "no queue here" rather than as
38
+ * a crash: the operator's next move is the same either way, and the three-way
39
+ * message says it better than a YAML error would.
40
+ */
41
+ export declare function resolveQueue(flag?: string): string | null;
42
+ export declare function runLaunch(script: string, opts: LaunchOptions, deps?: BridgeDeps): Promise<number>;
43
+ export declare function registerLaunchCommand(program: Command): void;