@dreamlake/dreamlake-cli 0.88.1 → 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,163 @@
1
+ // Push-time generators for `dreamlake library push --thumbnails/--embed` —
2
+ // thin shells around the Python reference tools in dreamlake-py, located and
3
+ // invoked EXACTLY the way `env compose` finds its engine (env/compose.ts):
4
+ // DREAMLAKE_PYTHON wins outright, otherwise python3 then python; the module
5
+ // is probed with a bounded `import`, and the run's LAST stdout line is the
6
+ // one-JSON-line machine report (stderr streams through for humans).
7
+ //
8
+ // python -m dreamlake.assets_tools.render_thumbnails \
9
+ // --jobs <cache>/jobs.json --out-dir <cache>/thumbnails
10
+ // → {"rendered": [ids], "skipped": [{id,reason}], "failed": [{id,reason}]}
11
+ //
12
+ // python -m dreamlake.assets_tools.embed --manifest <cache>/manifest.json \
13
+ // --files-root <src> --thumbs-dir <cache>/thumbnails --out-dir <cache> \
14
+ // [--model <name>]
15
+ // → the stats dict, carrying the vectors.json / vectors.f32 paths plus the
16
+ // `model` id and `dim` that were actually used
17
+ //
18
+ // A missing interpreter or module is a WARNING, not a failure: the push is
19
+ // complete without the generated artifacts, and the message says how to get
20
+ // them.
21
+ import { boundedSpawn, lastNonEmptyLine, spawn, truncate } from "../spawn.js";
22
+ export const RENDER_MODULE = "dreamlake.assets_tools.render_thumbnails";
23
+ export const EMBED_MODULE = "dreamlake.assets_tools.embed";
24
+ /**
25
+ * The ONE encoder space DreamLake semantic search can use: the sidecar's
26
+ * `model` id must equal this string or the server refuses to fuse the
27
+ * library's vectors and search silently degrades to keyword-only.
28
+ *
29
+ * It is a COMPATIBILITY CONTRACT with the server's query encoder (SigLIP 2
30
+ * base, `dreamlake-server services/siglip2Text.ts`), not a preference — and
31
+ * the check has to be on the id, not the dimension: the legacy CLIP space
32
+ * (`open_clip/ViT-L-14-quickgelu/openai`) is also 768-d, so `dim` alone
33
+ * cannot tell the two apart.
34
+ */
35
+ export const DREAMLAKE_QUERY_MODEL_ID = "open_clip/ViT-B-16-SigLIP2/webli";
36
+ /** DREAMLAKE_PYTHON wins outright; otherwise python3, then python — the
37
+ * same resolution `env compose` uses. */
38
+ export function toolsPythonCandidates() {
39
+ const explicit = process.env.DREAMLAKE_PYTHON;
40
+ return explicit ? [explicit] : ["python3", "python"];
41
+ }
42
+ // An import probe is ~100 ms; anything past two minutes is a hang. The tool
43
+ // runs themselves are UNbounded — rendering a large library is slow.
44
+ const probeSpawn = boundedSpawn(120_000);
45
+ /** The extra that actually ships each tool's dependencies: rendering needs
46
+ * MuJoCo (`compose`), embedding needs torch + open_clip (`embed`). There is
47
+ * no `dreamlake[assets]` extra. */
48
+ function extraFor(module) {
49
+ return module === EMBED_MODULE ? "embed" : "compose";
50
+ }
51
+ function toolMissingMessage(module, detail) {
52
+ return (`the asset tools were not found — this step delegates to Python (${module}).\n` +
53
+ ` install them: pip install "dreamlake[${extraFor(module)}]"\n` +
54
+ ` or set DREAMLAKE_PYTHON to an interpreter that has the dreamlake package` +
55
+ (detail ? `\n (${detail})` : ""));
56
+ }
57
+ /** First interpreter that can `import <module>`, or the warning to print. */
58
+ export function findAssetTool(module, deps = {}) {
59
+ const sp = deps.spawn ?? probeSpawn;
60
+ let detail = "";
61
+ for (const py of toolsPythonCandidates()) {
62
+ const r = sp(py, ["-c", `import ${module}`]);
63
+ if (r.error?.code === "ENOENT")
64
+ continue;
65
+ if (r.status === 0)
66
+ return { py };
67
+ const line = lastNonEmptyLine(r.stderr);
68
+ if (line)
69
+ detail = `${py}: ${line}`;
70
+ }
71
+ if (!detail)
72
+ detail = `no python interpreter on PATH (tried ${toolsPythonCandidates().join(", ")})`;
73
+ return { message: toolMissingMessage(module, detail) };
74
+ }
75
+ function parseLastJson(stdout) {
76
+ try {
77
+ return JSON.parse(lastNonEmptyLine(stdout));
78
+ }
79
+ catch {
80
+ return null;
81
+ }
82
+ }
83
+ export function runRenderThumbnails(py, jobsPath, outDir, deps = {}) {
84
+ const sp = deps.spawn ?? spawn;
85
+ const r = sp(py, ["-m", RENDER_MODULE, "--jobs", jobsPath, "--out-dir", outDir]);
86
+ if (r.error?.code === "ENOENT")
87
+ return { message: toolMissingMessage(RENDER_MODULE, `${py}: not found`) };
88
+ if (r.stderr)
89
+ process.stderr.write(r.stderr);
90
+ const parsed = parseLastJson(r.stdout);
91
+ if (!parsed ||
92
+ !Array.isArray(parsed.rendered) ||
93
+ !Array.isArray(parsed.skipped) ||
94
+ !Array.isArray(parsed.failed)) {
95
+ const tail = truncate(r.stderr, 400);
96
+ return {
97
+ message: `the thumbnail renderer produced no report (exit ${r.status ?? "?"})` + (tail ? `\n${tail}` : ""),
98
+ };
99
+ }
100
+ return { report: parsed };
101
+ }
102
+ export function runEmbed(py, args, deps = {}) {
103
+ const sp = deps.spawn ?? spawn;
104
+ const r = sp(py, [
105
+ "-m", EMBED_MODULE,
106
+ "--manifest", args.manifestPath,
107
+ "--files-root", args.filesRoot,
108
+ "--thumbs-dir", args.thumbsDir,
109
+ "--out-dir", args.outDir,
110
+ ...(args.model ? ["--model", args.model] : []),
111
+ ]);
112
+ if (r.error?.code === "ENOENT")
113
+ return { message: toolMissingMessage(EMBED_MODULE, `${py}: not found`) };
114
+ if (r.stderr)
115
+ process.stderr.write(r.stderr);
116
+ const parsed = parseLastJson(r.stdout);
117
+ if (r.status !== 0 || !parsed || typeof parsed.json !== "string" || typeof parsed.f32 !== "string") {
118
+ const tail = truncate(r.stderr, 400);
119
+ return {
120
+ message: `the embed tool produced no report (exit ${r.status ?? "?"})` + (tail ? `\n${tail}` : ""),
121
+ };
122
+ }
123
+ return { stats: parsed };
124
+ }
125
+ /**
126
+ * The encoder, as the push summary names it: `" (<model id>, <dim>-d)"`, or
127
+ * `""` when the tool reported neither. Which model ran is not cosmetic — it
128
+ * decides whether the library gets semantic search at all — so the push must
129
+ * never print a bare "vectors: …" line that leaves the user guessing.
130
+ */
131
+ export function describeEmbedModel(stats) {
132
+ const parts = [];
133
+ if (typeof stats.model === "string" && stats.model !== "")
134
+ parts.push(stats.model);
135
+ if (typeof stats.dim === "number" && Number.isFinite(stats.dim))
136
+ parts.push(`${stats.dim}-d`);
137
+ return parts.length > 0 ? ` (${parts.join(", ")})` : "";
138
+ }
139
+ /**
140
+ * The warning for a sidecar the server will not fuse, or `undefined` when the
141
+ * vectors are in the query-encoder space.
142
+ *
143
+ * A WARNING, never a failure: the sidecar is valid, and embedding a library
144
+ * for some other consumer with `--model` is legitimate. But the DreamLake
145
+ * outcome — keyword-only search, no error anywhere — is invisible otherwise,
146
+ * which is the whole defect this exists to close.
147
+ *
148
+ * Silent when the tool reported no `model` at all: an unknown id is not
149
+ * evidence of a wrong one, and a warning on every push with an older
150
+ * dreamlake-py would be noise.
151
+ */
152
+ export function embedModelWarning(stats) {
153
+ const model = typeof stats.model === "string" ? stats.model : "";
154
+ if (model === "" || model === DREAMLAKE_QUERY_MODEL_ID)
155
+ return undefined;
156
+ return (`these vectors are NOT usable for semantic search on DreamLake.\n` +
157
+ ` the sidecar was embedded with ${model}, but the server queries with\n` +
158
+ ` ${DREAMLAKE_QUERY_MODEL_ID} and only fuses a library whose model id matches —\n` +
159
+ ` this library will fall back to keyword-only search, with no further error.\n` +
160
+ ` fix: upgrade the Python toolchain (pip install -U "dreamlake[embed]"), or\n` +
161
+ ` re-push with --model siglip2\n` +
162
+ ` (ignore this if you are embedding for a consumer other than DreamLake search)`);
163
+ }
@@ -0,0 +1,47 @@
1
+ import type { LibraryYml } from "./config.js";
2
+ import type { DiscoveredAsset } from "./discover.js";
3
+ import type { HashedFile } from "./cache.js";
4
+ import { type LibraryManifest } from "./manifest.js";
5
+ export declare function thumbnailGeneratedPath(assetId: string): string;
6
+ export interface CarryForward {
7
+ /** generated[] entries carried from the remote manifest (still in storage). */
8
+ generated: string[];
9
+ /** assetId → carried thumbnail path (always under .dreamlake/thumbnails/). */
10
+ thumbnails: Map<string, string>;
11
+ /** Whether the vectors pair was carried. */
12
+ vectors: boolean;
13
+ }
14
+ /**
15
+ * What survives from the remote manifest's generated artifacts, given the
16
+ * asset ids this push registers and which artifact families it regenerates.
17
+ */
18
+ export declare function carryForwardGenerated(remote: LibraryManifest | null, localIds: ReadonlySet<string>, opts?: {
19
+ regenVectors?: boolean;
20
+ }): CarryForward;
21
+ export interface BuildManifestInput {
22
+ /** The resolved library name (written into library.name). */
23
+ name: string;
24
+ yml: LibraryYml | null;
25
+ /** true when a dreamlake.yml exists — it then joins the closure (attached
26
+ * to the first asset) so a pull → push round-trip keeps the metadata. */
27
+ includeYml: boolean;
28
+ assets: readonly DiscoveredAsset[];
29
+ /** rel path → {size, sha256}, covering every asset file AND dreamlake.yml. */
30
+ hashes: ReadonlyMap<string, HashedFile>;
31
+ /** assetId → generated thumbnail path, freshly rendered THIS push. */
32
+ renderedThumbnails?: ReadonlyMap<string, string>;
33
+ carried?: CarryForward;
34
+ /** Extra generated[] entries produced this push (e.g. the vectors pair). */
35
+ extraGenerated?: readonly string[];
36
+ }
37
+ /**
38
+ * Assemble the wire manifest. Deterministic: assets sorted by id, files
39
+ * sorted within each asset, generated[] sorted and deduplicated.
40
+ *
41
+ * Thumbnail precedence per asset: the user's own file (yml `thumbnail:` or
42
+ * a shipped thumbnail/preview image auto-detected at discovery) wins over a
43
+ * fresh render, which wins over a carried remote render — the
44
+ * fresh and carried paths are the same string anyway
45
+ * (`.dreamlake/thumbnails/<id>.webp`), so regeneration is invisible here.
46
+ */
47
+ export declare function buildWireManifest(input: BuildManifestInput): LibraryManifest;
@@ -0,0 +1,120 @@
1
+ // Wire-manifest construction for `dreamlake library push` — discovered
2
+ // assets + hashes + generated artifacts → the dreamlake.assets/v1 document
3
+ // that uploads to `files/.dreamlake/manifest.json`.
4
+ //
5
+ // CARRY-FORWARD is decided here. A push without `--thumbnails` / `--embed`
6
+ // on an existing library must not orphan the platform artifacts a previous
7
+ // push generated: their objects are still in storage, and the server's
8
+ // reconcile keeps exactly what the new manifest lists. So remote
9
+ // `.dreamlake/thumbnails/<id>.webp` entries (and the per-asset `thumbnail`
10
+ // pointers at them) are carried for every asset id that still exists, the
11
+ // vectors pair is carried unless this push regenerates it, and anything else
12
+ // under `generated[]` is carried verbatim. Thumbnails of REMOVED assets are
13
+ // dropped — reconcile then deletes the objects, which is the point.
14
+ import { GENERATED_THUMBNAILS_PREFIX, GENERATED_VECTORS_F32, GENERATED_VECTORS_JSON, LIBRARY_MANIFEST_SCHEMA, } from "./manifest.js";
15
+ export function thumbnailGeneratedPath(assetId) {
16
+ return `${GENERATED_THUMBNAILS_PREFIX}${assetId}.webp`;
17
+ }
18
+ /**
19
+ * What survives from the remote manifest's generated artifacts, given the
20
+ * asset ids this push registers and which artifact families it regenerates.
21
+ */
22
+ export function carryForwardGenerated(remote, localIds, opts = {}) {
23
+ const out = { generated: [], thumbnails: new Map(), vectors: false };
24
+ if (!remote?.generated)
25
+ return out;
26
+ for (const p of remote.generated) {
27
+ if (p.startsWith(GENERATED_THUMBNAILS_PREFIX)) {
28
+ const id = p.slice(GENERATED_THUMBNAILS_PREFIX.length).replace(/\.webp$/, "");
29
+ if (localIds.has(id))
30
+ out.generated.push(p);
31
+ continue;
32
+ }
33
+ if (p === GENERATED_VECTORS_JSON || p === GENERATED_VECTORS_F32) {
34
+ if (!opts.regenVectors) {
35
+ out.generated.push(p);
36
+ out.vectors = true;
37
+ }
38
+ continue;
39
+ }
40
+ out.generated.push(p); // an artifact family this CLI doesn't know — keep it
41
+ }
42
+ for (const asset of remote.assets) {
43
+ if (!localIds.has(asset.id))
44
+ continue;
45
+ if (typeof asset.thumbnail === "string" && asset.thumbnail.startsWith(GENERATED_THUMBNAILS_PREFIX)) {
46
+ if (out.generated.includes(asset.thumbnail)) {
47
+ out.thumbnails.set(asset.id, asset.thumbnail);
48
+ }
49
+ }
50
+ }
51
+ return out;
52
+ }
53
+ /**
54
+ * Assemble the wire manifest. Deterministic: assets sorted by id, files
55
+ * sorted within each asset, generated[] sorted and deduplicated.
56
+ *
57
+ * Thumbnail precedence per asset: the user's own file (yml `thumbnail:` or
58
+ * a shipped thumbnail/preview image auto-detected at discovery) wins over a
59
+ * fresh render, which wins over a carried remote render — the
60
+ * fresh and carried paths are the same string anyway
61
+ * (`.dreamlake/thumbnails/<id>.webp`), so regeneration is invisible here.
62
+ */
63
+ export function buildWireManifest(input) {
64
+ const { yml } = input;
65
+ const library = { name: input.name };
66
+ for (const key of ["type", "title", "description", "provider", "homepage", "license"]) {
67
+ const v = yml?.library?.[key];
68
+ if (v !== undefined)
69
+ library[key] = v;
70
+ }
71
+ if (yml?.library?.tags && yml.library.tags.length > 0)
72
+ library.tags = yml.library.tags;
73
+ if (yml?.library?.upstream)
74
+ library.upstream = yml.library.upstream;
75
+ const generated = new Set(input.carried?.generated ?? []);
76
+ for (const p of input.extraGenerated ?? [])
77
+ generated.add(p);
78
+ for (const p of input.renderedThumbnails?.values() ?? [])
79
+ generated.add(p);
80
+ const sorted = [...input.assets].sort((a, b) => (a.id < b.id ? -1 : 1));
81
+ const assets = sorted.map((a, i) => {
82
+ const fileSet = [...a.files];
83
+ if (input.includeYml && i === 0 && !fileSet.includes("dreamlake.yml")) {
84
+ // dreamlake.yml is a user file and must round-trip; the server keeps
85
+ // only manifest-listed paths, so it rides in the first asset's files.
86
+ fileSet.push("dreamlake.yml");
87
+ }
88
+ const files = fileSet.sort().map((rel) => {
89
+ const h = input.hashes.get(rel);
90
+ if (!h)
91
+ throw new Error(`no hash for '${rel}' — hashing must cover every manifest file`);
92
+ return { path: rel, size: h.size, sha256: h.sha256 };
93
+ });
94
+ const thumbnail = a.thumbnail ??
95
+ input.renderedThumbnails?.get(a.id) ??
96
+ input.carried?.thumbnails.get(a.id);
97
+ return {
98
+ id: a.id,
99
+ ...(a.title ? { title: a.title } : {}),
100
+ ...(a.description ? { description: a.description } : {}),
101
+ ...(a.category ? { category: a.category } : {}),
102
+ ...(a.tags && a.tags.length > 0 ? { tags: a.tags } : {}),
103
+ kind: a.kind,
104
+ ...(a.format ? { format: a.format } : {}),
105
+ ...(a.license ? { license: a.license } : {}),
106
+ ...(a.attribution ? { attribution: a.attribution } : {}),
107
+ ...(a.upstream ? { upstream: a.upstream } : {}),
108
+ ...(a.entry ? { entry: a.entry } : {}),
109
+ ...(a.entryPoints ? { entryPoints: a.entryPoints } : {}),
110
+ files,
111
+ ...(thumbnail ? { thumbnail } : {}),
112
+ };
113
+ });
114
+ return {
115
+ schema: LIBRARY_MANIFEST_SCHEMA,
116
+ library,
117
+ assets,
118
+ ...(generated.size > 0 ? { generated: [...generated].sort() } : {}),
119
+ };
120
+ }
@@ -0,0 +1,26 @@
1
+ import type { Command } from "commander";
2
+ interface AssetListOpts {
3
+ episode?: string;
4
+ prefix?: string;
5
+ type?: string;
6
+ json?: boolean;
7
+ }
8
+ export declare function runListAssets(opts: AssetListOpts): Promise<number>;
9
+ export declare function runListProjects(opts: {
10
+ namespace?: string;
11
+ json?: boolean;
12
+ }): Promise<number>;
13
+ export declare function runListBindrs(opts: {
14
+ project?: string;
15
+ json?: boolean;
16
+ }): Promise<number>;
17
+ export declare function runListDatasets(opts: {
18
+ project?: string;
19
+ json?: boolean;
20
+ }): Promise<number>;
21
+ export declare function runListEpisodes(opts: {
22
+ project?: string;
23
+ json?: boolean;
24
+ }): Promise<number>;
25
+ export declare function registerListCommand(program: Command): void;
26
+ export {};
@@ -0,0 +1,256 @@
1
+ // `dreamlake list ...` — assets (default), bindrs, datasets, episodes.
2
+ // Port of dreamlake-py's cli/commands/list.py. Where the Python CLI used
3
+ // an interactive 20-per-page pager, we fetch all pages and render one
4
+ // table (more script-friendly); `--json` emits raw JSON.
5
+ import { resolveNamespace, resolveRemote, resolveToken } from "../config.js";
6
+ import { emitJson, fail, humanSize, renderTable } from "../helpers.js";
7
+ import { fetchAllContents, fetchAllEpisodes, fetchAllPages, fetchProjects, nodePathToCommaPrefix, relPathUnder, resolveProjectCtx, } from "../resources.js";
8
+ import { formatProject, formatTarget, parseTarget } from "../target.js";
9
+ export async function runListAssets(opts) {
10
+ if (!opts.episode) {
11
+ fail("--episode is required");
12
+ return 1;
13
+ }
14
+ let t;
15
+ try {
16
+ t = parseTarget(opts.episode);
17
+ }
18
+ catch (err) {
19
+ fail(err.message);
20
+ return 1;
21
+ }
22
+ const remote = resolveRemote();
23
+ const token = resolveToken();
24
+ if (!token) {
25
+ fail("not authenticated. run 'dreamlake login' first");
26
+ return 1;
27
+ }
28
+ const namespace = await resolveNamespace(t.namespace, { token, remote });
29
+ if (!namespace) {
30
+ fail("namespace not specified and no authenticated user found. run 'dreamlake login'");
31
+ return 1;
32
+ }
33
+ t.namespace = namespace;
34
+ // Resolve the container node (episode root, or project root when the
35
+ // target has no episode), then list its files via /nodes/:id/contents.
36
+ let containerId;
37
+ let containerPrefix;
38
+ try {
39
+ if (t.episode) {
40
+ const episodes = await fetchAllEpisodes(remote, t.namespace, t.project, token);
41
+ const ep = episodes.find((e) => e.name === t.episode);
42
+ if (!ep) {
43
+ fail(`episode '${t.episode}' not found in ${t.project}@${t.namespace}`);
44
+ return 1;
45
+ }
46
+ containerId = ep.id;
47
+ containerPrefix = nodePathToCommaPrefix(ep.nodePath ?? `/${t.project}/${t.episode}`);
48
+ }
49
+ else {
50
+ const projects = await fetchProjects(remote, token, t.namespace);
51
+ const proj = projects.find((p) => p.slug === t.project);
52
+ if (!proj) {
53
+ fail(`project '${t.project}' not found in namespace ${t.namespace}`);
54
+ return 1;
55
+ }
56
+ containerId = proj.id;
57
+ containerPrefix = `,${t.project},`;
58
+ }
59
+ const files = await fetchAllContents(remote, token, containerId, opts.type);
60
+ let rows = files.map((f) => ({
61
+ path: relPathUnder(f, containerPrefix),
62
+ kind: f.kind,
63
+ size: f.metadata?.size != null ? humanSize(f.metadata.size) : "—",
64
+ created: String(f.createdAt ?? "").slice(0, 10),
65
+ }));
66
+ if (opts.prefix) {
67
+ const want = opts.prefix.replace(/^\/+/, "");
68
+ rows = rows.filter((r) => r.path.startsWith(want));
69
+ }
70
+ if (opts.json) {
71
+ emitJson(rows);
72
+ return 0;
73
+ }
74
+ process.stdout.write(`Listing ${opts.type ?? "all"} assets in ${formatTarget(t)}\n\n`);
75
+ if (rows.length === 0) {
76
+ process.stdout.write(" (no assets found)\n");
77
+ return 0;
78
+ }
79
+ process.stdout.write(renderTable(rows, ["path", "kind", "size", "created"]));
80
+ process.stdout.write(`\n ${rows.length} asset(s)\n`);
81
+ return 0;
82
+ }
83
+ catch (err) {
84
+ fail(err.message);
85
+ return 1;
86
+ }
87
+ }
88
+ // ─── projects ────────────────────────────────────────────────────────
89
+ export async function runListProjects(opts) {
90
+ const remote = resolveRemote();
91
+ const token = resolveToken();
92
+ if (!token) {
93
+ fail("not authenticated. run 'dreamlake login' first");
94
+ return 1;
95
+ }
96
+ const namespace = await resolveNamespace(opts.namespace, { token, remote });
97
+ if (!namespace) {
98
+ fail("namespace not specified and no authenticated user found. run 'dreamlake login'");
99
+ return 1;
100
+ }
101
+ const projects = await fetchProjects(remote, token, namespace);
102
+ if (opts.json) {
103
+ emitJson(projects);
104
+ return 0;
105
+ }
106
+ process.stdout.write(`Listing projects in namespace ${namespace}\n\n`);
107
+ const rows = projects.map((p) => ({
108
+ slug: p.slug,
109
+ name: p.name ?? "",
110
+ visibility: p.visibility ?? "",
111
+ bindrs: p.bindrCount ?? 0,
112
+ datasets: p.datasetCount ?? 0,
113
+ created: String(p.createdAt ?? "").slice(0, 10),
114
+ }));
115
+ process.stdout.write(renderTable(rows, ["slug", "name", "visibility", "bindrs", "datasets", "created"]));
116
+ process.stdout.write(`\n ${projects.length} project(s)\n`);
117
+ return 0;
118
+ }
119
+ // ─── bindrs / datasets / episodes ────────────────────────────────────
120
+ export async function runListBindrs(opts) {
121
+ if (!opts.project) {
122
+ fail("--project is required for listing bindrs");
123
+ return 1;
124
+ }
125
+ const ctx = await resolveProjectCtx(opts.project);
126
+ if (!ctx)
127
+ return 1;
128
+ const { s, token, remote } = ctx;
129
+ const result = await fetchAllPages(remote, `/namespaces/${s.namespace}/projects/${s.project}/bindrs`, token, "bindrs");
130
+ if (result === "not-found") {
131
+ process.stdout.write(" (project not found)\n");
132
+ return 0;
133
+ }
134
+ if (opts.json) {
135
+ emitJson(result.items);
136
+ return 0;
137
+ }
138
+ process.stdout.write(`Listing bindrs in ${formatProject(s)}\n\n`);
139
+ const rows = result.items.map((d) => ({
140
+ name: String(d.name ?? ""),
141
+ files: Array.isArray(d.members) ? d.members.length : 0,
142
+ tags: Array.isArray(d.tags) ? d.tags.join(", ") : "",
143
+ description: String(d.description ?? "").slice(0, 40),
144
+ created: String(d.createdAt ?? "").slice(0, 10),
145
+ }));
146
+ process.stdout.write(renderTable(rows, ["name", "files", "tags", "description", "created"]));
147
+ process.stdout.write(`\n ${result.total} bindr(s)\n`);
148
+ return 0;
149
+ }
150
+ export async function runListDatasets(opts) {
151
+ if (!opts.project) {
152
+ fail("--project is required for listing datasets");
153
+ return 1;
154
+ }
155
+ const ctx = await resolveProjectCtx(opts.project);
156
+ if (!ctx)
157
+ return 1;
158
+ const { s, token, remote } = ctx;
159
+ const result = await fetchAllPages(remote, `/namespaces/${s.namespace}/projects/${s.project}/datasets`, token, "datasets");
160
+ if (result === "not-found") {
161
+ process.stdout.write(" (project not found)\n");
162
+ return 0;
163
+ }
164
+ if (opts.json) {
165
+ emitJson(result.items);
166
+ return 0;
167
+ }
168
+ process.stdout.write(`Listing datasets in ${formatProject(s)}\n\n`);
169
+ const rows = result.items.map((d) => ({
170
+ name: String(d.name ?? ""),
171
+ bindrs: Array.isArray(d.bindrs) ? d.bindrs.length : 0,
172
+ tags: Array.isArray(d.tags) ? d.tags.join(", ") : "",
173
+ description: String(d.description ?? "").slice(0, 40),
174
+ created: String(d.createdAt ?? "").slice(0, 10),
175
+ }));
176
+ process.stdout.write(renderTable(rows, ["name", "bindrs", "tags", "description", "created"]));
177
+ process.stdout.write(`\n ${result.total} dataset(s)\n`);
178
+ return 0;
179
+ }
180
+ export async function runListEpisodes(opts) {
181
+ if (!opts.project) {
182
+ fail("--project is required for listing episodes");
183
+ return 1;
184
+ }
185
+ const ctx = await resolveProjectCtx(opts.project);
186
+ if (!ctx)
187
+ return 1;
188
+ const { s, token, remote } = ctx;
189
+ const result = await fetchAllPages(remote, `/namespaces/${s.namespace}/projects/${s.project}/episodes`, token, "episodes");
190
+ if (result === "not-found") {
191
+ process.stdout.write(" (project not found)\n");
192
+ return 0;
193
+ }
194
+ if (opts.json) {
195
+ emitJson(result.items);
196
+ return 0;
197
+ }
198
+ process.stdout.write(`Listing episodes in ${formatProject(s)}\n\n`);
199
+ const rows = result.items.map((ep) => ({
200
+ name: String(ep.name ?? ""),
201
+ path: String(ep.nodePath ?? ""),
202
+ status: String(ep.status ?? ""),
203
+ tags: Array.isArray(ep.tags) ? ep.tags.join(", ") : "",
204
+ created: String(ep.createdAt ?? "").slice(0, 10),
205
+ }));
206
+ process.stdout.write(renderTable(rows, ["name", "path", "status", "tags", "created"]));
207
+ process.stdout.write(`\n ${result.total} episode(s)\n`);
208
+ return 0;
209
+ }
210
+ // ─── registration ────────────────────────────────────────────────────
211
+ export function registerListCommand(program) {
212
+ const list = program
213
+ .command("list")
214
+ .description("list assets (default), or projects / bindrs / datasets / episodes")
215
+ .option("--episode <target>", "episode scope: space[@namespace][:episode]")
216
+ .option("--prefix <path>", "filter assets by path prefix")
217
+ .option("--type <category>", "filter assets by category")
218
+ .option("--json", "emit JSON instead of a table")
219
+ .action(async (opts) => {
220
+ process.exit(await runListAssets(opts));
221
+ });
222
+ list
223
+ .command("project")
224
+ .description("list projects in a namespace")
225
+ .option("--namespace <slug>", "namespace (default: your own)")
226
+ .option("--json", "emit JSON instead of a table")
227
+ // `list` also defines --json and takes it in either position
228
+ // (`list project --json`, `list --json project`), so read it from there too.
229
+ .action(async (_opts, cmd) => {
230
+ process.exit(await runListProjects(cmd.optsWithGlobals()));
231
+ });
232
+ list
233
+ .command("bindr")
234
+ .description("list bindrs in a project")
235
+ .requiredOption("--project <target>", "project scope: space[@namespace]")
236
+ .option("--json", "emit JSON instead of a table")
237
+ .action(async (opts) => {
238
+ process.exit(await runListBindrs(opts));
239
+ });
240
+ list
241
+ .command("dataset")
242
+ .description("list datasets in a project")
243
+ .requiredOption("--project <target>", "project scope: space[@namespace]")
244
+ .option("--json", "emit JSON instead of a table")
245
+ .action(async (opts) => {
246
+ process.exit(await runListDatasets(opts));
247
+ });
248
+ list
249
+ .command("episode")
250
+ .description("list episodes in a project")
251
+ .requiredOption("--project <target>", "project scope: space[@namespace]")
252
+ .option("--json", "emit JSON instead of a table")
253
+ .action(async (opts) => {
254
+ process.exit(await runListEpisodes(opts));
255
+ });
256
+ }
@@ -0,0 +1,22 @@
1
+ /** Pure patch validation. Persistence must compile these edits to native RTC operations. */
2
+ export interface CharacterEdit {
3
+ start: number;
4
+ end: number;
5
+ expectedText: string;
6
+ replacementText: string;
7
+ }
8
+ export declare const PATCH_LIMITS: Readonly<{
9
+ maxSourceCodePoints: 1000000;
10
+ maxPatchBytes: 8000000;
11
+ maxHunks: 10000;
12
+ maxEdits: 10000;
13
+ maxDiffCells: 4000000;
14
+ maxTraceCells: 250000;
15
+ }>;
16
+ export declare class NotePatchError extends Error {
17
+ readonly code: 'INVALID_PATCH' | 'LIMIT_EXCEEDED';
18
+ constructor(message: string, code?: 'INVALID_PATCH' | 'LIMIT_EXCEEDED');
19
+ }
20
+ export declare function characterDiff(base: string, target: string, offset?: number, budget?: {
21
+ cells: number;
22
+ }): CharacterEdit[];