@paradigma-inc/flywheel 0.1.26 → 0.1.51
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.
- package/README.md +117 -60
- package/bin/flywheel.js +10 -3
- package/package.json +5 -1
- package/skills/flywheel/SKILL.md +13 -1
- package/skills/flywheel/campaigns/participating-in-a-campaign.md +2 -2
- package/skills/flywheel/compute/managed-compute.md +26 -7
- package/skills/flywheel/example-workflows/organizing-exploring-and-iterating-on-a-research-topic.md +11 -11
- package/skills/flywheel/example-workflows/reproducing-papers-on-a-budget.md +8 -8
- package/skills/flywheel/getting-started/flywheel-tutorial-overview.md +2 -1
- package/skills/flywheel/references/ARTIFACTS.md +48 -0
- package/skills/flywheel/references/INTERFACES.md +208 -0
- package/skills/flywheel/references/experiment-design-protocol.md +5 -5
- package/skills/flywheel/references/flywheel-cli-tool-map.md +244 -0
- package/skills/flywheel/references/flywheel-mcp-tool-map.md +109 -63
- package/skills/flywheel/setting-up-flywheel/claude-code-cli-installation.md +1 -1
- package/skills/flywheel/setting-up-flywheel/codex-cli-installation.md +1 -1
- package/skills/flywheel/setting-up-flywheel/how-can-i-get-an-authorized-client_id-for-the-oauth-flow.md +3 -3
- package/skills/flywheel/setting-up-flywheel/installation-overview.md +19 -4
- package/skills/flywheel/setting-up-flywheel/other-hosts-installation.md +1 -1
- package/skills/flywheel/usage-and-workflows/what-to-do-with-flywheel.md +28 -1
- package/skills/flywheel/web-ui/the-flywheel-web-ui.md +1 -1
- package/skills/flywheel-auto/SKILL.md +23 -12
- package/skills/flywheel-auto/references/ARTIFACTS.md +1 -1
- package/skills/flywheel-auto/references/INTERFACES.md +61 -59
- package/skills/flywheel-auto/references/experiment-design-protocol.md +5 -5
- package/skills/flywheel-auto/references/flywheel-cli-tool-map.md +244 -0
- package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +76 -63
- package/skills/flywheel-lookahead/SKILL.md +22 -11
- package/skills/flywheel-lookahead/references/ARTIFACTS.md +1 -1
- package/skills/flywheel-lookahead/references/INTERFACES.md +61 -59
- package/skills/flywheel-lookahead/references/flywheel-cli-tool-map.md +244 -0
- package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +76 -63
- package/skills/flywheel-prove/SKILL.md +17 -0
- package/skills/flywheel-reproduce/SKILL.md +23 -12
- package/skills/flywheel-reproduce/references/ARTIFACTS.md +1 -1
- package/skills/flywheel-reproduce/references/INTERFACES.md +61 -59
- package/skills/flywheel-reproduce/references/experiment-design-protocol.md +5 -5
- package/skills/flywheel-reproduce/references/flywheel-cli-tool-map.md +244 -0
- package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +76 -63
- package/skills/flywheel-to-graph/SKILL.md +20 -9
- package/skills/flywheel-to-graph/references/ARTIFACTS.md +1 -1
- package/skills/flywheel-to-graph/references/INTERFACES.md +61 -59
- package/skills/flywheel-to-graph/references/flywheel-cli-tool-map.md +244 -0
- package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +76 -63
- package/skills/flywheel-tree/SKILL.md +70 -0
- package/skills/flywheel-tree/agents/interface.yaml +4 -0
- package/skills/flywheel-tree/assets/ansi_palette.json +29 -0
- package/skills/flywheel-tree/references/workflow.md +108 -0
- package/skills/flywheel-tree/scripts/render_tree.py +407 -0
- package/skills/flywheel-tree/scripts/render_tree_via_mcp.py +694 -0
- package/src/cli.mjs +204 -582
- package/src/mcp-writer.mjs +2 -2
- package/src/runtime/delegate.mjs +21 -0
- package/src/runtime/required-runtime-commands.json +117 -0
- package/src/runtime/runtime-config.mjs +84 -0
- package/src/runtime/vendor/.gitkeep +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/active-key-id.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/active-key-id.js +22 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/active-key-id.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/baseurl.d.ts +35 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/baseurl.js +64 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/baseurl.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.d.ts +34 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js +92 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/fingerprint.d.ts +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/fingerprint.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/fingerprint.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.d.ts +4 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js +31 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.d.ts +23 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js +387 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.d.ts +15 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js +150 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.d.ts +26 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js +27 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.d.ts +32 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js +171 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.js +26 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-writer.d.ts +34 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-writer.js +63 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-writer.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.d.ts +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.js +75 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.js +11 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.d.ts +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-create.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-create.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-create.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-delete.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-delete.js +20 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-delete.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-rotate.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-rotate.js +21 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-rotate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-expire.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-expire.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-expire.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-heartbeat.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-heartbeat.js +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-heartbeat.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-list.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-get.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-get.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-get.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-list.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js +9 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js +15 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js +34 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js +4 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/blobs-get.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/blobs-get.js +18 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/blobs-get.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-create.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-create.js +11 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-create.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-list.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-list.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-revoke.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-revoke.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-revoke.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-update.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-update.js +22 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-update.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-snapshot.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-snapshot.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-snapshot.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.js +39 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-budgets.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-budgets.js +14 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-budgets.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-connection.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-connection.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-connection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-funding.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-funding.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-funding.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.js +53 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-options.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-options.js +17 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-options.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-get.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.js +19 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-policy-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.js +39 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release.js +28 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-status.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-status.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-status.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-balance.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-balance.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-balance.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral-claim.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral-claim.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral-claim.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.js +14 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscription.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscription.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscription.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-transactions.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-transactions.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-transactions.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-usage.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-usage.js +9 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-usage.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/enums.d.ts +16 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/enums.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/enums.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.d.ts +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js +65 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-launch.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-launch.js +11 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-launch.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-list.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-list.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-terminate.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-terminate.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-terminate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.js +82 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.js +18 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-pdf.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-pdf.js +19 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-pdf.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-render-pdf.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-render-pdf.js +65 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-render-pdf.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-stream.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-stream.js +174 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-stream.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary.js +9 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/files-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/files-list.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/files-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-disconnect.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-disconnect.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-disconnect.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.js +17 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-refresh-repos.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-refresh-repos.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-refresh-repos.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-status.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-status.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-status.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-get.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-get.js +15 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-get.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/handler-factory.d.ts +22 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/handler-factory.js +51 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/handler-factory.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.d.ts +23 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +258 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/import-subgraph.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/import-subgraph.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/import-subgraph.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.d.ts +20 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js +238 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-remove.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-remove.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-remove.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-status.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-status.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-status.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-remove.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-remove.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-remove.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/machines-list.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/machines-list.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/machines-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-audit-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js +14 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js +9 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-files.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-files.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-files.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-get.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-get.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-get.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-list.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js +33 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-ancestry.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-ancestry.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-ancestry.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-summary.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-summary.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-summary.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-tree.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-tree.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-tree.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-get.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-get.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-get.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set-bulk.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set-bulk.js +20 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set-bulk.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-summaries.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-summaries.js +11 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-summaries.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-hypothesis.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-hypothesis.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-hypothesis.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-insights.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-insights.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-backfill-insights.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-acquire.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-acquire.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-acquire.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-heartbeat.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-heartbeat.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-heartbeat.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-release.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-release.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-release.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js +56 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.js +124 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.js +103 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.js +101 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js +104 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js +37 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.js +72 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.js +128 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.js +134 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.js +39 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/executions.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/executions.js +55 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/executions.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/export.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/export.js +88 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/export.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.js +60 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/graph.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/graph.js +22 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/graph.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js +284 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js +82 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js +108 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js +98 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/updates.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/updates.js +70 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/updates.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.d.ts +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js +441 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js +11 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js +28 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.d.ts +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide-all-active.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide-all-active.js +6 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide-all-active.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-list.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-list.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/utils.d.ts +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/utils.js +171 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/utils.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/errors.d.ts +55 -0
- package/src/runtime/vendor/flywheel-cli-dist/errors.js +51 -0
- package/src/runtime/vendor/flywheel-cli-dist/errors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/exit-codes.d.ts +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/exit-codes.js +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/exit-codes.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.d.ts +26 -0
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js +117 -0
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.d.ts +17 -0
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js +102 -0
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/client.d.ts +75 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js +369 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.d.ts +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js +68 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/poll.d.ts +18 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/poll.js +57 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/poll.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.d.ts +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js +127 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/main.d.ts +31 -0
- package/src/runtime/vendor/flywheel-cli-dist/main.js +763 -0
- package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/output/format.d.ts +9 -0
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js +129 -0
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/runtime-entry.d.ts +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/runtime-entry.js +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/runtime-entry.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/version.d.ts +3 -0
- package/src/runtime/vendor/flywheel-cli-dist/version.js +31 -0
- package/src/runtime/vendor/flywheel-cli-dist/version.js.map +1 -0
- package/src/runtime/vendor/manifest.json +500 -0
- package/src/setup/command.mjs +24 -0
- package/src/setup/io/patchers/json.mjs +33 -0
- package/src/setup/io/patchers/toml.mjs +15 -0
- package/src/setup/io/patchers/yaml.mjs +33 -0
- package/src/setup/mode.mjs +113 -0
- package/src/setup/modes/cli.mjs +317 -0
- package/src/setup/modes/mcp-command.mjs +850 -0
- package/src/setup/modes/mcp.mjs +176 -0
- package/src/setup/preflight.mjs +54 -0
- package/src/setup/shared/prior-mode-detect.mjs +412 -0
- package/src/setup/shared/skill.mjs +12 -0
- package/src/setup/shared/summary.mjs +80 -0
- package/src/setup-auth.mjs +293 -178
- package/src/unified-cli.mjs +161 -0
|
@@ -0,0 +1,763 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { randomUUID } from 'node:crypto';
|
|
3
|
+
import { access, writeFile } from 'node:fs/promises';
|
|
4
|
+
import os from 'node:os';
|
|
5
|
+
import { resolve } from 'node:path';
|
|
6
|
+
import { pathToFileURL } from 'node:url';
|
|
7
|
+
import { loadAuthConfig, DEFAULT_BASE_URL, resolveConfigPath, saveAuthConfig, } from './auth/config.js';
|
|
8
|
+
import { baseUrlsEqual } from './auth/baseurl.js';
|
|
9
|
+
import { getKey } from './auth/keychain.js';
|
|
10
|
+
import { loadProfile } from './auth/profile.js';
|
|
11
|
+
import { RUNTIME_ALIASES } from './commands/aliases.js';
|
|
12
|
+
import { BUILTIN_PROFILE_NAMES, isBuiltinProfileName, resolveBuiltinBaseUrl, } from './auth/profiles.js';
|
|
13
|
+
import { renderCommandHelp, renderCommandHelpAsJson, renderHelp, renderHelpAsJson, } from './commands/help.js';
|
|
14
|
+
import { getCommandByName } from './commands/registry.js';
|
|
15
|
+
import { MVP_COMMAND_HANDLERS } from './commands/index.js';
|
|
16
|
+
import { CliApprovalPendingError, CliFinalizeFailedError, CliUsageError, CliWaitTimeoutError, } from './errors.js';
|
|
17
|
+
import { EXIT_TRANSPORT, EXIT_USAGE } from './exit-codes.js';
|
|
18
|
+
import { extractGlobals } from './grammar/globals.js';
|
|
19
|
+
import { parseCliArgs } from './grammar/parse.js';
|
|
20
|
+
import { CliHttpError, createHttpClient } from './http/client.js';
|
|
21
|
+
import { renderOutput } from './output/format.js';
|
|
22
|
+
import { CLI_VERSION } from './version.js';
|
|
23
|
+
function defaultStdout(chunk) {
|
|
24
|
+
process.stdout.write(chunk);
|
|
25
|
+
}
|
|
26
|
+
function defaultStderr(chunk) {
|
|
27
|
+
process.stderr.write(chunk);
|
|
28
|
+
}
|
|
29
|
+
function writeLine(writer, text) {
|
|
30
|
+
if (text.endsWith('\n')) {
|
|
31
|
+
writer(text);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
writer(`${text}\n`);
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Derive the active built-in profile state from the already-loaded
|
|
38
|
+
* AuthConfig. Reading from `config` (instead of re-reading the file at
|
|
39
|
+
* `configPath`) keeps the injectable `loadConfig` dependency
|
|
40
|
+
* authoritative — tests and programmatic embedders that hand the CLI an
|
|
41
|
+
* in-memory config must not be silently overridden by stale on-disk
|
|
42
|
+
* state.
|
|
43
|
+
*/
|
|
44
|
+
function activeBuiltinFromConfig(config) {
|
|
45
|
+
const empty = {
|
|
46
|
+
name: undefined,
|
|
47
|
+
baseUrl: undefined,
|
|
48
|
+
apiKey: undefined,
|
|
49
|
+
};
|
|
50
|
+
const rawName = config.activeProfile;
|
|
51
|
+
if (typeof rawName !== 'string' || !rawName.trim())
|
|
52
|
+
return empty;
|
|
53
|
+
const name = rawName.trim();
|
|
54
|
+
if (!isBuiltinProfileName(name))
|
|
55
|
+
return empty;
|
|
56
|
+
const baseUrl = resolveBuiltinBaseUrl(name);
|
|
57
|
+
const bucket = config.profileKeys?.[name];
|
|
58
|
+
const candidate = bucket?.apiKey;
|
|
59
|
+
const apiKey = typeof candidate === 'string' && candidate.trim() ? candidate : undefined;
|
|
60
|
+
return { name, baseUrl, apiKey };
|
|
61
|
+
}
|
|
62
|
+
async function resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey) {
|
|
63
|
+
const envBaseUrl = process.env.FLYWHEEL_BASE_URL?.trim();
|
|
64
|
+
// Resolution order:
|
|
65
|
+
// FLYWHEEL_BASE_URL → --env=<name>'s profile.baseUrl → active built-in
|
|
66
|
+
// profile pointer in config.activeProfile → legacy config.baseUrl →
|
|
67
|
+
// DEFAULT_BASE_URL. Built-in baseUrls are ephemeral constants — they are
|
|
68
|
+
// never written into config.baseUrl, so upstream URL changes flow through
|
|
69
|
+
// automatically.
|
|
70
|
+
const activeBuiltin = activeBuiltinFromConfig(config);
|
|
71
|
+
const baseUrl = envBaseUrl ||
|
|
72
|
+
profile?.baseUrl ||
|
|
73
|
+
activeBuiltin.baseUrl ||
|
|
74
|
+
config.baseUrl ||
|
|
75
|
+
DEFAULT_BASE_URL;
|
|
76
|
+
let apiKey = process.env.FLYWHEEL_API_KEY?.trim() || undefined;
|
|
77
|
+
// Token-scoping guard: a profile's `api_key_env` / `api_key_keychain`
|
|
78
|
+
// credentials are minted for the profile's declared baseUrl. If the
|
|
79
|
+
// resolved baseUrl has since moved off that origin (typically via
|
|
80
|
+
// FLYWHEEL_BASE_URL override), the profile's credential must NOT ride
|
|
81
|
+
// along to a different host — that would leak the token across
|
|
82
|
+
// environments. Every other credential source in this resolver is
|
|
83
|
+
// already baseUrl-scoped; these two sources were the last hole.
|
|
84
|
+
const profileBindsToResolvedBaseUrl = profile !== null &&
|
|
85
|
+
profile.baseUrl !== undefined &&
|
|
86
|
+
baseUrlsEqual(baseUrl, profile.baseUrl);
|
|
87
|
+
if (!apiKey && profile?.apiKeyEnv && profileBindsToResolvedBaseUrl) {
|
|
88
|
+
apiKey = resolveEnvApiKey(profile.apiKeyEnv);
|
|
89
|
+
}
|
|
90
|
+
if (!apiKey && profile?.apiKeyKeychain && profileBindsToResolvedBaseUrl) {
|
|
91
|
+
const stored = await getKey('flywheel-cli', profile.name);
|
|
92
|
+
if (stored) {
|
|
93
|
+
apiKey = stored;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
// `--env=<builtin>` selects a built-in profile for this invocation.
|
|
97
|
+
// Pull its stored apiKey from `config.profileKeys[name]` so the
|
|
98
|
+
// one-shot override gets the same auth a persisted `env switch` would.
|
|
99
|
+
// Tied to the built-in's baseUrl so a manual baseUrl override (e.g.
|
|
100
|
+
// FLYWHEEL_BASE_URL) doesn't carry the per-profile token to a
|
|
101
|
+
// different origin.
|
|
102
|
+
if (!apiKey &&
|
|
103
|
+
profile !== null &&
|
|
104
|
+
isBuiltinProfileName(profile.name) &&
|
|
105
|
+
baseUrlsEqual(baseUrl, resolveBuiltinBaseUrl(profile.name))) {
|
|
106
|
+
const candidate = config.profileKeys?.[profile.name]?.apiKey;
|
|
107
|
+
if (typeof candidate === 'string' && candidate.trim()) {
|
|
108
|
+
apiKey = candidate;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// Prefer the per-profile apiKey stored by `auth:login` while a built-in
|
|
112
|
+
// profile is active — but only when the resolved baseUrl is still that
|
|
113
|
+
// built-in's origin. A `FLYWHEEL_BASE_URL` override or `--env=<legacy>`
|
|
114
|
+
// flag moves the request to a different host; attaching the stored
|
|
115
|
+
// prod/staging bearer there would leak credentials across environments.
|
|
116
|
+
// The legacy flat `config.apiKey` is intentionally left unset under
|
|
117
|
+
// active-profile logins (so the built-in baseUrl never bleeds into
|
|
118
|
+
// config.json); consult it only when no per-profile key is present.
|
|
119
|
+
if (!apiKey &&
|
|
120
|
+
activeBuiltin.apiKey &&
|
|
121
|
+
baseUrlsEqual(baseUrl, activeBuiltin.baseUrl)) {
|
|
122
|
+
apiKey = activeBuiltin.apiKey;
|
|
123
|
+
}
|
|
124
|
+
// The legacy `config.apiKey` belongs to `config.baseUrl` and only to
|
|
125
|
+
// that origin. Every path that resolves `baseUrl` to anything else
|
|
126
|
+
// (built-in profile pointer, `--env=<legacy-profile>`, or
|
|
127
|
+
// `FLYWHEEL_BASE_URL` override) must NOT have the legacy key ride
|
|
128
|
+
// along: that single stored key would otherwise leak across any target
|
|
129
|
+
// origin the user points the CLI at.
|
|
130
|
+
// Canonical equality so `FLYWHEEL_BASE_URL=<config.baseUrl>/` (and
|
|
131
|
+
// other RFC 3986 §6.2.2-equivalent variants) still binds the legacy
|
|
132
|
+
// flat key to its origin instead of being treated as an unrelated
|
|
133
|
+
// host. See `auth/baseurl.ts` for the normalisation rules.
|
|
134
|
+
if (!apiKey && baseUrlsEqual(config.baseUrl, baseUrl)) {
|
|
135
|
+
apiKey = config.apiKey ?? undefined;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
baseUrl,
|
|
139
|
+
apiKey,
|
|
140
|
+
defaultFormat: profile?.defaultFormat,
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
const HELP_TOKENS = new Set(['--help', '-h']);
|
|
144
|
+
const SCHEMA_TOKEN = '--schema';
|
|
145
|
+
const HELP_EXTRAS_PREFIX = '--_help_extras=';
|
|
146
|
+
const VALID_TOPIC_IDS = new Set([
|
|
147
|
+
'setup-admin',
|
|
148
|
+
'auth',
|
|
149
|
+
'profile',
|
|
150
|
+
'nodes-graph',
|
|
151
|
+
'artifacts-files',
|
|
152
|
+
'compute-executions',
|
|
153
|
+
'approvals-budgets',
|
|
154
|
+
'export-import',
|
|
155
|
+
'updates-resources',
|
|
156
|
+
'account-credits',
|
|
157
|
+
'integrations',
|
|
158
|
+
'api-keys',
|
|
159
|
+
'developer-admin',
|
|
160
|
+
]);
|
|
161
|
+
function parseHelpExtras(argv) {
|
|
162
|
+
let raw;
|
|
163
|
+
for (const token of argv) {
|
|
164
|
+
if (token.startsWith(HELP_EXTRAS_PREFIX)) {
|
|
165
|
+
raw = token.slice(HELP_EXTRAS_PREFIX.length);
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
if (raw === undefined)
|
|
170
|
+
return { kind: 'absent' };
|
|
171
|
+
let decoded;
|
|
172
|
+
try {
|
|
173
|
+
decoded = JSON.parse(raw);
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
return { kind: 'invalid' };
|
|
177
|
+
}
|
|
178
|
+
if (!Array.isArray(decoded))
|
|
179
|
+
return { kind: 'invalid' };
|
|
180
|
+
const extras = [];
|
|
181
|
+
for (const entry of decoded) {
|
|
182
|
+
if (!entry ||
|
|
183
|
+
typeof entry !== 'object' ||
|
|
184
|
+
typeof entry.group !== 'string' ||
|
|
185
|
+
typeof entry.name !== 'string' ||
|
|
186
|
+
typeof entry.summary !== 'string') {
|
|
187
|
+
return { kind: 'invalid' };
|
|
188
|
+
}
|
|
189
|
+
const group = entry.group;
|
|
190
|
+
if (!VALID_TOPIC_IDS.has(group))
|
|
191
|
+
return { kind: 'invalid' };
|
|
192
|
+
extras.push({
|
|
193
|
+
group,
|
|
194
|
+
name: entry.name,
|
|
195
|
+
summary: entry.summary,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
return { kind: 'ok', extras };
|
|
199
|
+
}
|
|
200
|
+
function stripHelpExtras(argv) {
|
|
201
|
+
return argv.filter((t) => !t.startsWith(HELP_EXTRAS_PREFIX));
|
|
202
|
+
}
|
|
203
|
+
// Commands that do not touch the HTTP runtime and therefore must run even
|
|
204
|
+
// when ~/.config/flywheel-cli/config.json is absent. These are purely local
|
|
205
|
+
// state operations (profile bookkeeping, keychain reads/writes) plus the
|
|
206
|
+
// bootstrap auth:login flow, so gating them on runtime config would break the
|
|
207
|
+
// exact recovery paths a user needs when the config is missing.
|
|
208
|
+
const RUNTIME_CONFIG_OPTIONAL_COMMANDS = new Set([
|
|
209
|
+
'profile:list',
|
|
210
|
+
'profile:show',
|
|
211
|
+
'profile:set',
|
|
212
|
+
'profile:unset',
|
|
213
|
+
'auth:login',
|
|
214
|
+
'auth:keychain:set',
|
|
215
|
+
'auth:keychain:clear',
|
|
216
|
+
'env:list',
|
|
217
|
+
'env:switch',
|
|
218
|
+
]);
|
|
219
|
+
function isHelpToken(token) {
|
|
220
|
+
return HELP_TOKENS.has(token);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Resolve runtime aliases before dispatch so the SHORTCUTS section advertised
|
|
224
|
+
* in `flywheel help` is executable, not cosmetic. Mirrors the rewrite the
|
|
225
|
+
* setup wrapper performs, but kept co-located with the runtime CLI so direct
|
|
226
|
+
* invocations of this entrypoint (for example an agent using the published
|
|
227
|
+
* dist) see identical behaviour to `flywheel <alias>` through the wrapper.
|
|
228
|
+
*
|
|
229
|
+
* `help`, `--help`, `-h` are reserved and never rewritten — they dispatch
|
|
230
|
+
* help paths that have their own alias handling for `help <alias>`.
|
|
231
|
+
*/
|
|
232
|
+
function rewriteAlias(argv) {
|
|
233
|
+
if (argv.length === 0)
|
|
234
|
+
return argv;
|
|
235
|
+
const head = argv[0];
|
|
236
|
+
if (head === 'help' || head === '--help' || head === '-h')
|
|
237
|
+
return argv;
|
|
238
|
+
if (!Object.prototype.hasOwnProperty.call(RUNTIME_ALIASES, head))
|
|
239
|
+
return argv;
|
|
240
|
+
const canonical = RUNTIME_ALIASES[head];
|
|
241
|
+
return [canonical, ...argv.slice(1)];
|
|
242
|
+
}
|
|
243
|
+
function parseHelpFormat(argv) {
|
|
244
|
+
let result = { kind: 'absent' };
|
|
245
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
246
|
+
const token = argv[i];
|
|
247
|
+
let value;
|
|
248
|
+
if (token.startsWith('--format=')) {
|
|
249
|
+
value = token.slice('--format='.length);
|
|
250
|
+
}
|
|
251
|
+
else if (token === '--format') {
|
|
252
|
+
value = argv[i + 1];
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
if (value === 'json') {
|
|
258
|
+
result = { kind: 'json' };
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
return { kind: 'invalid', value: value ?? '' };
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
return result;
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* Strip `--format=...` / `--format <value>` tokens from argv so the help
|
|
268
|
+
* dispatcher can pick out the positional <command> without tripping over the
|
|
269
|
+
* format global. Callers must validate the format value via parseHelpFormat
|
|
270
|
+
* before calling this — unsupported values should surface as usage errors,
|
|
271
|
+
* not be silently dropped.
|
|
272
|
+
*/
|
|
273
|
+
function stripFormatTokens(argv) {
|
|
274
|
+
const out = [];
|
|
275
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
276
|
+
const token = argv[i];
|
|
277
|
+
if (token.startsWith('--format='))
|
|
278
|
+
continue;
|
|
279
|
+
if (token === '--format') {
|
|
280
|
+
i += 1; // skip the value
|
|
281
|
+
continue;
|
|
282
|
+
}
|
|
283
|
+
out.push(token);
|
|
284
|
+
}
|
|
285
|
+
return out;
|
|
286
|
+
}
|
|
287
|
+
function emitCommandHelp(stdout, stderr, commandName, schema, asJson) {
|
|
288
|
+
if (asJson) {
|
|
289
|
+
const payload = renderCommandHelpAsJson(commandName);
|
|
290
|
+
const parsed = JSON.parse(payload);
|
|
291
|
+
if (parsed.error) {
|
|
292
|
+
writeLine(stderr, parsed.error);
|
|
293
|
+
return 1;
|
|
294
|
+
}
|
|
295
|
+
stdout(payload);
|
|
296
|
+
return 0;
|
|
297
|
+
}
|
|
298
|
+
const helpText = renderCommandHelp(commandName, { schema });
|
|
299
|
+
if (helpText.startsWith('unknown command:')) {
|
|
300
|
+
writeLine(stderr, helpText.trim());
|
|
301
|
+
return 1;
|
|
302
|
+
}
|
|
303
|
+
stdout(helpText);
|
|
304
|
+
return 0;
|
|
305
|
+
}
|
|
306
|
+
function buildMissingParamHint(commandName, message) {
|
|
307
|
+
const command = getCommandByName(commandName);
|
|
308
|
+
if (!command) {
|
|
309
|
+
return message;
|
|
310
|
+
}
|
|
311
|
+
const lines = [message];
|
|
312
|
+
if (command.required.length > 0) {
|
|
313
|
+
lines.push('Required:');
|
|
314
|
+
for (const param of command.required) {
|
|
315
|
+
const typeHint = param.type === 'boolean' ? '' : ` <${param.type}>`;
|
|
316
|
+
lines.push(` --${param.name}${typeHint} ${param.description}`);
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
if (command.examples.length > 0) {
|
|
320
|
+
lines.push('Example:');
|
|
321
|
+
lines.push(` ${command.examples[0].invocation}`);
|
|
322
|
+
}
|
|
323
|
+
return lines.join('\n');
|
|
324
|
+
}
|
|
325
|
+
function buildCommitSchemaHint(commandName, message) {
|
|
326
|
+
const command = getCommandByName(commandName);
|
|
327
|
+
if (!command?.schema) {
|
|
328
|
+
return message;
|
|
329
|
+
}
|
|
330
|
+
const lines = [message];
|
|
331
|
+
lines.push(`hint: payload rejected by server. Run \`flywheel help ${commandName} --schema\` to see the required JSON shape.`);
|
|
332
|
+
lines.push('Required payload keys (see schema for full shape):');
|
|
333
|
+
const keyMatches = command.schema.match(/^\s*"([^"]+)"\s*:/gm) ?? [];
|
|
334
|
+
const topLevelKeys = Array.from(new Set(keyMatches
|
|
335
|
+
.map((line) => line.match(/"([^"]+)"/)?.[1])
|
|
336
|
+
.filter((key) => Boolean(key)))).slice(0, 6);
|
|
337
|
+
for (const key of topLevelKeys) {
|
|
338
|
+
lines.push(` ${key}`);
|
|
339
|
+
}
|
|
340
|
+
return lines.join('\n');
|
|
341
|
+
}
|
|
342
|
+
function buildLocalhostTransportHint(message, baseUrl) {
|
|
343
|
+
if (!message.includes('transport error')) {
|
|
344
|
+
return message;
|
|
345
|
+
}
|
|
346
|
+
const normalizedBase = baseUrl.replace(/\/+$/, '');
|
|
347
|
+
if (normalizedBase !== DEFAULT_BASE_URL.replace(/\/+$/, '')) {
|
|
348
|
+
return message;
|
|
349
|
+
}
|
|
350
|
+
const lines = [message];
|
|
351
|
+
lines.push(`hint: runtime is pointing at the default localhost fallback (${DEFAULT_BASE_URL}).`);
|
|
352
|
+
// Only --mode cli provisions ~/.config/flywheel-cli/config.json; --mode mcp
|
|
353
|
+
// writes host MCP entries and cannot fix a stale runtime base URL, so do not
|
|
354
|
+
// offer it as an alternative here.
|
|
355
|
+
lines.push(' Run `npx --yes @paradigma-inc/flywheel setup --mode cli` to configure Flywheel.');
|
|
356
|
+
return lines.join('\n');
|
|
357
|
+
}
|
|
358
|
+
function formatConfigPathForMessage(configPath) {
|
|
359
|
+
const homeDir = os.homedir();
|
|
360
|
+
const withSlash = `${homeDir}/`;
|
|
361
|
+
if (configPath === homeDir) {
|
|
362
|
+
return '~';
|
|
363
|
+
}
|
|
364
|
+
if (configPath.startsWith(withSlash)) {
|
|
365
|
+
return `~/${configPath.slice(withSlash.length)}`;
|
|
366
|
+
}
|
|
367
|
+
return configPath;
|
|
368
|
+
}
|
|
369
|
+
function buildMissingRuntimeConfigMessage(configPath) {
|
|
370
|
+
const displayPath = formatConfigPathForMessage(configPath);
|
|
371
|
+
// Only --mode cli writes ~/.config/flywheel-cli/config.json. Pointing at
|
|
372
|
+
// --mode mcp as a fix would loop users back to this same error because MCP
|
|
373
|
+
// setup only touches host MCP entries, not the runtime CLI config.
|
|
374
|
+
return `Flywheel CLI runtime config not found at ${displayPath}. Run \`npx --yes @paradigma-inc/flywheel setup --mode cli\` to configure Flywheel.`;
|
|
375
|
+
}
|
|
376
|
+
async function defaultConfigExists(filePath) {
|
|
377
|
+
try {
|
|
378
|
+
await access(filePath);
|
|
379
|
+
return true;
|
|
380
|
+
}
|
|
381
|
+
catch {
|
|
382
|
+
return false;
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
export async function runCli(argv, dependencies = {}) {
|
|
386
|
+
const stdout = dependencies.stdout ?? defaultStdout;
|
|
387
|
+
const stderr = dependencies.stderr ?? defaultStderr;
|
|
388
|
+
if (argv.length === 0) {
|
|
389
|
+
writeLine(stderr, 'usage: flywheel <command> [options]');
|
|
390
|
+
return EXIT_USAGE;
|
|
391
|
+
}
|
|
392
|
+
argv = rewriteAlias(argv);
|
|
393
|
+
const [first, ...rest] = argv;
|
|
394
|
+
// Help-format validation intentionally runs only inside the help branches
|
|
395
|
+
// below. Non-help commands let `parseCliArgs` validate --format against the
|
|
396
|
+
// full json|tsv|csv|table set; validating here would reject legitimate
|
|
397
|
+
// runtime formats like `flywheel nodes:list --format=csv`.
|
|
398
|
+
function resolveHelpFormat() {
|
|
399
|
+
const fmt = parseHelpFormat(argv);
|
|
400
|
+
if (fmt.kind === 'invalid') {
|
|
401
|
+
writeLine(stderr, `invalid --format=${fmt.value}: help supports --format=json or no --format (text)`);
|
|
402
|
+
return EXIT_USAGE;
|
|
403
|
+
}
|
|
404
|
+
return { json: fmt.kind === 'json' };
|
|
405
|
+
}
|
|
406
|
+
// Top-level help / `help ...` dispatcher runs BEFORE parseCliArgs because
|
|
407
|
+
// `flywheel --help` and `flywheel help ...` aren't valid command tokens —
|
|
408
|
+
// they'd fail COMMAND_TOKEN_PATTERN and return "unknown command" if we
|
|
409
|
+
// let the parser run first. Per-command help (`flywheel <cmd> --help`,
|
|
410
|
+
// `flywheel <cmd> --schema --help`) is detected AFTER parseCliArgs binds
|
|
411
|
+
// values to flags, so a call like `profile:set --name -h --base_url ...`
|
|
412
|
+
// does not incorrectly drop into help mode on the `-h` value token.
|
|
413
|
+
if (isHelpToken(first)) {
|
|
414
|
+
const resolved = resolveHelpFormat();
|
|
415
|
+
if (typeof resolved === 'number')
|
|
416
|
+
return resolved;
|
|
417
|
+
const extrasParsed = parseHelpExtras(argv);
|
|
418
|
+
if (extrasParsed.kind === 'invalid') {
|
|
419
|
+
writeLine(stderr, 'invalid --_help_extras payload');
|
|
420
|
+
return EXIT_USAGE;
|
|
421
|
+
}
|
|
422
|
+
const extras = extrasParsed.kind === 'ok' ? extrasParsed.extras : [];
|
|
423
|
+
stdout(resolved.json ? renderHelpAsJson(extras) : renderHelp(extras));
|
|
424
|
+
return 0;
|
|
425
|
+
}
|
|
426
|
+
if (first === 'help') {
|
|
427
|
+
const resolved = resolveHelpFormat();
|
|
428
|
+
if (typeof resolved === 'number')
|
|
429
|
+
return resolved;
|
|
430
|
+
// Strip --format and --_help_extras tokens so the positional <command>
|
|
431
|
+
// lookup isn't fooled by them occupying rest[0].
|
|
432
|
+
const helpArgs = stripHelpExtras(stripFormatTokens(rest));
|
|
433
|
+
const extrasParsed = parseHelpExtras(argv);
|
|
434
|
+
if (extrasParsed.kind === 'invalid') {
|
|
435
|
+
writeLine(stderr, 'invalid --_help_extras payload');
|
|
436
|
+
return EXIT_USAGE;
|
|
437
|
+
}
|
|
438
|
+
if (helpArgs.length === 0) {
|
|
439
|
+
const extras = extrasParsed.kind === 'ok' ? extrasParsed.extras : [];
|
|
440
|
+
stdout(resolved.json ? renderHelpAsJson(extras) : renderHelp(extras));
|
|
441
|
+
return 0;
|
|
442
|
+
}
|
|
443
|
+
// --_help_extras is only valid on top-level help. Surface mis-use
|
|
444
|
+
// as a usage error rather than silently ignoring it.
|
|
445
|
+
if (extrasParsed.kind === 'ok') {
|
|
446
|
+
writeLine(stderr, 'unknown flag: --_help_extras');
|
|
447
|
+
return EXIT_USAGE;
|
|
448
|
+
}
|
|
449
|
+
// `help <alias>` must resolve the same alias map used by the SHORTCUTS
|
|
450
|
+
// section so advertised shortcuts get executable help pages.
|
|
451
|
+
const rawCommandName = helpArgs[0];
|
|
452
|
+
const commandName = Object.prototype.hasOwnProperty.call(RUNTIME_ALIASES, rawCommandName)
|
|
453
|
+
? RUNTIME_ALIASES[rawCommandName]
|
|
454
|
+
: rawCommandName;
|
|
455
|
+
const schema = helpArgs.slice(1).includes(SCHEMA_TOKEN);
|
|
456
|
+
return emitCommandHelp(stdout, stderr, commandName, schema, resolved.json);
|
|
457
|
+
}
|
|
458
|
+
// --_help_extras is reserved for top-level help dispatch only. Reject it
|
|
459
|
+
// when seen on any other command path so it cannot leak into runtime
|
|
460
|
+
// argument parsing downstream.
|
|
461
|
+
if (argv.some((t) => t.startsWith(HELP_EXTRAS_PREFIX))) {
|
|
462
|
+
writeLine(stderr, 'unknown flag: --_help_extras');
|
|
463
|
+
return EXIT_USAGE;
|
|
464
|
+
}
|
|
465
|
+
const parsed = parseCliArgs(argv);
|
|
466
|
+
if (!parsed.ok) {
|
|
467
|
+
writeLine(stderr, parsed.message);
|
|
468
|
+
return parsed.exitCode;
|
|
469
|
+
}
|
|
470
|
+
// Per-command help detection happens AFTER the parser has bound values
|
|
471
|
+
// to flags. `--help` / `-h` / `--schema` appear in parsed.params only
|
|
472
|
+
// when they were standalone flags on the command, never when they were
|
|
473
|
+
// consumed as a value for a preceding flag.
|
|
474
|
+
const helpRequested = parsed.params.help === true || parsed.params.h === true;
|
|
475
|
+
const schemaRequested = parsed.params.schema === true;
|
|
476
|
+
if (helpRequested) {
|
|
477
|
+
const resolved = resolveHelpFormat();
|
|
478
|
+
if (typeof resolved === 'number')
|
|
479
|
+
return resolved;
|
|
480
|
+
return emitCommandHelp(stdout, stderr, parsed.command, schemaRequested, resolved.json);
|
|
481
|
+
}
|
|
482
|
+
if (schemaRequested) {
|
|
483
|
+
writeLine(stderr, '--schema is only valid with --help');
|
|
484
|
+
return 1;
|
|
485
|
+
}
|
|
486
|
+
if (!getCommandByName(parsed.command)) {
|
|
487
|
+
writeLine(stderr, `unknown command: ${parsed.command}`);
|
|
488
|
+
return 1;
|
|
489
|
+
}
|
|
490
|
+
const handler = MVP_COMMAND_HANDLERS[parsed.command];
|
|
491
|
+
if (!handler) {
|
|
492
|
+
writeLine(stderr, `unknown command: ${parsed.command}`);
|
|
493
|
+
return 1;
|
|
494
|
+
}
|
|
495
|
+
const commandName = parsed.command;
|
|
496
|
+
const configPath = dependencies.configPath ?? resolveConfigPath();
|
|
497
|
+
const loadConfig = dependencies.loadConfig ?? loadAuthConfig;
|
|
498
|
+
const configExists = dependencies.configExists ?? defaultConfigExists;
|
|
499
|
+
const saveConfig = dependencies.saveConfig ?? saveAuthConfig;
|
|
500
|
+
const profileLoader = dependencies.loadProfile ?? loadProfile;
|
|
501
|
+
const resolveEnvApiKey = dependencies.resolveEnvApiKey ??
|
|
502
|
+
((envVar) => process.env[envVar]?.trim() || undefined);
|
|
503
|
+
const writeOutputFile = dependencies.writeOutputFile ??
|
|
504
|
+
(async (path, contents) => {
|
|
505
|
+
await writeFile(path, contents);
|
|
506
|
+
});
|
|
507
|
+
let effectiveBaseUrl = DEFAULT_BASE_URL;
|
|
508
|
+
let globals = {};
|
|
509
|
+
try {
|
|
510
|
+
const extracted = extractGlobals(parsed.params);
|
|
511
|
+
globals = { ...extracted.globals, format: parsed.format, formatExplicit: parsed.formatExplicit };
|
|
512
|
+
const { handlerParams, flagNames } = extracted;
|
|
513
|
+
// `--env=<name>` accepts both legacy TOML profiles AND built-in
|
|
514
|
+
// profile names (prod / staging). Built-ins synthesise a minimal
|
|
515
|
+
// Profile so the rest of the pipeline (baseUrl resolution,
|
|
516
|
+
// per-profile keychain lookups, etc.) treats them uniformly. The
|
|
517
|
+
// built-in baseUrl is the runtime source of truth (never written to
|
|
518
|
+
// config.json); the `--env=<builtin>` invocation effectively flips
|
|
519
|
+
// the active profile for this one call without mutating disk state.
|
|
520
|
+
let profile = null;
|
|
521
|
+
if (globals.env) {
|
|
522
|
+
// Built-in names (`prod` / `staging`) are reserved and must always
|
|
523
|
+
// resolve to `BUILTIN_PROFILES`. Checking built-ins BEFORE the
|
|
524
|
+
// TOML loader prevents a stray `profiles/staging.toml` (e.g. left
|
|
525
|
+
// over from manual setup before built-ins existed) from silently
|
|
526
|
+
// shadowing the built-in and routing requests — and, via the
|
|
527
|
+
// per-profile key lookup in `resolveRuntimeAuthConfig`, stored
|
|
528
|
+
// credentials — to an unintended origin. `env:switch` enforces
|
|
529
|
+
// the same reservation; resolving built-ins first keeps
|
|
530
|
+
// `--env=<name>` and `env:switch --name <name>` in lockstep.
|
|
531
|
+
if (isBuiltinProfileName(globals.env)) {
|
|
532
|
+
const builtinBaseUrl = resolveBuiltinBaseUrl(globals.env);
|
|
533
|
+
if (builtinBaseUrl) {
|
|
534
|
+
profile = { name: globals.env, baseUrl: builtinBaseUrl };
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
else {
|
|
538
|
+
const fromToml = await profileLoader(globals.env);
|
|
539
|
+
if (fromToml) {
|
|
540
|
+
profile = fromToml;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
if (!profile) {
|
|
544
|
+
const available = BUILTIN_PROFILE_NAMES.join(', ');
|
|
545
|
+
throw new CliUsageError(`unknown profile: ${globals.env}. Built-in profiles: ${available}`);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
if (dependencies.loadConfig === undefined &&
|
|
549
|
+
!RUNTIME_CONFIG_OPTIONAL_COMMANDS.has(commandName)) {
|
|
550
|
+
// Env-only execution (CI/containers, scripted health checks) and
|
|
551
|
+
// profile-based auth resolve runtime config without the file on
|
|
552
|
+
// disk. Once `FLYWHEEL_BASE_URL` is set the CLI has enough to
|
|
553
|
+
// reach a server — the API key is a per-endpoint concern: some
|
|
554
|
+
// endpoints (e.g. `/auth/status`) are callable unauthenticated
|
|
555
|
+
// and return a "not authenticated" payload, and requiring a
|
|
556
|
+
// bogus `FLYWHEEL_API_KEY` just to satisfy the gate would force
|
|
557
|
+
// users to invent values for valid bootstrap/health-check flows.
|
|
558
|
+
// Server-side 401 is the right signal when a specific command
|
|
559
|
+
// needs auth and none is available.
|
|
560
|
+
const envBaseUrl = process.env.FLYWHEEL_BASE_URL?.trim();
|
|
561
|
+
const hasEnvBaseUrl = Boolean(envBaseUrl);
|
|
562
|
+
if (!profile && !hasEnvBaseUrl) {
|
|
563
|
+
const runtimeConfigExists = await configExists(configPath);
|
|
564
|
+
if (!runtimeConfigExists) {
|
|
565
|
+
writeLine(stderr, buildMissingRuntimeConfigMessage(configPath));
|
|
566
|
+
return EXIT_USAGE;
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
const config = await loadConfig(configPath);
|
|
571
|
+
const runtimeConfig = await resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey);
|
|
572
|
+
effectiveBaseUrl = runtimeConfig.baseUrl;
|
|
573
|
+
const effectiveFormat = parsed.formatExplicit
|
|
574
|
+
? parsed.format
|
|
575
|
+
: (runtimeConfig.defaultFormat ?? parsed.format);
|
|
576
|
+
const profileTimeoutS = typeof profile?.defaultTimeoutS === 'number' ? profile.defaultTimeoutS : undefined;
|
|
577
|
+
const effectiveTimeoutMs = typeof globals.timeoutS === 'number'
|
|
578
|
+
? globals.timeoutS * 1000
|
|
579
|
+
: typeof profileTimeoutS === 'number'
|
|
580
|
+
? profileTimeoutS * 1000
|
|
581
|
+
: undefined;
|
|
582
|
+
const buildClient = dependencies.createHttpClient ?? createHttpClient;
|
|
583
|
+
const client = buildClient({
|
|
584
|
+
baseUrl: runtimeConfig.baseUrl,
|
|
585
|
+
apiKey: runtimeConfig.apiKey,
|
|
586
|
+
cliVersion: CLI_VERSION,
|
|
587
|
+
commandName,
|
|
588
|
+
flagNames,
|
|
589
|
+
invocationId: randomUUID(),
|
|
590
|
+
retryMax: globals.retryMax,
|
|
591
|
+
retryEnabled: globals.retryEnabled,
|
|
592
|
+
debug: globals.debug,
|
|
593
|
+
timeoutMs: effectiveTimeoutMs,
|
|
594
|
+
idempotencyKey: globals.idempotencyKey,
|
|
595
|
+
});
|
|
596
|
+
const payload = await handler({
|
|
597
|
+
params: handlerParams,
|
|
598
|
+
requestJson: client.requestJson,
|
|
599
|
+
requestRaw: client.requestRaw,
|
|
600
|
+
requestRawExternal: client.requestRawExternal,
|
|
601
|
+
saveConfig,
|
|
602
|
+
configPath,
|
|
603
|
+
baseUrl: runtimeConfig.baseUrl,
|
|
604
|
+
apiKey: runtimeConfig.apiKey,
|
|
605
|
+
globals,
|
|
606
|
+
stderr,
|
|
607
|
+
stdout,
|
|
608
|
+
writeOutputFile,
|
|
609
|
+
});
|
|
610
|
+
if (payload === undefined || payload === null) {
|
|
611
|
+
return 0;
|
|
612
|
+
}
|
|
613
|
+
if (payload instanceof Uint8Array || payload instanceof Buffer) {
|
|
614
|
+
if (!globals.outPath) {
|
|
615
|
+
writeLine(stderr, `${commandName} returns binary output; pass --out=<path> or --out=- to write to stdout`);
|
|
616
|
+
return EXIT_USAGE;
|
|
617
|
+
}
|
|
618
|
+
if (globals.outPath === '-') {
|
|
619
|
+
// Route binary bytes through the injected stdout writer so
|
|
620
|
+
// programmatic runCli callers can capture them, matching the
|
|
621
|
+
// text-output path.
|
|
622
|
+
stdout(payload);
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
await writeOutputFile(globals.outPath, payload);
|
|
626
|
+
}
|
|
627
|
+
return 0;
|
|
628
|
+
}
|
|
629
|
+
const rendered = renderOutput(payload, effectiveFormat);
|
|
630
|
+
if (globals.outPath) {
|
|
631
|
+
if (globals.outPath === '-') {
|
|
632
|
+
stdout(rendered);
|
|
633
|
+
}
|
|
634
|
+
else {
|
|
635
|
+
await writeOutputFile(globals.outPath, rendered);
|
|
636
|
+
}
|
|
637
|
+
}
|
|
638
|
+
else {
|
|
639
|
+
stdout(rendered);
|
|
640
|
+
}
|
|
641
|
+
return 0;
|
|
642
|
+
}
|
|
643
|
+
catch (error) {
|
|
644
|
+
if (error instanceof CliUsageError) {
|
|
645
|
+
const augmented = error.message.startsWith('missing required parameter')
|
|
646
|
+
? buildMissingParamHint(commandName, error.message)
|
|
647
|
+
: error.message;
|
|
648
|
+
writeLine(stderr, augmented);
|
|
649
|
+
return error.exitCode;
|
|
650
|
+
}
|
|
651
|
+
if (error instanceof CliApprovalPendingError) {
|
|
652
|
+
const envelope = {
|
|
653
|
+
error: {
|
|
654
|
+
code: 'approval_required',
|
|
655
|
+
message: error.message,
|
|
656
|
+
exit_code: error.exitCode,
|
|
657
|
+
},
|
|
658
|
+
};
|
|
659
|
+
const errBody = envelope.error;
|
|
660
|
+
if (error.approvalUrl) {
|
|
661
|
+
errBody.approval_url = error.approvalUrl;
|
|
662
|
+
}
|
|
663
|
+
if (error.approvalRequestId) {
|
|
664
|
+
errBody.approval_request_id = error.approvalRequestId;
|
|
665
|
+
}
|
|
666
|
+
if (error.requiredSignoffs.length > 0) {
|
|
667
|
+
errBody.required_signoffs = error.requiredSignoffs;
|
|
668
|
+
}
|
|
669
|
+
if (error.grantId) {
|
|
670
|
+
errBody.grant_id = error.grantId;
|
|
671
|
+
}
|
|
672
|
+
if (error.serverResponse) {
|
|
673
|
+
errBody.server_response = error.serverResponse;
|
|
674
|
+
}
|
|
675
|
+
if (error.request) {
|
|
676
|
+
errBody.request = error.request;
|
|
677
|
+
}
|
|
678
|
+
writeLine(stderr, JSON.stringify(envelope));
|
|
679
|
+
return error.exitCode;
|
|
680
|
+
}
|
|
681
|
+
if (error instanceof CliFinalizeFailedError) {
|
|
682
|
+
const envelope = {
|
|
683
|
+
error: {
|
|
684
|
+
code: 'finalize_failed',
|
|
685
|
+
message: error.message,
|
|
686
|
+
exit_code: error.exitCode,
|
|
687
|
+
orphan_blob_ids: error.orphanBlobIds,
|
|
688
|
+
},
|
|
689
|
+
};
|
|
690
|
+
writeLine(stderr, JSON.stringify(envelope));
|
|
691
|
+
return error.exitCode;
|
|
692
|
+
}
|
|
693
|
+
if (error instanceof CliWaitTimeoutError) {
|
|
694
|
+
const envelope = {
|
|
695
|
+
error: {
|
|
696
|
+
code: 'wait_timeout',
|
|
697
|
+
message: error.message,
|
|
698
|
+
exit_code: error.exitCode,
|
|
699
|
+
last_state: error.lastState,
|
|
700
|
+
},
|
|
701
|
+
};
|
|
702
|
+
writeLine(stderr, JSON.stringify(envelope));
|
|
703
|
+
return error.exitCode;
|
|
704
|
+
}
|
|
705
|
+
if (error instanceof CliHttpError) {
|
|
706
|
+
let message = error.message;
|
|
707
|
+
if (error.status === 422 &&
|
|
708
|
+
(commandName === 'nodes:commit-new' || commandName === 'nodes:commit')) {
|
|
709
|
+
message = buildCommitSchemaHint(commandName, message);
|
|
710
|
+
}
|
|
711
|
+
message = buildLocalhostTransportHint(message, effectiveBaseUrl);
|
|
712
|
+
const code = error.status === 401 || error.status === 403
|
|
713
|
+
? 'auth_error'
|
|
714
|
+
: error.status === undefined
|
|
715
|
+
? 'transport_error'
|
|
716
|
+
: 'http_error';
|
|
717
|
+
const envelope = {
|
|
718
|
+
error: {
|
|
719
|
+
code,
|
|
720
|
+
message,
|
|
721
|
+
exit_code: error.exitCode,
|
|
722
|
+
},
|
|
723
|
+
};
|
|
724
|
+
const inner = envelope.error;
|
|
725
|
+
if (typeof error.status === 'number') {
|
|
726
|
+
inner.server_response = { status: error.status, body: error.body };
|
|
727
|
+
}
|
|
728
|
+
if (error.request) {
|
|
729
|
+
inner.request = {
|
|
730
|
+
method: error.request.method,
|
|
731
|
+
path: error.request.path,
|
|
732
|
+
request_id: error.request.requestId,
|
|
733
|
+
};
|
|
734
|
+
}
|
|
735
|
+
writeLine(stderr, JSON.stringify(envelope));
|
|
736
|
+
return error.exitCode;
|
|
737
|
+
}
|
|
738
|
+
if (error instanceof Error) {
|
|
739
|
+
writeLine(stderr, error.message);
|
|
740
|
+
return EXIT_TRANSPORT;
|
|
741
|
+
}
|
|
742
|
+
writeLine(stderr, 'runtime error');
|
|
743
|
+
return EXIT_TRANSPORT;
|
|
744
|
+
}
|
|
745
|
+
finally {
|
|
746
|
+
void globals;
|
|
747
|
+
}
|
|
748
|
+
}
|
|
749
|
+
async function main() {
|
|
750
|
+
const exitCode = await runCli(process.argv.slice(2), {});
|
|
751
|
+
process.exitCode = exitCode;
|
|
752
|
+
}
|
|
753
|
+
function isDirectExecution() {
|
|
754
|
+
const entrypoint = process.argv[1];
|
|
755
|
+
if (!entrypoint) {
|
|
756
|
+
return false;
|
|
757
|
+
}
|
|
758
|
+
return import.meta.url === pathToFileURL(resolve(entrypoint)).href;
|
|
759
|
+
}
|
|
760
|
+
if (isDirectExecution()) {
|
|
761
|
+
void main();
|
|
762
|
+
}
|
|
763
|
+
//# sourceMappingURL=main.js.map
|