@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,200 @@
1
+ // `dreamlake library rm <spec> <assetId...>` — remove assets from a remote
2
+ // library without holding a full local copy (RFC 0008 §5.7).
3
+ //
4
+ // No payload bytes move: the edit is the manifest itself. Read the remote
5
+ // document → drop the named entries (and the generated thumbnail renders
6
+ // only they referenced) → upload the merged manifest → register with
7
+ // expectedRevision. Deletion is entirely server-side reconcile: storage
8
+ // keeps exactly what the registered manifest lists, so every file no
9
+ // remaining asset references is reclaimed there. The CLI never holds delete
10
+ // permission — same as push.
11
+ //
12
+ // A 409 means another writer advanced the library: refetch, re-apply the
13
+ // removal against the fresh document, retry ONCE. An id that is already
14
+ // gone after the refetch counts as done — the outcome the user asked for
15
+ // exists — and when nothing is left to change, no register is issued at all.
16
+ import { createHash } from 'node:crypto';
17
+ import { libraryGenerationRequired, publishLibraryManifestGeneration } from './generation.js';
18
+ import { librariesCacheDir } from './cache.js';
19
+ import { mkdtempSync, rmSync } from "node:fs";
20
+ import { tmpdir } from "node:os";
21
+ import path from "node:path";
22
+ import { emitJson, fail, ok, warn } from "../helpers.js";
23
+ import { resolveCtx } from "../compat/ctx.js";
24
+ import { errorMessage, jsonRequest, requireNamespace, requireToken } from "../compat/http.js";
25
+ import { DREAMLAKE_YML } from "./config.js";
26
+ import { GENERATED_THUMBNAILS_PREFIX, MANIFEST_PATH_PRIMARY, } from "./manifest.js";
27
+ import { thumbnailGeneratedPath } from "./wire.js";
28
+ import { fetchRemoteLibrary, uploadLibraryFiles, writeManifestFile, } from "./add.js";
29
+ import { parseLibrarySpec } from "./pull.js";
30
+ /**
31
+ * The merged document minus `ids`. Generated thumbnail renders
32
+ * (`.dreamlake/thumbnails/<id>.webp`) of removed assets leave generated[]
33
+ * unless a REMAINING asset's thumbnail points at that exact path; the
34
+ * vectors sidecar entries stay — their stale per-asset rows are tolerated
35
+ * (search reads assets from the manifest and looks vectors up by id).
36
+ */
37
+ export function planRemoval(remote, ids) {
38
+ const idSet = new Set(ids);
39
+ const removedAssets = remote.assets.filter((a) => idSet.has(a.id));
40
+ const remaining = remote.assets.filter((a) => !idSet.has(a.id));
41
+ const removed = removedAssets.map((a) => a.id);
42
+ const keptPaths = new Set();
43
+ for (const a of remaining)
44
+ for (const f of a.files)
45
+ keptPaths.add(f.path);
46
+ const reclaimed = new Set();
47
+ for (const a of removedAssets) {
48
+ for (const f of a.files) {
49
+ if (!keptPaths.has(f.path))
50
+ reclaimed.add(f.path);
51
+ }
52
+ }
53
+ const keptThumbs = new Set(remaining
54
+ .map((a) => a.thumbnail)
55
+ .filter((t) => typeof t === "string" && t.startsWith(GENERATED_THUMBNAILS_PREFIX)));
56
+ const droppedRenders = new Set(removed.map((id) => thumbnailGeneratedPath(id)));
57
+ const generated = (remote.generated ?? []).filter((p) => !droppedRenders.has(p) || keptThumbs.has(p));
58
+ const hasAuthoringYml = remote.assets.some((a) => a.files.some((f) => f.path === DREAMLAKE_YML));
59
+ const manifest = {
60
+ ...remote,
61
+ assets: remaining,
62
+ ...(generated.length > 0 ? { generated } : {}),
63
+ };
64
+ if (generated.length === 0)
65
+ delete manifest.generated;
66
+ return { manifest, removed, reclaimed: [...reclaimed].sort(), hasAuthoringYml };
67
+ }
68
+ export async function runLibraryRm(args, deps = {}) {
69
+ const parsed = parseLibrarySpec(args.spec);
70
+ if ("error" in parsed) {
71
+ fail(parsed.error);
72
+ return 1;
73
+ }
74
+ const ctx = resolveCtx(args);
75
+ const token = requireToken(ctx);
76
+ if (!token)
77
+ return 1;
78
+ const namespace = parsed.namespace ?? (await requireNamespace(ctx, undefined));
79
+ if (!namespace)
80
+ return 1;
81
+ const spec = `${namespace}/${parsed.name}`;
82
+ const base = `${ctx.remote}/namespaces/${encodeURIComponent(namespace)}/libraries/${encodeURIComponent(parsed.name)}`;
83
+ const tmp = mkdtempSync(path.join(tmpdir(), "dreamlake-rm-"));
84
+ try {
85
+ for (let attempt = 0;; attempt++) {
86
+ const remote = await fetchRemoteLibrary(base, token, spec);
87
+ if ("error" in remote) {
88
+ fail(remote.error);
89
+ return 1;
90
+ }
91
+ // Every requested id must exist on the FIRST attempt — a typo'd id is
92
+ // an error, not a no-op. On the retry an id another writer already
93
+ // removed is the requested outcome and counts as done.
94
+ if (attempt === 0) {
95
+ const known = new Set(remote.manifest.assets.map((a) => a.id));
96
+ const missing = args.assetIds.filter((id) => !known.has(id));
97
+ if (missing.length > 0) {
98
+ const available = remote.manifest.assets.map((a) => a.id);
99
+ const shown = available.slice(0, 20).join(", ");
100
+ fail(`asset '${missing[0]}' not found in ${spec} — ` +
101
+ `available: ${shown}${available.length > 20 ? `, … (${available.length} total)` : ""}`);
102
+ return 1;
103
+ }
104
+ }
105
+ const plan = planRemoval(remote.manifest, args.assetIds);
106
+ if (plan.manifest.assets.length === 0) {
107
+ fail(`removing ${plan.removed.length === 1 ? "this asset" : "these assets"} would leave ${spec} empty — ` +
108
+ `push a new tree instead, or delete the library`);
109
+ return 1;
110
+ }
111
+ // warn() writes to stdout — keep --json output parseable (the search
112
+ // command's stderr-scope-line precedent).
113
+ if (plan.hasAuthoringYml && !args.json) {
114
+ warn(`the library carries a ${DREAMLAKE_YML} authoring file — it may still reference the ` +
115
+ `removed id(s); refresh it on the next push`);
116
+ }
117
+ if (args.dryRun) {
118
+ process.stdout.write(`Removing from ${spec} (revision ${remote.revision})\n`);
119
+ process.stdout.write(` assets: ${plan.removed.join(", ")}\n`);
120
+ process.stdout.write(` files reclaimed at register (server-side): ${plan.reclaimed.length}\n`);
121
+ if (args.json) {
122
+ emitJson({ library: spec, dryRun: true, removed: plan.removed, filesReclaimed: plan.reclaimed.length });
123
+ }
124
+ else {
125
+ ok("dry run — nothing registered");
126
+ }
127
+ return 0;
128
+ }
129
+ if (plan.removed.length === 0) {
130
+ // Only reachable on the retry: every id was removed by the other
131
+ // writer while this rm raced it. The requested state already holds.
132
+ if (args.json) {
133
+ emitJson({ library: spec, revision: remote.revision, removed: [], filesReclaimed: 0 });
134
+ }
135
+ else {
136
+ ok(`${spec} — already removed by another writer, nothing to do`);
137
+ }
138
+ return 0;
139
+ }
140
+ const manifestFile = writeManifestFile(tmp, plan.manifest);
141
+ const generation = await libraryGenerationRequired(base, token);
142
+ let reg;
143
+ if (generation) {
144
+ reg = await publishLibraryManifestGeneration({ base, token, manifest: plan.manifest, manifestFile, localByRel: new Map(), expectedRevision: remote.revision, fetchFn: deps.fetchFn, cacheDir: path.join(librariesCacheDir(), 'generation-edits', createHash('sha256').update(base).digest('hex')) });
145
+ }
146
+ else {
147
+ try {
148
+ await uploadLibraryFiles(base, token, [{ relativePath: MANIFEST_PATH_PRIMARY, size: manifestFile.size }], new Map([[MANIFEST_PATH_PRIMARY, manifestFile.abs]]), deps.fetchFn);
149
+ }
150
+ catch (e) {
151
+ fail(`upload failed: ${e instanceof Error ? e.message : String(e)}`);
152
+ return 1;
153
+ }
154
+ reg = await jsonRequest("POST", `${base}/register`, token, {
155
+ expectedRevision: remote.revision,
156
+ });
157
+ }
158
+ if (reg.status === 409 && attempt === 0)
159
+ continue;
160
+ if (reg.status < 200 || reg.status >= 300) {
161
+ fail(`could not register the library → ${reg.status}: ${errorMessage(reg)}`);
162
+ if (reg.status === 409) {
163
+ process.stderr.write(` another writer is racing this rm — re-run \`dreamlake library rm\`.\n`);
164
+ }
165
+ return 1;
166
+ }
167
+ const receipt = reg.body;
168
+ const revision = generation ? receipt?.publishedRevision ?? receipt?.revision : receipt?.revision;
169
+ if (args.json) {
170
+ emitJson({
171
+ library: spec,
172
+ revision: typeof revision === "number" ? revision : null,
173
+ removed: plan.removed,
174
+ filesReclaimed: plan.reclaimed.length,
175
+ });
176
+ }
177
+ else {
178
+ ok(`${spec} revision ${typeof revision === "number" ? revision : "?"} — ` +
179
+ `${plan.removed.length} asset${plan.removed.length === 1 ? "" : "s"} removed, ` +
180
+ `${plan.reclaimed.length} file${plan.reclaimed.length === 1 ? "" : "s"} reclaimed`);
181
+ }
182
+ return 0;
183
+ }
184
+ }
185
+ finally {
186
+ rmSync(tmp, { recursive: true, force: true });
187
+ }
188
+ }
189
+ export function registerLibraryRmCommand(library, withConnFlags) {
190
+ withConnFlags(library
191
+ .command("rm")
192
+ .description("remove assets from a remote library without a full local copy — no bytes transfer; " +
193
+ "storage is reclaimed by server-side reconcile at register")
194
+ .argument("<spec>", "<namespace>/<name>, or a bare <name> under the active login")
195
+ .argument("<assetIds...>", "asset id(s) to remove")
196
+ .option("--dry-run", "print what would be removed, then exit")
197
+ .option("--json", "emit the result as JSON")).action(async (spec, assetIds, opts) => {
198
+ process.exit(await runLibraryRm({ ...opts, spec, assetIds }));
199
+ });
200
+ }
@@ -0,0 +1,18 @@
1
+ import type { Command } from "commander";
2
+ import { type DreamlakeOpts } from "../compat/ctx.js";
3
+ /** The search API refuses more than this many libraries per call. */
4
+ export declare const SEARCH_MAX_LIBRARIES = 50;
5
+ export interface LibrarySearchArgs extends DreamlakeOpts {
6
+ query: string;
7
+ /** Comma-separated `<namespace>/<name>` list; omitted → auto scope. */
8
+ library?: string;
9
+ kind?: string;
10
+ category?: string;
11
+ tag?: string;
12
+ license?: string;
13
+ limit?: string;
14
+ offset?: string;
15
+ json?: boolean;
16
+ }
17
+ export declare function runLibrarySearch(args: LibrarySearchArgs): Promise<number>;
18
+ export declare function registerLibrarySearchCommand(library: Command, withConnFlags: (c: Command) => Command): void;
@@ -0,0 +1,181 @@
1
+ // `dreamlake library search <query>` — search assets across libraries.
2
+ //
3
+ // GET /library-search over an explicit `--library ns/a,ns/b` scope, or —
4
+ // when no scope is given — the caller's visible libraries from GET
5
+ // /libraries (most recently updated first, capped at the API's 50-entry
6
+ // limit), with a one-liner saying which scope was used. Public libraries
7
+ // search without a token; the token rides along when the login has one,
8
+ // widening the scope to the caller's private libraries.
9
+ //
10
+ // Default output is one line per hit carrying the decision fields (id,
11
+ // score, kind, effective license, description tail) — the same field set an
12
+ // agent gets from --json, just laid out for a terminal (RFC 0008 §6).
13
+ import { emitJson, fail, splitCsv, warn } from "../helpers.js";
14
+ import { resolveCtx } from "../compat/ctx.js";
15
+ import { buildQuery, errorMessage, jsonRequest, requireNamespace } from "../compat/http.js";
16
+ import { parseLibrarySpec } from "./pull.js";
17
+ /** The search API refuses more than this many libraries per call. */
18
+ export const SEARCH_MAX_LIBRARIES = 50;
19
+ const DEFAULT_LIMIT = 20;
20
+ /** Whole-hit-line budget — keeps one hit on one terminal line, grep-friendly. */
21
+ const LINE_WIDTH = 110;
22
+ function str(v) {
23
+ return typeof v === "string" && v !== "" ? v : "—";
24
+ }
25
+ function truncate(s, width) {
26
+ return s.length <= width ? s : `${s.slice(0, width - 1)}…`;
27
+ }
28
+ /**
29
+ * The `libraries=` scope: the explicit `--library` list (bare names
30
+ * qualified with the active login's namespace), or — when omitted — up to
31
+ * 50 of the caller's visible libraries, newest-updated first as GET
32
+ * /libraries already orders them.
33
+ */
34
+ async function resolveScope(ctx, explicit) {
35
+ const entries = splitCsv(explicit);
36
+ if (entries.length > 0) {
37
+ let fallbackNs = null;
38
+ const libraries = [];
39
+ for (const entry of entries) {
40
+ const parsed = parseLibrarySpec(entry);
41
+ if ("error" in parsed) {
42
+ fail(parsed.error);
43
+ return null;
44
+ }
45
+ let ns = parsed.namespace;
46
+ if (!ns) {
47
+ fallbackNs ??= await requireNamespace(ctx, undefined);
48
+ if (!fallbackNs)
49
+ return null;
50
+ ns = fallbackNs;
51
+ }
52
+ libraries.push(`${ns}/${parsed.name}`);
53
+ }
54
+ if (libraries.length > SEARCH_MAX_LIBRARIES) {
55
+ fail(`--library lists ${libraries.length} libraries — the search API takes at most ${SEARCH_MAX_LIBRARIES}`);
56
+ return null;
57
+ }
58
+ return { libraries, auto: false };
59
+ }
60
+ const r = await jsonRequest("GET", `${ctx.remote}/libraries` + buildQuery({ limit: String(SEARCH_MAX_LIBRARIES) }), ctx.token);
61
+ if (r.status !== 200) {
62
+ fail(`could not resolve the search scope (GET /libraries) → ${r.status}: ${errorMessage(r)}`);
63
+ return null;
64
+ }
65
+ const rows = r.body?.libraries;
66
+ const libraries = (Array.isArray(rows) ? rows : [])
67
+ .map((row) => row)
68
+ .filter((row) => typeof row.namespace === "string" && typeof row.name === "string")
69
+ .map((row) => `${row.namespace}/${row.name}`)
70
+ .slice(0, SEARCH_MAX_LIBRARIES);
71
+ if (libraries.length === 0) {
72
+ fail("no libraries visible to search — push one, or pass --library <namespace>/<name>");
73
+ return null;
74
+ }
75
+ return { libraries, auto: true };
76
+ }
77
+ function scopeLine(libraries, auto) {
78
+ const n = libraries.length;
79
+ const shown = libraries.slice(0, 5).join(", ");
80
+ const more = n > 5 ? `, … (${n} total)` : "";
81
+ return auto
82
+ ? `searching ${n} visible librar${n === 1 ? "y" : "ies"} (no --library given; most recently updated first): ${shown}${more}\n`
83
+ : `searching: ${shown}${more}\n`;
84
+ }
85
+ /**
86
+ * One hit, one line: `ns/lib/asset score kind license — tail`.
87
+ * The tail is the description's first line (else the title) — the text an
88
+ * agent or a person actually reads to pick a candidate.
89
+ */
90
+ function hitLine(h) {
91
+ const id = `${str(h.namespace)}/${str(h.library)}/${str(h.assetId)}`;
92
+ const score = typeof h.score === "number" ? h.score.toFixed(2) : "—";
93
+ const firstDescLine = typeof h.description === "string" ? (h.description.split("\n", 1)[0] ?? "").trim() : "";
94
+ const tail = firstDescLine !== "" ? firstDescLine : str(h.title);
95
+ return truncate(`${id} ${score} ${str(h.kind)} ${str(h.license)} — ${tail}`, LINE_WIDTH);
96
+ }
97
+ export async function runLibrarySearch(args) {
98
+ const limit = Number(args.limit ?? String(DEFAULT_LIMIT));
99
+ if (!Number.isSafeInteger(limit) || limit < 1) {
100
+ fail("--limit must be a positive integer");
101
+ return 1;
102
+ }
103
+ let offset;
104
+ if (args.offset !== undefined) {
105
+ offset = Number(args.offset);
106
+ if (!Number.isSafeInteger(offset) || offset < 0) {
107
+ fail("--offset must be a non-negative integer");
108
+ return 1;
109
+ }
110
+ }
111
+ const ctx = resolveCtx(args);
112
+ const scope = await resolveScope(ctx, args.library);
113
+ if (!scope)
114
+ return 1;
115
+ // The auto-resolved scope is always announced — on stderr under --json so
116
+ // stdout stays the raw response; an explicit scope was the caller's own.
117
+ if (args.json) {
118
+ if (scope.auto)
119
+ process.stderr.write(scopeLine(scope.libraries, true));
120
+ }
121
+ else {
122
+ process.stdout.write(scopeLine(scope.libraries, scope.auto));
123
+ }
124
+ const r = await jsonRequest("GET", `${ctx.remote}/library-search` +
125
+ buildQuery({
126
+ q: args.query,
127
+ libraries: scope.libraries.join(","),
128
+ category: args.category,
129
+ kind: args.kind,
130
+ tag: args.tag,
131
+ license: args.license,
132
+ limit: String(limit),
133
+ offset: offset === undefined ? undefined : String(offset),
134
+ }), ctx.token);
135
+ if (r.status !== 200) {
136
+ fail(`search failed → ${r.status}: ${errorMessage(r)}`);
137
+ return 1;
138
+ }
139
+ if (args.json) {
140
+ emitJson(r.body);
141
+ return 0;
142
+ }
143
+ const body = (r.body ?? {});
144
+ const hits = Array.isArray(body.hits) ? body.hits : [];
145
+ const skipped = Array.isArray(body.skipped) ? body.skipped : [];
146
+ if (hits.length === 0) {
147
+ process.stdout.write("no matching assets.\n");
148
+ }
149
+ else {
150
+ for (const h of hits) {
151
+ process.stdout.write(`${hitLine(h)}\n`);
152
+ }
153
+ }
154
+ // Surface the envelope fields the table used to drop: pre-pagination
155
+ // total, and whether vector fusion actually ran for this query.
156
+ const total = typeof body.total === "number" ? body.total : hits.length;
157
+ process.stdout.write(`${hits.length} of ${total} hit${total === 1 ? "" : "s"} · semantic ${body.semantic === true ? "on" : "off"}\n`);
158
+ for (const s of skipped) {
159
+ warn(`skipped ${str(s.library)}: ${str(s.reason)}`);
160
+ }
161
+ if (hits.length > 0) {
162
+ process.stdout.write("download: dreamlake library pull <ns>/<lib> --asset <id>\n");
163
+ }
164
+ return 0;
165
+ }
166
+ export function registerLibrarySearchCommand(library, withConnFlags) {
167
+ withConnFlags(library
168
+ .command("search")
169
+ .description("search assets across libraries (semantic when indexed, keyword otherwise)")
170
+ .argument("<query>", "what to look for")
171
+ .option("--library <specs>", `comma-separated <namespace>/<name> list (default: up to ${SEARCH_MAX_LIBRARIES} most recently updated visible libraries)`)
172
+ .option("--kind <kind>", "only assets of this kind (e.g. mesh)")
173
+ .option("--category <category>", "only assets in this category")
174
+ .option("--tag <tag>", "only assets carrying this tag")
175
+ .option("--license <license>", "only assets under this effective license")
176
+ .option("--limit <n>", "maximum hits to return", String(DEFAULT_LIMIT))
177
+ .option("--offset <n>", "skip the first <n> hits (pagination)")
178
+ .option("--json", "emit the raw search response")).action(async (query, opts) => {
179
+ process.exit(await runLibrarySearch({ ...opts, query }));
180
+ });
181
+ }
@@ -0,0 +1,15 @@
1
+ import type { Command } from "commander";
2
+ import { type DreamlakeOpts } from "../compat/ctx.js";
3
+ export interface LibraryStatArgs extends DreamlakeOpts {
4
+ /** `<namespace>/<name>`, or a bare `<name>` under the active login. */
5
+ spec: string;
6
+ asset?: string;
7
+ /** Local directory to compare (default: ./<name>). */
8
+ output?: string;
9
+ /** Re-hash local files and re-download the manifest, bypassing the
10
+ * (mtime, size) hash cache and the revision-keyed manifest cache. */
11
+ verify?: boolean;
12
+ json?: boolean;
13
+ }
14
+ export declare function runLibraryStat(args: LibraryStatArgs): Promise<number>;
15
+ export declare function registerLibraryStatCommand(library: Command, withConnFlags: (c: Command) => Command): void;
@@ -0,0 +1,127 @@
1
+ // `dreamlake library stat <ns>/<name>` — is my local copy current?
2
+ //
3
+ // The consumer-side freshness verb (RFC 0008 §5.5): GET the catalog row (for
4
+ // `revision`) and the manifest, hash the local directory through the shared
5
+ // (mtime, size) cache, and answer with the REMOTE as truth — what a pull
6
+ // would fetch, in files and bytes. Zero payload transfer, and — like pull,
7
+ // unlike push --dry-run — token-optional, so public libraries stat anonymously.
8
+ // The manifest itself is served through the revision-keyed local cache
9
+ // (manifestCache.ts): a routine stat against an unchanged library costs one
10
+ // small catalog GET, not a multi-MB manifest download. `--verify` bypasses
11
+ // both local caches.
12
+ //
13
+ // The exit code is the contract: 0 = up-to-date, 1 = stale/absent, so
14
+ // `stat … && skip || pull …` scripts directly.
15
+ import { emitJson, fail, humanSize } from "../helpers.js";
16
+ import { resolveCtx } from "../compat/ctx.js";
17
+ import { errorMessage, jsonRequest, requireNamespace } from "../compat/http.js";
18
+ import { assetClosureDigest } from "./digest.js";
19
+ import { diffAgainstManifest } from "./freshness.js";
20
+ import { assertLibraryManifest } from "./manifest.js";
21
+ import { fetchManifestCached } from "./manifestCache.js";
22
+ import { parseLibrarySpec } from "./pull.js";
23
+ export async function runLibraryStat(args) {
24
+ const parsed = parseLibrarySpec(args.spec);
25
+ if ("error" in parsed) {
26
+ fail(parsed.error);
27
+ return 1;
28
+ }
29
+ const { name } = parsed;
30
+ const ctx = resolveCtx(args);
31
+ let namespace = parsed.namespace;
32
+ if (!namespace) {
33
+ namespace = await requireNamespace(ctx, undefined);
34
+ if (!namespace)
35
+ return 1;
36
+ }
37
+ const base = `${ctx.remote}/namespaces/${encodeURIComponent(namespace)}/libraries/${encodeURIComponent(name)}`;
38
+ // Catalog row — for `revision`, the cache-buster the report carries.
39
+ const dRes = await jsonRequest("GET", base, ctx.token);
40
+ if (dRes.status === 404) {
41
+ fail(`${namespace}/${name} not found (or not visible)`);
42
+ return 1;
43
+ }
44
+ if (dRes.status !== 200) {
45
+ fail(`could not read the library → ${dRes.status}: ${errorMessage(dRes)}`);
46
+ return 1;
47
+ }
48
+ const detail = (dRes.body ?? {});
49
+ const revision = typeof detail.revision === "number" ? detail.revision : null;
50
+ // The manifest, through the revision-keyed cache: an unchanged revision
51
+ // answers locally, so a routine stat costs the catalog GET above only.
52
+ const { res: mRes } = await fetchManifestCached({
53
+ remote: ctx.remote,
54
+ namespace,
55
+ name,
56
+ token: ctx.token,
57
+ revision,
58
+ bypass: args.verify,
59
+ });
60
+ if (mRes.status === 404) {
61
+ fail(`${namespace}/${name} has not been pushed yet — nothing to compare`);
62
+ return 1;
63
+ }
64
+ if (mRes.status !== 200) {
65
+ fail(`could not read the manifest → ${mRes.status}: ${errorMessage(mRes)}`);
66
+ return 1;
67
+ }
68
+ const outDir = args.output ?? `./${name}`;
69
+ let report;
70
+ let digest;
71
+ try {
72
+ const manifest = assertLibraryManifest(mRes.body, "the remote manifest");
73
+ report = await diffAgainstManifest({
74
+ manifest,
75
+ rootDir: outDir,
76
+ assetId: args.asset,
77
+ verify: args.verify,
78
+ });
79
+ if (args.asset) {
80
+ // Present by contract: diffAgainstManifest would have thrown otherwise.
81
+ const asset = manifest.assets.find((a) => a.id === args.asset);
82
+ digest = assetClosureDigest(asset.files.map((f) => ({ path: f.path, sha256: f.sha256.toLowerCase() })));
83
+ }
84
+ }
85
+ catch (e) {
86
+ fail(e instanceof Error ? e.message : String(e));
87
+ return 1;
88
+ }
89
+ const rc = report.state === "up-to-date" ? 0 : 1;
90
+ if (args.json) {
91
+ emitJson({
92
+ state: report.state,
93
+ missing: report.missing,
94
+ changed: report.changed,
95
+ bytesNeeded: report.bytesNeeded,
96
+ revision,
97
+ files: report.files,
98
+ ...(digest !== undefined ? { digest } : {}),
99
+ });
100
+ return rc;
101
+ }
102
+ switch (report.state) {
103
+ case "up-to-date":
104
+ process.stdout.write("up-to-date\n");
105
+ break;
106
+ case "stale":
107
+ process.stdout.write(`stale: ${report.changed.length} files changed, ${report.missing.length} missing — ` +
108
+ `pull would fetch ${humanSize(report.bytesNeeded)}\n`);
109
+ break;
110
+ case "absent":
111
+ process.stdout.write(`absent: full pull = ${report.files.count} files, ${humanSize(report.files.bytes)}\n`);
112
+ break;
113
+ }
114
+ return rc;
115
+ }
116
+ export function registerLibraryStatCommand(library, withConnFlags) {
117
+ withConnFlags(library
118
+ .command("stat")
119
+ .description("compare a local directory against the remote manifest — up-to-date, stale, or absent (exit 0 only when up-to-date)")
120
+ .argument("<spec>", "<namespace>/<name> (or <name> under the active login)")
121
+ .option("--asset <id>", "restrict the check to one asset's files")
122
+ .option("-o, --output <dir>", "local directory to compare (default: ./<name>)")
123
+ .option("--verify", "re-hash local files and re-download the manifest, bypassing the local caches")
124
+ .option("--json", "emit the report as JSON")).action(async (spec, opts) => {
125
+ process.exit(await runLibraryStat({ ...opts, spec }));
126
+ });
127
+ }
@@ -0,0 +1,104 @@
1
+ import { type Spawn } from "../spawn.js";
2
+ export declare const RENDER_MODULE = "dreamlake.assets_tools.render_thumbnails";
3
+ export declare const EMBED_MODULE = "dreamlake.assets_tools.embed";
4
+ /**
5
+ * The ONE encoder space DreamLake semantic search can use: the sidecar's
6
+ * `model` id must equal this string or the server refuses to fuse the
7
+ * library's vectors and search silently degrades to keyword-only.
8
+ *
9
+ * It is a COMPATIBILITY CONTRACT with the server's query encoder (SigLIP 2
10
+ * base, `dreamlake-server services/siglip2Text.ts`), not a preference — and
11
+ * the check has to be on the id, not the dimension: the legacy CLIP space
12
+ * (`open_clip/ViT-L-14-quickgelu/openai`) is also 768-d, so `dim` alone
13
+ * cannot tell the two apart.
14
+ */
15
+ export declare const DREAMLAKE_QUERY_MODEL_ID = "open_clip/ViT-B-16-SigLIP2/webli";
16
+ /** DREAMLAKE_PYTHON wins outright; otherwise python3, then python — the
17
+ * same resolution `env compose` uses. */
18
+ export declare function toolsPythonCandidates(): string[];
19
+ export interface ToolsDeps {
20
+ /** Injected in tests — the probe and the tool run share it. */
21
+ spawn?: Spawn;
22
+ }
23
+ /** First interpreter that can `import <module>`, or the warning to print. */
24
+ export declare function findAssetTool(module: string, deps?: ToolsDeps): {
25
+ py: string;
26
+ } | {
27
+ message: string;
28
+ };
29
+ /** One thumbnail render job, as jobs.json carries it. `entry` is ABSOLUTE —
30
+ * the renderer runs outside the source dir. */
31
+ export interface RenderJob {
32
+ id: string;
33
+ entry: string;
34
+ kind: string;
35
+ category?: string;
36
+ }
37
+ export interface RenderReport {
38
+ rendered: string[];
39
+ skipped: Array<{
40
+ id: string;
41
+ reason: string;
42
+ }>;
43
+ failed: Array<{
44
+ id: string;
45
+ reason: string;
46
+ }>;
47
+ }
48
+ export declare function runRenderThumbnails(py: string, jobsPath: string, outDir: string, deps?: ToolsDeps): {
49
+ report: RenderReport;
50
+ } | {
51
+ message: string;
52
+ };
53
+ /**
54
+ * The embed tool's stats line. The two output paths are what the push
55
+ * uploads; `model` / `dim` describe the encoder that actually ran and are
56
+ * what the push reports and gates on. Both are optional here on purpose —
57
+ * an older dreamlake-py may not report them, and a missing field must not
58
+ * turn into a crash or a bogus warning.
59
+ */
60
+ export interface EmbedStats {
61
+ json: string;
62
+ f32: string;
63
+ /** `open_clip/<model>/<pretrained>`, as written into the sidecar. */
64
+ model?: string;
65
+ dim?: number;
66
+ [k: string]: unknown;
67
+ }
68
+ export declare function runEmbed(py: string, args: {
69
+ manifestPath: string;
70
+ filesRoot: string;
71
+ thumbsDir: string;
72
+ outDir: string;
73
+ /** `library push --model` passthrough: an alias ("siglip2" / "clip") or a
74
+ * raw open_clip model name. Omitted → the Python tool picks, honoring
75
+ * $DREAMLAKE_EMBED_MODEL and its own default. The CLI deliberately does
76
+ * NOT substitute a default of its own: the model contract lives in
77
+ * dreamlake-py, and hardcoding one here would drift from it. */
78
+ model?: string;
79
+ }, deps?: ToolsDeps): {
80
+ stats: EmbedStats;
81
+ } | {
82
+ message: string;
83
+ };
84
+ /**
85
+ * The encoder, as the push summary names it: `" (<model id>, <dim>-d)"`, or
86
+ * `""` when the tool reported neither. Which model ran is not cosmetic — it
87
+ * decides whether the library gets semantic search at all — so the push must
88
+ * never print a bare "vectors: …" line that leaves the user guessing.
89
+ */
90
+ export declare function describeEmbedModel(stats: EmbedStats): string;
91
+ /**
92
+ * The warning for a sidecar the server will not fuse, or `undefined` when the
93
+ * vectors are in the query-encoder space.
94
+ *
95
+ * A WARNING, never a failure: the sidecar is valid, and embedding a library
96
+ * for some other consumer with `--model` is legitimate. But the DreamLake
97
+ * outcome — keyword-only search, no error anywhere — is invisible otherwise,
98
+ * which is the whole defect this exists to close.
99
+ *
100
+ * Silent when the tool reported no `model` at all: an unknown id is not
101
+ * evidence of a wrong one, and a warning on every push with an older
102
+ * dreamlake-py would be noise.
103
+ */
104
+ export declare function embedModelWarning(stats: EmbedStats): string | undefined;