@dreamlake/dreamlake-cli 0.88.1 → 0.90.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 (541) 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 +54 -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 +2362 -0
  18. package/dist/api/index.js +116 -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 +102 -0
  38. package/dist/api/note-files.js +107 -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-linger.d.ts +83 -0
  44. package/dist/api/note-linger.js +270 -0
  45. package/dist/api/note-presence.d.ts +82 -0
  46. package/dist/api/note-presence.js +72 -0
  47. package/dist/api/note-toc.d.ts +2 -0
  48. package/dist/api/note-toc.js +2 -0
  49. package/dist/api/notes.d.ts +329 -0
  50. package/dist/api/notes.js +209 -0
  51. package/dist/api/open-resources.d.ts +27 -0
  52. package/dist/api/open-resources.js +102 -0
  53. package/dist/api/ownership.d.ts +12 -0
  54. package/dist/api/ownership.js +24 -0
  55. package/dist/api/platform.d.ts +83 -0
  56. package/dist/api/platform.js +56 -0
  57. package/dist/api/presigned-transfer.d.ts +2 -0
  58. package/dist/api/presigned-transfer.js +2 -0
  59. package/dist/api/registered-runs.d.ts +48 -0
  60. package/dist/api/registered-runs.js +33 -0
  61. package/dist/api/sessions.d.ts +299 -0
  62. package/dist/api/sessions.js +105 -0
  63. package/dist/api/storage.d.ts +46 -0
  64. package/dist/api/storage.js +34 -0
  65. package/dist/api/streams.d.ts +18 -0
  66. package/dist/api/streams.js +70 -0
  67. package/dist/api/vault.d.ts +93 -0
  68. package/dist/api/vault.js +79 -0
  69. package/dist/api/workspace.d.ts +180 -0
  70. package/dist/api/workspace.js +146 -0
  71. package/dist/cli/agent-identity.d.ts +4 -0
  72. package/dist/cli/agent-identity.js +21 -0
  73. package/dist/cli/agents/identity.d.ts +50 -0
  74. package/dist/cli/agents/identity.js +105 -0
  75. package/dist/cli/agents/index.d.ts +31 -0
  76. package/dist/cli/agents/index.js +580 -0
  77. package/dist/cli/agents/manage.d.ts +43 -0
  78. package/dist/cli/agents/manage.js +376 -0
  79. package/dist/cli/agents/spec.d.ts +104 -0
  80. package/dist/cli/agents/spec.js +280 -0
  81. package/dist/cli/agents/web.d.ts +7 -0
  82. package/dist/cli/agents/web.js +109 -0
  83. package/dist/cli/artifact/incremental.d.ts +21 -0
  84. package/dist/cli/artifact/incremental.js +80 -0
  85. package/dist/cli/artifact/index.d.ts +52 -0
  86. package/dist/cli/artifact/index.js +405 -0
  87. package/dist/cli/artifact/meta.d.ts +69 -0
  88. package/dist/cli/artifact/meta.js +189 -0
  89. package/dist/cli/auth/commands.d.ts +29 -0
  90. package/dist/cli/auth/commands.js +327 -0
  91. package/dist/cli/auth/constants.d.ts +13 -0
  92. package/dist/cli/auth/constants.js +18 -0
  93. package/dist/cli/auth/credentials.d.ts +37 -0
  94. package/dist/cli/auth/credentials.js +155 -0
  95. package/dist/cli/auth/device-flow.d.ts +32 -0
  96. package/dist/cli/auth/device-flow.js +154 -0
  97. package/dist/cli/auth/device-secret.d.ts +6 -0
  98. package/dist/cli/auth/device-secret.js +26 -0
  99. package/dist/cli/auth/machine.d.ts +15 -0
  100. package/dist/cli/auth/machine.js +126 -0
  101. package/dist/cli/auth/materialized.d.ts +32 -0
  102. package/dist/cli/auth/materialized.js +102 -0
  103. package/dist/cli/auth/migrate.d.ts +10 -0
  104. package/dist/cli/auth/migrate.js +75 -0
  105. package/dist/cli/client.d.ts +102 -0
  106. package/dist/cli/client.js +206 -0
  107. package/dist/cli/collection-list.d.ts +3 -0
  108. package/dist/cli/collection-list.js +25 -0
  109. package/dist/cli/compat/ctx.d.ts +26 -0
  110. package/dist/cli/compat/ctx.js +76 -0
  111. package/dist/cli/compat/dreamdb-wasm-embedded.d.ts +2 -0
  112. package/dist/cli/compat/dreamdb-wasm-embedded.js +8 -0
  113. package/dist/cli/compat/dreamdb-wasm.d.ts +1 -0
  114. package/dist/cli/compat/dreamdb-wasm.js +26 -0
  115. package/dist/cli/compat/dreamdb.d.ts +112 -0
  116. package/dist/cli/compat/dreamdb.js +219 -0
  117. package/dist/cli/compat/flags.d.ts +2 -0
  118. package/dist/cli/compat/flags.js +13 -0
  119. package/dist/cli/compat/http.d.ts +23 -0
  120. package/dist/cli/compat/http.js +137 -0
  121. package/dist/cli/compat/presignedTransfer.d.ts +139 -0
  122. package/dist/cli/compat/presignedTransfer.js +580 -0
  123. package/dist/cli/compat/s3-backend.d.ts +73 -0
  124. package/dist/cli/compat/s3-backend.js +132 -0
  125. package/dist/cli/config.d.ts +22 -0
  126. package/dist/cli/config.js +96 -0
  127. package/dist/cli/connection/dto.d.ts +159 -0
  128. package/dist/cli/connection/dto.js +497 -0
  129. package/dist/cli/connection/index.d.ts +50 -0
  130. package/dist/cli/connection/index.js +413 -0
  131. package/dist/cli/connection/oauth.d.ts +23 -0
  132. package/dist/cli/connection/oauth.js +290 -0
  133. package/dist/cli/connection/write.d.ts +47 -0
  134. package/dist/cli/connection/write.js +573 -0
  135. package/dist/cli/create/index.d.ts +19 -0
  136. package/dist/cli/create/index.js +209 -0
  137. package/dist/cli/declare/index.d.ts +29 -0
  138. package/dist/cli/declare/index.js +304 -0
  139. package/dist/cli/delete/index.d.ts +18 -0
  140. package/dist/cli/delete/index.js +232 -0
  141. package/dist/cli/download/index.d.ts +9 -0
  142. package/dist/cli/download/index.js +128 -0
  143. package/dist/cli/env/compose.d.ts +88 -0
  144. package/dist/cli/env/compose.js +402 -0
  145. package/dist/cli/env/index.d.ts +176 -0
  146. package/dist/cli/env/index.js +1011 -0
  147. package/dist/cli/experiments/index.d.ts +11 -0
  148. package/dist/cli/experiments/index.js +168 -0
  149. package/dist/cli/glob.d.ts +1 -0
  150. package/dist/cli/glob.js +45 -0
  151. package/dist/cli/graphql-helpers.d.ts +23 -0
  152. package/dist/cli/graphql-helpers.js +42 -0
  153. package/dist/cli/graphql.d.ts +10 -0
  154. package/dist/cli/graphql.js +47 -0
  155. package/dist/cli/help-examples.generated.d.ts +1 -0
  156. package/dist/cli/help-examples.generated.js +192 -0
  157. package/dist/cli/helpers.d.ts +8 -0
  158. package/dist/cli/helpers.js +106 -0
  159. package/dist/cli/hosts/api.d.ts +29 -0
  160. package/dist/cli/hosts/api.js +54 -0
  161. package/dist/cli/hosts/bootstrap-source.d.ts +1 -0
  162. package/dist/cli/hosts/bootstrap-source.js +2 -0
  163. package/dist/cli/hosts/catalog.d.ts +26 -0
  164. package/dist/cli/hosts/catalog.js +55 -0
  165. package/dist/cli/hosts/config.d.ts +45 -0
  166. package/dist/cli/hosts/config.js +179 -0
  167. package/dist/cli/hosts/credentials.d.ts +19 -0
  168. package/dist/cli/hosts/credentials.js +173 -0
  169. package/dist/cli/hosts/enroll.d.ts +17 -0
  170. package/dist/cli/hosts/enroll.js +109 -0
  171. package/dist/cli/hosts/enrollments.d.ts +25 -0
  172. package/dist/cli/hosts/enrollments.js +54 -0
  173. package/dist/cli/hosts/index.d.ts +6 -0
  174. package/dist/cli/hosts/index.js +279 -0
  175. package/dist/cli/hosts/inventory.d.ts +40 -0
  176. package/dist/cli/hosts/inventory.js +91 -0
  177. package/dist/cli/hosts/lifecycle.d.ts +15 -0
  178. package/dist/cli/hosts/lifecycle.js +108 -0
  179. package/dist/cli/hosts/metrics-source.d.ts +12 -0
  180. package/dist/cli/hosts/metrics-source.js +89 -0
  181. package/dist/cli/hosts/observations.d.ts +39 -0
  182. package/dist/cli/hosts/observations.js +102 -0
  183. package/dist/cli/hosts/remote.d.ts +5 -0
  184. package/dist/cli/hosts/remote.js +66 -0
  185. package/dist/cli/hosts/ssh.d.ts +63 -0
  186. package/dist/cli/hosts/ssh.js +276 -0
  187. package/dist/cli/index.d.ts +1 -0
  188. package/dist/cli/index.js +288 -0
  189. package/dist/cli/infra/api.d.ts +95 -0
  190. package/dist/cli/infra/api.js +291 -0
  191. package/dist/cli/infra/index.d.ts +5 -0
  192. package/dist/cli/infra/index.js +102 -0
  193. package/dist/cli/infra/move.d.ts +15 -0
  194. package/dist/cli/infra/move.js +123 -0
  195. package/dist/cli/infra/transfer.d.ts +15 -0
  196. package/dist/cli/infra/transfer.js +280 -0
  197. package/dist/cli/jobs/api.d.ts +69 -0
  198. package/dist/cli/jobs/api.js +121 -0
  199. package/dist/cli/jobs/index.d.ts +5 -0
  200. package/dist/cli/jobs/index.js +140 -0
  201. package/dist/cli/lakeshore/index.d.ts +98 -0
  202. package/dist/cli/lakeshore/index.js +502 -0
  203. package/dist/cli/launch/index.d.ts +43 -0
  204. package/dist/cli/launch/index.js +270 -0
  205. package/dist/cli/layout/index.d.ts +2 -0
  206. package/dist/cli/layout/index.js +44 -0
  207. package/dist/cli/layout/transport.d.ts +12 -0
  208. package/dist/cli/layout/transport.js +70 -0
  209. package/dist/cli/library/add.d.ts +60 -0
  210. package/dist/cli/library/add.js +348 -0
  211. package/dist/cli/library/cache.d.ts +26 -0
  212. package/dist/cli/library/cache.js +88 -0
  213. package/dist/cli/library/config.d.ts +75 -0
  214. package/dist/cli/library/config.js +198 -0
  215. package/dist/cli/library/digest.d.ts +5 -0
  216. package/dist/cli/library/digest.js +19 -0
  217. package/dist/cli/library/discover.d.ts +87 -0
  218. package/dist/cli/library/discover.js +534 -0
  219. package/dist/cli/library/freshness.d.ts +35 -0
  220. package/dist/cli/library/freshness.js +109 -0
  221. package/dist/cli/library/generation.d.ts +35 -0
  222. package/dist/cli/library/generation.js +211 -0
  223. package/dist/cli/library/index.d.ts +2 -0
  224. package/dist/cli/library/index.js +36 -0
  225. package/dist/cli/library/info.d.ts +69 -0
  226. package/dist/cli/library/info.js +311 -0
  227. package/dist/cli/library/list.d.ts +33 -0
  228. package/dist/cli/library/list.js +86 -0
  229. package/dist/cli/library/manifest.d.ts +81 -0
  230. package/dist/cli/library/manifest.js +200 -0
  231. package/dist/cli/library/manifestCache.d.ts +45 -0
  232. package/dist/cli/library/manifestCache.js +169 -0
  233. package/dist/cli/library/pull.d.ts +30 -0
  234. package/dist/cli/library/pull.js +438 -0
  235. package/dist/cli/library/push.d.ts +72 -0
  236. package/dist/cli/library/push.js +642 -0
  237. package/dist/cli/library/rm.d.ts +31 -0
  238. package/dist/cli/library/rm.js +200 -0
  239. package/dist/cli/library/search.d.ts +18 -0
  240. package/dist/cli/library/search.js +181 -0
  241. package/dist/cli/library/stat.d.ts +15 -0
  242. package/dist/cli/library/stat.js +127 -0
  243. package/dist/cli/library/tools.d.ts +104 -0
  244. package/dist/cli/library/tools.js +163 -0
  245. package/dist/cli/library/wire.d.ts +47 -0
  246. package/dist/cli/library/wire.js +120 -0
  247. package/dist/cli/list/index.d.ts +26 -0
  248. package/dist/cli/list/index.js +256 -0
  249. package/dist/cli/notes/api-transport.d.ts +5 -0
  250. package/dist/cli/notes/api-transport.js +20 -0
  251. package/dist/cli/notes/character-plan.d.ts +22 -0
  252. package/dist/cli/notes/character-plan.js +232 -0
  253. package/dist/cli/notes/document.d.ts +73 -0
  254. package/dist/cli/notes/document.js +306 -0
  255. package/dist/cli/notes/edit-commands.d.ts +106 -0
  256. package/dist/cli/notes/edit-commands.js +623 -0
  257. package/dist/cli/notes/editing.d.ts +81 -0
  258. package/dist/cli/notes/editing.js +305 -0
  259. package/dist/cli/notes/events.d.ts +36 -0
  260. package/dist/cli/notes/events.js +54 -0
  261. package/dist/cli/notes/files-commands.d.ts +97 -0
  262. package/dist/cli/notes/files-commands.js +548 -0
  263. package/dist/cli/notes/html-read.d.ts +9 -0
  264. package/dist/cli/notes/html-read.js +90 -0
  265. package/dist/cli/notes/html.d.ts +73 -0
  266. package/dist/cli/notes/html.js +381 -0
  267. package/dist/cli/notes/index.d.ts +123 -0
  268. package/dist/cli/notes/index.js +1300 -0
  269. package/dist/cli/notes/linger.d.ts +4 -0
  270. package/dist/cli/notes/linger.js +96 -0
  271. package/dist/cli/notes/media-commands.d.ts +5 -0
  272. package/dist/cli/notes/media-commands.js +51 -0
  273. package/dist/cli/notes/move-command.d.ts +83 -0
  274. package/dist/cli/notes/move-command.js +259 -0
  275. package/dist/cli/notes/rm-command.d.ts +22 -0
  276. package/dist/cli/notes/rm-command.js +110 -0
  277. package/dist/cli/notes/select-command.d.ts +12 -0
  278. package/dist/cli/notes/select-command.js +63 -0
  279. package/dist/cli/notes/suggest-diff.d.ts +56 -0
  280. package/dist/cli/notes/suggest-diff.js +311 -0
  281. package/dist/cli/notes/toc.d.ts +38 -0
  282. package/dist/cli/notes/toc.js +144 -0
  283. package/dist/cli/notes/transfer-command.d.ts +6 -0
  284. package/dist/cli/notes/transfer-command.js +9 -0
  285. package/dist/cli/notes/version-commands.d.ts +19 -0
  286. package/dist/cli/notes/version-commands.js +178 -0
  287. package/dist/cli/nymph/index.d.ts +74 -0
  288. package/dist/cli/nymph/index.js +349 -0
  289. package/dist/cli/org/index.d.ts +34 -0
  290. package/dist/cli/org/index.js +341 -0
  291. package/dist/cli/ownership/index.d.ts +12 -0
  292. package/dist/cli/ownership/index.js +122 -0
  293. package/dist/cli/ownership/metadata-transfer.d.ts +20 -0
  294. package/dist/cli/ownership/metadata-transfer.js +159 -0
  295. package/dist/cli/page/index.d.ts +58 -0
  296. package/dist/cli/page/index.js +387 -0
  297. package/dist/cli/pipeline/index.d.ts +69 -0
  298. package/dist/cli/pipeline/index.js +604 -0
  299. package/dist/cli/progress.d.ts +60 -0
  300. package/dist/cli/progress.js +276 -0
  301. package/dist/cli/project/attachments.d.ts +10 -0
  302. package/dist/cli/project/attachments.js +39 -0
  303. package/dist/cli/project/grants.d.ts +10 -0
  304. package/dist/cli/project/grants.js +39 -0
  305. package/dist/cli/project/index.d.ts +8 -0
  306. package/dist/cli/project/index.js +92 -0
  307. package/dist/cli/project/move.d.ts +57 -0
  308. package/dist/cli/project/move.js +242 -0
  309. package/dist/cli/project/output.d.ts +2 -0
  310. package/dist/cli/project/output.js +29 -0
  311. package/dist/cli/project/stream.d.ts +55 -0
  312. package/dist/cli/project/stream.js +207 -0
  313. package/dist/cli/project/transfer-preview.d.ts +8 -0
  314. package/dist/cli/project/transfer-preview.js +10 -0
  315. package/dist/cli/prompt.d.ts +1 -0
  316. package/dist/cli/prompt.js +17 -0
  317. package/dist/cli/provider/dreamdir.d.ts +52 -0
  318. package/dist/cli/provider/dreamdir.js +138 -0
  319. package/dist/cli/provider/index.d.ts +4 -0
  320. package/dist/cli/provider/index.js +419 -0
  321. package/dist/cli/provider/jump-worker.d.ts +9 -0
  322. package/dist/cli/provider/jump-worker.js +141 -0
  323. package/dist/cli/provider/lifecycle.d.ts +149 -0
  324. package/dist/cli/provider/lifecycle.js +1390 -0
  325. package/dist/cli/provider/machine.d.ts +17 -0
  326. package/dist/cli/provider/machine.js +116 -0
  327. package/dist/cli/provider/ssh.d.ts +105 -0
  328. package/dist/cli/provider/ssh.js +305 -0
  329. package/dist/cli/provider/terraform.d.ts +140 -0
  330. package/dist/cli/provider/terraform.js +288 -0
  331. package/dist/cli/providers/index.d.ts +18 -0
  332. package/dist/cli/providers/index.js +422 -0
  333. package/dist/cli/python.d.ts +61 -0
  334. package/dist/cli/python.js +255 -0
  335. package/dist/cli/queues/index.d.ts +33 -0
  336. package/dist/cli/queues/index.js +248 -0
  337. package/dist/cli/queues/slurm.d.ts +10 -0
  338. package/dist/cli/queues/slurm.js +134 -0
  339. package/dist/cli/resources.d.ts +72 -0
  340. package/dist/cli/resources.js +137 -0
  341. package/dist/cli/run/index.d.ts +15 -0
  342. package/dist/cli/run/index.js +163 -0
  343. package/dist/cli/run/input.d.ts +34 -0
  344. package/dist/cli/run/input.js +135 -0
  345. package/dist/cli/run/recovery.d.ts +2 -0
  346. package/dist/cli/run/recovery.js +18 -0
  347. package/dist/cli/run/setup.d.ts +3 -0
  348. package/dist/cli/run/setup.js +62 -0
  349. package/dist/cli/runconfig/index.d.ts +12 -0
  350. package/dist/cli/runconfig/index.js +130 -0
  351. package/dist/cli/runnable/index.d.ts +35 -0
  352. package/dist/cli/runnable/index.js +575 -0
  353. package/dist/cli/runnable/path.d.ts +115 -0
  354. package/dist/cli/runnable/path.js +288 -0
  355. package/dist/cli/runnable/run.d.ts +91 -0
  356. package/dist/cli/runnable/run.js +239 -0
  357. package/dist/cli/runnable/upload.d.ts +43 -0
  358. package/dist/cli/runnable/upload.js +342 -0
  359. package/dist/cli/runnable/worker.d.ts +1 -0
  360. package/dist/cli/runnable/worker.js +44 -0
  361. package/dist/cli/schemas/workflow-spec.schema.json +335 -0
  362. package/dist/cli/self-update/index.d.ts +5 -0
  363. package/dist/cli/self-update/index.js +107 -0
  364. package/dist/cli/self-update/install.d.ts +60 -0
  365. package/dist/cli/self-update/install.js +428 -0
  366. package/dist/cli/self-update/paths.d.ts +40 -0
  367. package/dist/cli/self-update/paths.js +87 -0
  368. package/dist/cli/self-update/releases.d.ts +41 -0
  369. package/dist/cli/self-update/releases.js +153 -0
  370. package/dist/cli/self-update/settings.d.ts +16 -0
  371. package/dist/cli/self-update/settings.js +68 -0
  372. package/dist/cli/self-update/update.d.ts +18 -0
  373. package/dist/cli/self-update/update.js +241 -0
  374. package/dist/cli/service-accounts/index.d.ts +3 -0
  375. package/dist/cli/service-accounts/index.js +149 -0
  376. package/dist/cli/session-affiliation.d.ts +26 -0
  377. package/dist/cli/session-affiliation.js +135 -0
  378. package/dist/cli/sessions/affiliation.d.ts +8 -0
  379. package/dist/cli/sessions/affiliation.js +66 -0
  380. package/dist/cli/sessions/api.d.ts +55 -0
  381. package/dist/cli/sessions/api.js +88 -0
  382. package/dist/cli/sessions/control.d.ts +6 -0
  383. package/dist/cli/sessions/control.js +159 -0
  384. package/dist/cli/sessions/conversation.d.ts +15 -0
  385. package/dist/cli/sessions/conversation.js +118 -0
  386. package/dist/cli/sessions/index.d.ts +2 -0
  387. package/dist/cli/sessions/index.js +209 -0
  388. package/dist/cli/sessions/managed.d.ts +39 -0
  389. package/dist/cli/sessions/managed.js +63 -0
  390. package/dist/cli/sessions/redaction.d.ts +2 -0
  391. package/dist/cli/sessions/redaction.js +11 -0
  392. package/dist/cli/sessions/runner/exec.d.ts +108 -0
  393. package/dist/cli/sessions/runner/exec.js +335 -0
  394. package/dist/cli/sessions/runner/journal.d.ts +26 -0
  395. package/dist/cli/sessions/runner/journal.js +49 -0
  396. package/dist/cli/sessions/runner/native.d.ts +48 -0
  397. package/dist/cli/sessions/runner/native.js +170 -0
  398. package/dist/cli/sessions/runner/pod.d.ts +30 -0
  399. package/dist/cli/sessions/runner/pod.js +129 -0
  400. package/dist/cli/sessions/runner/serve.d.ts +85 -0
  401. package/dist/cli/sessions/runner/serve.js +558 -0
  402. package/dist/cli/sessions/sync.d.ts +47 -0
  403. package/dist/cli/sessions/sync.js +80 -0
  404. package/dist/cli/sessions/transport.d.ts +14 -0
  405. package/dist/cli/sessions/transport.js +116 -0
  406. package/dist/cli/share.d.ts +15 -0
  407. package/dist/cli/share.js +139 -0
  408. package/dist/cli/skill/catalog.d.ts +141 -0
  409. package/dist/cli/skill/catalog.js +442 -0
  410. package/dist/cli/skill/files.d.ts +89 -0
  411. package/dist/cli/skill/files.js +264 -0
  412. package/dist/cli/skill/index.d.ts +268 -0
  413. package/dist/cli/skill/index.js +1216 -0
  414. package/dist/cli/skill/manifest.d.ts +30 -0
  415. package/dist/cli/skill/manifest.js +101 -0
  416. package/dist/cli/skill/prefs.d.ts +9 -0
  417. package/dist/cli/skill/prefs.js +32 -0
  418. package/dist/cli/skill/reminders.d.ts +15 -0
  419. package/dist/cli/skill/reminders.js +105 -0
  420. package/dist/cli/skill/tar.d.ts +17 -0
  421. package/dist/cli/skill/tar.js +195 -0
  422. package/dist/cli/snapshot/index.d.ts +24 -0
  423. package/dist/cli/snapshot/index.js +146 -0
  424. package/dist/cli/source/access.d.ts +45 -0
  425. package/dist/cli/source/access.js +563 -0
  426. package/dist/cli/source/control.d.ts +103 -0
  427. package/dist/cli/source/control.js +546 -0
  428. package/dist/cli/source/delete.d.ts +89 -0
  429. package/dist/cli/source/delete.js +463 -0
  430. package/dist/cli/source/index.d.ts +288 -0
  431. package/dist/cli/source/index.js +1348 -0
  432. package/dist/cli/source/share.d.ts +65 -0
  433. package/dist/cli/source/share.js +530 -0
  434. package/dist/cli/source/upload.d.ts +62 -0
  435. package/dist/cli/source/upload.js +258 -0
  436. package/dist/cli/source/write.d.ts +77 -0
  437. package/dist/cli/source/write.js +335 -0
  438. package/dist/cli/spawn.d.ts +28 -0
  439. package/dist/cli/spawn.js +81 -0
  440. package/dist/cli/target.d.ts +22 -0
  441. package/dist/cli/target.js +85 -0
  442. package/dist/cli/tasks/index.d.ts +38 -0
  443. package/dist/cli/tasks/index.js +365 -0
  444. package/dist/cli/team/index.d.ts +37 -0
  445. package/dist/cli/team/index.js +407 -0
  446. package/dist/cli/telemetry.d.ts +23 -0
  447. package/dist/cli/telemetry.js +262 -0
  448. package/dist/cli/telemetryJournal.d.ts +26 -0
  449. package/dist/cli/telemetryJournal.js +104 -0
  450. package/dist/cli/update/index.d.ts +21 -0
  451. package/dist/cli/update/index.js +284 -0
  452. package/dist/cli/upload/index.d.ts +11 -0
  453. package/dist/cli/upload/index.js +261 -0
  454. package/dist/cli/upload/kinds.d.ts +10 -0
  455. package/dist/cli/upload/kinds.js +85 -0
  456. package/dist/cli/upload/multipart.d.ts +21 -0
  457. package/dist/cli/upload/multipart.js +248 -0
  458. package/dist/cli/vault/affected-preview.d.ts +15 -0
  459. package/dist/cli/vault/affected-preview.js +38 -0
  460. package/dist/cli/vault/cloud.d.ts +55 -0
  461. package/dist/cli/vault/cloud.js +287 -0
  462. package/dist/cli/vault/format.d.ts +18 -0
  463. package/dist/cli/vault/format.js +104 -0
  464. package/dist/cli/vault/hostCredentials.d.ts +21 -0
  465. package/dist/cli/vault/hostCredentials.js +71 -0
  466. package/dist/cli/vault/hostSupersessions.d.ts +18 -0
  467. package/dist/cli/vault/hostSupersessions.js +68 -0
  468. package/dist/cli/vault/import.d.ts +3 -0
  469. package/dist/cli/vault/import.js +79 -0
  470. package/dist/cli/vault/index.d.ts +14 -0
  471. package/dist/cli/vault/index.js +225 -0
  472. package/dist/cli/vault/keys.d.ts +5 -0
  473. package/dist/cli/vault/keys.js +165 -0
  474. package/dist/cli/vault/kms.d.ts +6 -0
  475. package/dist/cli/vault/kms.js +169 -0
  476. package/dist/cli/vault/list.d.ts +13 -0
  477. package/dist/cli/vault/list.js +60 -0
  478. package/dist/cli/vault/listView.d.ts +21 -0
  479. package/dist/cli/vault/listView.js +123 -0
  480. package/dist/cli/vault/managementMetadata.d.ts +2 -0
  481. package/dist/cli/vault/managementMetadata.js +23 -0
  482. package/dist/cli/vault/mutations.d.ts +8 -0
  483. package/dist/cli/vault/mutations.js +151 -0
  484. package/dist/cli/vault/otp.d.ts +6 -0
  485. package/dist/cli/vault/otp.js +62 -0
  486. package/dist/cli/vault/otpIntent.d.ts +23 -0
  487. package/dist/cli/vault/otpIntent.js +76 -0
  488. package/dist/cli/vault/passImport.d.ts +25 -0
  489. package/dist/cli/vault/passImport.js +129 -0
  490. package/dist/cli/vault/passOtp.d.ts +51 -0
  491. package/dist/cli/vault/passOtp.js +101 -0
  492. package/dist/cli/vault/passStore.d.ts +26 -0
  493. package/dist/cli/vault/passStore.js +134 -0
  494. package/dist/cli/vault/passwordCommand.d.ts +39 -0
  495. package/dist/cli/vault/passwordCommand.js +101 -0
  496. package/dist/cli/vault/passwordProbe.d.ts +27 -0
  497. package/dist/cli/vault/passwordProbe.js +282 -0
  498. package/dist/cli/vault/passwordRotation.d.ts +9 -0
  499. package/dist/cli/vault/passwordRotation.js +273 -0
  500. package/dist/cli/vault/rotationApi.d.ts +13 -0
  501. package/dist/cli/vault/rotationApi.js +58 -0
  502. package/dist/cli/vault/rotationCommand.d.ts +2 -0
  503. package/dist/cli/vault/rotationCommand.js +75 -0
  504. package/dist/cli/vault/rotationEngine.d.ts +19 -0
  505. package/dist/cli/vault/rotationEngine.js +65 -0
  506. package/dist/cli/vault/rotationHelperSource.d.ts +2 -0
  507. package/dist/cli/vault/rotationHelperSource.js +3 -0
  508. package/dist/cli/vault/rotationInput.d.ts +11 -0
  509. package/dist/cli/vault/rotationInput.js +48 -0
  510. package/dist/cli/vault/rotationJournal.d.ts +16 -0
  511. package/dist/cli/vault/rotationJournal.js +183 -0
  512. package/dist/cli/vault/rotationKeys.d.ts +4 -0
  513. package/dist/cli/vault/rotationKeys.js +48 -0
  514. package/dist/cli/vault/rotationPrepare.d.ts +17 -0
  515. package/dist/cli/vault/rotationPrepare.js +108 -0
  516. package/dist/cli/vault/rotationRemote.d.ts +33 -0
  517. package/dist/cli/vault/rotationRemote.js +156 -0
  518. package/dist/cli/vault/rotationState.d.ts +42 -0
  519. package/dist/cli/vault/rotationState.js +115 -0
  520. package/dist/cli/vault/rotationTransport.d.ts +18 -0
  521. package/dist/cli/vault/rotationTransport.js +71 -0
  522. package/dist/cli/vault/sshSource.d.ts +18 -0
  523. package/dist/cli/vault/sshSource.js +196 -0
  524. package/dist/cli/vault/sshSync.d.ts +17 -0
  525. package/dist/cli/vault/sshSync.js +224 -0
  526. package/dist/cli/vault/sshTransfer.d.ts +22 -0
  527. package/dist/cli/vault/sshTransfer.js +140 -0
  528. package/dist/cli/vault/terraformState.d.ts +66 -0
  529. package/dist/cli/vault/terraformState.js +252 -0
  530. package/dist/cli/vault/terraformStateCommand.d.ts +2 -0
  531. package/dist/cli/vault/terraformStateCommand.js +61 -0
  532. package/dist/cli/vault/tree.d.ts +43 -0
  533. package/dist/cli/vault/tree.js +292 -0
  534. package/dist/cli/version.d.ts +1 -0
  535. package/dist/cli/version.js +9 -0
  536. package/dist/cli/workflow/index.d.ts +76 -0
  537. package/dist/cli/workflow/index.js +826 -0
  538. package/dist/cli/workflow/validate.d.ts +19 -0
  539. package/dist/cli/workflow/validate.js +353 -0
  540. package/dist/package.json +1 -0
  541. package/package.json +28 -10
@@ -0,0 +1,28 @@
1
+ export interface SpawnResult {
2
+ status: number | null;
3
+ stdout: string;
4
+ stderr: string;
5
+ error?: NodeJS.ErrnoException;
6
+ }
7
+ export type Spawn = (cmd: string, args: string[], env?: Record<string, string>) => SpawnResult;
8
+ /**
9
+ * The real spawner. NO TIMEOUT: `launch --wait` legitimately blocks for as long
10
+ * as the script runs, and `terraform apply` on an EKS cluster is twenty minutes
11
+ * of normal. A CLI that kills either at the two-minute mark is worse than one
12
+ * that waits.
13
+ *
14
+ * `maxBuffer` is raised well past the 1 MB default because a launched script's
15
+ * own stdout comes back inside the envelope, and `terraform plan -json` on a
16
+ * large module is megabytes of line-delimited JSON.
17
+ */
18
+ export declare const spawn: Spawn;
19
+ /**
20
+ * A spawner with a wall clock, for the calls where a hang is a bug rather than
21
+ * a long job — a version probe, an ssh reachability check, a `terraform init`.
22
+ * Bounded where a hang is a bug, unbounded where slow is legitimate.
23
+ */
24
+ export declare function boundedSpawn(timeoutMs: number): Spawn;
25
+ /** Last non-empty line of `text`, trimmed. "" when there is none. */
26
+ export declare function lastNonEmptyLine(text: string): string;
27
+ /** Keep a long traceback from burying the sentence that explains it. */
28
+ export declare function truncate(text: string, max?: number): string;
@@ -0,0 +1,81 @@
1
+ // The subprocess injection point, shared by every runner in this CLI.
2
+ //
3
+ // WHY IT MOVED OUT OF `python.ts`. There used to be exactly one subprocess
4
+ // family — `python -m dreamlake.lakeshore.bridge` — and the type that describes
5
+ // it lived beside it. There are now two: the Python bridge, and the
6
+ // terraform / ssh runners behind `dreamlake provider`. Neither speaks the
7
+ // other's protocol (terraform emits a JSON *stream*, ssh emits nothing at all),
8
+ // but both are tested the same way, by handing the entry point a fake that
9
+ // records the argv it was given.
10
+ //
11
+ // So the TYPE lives here, once, and `python.ts` re-exports it so nothing that
12
+ // already imports `Spawn` from there has to change.
13
+ //
14
+ // THE SIGNATURE IS THREE ARGUMENTS AND STAYS THREE ARGUMENTS. Every test in
15
+ // this suite implements `Spawn` by hand; widening it to carry a cwd or a
16
+ // timeout would rewrite all of them. Callers that need a working directory pass
17
+ // it in the argv instead (`terraform -chdir=…`), and callers that need a bound
18
+ // build their own spawner with `boundedSpawn(ms)` — the same trick
19
+ // `probeSpawn` in python.ts already uses.
20
+ import { spawnSync } from "node:child_process";
21
+ /**
22
+ * The real spawner. NO TIMEOUT: `launch --wait` legitimately blocks for as long
23
+ * as the script runs, and `terraform apply` on an EKS cluster is twenty minutes
24
+ * of normal. A CLI that kills either at the two-minute mark is worse than one
25
+ * that waits.
26
+ *
27
+ * `maxBuffer` is raised well past the 1 MB default because a launched script's
28
+ * own stdout comes back inside the envelope, and `terraform plan -json` on a
29
+ * large module is megabytes of line-delimited JSON.
30
+ */
31
+ export const spawn = (cmd, args, env) => {
32
+ const r = spawnSync(cmd, args, {
33
+ encoding: "utf8",
34
+ env: { ...process.env, ...(env ?? {}) },
35
+ maxBuffer: 64 * 1024 * 1024,
36
+ });
37
+ return {
38
+ status: r.status,
39
+ stdout: r.stdout ?? "",
40
+ stderr: r.stderr ?? "",
41
+ error: r.error,
42
+ };
43
+ };
44
+ /**
45
+ * A spawner with a wall clock, for the calls where a hang is a bug rather than
46
+ * a long job — a version probe, an ssh reachability check, a `terraform init`.
47
+ * Bounded where a hang is a bug, unbounded where slow is legitimate.
48
+ */
49
+ export function boundedSpawn(timeoutMs) {
50
+ return (cmd, args, env) => {
51
+ const r = spawnSync(cmd, args, {
52
+ encoding: "utf8",
53
+ env: { ...process.env, ...(env ?? {}) },
54
+ maxBuffer: 64 * 1024 * 1024,
55
+ timeout: timeoutMs,
56
+ });
57
+ return {
58
+ status: r.status,
59
+ stdout: r.stdout ?? "",
60
+ stderr: r.stderr ?? "",
61
+ error: r.error,
62
+ };
63
+ };
64
+ }
65
+ /** Last non-empty line of `text`, trimmed. "" when there is none. */
66
+ export function lastNonEmptyLine(text) {
67
+ const lines = text.split(/\r?\n/);
68
+ for (let i = lines.length - 1; i >= 0; i--) {
69
+ const line = lines[i].trim();
70
+ if (line.length > 0)
71
+ return line;
72
+ }
73
+ return "";
74
+ }
75
+ /** Keep a long traceback from burying the sentence that explains it. */
76
+ export function truncate(text, max = 2000) {
77
+ const t = text.trimEnd();
78
+ if (t.length <= max)
79
+ return t;
80
+ return `${t.slice(0, max)}\n… (${t.length - max} more characters)`;
81
+ }
@@ -0,0 +1,22 @@
1
+ export interface ParsedTarget {
2
+ /** null → resolve from current user's token */
3
+ namespace: string | null;
4
+ project: string;
5
+ /** null → project-level (episodeId = null) */
6
+ episode: string | null;
7
+ /** null → not supplied */
8
+ path: string | null;
9
+ }
10
+ export interface ParsedProject {
11
+ /** null → resolve from current user's token */
12
+ namespace: string | null;
13
+ project: string;
14
+ }
15
+ /** Parse a target string: space[@namespace][:episode][//path]. */
16
+ export declare function parseTarget(target: string): ParsedTarget;
17
+ /** Parse a space target: space[@namespace]. */
18
+ export declare function parseProject(target: string): ParsedProject;
19
+ /** Reconstruct a target string from parsed components (for display). */
20
+ export declare function formatTarget(t: ParsedTarget): string;
21
+ /** Reconstruct a project string for display. */
22
+ export declare function formatProject(s: ParsedProject): string;
@@ -0,0 +1,85 @@
1
+ // Target syntax parser — TypeScript port of dreamlake-py's cli/_target.py.
2
+ //
3
+ // Syntax: space[@namespace][:episode][//path]
4
+ //
5
+ // robotics@alice:run-042 → project=robotics, namespace=alice, episode=run-042
6
+ // robotics:run-042 → namespace resolved from current user's token
7
+ // robotics@alice → no episode → project-level
8
+ // robotics → minimal — namespace from token, no episode
9
+ //
10
+ // The `--project` flag uses the shorter space[@namespace] form.
11
+ //
12
+ // NOTE: the Python original (cli/_target.py) has variable-name bugs
13
+ // (`space`/`project`/`nameproject` mixed up). This is the corrected
14
+ // implementation following the documented intent.
15
+ /** Parse a target string: space[@namespace][:episode][//path]. */
16
+ export function parseTarget(target) {
17
+ let rest = target;
18
+ let path = null;
19
+ let episode = null;
20
+ let namespace = null;
21
+ // Split off path (everything after //).
22
+ const slashIdx = rest.indexOf("//");
23
+ if (slashIdx >= 0) {
24
+ path = rest.slice(slashIdx + 2).replace(/^\/+|\/+$/g, "") || null;
25
+ rest = rest.slice(0, slashIdx);
26
+ }
27
+ // Split off episode (everything after the first :).
28
+ const colonIdx = rest.indexOf(":");
29
+ let base;
30
+ if (colonIdx >= 0) {
31
+ base = rest.slice(0, colonIdx);
32
+ episode = rest.slice(colonIdx + 1) || null;
33
+ }
34
+ else {
35
+ base = rest;
36
+ }
37
+ // Split off namespace (everything after @).
38
+ const atIdx = base.indexOf("@");
39
+ let project;
40
+ if (atIdx >= 0) {
41
+ project = base.slice(0, atIdx);
42
+ namespace = base.slice(atIdx + 1) || null;
43
+ }
44
+ else {
45
+ project = base;
46
+ }
47
+ if (!project) {
48
+ throw new Error("target must include a project name");
49
+ }
50
+ return { namespace, project, episode, path };
51
+ }
52
+ /** Parse a space target: space[@namespace]. */
53
+ export function parseProject(target) {
54
+ const atIdx = target.indexOf("@");
55
+ let project;
56
+ let namespace = null;
57
+ if (atIdx >= 0) {
58
+ project = target.slice(0, atIdx);
59
+ namespace = target.slice(atIdx + 1) || null;
60
+ }
61
+ else {
62
+ project = target;
63
+ }
64
+ if (!project) {
65
+ throw new Error("target must include a project name");
66
+ }
67
+ return { namespace, project };
68
+ }
69
+ /** Reconstruct a target string from parsed components (for display). */
70
+ export function formatTarget(t) {
71
+ let parts = t.project;
72
+ if (t.namespace)
73
+ parts += `@${t.namespace}`;
74
+ if (t.episode)
75
+ parts += `:${t.episode}`;
76
+ if (t.path)
77
+ parts += `//${t.path}`;
78
+ return parts;
79
+ }
80
+ /** Reconstruct a project string for display. */
81
+ export function formatProject(s) {
82
+ if (s.namespace)
83
+ return `${s.project}@${s.namespace}`;
84
+ return s.project;
85
+ }
@@ -0,0 +1,38 @@
1
+ import { Command } from "commander";
2
+ export interface TaskOptions {
3
+ namespace?: string;
4
+ project?: string;
5
+ remote?: string;
6
+ token?: string;
7
+ debug?: boolean;
8
+ toJson?: boolean;
9
+ json?: boolean;
10
+ id?: boolean;
11
+ title?: string;
12
+ blurb?: string;
13
+ kind?: string;
14
+ tags?: string;
15
+ ifMatch?: string;
16
+ includeDeleted?: boolean;
17
+ limit?: string;
18
+ cursor?: string;
19
+ tree?: boolean;
20
+ recursive?: boolean;
21
+ children?: string;
22
+ at?: string;
23
+ eventId?: string;
24
+ mode?: string;
25
+ completed?: string;
26
+ total?: string;
27
+ unit?: string;
28
+ status?: string;
29
+ type?: string;
30
+ message?: string;
31
+ url?: string;
32
+ description?: string;
33
+ role?: string;
34
+ noteId?: string;
35
+ section?: string;
36
+ }
37
+ export declare function runTasks(operation: string, target: string | undefined, opts?: TaskOptions, destination?: string): Promise<number>;
38
+ export declare function registerTasksCommand(program: Command): void;
@@ -0,0 +1,365 @@
1
+ import { collectionList } from "../collection-list.js";
2
+ import { randomUUID } from "node:crypto";
3
+ import { HttpError, requestJson } from "../client.js";
4
+ import { resolveCtx } from "../compat/ctx.js";
5
+ import { withConnFlags } from "../compat/flags.js";
6
+ import { requireNamespace } from "../compat/http.js";
7
+ import { emitJson, fail } from "../helpers.js";
8
+ const seg = encodeURIComponent;
9
+ function number(value, name) {
10
+ if (value === undefined)
11
+ return undefined;
12
+ const n = Number(value);
13
+ if (!Number.isFinite(n) || n < 0)
14
+ throw new Error(`${name} must be a nonnegative finite number`);
15
+ return n;
16
+ }
17
+ function output(result, opts) {
18
+ if (opts.toJson || opts.json) {
19
+ emitJson(result);
20
+ return;
21
+ }
22
+ const rows = result.tasks ??
23
+ (result.task ? [result.task, ...(result.descendants ?? [])] : []);
24
+ if (opts.recursive)
25
+ opts = { ...opts, tree: true };
26
+ if (rows.length) {
27
+ const map = new Map(rows.map((t) => [t.id, t]));
28
+ const childIds = new Set(rows.flatMap((t) => t.children));
29
+ const seen = new Set();
30
+ const print = (t, depth) => {
31
+ if (seen.has(t.id))
32
+ return;
33
+ seen.add(t.id);
34
+ const p = t.progress;
35
+ console.log(`${" ".repeat(depth)}${t.path} [${t.status}] ${t.title}${t.blurb ? " — " + t.blurb : ""}${p ? ` ${p.completed}/${p.total ?? "?"} ${p.unit}` : ""} (rev ${t.revision})`);
36
+ if (opts.tree)
37
+ for (const id of t.children) {
38
+ const c = map.get(id);
39
+ if (c)
40
+ print(c, depth + 1);
41
+ }
42
+ };
43
+ for (const t of rows)
44
+ if (!opts.tree || !childIds.has(t.id))
45
+ print(t, 0);
46
+ for (const t of rows)
47
+ if (!seen.has(t.id))
48
+ print(t, 0);
49
+ if (result.nextCursor)
50
+ console.log(`Next cursor: ${result.nextCursor}`);
51
+ }
52
+ else
53
+ console.log(JSON.stringify(result, null, 2));
54
+ }
55
+ export async function runTasks(operation, target, opts = {}, destination) {
56
+ try {
57
+ const project = opts.project ?? (process.env.DREAMLAKE_PROJECT || undefined);
58
+ const namespace = opts.namespace ?? (process.env.DREAMLAKE_NAMESPACE || undefined);
59
+ if (!project)
60
+ throw new Error("--project or DREAMLAKE_PROJECT is required");
61
+ const c = resolveCtx(opts);
62
+ if (!c.token)
63
+ throw new Error("not authenticated — run 'dreamlake login' first");
64
+ const ns = await requireNamespace(c, namespace);
65
+ if (!ns)
66
+ return 1;
67
+ const base = `/namespaces/${seg(ns)}/projects/${seg(project)}/tasks`;
68
+ const call = (path, method = "GET", body, query) => requestJson(c.remote, path, {
69
+ method,
70
+ token: c.token,
71
+ json: body,
72
+ query,
73
+ });
74
+ const list = async (prefix, all = false) => {
75
+ const collected = [];
76
+ let cursor = opts.cursor;
77
+ const seen = new Set();
78
+ do {
79
+ const p = await call(base, "GET", undefined, {
80
+ prefix,
81
+ includeDeleted: opts.includeDeleted,
82
+ limit: number(opts.limit, "limit"),
83
+ cursor,
84
+ });
85
+ collected.push(...p.tasks);
86
+ if (!all || !p.nextCursor)
87
+ return { tasks: collected, nextCursor: p.nextCursor };
88
+ if (seen.has(p.nextCursor))
89
+ throw new Error("Server repeated a pagination cursor");
90
+ seen.add(p.nextCursor);
91
+ cursor = p.nextCursor;
92
+ } while (true);
93
+ };
94
+ if (operation === "list") {
95
+ output(await list(target, opts.tree), opts);
96
+ return 0;
97
+ }
98
+ if (operation === "add") {
99
+ if (!target || !opts.title)
100
+ throw new Error("Task path and --title are required");
101
+ output(await call(base, "POST", {
102
+ path: target,
103
+ title: opts.title,
104
+ blurb: opts.blurb,
105
+ kind: opts.kind,
106
+ tags: opts.tags?.split(",").filter(Boolean),
107
+ }), opts);
108
+ return 0;
109
+ }
110
+ if (!target)
111
+ throw new Error("Task path or ID is required");
112
+ let task;
113
+ if (opts.id || operation === "restore")
114
+ task = (await call(`${base}/${seg(target)}`, "GET", undefined, {
115
+ includeDeleted: operation === "restore" || opts.includeDeleted,
116
+ })).task;
117
+ else
118
+ task = (await call(`${base}/resolve`, "GET", undefined, {
119
+ path: target,
120
+ includeDeleted: opts.includeDeleted,
121
+ })).task;
122
+ const path = `${base}/${seg(task.id)}`;
123
+ const expectedRevision = opts.ifMatch ?? task.revision;
124
+ let result;
125
+ if (operation === "show")
126
+ result = { task };
127
+ else if (operation === "status") {
128
+ result = await call(path + "/status");
129
+ if (opts.recursive)
130
+ result.descendants = (await list(task.path, true)).tasks.filter((t) => t.id !== task.id);
131
+ }
132
+ else if (operation === "rename") {
133
+ if (!opts.title)
134
+ throw new Error("--title is required");
135
+ result = await call(path, "PATCH", {
136
+ expectedRevision,
137
+ title: opts.title,
138
+ });
139
+ }
140
+ else if (operation === "update")
141
+ result = await call(path, "PATCH", {
142
+ expectedRevision,
143
+ title: opts.title,
144
+ blurb: opts.blurb,
145
+ kind: opts.kind,
146
+ tags: opts.tags?.split(",").filter(Boolean),
147
+ });
148
+ else if (operation === "move")
149
+ result = await call(path + "/move", "POST", {
150
+ expectedRevision,
151
+ path: destination,
152
+ });
153
+ else if (operation === "reorder") {
154
+ if (opts.children === undefined)
155
+ throw new Error("--children is required");
156
+ result = await call(path, "PATCH", {
157
+ expectedRevision,
158
+ children: opts.children.split(",").filter(Boolean),
159
+ });
160
+ }
161
+ else if (operation === "delete")
162
+ result = await call(path, "DELETE", { expectedRevision });
163
+ else if (operation === "restore")
164
+ result = await call(path + "/restore", "POST", { expectedRevision });
165
+ else if (operation === "notes-list")
166
+ result = await call(path + "/notes");
167
+ else if (operation === "notes-add" || operation === "notes-remove") {
168
+ if (!opts.role || !opts.noteId)
169
+ throw new Error("--role and --note-id are required");
170
+ result = await call(path + "/notes", operation === "notes-add" ? "POST" : "DELETE", {
171
+ expectedRevision,
172
+ link: { role: opts.role, noteId: opts.noteId, section: opts.section },
173
+ });
174
+ }
175
+ else if (operation === "events-list")
176
+ result = await call(path + "/events", "GET", undefined, {
177
+ cursor: opts.cursor,
178
+ limit: number(opts.limit, "limit"),
179
+ includeDeleted: opts.includeDeleted,
180
+ });
181
+ else {
182
+ const types = {
183
+ start: "started",
184
+ end: "ended",
185
+ reopen: "reopened",
186
+ progress: "progress",
187
+ "status-set": "status_changed",
188
+ };
189
+ const type = types[operation] ?? opts.type;
190
+ let data = {};
191
+ if (operation === "progress") {
192
+ if (!opts.mode || opts.completed === undefined || !opts.unit)
193
+ throw new Error("--mode, --completed and --unit are required");
194
+ data = {
195
+ mode: opts.mode,
196
+ completed: number(opts.completed, "completed"),
197
+ total: number(opts.total, "total"),
198
+ unit: opts.unit,
199
+ };
200
+ }
201
+ else if (operation === "status-set") {
202
+ if (!opts.status)
203
+ throw new Error("--status is required");
204
+ data = { status: opts.status };
205
+ }
206
+ else if (operation === "events-add") {
207
+ if (type === "message") {
208
+ if (!opts.message)
209
+ throw new Error("--message is required");
210
+ data = { message: opts.message };
211
+ }
212
+ else if (type === "evidence") {
213
+ if (!opts.kind || !opts.url)
214
+ throw new Error("--kind and --url are required");
215
+ data = {
216
+ kind: opts.kind,
217
+ url: opts.url,
218
+ description: opts.description,
219
+ };
220
+ }
221
+ else
222
+ throw new Error("Use --type message or evidence; use start/end/progress/status set for lifecycle events");
223
+ }
224
+ else if (!types[operation])
225
+ throw new Error("Unknown task operation");
226
+ const occurredAt = opts.at ?? new Date().toISOString();
227
+ if (!Number.isFinite(Date.parse(occurredAt)))
228
+ throw new Error("--at must be an ISO timestamp");
229
+ const eventId = opts.eventId ?? randomUUID();
230
+ // Print generated identity before sending: an uncertain response can be
231
+ // investigated without generating another progress event blindly.
232
+ if (!opts.eventId)
233
+ console.error(`Task event ID: ${eventId}`);
234
+ result = await call(path + "/events", "POST", {
235
+ eventId,
236
+ type,
237
+ occurredAt,
238
+ expectedRevision: type === "message" || type === "evidence"
239
+ ? undefined
240
+ : expectedRevision,
241
+ data,
242
+ });
243
+ }
244
+ output(result, opts);
245
+ return 0;
246
+ }
247
+ catch (error) {
248
+ if (error instanceof HttpError) {
249
+ let detail = error.message;
250
+ try {
251
+ const body = JSON.parse(error.body);
252
+ detail = body.message ?? detail;
253
+ }
254
+ catch { }
255
+ fail(detail);
256
+ return error.status === 409 || error.status === 428 ? 3 : 1;
257
+ }
258
+ fail(error instanceof Error ? error.message : String(error));
259
+ return 1;
260
+ }
261
+ }
262
+ function common(c) {
263
+ return withConnFlags(c)
264
+ .option("--namespace <slug>", "owning namespace (default: DREAMLAKE_NAMESPACE, then login)")
265
+ .option("--project <slug>", "owning project (default: DREAMLAKE_PROJECT; required if unset)")
266
+ .option("--id", "interpret task argument as stable ID")
267
+ .option("--to-json", "emit JSON")
268
+ .option("--json", "emit JSON")
269
+ .option("--if-match <revision>", "revision from an earlier read; default: freshly read revision");
270
+ }
271
+ function timed(c) {
272
+ return c
273
+ .option("--at <timestamp>", "actual occurrence time (ISO 8601; default: now)")
274
+ .option("--event-id <id>", "stable event identity to reuse on identical retries");
275
+ }
276
+ function action(operation) {
277
+ return async (target, opts, command) => {
278
+ process.exitCode = await runTasks(operation, target, {
279
+ ...command.optsWithGlobals(),
280
+ ...opts,
281
+ });
282
+ };
283
+ }
284
+ export function registerTasksCommand(program) {
285
+ const tasks = program
286
+ .command("tasks")
287
+ .description("Task folders, progress, events and linked Notes");
288
+ common(tasks.command("add <path>").description("Create a task; parent must exist"))
289
+ .requiredOption("--title <title>", "task title")
290
+ .option("--blurb <text>", "short description")
291
+ .option("--kind <kind>", "task type", "task")
292
+ .option("--tags <tags>", "comma-separated text tags")
293
+ .action(action("add"));
294
+ common(collectionList(tasks, "list [prefix]").description("List tasks"))
295
+ .option("--tree", "fetch all pages and print ordered children")
296
+ .option("--limit <n>", "page size", "50")
297
+ .option("--cursor <cursor>", "next page cursor")
298
+ .option("--include-deleted", "include soft-deleted tasks")
299
+ .action(action("list"));
300
+ common(tasks.command("show <task>"))
301
+ .option("--include-deleted", "include soft-deleted task")
302
+ .action(action("show"));
303
+ const status = tasks.command("status").description("Read or set task status");
304
+ common(status)
305
+ .argument("[task]")
306
+ .option("--recursive", "include descendant tasks")
307
+ .action(action("status"));
308
+ timed(common(status.command("set <task>")))
309
+ .requiredOption("--status <status>", "not_done, done, deprecated")
310
+ .action(action("status-set"));
311
+ common(tasks.command("rename <task>"))
312
+ .requiredOption("--title <title>", "new display title; ID/path stay unchanged")
313
+ .action(action("rename"));
314
+ common(tasks.command("update <task>"))
315
+ .option("--title <title>")
316
+ .option("--blurb <text>")
317
+ .option("--kind <kind>")
318
+ .option("--tags <tags>")
319
+ .action(action("update"));
320
+ common(tasks.command("move <task> <destination>"))
321
+ .description("Change folder/path, preserving IDs")
322
+ .action(async (task, destination, opts) => {
323
+ process.exitCode = await runTasks("move", task, opts, destination);
324
+ });
325
+ common(tasks.command("reorder <task>"))
326
+ .requiredOption("--children <ids>", "complete ordered child-ID array, comma-separated")
327
+ .action(action("reorder"));
328
+ common(tasks.command("delete <task>"))
329
+ .description("Soft-delete; live subtasks must be moved/deleted first")
330
+ .action(action("delete"));
331
+ common(tasks.command("restore <task-id>"))
332
+ .description("Restore a soft-deleted task by stable ID")
333
+ .action(action("restore"));
334
+ for (const op of ["start", "end", "reopen"])
335
+ timed(common(tasks.command(`${op} <task>`))).action(action(op));
336
+ timed(common(tasks.command("progress <task>")))
337
+ .requiredOption("--mode <mode>", "discrete or continuous")
338
+ .requiredOption("--completed <n>", "absolute completed quantity")
339
+ .option("--total <n>", "total quantity; omit when unknown")
340
+ .requiredOption("--unit <unit>", "fixed progress unit")
341
+ .action(action("progress"));
342
+ const events = tasks.command("events").description("Task event history");
343
+ timed(common(events.command("add <task>")))
344
+ .requiredOption("--type <type>", "message or evidence")
345
+ .option("--message <text>")
346
+ .option("--kind <kind>", "evidence kind")
347
+ .option("--url <url>", "evidence URL")
348
+ .option("--description <text>")
349
+ .action(action("events-add"));
350
+ common(collectionList(events, "list <task>"))
351
+ .option("--cursor <revision>", "last received event cursor")
352
+ .option("--limit <n>", "page size", "50")
353
+ .option("--include-deleted")
354
+ .action(action("events-list"));
355
+ const notes = tasks
356
+ .command("notes")
357
+ .description("Existing Note items attached to a task");
358
+ for (const op of ["add", "remove"])
359
+ common(notes.command(`${op} <task>`))
360
+ .requiredOption("--role <role>", "agent_prompt, comment, details, acceptance or another role")
361
+ .requiredOption("--note-id <id>", "existing Note ID")
362
+ .option("--section <anchor>", "existing Note section anchor")
363
+ .action(action(`notes-${op}`));
364
+ common(collectionList(notes, "list <task>")).action(action("notes-list"));
365
+ }
@@ -0,0 +1,37 @@
1
+ import type { Command } from "commander";
2
+ export declare function runTeamList(orgSlug: string | undefined, opts: {
3
+ json?: boolean;
4
+ }): Promise<number>;
5
+ export declare function runTeamShow(orgSlug: string, teamSlug: string, opts: {
6
+ json?: boolean;
7
+ }): Promise<number>;
8
+ export declare function runTeamCreate(orgSlug: string, teamSlug: string, opts: {
9
+ name?: string;
10
+ description?: string;
11
+ visibility?: string;
12
+ parent?: string;
13
+ }): Promise<number>;
14
+ export declare function runTeamUpdate(orgSlug: string, teamSlug: string, opts: {
15
+ name?: string;
16
+ description?: string;
17
+ visibility?: string;
18
+ }): Promise<number>;
19
+ export declare function runTeamDelete(orgSlug: string, teamSlug: string, opts: {
20
+ yes?: boolean;
21
+ }): Promise<number>;
22
+ export declare function runTeamLeave(orgSlug: string, teamSlug: string, opts: {
23
+ yes?: boolean;
24
+ }): Promise<number>;
25
+ export declare function runTeamMemberList(orgSlug: string, teamSlug: string, opts: {
26
+ json?: boolean;
27
+ }): Promise<number>;
28
+ export declare function runTeamMemberAdd(orgSlug: string, teamSlug: string, user: string, opts: {
29
+ role?: string;
30
+ }): Promise<number>;
31
+ export declare function runTeamMemberRole(orgSlug: string, teamSlug: string, user: string, opts: {
32
+ role?: string;
33
+ }): Promise<number>;
34
+ export declare function runTeamMemberRemove(orgSlug: string, teamSlug: string, user: string, opts: {
35
+ yes?: boolean;
36
+ }): Promise<number>;
37
+ export declare function registerTeamCommand(program: Command): void;