@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
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
2
|
+
import { RepositoryCommit } from "../../domain/models/commits.js";
|
|
3
|
+
import { canonicalBytes, stringifyRepositoryJson } from "../../domain/models/encoding.js";
|
|
4
|
+
import { isDigest, isRecord, isUuid } from "../../domain/models/constants.js";
|
|
5
|
+
import { decodePublishedCursor, encodePublishedCursor, encodeSessionCursor } from "../../domain/sync/cursors.js";
|
|
6
|
+
const MAX_TRANSFER_CHUNKS = 256;
|
|
7
|
+
const MAX_TRANSFER_CHUNK_BYTES = 32 * 1024 * 1024;
|
|
8
|
+
const MAX_SNAPSHOT_FRAGMENT_BYTES = 16 * 1024 * 1024;
|
|
9
|
+
const MAX_OBJECT_BYTES = 10 * 1024 * 1024;
|
|
10
|
+
function fail(message) {
|
|
11
|
+
throw new Error(message);
|
|
12
|
+
}
|
|
13
|
+
export function responseRecord(value, message) {
|
|
14
|
+
if (!isRecord(value))
|
|
15
|
+
fail(message);
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
function responseString(value, message) {
|
|
19
|
+
if (typeof value !== "string")
|
|
20
|
+
fail(message);
|
|
21
|
+
return value;
|
|
22
|
+
}
|
|
23
|
+
function nullableDigest(value, message) {
|
|
24
|
+
if (value === null)
|
|
25
|
+
return null;
|
|
26
|
+
if (!isDigest(value))
|
|
27
|
+
fail(message);
|
|
28
|
+
return value;
|
|
29
|
+
}
|
|
30
|
+
function nullableString(value, message) {
|
|
31
|
+
if (value === null)
|
|
32
|
+
return null;
|
|
33
|
+
return responseString(value, message);
|
|
34
|
+
}
|
|
35
|
+
export function counter(value, message, maximum) {
|
|
36
|
+
if ((typeof value !== "number" && typeof value !== "bigint") ||
|
|
37
|
+
(typeof value === "number" && !Number.isSafeInteger(value))) {
|
|
38
|
+
fail(message);
|
|
39
|
+
}
|
|
40
|
+
const integer = BigInt(value);
|
|
41
|
+
if (integer < 0n || maximum !== undefined && integer > maximum)
|
|
42
|
+
fail(message);
|
|
43
|
+
return integer;
|
|
44
|
+
}
|
|
45
|
+
function strictBase64(value, message) {
|
|
46
|
+
if (typeof value !== "string") {
|
|
47
|
+
fail(message);
|
|
48
|
+
}
|
|
49
|
+
const decoded = Buffer.from(value, "base64");
|
|
50
|
+
if (decoded.toString("base64") !== value)
|
|
51
|
+
fail(message);
|
|
52
|
+
return decoded;
|
|
53
|
+
}
|
|
54
|
+
function digest(domain, bytes) {
|
|
55
|
+
return `sha256:${createHash("sha256").update(domain).update(bytes).digest("hex")}`;
|
|
56
|
+
}
|
|
57
|
+
function pathPart(value) {
|
|
58
|
+
return encodeURIComponent(value);
|
|
59
|
+
}
|
|
60
|
+
export function repositoryOptions(body, idempotencyKey) {
|
|
61
|
+
return {
|
|
62
|
+
rawBody: stringifyRepositoryJson(body),
|
|
63
|
+
extraHeaders: { "content-type": "application/json" },
|
|
64
|
+
idempotencyKey,
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function associationBaseUrl(value) {
|
|
68
|
+
let parsed;
|
|
69
|
+
try {
|
|
70
|
+
parsed = new URL(value);
|
|
71
|
+
}
|
|
72
|
+
catch {
|
|
73
|
+
fail("repository hosted association does not match credentials");
|
|
74
|
+
}
|
|
75
|
+
if ((parsed.protocol !== "http:" && parsed.protocol !== "https:") || parsed.username || parsed.password || parsed.search || parsed.hash) {
|
|
76
|
+
fail("repository hosted association does not match credentials");
|
|
77
|
+
}
|
|
78
|
+
const port = (parsed.protocol === "https:" && parsed.port === "443") || (parsed.protocol === "http:" && parsed.port === "80")
|
|
79
|
+
? "" : parsed.port;
|
|
80
|
+
return `${parsed.protocol}//${parsed.hostname.toLowerCase()}${port ? `:${port}` : ""}${parsed.pathname.replace(/\/+$/, "")}`;
|
|
81
|
+
}
|
|
82
|
+
export function requireMatchingAssociation(association, connection) {
|
|
83
|
+
if (association === null)
|
|
84
|
+
return false;
|
|
85
|
+
if (association[1] !== connection.profile || associationBaseUrl(association[0]) !== associationBaseUrl(connection.baseUrl)) {
|
|
86
|
+
fail("repository hosted association does not match credentials");
|
|
87
|
+
}
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
export async function requestObject(connection, repositoryId, objectDigest) {
|
|
91
|
+
return connection.client.requestRepositoryRaw("GET", `/repositories/${pathPart(repositoryId)}/objects/${pathPart(objectDigest)}`, async (response) => {
|
|
92
|
+
const contentLength = response.headers.get("content-length");
|
|
93
|
+
if (contentLength !== null && (!/^\d+$/.test(contentLength) || BigInt(contentLength) > BigInt(MAX_OBJECT_BYTES))) {
|
|
94
|
+
await response.body?.cancel();
|
|
95
|
+
fail("repository object is too large");
|
|
96
|
+
}
|
|
97
|
+
if (response.body === null)
|
|
98
|
+
return Buffer.alloc(0);
|
|
99
|
+
const reader = response.body.getReader();
|
|
100
|
+
const chunks = [];
|
|
101
|
+
let size = 0;
|
|
102
|
+
try {
|
|
103
|
+
while (true) {
|
|
104
|
+
const { done, value } = await reader.read();
|
|
105
|
+
if (done)
|
|
106
|
+
return Buffer.concat(chunks, size);
|
|
107
|
+
if (value.byteLength > MAX_OBJECT_BYTES - size) {
|
|
108
|
+
await reader.cancel();
|
|
109
|
+
fail("repository object is too large");
|
|
110
|
+
}
|
|
111
|
+
chunks.push(value);
|
|
112
|
+
size += value.byteLength;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
finally {
|
|
116
|
+
reader.releaseLock();
|
|
117
|
+
}
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
export async function uploadObject(connection, repositoryId, requestId, objectDigest, bytes) {
|
|
121
|
+
if (!isUuid(requestId))
|
|
122
|
+
fail("repository object upload request is invalid");
|
|
123
|
+
const response = responseRecord(await connection.client.requestRepositoryJson("PUT", `/repositories/${pathPart(repositoryId)}/objects/${pathPart(objectDigest)}`, {
|
|
124
|
+
rawBody: bytes,
|
|
125
|
+
extraHeaders: { "content-type": "application/octet-stream", "content-length": String(bytes.byteLength) },
|
|
126
|
+
idempotencyKey: requestId,
|
|
127
|
+
}), "repository object upload response is invalid");
|
|
128
|
+
if (response.digest !== objectDigest || response.size !== bytes.byteLength || typeof response.stored !== "boolean") {
|
|
129
|
+
fail("repository object upload response is invalid");
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
function decodeFrames(frames, repositoryId, objectMode) {
|
|
133
|
+
const commits = [];
|
|
134
|
+
const fragments = new Map();
|
|
135
|
+
const objectDigests = [];
|
|
136
|
+
let snapshotDigest = null;
|
|
137
|
+
let fragmentCount = null;
|
|
138
|
+
for (const candidate of frames) {
|
|
139
|
+
const frame = responseRecord(candidate, "repository transfer frame is invalid");
|
|
140
|
+
switch (frame.kind) {
|
|
141
|
+
case "header": {
|
|
142
|
+
if (snapshotDigest !== null || frame.object_mode !== objectMode || !isDigest(frame.snapshot_digest)) {
|
|
143
|
+
fail("repository transfer header is duplicated");
|
|
144
|
+
}
|
|
145
|
+
snapshotDigest = frame.snapshot_digest;
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
case "commit": {
|
|
149
|
+
const raw = strictBase64(frame.canonical_b64, "repository transfer frame is invalid");
|
|
150
|
+
const commitId = responseString(frame.commit_id, "repository transfer frame is invalid");
|
|
151
|
+
let commit;
|
|
152
|
+
try {
|
|
153
|
+
commit = RepositoryCommit.fromCanonicalBytes(commitId, raw);
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
throw new Error("repository transfer commit is invalid", { cause: error });
|
|
157
|
+
}
|
|
158
|
+
if (commit.repositoryId !== repositoryId)
|
|
159
|
+
fail("repository transfer commit is invalid");
|
|
160
|
+
commits.push(commit);
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
case "snapshot": {
|
|
164
|
+
const index = counter(frame.fragment_index, "repository transfer snapshot frame is invalid", 0xffffffffn);
|
|
165
|
+
const count = counter(frame.fragment_count, "repository transfer snapshot frame is invalid", 0xffffffffn);
|
|
166
|
+
if (count === 0n || index >= count || count > 512n || fragmentCount !== null && fragmentCount !== Number(count) || fragments.has(Number(index))) {
|
|
167
|
+
fail("repository transfer snapshot frame is invalid");
|
|
168
|
+
}
|
|
169
|
+
const fragment = strictBase64(frame.fragment_b64, "repository transfer snapshot frame is invalid");
|
|
170
|
+
if (fragment.length > MAX_SNAPSHOT_FRAGMENT_BYTES)
|
|
171
|
+
fail("repository transfer snapshot frame is invalid");
|
|
172
|
+
fragmentCount = Number(count);
|
|
173
|
+
fragments.set(Number(index), fragment);
|
|
174
|
+
break;
|
|
175
|
+
}
|
|
176
|
+
case "object": {
|
|
177
|
+
if (!isDigest(frame.digest))
|
|
178
|
+
fail("repository transfer frame is invalid");
|
|
179
|
+
objectDigests.push(frame.digest);
|
|
180
|
+
break;
|
|
181
|
+
}
|
|
182
|
+
default:
|
|
183
|
+
fail("repository transfer frame is invalid");
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
if (snapshotDigest === null || fragmentCount === null || fragments.size !== fragmentCount ||
|
|
187
|
+
objectDigests.join("\0") !== [...new Set(objectDigests)].sort().join("\0")) {
|
|
188
|
+
fail("repository transfer frame set is invalid");
|
|
189
|
+
}
|
|
190
|
+
const snapshot = Buffer.concat(Array.from({ length: fragmentCount }, (_, index) => {
|
|
191
|
+
const fragment = fragments.get(index);
|
|
192
|
+
if (fragment === undefined)
|
|
193
|
+
fail("repository transfer frame set is invalid");
|
|
194
|
+
return fragment;
|
|
195
|
+
}));
|
|
196
|
+
if (digest("flywheel.repository.snapshot.v1\0", snapshot) !== snapshotDigest) {
|
|
197
|
+
fail("repository transfer snapshot digest is invalid");
|
|
198
|
+
}
|
|
199
|
+
return { commits, snapshot, objectDigests };
|
|
200
|
+
}
|
|
201
|
+
function manifestDigest(kind, input) {
|
|
202
|
+
const manifest = kind === "clone"
|
|
203
|
+
? {
|
|
204
|
+
chunk_digests: input.chunkDigests, head: input.head, object_mode: input.objectMode, references: input.references,
|
|
205
|
+
repository_id: input.repositoryId, schema: "flywheel.repository.clone-manifest.v1", session_id: input.sessionId,
|
|
206
|
+
}
|
|
207
|
+
: {
|
|
208
|
+
after_cursor: input.afterCursor, chunk_digests: input.chunkDigests, local_head: input.localHead,
|
|
209
|
+
object_mode: input.objectMode, references: input.references, repository_id: input.repositoryId,
|
|
210
|
+
schema: "flywheel.repository.pull-manifest.v1", session_id: input.sessionId,
|
|
211
|
+
target_cursor: input.targetCursor, target_head: input.head,
|
|
212
|
+
};
|
|
213
|
+
return digest(kind === "clone" ? "flywheel.clone-session-manifest.v1\0" : "flywheel.pull-session-manifest.v1\0", canonicalBytes(manifest));
|
|
214
|
+
}
|
|
215
|
+
export async function fetchTransfer(input) {
|
|
216
|
+
const sessionId = randomUUID();
|
|
217
|
+
const { connection, kind, repositoryId, clientId, objectMode } = input;
|
|
218
|
+
const request = kind === "clone"
|
|
219
|
+
? { wire_version: 2, session_id: sessionId, client_id: clientId, object_mode: objectMode }
|
|
220
|
+
: { wire_version: 2, session_id: sessionId, client_id: clientId, after_cursor: input.afterCursor ?? null, local_head: input.localHead ?? null, object_mode: objectMode };
|
|
221
|
+
const session = responseRecord(await connection.client.requestRepositoryJson("POST", `/repositories/${pathPart(repositoryId)}/${kind}-sessions`, repositoryOptions(request, sessionId)), `repository ${kind} session is invalid`);
|
|
222
|
+
const head = nullableDigest(session[kind === "clone" ? "head" : "target_head"], `repository ${kind} session is invalid`);
|
|
223
|
+
const targetCursor = nullableString(session[kind === "clone" ? "cursor" : "target_cursor"], `repository ${kind} session is invalid`);
|
|
224
|
+
const totalChunks = counter(session.total_chunks, "repository transfer session is invalid", BigInt(MAX_TRANSFER_CHUNKS));
|
|
225
|
+
if (session.session_id !== sessionId || session.repository_id !== repositoryId || totalChunks === 0n || !isDigest(session.manifest_digest)) {
|
|
226
|
+
fail(`repository ${kind} session is invalid`);
|
|
227
|
+
}
|
|
228
|
+
const chunkDigests = [];
|
|
229
|
+
const frames = [];
|
|
230
|
+
let after = null;
|
|
231
|
+
for (let ordinal = 0; ordinal < Number(totalChunks); ordinal += 1) {
|
|
232
|
+
const query = after === null ? undefined : { after };
|
|
233
|
+
const chunk = responseRecord(await connection.client.requestRepositoryJson("GET", `/repositories/${pathPart(repositoryId)}/${kind}-sessions/${pathPart(sessionId)}/chunks`, { query }), "repository transfer chunk is invalid");
|
|
234
|
+
const payload = responseRecord(chunk.payload, "repository transfer chunk is invalid");
|
|
235
|
+
const payloadBytes = canonicalBytes(payload);
|
|
236
|
+
const expectedNext = ordinal === Number(totalChunks) - 1 ? null : encodeSessionCursor(sessionId, ordinal);
|
|
237
|
+
const chunkDigest = digest("flywheel.transfer-chunk.v1\0", payloadBytes);
|
|
238
|
+
if (payloadBytes.length > MAX_TRANSFER_CHUNK_BYTES || chunk.session_id !== sessionId ||
|
|
239
|
+
counter(chunk.ordinal, "repository transfer chunk is invalid", 0xffffffffn) !== BigInt(ordinal) ||
|
|
240
|
+
chunk.payload_digest !== chunkDigest || chunk.next_cursor !== expectedNext || chunk.is_final !== (expectedNext === null) ||
|
|
241
|
+
payload.schema !== "flywheel.repository.transfer-chunk-payload.v1" || payload.repository_id !== repositoryId ||
|
|
242
|
+
counter(payload.ordinal, "repository transfer chunk is invalid", 0xffffffffn) !== BigInt(ordinal) ||
|
|
243
|
+
payload.head !== head || !Array.isArray(payload.frames)) {
|
|
244
|
+
fail("repository transfer chunk is invalid");
|
|
245
|
+
}
|
|
246
|
+
frames.push(...payload.frames);
|
|
247
|
+
chunkDigests.push(chunkDigest);
|
|
248
|
+
after = expectedNext;
|
|
249
|
+
}
|
|
250
|
+
const decoded = decodeFrames(frames, repositoryId, objectMode);
|
|
251
|
+
if (manifestDigest(kind, {
|
|
252
|
+
sessionId, repositoryId, head, targetCursor, afterCursor: input.afterCursor ?? null, localHead: input.localHead ?? null,
|
|
253
|
+
objectMode, chunkDigests, references: decoded.objectDigests,
|
|
254
|
+
}) !== session.manifest_digest) {
|
|
255
|
+
fail("repository transfer manifest digest is invalid");
|
|
256
|
+
}
|
|
257
|
+
return { sessionId, targetHead: head, targetCursor, manifestDigest: session.manifest_digest, ...decoded };
|
|
258
|
+
}
|
|
259
|
+
export function publishedSequence(repositoryId, cursor) {
|
|
260
|
+
if (cursor === null)
|
|
261
|
+
return 0n;
|
|
262
|
+
try {
|
|
263
|
+
return decodePublishedCursor(repositoryId, cursor);
|
|
264
|
+
}
|
|
265
|
+
catch (error) {
|
|
266
|
+
throw new Error("repository cursor is invalid", { cause: error });
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
export function publishedCursor(repositoryId, sequence) {
|
|
270
|
+
try {
|
|
271
|
+
return encodePublishedCursor(repositoryId, sequence);
|
|
272
|
+
}
|
|
273
|
+
catch (error) {
|
|
274
|
+
throw new Error("repository cursor is invalid", { cause: error });
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../../../src/local/runtime/remote/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,gCAAgC,CAAC;AAClE,OAAO,EAAE,cAAc,EAAE,uBAAuB,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,E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E,KAAK,CAAC,SAAS,IAAI,IAAI;QACvH,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,OAAO,CAAC,aAAa;KAC3D,CAAC,KAAK,OAAO,CAAC,eAAe,EAAE,CAAC;QAChC,IAAI,CAAC,gDAAgD,CAAC,CAAC;IACxD,CAAC;IACD,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,IAAI,EAAE,YAAY,EAAE,cAAc,EAAE,OAAO,CAAC,eAAe,EAAE,GAAG,OAAO,EAAE,CAAC;AAC3G,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,YAAoB,EAAE,MAAqB;IAC5E,IAAI,MAAM,KAAK,IAAI;QAAE,OAAO,EAAE,CAAC;IAC/B,IAAI,CAAC;QACJ,OAAO,qBAAqB,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACnE,CAAC;AACF,CAAC;AAED,MAAM,UAAU,eAAe,CAAC,YAAoB,EAAE,QAAgB;IACrE,IAAI,CAAC;QACJ,OAAO,qBAAqB,CAAC,YAAY,EAAE,QAAQ,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,MAAM,IAAI,KAAK,CAAC,8BAA8B,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACnE,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { RepositoryContractError } from "../domain/errors.js";
|
|
3
|
+
import { RepositoryCommit } from "../domain/models/commits.js";
|
|
4
|
+
import { MAX_COMMIT_METADATA_BYTES } from "../domain/models/constants.js";
|
|
5
|
+
import { parseRepositoryJson } from "../domain/models/encoding.js";
|
|
6
|
+
import { latestValuesBytes, stagingBytes, stagingDigest } from "../domain/service/staging.js";
|
|
7
|
+
import { canonicalLatestGroup, persistCommit, workspaceHeadIn } from "./commits.js";
|
|
8
|
+
import { latestValueWrites } from "./latest-values.js";
|
|
9
|
+
import { applyProjection } from "./projection/apply.js";
|
|
10
|
+
import { withWriteConnectionAsync } from "./sqlite/connection.js";
|
|
11
|
+
import { RepositoryStoreError } from "./sqlite/errors.js";
|
|
12
|
+
import { runSql } from "./sqlite/rows.js";
|
|
13
|
+
import { verifyFormat } from "./sqlite/verify.js";
|
|
14
|
+
import { workspaceStateIn } from "./workspace-state.js";
|
|
15
|
+
const COMMIT_SCALARS = ["repositoryId", "commitId", "parentCommitId", "authorKind", "authorId", "authoredAt", "message", "intent", "rebasedFrom"];
|
|
16
|
+
function sameStrings(left, right) {
|
|
17
|
+
return left.length === right.length && left.every((value, index) => value === right[index]);
|
|
18
|
+
}
|
|
19
|
+
export function verifyCommitFields(commit) {
|
|
20
|
+
try {
|
|
21
|
+
const parsed = RepositoryCommit.fromCanonicalBytes(commit.commitId, commit.canonicalBytes);
|
|
22
|
+
if (COMMIT_SCALARS.some(field => commit[field] !== parsed[field]) ||
|
|
23
|
+
!sameStrings(commit.latestStateDigests, parsed.latestStateDigests) || !sameStrings(commit.artifactDigests, parsed.artifactDigests) ||
|
|
24
|
+
commit.operations.length !== parsed.operations.length ||
|
|
25
|
+
commit.operations.some((operation, index) => !operation.canonicalBytes.equals(parsed.operations[index].canonicalBytes))) {
|
|
26
|
+
throw new RepositoryStoreError("commit fields do not match canonical bytes");
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
catch (error) {
|
|
30
|
+
if (!(error instanceof RepositoryContractError))
|
|
31
|
+
throw error;
|
|
32
|
+
throw new RepositoryStoreError("commit body is invalid", { cause: error });
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function assertArtifactObjectsAvailable(commit, objects) {
|
|
36
|
+
for (const operation of commit.operations) {
|
|
37
|
+
if (operation.type !== "artifact.attach.v1" && operation.type !== "artifact.attach.v2" &&
|
|
38
|
+
operation.type !== "artifact.content.set.v1")
|
|
39
|
+
continue;
|
|
40
|
+
if (objects === null)
|
|
41
|
+
throw new RepositoryStoreError("artifact object storage is not configured");
|
|
42
|
+
const digest = operation.payload.object_digest;
|
|
43
|
+
if (typeof digest !== "string")
|
|
44
|
+
throw new RepositoryStoreError("artifact object digest is invalid");
|
|
45
|
+
let bytes;
|
|
46
|
+
try {
|
|
47
|
+
bytes = await objects.download(digest);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
if (typeof error !== "object" || error === null || !("code" in error) || error.code !== "ENOENT")
|
|
51
|
+
throw error;
|
|
52
|
+
throw new RepositoryStoreError("artifact object is unavailable", { cause: error });
|
|
53
|
+
}
|
|
54
|
+
if (`sha256:${createHash("sha256").update(bytes).digest("hex")}` !== digest) {
|
|
55
|
+
throw new RepositoryStoreError("artifact object digest is unavailable");
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
function prepareStaging(database, batch, commit, timestamp) {
|
|
60
|
+
if (!batch.clearStaging)
|
|
61
|
+
return;
|
|
62
|
+
const workspace = workspaceStateIn(database, commit.repositoryId);
|
|
63
|
+
if (workspace.staging.state !== "open")
|
|
64
|
+
throw new RepositoryStoreError("staged commit operations are stale");
|
|
65
|
+
if (commit.intent !== null && /^revert:sha256:[0-9a-f]{64}$/.test(commit.intent)) {
|
|
66
|
+
if (workspace.staging.operations.length !== 0 || workspace.staging.latestValues.length !== 0 ||
|
|
67
|
+
workspace.staging.digest !== stagingDigest([], []))
|
|
68
|
+
throw new RepositoryStoreError("revert requires empty repository staging");
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const committedLatest = canonicalLatestGroup(batch.latestValueWrites);
|
|
72
|
+
if (workspace.staging.digest !== stagingDigest(commit.operations, parseRepositoryJson(committedLatest.toString("utf8"))) ||
|
|
73
|
+
!stagingBytes(workspace.staging.operations).equals(stagingBytes(commit.operations)) ||
|
|
74
|
+
!latestValuesBytes(workspace.staging.latestValues).equals(committedLatest)) {
|
|
75
|
+
throw new RepositoryStoreError("staged commit operations are stale");
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
runSql(database.prepare("UPDATE repository_staging SET state = 'prepared', updated_at = ? WHERE repository_id = ?"), timestamp, commit.repositoryId);
|
|
79
|
+
}
|
|
80
|
+
export async function applyOrdinaryAtomic(state, batch, objects) {
|
|
81
|
+
if (batch.canonicalCommits.length !== 1)
|
|
82
|
+
throw new RepositoryStoreError("local v1 applies exactly one canonical commit");
|
|
83
|
+
const commit = batch.canonicalCommits[0];
|
|
84
|
+
if (commit.authorKind !== "client")
|
|
85
|
+
throw new RepositoryStoreError("local commit author must be client");
|
|
86
|
+
if (batch.repositoryId !== commit.repositoryId || batch.expectedHead !== commit.expectedHead) {
|
|
87
|
+
throw new RepositoryStoreError("atomic batch repository or head does not match commit");
|
|
88
|
+
}
|
|
89
|
+
if (batch.resultingHead !== commit.commitId || batch.localWorkspaceHead !== commit.commitId)
|
|
90
|
+
throw new RepositoryStoreError("atomic batch head result is invalid");
|
|
91
|
+
verifyCommitFields(commit);
|
|
92
|
+
const latest = latestValueWrites(commit, batch.latestValueWrites);
|
|
93
|
+
let size = commit.canonicalBytes.byteLength;
|
|
94
|
+
for (const raw of batch.latestValueWrites)
|
|
95
|
+
size += raw.byteLength;
|
|
96
|
+
if (size > MAX_COMMIT_METADATA_BYTES)
|
|
97
|
+
throw new RepositoryStoreError("repository commit metadata exceeds limit");
|
|
98
|
+
return await withWriteConnectionAsync(state, async (database) => {
|
|
99
|
+
verifyFormat(database, commit.repositoryId);
|
|
100
|
+
await assertArtifactObjectsAvailable(commit, objects);
|
|
101
|
+
database.exec("BEGIN IMMEDIATE");
|
|
102
|
+
try {
|
|
103
|
+
const timestamp = new Date().toISOString().replace(/\.(\d{3})Z$/, ".$1000Z");
|
|
104
|
+
prepareStaging(database, batch, commit, timestamp);
|
|
105
|
+
if (workspaceHeadIn(database, commit.repositoryId) !== commit.expectedHead)
|
|
106
|
+
throw new RepositoryStoreError("stale repository head");
|
|
107
|
+
persistCommit(database, commit, batch.latestValueWrites, timestamp);
|
|
108
|
+
for (const operation of commit.operations)
|
|
109
|
+
applyProjection(database, commit, operation, latest);
|
|
110
|
+
runSql(database.prepare("UPDATE repository_heads SET workspace_head_commit_id = ?, updated_at = ? WHERE repository_id = ?"), commit.commitId, timestamp, commit.repositoryId);
|
|
111
|
+
if (batch.clearStaging) {
|
|
112
|
+
runSql(database.prepare("UPDATE repository_staging SET state = 'open', staging_digest = ?, operations_bytes = ?, latest_values_bytes = ?, updated_at = ? WHERE repository_id = ?"), stagingDigest([], []), stagingBytes([]), latestValuesBytes([]), timestamp, commit.repositoryId);
|
|
113
|
+
}
|
|
114
|
+
database.exec("COMMIT");
|
|
115
|
+
return { head: { repositoryId: commit.repositoryId, commitId: commit.commitId } };
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
try {
|
|
119
|
+
database.exec("ROLLBACK");
|
|
120
|
+
}
|
|
121
|
+
catch (rollbackError) {
|
|
122
|
+
throw new RepositoryStoreError("atomic batch rollback failed", {
|
|
123
|
+
cause: new AggregateError([error, rollbackError], "atomic batch and rollback both failed"),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
if (error instanceof RepositoryStoreError)
|
|
127
|
+
throw error;
|
|
128
|
+
throw new RepositoryStoreError("atomic batch failed; retryable staging retained", { cause: error });
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
//# sourceMappingURL=apply.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apply.js","sourceRoot":"","sources":["../../../src/local/store/apply.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,C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