@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,8 +1,9 @@
|
|
|
1
|
-
import { randomUUID } from
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { parseRepositoryJson } from "../local/domain/models/encoding.js";
|
|
3
|
+
import { CliApprovalPendingError, } from "../errors.js";
|
|
4
|
+
import { EXIT_AUTH, EXIT_TRANSPORT } from "../exit-codes.js";
|
|
5
|
+
import { maskHeadersForDebug, maskQueryString } from "./debug.js";
|
|
6
|
+
import { isRetryableNetworkError, isRetryableStatus, parseRetryAfterMs, withRetry, } from "./retry.js";
|
|
6
7
|
export class CliHttpError extends Error {
|
|
7
8
|
exitCode;
|
|
8
9
|
status;
|
|
@@ -10,7 +11,7 @@ export class CliHttpError extends Error {
|
|
|
10
11
|
request;
|
|
11
12
|
constructor(message, exitCode, status, body, request) {
|
|
12
13
|
super(message);
|
|
13
|
-
this.name =
|
|
14
|
+
this.name = "CliHttpError";
|
|
14
15
|
this.exitCode = exitCode;
|
|
15
16
|
this.status = status;
|
|
16
17
|
this.body = body;
|
|
@@ -21,18 +22,26 @@ class RetryableHttpError extends CliHttpError {
|
|
|
21
22
|
retryAfterMs;
|
|
22
23
|
constructor(message, status, retryAfterMs, body, request) {
|
|
23
24
|
super(message, EXIT_TRANSPORT, status, body, request);
|
|
24
|
-
this.name =
|
|
25
|
+
this.name = "RetryableHttpError";
|
|
25
26
|
this.retryAfterMs = retryAfterMs;
|
|
26
27
|
}
|
|
27
28
|
}
|
|
28
|
-
|
|
29
|
+
class RetryableResponseBodyError extends Error {
|
|
30
|
+
original;
|
|
31
|
+
constructor(original) {
|
|
32
|
+
super(original instanceof Error ? original.message : String(original));
|
|
33
|
+
this.name = "RetryableResponseBodyError";
|
|
34
|
+
this.original = original;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const API_VERSION_PREFIX = "/v1";
|
|
29
38
|
const ROOT_ONLY_PREFIXES = [
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
"/admin",
|
|
40
|
+
"/auth/accounts",
|
|
41
|
+
"/auth/github",
|
|
42
|
+
"/auth/integrations",
|
|
43
|
+
"/health",
|
|
44
|
+
"/repos",
|
|
36
45
|
];
|
|
37
46
|
function mapStatusToExitCode(status) {
|
|
38
47
|
if (status === 401 || status === 403) {
|
|
@@ -41,35 +50,35 @@ function mapStatusToExitCode(status) {
|
|
|
41
50
|
return EXIT_TRANSPORT;
|
|
42
51
|
}
|
|
43
52
|
function shouldBypassGenericRetryForProviderErrorBody(body) {
|
|
44
|
-
if (!body || typeof body !==
|
|
53
|
+
if (!body || typeof body !== "object") {
|
|
45
54
|
return false;
|
|
46
55
|
}
|
|
47
56
|
const detail = body.detail;
|
|
48
|
-
if (!detail || typeof detail !==
|
|
57
|
+
if (!detail || typeof detail !== "object") {
|
|
49
58
|
return false;
|
|
50
59
|
}
|
|
51
60
|
const providerError = detail.provider_error;
|
|
52
|
-
if (!providerError || typeof providerError !==
|
|
61
|
+
if (!providerError || typeof providerError !== "object") {
|
|
53
62
|
return false;
|
|
54
63
|
}
|
|
55
64
|
const typed = providerError;
|
|
56
|
-
return typed.retryable === false || typed.refresh_offers_before_retry === true;
|
|
65
|
+
return (typed.retryable === false || typed.refresh_offers_before_retry === true);
|
|
57
66
|
}
|
|
58
67
|
function maskUrlForDebug(target) {
|
|
59
68
|
// Masks sensitive query parameters (tokens, credentials, signed-upload
|
|
60
69
|
// params) before stringifying. Preserves origin + path + hash verbatim.
|
|
61
70
|
try {
|
|
62
|
-
const url = typeof target ===
|
|
71
|
+
const url = typeof target === "string" ? new URL(target) : target;
|
|
63
72
|
const maskedSearch = maskQueryString(url.search);
|
|
64
73
|
return `${url.origin}${url.pathname}${maskedSearch}${url.hash}`;
|
|
65
74
|
}
|
|
66
75
|
catch {
|
|
67
|
-
return typeof target ===
|
|
76
|
+
return typeof target === "string" ? target : target.toString();
|
|
68
77
|
}
|
|
69
78
|
}
|
|
70
79
|
function toQueryString(query) {
|
|
71
80
|
if (!query) {
|
|
72
|
-
return
|
|
81
|
+
return "";
|
|
73
82
|
}
|
|
74
83
|
const params = new URLSearchParams();
|
|
75
84
|
for (const [key, value] of Object.entries(query)) {
|
|
@@ -82,32 +91,34 @@ function toQueryString(query) {
|
|
|
82
91
|
params.set(key, String(value));
|
|
83
92
|
}
|
|
84
93
|
const encoded = params.toString();
|
|
85
|
-
return encoded ? `?${encoded}` :
|
|
94
|
+
return encoded ? `?${encoded}` : "";
|
|
86
95
|
}
|
|
87
96
|
function normalizeInternalPath(path) {
|
|
88
|
-
return path.startsWith(
|
|
97
|
+
return path.startsWith("/") ? path : `/${path}`;
|
|
89
98
|
}
|
|
90
99
|
function normalizeApiVersionPrefix(prefix) {
|
|
91
100
|
const raw = prefix ?? API_VERSION_PREFIX;
|
|
92
101
|
const normalized = raw.trim();
|
|
93
|
-
if (normalized ===
|
|
94
|
-
return
|
|
102
|
+
if (normalized === "" || normalized === "/") {
|
|
103
|
+
return "";
|
|
95
104
|
}
|
|
96
|
-
return `/${normalized.replace(/^\/+|\/+$/g,
|
|
105
|
+
return `/${normalized.replace(/^\/+|\/+$/g, "")}`;
|
|
97
106
|
}
|
|
98
|
-
function
|
|
99
|
-
|
|
100
|
-
|
|
107
|
+
export function effectiveApiBaseUrl(baseUrl, apiVersionPrefix) {
|
|
108
|
+
apiVersionPrefix = normalizeApiVersionPrefix(apiVersionPrefix);
|
|
109
|
+
const normalizedBase = baseUrl.replace(/\/+$/, "");
|
|
110
|
+
if (apiVersionPrefix === "") {
|
|
101
111
|
return normalizedBase;
|
|
102
112
|
}
|
|
103
113
|
try {
|
|
104
114
|
const parsed = new URL(normalizedBase);
|
|
105
|
-
const cleanPath = parsed.pathname.replace(/\/+$/u,
|
|
106
|
-
if (cleanPath === apiVersionPrefix ||
|
|
107
|
-
|
|
108
|
-
parsed.
|
|
109
|
-
parsed.
|
|
110
|
-
|
|
115
|
+
const cleanPath = parsed.pathname.replace(/\/+$/u, "");
|
|
116
|
+
if (cleanPath === apiVersionPrefix ||
|
|
117
|
+
cleanPath.endsWith(apiVersionPrefix)) {
|
|
118
|
+
parsed.pathname = cleanPath.slice(0, -apiVersionPrefix.length) || "/";
|
|
119
|
+
parsed.search = "";
|
|
120
|
+
parsed.hash = "";
|
|
121
|
+
return parsed.toString().replace(/\/+$/, "");
|
|
111
122
|
}
|
|
112
123
|
}
|
|
113
124
|
catch {
|
|
@@ -120,7 +131,7 @@ function isRootOnlyPath(path) {
|
|
|
120
131
|
}
|
|
121
132
|
function versionedRequestPath(path, apiVersionPrefix) {
|
|
122
133
|
const normalized = normalizeInternalPath(path);
|
|
123
|
-
if (apiVersionPrefix ===
|
|
134
|
+
if (apiVersionPrefix === "" || isRootOnlyPath(normalized)) {
|
|
124
135
|
return normalized;
|
|
125
136
|
}
|
|
126
137
|
if (normalized === apiVersionPrefix ||
|
|
@@ -132,31 +143,34 @@ function versionedRequestPath(path, apiVersionPrefix) {
|
|
|
132
143
|
function baseUrlLooksLikeOriginRoot(baseUrl) {
|
|
133
144
|
try {
|
|
134
145
|
const parsed = new URL(baseUrl);
|
|
135
|
-
const cleanPath = parsed.pathname.replace(/\/+$/,
|
|
136
|
-
return cleanPath ===
|
|
146
|
+
const cleanPath = parsed.pathname.replace(/\/+$/, "");
|
|
147
|
+
return cleanPath === "" || cleanPath === "/";
|
|
137
148
|
}
|
|
138
149
|
catch {
|
|
139
150
|
return false;
|
|
140
151
|
}
|
|
141
152
|
}
|
|
142
153
|
function clampWaitTimeoutSeconds(value) {
|
|
143
|
-
const raw = typeof value ===
|
|
154
|
+
const raw = typeof value === "number" && Number.isFinite(value) ? value : 600;
|
|
144
155
|
return Math.min(3600, Math.max(10, Math.trunc(raw)));
|
|
145
156
|
}
|
|
146
157
|
function buildHttpErrorMessage(status, baseUrl) {
|
|
147
158
|
const base = `request failed with status ${status}`;
|
|
148
|
-
if ((status === 401 || status === 404) &&
|
|
149
|
-
|
|
159
|
+
if ((status === 401 || status === 404) &&
|
|
160
|
+
baseUrlLooksLikeOriginRoot(baseUrl)) {
|
|
161
|
+
return `${base} — base URL appears to be an origin root; try ${baseUrl.replace(/\/+$/, "")}/api`;
|
|
150
162
|
}
|
|
151
163
|
return base;
|
|
152
164
|
}
|
|
153
|
-
async function readResponseBody(response) {
|
|
154
|
-
const contentType = response.headers.get(
|
|
155
|
-
if (contentType.includes(
|
|
165
|
+
async function readResponseBody(response, signal) {
|
|
166
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
167
|
+
if (contentType.includes("application/json")) {
|
|
156
168
|
try {
|
|
157
169
|
return await response.json();
|
|
158
170
|
}
|
|
159
|
-
catch {
|
|
171
|
+
catch (error) {
|
|
172
|
+
if (signal?.aborted || isRetryableNetworkError(error))
|
|
173
|
+
throw error;
|
|
160
174
|
return null;
|
|
161
175
|
}
|
|
162
176
|
}
|
|
@@ -172,10 +186,16 @@ async function readResponseBody(response) {
|
|
|
172
186
|
return text;
|
|
173
187
|
}
|
|
174
188
|
}
|
|
175
|
-
catch {
|
|
189
|
+
catch (error) {
|
|
190
|
+
if (signal?.aborted || isRetryableNetworkError(error))
|
|
191
|
+
throw error;
|
|
176
192
|
return null;
|
|
177
193
|
}
|
|
178
194
|
}
|
|
195
|
+
async function readRepositoryJsonResponse(response) {
|
|
196
|
+
const text = await response.text();
|
|
197
|
+
return parseRepositoryJson(text);
|
|
198
|
+
}
|
|
179
199
|
function snapshotResponse(status, body) {
|
|
180
200
|
return { status, body };
|
|
181
201
|
}
|
|
@@ -186,78 +206,57 @@ function elapsedMsSince(startedAtMs) {
|
|
|
186
206
|
return Math.max(0, Date.now() - startedAtMs);
|
|
187
207
|
}
|
|
188
208
|
function shouldIncludeRecoveryGuidance(failureKind) {
|
|
189
|
-
return (failureKind ===
|
|
190
|
-
failureKind ===
|
|
191
|
-
failureKind ===
|
|
209
|
+
return (failureKind === "timeout" ||
|
|
210
|
+
failureKind === "transport" ||
|
|
211
|
+
failureKind === "retryable_status" ||
|
|
212
|
+
failureKind === "response_body");
|
|
192
213
|
}
|
|
193
214
|
function pathWithoutApiVersion(path) {
|
|
194
|
-
return path.replace(/^\/v\d+(?=\/)/,
|
|
215
|
+
return path.replace(/^\/v\d+(?=\/)/, "");
|
|
195
216
|
}
|
|
196
217
|
function isReplayBackedWrite(method, path) {
|
|
197
218
|
const normalizedPath = pathWithoutApiVersion(path);
|
|
198
|
-
return ((method ===
|
|
199
|
-
(
|
|
200
|
-
|
|
201
|
-
(method === 'POST' &&
|
|
202
|
-
/^\/nodes\/[^/]+\/(?:commit|branch)$/.test(normalizedPath)) ||
|
|
203
|
-
(method === 'POST' &&
|
|
204
|
-
/^\/nodes\/[^/]+\/parents\/(?:add|remove)$/.test(normalizedPath)) ||
|
|
205
|
-
(method === 'DELETE' && /^\/nodes\/[^/]+$/.test(normalizedPath)) ||
|
|
206
|
-
(method === 'POST' && normalizedPath === '/nodes/bulk-delete') ||
|
|
207
|
-
(method === 'POST' && normalizedPath === '/nodes/merge') ||
|
|
208
|
-
(method === 'PUT' &&
|
|
219
|
+
return ((method === "POST" &&
|
|
220
|
+
/^\/nodes\/[^/]+\/stage\/lease\/(?:acquire|heartbeat|release)$/.test(normalizedPath)) ||
|
|
221
|
+
(method === "PUT" &&
|
|
209
222
|
/^\/nodes\/[^/]+\/access-policy$/.test(normalizedPath)) ||
|
|
210
|
-
(method ===
|
|
211
|
-
(method ===
|
|
212
|
-
/^\/nodes\/[^/]+\/artifacts\/uploads\/prepare$/.test(normalizedPath)) ||
|
|
213
|
-
(method === 'POST' &&
|
|
214
|
-
/^\/nodes\/[^/]+\/artifacts\/uploads\/finalize$/.test(normalizedPath)) ||
|
|
215
|
-
(method === 'POST' &&
|
|
216
|
-
/^\/nodes\/[^/]+\/artifacts\/bulk-delete$/.test(normalizedPath)) ||
|
|
217
|
-
(method === 'DELETE' &&
|
|
218
|
-
/^\/nodes\/[^/]+\/artifacts\/[^/]+$/.test(normalizedPath)) ||
|
|
219
|
-
(method === 'PATCH' &&
|
|
220
|
-
/^\/nodes\/[^/]+\/artifacts\/[^/]+\/note$/.test(normalizedPath)) ||
|
|
221
|
-
(method === 'POST' &&
|
|
223
|
+
(method === "POST" && normalizedPath === "/nodes/access-policy/bulk") ||
|
|
224
|
+
(method === "POST" &&
|
|
222
225
|
/^\/nodes\/[^/]+\/executions$/.test(normalizedPath)) ||
|
|
223
|
-
(method ===
|
|
226
|
+
(method === "POST" &&
|
|
224
227
|
/^\/nodes\/[^/]+\/executions\/[^/]+\/terminate$/.test(normalizedPath)) ||
|
|
225
|
-
(method ===
|
|
228
|
+
(method === "POST" &&
|
|
226
229
|
/^\/nodes\/[^/]+\/compute\/acquire$/.test(normalizedPath)) ||
|
|
227
|
-
(method ===
|
|
230
|
+
(method === "POST" &&
|
|
228
231
|
/^\/users\/me\/machines\/[^/]+\/release$/.test(normalizedPath)) ||
|
|
229
|
-
(method ===
|
|
230
|
-
normalizedPath ===
|
|
231
|
-
(method ===
|
|
232
|
-
normalizedPath ===
|
|
233
|
-
(method ===
|
|
234
|
-
(method ===
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
(method ===
|
|
238
|
-
/^\/
|
|
239
|
-
(method ===
|
|
240
|
-
/^\/
|
|
241
|
-
(method ===
|
|
242
|
-
(method === 'POST' && normalizedPath === '/import'));
|
|
232
|
+
(method === "POST" &&
|
|
233
|
+
normalizedPath === "/users/me/machines/release-all") ||
|
|
234
|
+
(method === "POST" &&
|
|
235
|
+
normalizedPath === "/compute-grants/request-approval") ||
|
|
236
|
+
(method === "POST" && normalizedPath === "/admin/test-users") ||
|
|
237
|
+
(method === "DELETE" &&
|
|
238
|
+
/^\/admin\/test-users\/[^/]+$/.test(normalizedPath)) ||
|
|
239
|
+
(method === "POST" && normalizedPath === "/repositories") ||
|
|
240
|
+
(method === "POST" &&
|
|
241
|
+
/^\/repositories\/[^/]+\/(?:clone-sessions|pull-sessions|objects\/prepare|pushes|membership-removals|ownership-transfers|retirements|commits|purges)$/.test(normalizedPath)) ||
|
|
242
|
+
(method === "PUT" &&
|
|
243
|
+
/^\/repositories\/[^/]+\/(?:members\/[^/]+|objects\/sha256%3A[0-9a-f]{64})$/.test(normalizedPath)) ||
|
|
244
|
+
(method === "POST" && normalizedPath === "/import"));
|
|
243
245
|
}
|
|
244
246
|
function retrySafeForRequest(input) {
|
|
245
|
-
if (input.method ===
|
|
247
|
+
if (input.method === "GET") {
|
|
246
248
|
return true;
|
|
247
249
|
}
|
|
248
250
|
if (!input.idempotencyKey) {
|
|
249
251
|
return false;
|
|
250
252
|
}
|
|
251
|
-
if (input.wrapperStep === 'finalize') {
|
|
252
|
-
return false;
|
|
253
|
-
}
|
|
254
253
|
return isReplayBackedWrite(input.method, input.path);
|
|
255
254
|
}
|
|
256
255
|
function buildRetryGuidance(input) {
|
|
257
256
|
const feedbackHint = input.requestId
|
|
258
257
|
? ` If this keeps failing, run feedback:create and include request_id ${input.requestId}.`
|
|
259
|
-
:
|
|
260
|
-
if (input.method ===
|
|
258
|
+
: " If this keeps failing, run feedback:create and include the request details.";
|
|
259
|
+
if (input.method === "GET") {
|
|
261
260
|
return `Retry the same read operation.${feedbackHint}`;
|
|
262
261
|
}
|
|
263
262
|
if (input.retrySafe && input.idempotencyKey) {
|
|
@@ -283,7 +282,7 @@ function buildFailureRequestContext(input) {
|
|
|
283
282
|
if (input.idempotencyKey) {
|
|
284
283
|
request.idempotencyKey = input.idempotencyKey;
|
|
285
284
|
}
|
|
286
|
-
if (typeof input.retryAfterMs ===
|
|
285
|
+
if (typeof input.retryAfterMs === "number") {
|
|
287
286
|
request.retryAfterMs = input.retryAfterMs;
|
|
288
287
|
}
|
|
289
288
|
if (input.wrapperStep) {
|
|
@@ -301,7 +300,6 @@ function buildFailureRequestContext(input) {
|
|
|
301
300
|
method: input.method,
|
|
302
301
|
path: input.path,
|
|
303
302
|
idempotencyKey: input.idempotencyKey,
|
|
304
|
-
wrapperStep: input.wrapperStep,
|
|
305
303
|
});
|
|
306
304
|
request.retrySafe = retrySafe;
|
|
307
305
|
request.retryGuidance = buildRetryGuidance({
|
|
@@ -315,25 +313,25 @@ function buildFailureRequestContext(input) {
|
|
|
315
313
|
}
|
|
316
314
|
function isApprovalRequiredBody(body) {
|
|
317
315
|
return (body !== null &&
|
|
318
|
-
typeof body ===
|
|
319
|
-
body.code ===
|
|
316
|
+
typeof body === "object" &&
|
|
317
|
+
body.code === "approval_required");
|
|
320
318
|
}
|
|
321
319
|
export function createHttpClient(options) {
|
|
322
320
|
const transport = options.transport ?? fetch;
|
|
323
321
|
const apiVersionPrefix = normalizeApiVersionPrefix(options.apiVersionPrefix);
|
|
324
|
-
const normalizedBase =
|
|
322
|
+
const normalizedBase = effectiveApiBaseUrl(options.baseUrl, options.apiVersionPrefix);
|
|
325
323
|
const invocationId = options.invocationId ?? randomUUID();
|
|
326
324
|
const retryMax = options.retryMax ?? 3;
|
|
327
325
|
const warnedPaths = new Set();
|
|
328
326
|
function emitDeprecationWarning(path, response, debugLog) {
|
|
329
|
-
const deprecation = response.headers.get(
|
|
330
|
-
if (!deprecation || deprecation.toLowerCase() ===
|
|
327
|
+
const deprecation = response.headers.get("deprecation");
|
|
328
|
+
if (!deprecation || deprecation.toLowerCase() === "false")
|
|
331
329
|
return;
|
|
332
330
|
if (warnedPaths.has(path))
|
|
333
331
|
return;
|
|
334
332
|
warnedPaths.add(path);
|
|
335
|
-
const sunset = response.headers.get(
|
|
336
|
-
const hint = sunset ? ` (sunset: ${sunset})` :
|
|
333
|
+
const sunset = response.headers.get("sunset");
|
|
334
|
+
const hint = sunset ? ` (sunset: ${sunset})` : "";
|
|
337
335
|
const line = `deprecation warning: this endpoint is deprecated${hint}`;
|
|
338
336
|
if (debugLog)
|
|
339
337
|
debugLog(line);
|
|
@@ -344,44 +342,44 @@ export function createHttpClient(options) {
|
|
|
344
342
|
const debug = options.debug ?? false;
|
|
345
343
|
const debugLog = options.debugLog ?? ((line) => process.stderr.write(`${line}\n`));
|
|
346
344
|
const timeoutMs = options.timeoutMs ?? 300_000;
|
|
347
|
-
async function doRequest(method, requestPath, requestOptions, idempotencyKey, requestId, startedAtMs, attempt, maxAttempts, requestIdempotencyKey) {
|
|
345
|
+
async function doRequest(method, requestPath, requestOptions, idempotencyKey, requestId, startedAtMs, attempt, maxAttempts, requestIdempotencyKey, responseMode, consumeResponse) {
|
|
348
346
|
const url = new URL(`${normalizedBase}${requestPath}${toQueryString(requestOptions?.query)}`);
|
|
349
347
|
const headers = {
|
|
350
|
-
Accept:
|
|
348
|
+
Accept: "application/json",
|
|
351
349
|
};
|
|
352
350
|
if (options.apiKey && !requestOptions?.skipAuth) {
|
|
353
351
|
headers.Authorization = `Bearer ${options.apiKey}`;
|
|
354
352
|
}
|
|
355
|
-
if (method !==
|
|
356
|
-
headers[
|
|
353
|
+
if (method !== "GET") {
|
|
354
|
+
headers["Idempotency-Key"] = idempotencyKey;
|
|
357
355
|
}
|
|
358
356
|
if (requestOptions?.body !== undefined && !requestOptions.rawBody) {
|
|
359
|
-
headers[
|
|
357
|
+
headers["Content-Type"] = "application/json";
|
|
360
358
|
}
|
|
361
359
|
if (options.cliVersion) {
|
|
362
|
-
headers[
|
|
363
|
-
headers[
|
|
360
|
+
headers["X-Flywheel-Cli-Version"] = options.cliVersion;
|
|
361
|
+
headers["User-Agent"] = `flywheel-cli/${options.cliVersion}`;
|
|
364
362
|
}
|
|
365
363
|
if (options.commandName) {
|
|
366
|
-
headers[
|
|
364
|
+
headers["X-Flywheel-Cli-Command"] = options.commandName;
|
|
367
365
|
}
|
|
368
366
|
if (options.flagNames && options.flagNames.length > 0) {
|
|
369
|
-
headers[
|
|
367
|
+
headers["X-Flywheel-Cli-Flags"] = options.flagNames.join(",");
|
|
370
368
|
}
|
|
371
|
-
headers[
|
|
372
|
-
headers[
|
|
373
|
-
headers[
|
|
369
|
+
headers["X-Flywheel-Cli-Invocation-Id"] = invocationId;
|
|
370
|
+
headers["X-Flywheel-Request-Id"] = requestId;
|
|
371
|
+
headers["X-Request-ID"] = requestId;
|
|
374
372
|
const wrapperStep = requestOptions?.wrapperStep ?? options.wrapperStep;
|
|
375
373
|
if (wrapperStep) {
|
|
376
|
-
headers[
|
|
374
|
+
headers["X-Flywheel-Cli-Wrapper-Step"] = wrapperStep;
|
|
377
375
|
}
|
|
378
376
|
if (options.waitRequested === true) {
|
|
379
|
-
headers[
|
|
380
|
-
headers[
|
|
377
|
+
headers["X-Flywheel-Cli-Wait-Requested"] = "true";
|
|
378
|
+
headers["X-Flywheel-Cli-Wait-Timeout-Seconds"] = String(clampWaitTimeoutSeconds(options.waitTimeoutS));
|
|
381
379
|
}
|
|
382
380
|
const exitIntent = requestOptions?.exitIntent ?? options.exitIntent;
|
|
383
|
-
if (typeof exitIntent ===
|
|
384
|
-
headers[
|
|
381
|
+
if (typeof exitIntent === "number") {
|
|
382
|
+
headers["X-Flywheel-Cli-Exit-Intent"] = String(exitIntent);
|
|
385
383
|
}
|
|
386
384
|
if (requestOptions?.extraHeaders) {
|
|
387
385
|
Object.assign(headers, requestOptions.extraHeaders);
|
|
@@ -393,18 +391,33 @@ export function createHttpClient(options) {
|
|
|
393
391
|
: undefined;
|
|
394
392
|
if (debug) {
|
|
395
393
|
debugLog(`DEBUG: ${method} ${maskUrlForDebug(url)} ${JSON.stringify({
|
|
396
|
-
headers:
|
|
397
|
-
body:
|
|
394
|
+
headers: maskHeadersForDebug(headers),
|
|
395
|
+
body: {
|
|
396
|
+
present: requestOptions?.body !== undefined ||
|
|
397
|
+
requestOptions?.rawBody !== undefined,
|
|
398
|
+
},
|
|
398
399
|
})}`);
|
|
399
400
|
}
|
|
400
401
|
const controller = new AbortController();
|
|
401
402
|
const timer = setTimeout(() => controller.abort(new Error(`CLI HTTP timeout after ${timeoutMs}ms`)), timeoutMs);
|
|
402
403
|
const progressInterval = process.stdout.isTTY
|
|
403
|
-
? setInterval(() => process.stderr.write(
|
|
404
|
-
:
|
|
404
|
+
? setInterval(() => process.stderr.write("."), 10_000)
|
|
405
|
+
: undefined;
|
|
405
406
|
let response;
|
|
406
407
|
try {
|
|
407
|
-
response = await transport(url, {
|
|
408
|
+
response = await transport(url, {
|
|
409
|
+
method,
|
|
410
|
+
headers,
|
|
411
|
+
body: body,
|
|
412
|
+
signal: controller.signal,
|
|
413
|
+
...(responseMode === "repository_json" || responseMode === "repository_raw"
|
|
414
|
+
? { redirect: "error" }
|
|
415
|
+
: {}),
|
|
416
|
+
});
|
|
417
|
+
if (debug) {
|
|
418
|
+
debugLog(`DEBUG: ${method} ${maskUrlForDebug(url)} -> ${response.status}`);
|
|
419
|
+
}
|
|
420
|
+
return await consumeResponse(response, controller.signal);
|
|
408
421
|
}
|
|
409
422
|
catch (error) {
|
|
410
423
|
if (controller.signal.aborted) {
|
|
@@ -418,13 +431,37 @@ export function createHttpClient(options) {
|
|
|
418
431
|
attempt,
|
|
419
432
|
maxAttempts,
|
|
420
433
|
wrapperStep,
|
|
421
|
-
failureKind:
|
|
434
|
+
failureKind: "timeout",
|
|
422
435
|
}));
|
|
423
436
|
}
|
|
424
437
|
if (isRetryableNetworkError(error)) {
|
|
438
|
+
if (response === undefined) {
|
|
439
|
+
throw error;
|
|
440
|
+
}
|
|
441
|
+
if (retrySafeForRequest({
|
|
442
|
+
method,
|
|
443
|
+
path: requestPath,
|
|
444
|
+
idempotencyKey: requestIdempotencyKey,
|
|
445
|
+
})) {
|
|
446
|
+
throw new RetryableResponseBodyError(error);
|
|
447
|
+
}
|
|
448
|
+
throw new CliHttpError("transport error", EXIT_TRANSPORT, undefined, undefined, buildFailureRequestContext({
|
|
449
|
+
method,
|
|
450
|
+
path: requestPath,
|
|
451
|
+
requestId,
|
|
452
|
+
idempotencyKey: requestIdempotencyKey,
|
|
453
|
+
timeoutMs,
|
|
454
|
+
startedAtMs,
|
|
455
|
+
attempt,
|
|
456
|
+
maxAttempts,
|
|
457
|
+
wrapperStep,
|
|
458
|
+
failureKind: "response_body",
|
|
459
|
+
}));
|
|
460
|
+
}
|
|
461
|
+
if (response !== undefined) {
|
|
425
462
|
throw error;
|
|
426
463
|
}
|
|
427
|
-
throw new CliHttpError(
|
|
464
|
+
throw new CliHttpError("transport error", EXIT_TRANSPORT, undefined, undefined, buildFailureRequestContext({
|
|
428
465
|
method,
|
|
429
466
|
path: requestPath,
|
|
430
467
|
requestId,
|
|
@@ -434,75 +471,106 @@ export function createHttpClient(options) {
|
|
|
434
471
|
attempt,
|
|
435
472
|
maxAttempts,
|
|
436
473
|
wrapperStep,
|
|
437
|
-
failureKind:
|
|
474
|
+
failureKind: "transport",
|
|
438
475
|
}));
|
|
439
476
|
}
|
|
440
477
|
finally {
|
|
441
478
|
clearTimeout(timer);
|
|
442
|
-
|
|
443
|
-
clearInterval(progressInterval);
|
|
444
|
-
}
|
|
445
|
-
if (debug) {
|
|
446
|
-
debugLog(`DEBUG: ${method} ${maskUrlForDebug(url)} -> ${response.status}`);
|
|
479
|
+
clearInterval(progressInterval);
|
|
447
480
|
}
|
|
448
|
-
return response;
|
|
449
481
|
}
|
|
450
|
-
async function requestWithRetry(method, path, requestOptions) {
|
|
482
|
+
async function requestWithRetry(method, path, requestOptions, responseMode, consumeRepositoryResponse) {
|
|
451
483
|
const requestPath = versionedRequestPath(path, apiVersionPrefix);
|
|
452
|
-
const idempotencyKey = options.idempotencyKey ?? randomUUID();
|
|
453
|
-
const requestIdempotencyKey = method !==
|
|
454
|
-
? idempotencyKey
|
|
455
|
-
: undefined;
|
|
484
|
+
const idempotencyKey = requestOptions?.idempotencyKey ?? options.idempotencyKey ?? randomUUID();
|
|
485
|
+
const requestIdempotencyKey = method !== "GET" ? idempotencyKey : undefined;
|
|
456
486
|
const requestId = randomUUID();
|
|
457
|
-
const maxAttempts = normalizeMaxAttempts(retryEnabled ? retryMax : 1);
|
|
487
|
+
const maxAttempts = normalizeMaxAttempts(retryEnabled && requestOptions?.retryEnabled !== false ? retryMax : 1);
|
|
458
488
|
const wrapperStep = requestOptions?.wrapperStep ?? options.wrapperStep;
|
|
459
489
|
let attempt = 0;
|
|
460
490
|
let lastAttemptStartedAtMs = Date.now();
|
|
461
491
|
const fn = async () => {
|
|
462
492
|
attempt += 1;
|
|
463
493
|
lastAttemptStartedAtMs = Date.now();
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
:
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
494
|
+
return await doRequest(method, requestPath, requestOptions, idempotencyKey, requestId, lastAttemptStartedAtMs, attempt, maxAttempts, requestIdempotencyKey, responseMode, async (response, signal) => {
|
|
495
|
+
if (!response.ok) {
|
|
496
|
+
const body = await readResponseBody(response, signal);
|
|
497
|
+
if (response.status === 422 && isApprovalRequiredBody(body)) {
|
|
498
|
+
const approvalBody = body;
|
|
499
|
+
throw new CliApprovalPendingError(typeof approvalBody.message === "string"
|
|
500
|
+
? approvalBody.message
|
|
501
|
+
: "approval required", {
|
|
502
|
+
approvalUrl: typeof approvalBody.approval_url === "string"
|
|
503
|
+
? approvalBody.approval_url
|
|
504
|
+
: undefined,
|
|
505
|
+
approvalRequestId: typeof approvalBody.approval_request_id === "string"
|
|
506
|
+
? approvalBody.approval_request_id
|
|
507
|
+
: undefined,
|
|
508
|
+
grantId: typeof approvalBody.grant_id === "string"
|
|
509
|
+
? approvalBody.grant_id
|
|
510
|
+
: undefined,
|
|
511
|
+
requiredSignoffs: Array.isArray(approvalBody.required_signoffs)
|
|
512
|
+
? approvalBody.required_signoffs.filter((v) => typeof v === "string")
|
|
513
|
+
: undefined,
|
|
514
|
+
serverResponse: snapshotResponse(response.status, body),
|
|
515
|
+
request: {
|
|
516
|
+
method,
|
|
517
|
+
path: requestPath,
|
|
518
|
+
requestId,
|
|
519
|
+
},
|
|
520
|
+
});
|
|
521
|
+
}
|
|
522
|
+
if (isRetryableStatus(response.status)) {
|
|
523
|
+
const retryAfterMs = parseRetryAfterMs(response.headers.get("retry-after"));
|
|
524
|
+
const suppressRetryGuidance = shouldBypassGenericRetryForProviderErrorBody(body);
|
|
525
|
+
throw new RetryableHttpError(buildHttpErrorMessage(response.status, options.baseUrl), response.status, retryAfterMs, body, buildFailureRequestContext({
|
|
496
526
|
method,
|
|
497
527
|
path: requestPath,
|
|
498
528
|
requestId,
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
529
|
+
idempotencyKey: requestIdempotencyKey,
|
|
530
|
+
timeoutMs,
|
|
531
|
+
startedAtMs: lastAttemptStartedAtMs,
|
|
532
|
+
attempt,
|
|
533
|
+
maxAttempts,
|
|
534
|
+
retryAfterMs,
|
|
535
|
+
wrapperStep,
|
|
536
|
+
failureKind: "retryable_status",
|
|
537
|
+
suppressRetryGuidance,
|
|
538
|
+
}));
|
|
539
|
+
}
|
|
540
|
+
if (response.status === 426) {
|
|
541
|
+
throw new CliHttpError("upgrade required: install the latest @paradigma-inc/flywheel package", EXIT_TRANSPORT, 426, body, buildFailureRequestContext({
|
|
542
|
+
method,
|
|
543
|
+
path: requestPath,
|
|
544
|
+
requestId,
|
|
545
|
+
idempotencyKey: requestIdempotencyKey,
|
|
546
|
+
timeoutMs,
|
|
547
|
+
startedAtMs: lastAttemptStartedAtMs,
|
|
548
|
+
attempt,
|
|
549
|
+
maxAttempts,
|
|
550
|
+
wrapperStep,
|
|
551
|
+
failureKind: "http_status",
|
|
552
|
+
}));
|
|
553
|
+
}
|
|
554
|
+
if (response.status === 410) {
|
|
555
|
+
const hint = body &&
|
|
556
|
+
typeof body === "object" &&
|
|
557
|
+
typeof body.replacement === "string"
|
|
558
|
+
? body.replacement
|
|
559
|
+
: null;
|
|
560
|
+
throw new CliHttpError(`resource gone${hint ? ` — use ${hint}` : ""}`, EXIT_TRANSPORT, 410, body, buildFailureRequestContext({
|
|
561
|
+
method,
|
|
562
|
+
path: requestPath,
|
|
563
|
+
requestId,
|
|
564
|
+
idempotencyKey: requestIdempotencyKey,
|
|
565
|
+
timeoutMs,
|
|
566
|
+
startedAtMs: lastAttemptStartedAtMs,
|
|
567
|
+
attempt,
|
|
568
|
+
maxAttempts,
|
|
569
|
+
wrapperStep,
|
|
570
|
+
failureKind: "http_status",
|
|
571
|
+
}));
|
|
572
|
+
}
|
|
573
|
+
throw new CliHttpError(buildHttpErrorMessage(response.status, options.baseUrl), mapStatusToExitCode(response.status), response.status, body, buildFailureRequestContext({
|
|
506
574
|
method,
|
|
507
575
|
path: requestPath,
|
|
508
576
|
requestId,
|
|
@@ -511,31 +579,47 @@ export function createHttpClient(options) {
|
|
|
511
579
|
startedAtMs: lastAttemptStartedAtMs,
|
|
512
580
|
attempt,
|
|
513
581
|
maxAttempts,
|
|
514
|
-
retryAfterMs,
|
|
515
582
|
wrapperStep,
|
|
516
|
-
failureKind:
|
|
517
|
-
suppressRetryGuidance,
|
|
583
|
+
failureKind: "http_status",
|
|
518
584
|
}));
|
|
519
585
|
}
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
}
|
|
586
|
+
emitDeprecationWarning(requestPath, response, debugLog);
|
|
587
|
+
if (consumeRepositoryResponse) {
|
|
588
|
+
return await consumeRepositoryResponse(response);
|
|
589
|
+
}
|
|
590
|
+
if (responseMode === "raw") {
|
|
591
|
+
return response;
|
|
592
|
+
}
|
|
593
|
+
let body = null;
|
|
594
|
+
let responseError;
|
|
595
|
+
if (responseMode === "repository_json") {
|
|
596
|
+
try {
|
|
597
|
+
body = await readRepositoryJsonResponse(response);
|
|
598
|
+
}
|
|
599
|
+
catch (error) {
|
|
600
|
+
if (signal.aborted || isRetryableNetworkError(error))
|
|
601
|
+
throw error;
|
|
602
|
+
body = undefined;
|
|
603
|
+
responseError = "response body could not be read or parsed as JSON";
|
|
604
|
+
}
|
|
533
605
|
}
|
|
534
|
-
|
|
535
|
-
const
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
606
|
+
else {
|
|
607
|
+
const contentType = response.headers.get("content-type") ?? "";
|
|
608
|
+
if (contentType.includes("application/json")) {
|
|
609
|
+
try {
|
|
610
|
+
body = await response.json();
|
|
611
|
+
}
|
|
612
|
+
catch (error) {
|
|
613
|
+
if (signal.aborted || isRetryableNetworkError(error))
|
|
614
|
+
throw error;
|
|
615
|
+
body = undefined;
|
|
616
|
+
responseError = "response body could not be read or parsed as JSON";
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
responseError ??= requestOptions?.validateJson?.(body);
|
|
621
|
+
if (responseError !== undefined) {
|
|
622
|
+
throw new CliHttpError(responseError, EXIT_TRANSPORT, response.status, body, buildFailureRequestContext({
|
|
539
623
|
method,
|
|
540
624
|
path: requestPath,
|
|
541
625
|
requestId,
|
|
@@ -545,24 +629,11 @@ export function createHttpClient(options) {
|
|
|
545
629
|
attempt,
|
|
546
630
|
maxAttempts,
|
|
547
631
|
wrapperStep,
|
|
548
|
-
failureKind:
|
|
632
|
+
failureKind: "response_body",
|
|
549
633
|
}));
|
|
550
634
|
}
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
path: requestPath,
|
|
554
|
-
requestId,
|
|
555
|
-
idempotencyKey: requestIdempotencyKey,
|
|
556
|
-
timeoutMs,
|
|
557
|
-
startedAtMs: lastAttemptStartedAtMs,
|
|
558
|
-
attempt,
|
|
559
|
-
maxAttempts,
|
|
560
|
-
wrapperStep,
|
|
561
|
-
failureKind: 'http_status',
|
|
562
|
-
}));
|
|
563
|
-
}
|
|
564
|
-
emitDeprecationWarning(requestPath, response, debugLog);
|
|
565
|
-
return response;
|
|
635
|
+
return body;
|
|
636
|
+
});
|
|
566
637
|
};
|
|
567
638
|
try {
|
|
568
639
|
return await withRetry(fn, {
|
|
@@ -576,11 +647,14 @@ export function createHttpClient(options) {
|
|
|
576
647
|
if (shouldBypassGenericRetryForProviderErrorBody(error.body)) {
|
|
577
648
|
return { retry: false };
|
|
578
649
|
}
|
|
579
|
-
if (typeof error.retryAfterMs ===
|
|
650
|
+
if (typeof error.retryAfterMs === "number") {
|
|
580
651
|
return { retry: true, delayMs: error.retryAfterMs };
|
|
581
652
|
}
|
|
582
653
|
return { retry: true };
|
|
583
654
|
}
|
|
655
|
+
if (error instanceof RetryableResponseBodyError) {
|
|
656
|
+
return { retry: true };
|
|
657
|
+
}
|
|
584
658
|
if (isRetryableNetworkError(error)) {
|
|
585
659
|
return { retry: true };
|
|
586
660
|
}
|
|
@@ -594,10 +668,30 @@ export function createHttpClient(options) {
|
|
|
594
668
|
// out of withRetry after retries exhaust. Without this, runCli
|
|
595
669
|
// would hit the generic Error path and lose the structured stderr
|
|
596
670
|
// envelope, request metadata, and localhost-setup hint.
|
|
671
|
+
if (error instanceof RetryableResponseBodyError) {
|
|
672
|
+
const detail = error.original instanceof Error
|
|
673
|
+
? error.original.message
|
|
674
|
+
: String(error.original);
|
|
675
|
+
throw new CliHttpError(`transport error: ${detail}`, EXIT_TRANSPORT, undefined, undefined, buildFailureRequestContext({
|
|
676
|
+
method,
|
|
677
|
+
path: requestPath,
|
|
678
|
+
requestId,
|
|
679
|
+
idempotencyKey: requestIdempotencyKey,
|
|
680
|
+
timeoutMs,
|
|
681
|
+
startedAtMs: lastAttemptStartedAtMs,
|
|
682
|
+
attempt: Math.max(1, attempt),
|
|
683
|
+
maxAttempts,
|
|
684
|
+
wrapperStep,
|
|
685
|
+
failureKind: "response_body",
|
|
686
|
+
}));
|
|
687
|
+
}
|
|
597
688
|
if (error instanceof CliHttpError ||
|
|
598
689
|
error instanceof CliApprovalPendingError) {
|
|
599
690
|
throw error;
|
|
600
691
|
}
|
|
692
|
+
if (responseMode === "repository_raw" && !isRetryableNetworkError(error)) {
|
|
693
|
+
throw error;
|
|
694
|
+
}
|
|
601
695
|
const detail = error instanceof Error ? error.message : String(error);
|
|
602
696
|
throw new CliHttpError(`transport error: ${detail}`, EXIT_TRANSPORT, undefined, undefined, buildFailureRequestContext({
|
|
603
697
|
method,
|
|
@@ -609,98 +703,22 @@ export function createHttpClient(options) {
|
|
|
609
703
|
attempt: Math.max(1, attempt),
|
|
610
704
|
maxAttempts,
|
|
611
705
|
wrapperStep,
|
|
612
|
-
failureKind:
|
|
706
|
+
failureKind: "transport",
|
|
613
707
|
}));
|
|
614
708
|
}
|
|
615
709
|
}
|
|
616
710
|
return {
|
|
617
711
|
async requestJson(method, path, requestOptions) {
|
|
618
|
-
|
|
619
|
-
if (requestOptions?.rawResponse) {
|
|
620
|
-
return response;
|
|
621
|
-
}
|
|
622
|
-
const contentType = response.headers.get('content-type') ?? '';
|
|
623
|
-
if (!contentType.includes('application/json')) {
|
|
624
|
-
// 204/empty responses
|
|
625
|
-
return null;
|
|
626
|
-
}
|
|
627
|
-
return (await response.json());
|
|
712
|
+
return requestWithRetry(method, path, requestOptions, "json");
|
|
628
713
|
},
|
|
629
|
-
async
|
|
630
|
-
return requestWithRetry(method, path, requestOptions);
|
|
714
|
+
async requestRepositoryJson(method, path, requestOptions) {
|
|
715
|
+
return requestWithRetry(method, path, requestOptions, "repository_json");
|
|
631
716
|
},
|
|
632
|
-
async
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
const headers = {};
|
|
638
|
-
if (rawOptions?.extraHeaders) {
|
|
639
|
-
Object.assign(headers, rawOptions.extraHeaders);
|
|
640
|
-
}
|
|
641
|
-
if (debug) {
|
|
642
|
-
debugLog(`DEBUG: ${method} ${redactExternalUrlForOutput(absoluteUrl)} (external) ${JSON.stringify({
|
|
643
|
-
headers: maskForDebug(headers),
|
|
644
|
-
})}`);
|
|
645
|
-
}
|
|
646
|
-
// Apply the same timeout + abort semantics as internal requests so
|
|
647
|
-
// external uploads to stalled signed URLs can't hang the CLI past
|
|
648
|
-
// the configured --timeout / profile default_timeout_s.
|
|
649
|
-
const controller = new AbortController();
|
|
650
|
-
const timer = setTimeout(() => controller.abort(new Error(`CLI HTTP timeout after ${timeoutMs}ms`)), timeoutMs);
|
|
651
|
-
const progressInterval = process.stdout.isTTY
|
|
652
|
-
? setInterval(() => process.stderr.write('.'), 10_000)
|
|
653
|
-
: null;
|
|
654
|
-
const redactedPath = redactExternalUrlForOutput(absoluteUrl);
|
|
655
|
-
const startedAtMs = Date.now();
|
|
656
|
-
const wrapperStep = rawOptions?.wrapperStep ?? options.wrapperStep;
|
|
657
|
-
let response;
|
|
658
|
-
try {
|
|
659
|
-
response = await transport(new URL(absoluteUrl), {
|
|
660
|
-
method,
|
|
661
|
-
headers,
|
|
662
|
-
body: rawOptions?.rawBody,
|
|
663
|
-
signal: controller.signal,
|
|
664
|
-
});
|
|
665
|
-
}
|
|
666
|
-
catch (error) {
|
|
667
|
-
// Mirror internal-request semantics so callers always receive a
|
|
668
|
-
// structured CliHttpError envelope (with EXIT_TRANSPORT + the
|
|
669
|
-
// redacted external URL as `request.path`) instead of a raw network
|
|
670
|
-
// error bubbling out through the generic Error path in runCli.
|
|
671
|
-
void error;
|
|
672
|
-
if (controller.signal.aborted) {
|
|
673
|
-
throw new CliHttpError(`request timed out after ${timeoutMs}ms`, EXIT_TRANSPORT, undefined, undefined, buildFailureRequestContext({
|
|
674
|
-
method,
|
|
675
|
-
path: redactedPath,
|
|
676
|
-
timeoutMs,
|
|
677
|
-
startedAtMs,
|
|
678
|
-
attempt: 1,
|
|
679
|
-
maxAttempts: 1,
|
|
680
|
-
wrapperStep,
|
|
681
|
-
failureKind: 'timeout',
|
|
682
|
-
}));
|
|
683
|
-
}
|
|
684
|
-
throw new CliHttpError(`transport error while contacting ${redactedPath}`, EXIT_TRANSPORT, undefined, undefined, buildFailureRequestContext({
|
|
685
|
-
method,
|
|
686
|
-
path: redactedPath,
|
|
687
|
-
timeoutMs,
|
|
688
|
-
startedAtMs,
|
|
689
|
-
attempt: 1,
|
|
690
|
-
maxAttempts: 1,
|
|
691
|
-
wrapperStep,
|
|
692
|
-
failureKind: 'transport',
|
|
693
|
-
}));
|
|
694
|
-
}
|
|
695
|
-
finally {
|
|
696
|
-
clearTimeout(timer);
|
|
697
|
-
if (progressInterval)
|
|
698
|
-
clearInterval(progressInterval);
|
|
699
|
-
}
|
|
700
|
-
if (debug) {
|
|
701
|
-
debugLog(`DEBUG: ${method} ${redactExternalUrlForOutput(absoluteUrl)} (external) -> ${response.status}`);
|
|
702
|
-
}
|
|
703
|
-
return response;
|
|
717
|
+
async requestRepositoryRaw(method, path, consumeResponse, requestOptions) {
|
|
718
|
+
return requestWithRetry(method, path, requestOptions, "repository_raw", consumeResponse);
|
|
719
|
+
},
|
|
720
|
+
async requestRaw(method, path, requestOptions) {
|
|
721
|
+
return requestWithRetry(method, path, requestOptions, "raw");
|
|
704
722
|
},
|
|
705
723
|
};
|
|
706
724
|
}
|