@paradigma-inc/flywheel 0.1.53 → 0.1.72

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 (263) hide show
  1. package/README.md +149 -17
  2. package/package.json +4 -2
  3. package/skills/flywheel/SKILL.md +4 -3
  4. package/skills/flywheel/getting-started/flywheel-quickstart.md +4 -4
  5. package/skills/flywheel/references/flywheel-cli-tool-map.md +47 -35
  6. package/skills/flywheel/references/flywheel-mcp-tool-map.md +16 -5
  7. package/skills/flywheel/setting-up-flywheel/claude-code-cli-installation.md +3 -3
  8. package/skills/flywheel/setting-up-flywheel/codex-cli-installation.md +3 -3
  9. package/skills/flywheel/setting-up-flywheel/installation-overview.md +9 -8
  10. package/skills/flywheel/setting-up-flywheel/other-hosts-installation.md +1 -1
  11. package/skills/flywheel/setting-up-flywheel/updating-flywheel-mcp.md +4 -4
  12. package/skills/flywheel-auto/SKILL.md +4 -3
  13. package/skills/flywheel-auto/references/flywheel-cli-tool-map.md +37 -35
  14. package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +4 -4
  15. package/skills/flywheel-lookahead/SKILL.md +1 -1
  16. package/skills/flywheel-lookahead/references/flywheel-cli-tool-map.md +37 -35
  17. package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +4 -4
  18. package/skills/flywheel-prove/SKILL.md +1 -1
  19. package/skills/flywheel-reproduce/SKILL.md +4 -3
  20. package/skills/flywheel-reproduce/references/flywheel-cli-tool-map.md +37 -35
  21. package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +4 -4
  22. package/skills/flywheel-to-graph/SKILL.md +1 -1
  23. package/skills/flywheel-to-graph/references/flywheel-cli-tool-map.md +37 -35
  24. package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +4 -4
  25. package/skills/flywheel-tree/SKILL.md +1 -1
  26. package/src/agents.mjs +114 -48
  27. package/src/cli.mjs +373 -56
  28. package/src/mcp-writer.mjs +190 -17
  29. package/src/runtime/required-runtime-commands.json +19 -4
  30. package/src/runtime/vendor/flywheel-cli-dist/auth/login.d.ts +1 -0
  31. package/src/runtime/vendor/flywheel-cli-dist/auth/login.js +3 -6
  32. package/src/runtime/vendor/flywheel-cli-dist/auth/login.js.map +1 -1
  33. package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.d.ts +1 -0
  34. package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js +1 -1
  35. package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js.map +1 -1
  36. package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.d.ts +27 -0
  37. package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.js +54 -0
  38. package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.js.map +1 -0
  39. package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.d.ts +1 -1
  40. package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js +6 -5
  41. package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js.map +1 -1
  42. package/src/runtime/vendor/flywheel-cli-dist/commands/_browser-handoff.d.ts +21 -0
  43. package/src/runtime/vendor/flywheel-cli-dist/commands/_browser-handoff.js +51 -0
  44. package/src/runtime/vendor/flywheel-cli-dist/commands/_browser-handoff.js.map +1 -0
  45. package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.d.ts +1 -1
  46. package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.js +6 -3
  47. package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.js.map +1 -1
  48. package/src/runtime/vendor/flywheel-cli-dist/commands/_secret-param.d.ts +7 -0
  49. package/src/runtime/vendor/flywheel-cli-dist/commands/_secret-param.js +18 -0
  50. package/src/runtime/vendor/flywheel-cli-dist/commands/_secret-param.js.map +1 -0
  51. package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.d.ts +39 -0
  52. package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.js +72 -0
  53. package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.js.map +1 -0
  54. package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.js +2 -0
  55. package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.js.map +1 -1
  56. package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.js +2 -0
  57. package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.js.map +1 -1
  58. package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.js +2 -0
  59. package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.js.map +1 -1
  60. package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.js +2 -0
  61. package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.js.map +1 -1
  62. package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.d.ts +2 -1
  63. package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.js +6 -1
  64. package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.js.map +1 -1
  65. package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.js +2 -0
  66. package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.js.map +1 -1
  67. package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.js +2 -0
  68. package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.js.map +1 -1
  69. package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.js +2 -0
  70. package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.js.map +1 -1
  71. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.d.ts +2 -0
  72. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.js +11 -0
  73. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.js.map +1 -0
  74. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.d.ts +2 -0
  75. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.js +60 -0
  76. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.js.map +1 -0
  77. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.d.ts +2 -0
  78. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.js +115 -0
  79. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.js.map +1 -0
  80. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.d.ts +2 -0
  81. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.js +12 -0
  82. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.js.map +1 -0
  83. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.d.ts +4 -0
  84. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.js +39 -0
  85. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.js.map +1 -0
  86. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.d.ts +2 -0
  87. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.js +15 -0
  88. package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.js.map +1 -0
  89. package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.d.ts +18 -1
  90. package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.js +38 -5
  91. package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.js.map +1 -1
  92. package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js +1 -1
  93. package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js.map +1 -1
  94. package/src/runtime/vendor/flywheel-cli-dist/commands/auth-mode.d.ts +4 -0
  95. package/src/runtime/vendor/flywheel-cli-dist/commands/auth-mode.js +42 -0
  96. package/src/runtime/vendor/flywheel-cli-dist/commands/auth-mode.js.map +1 -0
  97. package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js +15 -1
  98. package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js.map +1 -1
  99. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.js +8 -2
  100. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.js.map +1 -1
  101. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.js +6 -1
  102. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.js.map +1 -1
  103. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.js +18 -7
  104. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.js.map +1 -1
  105. package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.js +8 -4
  106. package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.js.map +1 -1
  107. package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.js +8 -4
  108. package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.js.map +1 -1
  109. package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.js +8 -4
  110. package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.js.map +1 -1
  111. package/src/runtime/vendor/flywheel-cli-dist/commands/destructive-confirmation.d.ts +2 -0
  112. package/src/runtime/vendor/flywheel-cli-dist/commands/destructive-confirmation.js +7 -0
  113. package/src/runtime/vendor/flywheel-cli-dist/commands/destructive-confirmation.js.map +1 -0
  114. package/src/runtime/vendor/flywheel-cli-dist/commands/enums.d.ts +8 -0
  115. package/src/runtime/vendor/flywheel-cli-dist/commands/enums.js +4 -0
  116. package/src/runtime/vendor/flywheel-cli-dist/commands/enums.js.map +1 -1
  117. package/src/runtime/vendor/flywheel-cli-dist/commands/env.d.ts +0 -4
  118. package/src/runtime/vendor/flywheel-cli-dist/commands/env.js +7 -12
  119. package/src/runtime/vendor/flywheel-cli-dist/commands/env.js.map +1 -1
  120. package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.js +42 -30
  121. package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.js.map +1 -1
  122. package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.js +12 -4
  123. package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.js.map +1 -1
  124. package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.js +9 -14
  125. package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.js.map +1 -1
  126. package/src/runtime/vendor/flywheel-cli-dist/commands/help-format.d.ts +31 -0
  127. package/src/runtime/vendor/flywheel-cli-dist/commands/help-format.js +69 -0
  128. package/src/runtime/vendor/flywheel-cli-dist/commands/help-format.js.map +1 -0
  129. package/src/runtime/vendor/flywheel-cli-dist/commands/help.d.ts +6 -1
  130. package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +226 -124
  131. package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -1
  132. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.d.ts +2 -0
  133. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.js +25 -0
  134. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.js.map +1 -0
  135. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.d.ts +1 -0
  136. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.js +6 -0
  137. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.js.map +1 -0
  138. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.d.ts +2 -0
  139. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.js +10 -0
  140. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.js.map +1 -0
  141. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.d.ts +2 -0
  142. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.js +15 -0
  143. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.js.map +1 -0
  144. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.d.ts +2 -0
  145. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.js +8 -0
  146. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.js.map +1 -0
  147. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.d.ts +1 -0
  148. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.js +6 -0
  149. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.js.map +1 -0
  150. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.d.ts +1 -0
  151. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.js +6 -0
  152. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.js.map +1 -0
  153. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.d.ts +2 -0
  154. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.js +8 -0
  155. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.js.map +1 -0
  156. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.d.ts +2 -0
  157. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.js +8 -0
  158. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.js.map +1 -0
  159. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.d.ts +2 -0
  160. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.js +29 -0
  161. package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.js.map +1 -0
  162. package/src/runtime/vendor/flywheel-cli-dist/commands/index.js +36 -6
  163. package/src/runtime/vendor/flywheel-cli-dist/commands/index.js.map +1 -1
  164. package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.js +7 -3
  165. package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.js.map +1 -1
  166. package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.js +6 -2
  167. package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.js.map +1 -1
  168. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js +6 -1
  169. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js.map +1 -1
  170. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js +2 -0
  171. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js.map +1 -1
  172. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js +2 -0
  173. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js.map +1 -1
  174. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js +8 -1
  175. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js.map +1 -1
  176. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.js +55 -2
  177. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.js.map +1 -1
  178. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js +13 -1
  179. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js.map +1 -1
  180. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js +4 -2
  181. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js.map +1 -1
  182. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js +16 -1
  183. package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js.map +1 -1
  184. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.js +8 -7
  185. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.js.map +1 -1
  186. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.d.ts +8 -0
  187. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js +131 -0
  188. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js.map +1 -0
  189. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.js +8 -2
  190. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.js.map +1 -1
  191. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.js +29 -1
  192. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.js.map +1 -1
  193. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js +13 -1
  194. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js.map +1 -1
  195. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js +2 -2
  196. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js.map +1 -1
  197. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.js +11 -2
  198. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.js.map +1 -1
  199. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.js +2 -2
  200. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.js.map +1 -1
  201. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.js +8 -6
  202. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.js.map +1 -1
  203. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.js +7 -5
  204. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.js.map +1 -1
  205. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.js +6 -14
  206. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.js.map +1 -1
  207. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.d.ts +2 -0
  208. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.js +312 -0
  209. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.js.map +1 -0
  210. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.js +22 -8
  211. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.js.map +1 -1
  212. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js +122 -25
  213. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js.map +1 -1
  214. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js +2 -2
  215. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js.map +1 -1
  216. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js +1 -31
  217. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js.map +1 -1
  218. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.js +12 -4
  219. package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.js.map +1 -1
  220. package/src/runtime/vendor/flywheel-cli-dist/commands/registry.d.ts +2 -1
  221. package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js +46 -9
  222. package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js.map +1 -1
  223. package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-refresh.d.ts +2 -0
  224. package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-refresh.js +20 -0
  225. package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-refresh.js.map +1 -0
  226. package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-resolve.d.ts +2 -0
  227. package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-resolve.js +23 -0
  228. package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-resolve.js.map +1 -0
  229. package/src/runtime/vendor/flywheel-cli-dist/errors.d.ts +15 -0
  230. package/src/runtime/vendor/flywheel-cli-dist/errors.js +16 -1
  231. package/src/runtime/vendor/flywheel-cli-dist/errors.js.map +1 -1
  232. package/src/runtime/vendor/flywheel-cli-dist/http/client.d.ts +1 -0
  233. package/src/runtime/vendor/flywheel-cli-dist/http/client.js +75 -19
  234. package/src/runtime/vendor/flywheel-cli-dist/http/client.js.map +1 -1
  235. package/src/runtime/vendor/flywheel-cli-dist/http/debug.d.ts +3 -0
  236. package/src/runtime/vendor/flywheel-cli-dist/http/debug.js +21 -2
  237. package/src/runtime/vendor/flywheel-cli-dist/http/debug.js.map +1 -1
  238. package/src/runtime/vendor/flywheel-cli-dist/main.js +119 -10
  239. package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -1
  240. package/src/runtime/vendor/flywheel-cli-dist/output/format.js +44 -6
  241. package/src/runtime/vendor/flywheel-cli-dist/output/format.js.map +1 -1
  242. package/src/runtime/vendor/manifest.json +82 -10
  243. package/src/setup/base-url.mjs +43 -0
  244. package/src/setup/command.mjs +2 -0
  245. package/src/setup/io/patchers/json.mjs +2 -0
  246. package/src/setup/io/patchers/toml.mjs +7 -1
  247. package/src/setup/io/patchers/yaml.mjs +2 -0
  248. package/src/setup/modes/cli.mjs +72 -24
  249. package/src/setup/modes/mcp-command.mjs +146 -38
  250. package/src/setup/modes/mcp.mjs +26 -1
  251. package/src/setup/resolved-selection-record.mjs +25 -0
  252. package/src/setup/shared/prior-mode-detect.mjs +133 -14
  253. package/src/setup-auth.mjs +3 -2
  254. package/src/skill-installer.mjs +179 -1
  255. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.d.ts +0 -1
  256. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.js +0 -6
  257. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.js.map +0 -1
  258. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.d.ts +0 -2
  259. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.js +0 -19
  260. package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.js.map +0 -1
  261. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.d.ts +0 -2
  262. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.js +0 -7
  263. package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.js.map +0 -1
@@ -0,0 +1,51 @@
1
+ import { EXIT_TRANSPORT } from '../exit-codes.js';
2
+ import { CliHttpError } from '../http/client.js';
3
+ import { maybeOpenUrl } from './_open-url.js';
4
+ const BROWSER_HANDOFF_URL_KEYS = [
5
+ 'open_url',
6
+ 'url',
7
+ 'checkout_url',
8
+ 'portal_url',
9
+ ];
10
+ /**
11
+ * Normalizes route-specific browser URLs into the CLI's stable handoff result.
12
+ * Billing routes expose Stripe-shaped checkout/portal fields, while OAuth and
13
+ * generic handoffs use open_url/url.
14
+ */
15
+ export function extractOpenUrl(payload) {
16
+ for (const key of BROWSER_HANDOFF_URL_KEYS) {
17
+ const value = payload[key];
18
+ if (typeof value === 'string')
19
+ return value;
20
+ }
21
+ return '';
22
+ }
23
+ function validatedBrowserHandoffUrl(url) {
24
+ const trimmed = url.trim();
25
+ if (!trimmed) {
26
+ throw new CliHttpError('browser handoff response missing browser URL', EXIT_TRANSPORT);
27
+ }
28
+ let parsed;
29
+ try {
30
+ parsed = new URL(trimmed);
31
+ }
32
+ catch {
33
+ throw new CliHttpError('browser handoff response included an invalid browser URL', EXIT_TRANSPORT);
34
+ }
35
+ if (parsed.protocol !== 'https:' && parsed.protocol !== 'http:') {
36
+ throw new CliHttpError('browser handoff response included a non-HTTP browser URL', EXIT_TRANSPORT);
37
+ }
38
+ return trimmed;
39
+ }
40
+ export async function buildBrowserHandoffResult({ command, url, globals, stderr, nextAction, }) {
41
+ const handoffUrl = validatedBrowserHandoffUrl(url);
42
+ const opened = await maybeOpenUrl(handoffUrl, globals, stderr);
43
+ return {
44
+ status: 'browser_flow_required',
45
+ command,
46
+ url: handoffUrl,
47
+ opened,
48
+ next_action: nextAction,
49
+ };
50
+ }
51
+ //# sourceMappingURL=_browser-handoff.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_browser-handoff.js","sourceRoot":"","sources":["../../src/commands/_browser-handoff.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,YAAY,EAAE,MAAM,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AAM,EAAE,uBAAuB;QAC/B,OAAO;QACP,GAAG,EAAE,UAAU;QACf,MAAM;QACN,WAAW,EAAE,UAAU;KACxB,CAAC;AACJ,CAAC"}
@@ -1,2 +1,2 @@
1
1
  import type { CliGlobals } from '../grammar/globals.js';
2
- export declare function maybeOpenUrl(url: string | undefined, globals: CliGlobals | undefined, stderr?: (chunk: string) => void): Promise<void>;
2
+ export declare function maybeOpenUrl(url: string | undefined, globals: CliGlobals | undefined, stderr?: (chunk: string) => void): Promise<boolean>;
@@ -1,8 +1,8 @@
1
1
  export async function maybeOpenUrl(url, globals, stderr) {
2
2
  if (!url || !globals?.open)
3
- return;
3
+ return false;
4
4
  if (!process.stdout.isTTY)
5
- return;
5
+ return false;
6
6
  try {
7
7
  const mod = (await import('open'));
8
8
  let open;
@@ -12,8 +12,10 @@ export async function maybeOpenUrl(url, globals, stderr) {
12
12
  else if (mod && typeof mod.default === 'function') {
13
13
  open = mod.default;
14
14
  }
15
- if (open)
15
+ if (open) {
16
16
  await open(url);
17
+ return true;
18
+ }
17
19
  }
18
20
  catch {
19
21
  const msg = '--open skipped: install the `open` package to enable browser launch\n';
@@ -22,5 +24,6 @@ export async function maybeOpenUrl(url, globals, stderr) {
22
24
  else
23
25
  process.stderr.write(msg);
24
26
  }
27
+ return false;
25
28
  }
26
29
  //# sourceMappingURL=_open-url.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"_open-url.js","sourceRoot":"","sources":["../../src/commands/_open-url.ts"],"names":[],"mappings":"AAIA,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,GAAuB,EACvB,OAA+B,EAC/B,MAAgC;IAEhC,IAAI,CAAC,GAAG,IAAI,CAAC,OAAO,EAAE,IAAI;QAAE,OAAO;IACnC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK;QAAE,OAAO;IAClC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,MAAgB,CAAC,CAAY,CAAC;QACxD,IA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O,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IAAC,MAAM,CAAC;QACP,MAAM,GAAG,GAAG,uEAAuE,CAAC;QACpF,IAAI,MAAM;YAAE,MAAM,CAAC,GAAG,CAAC,CAAC;;YACnB,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACjC,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,7 @@
1
+ interface ResolveSecretParamOptions {
2
+ readonly valueKey: string;
3
+ readonly envKey: string;
4
+ readonly label: string;
5
+ }
6
+ export declare function resolveSecretParam(params: Record<string, string | boolean>, options: ResolveSecretParamOptions): string;
7
+ export {};
@@ -0,0 +1,18 @@
1
+ import { CliUsageError } from '../errors.js';
2
+ import { optionalString } from './utils.js';
3
+ export function resolveSecretParam(params, options) {
4
+ const directValue = optionalString(params, options.valueKey);
5
+ if (directValue !== undefined) {
6
+ return directValue;
7
+ }
8
+ const envName = optionalString(params, options.envKey);
9
+ if (envName !== undefined) {
10
+ const envValue = process.env[envName]?.trim();
11
+ if (envValue) {
12
+ return envValue;
13
+ }
14
+ throw new CliUsageError(`environment variable ${envName} is not set for --${options.envKey}`);
15
+ }
16
+ throw new CliUsageError(`missing required parameter: ${options.valueKey} or ${options.envKey} (${options.label})`);
17
+ }
18
+ //# sourceMappingURL=_secret-param.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_secret-param.js","sourceRoot":"","sources":["../../src/commands/_secret-param.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQ5C,MAAM,UAAU,kBAAkB,CAChC,MAAwC,EACxC,OAAkC;IAElC,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC;IAC7D,IAAI,WAAW,KAAK,SAAS,EAAE,CAAC;QAC9B,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,OAAO,GAAG,cAAc,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;IACvD,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,CAAC;QAC9C,IAAI,QAAQ,EAAE,CAAC;YACb,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,MAAM,IAAI,aAAa,CACrB,wBAAwB,OAAO,qBAAqB,OAAO,CAAC,MAAM,EAAE,CACrE,CAAC;IACJ,CAAC;IAED,MAAM,IAAI,aAAa,CACrB,+BAA+B,OAAO,CAAC,QAAQ,OAAO,OAAO,CAAC,MAAM,KAAK,OAAO,CAAC,KAAK,GAAG,CAC1F,CAAC;AACJ,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type WriteStream } from 'node:fs';
2
+ /**
3
+ * Lifecycle handle for an ``--out`` destination.
4
+ *
5
+ * ``stream`` is the open writable stream the caller feeds bytes into.
6
+ * The stream writes to a sibling ``.partial`` temp file, NOT the final
7
+ * destination, so an aborted run cannot clobber a previously-good file
8
+ * at ``outPath``.
9
+ *
10
+ * Callers MUST invoke exactly one of:
11
+ *
12
+ * * :func:`finalize` after the last successful write + stream close —
13
+ * atomically renames the temp over ``outPath`` on filesystems that
14
+ * support ``rename(2)`` semantics (all POSIX targets + Windows).
15
+ * * :func:`abort` on any failure path — best-effort removes the temp so
16
+ * a retry starts clean.
17
+ */
18
+ export interface OutputFileHandle {
19
+ readonly stream: WriteStream;
20
+ finalize(): Promise<void>;
21
+ abort(): Promise<void>;
22
+ }
23
+ /**
24
+ * Validate and open a writable destination for an ``--out`` path.
25
+ *
26
+ * Returns an :class:`OutputFileHandle` when ``outPath`` is a concrete
27
+ * filesystem path, or ``null`` when the caller is streaming to stdout
28
+ * (``outPath`` is absent or the literal ``"-"``).
29
+ *
30
+ * The handle is backed by a ``<outPath>.partial`` temp file opened in
31
+ * the same directory so the final ``rename`` is atomic (same
32
+ * filesystem). The temp file is fully opened (``"open"`` event
33
+ * resolved) before this function returns, so callers can still order
34
+ * this BEFORE dispatching an expensive server-side request — a bad
35
+ * destination raises a typed :class:`CliUsageError` without any
36
+ * network traffic, but the caller's previous ``outPath`` contents are
37
+ * never overwritten until ``finalize`` succeeds.
38
+ */
39
+ export declare function openWriteStreamOrFail(outPath: string | undefined): Promise<OutputFileHandle | null>;
@@ -0,0 +1,72 @@
1
+ import { createWriteStream } from 'node:fs';
2
+ import { rename, unlink } from 'node:fs/promises';
3
+ import { CliUsageError } from '../errors.js';
4
+ /**
5
+ * Validate and open a writable destination for an ``--out`` path.
6
+ *
7
+ * Returns an :class:`OutputFileHandle` when ``outPath`` is a concrete
8
+ * filesystem path, or ``null`` when the caller is streaming to stdout
9
+ * (``outPath`` is absent or the literal ``"-"``).
10
+ *
11
+ * The handle is backed by a ``<outPath>.partial`` temp file opened in
12
+ * the same directory so the final ``rename`` is atomic (same
13
+ * filesystem). The temp file is fully opened (``"open"`` event
14
+ * resolved) before this function returns, so callers can still order
15
+ * this BEFORE dispatching an expensive server-side request — a bad
16
+ * destination raises a typed :class:`CliUsageError` without any
17
+ * network traffic, but the caller's previous ``outPath`` contents are
18
+ * never overwritten until ``finalize`` succeeds.
19
+ */
20
+ export async function openWriteStreamOrFail(outPath) {
21
+ if (!outPath || outPath === '-') {
22
+ return null;
23
+ }
24
+ // Same-directory temp so the final ``rename`` stays on one filesystem
25
+ // and is therefore atomic. ``.partial`` is the conventional suffix
26
+ // used by curl / wget / aria2 / pip for in-flight downloads; it makes
27
+ // the intent obvious to anyone inspecting the directory mid-run.
28
+ const tmpPath = `${outPath}.partial`;
29
+ const candidate = createWriteStream(tmpPath);
30
+ try {
31
+ await new Promise((resolve, reject) => {
32
+ const onOpen = () => {
33
+ candidate.off('error', onError);
34
+ resolve();
35
+ };
36
+ const onError = (err) => {
37
+ candidate.off('open', onOpen);
38
+ reject(err);
39
+ };
40
+ candidate.once('open', onOpen);
41
+ candidate.once('error', onError);
42
+ });
43
+ }
44
+ catch (err) {
45
+ candidate.destroy();
46
+ // Best-effort cleanup in case ``createWriteStream`` managed to
47
+ // create the temp before failing (e.g. parent dir writable but then
48
+ // a later error). Swallow because the original open error is the
49
+ // message the caller actually needs.
50
+ await unlink(tmpPath).catch(() => undefined);
51
+ throw new CliUsageError(`cannot open --out=${outPath}: ${err.message}`);
52
+ }
53
+ let settled = false;
54
+ return {
55
+ stream: candidate,
56
+ async finalize() {
57
+ if (settled) {
58
+ return;
59
+ }
60
+ settled = true;
61
+ await rename(tmpPath, outPath);
62
+ },
63
+ async abort() {
64
+ if (settled) {
65
+ return;
66
+ }
67
+ settled = true;
68
+ await unlink(tmpPath).catch(() => undefined);
69
+ },
70
+ };
71
+ }
72
+ //# sourceMappingURL=_stream-file-out.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_stream-file-out.js","sourceRoot":"","sources":["../../src/commands/_stream-file-out.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAElD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAwB7C;;;;;;;;;;;;;;;GAeG;AACH,MAAM,CAAC,KAAK,UAAU,qBAAqB,CACzC,OAA2B;IAE3B,IAAI,CAAC,OAAO,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;QAChC,OAAO,IAAI,CAAC;IACd,CAAC;IACD,sEAAsE;IACtE,mEAAmE;IACnE,sEAAsE;IACtE,iEAAiE;IACjE,MAAM,OAAO,GAAG,GAAG,OAAO,UAAU,CAAC;IACrC,MAAM,SAAS,GAAG,iBAAiB,CAAC,OAAO,CAAC,CAAC;IAC7C,IAAI,CAAC;QACH,MAAM,IAAI,OAAO,CAAO,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;YAC1C,M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J,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { CliUsageError } from '../errors.js';
2
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
2
3
  import { requiredString } from './utils.js';
3
4
  export const accountDetachCommand = async (context) => {
5
+ rejectApiKeyAuthMode(context, 'account:detach', 'session-auth-only');
4
6
  const aliasUserId = requiredString(context.params, 'alias_user_id');
5
7
  const confirm = requiredString(context.params, 'confirm');
6
8
  if (confirm !== 'DETACH') {
@@ -1 +1 @@
1
- {"version":3,"file":"account-detach.js","sourceRoot":"","sources":["../../src/commands/account-detach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,oBAAoB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACpE,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACpE,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1D,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,IAAI,aAAa,CAAC,6CAA6C,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,uBAAuB,EAAE;QAC1D,IAAI,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE;KAC9C,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"account-detach.js","sourceRoot":"","sources":["../../src/commands/account-detach.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,oBAAoB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACpE,oBAAoB,CAAC,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,CAAC,CAAC;IACrE,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,eAAe,CAAC,CAAC;IACpE,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1D,IAAI,OAAO,KAAK,QAAQ,EAAE,CAAC;QACzB,MAAM,IAAI,aAAa,CAAC,6CAA6C,CAAC,CAAC;IACzE,CAAC;IACD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,uBAAuB,EAAE;QAC1D,IAAI,EAAE,EAAE,aAAa,EAAE,WAAW,EAAE,OAAO,EAAE;KAC9C,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
1
2
  import { requiredString } from './utils.js';
2
3
  export const accountEmailsAddCommand = async (context) => {
4
+ rejectApiKeyAuthMode(context, 'account:emails:add', 'session-auth-only');
3
5
  const email = requiredString(context.params, 'email');
4
6
  return context.requestJson('POST', '/auth/accounts/emails', { body: { email } });
5
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"account-emails-add.js","sourceRoot":"","sources":["../../src/commands/account-emails-add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACvE,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,uBAAuB,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AACnF,CAAC,CAAC"}
1
+ {"version":3,"file":"account-emails-add.js","sourceRoot":"","sources":["../../src/commands/account-emails-add.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,uBAAuB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACvE,oBAAoB,CAAC,OAAO,EAAE,oBAAoB,EAAE,mBAAmB,CAAC,CAAC;IACzE,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,uBAAuB,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AACnF,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
1
2
  import { requiredString } from './utils.js';
2
3
  export const accountEmailsRemoveCommand = async (context) => {
4
+ rejectApiKeyAuthMode(context, 'account:emails:remove', 'session-auth-only');
3
5
  const email = requiredString(context.params, 'email');
4
6
  return context.requestJson('DELETE', `/auth/accounts/emails/${encodeURIComponent(email)}`);
5
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"account-emails-remove.js","sourceRoot":"","sources":["../../src/commands/account-emails-remove.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,0BAA0B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC1E,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,yBAAyB,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7F,CAAC,CAAC"}
1
+ {"version":3,"file":"account-emails-remove.js","sourceRoot":"","sources":["../../src/commands/account-emails-remove.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,0BAA0B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC1E,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,yBAAyB,kBAAkB,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AAC7F,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
1
2
  import { requiredString } from './utils.js';
2
3
  export const accountEmailsSetPrimaryCommand = async (context) => {
4
+ rejectApiKeyAuthMode(context, 'account:emails:set-primary', 'session-auth-only');
3
5
  const email = requiredString(context.params, 'email');
4
6
  return context.requestJson('PATCH', '/auth/accounts/primary-email', { body: { email } });
5
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"account-emails-set-primary.js","sourceRoot":"","sources":["../../src/commands/account-emails-set-primary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,8BAA8B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9E,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC,CAAC"}
1
+ {"version":3,"file":"account-emails-set-primary.js","sourceRoot":"","sources":["../../src/commands/account-emails-set-primary.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,8BAA8B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9E,oBAAoB,CAAC,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,CAAC,CAAC;IACjF,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,OAAO,EAAE,8BAA8B,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC,CAAC"}
@@ -1 +1,2 @@
1
- export declare const accountGetCommand: import("./types.js").CommandHandler;
1
+ import type { CommandHandler } from './types.js';
2
+ export declare const accountGetCommand: CommandHandler;
@@ -1,6 +1,11 @@
1
1
  import { buildHandler } from './handler-factory.js';
2
- export const accountGetCommand = buildHandler({
2
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
3
+ const accountGetRequest = buildHandler({
3
4
  method: 'GET',
4
5
  pathTemplate: '/auth/accounts',
5
6
  });
7
+ export const accountGetCommand = async (context) => {
8
+ rejectApiKeyAuthMode(context, 'account:get', 'session-auth-only');
9
+ return accountGetRequest(context);
10
+ };
6
11
  //# sourceMappingURL=account-get.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"account-get.js","sourceRoot":"","sources":["../../src/commands/account-get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEpD,MAAM,CAAC,MAAM,iBAAiB,GAAG,YAAY,CAAC;IAC5C,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,gBAAgB;CAC/B,CAAC,CAAC"}
1
+ {"version":3,"file":"account-get.js","sourceRoot":"","sources":["../../src/commands/account-get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AAGtD,MAAM,iBAAiB,GAAG,YAAY,CAAC;IACrC,MAAM,EAAE,KAAK;IACb,YAAY,EAAE,gBAAgB;CAC/B,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,iBAAiB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACjE,oBAAoB,CAAC,OAAO,EAAE,aAAa,EAAE,mBAAmB,CAAC,CAAC;IAClE,OAAO,iBAAiB,CAAC,OAAO,CAAC,CAAC;AACpC,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
1
2
  import { requiredString } from './utils.js';
2
3
  export const accountMergePreviewCommand = async (context) => {
4
+ rejectApiKeyAuthMode(context, 'account:merge:preview', 'session-auth-only');
3
5
  const proof = requiredString(context.params, 'proof');
4
6
  return context.requestJson('POST', '/auth/accounts/merge/preview', { body: { proof } });
5
7
  };
@@ -1 +1 @@
1
- {"version":3,"file":"account-merge-preview.js","sourceRoot":"","sources":["../../src/commands/account-merge-preview.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,0BAA0B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC1E,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,8BAA8B,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC1F,CAAC,CAAC"}
1
+ {"version":3,"file":"account-merge-preview.js","sourceRoot":"","sources":["../../src/commands/account-merge-preview.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,0BAA0B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC1E,oBAAoB,CAAC,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,CAAC,CAAC;IAC5E,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,8BAA8B,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC;AAC1F,CAAC,CAAC"}
@@ -1,5 +1,7 @@
1
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
1
2
  import { requiredString } from './utils.js';
2
3
  export const accountMergeProofCommand = async (context) => {
4
+ rejectApiKeyAuthMode(context, 'account:merge:proof', 'session-auth-only');
3
5
  const sourceToken = requiredString(context.params, 'source_token');
4
6
  return context.requestJson('POST', '/auth/accounts/merge/source-proof', {
5
7
  body: { source_token: sourceToken },
@@ -1 +1 @@
1
- {"version":3,"file":"account-merge-proof.js","sourceRoot":"","sources":["../../src/commands/account-merge-proof.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,wBAAwB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACxE,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,mCAAmC,EAAE;QACtE,IAAI,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE;KACpC,CAAC,CAAC;AACL,CAAC,CAAC"}
1
+ {"version":3,"file":"account-merge-proof.js","sourceRoot":"","sources":["../../src/commands/account-merge-proof.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,wBAAwB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACxE,oBAAoB,CAAC,OAAO,EAAE,qBAAqB,EAAE,mBAAmB,CAAC,CAAC;IAC1E,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,cAAc,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,mCAAmC,EAAE;QACtE,IAAI,EAAE,EAAE,YAAY,EAAE,WAAW,EAAE;KACpC,CAAC,CAAC;AACL,CAAC,CAAC"}
@@ -1,6 +1,8 @@
1
1
  import { CliUsageError } from '../errors.js';
2
+ import { rejectApiKeyAuthMode } from './auth-mode.js';
2
3
  import { requiredString } from './utils.js';
3
4
  export const accountMergeCommand = async (context) => {
5
+ rejectApiKeyAuthMode(context, 'account:merge', 'session-auth-only');
4
6
  const proof = requiredString(context.params, 'proof');
5
7
  const confirm = requiredString(context.params, 'confirm');
6
8
  if (confirm !== 'MERGE') {
@@ -1 +1 @@
1
- {"version":3,"file":"account-merge.js","sourceRoot":"","sources":["../../src/commands/account-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACnE,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1D,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,IAAI,aAAa,CAAC,4CAA4C,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,sBAAsB,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC,CAAC"}
1
+ {"version":3,"file":"account-merge.js","sourceRoot":"","sources":["../../src/commands/account-merge.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAC;AACtD,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,mBAAmB,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IACnE,oBAAoB,CAAC,OAAO,EAAE,eAAe,EAAE,mBAAmB,CAAC,CAAC;IACpE,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACtD,MAAM,OAAO,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IAC1D,IAAI,OAAO,KAAK,OAAO,EAAE,CAAC;QACxB,MAAM,IAAI,aAAa,CAAC,4CAA4C,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,sBAAsB,EAAE,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;AAC3F,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { CommandHandler } from './types.js';
2
+ export declare const adminComputePolicyGetCommand: CommandHandler;
@@ -0,0 +1,11 @@
1
+ import { adminAuthRequestOptions, requireAdminCredential } from './_admin-auth.js';
2
+ import { requiredString } from './utils.js';
3
+ export const adminComputePolicyGetCommand = async (context) => {
4
+ requireAdminCredential(context, 'admin:compute:policy:get');
5
+ const nodeId = requiredString(context.params, 'node_id');
6
+ const options = {
7
+ ...adminAuthRequestOptions(context.apiKey),
8
+ };
9
+ return context.requestJson('GET', `/admin/nodes/${encodeURIComponent(nodeId)}/compute/policy`, options);
10
+ };
11
+ //# sourceMappingURL=admin-compute-policy-get.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-compute-policy-get.js","sourceRoot":"","sources":["../../src/commands/admin-compute-policy-get.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAEnF,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,MAAM,CAAC,MAAM,4BAA4B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC5E,sBAAsB,CAAC,OAAO,EAAE,0BAA0B,CAAC,CAAC;IAC5D,MAAM,MAAM,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACzD,MAAM,OAAO,GAAmB;QAC9B,GAAG,uBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC;KAC3C,CAAC;IACF,OAAO,OAAO,CAAC,WAAW,CACxB,KAAK,EACL,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,EAC3D,OAAO,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { CommandHandler } from './types.js';
2
+ export declare const adminComputePolicySetCommand: CommandHandler;
@@ -0,0 +1,60 @@
1
+ import { adminAuthRequestOptions, requireAdminCredential } from './_admin-auth.js';
2
+ import { CliUsageError } from '../errors.js';
3
+ import { optionalInt, requiredBoolean, requiredString, resolvePayloadJson, } from './utils.js';
4
+ async function optionalJsonParam(params, key) {
5
+ if (params[key] === undefined) {
6
+ return undefined;
7
+ }
8
+ return resolvePayloadJson(params, key);
9
+ }
10
+ function stringArrayParam(key, value) {
11
+ if (!Array.isArray(value)) {
12
+ throw new CliUsageError(`invalid argument: ${key} must be a JSON array of strings`);
13
+ }
14
+ return value.map((item, index) => {
15
+ if (typeof item !== 'string' || !item.trim()) {
16
+ throw new CliUsageError(`invalid argument: ${key}[${index}] must be a non-empty string`);
17
+ }
18
+ return item.trim();
19
+ });
20
+ }
21
+ function objectParam(key, value) {
22
+ if (!value || typeof value !== 'object' || Array.isArray(value)) {
23
+ throw new CliUsageError(`invalid argument: ${key} must be a JSON object`);
24
+ }
25
+ return value;
26
+ }
27
+ export const adminComputePolicySetCommand = async (context) => {
28
+ requireAdminCredential(context, 'admin:compute:policy:set');
29
+ const nodeId = requiredString(context.params, 'node_id');
30
+ const body = {};
31
+ const hardCapCents = optionalInt(context.params, 'hard_cap_cents');
32
+ if (hardCapCents !== undefined) {
33
+ body.hard_cap_cents = hardCapCents;
34
+ }
35
+ if (context.params.managed_compute_enabled !== undefined) {
36
+ body.managed_compute_enabled = requiredBoolean(context.params, 'managed_compute_enabled');
37
+ }
38
+ const allowedOfferIds = await optionalJsonParam(context.params, 'allowed_offer_ids');
39
+ if (allowedOfferIds !== undefined) {
40
+ body.allowed_offer_ids = stringArrayParam('allowed_offer_ids', allowedOfferIds);
41
+ }
42
+ const preferredOfferIds = await optionalJsonParam(context.params, 'preferred_offer_ids');
43
+ if (preferredOfferIds !== undefined) {
44
+ body.preferred_offer_ids = stringArrayParam('preferred_offer_ids', preferredOfferIds);
45
+ }
46
+ const providerFilters = await optionalJsonParam(context.params, 'provider_filters');
47
+ if (providerFilters !== undefined) {
48
+ body.provider_filters = objectParam('provider_filters', providerFilters);
49
+ }
50
+ const autoShutdownIdleSeconds = optionalInt(context.params, 'auto_shutdown_idle_seconds');
51
+ if (autoShutdownIdleSeconds !== undefined) {
52
+ body.auto_shutdown_idle_seconds = autoShutdownIdleSeconds;
53
+ }
54
+ const options = {
55
+ body,
56
+ ...adminAuthRequestOptions(context.apiKey),
57
+ };
58
+ return context.requestJson('PATCH', `/admin/nodes/${encodeURIComponent(nodeId)}/compute/policy`, options);
59
+ };
60
+ //# sourceMappingURL=admin-compute-policy-set.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-compute-policy-set.js","sourceRoot":"","sources":["../../src/commands/admin-compute-policy-set.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,sB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CAAC,MAAM,EACd,4BAA4B,CAC7B,CAAC;IACF,IAAI,uBAAuB,KAAK,SAAS,EAAE,CAAC;QAC1C,IAAI,CAAC,0BAA0B,GAAG,uBAAuB,CAAC;IAC5D,CAAC;IACD,MAAM,OAAO,GAAmB;QAC9B,IAAI;QACJ,GAAG,uBAAuB,CAAC,OAAO,CAAC,MAAM,CAAC;KAC3C,CAAC;IACF,OAAO,OAAO,CAAC,WAAW,CACxB,OAAO,EACP,gBAAgB,kBAAkB,CAAC,MAAM,CAAC,iBAAiB,EAC3D,OAAO,CACR,CAAC;AACJ,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ import type { CommandHandler } from './types.js';
2
+ export declare const adminGraphsExportStreamCommand: CommandHandler;
@@ -0,0 +1,115 @@
1
+ import { CliUsageError } from '../errors.js';
2
+ import { adminAuthRequestOptions, requireAdminCredential } from './_admin-auth.js';
3
+ import { openWriteStreamOrFail } from './_stream-file-out.js';
4
+ import { makeSafeStreamWriter } from './_stream-writer.js';
5
+ import { optionalInt, optionalString } from './utils.js';
6
+ export const adminGraphsExportStreamCommand = async (context) => {
7
+ requireAdminCredential(context, 'admin:graphs:export:stream');
8
+ if (!context.requestRaw) {
9
+ throw new CliUsageError('binary transport unavailable in this context');
10
+ }
11
+ const query = {};
12
+ const tagId = optionalString(context.params, 'tag-id');
13
+ if (tagId !== undefined)
14
+ query['tag_id'] = tagId;
15
+ const kind = optionalString(context.params, 'kind');
16
+ if (kind !== undefined)
17
+ query['kind'] = kind;
18
+ const ownerUserId = optionalString(context.params, 'owner-user-id');
19
+ if (ownerUserId !== undefined)
20
+ query['owner_user_id'] = ownerUserId;
21
+ const createdAfter = optionalString(context.params, 'created-after');
22
+ if (createdAfter !== undefined)
23
+ query['created_after'] = createdAfter;
24
+ const createdBefore = optionalString(context.params, 'created-before');
25
+ if (createdBefore !== undefined)
26
+ query['created_before'] = createdBefore;
27
+ const cursor = optionalString(context.params, 'cursor');
28
+ if (cursor !== undefined)
29
+ query['cursor'] = cursor;
30
+ const pageSize = optionalInt(context.params, 'page-size');
31
+ if (pageSize !== undefined)
32
+ query['page_size'] = pageSize;
33
+ const options = {
34
+ query,
35
+ ...adminAuthRequestOptions(context.apiKey),
36
+ };
37
+ // Open and validate ``--out`` BEFORE dispatching the HTTP request.
38
+ // ``/admin/graphs/export.jsonl`` is expensive server-side (per-graph
39
+ // subgraph loads); starting it and then failing locally on a bad output
40
+ // path would burn backend work we cannot cancel cleanly from userland
41
+ // once the response body is in flight. The helper writes to a
42
+ // ``.partial`` temp file next to the destination so a later request
43
+ // failure leaves the caller's prior ``--out`` contents untouched.
44
+ const outPath = context.globals?.outPath ?? optionalString(context.params, 'out');
45
+ const fileHandle = await openWriteStreamOrFail(outPath);
46
+ let response;
47
+ try {
48
+ response = await context.requestRaw('GET', '/admin/graphs/export.jsonl', options);
49
+ }
50
+ catch (err) {
51
+ if (fileHandle) {
52
+ fileHandle.stream.destroy();
53
+ await fileHandle.abort();
54
+ }
55
+ throw err;
56
+ }
57
+ // Wrap the opened stream so in-loop write failures (ENOSPC, EIO,
58
+ // EPIPE, destination destroyed mid-stream) surface deterministically,
59
+ // and backpressure is awaited instead of over-buffering memory during
60
+ // bulk exports. This is the canonical pattern across streaming
61
+ // commands in this package.
62
+ const safeWriter = fileHandle
63
+ ? makeSafeStreamWriter(fileHandle.stream)
64
+ : null;
65
+ const writeStdout = context.stdout ??
66
+ ((chunk) => {
67
+ process.stdout.write(chunk);
68
+ });
69
+ const write = safeWriter
70
+ ? async (chunk) => {
71
+ await safeWriter.write(chunk);
72
+ }
73
+ : async (chunk) => {
74
+ writeStdout(chunk);
75
+ };
76
+ if (!response.body) {
77
+ if (safeWriter)
78
+ await safeWriter.close();
79
+ if (fileHandle)
80
+ await fileHandle.finalize();
81
+ return null;
82
+ }
83
+ const decoder = new TextDecoder();
84
+ const reader = response.body.getReader();
85
+ let succeeded = false;
86
+ try {
87
+ while (true) {
88
+ const { value, done } = await reader.read();
89
+ if (done)
90
+ break;
91
+ const text = decoder.decode(value, { stream: true });
92
+ if (text)
93
+ await write(text);
94
+ }
95
+ const tail = decoder.decode();
96
+ if (tail)
97
+ await write(tail);
98
+ succeeded = true;
99
+ }
100
+ finally {
101
+ reader.releaseLock();
102
+ if (safeWriter)
103
+ await safeWriter.close();
104
+ if (fileHandle) {
105
+ if (succeeded) {
106
+ await fileHandle.finalize();
107
+ }
108
+ else {
109
+ await fileHandle.abort();
110
+ }
111
+ }
112
+ }
113
+ return null;
114
+ };
115
+ //# sourceMappingURL=admin-graphs-export-stream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"admin-graphs-export-stream.js","sourceRoot":"","sources":["../../src/commands/admin-graphs-export-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACnF,OAAO,EAAE,qBAAqB,EAAyB,MAAM,uBAAuB,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAyB,MAAM,qBAAqB,CAAC;AAElF,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEzD,MAAM,CAAC,MAAM,8BAA8B,GAAmB,KAAK,EAAE,OAAO,EAAE,EAAE;IAC9E,sBAAsB,CAAC,OAAO,EAAE,4BAA4B,CAAC,CAAC;IAC9D,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;QACxB,MAAM,IAAI,aAAa,CAAC,8CAA8C,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,KAAK,GAA8C,EAAE,CAAC;IAC5D,MAAM,KAAK,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IACvD,IAAI,KAAK,KAAK,SAAS;QAAE,KAAK,CAAC,QAAQ,CAAC,GAAG,KAAK,CAAC;IACjD,MAAM,IAAI,GAAG,cAAc,CAAC,OAAO,CAAC,MAAM,EAA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