@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,387 @@
|
|
|
1
|
+
import { readFile } from 'node:fs/promises';
|
|
2
|
+
import { CliUsageError } from '../errors.js';
|
|
3
|
+
import { baseUrlsEqual } from './baseurl.js';
|
|
4
|
+
import { BUILTIN_PROFILES, BUILTIN_PROFILE_NAMES, } from './profiles.js';
|
|
5
|
+
function extractStatusError(error) {
|
|
6
|
+
if (typeof error !== 'object' || error === null)
|
|
7
|
+
return null;
|
|
8
|
+
const candidate = error;
|
|
9
|
+
if (typeof candidate.status === 'number')
|
|
10
|
+
return candidate;
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
function extractErrorBody(statusError) {
|
|
14
|
+
const raw = statusError.body ?? statusError.errorBody;
|
|
15
|
+
if (raw && typeof raw === 'object') {
|
|
16
|
+
return raw;
|
|
17
|
+
}
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
function normalizePollInterval(raw) {
|
|
21
|
+
// Defensive: discard non-finite, zero/negative, or non-number values
|
|
22
|
+
// instead of letting them poison the sleep call. The server contract
|
|
23
|
+
// is a positive integer-seconds value; anything else is a buggy
|
|
24
|
+
// response and the CLI should keep its last good interval.
|
|
25
|
+
if (typeof raw !== 'number')
|
|
26
|
+
return null;
|
|
27
|
+
if (!Number.isFinite(raw) || raw <= 0)
|
|
28
|
+
return null;
|
|
29
|
+
return raw;
|
|
30
|
+
}
|
|
31
|
+
function extractPollIntervalSeconds(error) {
|
|
32
|
+
const statusError = extractStatusError(error);
|
|
33
|
+
if (!statusError)
|
|
34
|
+
return null;
|
|
35
|
+
const body = extractErrorBody(statusError);
|
|
36
|
+
if (!body)
|
|
37
|
+
return null;
|
|
38
|
+
const topLevel = normalizePollInterval(body.poll_interval_seconds);
|
|
39
|
+
if (topLevel !== null)
|
|
40
|
+
return topLevel;
|
|
41
|
+
const detail = body.detail;
|
|
42
|
+
if (detail && typeof detail === 'object') {
|
|
43
|
+
const nested = detail.poll_interval_seconds;
|
|
44
|
+
return normalizePollInterval(nested);
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
function extractDeviceFlowError(error) {
|
|
49
|
+
const statusError = extractStatusError(error);
|
|
50
|
+
if (!statusError)
|
|
51
|
+
return null;
|
|
52
|
+
const body = extractErrorBody(statusError);
|
|
53
|
+
if (!body)
|
|
54
|
+
return null;
|
|
55
|
+
// Server may wrap the OAuth-style payload under FastAPI's `detail` key or
|
|
56
|
+
// place it at the top level. Check both so the CLI reads the same error
|
|
57
|
+
// code either way.
|
|
58
|
+
const topLevel = typeof body.error === 'string' ? body.error : null;
|
|
59
|
+
if (topLevel)
|
|
60
|
+
return topLevel;
|
|
61
|
+
const detail = body.detail;
|
|
62
|
+
if (detail && typeof detail === 'object') {
|
|
63
|
+
const nested = detail.error;
|
|
64
|
+
if (typeof nested === 'string')
|
|
65
|
+
return nested;
|
|
66
|
+
}
|
|
67
|
+
return null;
|
|
68
|
+
}
|
|
69
|
+
function defaultOpenBrowser(url) {
|
|
70
|
+
// Dynamic import keeps the "open" side-effect out of unit tests that inject
|
|
71
|
+
// their own openBrowser hook. The native shell-out is only invoked in real
|
|
72
|
+
// CLI runs.
|
|
73
|
+
return import('open').then(async (mod) => {
|
|
74
|
+
await mod.default(url);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
function defaultSleep(seconds) {
|
|
78
|
+
return new Promise((resolve) => {
|
|
79
|
+
setTimeout(resolve, seconds * 1000);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
function defaultNow() {
|
|
83
|
+
return Date.now();
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Derive the device-flow verification origin from the CLI's resolved
|
|
87
|
+
* baseUrl. The server validator accepts an origin only — scheme + host
|
|
88
|
+
* + optional non-default port — so we strip any path component (most
|
|
89
|
+
* commonly `/api` for built-in profiles) and return `URL.origin`.
|
|
90
|
+
* Returns null for unparseable input so the caller can fall back to
|
|
91
|
+
* omitting the field (server then falls back to request-host inference).
|
|
92
|
+
*/
|
|
93
|
+
function deriveVerificationBaseUrl(baseUrl) {
|
|
94
|
+
try {
|
|
95
|
+
return new URL(baseUrl).origin;
|
|
96
|
+
}
|
|
97
|
+
catch {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// FLY-416 CFG-WIPE: helpers to read the current activeProfile pointer and
|
|
102
|
+
// the existing per-profile key map from config.json without going through
|
|
103
|
+
// the AuthConfig-shaped loader (which normalises/drops fields we want to
|
|
104
|
+
// merge untouched).
|
|
105
|
+
async function readRawConfig(configPath) {
|
|
106
|
+
try {
|
|
107
|
+
const raw = await readFile(configPath, 'utf8');
|
|
108
|
+
const parsed = JSON.parse(raw);
|
|
109
|
+
if (parsed && typeof parsed === 'object') {
|
|
110
|
+
return parsed;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
// missing or malformed — callers fall back to legacy path
|
|
115
|
+
}
|
|
116
|
+
return {};
|
|
117
|
+
}
|
|
118
|
+
async function readExistingProfileKeys(configPath) {
|
|
119
|
+
const raw = await readRawConfig(configPath);
|
|
120
|
+
const candidate = raw.profileKeys;
|
|
121
|
+
if (!candidate || typeof candidate !== 'object')
|
|
122
|
+
return {};
|
|
123
|
+
const normalized = {};
|
|
124
|
+
for (const [name, value] of Object.entries(candidate)) {
|
|
125
|
+
if (value && typeof value === 'object') {
|
|
126
|
+
const entry = value;
|
|
127
|
+
if (typeof entry.apiKey === 'string') {
|
|
128
|
+
normalized[name] = { apiKey: entry.apiKey };
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return normalized;
|
|
133
|
+
}
|
|
134
|
+
function readOptionalInt(params, key) {
|
|
135
|
+
const value = params[key];
|
|
136
|
+
if (typeof value !== 'string')
|
|
137
|
+
return undefined;
|
|
138
|
+
const trimmed = value.trim();
|
|
139
|
+
if (!trimmed)
|
|
140
|
+
return undefined;
|
|
141
|
+
const parsed = Number.parseInt(trimmed, 10);
|
|
142
|
+
// A non-numeric value must fail loudly, not fall back to the server-side
|
|
143
|
+
// default: a typo like `--expiry_days abc` would otherwise silently mint
|
|
144
|
+
// a key with an unintended lifetime.
|
|
145
|
+
if (Number.isNaN(parsed) || !/^-?\d+$/.test(trimmed)) {
|
|
146
|
+
throw new CliUsageError(`invalid argument: ${key}=${value}`);
|
|
147
|
+
}
|
|
148
|
+
return parsed;
|
|
149
|
+
}
|
|
150
|
+
function readOptionalString(params, key) {
|
|
151
|
+
const value = params[key];
|
|
152
|
+
if (typeof value !== 'string')
|
|
153
|
+
return undefined;
|
|
154
|
+
const trimmed = value.trim();
|
|
155
|
+
return trimmed ? trimmed : undefined;
|
|
156
|
+
}
|
|
157
|
+
function readFlag(params, key) {
|
|
158
|
+
const value = params[key];
|
|
159
|
+
return value === true || value === 'true';
|
|
160
|
+
}
|
|
161
|
+
function formatDenyStdout() {
|
|
162
|
+
return [
|
|
163
|
+
'',
|
|
164
|
+
' ✖ Authorization denied.',
|
|
165
|
+
'',
|
|
166
|
+
' Your identity is not authorized for staging access.',
|
|
167
|
+
' Staging is limited to Paradigma engineers and approved beta users.',
|
|
168
|
+
'',
|
|
169
|
+
' To request access, see docs/flywheel/CLI_STAGING_ACCESS.md',
|
|
170
|
+
' (internal) or contact the staging-access owner listed there.',
|
|
171
|
+
'',
|
|
172
|
+
].join('\n');
|
|
173
|
+
}
|
|
174
|
+
function formatStartPromptInteractive(start) {
|
|
175
|
+
return [
|
|
176
|
+
'',
|
|
177
|
+
` One-time code: ${start.user_code}`,
|
|
178
|
+
'',
|
|
179
|
+
` Opening ${start.verification_uri} in your browser`,
|
|
180
|
+
' (or visit the URL manually and enter the code above).',
|
|
181
|
+
'',
|
|
182
|
+
' Waiting for authorization...',
|
|
183
|
+
].join('\n') + '\n';
|
|
184
|
+
}
|
|
185
|
+
function formatStartPromptHeadless(start) {
|
|
186
|
+
return [
|
|
187
|
+
'',
|
|
188
|
+
` One-time code: ${start.user_code}`,
|
|
189
|
+
'',
|
|
190
|
+
' On another device, visit:',
|
|
191
|
+
` ${start.verification_uri}`,
|
|
192
|
+
'',
|
|
193
|
+
' and enter the code above.',
|
|
194
|
+
'',
|
|
195
|
+
` Waiting for authorization (expires in ${Math.round(start.expires_in_seconds / 60)}m)...`,
|
|
196
|
+
].join('\n') + '\n';
|
|
197
|
+
}
|
|
198
|
+
export async function runAuthLogin(args) {
|
|
199
|
+
const openBrowser = args.openBrowser ?? defaultOpenBrowser;
|
|
200
|
+
const sleep = args.sleep ?? defaultSleep;
|
|
201
|
+
const now = args.now ?? defaultNow;
|
|
202
|
+
const write = args.writeStdout ?? ((chunk) => process.stdout.write(chunk));
|
|
203
|
+
const noBrowser = readFlag(args.params, 'no-browser');
|
|
204
|
+
const name = readOptionalString(args.params, 'name');
|
|
205
|
+
const expiryDays = readOptionalInt(args.params, 'expiry_days');
|
|
206
|
+
const startBody = {};
|
|
207
|
+
if (name)
|
|
208
|
+
startBody.name = name;
|
|
209
|
+
if (expiryDays !== undefined)
|
|
210
|
+
startBody.expiry_days = expiryDays;
|
|
211
|
+
// Always send the explicit verification origin so the server does not
|
|
212
|
+
// have to infer it from the request host. Server-side inference falls
|
|
213
|
+
// through to whatever the ingress/proxy presents (most often the API
|
|
214
|
+
// origin), which in API/UI split-origin deployments does not serve
|
|
215
|
+
// `/auth/mcp/setup/device` and leaves the user with an unusable
|
|
216
|
+
// browser URL. `URL.origin` is the WHATWG canonical origin (scheme +
|
|
217
|
+
// host [+ non-default port]); the server validates this exact shape.
|
|
218
|
+
const verificationBaseUrl = deriveVerificationBaseUrl(args.baseUrl);
|
|
219
|
+
if (verificationBaseUrl) {
|
|
220
|
+
startBody.verification_base_url = verificationBaseUrl;
|
|
221
|
+
}
|
|
222
|
+
let start;
|
|
223
|
+
try {
|
|
224
|
+
start = await args.requestJson('POST', '/auth/mcp-api-keys/setup-device/start', { body: startBody });
|
|
225
|
+
}
|
|
226
|
+
catch (error) {
|
|
227
|
+
// /setup-device/start does NOT carry the staging allowlist gate — that
|
|
228
|
+
// lives on /setup-device/approve and surfaces to the CLI via
|
|
229
|
+
// `access_denied` on /poll. A 403 here is therefore a different class
|
|
230
|
+
// of failure (capacity gate is the common one). Classify by payload
|
|
231
|
+
// rather than HTTP status so capacity reaches the user as a capacity
|
|
232
|
+
// error and other 403s are not silently rebranded as staging deny.
|
|
233
|
+
const deviceFlowError = extractDeviceFlowError(error);
|
|
234
|
+
if (deviceFlowError === 'capacity_reached') {
|
|
235
|
+
throw new Error('Flywheel capacity reached. Please try `flywheel auth:login` again ' +
|
|
236
|
+
'in a few minutes.');
|
|
237
|
+
}
|
|
238
|
+
throw error;
|
|
239
|
+
}
|
|
240
|
+
if (noBrowser) {
|
|
241
|
+
write(formatStartPromptHeadless(start));
|
|
242
|
+
}
|
|
243
|
+
else {
|
|
244
|
+
write(formatStartPromptInteractive(start));
|
|
245
|
+
try {
|
|
246
|
+
await openBrowser(start.verification_uri_complete);
|
|
247
|
+
}
|
|
248
|
+
catch {
|
|
249
|
+
// Failing to launch the browser is not fatal — the user can still
|
|
250
|
+
// visit the verification_uri manually. Fall through to polling.
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
const startedAtSeconds = now() / 1000;
|
|
254
|
+
let pollIntervalSeconds = start.poll_interval_seconds;
|
|
255
|
+
// RFC 8628 §3.5: once the server emits `slow_down`, the interval MUST
|
|
256
|
+
// be increased by 5 seconds "for this and all subsequent requests".
|
|
257
|
+
// Track that floor so a later pending response with a narrower
|
|
258
|
+
// server-advertised interval cannot drop us back below the RFC-
|
|
259
|
+
// mandated backoff.
|
|
260
|
+
let slowDownFloorSeconds = 0;
|
|
261
|
+
for (;;) {
|
|
262
|
+
if ((now() / 1000) - startedAtSeconds >= start.expires_in_seconds) {
|
|
263
|
+
write(' ✖ Device code expired before authorization was received.\n');
|
|
264
|
+
write(' Run `flywheel auth:login` again to start a new flow.\n');
|
|
265
|
+
return { key_id: null, exit_code: 1 };
|
|
266
|
+
}
|
|
267
|
+
await sleep(pollIntervalSeconds);
|
|
268
|
+
let poll;
|
|
269
|
+
try {
|
|
270
|
+
poll = await args.requestJson('POST', '/auth/mcp-api-keys/setup-device/poll', { body: { user_code: start.user_code, device_code: start.device_code } });
|
|
271
|
+
}
|
|
272
|
+
catch (error) {
|
|
273
|
+
const deviceFlowError = extractDeviceFlowError(error);
|
|
274
|
+
if (deviceFlowError === 'slow_down') {
|
|
275
|
+
pollIntervalSeconds += 5;
|
|
276
|
+
slowDownFloorSeconds = pollIntervalSeconds;
|
|
277
|
+
write(` (poll interval increased to ${pollIntervalSeconds}s per server request)\n`);
|
|
278
|
+
continue;
|
|
279
|
+
}
|
|
280
|
+
if (deviceFlowError === 'authorization_pending') {
|
|
281
|
+
// The server can ride an updated `poll_interval_seconds` along
|
|
282
|
+
// with the pending signal (dynamic throttling, runtime config
|
|
283
|
+
// change). Honour it so the CLI doesn't keep polling too
|
|
284
|
+
// aggressively (or unnecessarily slowly) against the server's
|
|
285
|
+
// wishes — while respecting the slow_down floor.
|
|
286
|
+
const updated = extractPollIntervalSeconds(error);
|
|
287
|
+
if (updated !== null) {
|
|
288
|
+
pollIntervalSeconds = Math.max(updated, slowDownFloorSeconds);
|
|
289
|
+
}
|
|
290
|
+
continue;
|
|
291
|
+
}
|
|
292
|
+
if (deviceFlowError === 'expired_token') {
|
|
293
|
+
write(' ✖ Device code expired before authorization was received.\n');
|
|
294
|
+
write(' Run `flywheel auth:login` again to start a new flow.\n');
|
|
295
|
+
return { key_id: null, exit_code: 1 };
|
|
296
|
+
}
|
|
297
|
+
// RFC 8628 §3.5 access_denied: the authorization request was denied
|
|
298
|
+
// (e.g. a staging-allowlist rejection at /approve). The server
|
|
299
|
+
// surfaces this via /poll so the CLI can stop polling immediately
|
|
300
|
+
// instead of waiting for `expires_in` to elapse.
|
|
301
|
+
if (deviceFlowError === 'access_denied') {
|
|
302
|
+
write(formatDenyStdout());
|
|
303
|
+
return { key_id: null, exit_code: 3 };
|
|
304
|
+
}
|
|
305
|
+
if (deviceFlowError === 'capacity_reached') {
|
|
306
|
+
throw new Error('Flywheel capacity reached. Please try `flywheel auth:login` ' +
|
|
307
|
+
'again in a few minutes.');
|
|
308
|
+
}
|
|
309
|
+
// Server returns 404 when the session row is missing — most
|
|
310
|
+
// commonly because `expires_at` has just elapsed (the SELECT
|
|
311
|
+
// filters on `expires_at > NOW()`) but the CLI's local
|
|
312
|
+
// `expires_in_seconds` timer hasn't fired yet. Treat 404 as the
|
|
313
|
+
// server-side variant of `expired_token` so the user gets the
|
|
314
|
+
// actionable "device code expired, run again" guidance and exit
|
|
315
|
+
// code 1, instead of a misleading transport error and exit 2.
|
|
316
|
+
const statusError = extractStatusError(error);
|
|
317
|
+
if (statusError?.status === 404) {
|
|
318
|
+
write(' ✖ Device code expired before authorization was received.\n');
|
|
319
|
+
write(' Run `flywheel auth:login` again to start a new flow.\n');
|
|
320
|
+
return { key_id: null, exit_code: 1 };
|
|
321
|
+
}
|
|
322
|
+
throw error;
|
|
323
|
+
}
|
|
324
|
+
if (poll.status === 'pending') {
|
|
325
|
+
// Same contract as the `authorization_pending` error variant above:
|
|
326
|
+
// if the server advertises a new interval, pick it up so this loop
|
|
327
|
+
// paces itself as the server instructed on every pending response,
|
|
328
|
+
// not just on `slow_down`. The slow_down floor still wins so the
|
|
329
|
+
// RFC-mandated backoff can't be silently undone by a lower value.
|
|
330
|
+
const updated = normalizePollInterval(poll.poll_interval_seconds);
|
|
331
|
+
if (updated !== null) {
|
|
332
|
+
pollIntervalSeconds = Math.max(updated, slowDownFloorSeconds);
|
|
333
|
+
}
|
|
334
|
+
continue;
|
|
335
|
+
}
|
|
336
|
+
if (poll.status === 'approved') {
|
|
337
|
+
// The minted key is scoped to the origin it was issued against.
|
|
338
|
+
// Routing therefore depends on `args.baseUrl`, NOT on which
|
|
339
|
+
// profile happens to be active: `auth:login --env=staging` while
|
|
340
|
+
// `activeProfile=prod` still mints a staging-scoped key and must
|
|
341
|
+
// populate `profileKeys.staging` (not the flat fields), otherwise
|
|
342
|
+
// the next `env:switch --name staging` resolves to whatever
|
|
343
|
+
// `profileKeys.staging` previously held (stale key) and the
|
|
344
|
+
// login "silently succeeds" while commands keep failing auth.
|
|
345
|
+
//
|
|
346
|
+
// Algorithm: if `args.baseUrl` is canonically equal to any
|
|
347
|
+
// built-in profile's baseUrl, write into `profileKeys[that
|
|
348
|
+
// built-in]`. Otherwise (local dev, ad-hoc origin, custom TOML
|
|
349
|
+
// profile), fall through to the legacy flat `{baseUrl, apiKey}`
|
|
350
|
+
// shape so the key records its actual origin.
|
|
351
|
+
let targetBuiltin = null;
|
|
352
|
+
for (const name of BUILTIN_PROFILE_NAMES) {
|
|
353
|
+
if (baseUrlsEqual(BUILTIN_PROFILES[name].baseUrl, args.baseUrl)) {
|
|
354
|
+
targetBuiltin = name;
|
|
355
|
+
break;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
if (targetBuiltin !== null) {
|
|
359
|
+
const existing = await readExistingProfileKeys(args.configPath);
|
|
360
|
+
const updated = {
|
|
361
|
+
...existing,
|
|
362
|
+
[targetBuiltin]: { apiKey: poll.key },
|
|
363
|
+
};
|
|
364
|
+
// Built-in baseUrls are runtime constants (never serialised
|
|
365
|
+
// into config.json) and the flat `apiKey` has no meaning under
|
|
366
|
+
// an active built-in profile. Writing a delta with only
|
|
367
|
+
// `profileKeys` preserves that invariant without passing
|
|
368
|
+
// `undefined` through a type cast that would break injected
|
|
369
|
+
// `saveConfig` implementations relying on the declared
|
|
370
|
+
// `AuthConfig` field types.
|
|
371
|
+
await args.saveConfig(args.configPath, {
|
|
372
|
+
profileKeys: updated,
|
|
373
|
+
});
|
|
374
|
+
}
|
|
375
|
+
else {
|
|
376
|
+
await args.saveConfig(args.configPath, {
|
|
377
|
+
baseUrl: args.baseUrl,
|
|
378
|
+
apiKey: poll.key,
|
|
379
|
+
});
|
|
380
|
+
}
|
|
381
|
+
write(' ✓ Authorization received.\n');
|
|
382
|
+
write(` ✓ API key saved to ${args.configPath}\n`);
|
|
383
|
+
return { key_id: poll.key_id, exit_code: 0 };
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
//# sourceMappingURL=login.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/auth/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAE5C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EA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,CAAC;YACH,CAAC;YACD,IAAI,aAAa,KAAK,IAAI,EAAE,CAAC;gBAC3B,MAAM,QAAQ,GAAG,MAAM,uBAAuB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;gBAChE,MAAM,OAAO,GAA+C;oBAC1D,GAAG,QAAQ;oBACX,CAAC,aAAa,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,GAAG,EAAE;iBACtC,CAAC;gBACF,4DAA4D;gBAC5D,+DAA+D;gBAC/D,wDAAwD;gBACxD,yDAAyD;gBACzD,4DAA4D;gBAC5D,uDAAuD;gBACvD,4BAA4B;gBAC5B,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE;oBACrC,WAAW,EAAE,OAAO;iBACrB,CAAC,CAAC;YACL,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE;oBACrC,OAAO,EAAE,IAAI,CAAC,OAAO;oBACrB,MAAM,EAAE,IAAI,CAAC,GAAG;iBACjB,CAAC,CAAC;YACL,CAAC;YACD,KAAK,CAAC,+BAA+B,CAAC,CAAC;YACvC,KAAK,CAAC,wBAAwB,IAAI,CAAC,UAAU,IAAI,CAAC,CAAC;YACnD,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;QAC/C,CAAC;IACH,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { OutputFormat } from '../grammar/parse.js';
|
|
2
|
+
export interface Profile {
|
|
3
|
+
name: string;
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
apiKeyEnv?: string;
|
|
6
|
+
apiKeyKeychain?: boolean;
|
|
7
|
+
defaultFormat?: OutputFormat;
|
|
8
|
+
defaultTimeoutS?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare function resolveProfilesDir(): string;
|
|
11
|
+
export declare function parseProfileToml(input: string): Record<string, string | number | boolean>;
|
|
12
|
+
export declare function loadProfile(name: string, dir?: string): Promise<Profile | null>;
|
|
13
|
+
export declare function listProfiles(dir?: string): Promise<string[]>;
|
|
14
|
+
export declare function saveProfile(profile: Profile, dir?: string): Promise<void>;
|
|
15
|
+
export declare function deleteProfile(name: string, dir?: string): Promise<boolean>;
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import { readdir, readFile, unlink, writeFile, mkdir } from 'node:fs/promises';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { CliUsageError } from '../errors.js';
|
|
5
|
+
export function resolveProfilesDir() {
|
|
6
|
+
const fromEnv = process.env.FLYWHEEL_CLI_PROFILES_DIR?.trim();
|
|
7
|
+
if (fromEnv) {
|
|
8
|
+
return fromEnv;
|
|
9
|
+
}
|
|
10
|
+
return path.join(os.homedir(), '.config', 'flywheel-cli', 'profiles');
|
|
11
|
+
}
|
|
12
|
+
function assertProfileNameSafe(name, dir) {
|
|
13
|
+
// Profile names arrive directly from user input (--name on profile:set /
|
|
14
|
+
// profile:unset / --env global). A plain Error would be classified as a
|
|
15
|
+
// runtime/transport failure in main.ts's catch ladder (exit 2). Use
|
|
16
|
+
// CliUsageError so invalid names like `../bad` exit 1 (usage) and stay
|
|
17
|
+
// distinguishable from connectivity/runtime failures in script exit codes.
|
|
18
|
+
if (!name || path.basename(name) !== name) {
|
|
19
|
+
throw new CliUsageError(`invalid profile name: ${name}`);
|
|
20
|
+
}
|
|
21
|
+
const resolvedDir = path.resolve(dir);
|
|
22
|
+
const resolvedFile = path.resolve(resolvedDir, `${name}.toml`);
|
|
23
|
+
if (resolvedFile !== path.join(resolvedDir, `${name}.toml`) ||
|
|
24
|
+
!resolvedFile.startsWith(resolvedDir + path.sep)) {
|
|
25
|
+
throw new CliUsageError(`invalid profile name: ${name}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
function profilePath(dir, name) {
|
|
29
|
+
assertProfileNameSafe(name, dir);
|
|
30
|
+
return path.join(dir, `${name}.toml`);
|
|
31
|
+
}
|
|
32
|
+
// Minimal TOML parser for our narrow schema: top-level `key = value` lines.
|
|
33
|
+
// Supports strings (quoted), integers, and booleans. No nested tables.
|
|
34
|
+
export function parseProfileToml(input) {
|
|
35
|
+
const out = {};
|
|
36
|
+
const lines = input.split(/\r?\n/);
|
|
37
|
+
for (const line of lines) {
|
|
38
|
+
const trimmed = line.trim();
|
|
39
|
+
if (!trimmed || trimmed.startsWith('#')) {
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
const eq = trimmed.indexOf('=');
|
|
43
|
+
if (eq === -1)
|
|
44
|
+
continue;
|
|
45
|
+
const key = trimmed.slice(0, eq).trim();
|
|
46
|
+
const rawValue = trimmed.slice(eq + 1).trim().replace(/\s+#.*$/, '');
|
|
47
|
+
if (!key)
|
|
48
|
+
continue;
|
|
49
|
+
if (rawValue.startsWith('"') && rawValue.endsWith('"')) {
|
|
50
|
+
out[key] = rawValue.slice(1, -1);
|
|
51
|
+
}
|
|
52
|
+
else if (rawValue === 'true' || rawValue === 'false') {
|
|
53
|
+
out[key] = rawValue === 'true';
|
|
54
|
+
}
|
|
55
|
+
else if (/^-?\d+$/.test(rawValue)) {
|
|
56
|
+
out[key] = Number.parseInt(rawValue, 10);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
out[key] = rawValue;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
return out;
|
|
63
|
+
}
|
|
64
|
+
function serializeProfileToml(profile) {
|
|
65
|
+
const lines = [];
|
|
66
|
+
lines.push(`base_url = ${JSON.stringify(profile.baseUrl)}`);
|
|
67
|
+
if (profile.apiKeyEnv) {
|
|
68
|
+
lines.push(`api_key_env = ${JSON.stringify(profile.apiKeyEnv)}`);
|
|
69
|
+
}
|
|
70
|
+
if (profile.apiKeyKeychain) {
|
|
71
|
+
lines.push(`api_key_keychain = true`);
|
|
72
|
+
}
|
|
73
|
+
if (profile.defaultFormat) {
|
|
74
|
+
lines.push(`default_format = ${JSON.stringify(profile.defaultFormat)}`);
|
|
75
|
+
}
|
|
76
|
+
if (typeof profile.defaultTimeoutS === 'number') {
|
|
77
|
+
lines.push(`default_timeout_s = ${profile.defaultTimeoutS}`);
|
|
78
|
+
}
|
|
79
|
+
return `${lines.join('\n')}\n`;
|
|
80
|
+
}
|
|
81
|
+
export async function loadProfile(name, dir = resolveProfilesDir()) {
|
|
82
|
+
assertProfileNameSafe(name, dir);
|
|
83
|
+
try {
|
|
84
|
+
const raw = await readFile(profilePath(dir, name), 'utf8');
|
|
85
|
+
const parsed = parseProfileToml(raw);
|
|
86
|
+
const baseUrl = typeof parsed.base_url === 'string' ? parsed.base_url : null;
|
|
87
|
+
if (!baseUrl) {
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
const profile = {
|
|
91
|
+
name,
|
|
92
|
+
baseUrl,
|
|
93
|
+
};
|
|
94
|
+
if (typeof parsed.api_key_env === 'string') {
|
|
95
|
+
profile.apiKeyEnv = parsed.api_key_env;
|
|
96
|
+
}
|
|
97
|
+
if (parsed.api_key_keychain === true) {
|
|
98
|
+
profile.apiKeyKeychain = true;
|
|
99
|
+
}
|
|
100
|
+
if (parsed.default_format === 'json' ||
|
|
101
|
+
parsed.default_format === 'tsv' ||
|
|
102
|
+
parsed.default_format === 'csv' ||
|
|
103
|
+
parsed.default_format === 'table') {
|
|
104
|
+
profile.defaultFormat = parsed.default_format;
|
|
105
|
+
}
|
|
106
|
+
if (typeof parsed.default_timeout_s === 'number' &&
|
|
107
|
+
Number.isFinite(parsed.default_timeout_s) &&
|
|
108
|
+
parsed.default_timeout_s >= 1 &&
|
|
109
|
+
parsed.default_timeout_s <= 86_400) {
|
|
110
|
+
// Clamp to the same bounds profile:set enforces; silently ignore
|
|
111
|
+
// out-of-range values from hand-edited TOML rather than let a
|
|
112
|
+
// zero/negative timeout brick every command.
|
|
113
|
+
profile.defaultTimeoutS = parsed.default_timeout_s;
|
|
114
|
+
}
|
|
115
|
+
return profile;
|
|
116
|
+
}
|
|
117
|
+
catch {
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
export async function listProfiles(dir = resolveProfilesDir()) {
|
|
122
|
+
try {
|
|
123
|
+
const entries = await readdir(dir);
|
|
124
|
+
return entries
|
|
125
|
+
.filter((entry) => entry.endsWith('.toml'))
|
|
126
|
+
.map((entry) => entry.replace(/\.toml$/, ''))
|
|
127
|
+
.sort();
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
return [];
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
export async function saveProfile(profile, dir = resolveProfilesDir()) {
|
|
134
|
+
await mkdir(dir, { recursive: true });
|
|
135
|
+
await writeFile(profilePath(dir, profile.name), serializeProfileToml(profile), {
|
|
136
|
+
encoding: 'utf8',
|
|
137
|
+
mode: 0o600,
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export async function deleteProfile(name, dir = resolveProfilesDir()) {
|
|
141
|
+
assertProfileNameSafe(name, dir);
|
|
142
|
+
try {
|
|
143
|
+
await unlink(profilePath(dir, name));
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
catch {
|
|
147
|
+
return false;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
//# sourceMappingURL=profile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/auth/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC/E,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAY7C,MAAM,UAAU,kBAAkB;IAChC,MAAM,OAAO,GAAG,OAAO,CAAC,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ACX,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;aAC1C,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;aAC5C,IAAI,EAAE,CAAC;IACZ,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAgB,EAChB,MAAc,kBAAkB,EAAE;IAElC,MAAM,KAAK,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtC,MAAM,SAAS,CAAC,WAAW,CAAC,GAAG,EAAE,OAAO,CAAC,IAAI,CAAC,EAAE,oBAAoB,CAAC,OAAO,CAAC,EAAE;QAC7E,QAAQ,EAAE,MAAM;QAChB,IAAI,EAAE,KAAK;KACZ,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,IAAY,EACZ,MAAc,kBAAkB,EAAE;IAElC,qBAAqB,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IACjC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,WAAW,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC,CAAC;QACrC,OAAO,IAAI,CAAC;IACd,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in CLI profiles. Values here are the runtime source of truth for
|
|
3
|
+
* prod/staging baseUrls — per the CLI's auth contract they are NEVER
|
|
4
|
+
* written into the user's config.json. That way upstream URL changes flow
|
|
5
|
+
* through to every installed CLI without a config migration.
|
|
6
|
+
*
|
|
7
|
+
* NOTE on the `/api` suffix: the CLI targets the JSON API root, which
|
|
8
|
+
* lives under `/api` on both prod and staging (see `help.ts` and the
|
|
9
|
+
* `README` — "FLYWHEEL_BASE_URL must be the full API base, including
|
|
10
|
+
* /api"). The browser-facing device-flow page (`/auth/mcp/setup/device`)
|
|
11
|
+
* is rendered by the server off the origin root and does not require the
|
|
12
|
+
* suffix, but every request the CLI's HTTP client makes is concatenated
|
|
13
|
+
* onto `baseUrl`, so origin-root URLs would land on the web app instead
|
|
14
|
+
* of the API.
|
|
15
|
+
*/
|
|
16
|
+
export interface BuiltinProfile {
|
|
17
|
+
baseUrl: string;
|
|
18
|
+
}
|
|
19
|
+
export declare const BUILTIN_PROFILES: {
|
|
20
|
+
readonly prod: BuiltinProfile;
|
|
21
|
+
readonly staging: BuiltinProfile;
|
|
22
|
+
};
|
|
23
|
+
export type BuiltinProfileName = keyof typeof BUILTIN_PROFILES;
|
|
24
|
+
export declare const BUILTIN_PROFILE_NAMES: readonly BuiltinProfileName[];
|
|
25
|
+
export declare function isBuiltinProfileName(name: string): name is BuiltinProfileName;
|
|
26
|
+
export declare function resolveBuiltinBaseUrl(name: string): string | undefined;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in CLI profiles. Values here are the runtime source of truth for
|
|
3
|
+
* prod/staging baseUrls — per the CLI's auth contract they are NEVER
|
|
4
|
+
* written into the user's config.json. That way upstream URL changes flow
|
|
5
|
+
* through to every installed CLI without a config migration.
|
|
6
|
+
*
|
|
7
|
+
* NOTE on the `/api` suffix: the CLI targets the JSON API root, which
|
|
8
|
+
* lives under `/api` on both prod and staging (see `help.ts` and the
|
|
9
|
+
* `README` — "FLYWHEEL_BASE_URL must be the full API base, including
|
|
10
|
+
* /api"). The browser-facing device-flow page (`/auth/mcp/setup/device`)
|
|
11
|
+
* is rendered by the server off the origin root and does not require the
|
|
12
|
+
* suffix, but every request the CLI's HTTP client makes is concatenated
|
|
13
|
+
* onto `baseUrl`, so origin-root URLs would land on the web app instead
|
|
14
|
+
* of the API.
|
|
15
|
+
*/
|
|
16
|
+
export const BUILTIN_PROFILES = {
|
|
17
|
+
prod: { baseUrl: 'https://flywheel.paradigma.inc/api' },
|
|
18
|
+
staging: { baseUrl: 'https://flywheel-staging.paradigma.inc/api' },
|
|
19
|
+
};
|
|
20
|
+
export const BUILTIN_PROFILE_NAMES = Object.freeze(Object.keys(BUILTIN_PROFILES));
|
|
21
|
+
export function isBuiltinProfileName(name) {
|
|
22
|
+
return Object.prototype.hasOwnProperty.call(BUILTIN_PROFILES, name);
|
|
23
|
+
}
|
|
24
|
+
export function resolveBuiltinBaseUrl(name) {
|
|
25
|
+
return isBuiltinProfileName(name) ? BUILTIN_PROFILES[name].baseUrl : undefined;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=profiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profiles.js","sourceRoot":"","sources":["../../src/auth/profiles.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAMH,MAAM,CAAC,MAAM,gBAAgB,GAGzB;IACF,IAAI,EAAE,EAAE,OAAO,EAAE,oCAAoC,EAAE;IACvD,OAAO,EAAE,EAAE,OAAO,EAAE,4CAA4C,EAAE;CACnE,CAAC;AAIF,MAAM,CAAC,MAAM,qBAAqB,GAAkC,MAAM,CAAC,MAAM,CAC/E,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAyB,CACtD,CAAC;AAEF,MAAM,UAAU,oBAAoB,CAAC,IAAY;IAC/C,OAAO,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,gBAAgB,EAAE,IAAI,CAAC,CAAC;AACtE,CAAC;AAED,MAAM,UAAU,qBAAqB,CAAC,IAAY;IAChD,OAAO,oBAAoB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC;AACjF,CAAC"}
|