@paradigma-inc/flywheel 0.1.115 → 0.1.134
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 +67 -10
- package/package.json +14 -6
- package/skills/flywheel/SKILL.md +9 -6
- package/skills/flywheel/example-workflows/organizing-exploring-and-iterating-on-a-research-topic.md +38 -46
- package/skills/flywheel/example-workflows/reproducing-papers-on-a-budget.md +34 -36
- package/skills/flywheel/getting-started/flywheel-quickstart.md +2 -5
- package/skills/flywheel/references/INTERFACES.md +2 -2
- package/skills/flywheel/references/experiment-design-protocol.md +32 -25
- package/skills/flywheel/references/flywheel-cli-tool-map.md +120 -76
- package/skills/flywheel/references/flywheel-mcp-tool-map.md +42 -32
- 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/installation-overview.md +2 -6
- package/skills/flywheel/setting-up-flywheel/other-hosts-installation.md +45 -25
- package/skills/flywheel/setting-up-flywheel/updating-flywheel-mcp.md +34 -11
- package/skills/flywheel-auto/SKILL.md +40 -23
- package/skills/flywheel-auto/evals/evals.json +1 -1
- package/skills/flywheel-auto/references/INTERFACES.md +2 -2
- package/skills/flywheel-auto/references/experiment-design-protocol.md +31 -23
- package/skills/flywheel-auto/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-lookahead/SKILL.md +47 -28
- package/skills/flywheel-lookahead/agents/openai.yaml +1 -1
- package/skills/flywheel-lookahead/evals/evals.json +6 -6
- package/skills/flywheel-lookahead/references/INTERFACES.md +2 -2
- package/skills/flywheel-lookahead/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-prove/SKILL.md +2 -2
- package/skills/flywheel-prove/references/workflow.md +21 -2
- package/skills/flywheel-reproduce/SKILL.md +39 -19
- package/skills/flywheel-reproduce/evals/evals.json +1 -1
- package/skills/flywheel-reproduce/references/INTERFACES.md +2 -2
- package/skills/flywheel-reproduce/references/experiment-design-protocol.md +31 -23
- package/skills/flywheel-reproduce/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-to-graph/SKILL.md +37 -17
- package/skills/flywheel-to-graph/references/INTERFACES.md +2 -2
- package/skills/flywheel-to-graph/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-tree/references/workflow.md +6 -37
- package/src/cli.mjs +1145 -1141
- package/src/mcp-writer.mjs +413 -435
- package/src/public-command-metadata.mjs +28 -5
- package/src/runtime/delegate.mjs +2 -19
- package/src/runtime/required-runtime-commands.json +80 -28
- package/src/runtime/runtime-config.mjs +39 -60
- package/src/runtime/vendor/flywheel-cli-dist/auth/credentials.js +330 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/credentials.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js +90 -139
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/secure-write.js +116 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/secure-write.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js +248 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js +65 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-revoke-api-key.js +17 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-revoke-api-key.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js +3 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-clear.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-clear.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-set.js +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js +46 -10
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js +17 -40
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js +305 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-support.js +72 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-support.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation.js +286 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js +30 -5
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +27 -12
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-commit-replay.js +284 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-commit-replay.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-graph.js +169 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-graph.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-lineage-list.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-lineage-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-repository-snapshot.js +227 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-repository-snapshot.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js +21 -51
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/node-create-schema.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/node-create-schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js +11 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js +38 -45
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js +14 -17
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js +13 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js +34 -3
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js +9 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hosted.js +76 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hosted.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js +4 -138
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js +8 -13
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js +362 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js +45 -183
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-edit.js +47 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-edit.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js +181 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-output.js +163 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-output.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js +79 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js +80 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/retired-command-names.js +78 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/retired-command-names.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js +3 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/config/index.js +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/index.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/io.js +139 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/io.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/migration.js +299 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/migration.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/model.js +214 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/model.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/path.js +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/path.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/credential-output.js +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/credential-output.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/errors.js +1 -16
- package/src/runtime/vendor/flywheel-cli-dist/errors.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.js +3 -3
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js +19 -9
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js +33 -4
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js +322 -304
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js +1 -21
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js +244 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/errors.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/errors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/history.js +35 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/history.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/invariants.js +42 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/invariants.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/artifact-properties.js +179 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/artifact-properties.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/commits.js +152 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/constants.js +71 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/constants.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/encoding.js +73 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/encoding.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/imported-artifact-properties.js +82 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/imported-artifact-properties.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/operations.js +345 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/operations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/tags.js +57 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/tags.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/conflicts.js +149 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/conflicts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/context.js +115 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/context.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/keys.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/keys.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/pull.js +159 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js +346 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/resolve.js +37 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/resolve.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/inverses.js +203 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/inverses.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/plan.js +207 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/plan.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/tag-inverses.js +109 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/tag-inverses.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js +61 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/projection.js +46 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/revert.js +203 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/revert.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js +188 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/cursors.js +54 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/cursors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/local-pull.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/local-pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync-models.js +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync-models.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/native.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/native.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/state.js +129 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/state.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/writer-lock.js +277 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/writer-lock.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/bootstrap.js +183 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/bootstrap.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/context.js +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/context.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js +121 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/doctor.js +16 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/doctor.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/identity.js +72 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/identity.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/conflicts.js +59 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/conflicts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js +125 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/history.js +129 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/history.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js +31 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/maintenance.js +49 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/maintenance.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/shared.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/shared.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/platform.js +18 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/platform.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js +125 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/clone.js +37 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/clone.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/pull.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/purge.js +58 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/purge.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/push.js +118 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/push.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/transport.js +277 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/transport.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js +132 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/archive.js +372 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/archive.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/backup.js +210 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/backup.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/restore.js +278 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/restore.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/retained-directory.js +192 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/retained-directory.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/commits.js +114 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js +65 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics-worker.js +145 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics-worker.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics.js +218 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/gc.js +71 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/gc.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js +298 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js +121 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrate.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/provenance.js +49 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/provenance.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/steps.js +424 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/steps.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/versions.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/versions.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/001_initial.sql +319 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/002_staged_latest_values.sql +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/003_remove_cli_editing_lease.sql +21 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/004_hosted_association.sql +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/005_artifact_properties.sql +68 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/objects.js +410 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/objects.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/apply.js +77 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/apply.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js +240 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/nodes.js +127 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/nodes.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/relations.js +107 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/relations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/rules.js +80 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/rules.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/tags.js +219 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/tags.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/hosted.js +164 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/hosted.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/read.js +20 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/read.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/replace.js +41 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/replace.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/schema.js +22 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/validate.js +188 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/validate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot.js +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/connection.js +214 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/connection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/errors.js +4 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/errors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/rows.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/rows.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/schema.js +38 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js +284 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/verify.js +133 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/verify.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync-commits.js +98 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync-commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js +161 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace-state.js +97 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace-state.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/main.js +651 -376
- package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js +18 -11
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-x64/node.napi.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-arm64/node.napi.glibc.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-arm64/node.napi.musl.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/src/runtime/vendor/manifest.json +246 -257
- package/src/setup/command.mjs +5 -0
- package/src/setup/io/patchers/json.mjs +1 -1
- package/src/setup/io/patchers/toml.mjs +3 -1
- package/src/setup/io/patchers/yaml.mjs +1 -1
- package/src/setup/modes/cli.mjs +76 -7
- package/src/setup/modes/mcp-command.mjs +802 -793
- package/src/setup/modes/mcp.mjs +7 -3
- package/src/setup/shared/prior-mode-detect.mjs +18 -21
- package/src/setup/test-seams.mjs +25 -0
- package/src/setup-auth.mjs +76 -10
- package/src/toml-lines.mjs +52 -0
- package/src/unified-cli.mjs +31 -16
- package/skills/flywheel-llm-proof-paper/scripts/__pycache__/check_paper.cpython-312.pyc +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/active-key-id.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/baseurl.d.ts +0 -35
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.d.ts +0 -34
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js +0 -92
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/fingerprint.d.ts +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js +0 -31
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.d.ts +0 -24
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.d.ts +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js +0 -150
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.d.ts +0 -32
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js +0 -213
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/_browser-handoff.d.ts +0 -35
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/_secret-param.d.ts +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.d.ts +0 -39
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-writer.d.ts +0 -34
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.d.ts +0 -50
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.d.ts +0 -13
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.d.ts +0 -18
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-rotate.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-expire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-heartbeat.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.js +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js +0 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-mode.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/blobs-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-revoke.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-snapshot.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-budgets.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-connection.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-funding.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-options.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-status.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-balance.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral-claim.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscription.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-transactions.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-usage.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/destructive-confirmation.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/enums.d.ts +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-launch.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-terminate.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-pdf.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-render-pdf.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-stream.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/feedback-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/files-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-disconnect.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-refresh-repos.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-status.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/handler-factory.d.ts +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-format.d.ts +0 -31
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.d.ts +0 -36
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.d.ts +0 -17
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/import-subgraph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.d.ts +0 -23
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-remove.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-status.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-remove.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/machines-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js +0 -10
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js +0 -16
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-files.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js +0 -33
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-ancestry.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-summary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-tree.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-get.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-summaries.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-acquire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-heartbeat.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-release.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js +0 -140
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/executions.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/export.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/graph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js +0 -98
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/updates.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-refresh.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-resolve.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js +0 -25
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js +0 -25
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js +0 -28
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.d.ts +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide-all-active.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.d.ts +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/utils.d.ts +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/errors.d.ts +0 -86
- package/src/runtime/vendor/flywheel-cli-dist/exit-codes.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/generatedFeedbackContract.d.ts +0 -41
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.d.ts +0 -13
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.d.ts +0 -26
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.d.ts +0 -17
- package/src/runtime/vendor/flywheel-cli-dist/http/client.d.ts +0 -91
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.d.ts +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/http/poll.d.ts +0 -18
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.d.ts +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/main.d.ts +0 -33
- package/src/runtime/vendor/flywheel-cli-dist/output/format.d.ts +0 -9
- package/src/runtime/vendor/flywheel-cli-dist/runtime-entry.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/version.d.ts +0 -3
- package/src/secure-write.mjs +0 -43
|
@@ -1,27 +1,37 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { randomUUID } from
|
|
3
|
-
import { access, writeFile } from
|
|
4
|
-
import os from
|
|
5
|
-
import { resolve } from
|
|
6
|
-
import { pathToFileURL } from
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { RUNTIME_ALIASES } from
|
|
12
|
-
import { BUILTIN_PROFILE_NAMES, isBuiltinProfileName, resolveBuiltinBaseUrl, } from
|
|
13
|
-
import { renderCommandHelp, renderCommandHelpAsJson, renderHelp, renderHelpAsJson, } from
|
|
14
|
-
import { renderUsageSpec } from
|
|
15
|
-
import { getCommandByName } from
|
|
16
|
-
import { MVP_COMMAND_HANDLERS } from
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
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 { processStdoutIsPipe, writeCredentialStream } from "./credential-output.js";
|
|
8
|
+
import { loadFlywheelConfig, saveFlywheelConfig, FlywheelConfigError, resolveFlywheelConfigPath, } from "./config/index.js";
|
|
9
|
+
import { baseUrlsEqual } from "./auth/baseurl.js";
|
|
10
|
+
import { CredentialStoreError, readCredential, resolveCredentialFilePath, } from "./auth/credentials.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 { renderUsageSpec } from "./commands/usage-spec.js";
|
|
15
|
+
import { getCommandByName } from "./commands/registry.js";
|
|
16
|
+
import { MVP_COMMAND_HANDLERS } from "./commands/index.js";
|
|
17
|
+
import { repositoryLocalOperationNames } from "./commands/repository-operation.js";
|
|
18
|
+
import { repositoryProjectionNames } from "./commands/repository-projection.js";
|
|
19
|
+
import { repositoryEditNames } from "./commands/repository-edit.js";
|
|
20
|
+
import { hostedGraphMutationNames } from "./commands/hosted-graph.js";
|
|
21
|
+
import { NODE_CREATE_SCHEMA } from "./commands/node-create-schema.js";
|
|
22
|
+
import { RETIRED_COMMAND_NAMES } from "./commands/retired-command-names.js";
|
|
23
|
+
import { renderRepositoryHumanOutput } from "./commands/repository-output.js";
|
|
24
|
+
import { RepositorySelectionError, resolveRepositorySelection, shellQuote, } from "./commands/repository-selection.js";
|
|
25
|
+
import { CliApprovalPendingError, CliAuthRequirementError, CliUsageError, CliWaitTimeoutError, } from "./errors.js";
|
|
26
|
+
import { EXIT_TRANSPORT, EXIT_USAGE } from "./exit-codes.js";
|
|
27
|
+
import { extractGlobals, GLOBAL_BOOLEAN_FLAG_NAMES, GLOBAL_FLAG_NAMES } from "./grammar/globals.js";
|
|
28
|
+
import { parseCliArgs } from "./grammar/parse.js";
|
|
29
|
+
import { CliHttpError, createHttpClient, } from "./http/client.js";
|
|
30
|
+
import { maskSensitiveForOutput } from "./http/debug.js";
|
|
31
|
+
import { renderOutput } from "./output/format.js";
|
|
32
|
+
import { CLI_VERSION } from "./version.js";
|
|
33
|
+
import { LocalRepositoryAdapter } from "./local/adapter.js";
|
|
34
|
+
const DEFAULT_BASE_URL = "http://localhost:8000";
|
|
25
35
|
function defaultStdout(chunk) {
|
|
26
36
|
process.stdout.write(chunk);
|
|
27
37
|
}
|
|
@@ -29,140 +39,132 @@ function defaultStderr(chunk) {
|
|
|
29
39
|
process.stderr.write(chunk);
|
|
30
40
|
}
|
|
31
41
|
function writeLine(writer, text) {
|
|
32
|
-
if (text.endsWith(
|
|
42
|
+
if (text.endsWith("\n")) {
|
|
33
43
|
writer(text);
|
|
34
44
|
return;
|
|
35
45
|
}
|
|
36
46
|
writer(`${text}\n`);
|
|
37
47
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
48
|
+
function requestsJsonOutput(argv) {
|
|
49
|
+
return argv.some((token, index) => token === "--format=json" ||
|
|
50
|
+
(token === "--format" && argv[index + 1] === "json"));
|
|
51
|
+
}
|
|
52
|
+
function emitRetiredCommandName(command, argv, stderr) {
|
|
53
|
+
const remediation = RETIRED_COMMAND_NAMES[command];
|
|
54
|
+
if (!remediation)
|
|
55
|
+
return undefined;
|
|
56
|
+
const message = `${command} is retired. Use: ${remediation}`;
|
|
57
|
+
if (requestsJsonOutput(argv)) {
|
|
58
|
+
writeLine(stderr, JSON.stringify({
|
|
59
|
+
error: {
|
|
60
|
+
code: "retired_command_name",
|
|
61
|
+
message,
|
|
62
|
+
remediation,
|
|
63
|
+
exit_code: 1,
|
|
64
|
+
},
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
writeLine(stderr, message);
|
|
69
|
+
}
|
|
70
|
+
return 1;
|
|
71
|
+
}
|
|
46
72
|
function activeBuiltinFromConfig(config) {
|
|
47
|
-
const empty = {
|
|
48
|
-
name: undefined,
|
|
49
|
-
baseUrl: undefined,
|
|
50
|
-
apiKey: undefined,
|
|
51
|
-
};
|
|
52
73
|
const rawName = config.activeProfile;
|
|
53
|
-
if (typeof rawName !==
|
|
54
|
-
|
|
74
|
+
if (typeof rawName !== "string" ||
|
|
75
|
+
!rawName.trim() ||
|
|
76
|
+
!isBuiltinProfileName(rawName.trim())) {
|
|
77
|
+
return { name: undefined, baseUrl: undefined };
|
|
78
|
+
}
|
|
55
79
|
const name = rawName.trim();
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
80
|
+
return { name, baseUrl: resolveBuiltinBaseUrl(name) };
|
|
81
|
+
}
|
|
82
|
+
function assertRepositoryTransportOrigin(baseUrl) {
|
|
83
|
+
let parsed;
|
|
84
|
+
try {
|
|
85
|
+
parsed = new URL(baseUrl);
|
|
86
|
+
}
|
|
87
|
+
catch {
|
|
88
|
+
throw new CliHttpError("repository remotes require HTTPS or loopback HTTP", EXIT_TRANSPORT);
|
|
89
|
+
}
|
|
90
|
+
const loopbackHttp = parsed.protocol === "http:" &&
|
|
91
|
+
["localhost", "127.0.0.1", "[::1]", "::1"].includes(parsed.hostname.toLowerCase());
|
|
92
|
+
if (parsed.protocol === "https:" || loopbackHttp)
|
|
93
|
+
return;
|
|
94
|
+
throw new CliHttpError("repository remotes require HTTPS or loopback HTTP", EXIT_TRANSPORT);
|
|
63
95
|
}
|
|
64
|
-
async function resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey) {
|
|
96
|
+
async function resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey, resolveCredentialFile, credentialLookupEnabled, readStoredCredential, repositoryRemote = false) {
|
|
65
97
|
const envBaseUrl = process.env.FLYWHEEL_BASE_URL?.trim();
|
|
66
|
-
// Resolution order:
|
|
67
|
-
// FLYWHEEL_BASE_URL → --env=<name>'s profile.baseUrl → active built-in
|
|
68
|
-
// profile pointer in config.activeProfile → legacy config.baseUrl →
|
|
69
|
-
// DEFAULT_BASE_URL. Built-in baseUrls are ephemeral constants — they are
|
|
70
|
-
// never written into config.baseUrl, so upstream URL changes flow through
|
|
71
|
-
// automatically.
|
|
72
98
|
const activeBuiltin = activeBuiltinFromConfig(config);
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
if (!apiKey &&
|
|
99
|
+
const activeProfile = typeof config.activeProfile === "string" && config.activeProfile.trim()
|
|
100
|
+
? config.activeProfile.trim()
|
|
101
|
+
: undefined;
|
|
102
|
+
const baseUrl = envBaseUrl || profile?.baseUrl || activeBuiltin.baseUrl || DEFAULT_BASE_URL;
|
|
103
|
+
if (repositoryRemote)
|
|
104
|
+
assertRepositoryTransportOrigin(baseUrl);
|
|
105
|
+
const credentialProfile = profile?.name ?? activeBuiltin.name ?? activeProfile ?? "default";
|
|
106
|
+
const credentialBaseUrl = profile?.baseUrl ?? activeBuiltin.baseUrl ??
|
|
107
|
+
(credentialProfile === "default" ? baseUrl : DEFAULT_BASE_URL);
|
|
108
|
+
const environmentApiKey = process.env.FLYWHEEL_API_KEY?.trim() || undefined;
|
|
109
|
+
if (repositoryRemote &&
|
|
110
|
+
environmentApiKey &&
|
|
111
|
+
(!envBaseUrl || !baseUrlsEqual(baseUrl, envBaseUrl))) {
|
|
112
|
+
throw new CliHttpError("credential_store_unavailable", EXIT_TRANSPORT);
|
|
113
|
+
}
|
|
114
|
+
let apiKey = environmentApiKey;
|
|
115
|
+
if (!apiKey &&
|
|
116
|
+
profile?.apiKeyEnv &&
|
|
117
|
+
profile.baseUrl &&
|
|
118
|
+
baseUrlsEqual(baseUrl, profile.baseUrl)) {
|
|
90
119
|
apiKey = resolveEnvApiKey(profile.apiKeyEnv);
|
|
91
120
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
apiKey = stored;
|
|
96
|
-
}
|
|
121
|
+
let credentialReadiness;
|
|
122
|
+
if (apiKey || !credentialLookupEnabled) {
|
|
123
|
+
credentialReadiness = "not_checked";
|
|
97
124
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
// FLYWHEEL_BASE_URL) doesn't carry the per-profile token to a
|
|
103
|
-
// different origin.
|
|
104
|
-
if (!apiKey &&
|
|
105
|
-
profile !== null &&
|
|
106
|
-
isBuiltinProfileName(profile.name) &&
|
|
107
|
-
baseUrlsEqual(baseUrl, resolveBuiltinBaseUrl(profile.name))) {
|
|
108
|
-
const candidate = config.profileKeys?.[profile.name]?.apiKey;
|
|
109
|
-
if (typeof candidate === 'string' && candidate.trim()) {
|
|
110
|
-
apiKey = candidate;
|
|
111
|
-
}
|
|
125
|
+
else if (baseUrlsEqual(baseUrl, credentialBaseUrl)) {
|
|
126
|
+
const storedCredential = await readStoredCredential(credentialProfile, credentialBaseUrl, resolveCredentialFile());
|
|
127
|
+
credentialReadiness = storedCredential ? "ready" : "missing";
|
|
128
|
+
apiKey = storedCredential ?? undefined;
|
|
112
129
|
}
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
// The legacy flat `config.apiKey` is intentionally left unset under
|
|
119
|
-
// active-profile logins (so the built-in baseUrl never bleeds into
|
|
120
|
-
// config.json); consult it only when no per-profile key is present.
|
|
121
|
-
if (!apiKey &&
|
|
122
|
-
activeBuiltin.apiKey &&
|
|
123
|
-
baseUrlsEqual(baseUrl, activeBuiltin.baseUrl)) {
|
|
124
|
-
apiKey = activeBuiltin.apiKey;
|
|
125
|
-
}
|
|
126
|
-
// The legacy `config.apiKey` belongs to `config.baseUrl` and only to
|
|
127
|
-
// that origin. Every path that resolves `baseUrl` to anything else
|
|
128
|
-
// (built-in profile pointer, `--env=<legacy-profile>`, or
|
|
129
|
-
// `FLYWHEEL_BASE_URL` override) must NOT have the legacy key ride
|
|
130
|
-
// along: that single stored key would otherwise leak across any target
|
|
131
|
-
// origin the user points the CLI at.
|
|
132
|
-
// Canonical equality so `FLYWHEEL_BASE_URL=<config.baseUrl>/` (and
|
|
133
|
-
// other RFC 3986 §6.2.2-equivalent variants) still binds the legacy
|
|
134
|
-
// flat key to its origin instead of being treated as an unrelated
|
|
135
|
-
// host. See `auth/baseurl.ts` for the normalisation rules.
|
|
136
|
-
if (!apiKey && baseUrlsEqual(config.baseUrl, baseUrl)) {
|
|
137
|
-
apiKey = config.apiKey ?? undefined;
|
|
130
|
+
else {
|
|
131
|
+
credentialReadiness = "not_checked";
|
|
132
|
+
}
|
|
133
|
+
if (repositoryRemote && !apiKey) {
|
|
134
|
+
throw new CliHttpError("credential_store_unavailable", EXIT_TRANSPORT);
|
|
138
135
|
}
|
|
139
136
|
return {
|
|
140
137
|
baseUrl,
|
|
138
|
+
credentialBaseUrl: environmentApiKey
|
|
139
|
+
? baseUrl
|
|
140
|
+
: credentialBaseUrl,
|
|
141
141
|
apiKey,
|
|
142
|
+
credentialReadiness,
|
|
142
143
|
defaultFormat: profile?.defaultFormat,
|
|
143
144
|
};
|
|
144
145
|
}
|
|
145
|
-
const HELP_TOKENS = new Set([
|
|
146
|
-
const USAGE_TOKENS = new Set([
|
|
147
|
-
const SCHEMA_TOKEN =
|
|
148
|
-
const HELP_EXTRAS_PREFIX =
|
|
149
|
-
const USAGE_EXTRAS_PREFIX =
|
|
150
|
-
const USAGE_VERSION_PREFIX =
|
|
146
|
+
const HELP_TOKENS = new Set(["--help", "-h"]);
|
|
147
|
+
const USAGE_TOKENS = new Set(["--usage", "--usage-spec"]);
|
|
148
|
+
const SCHEMA_TOKEN = "--schema";
|
|
149
|
+
const HELP_EXTRAS_PREFIX = "--_help_extras=";
|
|
150
|
+
const USAGE_EXTRAS_PREFIX = "--_usage_extras=";
|
|
151
|
+
const USAGE_VERSION_PREFIX = "--_usage_version=";
|
|
151
152
|
const VALID_TOPIC_IDS = new Set([
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
153
|
+
"setup-admin",
|
|
154
|
+
"auth",
|
|
155
|
+
"profile",
|
|
156
|
+
"nodes-graph",
|
|
157
|
+
"repo-workflow",
|
|
158
|
+
"hosted-graph",
|
|
159
|
+
"hooks",
|
|
160
|
+
"compute-executions",
|
|
161
|
+
"approvals-budgets",
|
|
162
|
+
"export-import",
|
|
163
|
+
"updates-resources",
|
|
164
|
+
"account-credits",
|
|
165
|
+
"integrations",
|
|
166
|
+
"api-keys",
|
|
167
|
+
"admin",
|
|
166
168
|
]);
|
|
167
169
|
function parseHelpExtras(argv) {
|
|
168
170
|
let raw;
|
|
@@ -173,79 +175,83 @@ function parseHelpExtras(argv) {
|
|
|
173
175
|
}
|
|
174
176
|
}
|
|
175
177
|
if (raw === undefined)
|
|
176
|
-
return { kind:
|
|
178
|
+
return { kind: "absent" };
|
|
177
179
|
let decoded;
|
|
178
180
|
try {
|
|
179
181
|
decoded = JSON.parse(raw);
|
|
180
182
|
}
|
|
181
183
|
catch {
|
|
182
|
-
return { kind:
|
|
184
|
+
return { kind: "invalid" };
|
|
183
185
|
}
|
|
184
186
|
if (!Array.isArray(decoded))
|
|
185
|
-
return { kind:
|
|
187
|
+
return { kind: "invalid" };
|
|
186
188
|
const extras = [];
|
|
187
189
|
for (const entry of decoded) {
|
|
188
190
|
if (!entry ||
|
|
189
|
-
typeof entry !==
|
|
190
|
-
typeof entry.group !==
|
|
191
|
-
typeof entry.name !==
|
|
192
|
-
typeof entry.summary !==
|
|
193
|
-
return { kind:
|
|
191
|
+
typeof entry !== "object" ||
|
|
192
|
+
typeof entry.group !== "string" ||
|
|
193
|
+
typeof entry.name !== "string" ||
|
|
194
|
+
typeof entry.summary !== "string") {
|
|
195
|
+
return { kind: "invalid" };
|
|
194
196
|
}
|
|
195
197
|
const group = entry.group;
|
|
196
198
|
if (!VALID_TOPIC_IDS.has(group))
|
|
197
|
-
return { kind:
|
|
199
|
+
return { kind: "invalid" };
|
|
198
200
|
extras.push({
|
|
199
201
|
group,
|
|
200
202
|
name: entry.name,
|
|
201
203
|
summary: entry.summary,
|
|
202
204
|
});
|
|
203
205
|
}
|
|
204
|
-
return { kind:
|
|
206
|
+
return { kind: "ok", extras };
|
|
205
207
|
}
|
|
206
208
|
function stripHelpExtras(argv) {
|
|
207
209
|
return argv.filter((t) => !t.startsWith(HELP_EXTRAS_PREFIX));
|
|
208
210
|
}
|
|
209
211
|
function isStringArray(value) {
|
|
210
|
-
return Array.isArray(value) && value.every((entry) => typeof entry ===
|
|
212
|
+
return (Array.isArray(value) && value.every((entry) => typeof entry === "string"));
|
|
211
213
|
}
|
|
212
214
|
function isCommandParamArray(value) {
|
|
213
215
|
return (Array.isArray(value) &&
|
|
214
216
|
value.every((entry) => {
|
|
215
|
-
if (!entry || typeof entry !==
|
|
217
|
+
if (!entry || typeof entry !== "object")
|
|
216
218
|
return false;
|
|
217
219
|
const candidate = entry;
|
|
218
|
-
return (typeof candidate.name ===
|
|
219
|
-
[
|
|
220
|
-
typeof candidate.description ===
|
|
221
|
-
(candidate.default === undefined ||
|
|
220
|
+
return (typeof candidate.name === "string" &&
|
|
221
|
+
["string", "integer", "json", "boolean"].includes(String(candidate.type)) &&
|
|
222
|
+
typeof candidate.description === "string" &&
|
|
223
|
+
(candidate.default === undefined ||
|
|
224
|
+
typeof candidate.default === "string"));
|
|
222
225
|
}));
|
|
223
226
|
}
|
|
224
227
|
function isCommandExampleArray(value) {
|
|
225
228
|
return (Array.isArray(value) &&
|
|
226
229
|
value.every((entry) => {
|
|
227
|
-
if (!entry || typeof entry !==
|
|
230
|
+
if (!entry || typeof entry !== "object")
|
|
228
231
|
return false;
|
|
229
232
|
const candidate = entry;
|
|
230
|
-
return (typeof candidate.description ===
|
|
231
|
-
typeof candidate.invocation ===
|
|
233
|
+
return (typeof candidate.description === "string" &&
|
|
234
|
+
typeof candidate.invocation === "string");
|
|
232
235
|
}));
|
|
233
236
|
}
|
|
234
237
|
function isUsageExtra(value) {
|
|
235
|
-
if (!value || typeof value !==
|
|
238
|
+
if (!value || typeof value !== "object")
|
|
236
239
|
return false;
|
|
237
240
|
const candidate = value;
|
|
238
|
-
return (typeof candidate.name ===
|
|
239
|
-
typeof candidate.group ===
|
|
241
|
+
return (typeof candidate.name === "string" &&
|
|
242
|
+
typeof candidate.group === "string" &&
|
|
240
243
|
VALID_TOPIC_IDS.has(candidate.group) &&
|
|
241
|
-
typeof candidate.summary ===
|
|
244
|
+
typeof candidate.summary === "string" &&
|
|
242
245
|
(candidate.endpoints === undefined || isStringArray(candidate.endpoints)) &&
|
|
243
|
-
(candidate.required === undefined ||
|
|
244
|
-
|
|
245
|
-
(candidate.
|
|
246
|
+
(candidate.required === undefined ||
|
|
247
|
+
isCommandParamArray(candidate.required)) &&
|
|
248
|
+
(candidate.optional === undefined ||
|
|
249
|
+
isCommandParamArray(candidate.optional)) &&
|
|
250
|
+
(candidate.examples === undefined ||
|
|
251
|
+
isCommandExampleArray(candidate.examples)) &&
|
|
246
252
|
(candidate.related === undefined || isStringArray(candidate.related)) &&
|
|
247
|
-
(candidate.schema === undefined || typeof candidate.schema ===
|
|
248
|
-
(candidate.hidden === undefined || typeof candidate.hidden ===
|
|
253
|
+
(candidate.schema === undefined || typeof candidate.schema === "string") &&
|
|
254
|
+
(candidate.hidden === undefined || typeof candidate.hidden === "boolean"));
|
|
249
255
|
}
|
|
250
256
|
function parseUsageExtras(argv) {
|
|
251
257
|
const rawValues = argv
|
|
@@ -255,15 +261,15 @@ function parseUsageExtras(argv) {
|
|
|
255
261
|
.filter((token) => token.startsWith(USAGE_VERSION_PREFIX))
|
|
256
262
|
.map((token) => token.slice(USAGE_VERSION_PREFIX.length));
|
|
257
263
|
if (rawValues.length === 0 && rawVersionValues.length === 0) {
|
|
258
|
-
return { kind:
|
|
264
|
+
return { kind: "ok", extras: [] };
|
|
259
265
|
}
|
|
260
266
|
if (rawValues.length > 1)
|
|
261
|
-
return { kind:
|
|
267
|
+
return { kind: "invalid" };
|
|
262
268
|
if (rawVersionValues.length > 1)
|
|
263
|
-
return { kind:
|
|
269
|
+
return { kind: "invalid" };
|
|
264
270
|
const version = rawVersionValues[0];
|
|
265
|
-
if (version !== undefined && version.trim() ===
|
|
266
|
-
return { kind:
|
|
271
|
+
if (version !== undefined && version.trim() === "")
|
|
272
|
+
return { kind: "invalid" };
|
|
267
273
|
let extras = [];
|
|
268
274
|
if (rawValues.length === 1) {
|
|
269
275
|
let decoded;
|
|
@@ -271,45 +277,60 @@ function parseUsageExtras(argv) {
|
|
|
271
277
|
decoded = JSON.parse(rawValues[0]);
|
|
272
278
|
}
|
|
273
279
|
catch {
|
|
274
|
-
return { kind:
|
|
280
|
+
return { kind: "invalid" };
|
|
275
281
|
}
|
|
276
282
|
if (!Array.isArray(decoded) || !decoded.every(isUsageExtra)) {
|
|
277
|
-
return { kind:
|
|
283
|
+
return { kind: "invalid" };
|
|
278
284
|
}
|
|
279
285
|
extras = decoded;
|
|
280
286
|
}
|
|
281
|
-
return { kind:
|
|
287
|
+
return { kind: "ok", extras, version };
|
|
282
288
|
}
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
289
|
+
const LOCAL_REPOSITORY_REMOTE_COMMANDS = [
|
|
290
|
+
"repo:clone",
|
|
291
|
+
"repo:pull",
|
|
292
|
+
"repo:push",
|
|
293
|
+
"repo:purge",
|
|
294
|
+
];
|
|
295
|
+
const LOCAL_REPOSITORY_OFFLINE_COMMANDS = [
|
|
296
|
+
...repositoryLocalOperationNames.filter((command) => !LOCAL_REPOSITORY_REMOTE_COMMANDS.includes(command)),
|
|
297
|
+
...repositoryProjectionNames,
|
|
298
|
+
...repositoryEditNames,
|
|
299
|
+
];
|
|
300
|
+
// Offline repository commands do not need credential resolution. Remote
|
|
301
|
+
// repository operations use the ordinary CLI HTTP client as their auth boundary.
|
|
302
|
+
const CREDENTIAL_LOOKUP_SKIPPED_COMMANDS = [
|
|
303
|
+
"profile:list",
|
|
304
|
+
"profile:show",
|
|
305
|
+
"profile:set",
|
|
306
|
+
"profile:unset",
|
|
307
|
+
"auth:login",
|
|
308
|
+
"auth:credentials:set",
|
|
309
|
+
"auth:credentials:clear",
|
|
310
|
+
"env:list",
|
|
311
|
+
"env:switch",
|
|
312
|
+
...LOCAL_REPOSITORY_OFFLINE_COMMANDS,
|
|
313
|
+
];
|
|
314
|
+
// Commands that can recover or inspect configuration without requiring the
|
|
315
|
+
// runtime config file. auth:status still resolves the selected credential.
|
|
316
|
+
const RUNTIME_CONFIG_OPTIONAL_COMMANDS = [
|
|
317
|
+
...CREDENTIAL_LOOKUP_SKIPPED_COMMANDS,
|
|
318
|
+
"auth:status",
|
|
319
|
+
];
|
|
299
320
|
const API_KEY_BOUND_BROWSER_AND_INTEGRATION_COMMANDS = new Set([
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
321
|
+
"credits:purchase",
|
|
322
|
+
"credits:subscribe",
|
|
323
|
+
"credits:billing-portal",
|
|
324
|
+
"github:link",
|
|
325
|
+
"github:refresh-repos",
|
|
326
|
+
"github:disconnect",
|
|
327
|
+
"integrations:wandb:set",
|
|
328
|
+
"integrations:wandb:remove",
|
|
329
|
+
"integrations:huggingface:set",
|
|
330
|
+
"integrations:huggingface:remove",
|
|
310
331
|
]);
|
|
311
|
-
const RAW_API_KEY_ALLOWLIST_DETAIL =
|
|
312
|
-
const CLI_API_KEY_BOUND_ALLOWLIST_DETAIL =
|
|
332
|
+
const RAW_API_KEY_ALLOWLIST_DETAIL = "API key authentication is not allowed on this endpoint";
|
|
333
|
+
const CLI_API_KEY_BOUND_ALLOWLIST_DETAIL = "API-key access is unavailable for this command. Update the server API-key route allowlist for this endpoint.";
|
|
313
334
|
function isHelpToken(token) {
|
|
314
335
|
return HELP_TOKENS.has(token);
|
|
315
336
|
}
|
|
@@ -327,7 +348,7 @@ function rewriteAlias(argv) {
|
|
|
327
348
|
if (argv.length === 0)
|
|
328
349
|
return argv;
|
|
329
350
|
const head = argv[0];
|
|
330
|
-
if (head ===
|
|
351
|
+
if (head === "help" || head === "--help" || head === "-h")
|
|
331
352
|
return argv;
|
|
332
353
|
if (!Object.prototype.hasOwnProperty.call(RUNTIME_ALIASES, head))
|
|
333
354
|
return argv;
|
|
@@ -335,24 +356,24 @@ function rewriteAlias(argv) {
|
|
|
335
356
|
return [canonical, ...argv.slice(1)];
|
|
336
357
|
}
|
|
337
358
|
function parseHelpFormat(argv) {
|
|
338
|
-
let result = { kind:
|
|
359
|
+
let result = { kind: "absent" };
|
|
339
360
|
for (let i = 0; i < argv.length; i += 1) {
|
|
340
361
|
const token = argv[i];
|
|
341
362
|
let value;
|
|
342
|
-
if (token.startsWith(
|
|
343
|
-
value = token.slice(
|
|
363
|
+
if (token.startsWith("--format=")) {
|
|
364
|
+
value = token.slice("--format=".length);
|
|
344
365
|
}
|
|
345
|
-
else if (token ===
|
|
366
|
+
else if (token === "--format") {
|
|
346
367
|
value = argv[i + 1];
|
|
347
368
|
}
|
|
348
369
|
else {
|
|
349
370
|
continue;
|
|
350
371
|
}
|
|
351
|
-
if (value ===
|
|
352
|
-
result = { kind:
|
|
372
|
+
if (value === "json") {
|
|
373
|
+
result = { kind: "json" };
|
|
353
374
|
}
|
|
354
375
|
else {
|
|
355
|
-
return { kind:
|
|
376
|
+
return { kind: "invalid", value: value ?? "" };
|
|
356
377
|
}
|
|
357
378
|
}
|
|
358
379
|
return result;
|
|
@@ -368,9 +389,9 @@ function stripFormatTokens(argv) {
|
|
|
368
389
|
const out = [];
|
|
369
390
|
for (let i = 0; i < argv.length; i += 1) {
|
|
370
391
|
const token = argv[i];
|
|
371
|
-
if (token.startsWith(
|
|
392
|
+
if (token.startsWith("--format="))
|
|
372
393
|
continue;
|
|
373
|
-
if (token ===
|
|
394
|
+
if (token === "--format") {
|
|
374
395
|
i += 1; // skip the value
|
|
375
396
|
continue;
|
|
376
397
|
}
|
|
@@ -387,7 +408,7 @@ function normalizeCommandHelpArgs(argv) {
|
|
|
387
408
|
schema = true;
|
|
388
409
|
continue;
|
|
389
410
|
}
|
|
390
|
-
if (token ===
|
|
411
|
+
if (token === "--aliases" || token === "-a") {
|
|
391
412
|
aliases = true;
|
|
392
413
|
continue;
|
|
393
414
|
}
|
|
@@ -398,7 +419,7 @@ function normalizeCommandHelpArgs(argv) {
|
|
|
398
419
|
function renderAliasesHelp() {
|
|
399
420
|
return `${Object.entries(RUNTIME_ALIASES)
|
|
400
421
|
.map(([aliasCommand, canonicalCommand]) => ` ${aliasCommand} → ${canonicalCommand}`)
|
|
401
|
-
.join(
|
|
422
|
+
.join("\n")}\n`;
|
|
402
423
|
}
|
|
403
424
|
function emitCommandHelp(stdout, stderr, commandName, schema, asJson) {
|
|
404
425
|
if (asJson) {
|
|
@@ -412,7 +433,7 @@ function emitCommandHelp(stdout, stderr, commandName, schema, asJson) {
|
|
|
412
433
|
return 0;
|
|
413
434
|
}
|
|
414
435
|
const helpText = renderCommandHelp(commandName, { schema });
|
|
415
|
-
if (helpText.startsWith(
|
|
436
|
+
if (helpText.startsWith("unknown command:")) {
|
|
416
437
|
writeLine(stderr, helpText.trim());
|
|
417
438
|
return 1;
|
|
418
439
|
}
|
|
@@ -426,91 +447,95 @@ function buildMissingParamHint(commandName, message) {
|
|
|
426
447
|
}
|
|
427
448
|
const lines = [message];
|
|
428
449
|
if (command.required.length > 0) {
|
|
429
|
-
lines.push(
|
|
450
|
+
lines.push("Required:");
|
|
430
451
|
for (const param of command.required) {
|
|
431
|
-
const typeHint = param.type ===
|
|
452
|
+
const typeHint = param.type === "boolean" ? "" : ` <${param.type}>`;
|
|
432
453
|
lines.push(` --${param.name}${typeHint} ${param.description}`);
|
|
433
454
|
}
|
|
434
455
|
}
|
|
435
456
|
if (command.examples.length > 0) {
|
|
436
|
-
lines.push(
|
|
457
|
+
lines.push("Example:");
|
|
437
458
|
lines.push(` ${command.examples[0].invocation}`);
|
|
438
459
|
}
|
|
439
|
-
return lines.join(
|
|
460
|
+
return lines.join("\n");
|
|
461
|
+
}
|
|
462
|
+
function bindCommandPositionals(commandName, positionals, params) {
|
|
463
|
+
const command = getCommandByName(commandName);
|
|
464
|
+
const definitions = command?.positionals ?? [];
|
|
465
|
+
for (const [index, definition] of definitions.entries()) {
|
|
466
|
+
const value = positionals[index];
|
|
467
|
+
if (value === undefined) {
|
|
468
|
+
if (command?.required.some((param) => param.name === definition.name)) {
|
|
469
|
+
throw new CliUsageError(`missing positional argument: ${definition.name}`);
|
|
470
|
+
}
|
|
471
|
+
continue;
|
|
472
|
+
}
|
|
473
|
+
if (params[definition.name] !== undefined) {
|
|
474
|
+
throw new CliUsageError(`duplicate argument: ${definition.name}`);
|
|
475
|
+
}
|
|
476
|
+
params[definition.name] = value;
|
|
477
|
+
}
|
|
440
478
|
}
|
|
441
479
|
function validateCommandSpecificFlags(commandName, params) {
|
|
442
480
|
const command = getCommandByName(commandName);
|
|
443
481
|
if (!command) {
|
|
444
482
|
return;
|
|
445
483
|
}
|
|
446
|
-
const
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
484
|
+
const positionals = new Set((command.positionals ?? []).map((param) => param.name));
|
|
485
|
+
const allowed = new Map([...command.required, ...command.optional]
|
|
486
|
+
.filter((param) => !positionals.has(param.name))
|
|
487
|
+
.map((param) => [param.name, param]));
|
|
450
488
|
for (const flagName of Object.keys(params)) {
|
|
451
489
|
if (GLOBAL_FLAG_NAMES.has(flagName)) {
|
|
452
490
|
continue;
|
|
453
491
|
}
|
|
454
|
-
|
|
492
|
+
const definition = allowed.get(flagName);
|
|
493
|
+
if (!definition) {
|
|
455
494
|
throw new CliUsageError(`unknown flag for ${commandName}: --${flagName}`);
|
|
456
495
|
}
|
|
496
|
+
if (definition.type !== "boolean" && typeof params[flagName] !== "string") {
|
|
497
|
+
throw new CliUsageError(`missing value for --${flagName}`);
|
|
498
|
+
}
|
|
457
499
|
}
|
|
458
500
|
}
|
|
459
|
-
function buildCommitSchemaHint(commandName, message) {
|
|
460
|
-
const command = getCommandByName(commandName);
|
|
461
|
-
if (!command?.schema) {
|
|
462
|
-
return message;
|
|
463
|
-
}
|
|
464
|
-
const lines = [message];
|
|
465
|
-
lines.push(`hint: payload rejected by server. Run \`flywheel help ${commandName} --schema\` to see the required JSON shape.`);
|
|
466
|
-
lines.push('Required payload keys (see schema for full shape):');
|
|
467
|
-
const keyMatches = command.schema.match(/^\s*"([^"]+)"\s*:/gm) ?? [];
|
|
468
|
-
const topLevelKeys = Array.from(new Set(keyMatches
|
|
469
|
-
.map((line) => line.match(/"([^"]+)"/)?.[1])
|
|
470
|
-
.filter((key) => Boolean(key)))).slice(0, 6);
|
|
471
|
-
for (const key of topLevelKeys) {
|
|
472
|
-
lines.push(` ${key}`);
|
|
473
|
-
}
|
|
474
|
-
return lines.join('\n');
|
|
475
|
-
}
|
|
476
501
|
function buildLocalhostTransportHint(message, baseUrl) {
|
|
477
|
-
if (!message.includes(
|
|
502
|
+
if (!message.includes("transport error")) {
|
|
478
503
|
return message;
|
|
479
504
|
}
|
|
480
|
-
const normalizedBase = baseUrl.replace(/\/+$/,
|
|
481
|
-
if (normalizedBase !== DEFAULT_BASE_URL.replace(/\/+$/,
|
|
505
|
+
const normalizedBase = baseUrl.replace(/\/+$/, "");
|
|
506
|
+
if (normalizedBase !== DEFAULT_BASE_URL.replace(/\/+$/, "")) {
|
|
482
507
|
return message;
|
|
483
508
|
}
|
|
484
509
|
const lines = [message];
|
|
485
510
|
lines.push(`hint: runtime is pointing at the default localhost fallback (${DEFAULT_BASE_URL}).`);
|
|
486
|
-
// Only --mode cli provisions ~/.config/flywheel
|
|
511
|
+
// Only --mode cli provisions ~/.config/flywheel/config.toml; --mode mcp
|
|
487
512
|
// writes host MCP entries and cannot fix a stale runtime base URL, so do not
|
|
488
513
|
// offer it as an alternative here.
|
|
489
|
-
lines.push(
|
|
490
|
-
return lines.join(
|
|
514
|
+
lines.push(" Run `npx --yes @paradigma-inc/flywheel setup --mode cli` to configure Flywheel.");
|
|
515
|
+
return lines.join("\n");
|
|
491
516
|
}
|
|
492
517
|
function looksLikeNodeSlug(value) {
|
|
493
518
|
return /^[a-z][a-z0-9]*-[a-z][a-z0-9]*-\d{4}$/.test(value);
|
|
494
519
|
}
|
|
495
520
|
function buildNodeSlugMissHint(args) {
|
|
496
521
|
const { commandName, status, params, message } = args;
|
|
497
|
-
if (commandName !==
|
|
522
|
+
if (commandName !== "hosted:node:get" || status !== 404) {
|
|
498
523
|
return message;
|
|
499
524
|
}
|
|
500
525
|
const nodeId = params.node_id;
|
|
501
|
-
if (typeof nodeId !==
|
|
526
|
+
if (typeof nodeId !== "string" || !looksLikeNodeSlug(nodeId.trim())) {
|
|
502
527
|
return message;
|
|
503
528
|
}
|
|
504
529
|
return [
|
|
505
530
|
message,
|
|
506
531
|
`hint: node_id looks like a slug. Use \`flywheel nodes:resolve-slug --slug_name ${nodeId.trim()}\` to resolve it.`,
|
|
507
|
-
].join(
|
|
532
|
+
].join("\n");
|
|
508
533
|
}
|
|
509
534
|
function formatConfigPathForMessage(configPath) {
|
|
510
535
|
const homeDir = os.homedir();
|
|
511
536
|
const withSlash = `${homeDir}/`;
|
|
512
537
|
if (configPath === homeDir) {
|
|
513
|
-
return
|
|
538
|
+
return "~";
|
|
514
539
|
}
|
|
515
540
|
if (configPath.startsWith(withSlash)) {
|
|
516
541
|
return `~/${configPath.slice(withSlash.length)}`;
|
|
@@ -519,23 +544,23 @@ function formatConfigPathForMessage(configPath) {
|
|
|
519
544
|
}
|
|
520
545
|
function buildMissingRuntimeConfigMessage(configPath) {
|
|
521
546
|
const displayPath = formatConfigPathForMessage(configPath);
|
|
522
|
-
// Only --mode cli writes ~/.config/flywheel
|
|
547
|
+
// Only --mode cli writes ~/.config/flywheel/config.toml. Pointing at
|
|
523
548
|
// --mode mcp as a fix would loop users back to this same error because MCP
|
|
524
549
|
// setup only touches host MCP entries, not the runtime CLI config.
|
|
525
550
|
return `Flywheel CLI runtime config not found at ${displayPath}. Run \`npx --yes @paradigma-inc/flywheel setup --mode cli\` to configure Flywheel.`;
|
|
526
551
|
}
|
|
527
552
|
function isPolicyBlockedResponseBody(body) {
|
|
528
|
-
if (!body || typeof body !==
|
|
553
|
+
if (!body || typeof body !== "object") {
|
|
529
554
|
return false;
|
|
530
555
|
}
|
|
531
556
|
const detail = body.detail;
|
|
532
|
-
if (!detail || typeof detail !==
|
|
557
|
+
if (!detail || typeof detail !== "object") {
|
|
533
558
|
return false;
|
|
534
559
|
}
|
|
535
|
-
return detail.type ===
|
|
560
|
+
return detail.type === "policy_blocked";
|
|
536
561
|
}
|
|
537
562
|
function isRawApiKeyAllowlistResponseBody(body) {
|
|
538
|
-
if (!body || typeof body !==
|
|
563
|
+
if (!body || typeof body !== "object") {
|
|
539
564
|
return false;
|
|
540
565
|
}
|
|
541
566
|
return body.detail === RAW_API_KEY_ALLOWLIST_DETAIL;
|
|
@@ -595,18 +620,22 @@ async function defaultConfigExists(filePath) {
|
|
|
595
620
|
}
|
|
596
621
|
}
|
|
597
622
|
export async function runCli(argv, dependencies = {}) {
|
|
623
|
+
const credentialMode = argv[0] === "admin:test-users:login" &&
|
|
624
|
+
argv.some((arg) => /^--(?:headless|credential-stdout)(?:=|$)/.test(arg));
|
|
598
625
|
const stdout = dependencies.stdout ?? defaultStdout;
|
|
599
626
|
const stderr = dependencies.stderr ?? defaultStderr;
|
|
627
|
+
const credentialOutput = credentialMode && !dependencies.stdout && processStdoutIsPipe()
|
|
628
|
+
? "pipe" : undefined;
|
|
600
629
|
if (argv.length === 0) {
|
|
601
|
-
writeLine(stderr,
|
|
630
|
+
writeLine(stderr, "usage: flywheel <command> [options]");
|
|
602
631
|
return EXIT_USAGE;
|
|
603
632
|
}
|
|
604
633
|
argv = rewriteAlias(argv);
|
|
605
634
|
const [first, ...rest] = argv;
|
|
606
635
|
if (USAGE_TOKENS.has(first)) {
|
|
607
636
|
const extrasParsed = parseUsageExtras(argv);
|
|
608
|
-
if (extrasParsed.kind ===
|
|
609
|
-
writeLine(stderr,
|
|
637
|
+
if (extrasParsed.kind === "invalid") {
|
|
638
|
+
writeLine(stderr, "invalid --_usage_extras payload");
|
|
610
639
|
return EXIT_USAGE;
|
|
611
640
|
}
|
|
612
641
|
stdout(renderUsageSpec({
|
|
@@ -619,21 +648,21 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
619
648
|
token.startsWith(USAGE_VERSION_PREFIX));
|
|
620
649
|
if (usagePrivateFlag !== undefined) {
|
|
621
650
|
writeLine(stderr, usagePrivateFlag.startsWith(USAGE_VERSION_PREFIX)
|
|
622
|
-
?
|
|
623
|
-
:
|
|
651
|
+
? "unknown flag: --_usage_version"
|
|
652
|
+
: "unknown flag: --_usage_extras");
|
|
624
653
|
return EXIT_USAGE;
|
|
625
654
|
}
|
|
626
655
|
// Help-format validation intentionally runs only inside the help branches
|
|
627
656
|
// below. Non-help commands let `parseCliArgs` validate --format against the
|
|
628
657
|
// full json|tsv|csv|table set; validating here would reject legitimate
|
|
629
|
-
// runtime formats like `flywheel
|
|
658
|
+
// runtime formats like `flywheel hosted:node:list --format=csv`.
|
|
630
659
|
function resolveHelpFormat() {
|
|
631
660
|
const fmt = parseHelpFormat(argv);
|
|
632
|
-
if (fmt.kind ===
|
|
661
|
+
if (fmt.kind === "invalid") {
|
|
633
662
|
writeLine(stderr, `invalid --format=${fmt.value}: help supports --format=json or no --format (text)`);
|
|
634
663
|
return EXIT_USAGE;
|
|
635
664
|
}
|
|
636
|
-
return { json: fmt.kind ===
|
|
665
|
+
return { json: fmt.kind === "json" };
|
|
637
666
|
}
|
|
638
667
|
// Top-level help / `help ...` dispatcher runs BEFORE parseCliArgs because
|
|
639
668
|
// `flywheel --help` and `flywheel help ...` aren't valid command tokens —
|
|
@@ -644,31 +673,31 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
644
673
|
// does not incorrectly drop into help mode on the `-h` value token.
|
|
645
674
|
if (isHelpToken(first)) {
|
|
646
675
|
const resolved = resolveHelpFormat();
|
|
647
|
-
if (typeof resolved ===
|
|
676
|
+
if (typeof resolved === "number")
|
|
648
677
|
return resolved;
|
|
649
678
|
const extrasParsed = parseHelpExtras(argv);
|
|
650
|
-
if (extrasParsed.kind ===
|
|
651
|
-
writeLine(stderr,
|
|
679
|
+
if (extrasParsed.kind === "invalid") {
|
|
680
|
+
writeLine(stderr, "invalid --_help_extras payload");
|
|
652
681
|
return EXIT_USAGE;
|
|
653
682
|
}
|
|
654
|
-
const extras = extrasParsed.kind ===
|
|
683
|
+
const extras = extrasParsed.kind === "ok" ? extrasParsed.extras : [];
|
|
655
684
|
stdout(resolved.json ? renderHelpAsJson(extras) : renderHelp(extras));
|
|
656
685
|
return 0;
|
|
657
686
|
}
|
|
658
|
-
if (first ===
|
|
687
|
+
if (first === "help") {
|
|
659
688
|
const resolved = resolveHelpFormat();
|
|
660
|
-
if (typeof resolved ===
|
|
689
|
+
if (typeof resolved === "number")
|
|
661
690
|
return resolved;
|
|
662
691
|
// Strip --format and --_help_extras tokens so the positional <command>
|
|
663
692
|
// lookup isn't fooled by them occupying rest[0].
|
|
664
|
-
const { commandArgs: helpArgs, schema, aliases } = normalizeCommandHelpArgs(stripHelpExtras(stripFormatTokens(rest)));
|
|
693
|
+
const { commandArgs: helpArgs, schema, aliases, } = normalizeCommandHelpArgs(stripHelpExtras(stripFormatTokens(rest)));
|
|
665
694
|
const extrasParsed = parseHelpExtras(argv);
|
|
666
|
-
if (extrasParsed.kind ===
|
|
667
|
-
writeLine(stderr,
|
|
695
|
+
if (extrasParsed.kind === "invalid") {
|
|
696
|
+
writeLine(stderr, "invalid --_help_extras payload");
|
|
668
697
|
return EXIT_USAGE;
|
|
669
698
|
}
|
|
670
699
|
if (schema && helpArgs.length === 0) {
|
|
671
|
-
writeLine(stderr,
|
|
700
|
+
writeLine(stderr, "--schema requires a command name");
|
|
672
701
|
return EXIT_USAGE;
|
|
673
702
|
}
|
|
674
703
|
if (aliases) {
|
|
@@ -676,14 +705,14 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
676
705
|
return 0;
|
|
677
706
|
}
|
|
678
707
|
if (helpArgs.length === 0) {
|
|
679
|
-
const extras = extrasParsed.kind ===
|
|
708
|
+
const extras = extrasParsed.kind === "ok" ? extrasParsed.extras : [];
|
|
680
709
|
stdout(resolved.json ? renderHelpAsJson(extras) : renderHelp(extras));
|
|
681
710
|
return 0;
|
|
682
711
|
}
|
|
683
712
|
// --_help_extras is only valid on top-level help. Surface mis-use
|
|
684
713
|
// as a usage error rather than silently ignoring it.
|
|
685
|
-
if (extrasParsed.kind ===
|
|
686
|
-
writeLine(stderr,
|
|
714
|
+
if (extrasParsed.kind === "ok") {
|
|
715
|
+
writeLine(stderr, "unknown flag: --_help_extras");
|
|
687
716
|
return EXIT_USAGE;
|
|
688
717
|
}
|
|
689
718
|
// `help <alias>` must resolve the same alias map used by the SHORTCUTS
|
|
@@ -692,16 +721,35 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
692
721
|
const commandName = Object.prototype.hasOwnProperty.call(RUNTIME_ALIASES, rawCommandName)
|
|
693
722
|
? RUNTIME_ALIASES[rawCommandName]
|
|
694
723
|
: rawCommandName;
|
|
724
|
+
const retiredExitCode = emitRetiredCommandName(commandName, argv, stderr);
|
|
725
|
+
if (retiredExitCode !== undefined)
|
|
726
|
+
return retiredExitCode;
|
|
695
727
|
return emitCommandHelp(stdout, stderr, commandName, schema, resolved.json);
|
|
696
728
|
}
|
|
697
729
|
// --_help_extras is reserved for top-level help dispatch only. Reject it
|
|
698
730
|
// when seen on any other command path so it cannot leak into runtime
|
|
699
731
|
// argument parsing downstream.
|
|
700
732
|
if (argv.some((t) => t.startsWith(HELP_EXTRAS_PREFIX))) {
|
|
701
|
-
writeLine(stderr,
|
|
733
|
+
writeLine(stderr, "unknown flag: --_help_extras");
|
|
702
734
|
return EXIT_USAGE;
|
|
703
735
|
}
|
|
704
|
-
const
|
|
736
|
+
const retiredExitCode = emitRetiredCommandName(argv[0] ?? "", argv, stderr);
|
|
737
|
+
if (retiredExitCode !== undefined)
|
|
738
|
+
return retiredExitCode;
|
|
739
|
+
const commandDefinition = getCommandByName(argv[0] ?? "");
|
|
740
|
+
const positionalLimit = commandDefinition?.positionals?.length ?? 0;
|
|
741
|
+
const booleanFlags = [...GLOBAL_BOOLEAN_FLAG_NAMES];
|
|
742
|
+
if (commandDefinition) {
|
|
743
|
+
for (const parameter of commandDefinition.required) {
|
|
744
|
+
if (parameter.type === "boolean")
|
|
745
|
+
booleanFlags.push(parameter.name);
|
|
746
|
+
}
|
|
747
|
+
for (const parameter of commandDefinition.optional) {
|
|
748
|
+
if (parameter.type === "boolean")
|
|
749
|
+
booleanFlags.push(parameter.name);
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
const parsed = parseCliArgs(argv, positionalLimit, booleanFlags);
|
|
705
753
|
if (!parsed.ok) {
|
|
706
754
|
writeLine(stderr, parsed.message);
|
|
707
755
|
return parsed.exitCode;
|
|
@@ -714,49 +762,85 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
714
762
|
const schemaRequested = parsed.params.schema === true;
|
|
715
763
|
if (helpRequested) {
|
|
716
764
|
const resolved = resolveHelpFormat();
|
|
717
|
-
if (typeof resolved ===
|
|
765
|
+
if (typeof resolved === "number")
|
|
718
766
|
return resolved;
|
|
719
767
|
return emitCommandHelp(stdout, stderr, parsed.command, schemaRequested, resolved.json);
|
|
720
768
|
}
|
|
721
|
-
if (schemaRequested) {
|
|
722
|
-
writeLine(stderr,
|
|
769
|
+
if (schemaRequested && parsed.command !== "repo:node:create") {
|
|
770
|
+
writeLine(stderr, "--schema is only valid with --help");
|
|
723
771
|
return 1;
|
|
724
772
|
}
|
|
725
773
|
if (!getCommandByName(parsed.command)) {
|
|
726
774
|
writeLine(stderr, `unknown command: ${parsed.command}`);
|
|
727
775
|
return 1;
|
|
728
776
|
}
|
|
777
|
+
const commandName = parsed.command;
|
|
729
778
|
const handler = MVP_COMMAND_HANDLERS[parsed.command];
|
|
730
779
|
if (!handler) {
|
|
731
780
|
writeLine(stderr, `unknown command: ${parsed.command}`);
|
|
732
781
|
return 1;
|
|
733
782
|
}
|
|
734
|
-
const
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
const
|
|
738
|
-
const
|
|
739
|
-
const profileLoader = dependencies.loadProfile ?? loadProfile;
|
|
740
|
-
const resolveEnvApiKey = dependencies.resolveEnvApiKey ??
|
|
741
|
-
((envVar) => process.env[envVar]?.trim() || undefined);
|
|
783
|
+
const localRepositoryCommand = repositoryLocalOperationNames.includes(commandName) ||
|
|
784
|
+
repositoryProjectionNames.includes(commandName) ||
|
|
785
|
+
repositoryEditNames.includes(commandName);
|
|
786
|
+
const localRepositoryRemoteCommand = LOCAL_REPOSITORY_REMOTE_COMMANDS.includes(commandName);
|
|
787
|
+
const humanGraphCommand = localRepositoryCommand || hostedGraphMutationNames.includes(commandName);
|
|
742
788
|
const writeOutputFile = dependencies.writeOutputFile ??
|
|
743
789
|
(async (path, contents) => {
|
|
744
790
|
await writeFile(path, contents);
|
|
745
791
|
});
|
|
746
792
|
let effectiveBaseUrl = DEFAULT_BASE_URL;
|
|
747
793
|
let globals = {};
|
|
794
|
+
let repositorySelection;
|
|
795
|
+
let repositoryInitPersonal = false;
|
|
796
|
+
const nodeCreateSchemaRequested = parsed.command === "repo:node:create" && parsed.params.schema === true;
|
|
797
|
+
let missingCredentialRemediation;
|
|
748
798
|
try {
|
|
749
799
|
validateCommandSpecificFlags(commandName, parsed.params);
|
|
800
|
+
bindCommandPositionals(commandName, parsed.positionals, parsed.params);
|
|
750
801
|
const extracted = extractGlobals(parsed.params);
|
|
751
|
-
globals = {
|
|
802
|
+
globals = {
|
|
803
|
+
...extracted.globals,
|
|
804
|
+
format: extracted.globals.format ?? parsed.format,
|
|
805
|
+
formatExplicit: parsed.formatExplicit || extracted.globals.formatExplicit,
|
|
806
|
+
};
|
|
752
807
|
const { handlerParams, flagNames } = extracted;
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
808
|
+
if (nodeCreateSchemaRequested) {
|
|
809
|
+
if (Object.keys(handlerParams).some((name) => name !== "schema")) {
|
|
810
|
+
throw new CliUsageError("--schema cannot be combined with node authoring flags");
|
|
811
|
+
}
|
|
812
|
+
const rendered = renderOutput(NODE_CREATE_SCHEMA, globals.format ?? parsed.format);
|
|
813
|
+
if (globals.outPath && globals.outPath !== "-") {
|
|
814
|
+
await writeOutputFile(globals.outPath, rendered);
|
|
815
|
+
}
|
|
816
|
+
else {
|
|
817
|
+
stdout(rendered);
|
|
818
|
+
}
|
|
819
|
+
return 0;
|
|
820
|
+
}
|
|
821
|
+
const configPath = dependencies.configPath ??
|
|
822
|
+
(dependencies.resolveConfigPath ?? resolveFlywheelConfigPath)();
|
|
823
|
+
const loadConfig = dependencies.loadConfig ??
|
|
824
|
+
(dependencies.configPath
|
|
825
|
+
? (filePath) => loadFlywheelConfig({
|
|
826
|
+
env: { ...process.env, FLYWHEEL_CLI_CONFIG_PATH: filePath },
|
|
827
|
+
})
|
|
828
|
+
: async () => loadFlywheelConfig());
|
|
829
|
+
const configExists = dependencies.configExists ?? defaultConfigExists;
|
|
830
|
+
const saveConfig = dependencies.saveConfig ??
|
|
831
|
+
(async (filePath, config) => saveFlywheelConfig(config, filePath));
|
|
832
|
+
const resolveEnvApiKey = dependencies.resolveEnvApiKey ??
|
|
833
|
+
((envVar) => process.env[envVar]?.trim() || undefined);
|
|
834
|
+
const config = await loadConfig(configPath);
|
|
835
|
+
const runtimeConfigExists = dependencies.loadConfig === undefined
|
|
836
|
+
? await configExists(configPath)
|
|
837
|
+
: true;
|
|
838
|
+
// `--env=<name>` accepts a unified TOML profile or a built-in profile name
|
|
839
|
+
// (prod / staging). Built-ins synthesise a minimal Profile so the rest of
|
|
840
|
+
// the pipeline (base URL resolution and per-profile keychain lookups) treats
|
|
841
|
+
// them uniformly. The built-in base URL is the runtime source of truth
|
|
842
|
+
// (never written to config.toml); `--env=<builtin>` selects it for one call
|
|
843
|
+
// without mutating disk state.
|
|
760
844
|
let profile = null;
|
|
761
845
|
if (globals.env) {
|
|
762
846
|
// Built-in names (`prod` / `staging`) are reserved and must always
|
|
@@ -775,18 +859,31 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
775
859
|
}
|
|
776
860
|
}
|
|
777
861
|
else {
|
|
778
|
-
const fromToml =
|
|
862
|
+
const fromToml = config.profiles && Object.hasOwn(config.profiles, globals.env)
|
|
863
|
+
? { name: globals.env, ...config.profiles[globals.env] }
|
|
864
|
+
: null;
|
|
779
865
|
if (fromToml) {
|
|
780
866
|
profile = fromToml;
|
|
781
867
|
}
|
|
868
|
+
if (!profile) {
|
|
869
|
+
const available = BUILTIN_PROFILE_NAMES.join(", ");
|
|
870
|
+
throw new CliUsageError(`unknown profile: ${globals.env}. Built-in profiles: ${available}`);
|
|
871
|
+
}
|
|
782
872
|
}
|
|
783
|
-
if (!profile) {
|
|
784
|
-
const available = BUILTIN_PROFILE_NAMES.join(', ');
|
|
785
|
-
throw new CliUsageError(`unknown profile: ${globals.env}. Built-in profiles: ${available}`);
|
|
786
|
-
}
|
|
787
873
|
}
|
|
874
|
+
if (!profile &&
|
|
875
|
+
config.activeProfile &&
|
|
876
|
+
!isBuiltinProfileName(config.activeProfile)) {
|
|
877
|
+
const active = config.profiles && Object.hasOwn(config.profiles, config.activeProfile)
|
|
878
|
+
? config.profiles[config.activeProfile]
|
|
879
|
+
: undefined;
|
|
880
|
+
if (active)
|
|
881
|
+
profile = { name: config.activeProfile, ...active };
|
|
882
|
+
}
|
|
883
|
+
let credentialFile = dependencies.credentialFile;
|
|
884
|
+
const resolveCredentialFile = () => credentialFile ??= resolveCredentialFilePath();
|
|
788
885
|
if (dependencies.loadConfig === undefined &&
|
|
789
|
-
!RUNTIME_CONFIG_OPTIONAL_COMMANDS.
|
|
886
|
+
!RUNTIME_CONFIG_OPTIONAL_COMMANDS.includes(commandName)) {
|
|
790
887
|
// Env-only execution (CI/containers, scripted health checks) and
|
|
791
888
|
// profile-based auth resolve runtime config without the file on
|
|
792
889
|
// disk. Once `FLYWHEEL_BASE_URL` is set the CLI has enough to
|
|
@@ -799,58 +896,137 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
799
896
|
// needs auth and none is available.
|
|
800
897
|
const envBaseUrl = process.env.FLYWHEEL_BASE_URL?.trim();
|
|
801
898
|
const hasEnvBaseUrl = Boolean(envBaseUrl);
|
|
802
|
-
if (!profile && !hasEnvBaseUrl) {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
writeLine(stderr, buildMissingRuntimeConfigMessage(configPath));
|
|
806
|
-
return EXIT_USAGE;
|
|
807
|
-
}
|
|
899
|
+
if (!profile && !hasEnvBaseUrl && !runtimeConfigExists) {
|
|
900
|
+
writeLine(stderr, buildMissingRuntimeConfigMessage(configPath));
|
|
901
|
+
return EXIT_USAGE;
|
|
808
902
|
}
|
|
809
903
|
}
|
|
810
|
-
const
|
|
811
|
-
|
|
904
|
+
const authLocalConfigReadiness = dependencies.loadConfig === undefined
|
|
905
|
+
? runtimeConfigExists
|
|
906
|
+
? "ready"
|
|
907
|
+
: "missing"
|
|
908
|
+
: "ready";
|
|
909
|
+
const authRemoteProbeAllowed = authLocalConfigReadiness === "ready" ||
|
|
910
|
+
profile !== null ||
|
|
911
|
+
Boolean(process.env.FLYWHEEL_BASE_URL?.trim());
|
|
912
|
+
const runtimeConfig = await resolveRuntimeAuthConfig(config, profile, resolveEnvApiKey, resolveCredentialFile, !CREDENTIAL_LOOKUP_SKIPPED_COMMANDS.includes(commandName), dependencies.readCredential ?? readCredential, localRepositoryRemoteCommand);
|
|
913
|
+
const selectedProfileName = profile?.name ??
|
|
914
|
+
(typeof config.activeProfile === "string" && config.activeProfile.trim()
|
|
915
|
+
? config.activeProfile.trim()
|
|
916
|
+
: "default");
|
|
917
|
+
missingCredentialRemediation = runtimeConfig.apiKey
|
|
918
|
+
? undefined
|
|
919
|
+
: selectedProfileName === "default"
|
|
920
|
+
? "flywheel auth:login"
|
|
921
|
+
: `flywheel auth:login --env ${selectedProfileName}`;
|
|
812
922
|
effectiveBaseUrl = runtimeConfig.baseUrl;
|
|
813
|
-
const
|
|
814
|
-
const
|
|
815
|
-
|
|
816
|
-
|
|
923
|
+
const selectedFormat = globals.format ?? parsed.format;
|
|
924
|
+
const commandDefaultFormat = commandName === "api-keys:list" ||
|
|
925
|
+
localRepositoryCommand ||
|
|
926
|
+
commandDefinition?.group === "hosted-graph"
|
|
927
|
+
? "table"
|
|
928
|
+
: selectedFormat;
|
|
929
|
+
const effectiveFormat = globals.formatExplicit
|
|
930
|
+
? selectedFormat
|
|
931
|
+
: commandName === "api-keys:list"
|
|
817
932
|
? commandDefaultFormat
|
|
818
933
|
: (runtimeConfig.defaultFormat ?? commandDefaultFormat);
|
|
819
|
-
const profileTimeoutS = typeof profile?.defaultTimeoutS ===
|
|
820
|
-
|
|
934
|
+
const profileTimeoutS = typeof profile?.defaultTimeoutS === "number"
|
|
935
|
+
? profile.defaultTimeoutS
|
|
936
|
+
: undefined;
|
|
937
|
+
const effectiveTimeoutMs = typeof globals.timeoutS === "number"
|
|
821
938
|
? globals.timeoutS * 1000
|
|
822
|
-
: typeof profileTimeoutS ===
|
|
939
|
+
: typeof profileTimeoutS === "number"
|
|
823
940
|
? profileTimeoutS * 1000
|
|
824
941
|
: undefined;
|
|
825
|
-
const
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
commandName
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
942
|
+
const invocationId = randomUUID();
|
|
943
|
+
repositoryInitPersonal =
|
|
944
|
+
commandName === "repo:init" && handlerParams.personal === true;
|
|
945
|
+
repositorySelection = undefined;
|
|
946
|
+
if (localRepositoryCommand &&
|
|
947
|
+
!["repo:init", "repo:clone", "repo:restore"].includes(commandName)) {
|
|
948
|
+
repositorySelection = await resolveRepositorySelection({
|
|
949
|
+
params: handlerParams,
|
|
950
|
+
loadConfig: async () => config,
|
|
951
|
+
});
|
|
952
|
+
}
|
|
953
|
+
if (localRepositoryCommand) {
|
|
954
|
+
delete handlerParams.repo;
|
|
955
|
+
delete handlerParams.personal;
|
|
956
|
+
}
|
|
957
|
+
const client = !localRepositoryCommand || localRepositoryRemoteCommand
|
|
958
|
+
? (dependencies.createHttpClient ?? createHttpClient)({
|
|
959
|
+
baseUrl: runtimeConfig.baseUrl,
|
|
960
|
+
apiKey: runtimeConfig.apiKey,
|
|
961
|
+
cliVersion: CLI_VERSION,
|
|
962
|
+
commandName,
|
|
963
|
+
flagNames,
|
|
964
|
+
invocationId,
|
|
965
|
+
retryMax: globals.retryMax,
|
|
966
|
+
retryEnabled: globals.retryEnabled,
|
|
967
|
+
waitRequested: globals.wait === true,
|
|
968
|
+
waitTimeoutS: globals.waitTimeoutS,
|
|
969
|
+
debug: globals.debug,
|
|
970
|
+
timeoutMs: effectiveTimeoutMs,
|
|
971
|
+
idempotencyKey: globals.idempotencyKey,
|
|
972
|
+
})
|
|
973
|
+
: undefined;
|
|
974
|
+
if (credentialFile === undefined &&
|
|
975
|
+
(commandName === "auth:login" ||
|
|
976
|
+
commandName === "auth:credentials:set" ||
|
|
977
|
+
commandName === "auth:credentials:clear")) {
|
|
978
|
+
resolveCredentialFile();
|
|
979
|
+
}
|
|
980
|
+
const connection = localRepositoryRemoteCommand && client
|
|
981
|
+
? {
|
|
982
|
+
client,
|
|
983
|
+
baseUrl: runtimeConfig.baseUrl,
|
|
984
|
+
profile: profile?.name ??
|
|
985
|
+
(typeof config.activeProfile === "string" && config.activeProfile.trim()
|
|
986
|
+
? config.activeProfile.trim()
|
|
987
|
+
: "default"),
|
|
988
|
+
}
|
|
989
|
+
: undefined;
|
|
990
|
+
const localAdapter = localRepositoryCommand
|
|
991
|
+
? new LocalRepositoryAdapter({ connection })
|
|
992
|
+
: undefined;
|
|
841
993
|
const payload = await handler({
|
|
842
994
|
params: handlerParams,
|
|
843
|
-
requestJson: client
|
|
844
|
-
|
|
845
|
-
|
|
995
|
+
requestJson: client?.requestJson ??
|
|
996
|
+
(async () => {
|
|
997
|
+
throw new Error("hosted HTTP transport is unavailable for local repository commands");
|
|
998
|
+
}),
|
|
999
|
+
requestRaw: client?.requestRaw,
|
|
846
1000
|
saveConfig,
|
|
1001
|
+
config,
|
|
847
1002
|
configPath,
|
|
1003
|
+
authProfile: selectedProfileName,
|
|
1004
|
+
authCredentialBaseUrl: runtimeConfig.credentialBaseUrl,
|
|
1005
|
+
authProfileBaseUrl: profile?.baseUrl,
|
|
1006
|
+
authDefaultBaseUrl: process.env.FLYWHEEL_BASE_URL?.trim() || DEFAULT_BASE_URL,
|
|
1007
|
+
authApiKeyEnv: profile?.apiKeyEnv,
|
|
1008
|
+
authLocalConfigReadiness,
|
|
1009
|
+
authRemoteProbeAllowed,
|
|
1010
|
+
authCredentialReadiness: runtimeConfig.credentialReadiness,
|
|
1011
|
+
authCredentialFile: credentialFile,
|
|
848
1012
|
baseUrl: runtimeConfig.baseUrl,
|
|
849
1013
|
apiKey: runtimeConfig.apiKey,
|
|
850
1014
|
globals,
|
|
851
|
-
stderr
|
|
852
|
-
|
|
1015
|
+
stderr: credentialMode && !dependencies.stderr
|
|
1016
|
+
? (chunk) => writeCredentialStream(process.stderr, chunk)
|
|
1017
|
+
: stderr,
|
|
1018
|
+
stdout: credentialMode && !dependencies.stdout
|
|
1019
|
+
? (chunk) => writeCredentialStream(process.stdout, chunk)
|
|
1020
|
+
: stdout,
|
|
1021
|
+
credentialOutput,
|
|
853
1022
|
writeOutputFile,
|
|
1023
|
+
requestLocalJson: localAdapter?.requestJson,
|
|
1024
|
+
repositoryBootstrap: localAdapter?.bootstrap.bind(localAdapter),
|
|
1025
|
+
localRepositoryId: localAdapter?.repositoryId.bind(localAdapter),
|
|
1026
|
+
installLocalObject: localAdapter?.installObject.bind(localAdapter),
|
|
1027
|
+
stageLocalOperations: localAdapter?.stageOperations.bind(localAdapter),
|
|
1028
|
+
repositoryInitPersonal,
|
|
1029
|
+
repositorySelection,
|
|
854
1030
|
});
|
|
855
1031
|
if (payload === undefined || payload === null) {
|
|
856
1032
|
return 0;
|
|
@@ -860,7 +1036,7 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
860
1036
|
writeLine(stderr, `${commandName} returns binary output; pass --out=<path> or --out=- to write to stdout`);
|
|
861
1037
|
return EXIT_USAGE;
|
|
862
1038
|
}
|
|
863
|
-
if (globals.outPath ===
|
|
1039
|
+
if (globals.outPath === "-") {
|
|
864
1040
|
// Route binary bytes through the injected stdout writer so
|
|
865
1041
|
// programmatic runCli callers can capture them, matching the
|
|
866
1042
|
// text-output path.
|
|
@@ -871,9 +1047,16 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
871
1047
|
}
|
|
872
1048
|
return 0;
|
|
873
1049
|
}
|
|
874
|
-
const
|
|
1050
|
+
const outputOptions = localRepositoryCommand
|
|
1051
|
+
? { repositoryJson: true }
|
|
1052
|
+
: undefined;
|
|
1053
|
+
const rendered = humanGraphCommand &&
|
|
1054
|
+
!globals.formatExplicit &&
|
|
1055
|
+
effectiveFormat === "table"
|
|
1056
|
+
? (renderRepositoryHumanOutput(commandName, payload, repositorySelection, repositoryInitPersonal) ?? renderOutput(payload, effectiveFormat, outputOptions))
|
|
1057
|
+
: renderOutput(payload, effectiveFormat, outputOptions);
|
|
875
1058
|
if (globals.outPath) {
|
|
876
|
-
if (globals.outPath ===
|
|
1059
|
+
if (globals.outPath === "-") {
|
|
877
1060
|
stdout(rendered);
|
|
878
1061
|
}
|
|
879
1062
|
else {
|
|
@@ -886,6 +1069,18 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
886
1069
|
return 0;
|
|
887
1070
|
}
|
|
888
1071
|
catch (error) {
|
|
1072
|
+
if (credentialMode && error instanceof CliHttpError) {
|
|
1073
|
+
try {
|
|
1074
|
+
const message = `${error.message}\n`;
|
|
1075
|
+
await (dependencies.stderr
|
|
1076
|
+
? stderr(message)
|
|
1077
|
+
: writeCredentialStream(process.stderr, message));
|
|
1078
|
+
}
|
|
1079
|
+
catch {
|
|
1080
|
+
// A failed receipt/error sink must never cause credential emission.
|
|
1081
|
+
}
|
|
1082
|
+
return error.exitCode;
|
|
1083
|
+
}
|
|
889
1084
|
if (error instanceof CliAuthRequirementError) {
|
|
890
1085
|
const envelope = {
|
|
891
1086
|
error: {
|
|
@@ -905,8 +1100,39 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
905
1100
|
writeLine(stderr, JSON.stringify(envelope));
|
|
906
1101
|
return error.exitCode;
|
|
907
1102
|
}
|
|
1103
|
+
if (error instanceof RepositorySelectionError) {
|
|
1104
|
+
writeLine(stderr, `${error.code}: ${error.message}`);
|
|
1105
|
+
return EXIT_USAGE;
|
|
1106
|
+
}
|
|
1107
|
+
if (error instanceof FlywheelConfigError) {
|
|
1108
|
+
if ((globals.format ?? parsed.format) !== "json") {
|
|
1109
|
+
writeLine(stderr, error.message);
|
|
1110
|
+
return EXIT_USAGE;
|
|
1111
|
+
}
|
|
1112
|
+
const details = {
|
|
1113
|
+
code: error.code,
|
|
1114
|
+
message: error.message,
|
|
1115
|
+
exit_code: EXIT_USAGE,
|
|
1116
|
+
};
|
|
1117
|
+
if (error.configPath)
|
|
1118
|
+
details.config_path = error.configPath;
|
|
1119
|
+
if (error.field)
|
|
1120
|
+
details.field = error.field;
|
|
1121
|
+
if (error.sourcePaths)
|
|
1122
|
+
details.source_paths = error.sourcePaths;
|
|
1123
|
+
if (error.platform)
|
|
1124
|
+
details.platform = error.platform;
|
|
1125
|
+
if (error.environmentVariable)
|
|
1126
|
+
details.environment_variable = error.environmentVariable;
|
|
1127
|
+
if (error.override)
|
|
1128
|
+
details.override = error.override;
|
|
1129
|
+
if (error.schemaVersion !== undefined)
|
|
1130
|
+
details.schema_version = error.schemaVersion;
|
|
1131
|
+
writeLine(stderr, JSON.stringify({ error: details }));
|
|
1132
|
+
return EXIT_USAGE;
|
|
1133
|
+
}
|
|
908
1134
|
if (error instanceof CliUsageError) {
|
|
909
|
-
const augmented = error.message.startsWith(
|
|
1135
|
+
const augmented = error.message.startsWith("missing required parameter")
|
|
910
1136
|
? buildMissingParamHint(commandName, error.message)
|
|
911
1137
|
: error.message;
|
|
912
1138
|
writeLine(stderr, augmented);
|
|
@@ -915,7 +1141,7 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
915
1141
|
if (error instanceof CliApprovalPendingError) {
|
|
916
1142
|
const envelope = {
|
|
917
1143
|
error: {
|
|
918
|
-
code:
|
|
1144
|
+
code: "approval_required",
|
|
919
1145
|
message: error.message,
|
|
920
1146
|
exit_code: error.exitCode,
|
|
921
1147
|
},
|
|
@@ -942,33 +1168,20 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
942
1168
|
writeLine(stderr, JSON.stringify(envelope));
|
|
943
1169
|
return error.exitCode;
|
|
944
1170
|
}
|
|
945
|
-
if (error instanceof
|
|
946
|
-
|
|
947
|
-
const envelope = {
|
|
1171
|
+
if (error instanceof CredentialStoreError) {
|
|
1172
|
+
writeLine(stderr, JSON.stringify({
|
|
948
1173
|
error: {
|
|
949
|
-
code,
|
|
1174
|
+
code: error.code,
|
|
950
1175
|
message: error.message,
|
|
951
|
-
exit_code:
|
|
952
|
-
orphan_blob_ids: error.orphanBlobIds,
|
|
1176
|
+
exit_code: 1,
|
|
953
1177
|
},
|
|
954
|
-
};
|
|
955
|
-
|
|
956
|
-
if (typeof error.status === 'number') {
|
|
957
|
-
inner.server_response = {
|
|
958
|
-
status: error.status,
|
|
959
|
-
body: responseBodyForCliError(commandName, error.body),
|
|
960
|
-
};
|
|
961
|
-
}
|
|
962
|
-
if (error.request) {
|
|
963
|
-
inner.request = requestForCliHttpEnvelope(error.request);
|
|
964
|
-
}
|
|
965
|
-
writeLine(stderr, JSON.stringify(envelope));
|
|
966
|
-
return error.exitCode;
|
|
1178
|
+
}));
|
|
1179
|
+
return 1;
|
|
967
1180
|
}
|
|
968
1181
|
if (error instanceof CliWaitTimeoutError) {
|
|
969
1182
|
const envelope = {
|
|
970
1183
|
error: {
|
|
971
|
-
code:
|
|
1184
|
+
code: "wait_timeout",
|
|
972
1185
|
message: error.message,
|
|
973
1186
|
exit_code: error.exitCode,
|
|
974
1187
|
last_state: error.lastState,
|
|
@@ -979,10 +1192,6 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
979
1192
|
}
|
|
980
1193
|
if (error instanceof CliHttpError) {
|
|
981
1194
|
let message = error.message;
|
|
982
|
-
if (error.status === 422 &&
|
|
983
|
-
(commandName === 'nodes:commit-new' || commandName === 'nodes:commit')) {
|
|
984
|
-
message = buildCommitSchemaHint(commandName, message);
|
|
985
|
-
}
|
|
986
1195
|
message = buildLocalhostTransportHint(message, effectiveBaseUrl);
|
|
987
1196
|
message = buildNodeSlugMissHint({
|
|
988
1197
|
commandName,
|
|
@@ -990,15 +1199,65 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
990
1199
|
params: parsed.params,
|
|
991
1200
|
message,
|
|
992
1201
|
});
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1202
|
+
if (error.status === 401 && missingCredentialRemediation) {
|
|
1203
|
+
message = `${message} Run ${missingCredentialRemediation}.`;
|
|
1204
|
+
}
|
|
1205
|
+
const localRuntimeError = localRuntimeErrorType(error.body);
|
|
1206
|
+
const invalidRepositorySelection = localRuntimeError === "repository_runtime_state_invalid"
|
|
1207
|
+
? repositorySelection
|
|
1208
|
+
: undefined;
|
|
1209
|
+
const personalRepositoryInvalid = invalidRepositorySelection?.source === "personal";
|
|
1210
|
+
const personalRepositoryAdoptionInvalid = localRuntimeError === "repository_adoption_invalid" &&
|
|
1211
|
+
repositoryInitPersonal;
|
|
1212
|
+
let repositoryRoot;
|
|
1213
|
+
let repositorySource;
|
|
1214
|
+
if (invalidRepositorySelection) {
|
|
1215
|
+
repositoryRoot = invalidRepositorySelection.root;
|
|
1216
|
+
repositorySource = invalidRepositorySelection.source;
|
|
1217
|
+
if (personalRepositoryInvalid) {
|
|
1218
|
+
message =
|
|
1219
|
+
`The configured personal repository is invalid: ${repositoryRoot}. ` +
|
|
1220
|
+
`Run flywheel repo:init --personal ${shellQuote(repositoryRoot)} to repair it.`;
|
|
1221
|
+
}
|
|
1222
|
+
else {
|
|
1223
|
+
message =
|
|
1224
|
+
`The Flywheel repository selected from ${repositorySource} is invalid: ` +
|
|
1225
|
+
`${repositoryRoot}.`;
|
|
1226
|
+
}
|
|
1227
|
+
}
|
|
1228
|
+
else if (personalRepositoryAdoptionInvalid) {
|
|
1229
|
+
const input = typeof parsed.params.directory === "string"
|
|
1230
|
+
? parsed.params.directory
|
|
1231
|
+
: resolve(os.homedir(), "Flywheel");
|
|
1232
|
+
repositoryRoot =
|
|
1233
|
+
input === "~"
|
|
1234
|
+
? os.homedir()
|
|
1235
|
+
: input.startsWith("~/")
|
|
1236
|
+
? resolve(os.homedir(), input.slice(2))
|
|
1237
|
+
: resolve(input);
|
|
1238
|
+
repositorySource = "personal";
|
|
1239
|
+
message =
|
|
1240
|
+
`Unable to adopt the personal Flywheel repository at ${repositoryRoot}. ` +
|
|
1241
|
+
`Fix the repository, then retry: flywheel repo:init --personal ${shellQuote(repositoryRoot)}.`;
|
|
1242
|
+
}
|
|
1243
|
+
const code = personalRepositoryInvalid
|
|
1244
|
+
? "personal_repository_invalid"
|
|
1245
|
+
: invalidRepositorySelection !== undefined ||
|
|
1246
|
+
personalRepositoryAdoptionInvalid
|
|
1247
|
+
? localRuntimeError
|
|
1248
|
+
: localRuntimeError === "repository_locked"
|
|
1249
|
+
? localRuntimeError
|
|
1250
|
+
: error.request?.failureKind === "timeout"
|
|
1251
|
+
? "timeout"
|
|
1252
|
+
: error.request?.failureKind === "response_body"
|
|
1253
|
+
? "response_error"
|
|
1254
|
+
: error.status === 403 && isPolicyBlockedResponseBody(error.body)
|
|
1255
|
+
? "policy_blocked"
|
|
1256
|
+
: error.status === 401 || error.status === 403
|
|
1257
|
+
? "auth_error"
|
|
1258
|
+
: error.status === undefined
|
|
1259
|
+
? "transport_error"
|
|
1260
|
+
: "http_error";
|
|
1002
1261
|
const envelope = {
|
|
1003
1262
|
error: {
|
|
1004
1263
|
code,
|
|
@@ -1007,7 +1266,11 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
1007
1266
|
},
|
|
1008
1267
|
};
|
|
1009
1268
|
const inner = envelope.error;
|
|
1010
|
-
if (
|
|
1269
|
+
if (repositoryRoot)
|
|
1270
|
+
inner.repository_root = repositoryRoot;
|
|
1271
|
+
if (repositorySource)
|
|
1272
|
+
inner.repository_source = repositorySource;
|
|
1273
|
+
if (typeof error.status === "number") {
|
|
1011
1274
|
inner.server_response = {
|
|
1012
1275
|
status: error.status,
|
|
1013
1276
|
body: responseBodyForCliError(commandName, error.body),
|
|
@@ -1023,13 +1286,25 @@ export async function runCli(argv, dependencies = {}) {
|
|
|
1023
1286
|
writeLine(stderr, error.message);
|
|
1024
1287
|
return EXIT_TRANSPORT;
|
|
1025
1288
|
}
|
|
1026
|
-
writeLine(stderr,
|
|
1289
|
+
writeLine(stderr, "runtime error");
|
|
1027
1290
|
return EXIT_TRANSPORT;
|
|
1028
1291
|
}
|
|
1029
1292
|
finally {
|
|
1030
1293
|
void globals;
|
|
1031
1294
|
}
|
|
1032
1295
|
}
|
|
1296
|
+
function localRuntimeErrorType(body) {
|
|
1297
|
+
if (typeof body !== "object" ||
|
|
1298
|
+
body === null ||
|
|
1299
|
+
!("detail" in body) ||
|
|
1300
|
+
typeof body.detail !== "object" ||
|
|
1301
|
+
body.detail === null ||
|
|
1302
|
+
!("type" in body.detail) ||
|
|
1303
|
+
typeof body.detail.type !== "string") {
|
|
1304
|
+
return undefined;
|
|
1305
|
+
}
|
|
1306
|
+
return body.detail.type;
|
|
1307
|
+
}
|
|
1033
1308
|
async function main() {
|
|
1034
1309
|
const exitCode = await runCli(process.argv.slice(2), {});
|
|
1035
1310
|
process.exitCode = exitCode;
|