@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,24 +0,0 @@
|
|
|
1
|
-
import type { HttpMethod } from '../http/client.js';
|
|
2
|
-
import type { AuthConfigDelta } from './config.js';
|
|
3
|
-
interface RequestOptions {
|
|
4
|
-
body?: unknown;
|
|
5
|
-
}
|
|
6
|
-
type RequestJson = <T>(method: HttpMethod, path: string, options?: RequestOptions) => Promise<T>;
|
|
7
|
-
export interface AuthLoginArgs {
|
|
8
|
-
baseUrl: string;
|
|
9
|
-
params: Record<string, string | boolean>;
|
|
10
|
-
requestJson: RequestJson;
|
|
11
|
-
saveConfig: (filePath: string, config: AuthConfigDelta) => Promise<void>;
|
|
12
|
-
configPath: string;
|
|
13
|
-
openBrowser?: (url: string) => Promise<void>;
|
|
14
|
-
sleep?: (seconds: number) => Promise<void>;
|
|
15
|
-
now?: () => number;
|
|
16
|
-
writeStdout?: (chunk: string) => void;
|
|
17
|
-
}
|
|
18
|
-
export interface AuthLoginResult {
|
|
19
|
-
key_id: string | null;
|
|
20
|
-
exit_code: 0 | 1 | 3;
|
|
21
|
-
}
|
|
22
|
-
export declare function formatDenyStdout(): string;
|
|
23
|
-
export declare function runAuthLogin(args: AuthLoginArgs): Promise<AuthLoginResult>;
|
|
24
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { OutputFormat } from '../grammar/parse.js';
|
|
2
|
-
export interface Profile {
|
|
3
|
-
name: string;
|
|
4
|
-
baseUrl: string;
|
|
5
|
-
apiKeyEnv?: string;
|
|
6
|
-
apiKeyKeychain?: boolean;
|
|
7
|
-
defaultFormat?: OutputFormat;
|
|
8
|
-
defaultTimeoutS?: number;
|
|
9
|
-
}
|
|
10
|
-
export declare function resolveProfilesDir(): string;
|
|
11
|
-
export declare function parseProfileToml(input: string): Record<string, string | number | boolean>;
|
|
12
|
-
export declare function loadProfile(name: string, dir?: string): Promise<Profile | null>;
|
|
13
|
-
export declare function listProfiles(dir?: string): Promise<string[]>;
|
|
14
|
-
export declare function saveProfile(profile: Profile, dir?: string): Promise<void>;
|
|
15
|
-
export declare function deleteProfile(name: string, dir?: string): Promise<boolean>;
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { readdir, readFile, unlink, writeFile, mkdir } from 'node:fs/promises';
|
|
2
|
-
import os from 'node:os';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import { CliUsageError } from '../errors.js';
|
|
5
|
-
export function resolveProfilesDir() {
|
|
6
|
-
const fromEnv = process.env.FLYWHEEL_CLI_PROFILES_DIR?.trim();
|
|
7
|
-
if (fromEnv) {
|
|
8
|
-
return fromEnv;
|
|
9
|
-
}
|
|
10
|
-
return path.join(os.homedir(), '.config', 'flywheel-cli', 'profiles');
|
|
11
|
-
}
|
|
12
|
-
function assertProfileNameSafe(name, dir) {
|
|
13
|
-
// Profile names arrive directly from user input (--name on profile:set /
|
|
14
|
-
// profile:unset / --env global). A plain Error would be classified as a
|
|
15
|
-
// runtime/transport failure in main.ts's catch ladder (exit 2). Use
|
|
16
|
-
// CliUsageError so invalid names like `../bad` exit 1 (usage) and stay
|
|
17
|
-
// distinguishable from connectivity/runtime failures in script exit codes.
|
|
18
|
-
if (!name || path.basename(name) !== name) {
|
|
19
|
-
throw new CliUsageError(`invalid profile name: ${name}`);
|
|
20
|
-
}
|
|
21
|
-
const resolvedDir = path.resolve(dir);
|
|
22
|
-
const resolvedFile = path.resolve(resolvedDir, `${name}.toml`);
|
|
23
|
-
if (resolvedFile !== path.join(resolvedDir, `${name}.toml`) ||
|
|
24
|
-
!resolvedFile.startsWith(resolvedDir + path.sep)) {
|
|
25
|
-
throw new CliUsageError(`invalid profile name: ${name}`);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
function profilePath(dir, name) {
|
|
29
|
-
assertProfileNameSafe(name, dir);
|
|
30
|
-
return path.join(dir, `${name}.toml`);
|
|
31
|
-
}
|
|
32
|
-
// Minimal TOML parser for our narrow schema: top-level `key = value` lines.
|
|
33
|
-
// Supports strings (quoted), integers, and booleans. No nested tables.
|
|
34
|
-
export function parseProfileToml(input) {
|
|
35
|
-
const out = {};
|
|
36
|
-
const lines = input.split(/\r?\n/);
|
|
37
|
-
for (const line of lines) {
|
|
38
|
-
const trimmed = line.trim();
|
|
39
|
-
if (!trimmed || trimmed.startsWith('#')) {
|
|
40
|
-
continue;
|
|
41
|
-
}
|
|
42
|
-
const eq = trimmed.indexOf('=');
|
|
43
|
-
if (eq === -1)
|
|
44
|
-
continue;
|
|
45
|
-
const key = trimmed.slice(0, eq).trim();
|
|
46
|
-
const rawValue = trimmed.slice(eq + 1).trim().replace(/\s+#.*$/, '');
|
|
47
|
-
if (!key)
|
|
48
|
-
continue;
|
|
49
|
-
if (rawValue.startsWith('"') && rawValue.endsWith('"')) {
|
|
50
|
-
out[key] = rawValue.slice(1, -1);
|
|
51
|
-
}
|
|
52
|
-
else if (rawValue === 'true' || rawValue === 'false') {
|
|
53
|
-
out[key] = rawValue === 'true';
|
|
54
|
-
}
|
|
55
|
-
else if (/^-?\d+$/.test(rawValue)) {
|
|
56
|
-
out[key] = Number.parseInt(rawValue, 10);
|
|
57
|
-
}
|
|
58
|
-
else {
|
|
59
|
-
out[key] = rawValue;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
return out;
|
|
63
|
-
}
|
|
64
|
-
function serializeProfileToml(profile) {
|
|
65
|
-
const lines = [];
|
|
66
|
-
lines.push(`base_url = ${JSON.stringify(profile.baseUrl)}`);
|
|
67
|
-
if (profile.apiKeyEnv) {
|
|
68
|
-
lines.push(`api_key_env = ${JSON.stringify(profile.apiKeyEnv)}`);
|
|
69
|
-
}
|
|
70
|
-
if (profile.apiKeyKeychain) {
|
|
71
|
-
lines.push(`api_key_keychain = true`);
|
|
72
|
-
}
|
|
73
|
-
if (profile.defaultFormat) {
|
|
74
|
-
lines.push(`default_format = ${JSON.stringify(profile.defaultFormat)}`);
|
|
75
|
-
}
|
|
76
|
-
if (typeof profile.defaultTimeoutS === 'number') {
|
|
77
|
-
lines.push(`default_timeout_s = ${profile.defaultTimeoutS}`);
|
|
78
|
-
}
|
|
79
|
-
return `${lines.join('\n')}\n`;
|
|
80
|
-
}
|
|
81
|
-
export async function loadProfile(name, dir = resolveProfilesDir()) {
|
|
82
|
-
assertProfileNameSafe(name, dir);
|
|
83
|
-
try {
|
|
84
|
-
const raw = await readFile(profilePath(dir, name), 'utf8');
|
|
85
|
-
const parsed = parseProfileToml(raw);
|
|
86
|
-
const baseUrl = typeof parsed.base_url === 'string' ? parsed.base_url : null;
|
|
87
|
-
if (!baseUrl) {
|
|
88
|
-
return null;
|
|
89
|
-
}
|
|
90
|
-
const profile = {
|
|
91
|
-
name,
|
|
92
|
-
baseUrl,
|
|
93
|
-
};
|
|
94
|
-
if (typeof parsed.api_key_env === 'string') {
|
|
95
|
-
profile.apiKeyEnv = parsed.api_key_env;
|
|
96
|
-
}
|
|
97
|
-
if (parsed.api_key_keychain === true) {
|
|
98
|
-
profile.apiKeyKeychain = true;
|
|
99
|
-
}
|
|
100
|
-
if (parsed.default_format === 'json' ||
|
|
101
|
-
parsed.default_format === 'tsv' ||
|
|
102
|
-
parsed.default_format === 'csv' ||
|
|
103
|
-
parsed.default_format === 'table') {
|
|
104
|
-
profile.defaultFormat = parsed.default_format;
|
|
105
|
-
}
|
|
106
|
-
if (typeof parsed.default_timeout_s === 'number' &&
|
|
107
|
-
Number.isFinite(parsed.default_timeout_s) &&
|
|
108
|
-
parsed.default_timeout_s >= 1 &&
|
|
109
|
-
parsed.default_timeout_s <= 86_400) {
|
|
110
|
-
// Clamp to the same bounds profile:set enforces; silently ignore
|
|
111
|
-
// out-of-range values from hand-edited TOML rather than let a
|
|
112
|
-
// zero/negative timeout brick every command.
|
|
113
|
-
profile.defaultTimeoutS = parsed.default_timeout_s;
|
|
114
|
-
}
|
|
115
|
-
return profile;
|
|
116
|
-
}
|
|
117
|
-
catch {
|
|
118
|
-
return null;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
export async function listProfiles(dir = resolveProfilesDir()) {
|
|
122
|
-
try {
|
|
123
|
-
const entries = await readdir(dir);
|
|
124
|
-
return entries
|
|
125
|
-
.filter((entry) => entry.endsWith('.toml'))
|
|
126
|
-
.map((entry) => entry.replace(/\.toml$/, ''))
|
|
127
|
-
.sort();
|
|
128
|
-
}
|
|
129
|
-
catch {
|
|
130
|
-
return [];
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
export async function saveProfile(profile, dir = resolveProfilesDir()) {
|
|
134
|
-
await mkdir(dir, { recursive: true });
|
|
135
|
-
await writeFile(profilePath(dir, profile.name), serializeProfileToml(profile), {
|
|
136
|
-
encoding: 'utf8',
|
|
137
|
-
mode: 0o600,
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
export async function deleteProfile(name, dir = resolveProfilesDir()) {
|
|
141
|
-
assertProfileNameSafe(name, dir);
|
|
142
|
-
try {
|
|
143
|
-
await unlink(profilePath(dir, name));
|
|
144
|
-
return true;
|
|
145
|
-
}
|
|
146
|
-
catch {
|
|
147
|
-
return false;
|
|
148
|
-
}
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=profile.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/auth/profile.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,QAAQ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1
|
-
/**
|
|
2
|
-
* Built-in CLI profiles. Values here are the runtime source of truth for
|
|
3
|
-
* prod/staging baseUrls — per the CLI's auth contract they are NEVER
|
|
4
|
-
* written into the user's config.json. That way upstream URL changes flow
|
|
5
|
-
* through to every installed CLI without a config migration.
|
|
6
|
-
*
|
|
7
|
-
* NOTE on the `/api` suffix: the CLI targets the JSON API root, which
|
|
8
|
-
* lives under `/api` on both prod and staging (see `help.ts` and the
|
|
9
|
-
* `README` — "FLYWHEEL_BASE_URL must be the full API base, including
|
|
10
|
-
* /api"). The browser-facing device-flow page (`/auth/mcp/setup/device`)
|
|
11
|
-
* is rendered by the server off the origin root and does not require the
|
|
12
|
-
* suffix, but every request the CLI's HTTP client makes is concatenated
|
|
13
|
-
* onto `baseUrl`, so origin-root URLs would land on the web app instead
|
|
14
|
-
* of the API.
|
|
15
|
-
*/
|
|
16
|
-
export interface BuiltinProfile {
|
|
17
|
-
baseUrl: string;
|
|
18
|
-
hidden?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export declare const BUILTIN_PROFILES: {
|
|
21
|
-
readonly prod: BuiltinProfile;
|
|
22
|
-
readonly staging: BuiltinProfile;
|
|
23
|
-
};
|
|
24
|
-
export type BuiltinProfileName = keyof typeof BUILTIN_PROFILES;
|
|
25
|
-
export declare const BUILTIN_PROFILE_NAMES: readonly BuiltinProfileName[];
|
|
26
|
-
export declare function isBuiltinProfileName(name: string): name is BuiltinProfileName;
|
|
27
|
-
export declare function resolveBuiltinBaseUrl(name: string): string | undefined;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { CommandContext, RequestOptions } from './types.js';
|
|
2
|
-
/**
|
|
3
|
-
* Build the admin-only auth overlay for `RequestOptions` from the
|
|
4
|
-
* ``FLYWHEEL_ADMIN_KEY`` env var and the caller's configured bearer.
|
|
5
|
-
*
|
|
6
|
-
* Shared by every CLI command that targets an ``/admin/*`` HTTP route.
|
|
7
|
-
* The overlay:
|
|
8
|
-
*
|
|
9
|
-
* 1. Sends the env value as the ``X-Admin-Key`` header (consumed by
|
|
10
|
-
* ``require_paradigma_admin`` on the server).
|
|
11
|
-
* 2. Sets ``skipAuth: true`` ONLY when the caller's configured bearer
|
|
12
|
-
* looks like a Flywheel API key (``fwk_*``). The server's
|
|
13
|
-
* ``get_current_user`` runs before ``require_paradigma_admin`` and
|
|
14
|
-
* rejects API-key bearers for routes not in the API-key allowlist;
|
|
15
|
-
* ``/admin/*`` is intentionally excluded from that allowlist, so
|
|
16
|
-
* that 403 would fire before the admin-key header could be seen.
|
|
17
|
-
* Suppressing the bearer ONLY for API-key bearers keeps JWT bearers
|
|
18
|
-
* (``@paradigma.inc`` browser-login sessions) intact — user-bound
|
|
19
|
-
* admin routes (e.g. ``/admin/dev/*``) still require the
|
|
20
|
-
* authenticated user identity those JWTs carry.
|
|
21
|
-
*
|
|
22
|
-
* When the env var is unset, returns an empty overlay so the bearer
|
|
23
|
-
* chain (JWT or API key) flows through untouched.
|
|
24
|
-
*/
|
|
25
|
-
export declare function adminAuthRequestOptions(apiKey?: string): Pick<RequestOptions, 'extraHeaders' | 'skipAuth'>;
|
|
26
|
-
export declare function adminKeyFromEnv(): string | undefined;
|
|
27
|
-
export declare function requireAdminCredential(context: CommandContext, commandName: string): void;
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
import type { CommandContext } from './types.js';
|
|
2
|
-
export interface UploadItem {
|
|
3
|
-
local_path: string;
|
|
4
|
-
artifact_type: string;
|
|
5
|
-
media_type?: string;
|
|
6
|
-
title?: string;
|
|
7
|
-
execution_id?: string;
|
|
8
|
-
note?: string;
|
|
9
|
-
metadata?: Record<string, unknown>;
|
|
10
|
-
}
|
|
11
|
-
interface ResolvedUpload {
|
|
12
|
-
item: UploadItem;
|
|
13
|
-
/** Absolute path resolved from `item.local_path` against `cwd`. The upload
|
|
14
|
-
* loop reads the file just-in-time from this path so peak memory stays
|
|
15
|
-
* bounded by a single file's size, not the full batch. */
|
|
16
|
-
abs: string;
|
|
17
|
-
/** Stat-derived byte length used for size validation and (in future) for
|
|
18
|
-
* Content-Length headers when streaming. */
|
|
19
|
-
size: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function parseItems(params: Record<string, string | boolean>): Promise<UploadItem[]>;
|
|
22
|
-
/**
|
|
23
|
-
* Validate the batch against per-file size and existence rules. Reads
|
|
24
|
-
* **metadata only** (`fs.stat`) — file bodies are deliberately not loaded
|
|
25
|
-
* here so a valid 50 × 100 MB batch (the documented ceiling) cannot
|
|
26
|
-
* exhaust local RAM before the first PUT. The upload loop in
|
|
27
|
-
* `runArtifactsUpload` reads each file just-in-time, keeping at most one
|
|
28
|
-
* file's bytes resident at a time.
|
|
29
|
-
*/
|
|
30
|
-
export declare function validateItems(items: UploadItem[]): Promise<ResolvedUpload[]>;
|
|
31
|
-
export declare function runArtifactsUpload(context: CommandContext): Promise<unknown>;
|
|
32
|
-
export {};
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
import { readFile, stat } from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { CliFinalizeFailedError, CliUsageError } from '../errors.js';
|
|
4
|
-
import { EXIT_TRANSPORT } from '../exit-codes.js';
|
|
5
|
-
import { CliHttpError } from '../http/client.js';
|
|
6
|
-
import { redactExternalUrlForOutput } from '../http/debug.js';
|
|
7
|
-
import { requiredInt, requiredString, resolvePayloadJson } from './utils.js';
|
|
8
|
-
const ARTIFACT_TYPES = new Set([
|
|
9
|
-
'text', 'table', 'json', 'image', 'banner',
|
|
10
|
-
'html', 'plotly_html', 'vega', 'checkpoint', 'binary', 'diff_carousel',
|
|
11
|
-
]);
|
|
12
|
-
function finalizeRetryGuidance(requestId) {
|
|
13
|
-
return requestId
|
|
14
|
-
? `Do not rerun artifacts:upload automatically after finalize failed; inspect the node artifacts first. If the outcome is unclear, run feedback:create and include request_id ${requestId}.`
|
|
15
|
-
: 'Do not rerun artifacts:upload automatically after finalize failed; inspect the node artifacts first. If the outcome is unclear, run feedback:create and include the request details.';
|
|
16
|
-
}
|
|
17
|
-
function requestForFinalizeFailure(request) {
|
|
18
|
-
const wrapperStep = request.wrapperStep ?? 'finalize';
|
|
19
|
-
if (request.retryGuidance === undefined &&
|
|
20
|
-
request.failureKind !== 'timeout' &&
|
|
21
|
-
request.failureKind !== 'transport' &&
|
|
22
|
-
request.failureKind !== 'retryable_status') {
|
|
23
|
-
return { ...request, wrapperStep };
|
|
24
|
-
}
|
|
25
|
-
return {
|
|
26
|
-
...request,
|
|
27
|
-
wrapperStep,
|
|
28
|
-
retrySafe: false,
|
|
29
|
-
retryGuidance: finalizeRetryGuidance(request.requestId),
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
const MAX_ITEMS = 50;
|
|
33
|
-
const MAX_BYTES = 100 * 1024 * 1024;
|
|
34
|
-
function detectMediaType(filename) {
|
|
35
|
-
const dot = filename.lastIndexOf('.');
|
|
36
|
-
const ext = dot >= 0 ? filename.toLowerCase().slice(dot) : '';
|
|
37
|
-
switch (ext) {
|
|
38
|
-
case '.json': return 'application/json';
|
|
39
|
-
case '.txt':
|
|
40
|
-
case '.md': return 'text/plain';
|
|
41
|
-
case '.csv': return 'text/csv';
|
|
42
|
-
case '.html':
|
|
43
|
-
case '.htm': return 'text/html';
|
|
44
|
-
case '.png': return 'image/png';
|
|
45
|
-
case '.jpg':
|
|
46
|
-
case '.jpeg': return 'image/jpeg';
|
|
47
|
-
case '.svg': return 'image/svg+xml';
|
|
48
|
-
case '.pdf': return 'application/pdf';
|
|
49
|
-
default: return 'application/octet-stream';
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
export async function parseItems(params) {
|
|
53
|
-
const raw = await resolvePayloadJson(params, 'items');
|
|
54
|
-
if (!Array.isArray(raw) || raw.length === 0) {
|
|
55
|
-
throw new CliUsageError('items must be a non-empty JSON array');
|
|
56
|
-
}
|
|
57
|
-
if (raw.length > MAX_ITEMS) {
|
|
58
|
-
throw new CliUsageError(`items array exceeds max length ${MAX_ITEMS}; batch smaller`);
|
|
59
|
-
}
|
|
60
|
-
return raw.map((entry, i) => {
|
|
61
|
-
if (!entry || typeof entry !== 'object' || Array.isArray(entry)) {
|
|
62
|
-
throw new CliUsageError(`items[${i}] must be an object`);
|
|
63
|
-
}
|
|
64
|
-
const r = entry;
|
|
65
|
-
if (typeof r.local_path !== 'string' || !r.local_path.trim()) {
|
|
66
|
-
throw new CliUsageError(`items[${i}].local_path must be a non-empty string`);
|
|
67
|
-
}
|
|
68
|
-
if (typeof r.artifact_type !== 'string' || !ARTIFACT_TYPES.has(r.artifact_type)) {
|
|
69
|
-
throw new CliUsageError(`items[${i}].artifact_type must be one of: ${[...ARTIFACT_TYPES].join(', ')}`);
|
|
70
|
-
}
|
|
71
|
-
const item = {
|
|
72
|
-
local_path: r.local_path.trim(),
|
|
73
|
-
artifact_type: r.artifact_type,
|
|
74
|
-
};
|
|
75
|
-
if (typeof r.media_type === 'string' && r.media_type.trim())
|
|
76
|
-
item.media_type = r.media_type.trim();
|
|
77
|
-
if (typeof r.title === 'string' && r.title.trim())
|
|
78
|
-
item.title = r.title.trim();
|
|
79
|
-
if (typeof r.execution_id === 'string' && r.execution_id.trim())
|
|
80
|
-
item.execution_id = r.execution_id.trim();
|
|
81
|
-
if (typeof r.note === 'string' && r.note.trim())
|
|
82
|
-
item.note = r.note.trim();
|
|
83
|
-
if (r.metadata && typeof r.metadata === 'object' && !Array.isArray(r.metadata)) {
|
|
84
|
-
item.metadata = r.metadata;
|
|
85
|
-
}
|
|
86
|
-
return item;
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Validate the batch against per-file size and existence rules. Reads
|
|
91
|
-
* **metadata only** (`fs.stat`) — file bodies are deliberately not loaded
|
|
92
|
-
* here so a valid 50 × 100 MB batch (the documented ceiling) cannot
|
|
93
|
-
* exhaust local RAM before the first PUT. The upload loop in
|
|
94
|
-
* `runArtifactsUpload` reads each file just-in-time, keeping at most one
|
|
95
|
-
* file's bytes resident at a time.
|
|
96
|
-
*/
|
|
97
|
-
export async function validateItems(items) {
|
|
98
|
-
const resolved = [];
|
|
99
|
-
for (const item of items) {
|
|
100
|
-
const abs = path.isAbsolute(item.local_path)
|
|
101
|
-
? item.local_path
|
|
102
|
-
: path.resolve(process.cwd(), item.local_path);
|
|
103
|
-
const st = await stat(abs).catch(() => null);
|
|
104
|
-
if (!st || !st.isFile()) {
|
|
105
|
-
throw new CliUsageError(`local_path not found or not a regular file: ${item.local_path}`);
|
|
106
|
-
}
|
|
107
|
-
if (st.size > MAX_BYTES) {
|
|
108
|
-
throw new CliUsageError(`${item.local_path} exceeds max size ${MAX_BYTES} bytes (${st.size} bytes)`);
|
|
109
|
-
}
|
|
110
|
-
resolved.push({ item, abs, size: st.size });
|
|
111
|
-
}
|
|
112
|
-
return resolved;
|
|
113
|
-
}
|
|
114
|
-
export async function runArtifactsUpload(context) {
|
|
115
|
-
const nodeId = requiredString(context.params, 'node_id');
|
|
116
|
-
const expectedRevision = requiredInt(context.params, 'expected_revision');
|
|
117
|
-
const items = await parseItems(context.params);
|
|
118
|
-
const resolved = await validateItems(items);
|
|
119
|
-
if (!context.requestRawExternal) {
|
|
120
|
-
throw new CliUsageError('binary external transport unavailable in this context');
|
|
121
|
-
}
|
|
122
|
-
const prepared = await context.requestJson('POST', `/nodes/${encodeURIComponent(nodeId)}/artifacts/uploads/prepare`, {
|
|
123
|
-
body: {
|
|
124
|
-
expected_revision: expectedRevision,
|
|
125
|
-
items: items.map((it) => {
|
|
126
|
-
const filename = path.basename(it.local_path);
|
|
127
|
-
const out = {
|
|
128
|
-
artifact_type: it.artifact_type,
|
|
129
|
-
filename,
|
|
130
|
-
media_type: it.media_type ?? detectMediaType(filename),
|
|
131
|
-
};
|
|
132
|
-
if (it.title)
|
|
133
|
-
out.title = it.title;
|
|
134
|
-
if (it.execution_id)
|
|
135
|
-
out.execution_id = it.execution_id;
|
|
136
|
-
if (it.note)
|
|
137
|
-
out.note = it.note;
|
|
138
|
-
if (it.metadata)
|
|
139
|
-
out.metadata = it.metadata;
|
|
140
|
-
return out;
|
|
141
|
-
}),
|
|
142
|
-
},
|
|
143
|
-
wrapperStep: 'prepare',
|
|
144
|
-
});
|
|
145
|
-
const batchItems = prepared?.batch?.items;
|
|
146
|
-
const batchToken = prepared?.batch?.batch_token;
|
|
147
|
-
if (!batchToken || !Array.isArray(batchItems) || batchItems.length !== resolved.length) {
|
|
148
|
-
throw new CliUsageError('prepare response did not include the expected batch envelope; server contract changed');
|
|
149
|
-
}
|
|
150
|
-
const orphanBlobIds = [];
|
|
151
|
-
for (let i = 0; i < resolved.length; i += 1) {
|
|
152
|
-
const batchItem = batchItems[i];
|
|
153
|
-
const { abs, item } = resolved[i];
|
|
154
|
-
// Read just-in-time so peak memory is bounded by one file at a time
|
|
155
|
-
// rather than the full batch. Each iteration's Buffer becomes
|
|
156
|
-
// unreachable when the next iteration overwrites the binding (and
|
|
157
|
-
// when `runArtifactsUpload` returns), letting V8 reclaim it before
|
|
158
|
-
// the next 100 MB allocation.
|
|
159
|
-
const bytes = await readFile(abs);
|
|
160
|
-
// Time-of-check / time-of-use guard: `validateItems` stat'd the
|
|
161
|
-
// file size before `prepare` fired, but a log or artifact that is
|
|
162
|
-
// still being written can grow between stat and read. Without a
|
|
163
|
-
// re-check, `readFile` would load an oversized payload into
|
|
164
|
-
// memory and hand it to the signed-URL PUT, bypassing the
|
|
165
|
-
// documented MAX_BYTES ceiling. Re-validate the actual byte
|
|
166
|
-
// count and fail the whole batch instead of letting one oversized
|
|
167
|
-
// item through.
|
|
168
|
-
if (bytes.length > MAX_BYTES) {
|
|
169
|
-
throw new CliUsageError(`${item.local_path} exceeds max size ${MAX_BYTES} bytes (${bytes.length} bytes at read time; file grew after validation)`);
|
|
170
|
-
}
|
|
171
|
-
const response = await context.requestRawExternal(batchItem.method ?? 'PUT', batchItem.upload_url, {
|
|
172
|
-
rawBody: new Uint8Array(bytes),
|
|
173
|
-
extraHeaders: batchItem.headers,
|
|
174
|
-
wrapperStep: 'signed_upload_put',
|
|
175
|
-
});
|
|
176
|
-
if (!response.ok) {
|
|
177
|
-
// Signed-URL PUT failures (expired URL, transient 5xx from the
|
|
178
|
-
// object store, rate limiting, etc.) are transport-class: the
|
|
179
|
-
// caller's input was valid, but the remote side returned non-2xx.
|
|
180
|
-
// Using CliHttpError (exit 2) keeps the upload path consistent with
|
|
181
|
-
// every other HTTP error and lets script retry-on-transport loops
|
|
182
|
-
// treat it uniformly.
|
|
183
|
-
throw new CliHttpError(`upload PUT failed for ${item.local_path} with status ${response.status}`, EXIT_TRANSPORT, response.status, undefined, {
|
|
184
|
-
method: 'PUT',
|
|
185
|
-
path: redactExternalUrlForOutput(batchItem.upload_url),
|
|
186
|
-
wrapperStep: 'signed_upload_put',
|
|
187
|
-
attempt: 1,
|
|
188
|
-
maxAttempts: 1,
|
|
189
|
-
failureKind: 'http_status',
|
|
190
|
-
});
|
|
191
|
-
}
|
|
192
|
-
if (batchItem.upload_id)
|
|
193
|
-
orphanBlobIds.push(batchItem.upload_id);
|
|
194
|
-
}
|
|
195
|
-
try {
|
|
196
|
-
return await context.requestJson('POST', `/nodes/${encodeURIComponent(nodeId)}/artifacts/uploads/finalize`, { body: { batch_token: batchToken }, wrapperStep: 'finalize' });
|
|
197
|
-
}
|
|
198
|
-
catch (error) {
|
|
199
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
200
|
-
if (error instanceof CliHttpError) {
|
|
201
|
-
throw new CliFinalizeFailedError(message, {
|
|
202
|
-
orphanBlobIds,
|
|
203
|
-
status: error.status,
|
|
204
|
-
body: error.body,
|
|
205
|
-
request: error.request
|
|
206
|
-
? requestForFinalizeFailure(error.request)
|
|
207
|
-
: undefined,
|
|
208
|
-
});
|
|
209
|
-
}
|
|
210
|
-
throw new CliFinalizeFailedError(message, { orphanBlobIds });
|
|
211
|
-
}
|
|
212
|
-
}
|
|
213
|
-
//# sourceMappingURL=_artifacts-upload-helpers.js.map
|
|
@@ -1 +0,0 @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C;IACnE,CAAC;IACD,IAAI,CAAC;QACH,OAAO,MAAM,OAAO,CAAC,WAAW,CAC9B,MAAM,EACN,UAAU,kBAAkB,CAAC,MAAM,CAAC,6BAA6B,EACjE,EAAE,IAAI,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,EAAE,WAAW,EAAE,UAAU,EAAE,CAC/D,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACvE,IAAI,KAAK,YAAY,YAAY,EAAE,CAAC;YAClC,MAAM,IAAI,sBAAsB,CAAC,OAAO,EAAE;gBACxC,aAAa;gBACb,MAAM,EAAE,KAAK,CAAC,MAAM;gBACpB,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,OAAO,EAAE,KAAK,CAAC,OAAO;oBACpB,CAAC,CAAC,yBAAyB,CAAC,KAAK,CAAC,OAAO,CAAC;oBAC1C,CAAC,CAAC,SAAS;aACd,CAAC,CAAC;QACL,CAAC;QACD,MAAM,IAAI,sBAAsB,CAAC,OAAO,EAAE,EAAE,aAAa,EAAE,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import type { CliGlobals } from "../grammar/globals.js";
|
|
2
|
-
export interface BrowserHandoffResult {
|
|
3
|
-
status: "browser_flow_required";
|
|
4
|
-
command: string;
|
|
5
|
-
url: string;
|
|
6
|
-
opened: boolean;
|
|
7
|
-
next_action: string;
|
|
8
|
-
}
|
|
9
|
-
export interface PrivateBrowserHandoffResult {
|
|
10
|
-
status: "private_browser_handoff_started";
|
|
11
|
-
command: string;
|
|
12
|
-
opened: true;
|
|
13
|
-
next_action: string;
|
|
14
|
-
}
|
|
15
|
-
/**
|
|
16
|
-
* Normalizes route-specific browser URLs into the CLI's stable handoff result.
|
|
17
|
-
* Billing routes expose Stripe-shaped checkout/portal fields, while OAuth and
|
|
18
|
-
* generic handoffs use open_url/url.
|
|
19
|
-
*/
|
|
20
|
-
export declare function extractOpenUrl(payload: Record<string, unknown>): string;
|
|
21
|
-
export declare function requirePrivateBrowserHandoff(globals: CliGlobals | undefined): void;
|
|
22
|
-
export declare function buildBrowserHandoffResult({ command, url, globals, stderr, nextAction, }: {
|
|
23
|
-
command: string;
|
|
24
|
-
url: string;
|
|
25
|
-
globals: CliGlobals | undefined;
|
|
26
|
-
stderr?: (chunk: string) => void;
|
|
27
|
-
nextAction: string;
|
|
28
|
-
}): Promise<BrowserHandoffResult>;
|
|
29
|
-
export declare function buildPrivateBrowserHandoffResult({ command, url, globals, stderr, nextAction, }: {
|
|
30
|
-
command: string;
|
|
31
|
-
url: string;
|
|
32
|
-
globals: CliGlobals | undefined;
|
|
33
|
-
stderr?: (chunk: string) => void;
|
|
34
|
-
nextAction: string;
|
|
35
|
-
}): Promise<PrivateBrowserHandoffResult>;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
interface ResolveSecretParamOptions {
|
|
2
|
-
readonly valueKey: string;
|
|
3
|
-
readonly envKey: string;
|
|
4
|
-
readonly label: string;
|
|
5
|
-
}
|
|
6
|
-
export declare function resolveSecretParam(params: Record<string, string | boolean>, options: ResolveSecretParamOptions): string;
|
|
7
|
-
export {};
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { type WriteStream } from 'node:fs';
|
|
2
|
-
/**
|
|
3
|
-
* Lifecycle handle for an ``--out`` destination.
|
|
4
|
-
*
|
|
5
|
-
* ``stream`` is the open writable stream the caller feeds bytes into.
|
|
6
|
-
* The stream writes to a sibling ``.partial`` temp file, NOT the final
|
|
7
|
-
* destination, so an aborted run cannot clobber a previously-good file
|
|
8
|
-
* at ``outPath``.
|
|
9
|
-
*
|
|
10
|
-
* Callers MUST invoke exactly one of:
|
|
11
|
-
*
|
|
12
|
-
* * :func:`finalize` after the last successful write + stream close —
|
|
13
|
-
* atomically renames the temp over ``outPath`` on filesystems that
|
|
14
|
-
* support ``rename(2)`` semantics (all POSIX targets + Windows).
|
|
15
|
-
* * :func:`abort` on any failure path — best-effort removes the temp so
|
|
16
|
-
* a retry starts clean.
|
|
17
|
-
*/
|
|
18
|
-
export interface OutputFileHandle {
|
|
19
|
-
readonly stream: WriteStream;
|
|
20
|
-
finalize(): Promise<void>;
|
|
21
|
-
abort(): Promise<void>;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Validate and open a writable destination for an ``--out`` path.
|
|
25
|
-
*
|
|
26
|
-
* Returns an :class:`OutputFileHandle` when ``outPath`` is a concrete
|
|
27
|
-
* filesystem path, or ``null`` when the caller is streaming to stdout
|
|
28
|
-
* (``outPath`` is absent or the literal ``"-"``).
|
|
29
|
-
*
|
|
30
|
-
* The handle is backed by a ``<outPath>.partial`` temp file opened in
|
|
31
|
-
* the same directory so the final ``rename`` is atomic (same
|
|
32
|
-
* filesystem). The temp file is fully opened (``"open"`` event
|
|
33
|
-
* resolved) before this function returns, so callers can still order
|
|
34
|
-
* this BEFORE dispatching an expensive server-side request — a bad
|
|
35
|
-
* destination raises a typed :class:`CliUsageError` without any
|
|
36
|
-
* network traffic, but the caller's previous ``outPath`` contents are
|
|
37
|
-
* never overwritten until ``finalize`` succeeds.
|
|
38
|
-
*/
|
|
39
|
-
export declare function openWriteStreamOrFail(outPath: string | undefined): Promise<OutputFileHandle | null>;
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import type { WriteStream } from 'node:fs';
|
|
2
|
-
/**
|
|
3
|
-
* Async write helper that makes Node.js writable-stream failures
|
|
4
|
-
* observable during long-running streaming commands.
|
|
5
|
-
*
|
|
6
|
-
* Background: `WriteStream.write(chunk)` is fire-and-forget — the
|
|
7
|
-
* synchronous return value only signals backpressure, not success.
|
|
8
|
-
* Actual I/O failures (ENOSPC, EIO, EPIPE, write on a destroyed
|
|
9
|
-
* destination) surface later as an asynchronous ``'error'`` event.
|
|
10
|
-
* Without a dedicated listener + in-loop propagation, long JSONL /
|
|
11
|
-
* NDJSON exports to ``--out=<file>`` can be truncated silently while
|
|
12
|
-
* the command exits 0 — the user never learns their export is
|
|
13
|
-
* incomplete.
|
|
14
|
-
*
|
|
15
|
-
* Standard Node.js pattern: register one ``'error'`` listener, latch
|
|
16
|
-
* the first error, await ``'drain'`` whenever ``write()`` returns
|
|
17
|
-
* ``false`` (backpressure), and re-check the latched error before and
|
|
18
|
-
* after every write. On ``close()`` we also pass any deferred error to
|
|
19
|
-
* ``stream.end()`` so the command cannot succeed over a truncated
|
|
20
|
-
* file.
|
|
21
|
-
*/
|
|
22
|
-
export interface SafeStreamWriter {
|
|
23
|
-
/**
|
|
24
|
-
* Append a chunk; rejects with the captured error if the stream has
|
|
25
|
-
* failed (or fails during the write).
|
|
26
|
-
*/
|
|
27
|
-
write: (chunk: string | Uint8Array) => Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Flush the final buffered chunk and wait for ``'finish'``. Rejects
|
|
30
|
-
* with the captured error if the stream has failed at any point.
|
|
31
|
-
*/
|
|
32
|
-
close: () => Promise<void>;
|
|
33
|
-
}
|
|
34
|
-
export declare function makeSafeStreamWriter(stream: WriteStream): SafeStreamWriter;
|