@paradigma-inc/flywheel 0.1.111 → 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 +79 -13
- 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/getting-started/flywheel-tutorial-overview.md +1 -1
- 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/how-can-i-get-an-authorized-client_id-for-the-oauth-flow.md +12 -4
- package/skills/flywheel/setting-up-flywheel/installation-overview.md +2 -6
- package/skills/flywheel/setting-up-flywheel/other-hosts-installation.md +53 -26
- 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 +83 -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/_browser-handoff.js +36 -14
- package/src/runtime/vendor/flywheel-cli-dist/commands/_browser-handoff.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.js +15 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js +256 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-delete.js +11 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-delete.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js +84 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js.map +1 -0
- 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 +239 -263
- 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 +237 -66
- 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 -302
- 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 +252 -254
- 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 -21
- 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/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,121 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { isDigest, isUuid } from "../domain/models/constants.js";
|
|
3
|
+
import { RetainedRepositoryState } from "../fs/state.js";
|
|
4
|
+
import { RepositoryWriteGateBusyError, withRepositoryWriter } from "../fs/writer-lock.js";
|
|
5
|
+
import { diagnosticsPath, LocalDiagnosticWriter } from "../store/diagnostics.js";
|
|
6
|
+
import { migrateLocalRepository } from "../store/migrate.js";
|
|
7
|
+
import { readRepositoryIdentity } from "../store/migration/steps.js";
|
|
8
|
+
import { CURRENT_REPOSITORY_USER_VERSION } from "../store/migration/versions.js";
|
|
9
|
+
import { RepositoryObjectStorage } from "../store/objects.js";
|
|
10
|
+
import { SQLiteRepositoryStore } from "../store/sqlite/store.js";
|
|
11
|
+
import { localRuntimeIdentity } from "./identity.js";
|
|
12
|
+
import { dispatchLocalOperation } from "./operations/index.js";
|
|
13
|
+
import { pullIntoStore } from "./remote/pull.js";
|
|
14
|
+
import { pushFromStore } from "./remote/push.js";
|
|
15
|
+
import { purgeFromStore } from "./remote/purge.js";
|
|
16
|
+
import { randomUUID } from "node:crypto";
|
|
17
|
+
const MUTATIONS = {
|
|
18
|
+
stage: true, "conflicts:resolve": true, "rebase:continue": true, "rebase:abort": true,
|
|
19
|
+
pull: true, push: true, purge: true, revert: true, backup: true, restore: true, commit: true, object_install: true,
|
|
20
|
+
};
|
|
21
|
+
/** One command retains one state handle; nested helpers never reacquire its writer locks. */
|
|
22
|
+
export async function dispatchRepositoryCommand(rootPath, operation, args, options = {}) {
|
|
23
|
+
const runtimeIdentity = await localRuntimeIdentity();
|
|
24
|
+
const mutates = Object.hasOwn(MUTATIONS, operation) || operation === "gc" && args.dry_run === false;
|
|
25
|
+
if (mutates)
|
|
26
|
+
return executeWriter(rootPath, operation, args, options, runtimeIdentity);
|
|
27
|
+
const state = RetainedRepositoryState.open(rootPath);
|
|
28
|
+
let success = false;
|
|
29
|
+
try {
|
|
30
|
+
const identity = readRepositoryIdentity(join(state.statePath, "db.sqlite"));
|
|
31
|
+
if (identity.userVersion === CURRENT_REPOSITORY_USER_VERSION) {
|
|
32
|
+
const result = await execute(state, operation, args, options, false, runtimeIdentity);
|
|
33
|
+
state.assertValid();
|
|
34
|
+
success = true;
|
|
35
|
+
return result;
|
|
36
|
+
}
|
|
37
|
+
state.assertValid();
|
|
38
|
+
}
|
|
39
|
+
finally {
|
|
40
|
+
try {
|
|
41
|
+
await state.complete(success);
|
|
42
|
+
}
|
|
43
|
+
finally {
|
|
44
|
+
state.close();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
// Migration itself is a mutation even when the requested command only reads.
|
|
48
|
+
return executeWriter(rootPath, operation, args, options, runtimeIdentity);
|
|
49
|
+
}
|
|
50
|
+
async function executeWriter(rootPath, operation, args, options, runtimeIdentity) {
|
|
51
|
+
try {
|
|
52
|
+
return await withRepositoryWriter(rootPath, state => execute(state, operation, args, options, true, runtimeIdentity));
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (error instanceof RepositoryWriteGateBusyError) {
|
|
56
|
+
const state = RetainedRepositoryState.open(rootPath);
|
|
57
|
+
try {
|
|
58
|
+
const identity = readRepositoryIdentity(join(state.statePath, "db.sqlite"));
|
|
59
|
+
const diagnostics = new LocalDiagnosticWriter(options.diagnosticsPath ?? diagnosticsPath());
|
|
60
|
+
diagnostics.record({
|
|
61
|
+
repositoryId: identity.repositoryId, clientId: identity.clientId,
|
|
62
|
+
event: "repository_lock_contention", requestId: options.requestId,
|
|
63
|
+
fields: { operation, outcome: "failure", failure_kind: "repository_locked" },
|
|
64
|
+
});
|
|
65
|
+
await diagnostics.close();
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
state.close();
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
throw error;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
async function execute(state, operation, args, options, writerHeld, runtimeIdentity) {
|
|
75
|
+
const identity = writerHeld ? await migrateLocalRepository(state) : readRepositoryIdentity(join(state.statePath, "db.sqlite"));
|
|
76
|
+
const diagnostics = new LocalDiagnosticWriter(options.diagnosticsPath ?? diagnosticsPath());
|
|
77
|
+
const requestId = isUuid(options.requestId) ? options.requestId : randomUUID();
|
|
78
|
+
const operationId = isUuid(args.operation_id) ? args.operation_id : undefined;
|
|
79
|
+
diagnostics.record({
|
|
80
|
+
repositoryId: identity.repositoryId, clientId: identity.clientId,
|
|
81
|
+
event: "runtime_command", requestId, operationId, fields: { operation },
|
|
82
|
+
});
|
|
83
|
+
const complete = async (success) => {
|
|
84
|
+
diagnostics.record({
|
|
85
|
+
repositoryId: identity.repositoryId, clientId: identity.clientId,
|
|
86
|
+
event: "runtime_command_completed", requestId, operationId,
|
|
87
|
+
fields: { operation, outcome: success ? "success" : "failure", ...(!success && { failure_kind: "local_runtime_error" }) },
|
|
88
|
+
});
|
|
89
|
+
await diagnostics.close();
|
|
90
|
+
};
|
|
91
|
+
state.deferCompletion({ success: () => complete(true), failure: () => complete(false) });
|
|
92
|
+
if (operation === "repository_identity") {
|
|
93
|
+
if (Object.keys(args).length !== 0)
|
|
94
|
+
throw new Error("repository_command_request_invalid");
|
|
95
|
+
return { repository_id: identity.repositoryId };
|
|
96
|
+
}
|
|
97
|
+
const objects = new RepositoryObjectStorage(state);
|
|
98
|
+
const store = new SQLiteRepositoryStore(state, objects);
|
|
99
|
+
const context = { state, objects, store, diagnostics, repositoryId: identity.repositoryId, clientId: identity.clientId };
|
|
100
|
+
let result;
|
|
101
|
+
if (operation === "object_install") {
|
|
102
|
+
const bytes = options.objectBytes;
|
|
103
|
+
if (Object.keys(args).length !== 2 || !isDigest(args.digest) || !(bytes instanceof Uint8Array) || args.byte_length !== bytes.byteLength || bytes.byteLength > 10 * 1024 * 1024) {
|
|
104
|
+
throw new Error("repository_command_request_invalid");
|
|
105
|
+
}
|
|
106
|
+
await store.installObject(identity.repositoryId, args.digest, bytes);
|
|
107
|
+
result = { digest: args.digest, size: bytes.byteLength, stored: true };
|
|
108
|
+
}
|
|
109
|
+
else if (operation === "pull" || operation === "push" || operation === "purge") {
|
|
110
|
+
if (!options.connection)
|
|
111
|
+
throw new Error("repository credential is unavailable");
|
|
112
|
+
const remote = { pull: pullIntoStore, push: pushFromStore, purge: purgeFromStore }[operation];
|
|
113
|
+
result = await remote(context, args, options.connection);
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
result = await dispatchLocalOperation(context, operation, args, runtimeIdentity);
|
|
117
|
+
}
|
|
118
|
+
state.assertValid();
|
|
119
|
+
return result;
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../../src/local/runtime/dispatch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC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,EAAE,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;IACzE,CAAC;SAAM,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,MAAM,IAAI,SAAS,KAAK,OAAO,EAAE,CAAC;QACjF,IAAI,CAAC,OAAO,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;QACjF,MAAM,MAAM,GAAG,EAAE,IAAI,EAAE,aAAa,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,cAAc,EAAE,CAAC,SAAS,CAAC,CAAC;QAC9F,MAAM,GAAG,MAAM,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACN,MAAM,GAAG,MAAM,sBAAsB,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IACnF,CAAC;IACD,KAAK,CAAC,WAAW,EAAE,CAAC;IACpB,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { isRecord } from "../domain/models/constants.js";
|
|
2
|
+
export function doctorReport(status, repositoryId) {
|
|
3
|
+
const diagnostics = status.diagnostics;
|
|
4
|
+
const diagnosticsState = isRecord(diagnostics) && typeof diagnostics.state === "string" ? diagnostics.state : "unavailable";
|
|
5
|
+
return {
|
|
6
|
+
...status,
|
|
7
|
+
checks: [
|
|
8
|
+
{ id: "database_integrity", result: "pass", detail: "ok" },
|
|
9
|
+
{ id: "repository_identity", result: "pass", detail: repositoryId },
|
|
10
|
+
{ id: "filesystem_policy", result: "pass", detail: "local-filesystem-required" },
|
|
11
|
+
{ id: "checkpoint_observation", result: "pass", detail: "read-only observation; no checkpoint requested" },
|
|
12
|
+
{ id: "local_diagnostics", result: diagnosticsState === "active" ? "pass" : "warn", detail: diagnosticsState },
|
|
13
|
+
],
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=doctor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../../src/local/runtime/doctor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAEzD,MAAM,UAAU,YAAY,CAAC,MAA+B,EAAE,YAAoB;IAChF,MAAM,WAAW,GAAG,MAAM,CAAC,WAAW,CAAC;IACvC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,WAAW,CAAC,IAAI,OAAO,WAAW,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,aAAa,CAAC;IAC5H,OAAO;QACL,GAAG,MAAM;QACT,MAAM,EAAE;YACN,EAAE,EAAE,EAAE,oBAAoB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;YAC1D,EAAE,EAAE,EAAE,qBAAqB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE;YACnE,EAAE,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,2BAA2B,EAAE;YAChF,EAAE,EAAE,EAAE,wBAAwB,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,gDAAgD,EAAE;YAC1G,EAAE,EAAE,EAAE,mBAAmB,EAAE,MAAM,EAAE,gBAAgB,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,gBAAgB,EAAE;SAC/G;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { chmodSync, mkdtempSync, rmSync } from "node:fs";
|
|
2
|
+
import { tmpdir } from "node:os";
|
|
3
|
+
import { join } from "node:path";
|
|
4
|
+
import { assertLocalPlatform, assertNodeVersion } from "./platform.js";
|
|
5
|
+
export async function localRuntimeIdentity() {
|
|
6
|
+
assertNodeVersion();
|
|
7
|
+
assertLocalPlatform();
|
|
8
|
+
// Type-only import above is erased; unsupported Node/OS pairs never load SQLite.
|
|
9
|
+
const sqlite = await import("node:sqlite");
|
|
10
|
+
const root = mkdtempSync(join(tmpdir(), "flywheel-sqlite-capabilities-"));
|
|
11
|
+
let database;
|
|
12
|
+
let version = "unavailable";
|
|
13
|
+
let capability = "opening a defensive SQLite connection";
|
|
14
|
+
try {
|
|
15
|
+
chmodSync(root, 0o700);
|
|
16
|
+
database = new sqlite.DatabaseSync(join(root, "probe.sqlite"), { defensive: true, allowExtension: false });
|
|
17
|
+
database.exec("PRAGMA trusted_schema = OFF");
|
|
18
|
+
const detected = database.prepare("SELECT sqlite_version() AS version").get()?.version;
|
|
19
|
+
if (typeof detected !== "string")
|
|
20
|
+
throw new Error("SQLite did not report its version");
|
|
21
|
+
version = detected;
|
|
22
|
+
capability = "SQLite >= 3.31.0";
|
|
23
|
+
const parts = version.split(".").map(Number);
|
|
24
|
+
if (parts[0] < 3 || (parts[0] === 3 && parts[1] < 31))
|
|
25
|
+
throw new Error("SQLite version is below the required floor");
|
|
26
|
+
capability = "defensive mode";
|
|
27
|
+
if (typeof database.enableDefensive !== "function")
|
|
28
|
+
throw new Error("defensive API is unavailable");
|
|
29
|
+
database.enableDefensive(true);
|
|
30
|
+
database.exec("PRAGMA writable_schema = ON");
|
|
31
|
+
if (database.prepare("PRAGMA writable_schema").get()?.writable_schema !== 0)
|
|
32
|
+
throw new Error("defensive mode did not protect the schema");
|
|
33
|
+
capability = "recursive CTEs";
|
|
34
|
+
const recursive = database.prepare("WITH RECURSIVE values_probe(x) AS (VALUES(1) UNION ALL SELECT x + 1 FROM values_probe WHERE x < 3) SELECT sum(x) AS total FROM values_probe").get();
|
|
35
|
+
if (recursive?.total !== 6)
|
|
36
|
+
throw new Error("recursive query returned an unexpected result");
|
|
37
|
+
capability = "GLOB CHECK constraints";
|
|
38
|
+
database.exec("CREATE TABLE glob_probe(value TEXT CHECK(value GLOB '[a-z]*')); INSERT INTO glob_probe VALUES ('valid')");
|
|
39
|
+
let rejected = false;
|
|
40
|
+
try {
|
|
41
|
+
database.exec("INSERT INTO glob_probe VALUES ('123')");
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
if (typeof error !== "object" || error === null || !("errcode" in error) || error.errcode !== 275)
|
|
45
|
+
throw error;
|
|
46
|
+
rejected = true;
|
|
47
|
+
}
|
|
48
|
+
if (!rejected)
|
|
49
|
+
throw new Error("GLOB constraint accepted invalid data");
|
|
50
|
+
capability = "WAL on a file-backed database";
|
|
51
|
+
if (database.prepare("PRAGMA journal_mode = WAL").get()?.journal_mode !== "wal")
|
|
52
|
+
throw new Error("WAL could not be enabled");
|
|
53
|
+
const options = database.prepare("PRAGMA compile_options").all().map(row => {
|
|
54
|
+
if (typeof row.compile_options !== "string")
|
|
55
|
+
throw new Error("SQLite compile option is invalid");
|
|
56
|
+
return row.compile_options;
|
|
57
|
+
});
|
|
58
|
+
return { engine: "node-sqlite", node: process.versions.node, sqlite: version, sqlite_compile_options: options };
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
throw new Error(`Local repository runtime is unsupported: Node.js ${process.versions.node}, SQLite ${version}; failed capability: ${capability}.`, { cause: error });
|
|
62
|
+
}
|
|
63
|
+
finally {
|
|
64
|
+
try {
|
|
65
|
+
database?.close();
|
|
66
|
+
}
|
|
67
|
+
finally {
|
|
68
|
+
rmSync(root, { recursive: true });
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
//# sourceMappingURL=identity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/local/runtime/identity.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACzD,OAAO,EAA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G,+BAA+B,CAAC;QAC7C,IAAI,QAAQ,CAAC,OAAO,CAAC,2BAA2B,CAAC,CAAC,GAAG,EAAE,EAAE,YAAY,KAAK,KAAK;YAAE,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;QAC7H,MAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,wBAAwB,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YACzE,IAAI,OAAO,GAAG,CAAC,eAAe,KAAK,QAAQ;gBAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;YACjG,OAAO,GAAG,CAAC,eAAe,CAAC;QAC7B,CAAC,CAAC,CAAC;QACH,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,CAAC;IAClH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,oDAAoD,OAAO,CAAC,QAAQ,CAAC,IAAI,YAAY,OAAO,wBAAwB,UAAU,GAAG,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;IACvK,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;QAAC,CAAC;gBAAS,CAAC;YAAC,MAAM,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;QAAC,CAAC;IAC3E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { canonicalBytes, parseRepositoryJson } from "../../domain/models/encoding.js";
|
|
3
|
+
import { listConflicts, loadConflict } from "../../domain/rebase/pull.js";
|
|
4
|
+
import { resolveConflict } from "../../domain/rebase/resolve.js";
|
|
5
|
+
import { abortRebase, continueRebase } from "../../domain/rebase/replay.js";
|
|
6
|
+
import { requireExactArguments } from "./shared.js";
|
|
7
|
+
function conflictMapping(conflict) {
|
|
8
|
+
const payload = parseRepositoryJson(new TextDecoder("utf-8", { fatal: true }).decode(conflict.canonicalBytes));
|
|
9
|
+
if (!canonicalBytes(payload).equals(Buffer.from(conflict.canonicalBytes)))
|
|
10
|
+
throw new Error("repository conflict is corrupt");
|
|
11
|
+
return { ...payload, conflict_id: conflict.conflictId, rebase_id: conflict.rebaseId, state: conflict.state };
|
|
12
|
+
}
|
|
13
|
+
export async function conflictsList(context, arguments_) {
|
|
14
|
+
requireExactArguments(arguments_, []);
|
|
15
|
+
return { conflicts: (await listConflicts(context.store, context.repositoryId)).map(conflictMapping) };
|
|
16
|
+
}
|
|
17
|
+
export async function conflictsShow(context, arguments_) {
|
|
18
|
+
requireExactArguments(arguments_, ["conflict_id"]);
|
|
19
|
+
if (typeof arguments_.conflict_id !== "string")
|
|
20
|
+
throw new Error("invalid internal operation arguments");
|
|
21
|
+
return { conflict: conflictMapping(await loadConflict(context.store, context.repositoryId, arguments_.conflict_id)) };
|
|
22
|
+
}
|
|
23
|
+
export async function conflictsResolve(context, arguments_) {
|
|
24
|
+
requireExactArguments(arguments_, ["conflict_id", "manual_value", "operation_id", "strategy"]);
|
|
25
|
+
const operationId = arguments_.operation_id;
|
|
26
|
+
const conflictId = arguments_.conflict_id;
|
|
27
|
+
const strategy = arguments_.strategy;
|
|
28
|
+
const manualValue = arguments_.manual_value;
|
|
29
|
+
if (typeof operationId !== "string" || typeof conflictId !== "string" || typeof strategy !== "string" || (manualValue !== null && typeof manualValue !== "string")) {
|
|
30
|
+
throw new Error("invalid internal operation arguments");
|
|
31
|
+
}
|
|
32
|
+
const conflict = await resolveConflict(context.store, context.repositoryId, operationId, conflictId, strategy, manualValue);
|
|
33
|
+
const payload = parseRepositoryJson(new TextDecoder("utf-8", { fatal: true }).decode(conflict.canonicalBytes));
|
|
34
|
+
return {
|
|
35
|
+
conflict_id: conflict.conflictId,
|
|
36
|
+
rebase_id: conflict.rebaseId,
|
|
37
|
+
resolution_digest: `sha256:${createHash("sha256").update(canonicalBytes(payload.resolution)).digest("hex")}`,
|
|
38
|
+
state: "resolved_pending_continue",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
async function finishRebase(context, arguments_, method) {
|
|
42
|
+
requireExactArguments(arguments_, ["expected_local_head", "operation_id", "rebase_id"]);
|
|
43
|
+
const operationId = arguments_.operation_id;
|
|
44
|
+
const rebaseId = arguments_.rebase_id;
|
|
45
|
+
const expectedHead = arguments_.expected_local_head;
|
|
46
|
+
if (typeof operationId !== "string" || typeof rebaseId !== "string" || (expectedHead !== null && typeof expectedHead !== "string")) {
|
|
47
|
+
throw new Error("invalid internal operation arguments");
|
|
48
|
+
}
|
|
49
|
+
const result = await method(context.store, context.repositoryId, operationId, rebaseId, expectedHead);
|
|
50
|
+
const workspace = await context.store.loadWorkspace(context.repositoryId);
|
|
51
|
+
return { rebase_id: result.rebaseId, state: result.state, head: result.head, conflict_count: workspace.conflicts.length };
|
|
52
|
+
}
|
|
53
|
+
export function rebaseContinue(context, arguments_) {
|
|
54
|
+
return finishRebase(context, arguments_, continueRebase);
|
|
55
|
+
}
|
|
56
|
+
export function rebaseAbort(context, arguments_) {
|
|
57
|
+
return finishRebase(context, arguments_, abortRebase);
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=conflicts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conflicts.js","sourceRoot":"","sources":["../../../../src/local/runtime/operations/conflicts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtF,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,O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"}
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { existsSync, readdirSync, statSync } from "node:fs";
|
|
2
|
+
import { join } from "node:path";
|
|
3
|
+
import { RepositoryOperation } from "../../domain/models/operations.js";
|
|
4
|
+
import { commitStaged } from "../../domain/service/commit.js";
|
|
5
|
+
import { stageOperations } from "../../domain/service/staging.js";
|
|
6
|
+
import { doctorReport } from "../doctor.js";
|
|
7
|
+
import { requireExactArguments } from "./shared.js";
|
|
8
|
+
import { validateRepositoryIdentity } from "../../store/sqlite/verify.js";
|
|
9
|
+
import { CURRENT_REPOSITORY_USER_VERSION } from "../../store/migration/versions.js";
|
|
10
|
+
function objectByteCounts(path, reachable) {
|
|
11
|
+
if (!existsSync(path))
|
|
12
|
+
return { reachable: 0, reclaimable: 0 };
|
|
13
|
+
let reachableBytes = 0;
|
|
14
|
+
let reclaimableBytes = 0;
|
|
15
|
+
for (const entry of readdirSync(path, { withFileTypes: true })) {
|
|
16
|
+
const child = join(path, entry.name);
|
|
17
|
+
if (entry.isDirectory()) {
|
|
18
|
+
const nested = objectByteCounts(child, reachable);
|
|
19
|
+
reachableBytes += nested.reachable;
|
|
20
|
+
reclaimableBytes += nested.reclaimable;
|
|
21
|
+
}
|
|
22
|
+
else if (entry.isFile()) {
|
|
23
|
+
if (reachable.has(entry.name))
|
|
24
|
+
reachableBytes += statSync(child).size;
|
|
25
|
+
else
|
|
26
|
+
reclaimableBytes += statSync(child).size;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return { reachable: reachableBytes, reclaimable: reclaimableBytes };
|
|
30
|
+
}
|
|
31
|
+
export async function staging(context, arguments_) {
|
|
32
|
+
requireExactArguments(arguments_, []);
|
|
33
|
+
const workspace = await context.store.loadWorkspace(context.repositoryId);
|
|
34
|
+
return {
|
|
35
|
+
operations: workspace.staging.operations.map(operation => operation.toMapping()),
|
|
36
|
+
latest_values: workspace.staging.latestValues.map(value => ({ ...value })),
|
|
37
|
+
staging_digest: workspace.staging.digest,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export async function stage(context, arguments_) {
|
|
41
|
+
requireExactArguments(arguments_, ["latest_values", "operations"]);
|
|
42
|
+
const operations = arguments_.operations;
|
|
43
|
+
const latestValues = arguments_.latest_values;
|
|
44
|
+
if (!Array.isArray(operations) || operations.length === 0 || operations.some(operation => typeof operation !== "object" || operation === null || Array.isArray(operation)) ||
|
|
45
|
+
!Array.isArray(latestValues) || latestValues.some(value => typeof value !== "object" || value === null || Array.isArray(value))) {
|
|
46
|
+
throw new Error("invalid internal operation arguments");
|
|
47
|
+
}
|
|
48
|
+
const parsed = operations.map(operation => RepositoryOperation.fromMapping(operation));
|
|
49
|
+
const result = await stageOperations(context.store, context.repositoryId, parsed, latestValues);
|
|
50
|
+
return { operation_id: parsed.at(-1).operationId, staging_digest: result.digest, operation_count: result.operations.length };
|
|
51
|
+
}
|
|
52
|
+
export async function commit(context, arguments_) {
|
|
53
|
+
requireExactArguments(arguments_, ["expected_local_head", "message", "staging_digest"]);
|
|
54
|
+
const expectedHead = arguments_.expected_local_head;
|
|
55
|
+
const stagingDigest = arguments_.staging_digest;
|
|
56
|
+
const message = arguments_.message;
|
|
57
|
+
if ((expectedHead !== null && typeof expectedHead !== "string") || typeof stagingDigest !== "string" || (message !== null && typeof message !== "string")) {
|
|
58
|
+
throw new Error("invalid internal operation arguments");
|
|
59
|
+
}
|
|
60
|
+
const result = await commitStaged(context.store, context.repositoryId, context.clientId, expectedHead, stagingDigest, message);
|
|
61
|
+
return {
|
|
62
|
+
repository_id: context.repositoryId,
|
|
63
|
+
commit_id: result.commitId,
|
|
64
|
+
head: result.head.commitId,
|
|
65
|
+
operation_count: result.operationCount,
|
|
66
|
+
metadata_bytes: result.metadataBytes,
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
export async function localHead(context, arguments_) {
|
|
70
|
+
requireExactArguments(arguments_, []);
|
|
71
|
+
const workspace = await context.store.loadWorkspace(context.repositoryId);
|
|
72
|
+
return {
|
|
73
|
+
repository_id: context.repositoryId,
|
|
74
|
+
current_local_head: workspace.localHeadCommitId,
|
|
75
|
+
remote_tracking_head: workspace.remoteTrackingHeadCommitId,
|
|
76
|
+
remote_cursor: null,
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
export async function status(context, arguments_, runtimeIdentity) {
|
|
80
|
+
requireExactArguments(arguments_, []);
|
|
81
|
+
context.state.assertValid();
|
|
82
|
+
validateRepositoryIdentity(join(context.state.statePath, "db.sqlite"), context.repositoryId);
|
|
83
|
+
const [repository, head, workspace, objectMode, association] = await Promise.all([
|
|
84
|
+
context.store.loadRepository(context.repositoryId), context.store.loadHead(context.repositoryId), context.store.loadWorkspace(context.repositoryId),
|
|
85
|
+
context.store.loadObjectMode(context.repositoryId), context.store.loadHostedAssociation(context.repositoryId),
|
|
86
|
+
]);
|
|
87
|
+
const reachable = await context.store.loadReachableObjectDigests(context.repositoryId, head.commitId);
|
|
88
|
+
const objectBytes = objectByteCounts(join(context.state.statePath, "objects"), new Set(reachable));
|
|
89
|
+
const databasePath = join(context.state.statePath, "db.sqlite");
|
|
90
|
+
const walPath = `${databasePath}-wal`;
|
|
91
|
+
const sharedMemoryPath = `${databasePath}-shm`;
|
|
92
|
+
const openConflicts = workspace.conflicts.filter(conflict => conflict.state === "open").length;
|
|
93
|
+
const databaseBytes = existsSync(databasePath) ? statSync(databasePath).size : 0;
|
|
94
|
+
const walBytes = existsSync(walPath) ? statSync(walPath).size : 0;
|
|
95
|
+
const sharedMemoryBytes = existsSync(sharedMemoryPath) ? statSync(sharedMemoryPath).size : 0;
|
|
96
|
+
return {
|
|
97
|
+
repository_id: context.repositoryId,
|
|
98
|
+
client_id: repository.clientId,
|
|
99
|
+
heads: { workspace: head.commitId, remote_tracking: workspace.remoteTrackingHeadCommitId },
|
|
100
|
+
hosted_repository: association === null
|
|
101
|
+
? { state: "not_attached", readiness: "not_attached" }
|
|
102
|
+
: { state: "attached", readiness: "configured", repository_id: context.repositoryId, service_url: association[0], profile: association[1] },
|
|
103
|
+
versions: { ...runtimeIdentity, user_version: CURRENT_REPOSITORY_USER_VERSION },
|
|
104
|
+
filesystem: { repository_root: context.state.rootPath, policy: "local-filesystem-required" },
|
|
105
|
+
integrity: { database: "verified" },
|
|
106
|
+
migration: { state: "current", user_version: CURRENT_REPOSITORY_USER_VERSION },
|
|
107
|
+
bytes: { database: databaseBytes, wal: walBytes, shared_memory: sharedMemoryBytes, reachable_objects: objectBytes.reachable },
|
|
108
|
+
diagnostics: {
|
|
109
|
+
state: context.diagnostics === undefined ? "unavailable" : await context.diagnostics.status(),
|
|
110
|
+
drop_count: context.diagnostics?.dropCount ?? 0,
|
|
111
|
+
queue_age: context.diagnostics?.queueAge ?? 0,
|
|
112
|
+
},
|
|
113
|
+
checkpoint: { state: "not-run-read-only", wal_bytes: walBytes },
|
|
114
|
+
conflicts: { open: openConflicts, total: workspace.conflicts.length },
|
|
115
|
+
staging: { operation_count: workspace.staging.operations.length, digest: workspace.staging.digest },
|
|
116
|
+
sync: { rebase: workspace.rebase?.state ?? null, object_mode: objectMode, remote_tracking_head: workspace.remoteTrackingHeadCommitId },
|
|
117
|
+
reclaimable_bytes: objectBytes.reclaimable,
|
|
118
|
+
last_backup: null,
|
|
119
|
+
};
|
|
120
|
+
}
|
|
121
|
+
export async function doctor(context, arguments_, runtimeIdentity) {
|
|
122
|
+
requireExactArguments(arguments_, []);
|
|
123
|
+
return doctorReport(await status(context, {}, runtimeIdentity), context.repositoryId);
|
|
124
|
+
}
|
|
125
|
+
//# sourceMappingURL=core.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"core.js","sourceRoot":"","sources":["../../../../src/local/runtime/operations/core.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AACjC,OAAO,EAAE,mBAAmB,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E,mBAAmB,EAAE,SAAS,EAAE,QAAQ,EAAE;QAC/D,SAAS,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,SAAS,CAAC,SAAS,CAAC,MAAM,EAAE;QACrE,OAAO,EAAE,EAAE,eAAe,EAAE,SAAS,CAAC,OAAO,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,CAAC,OAAO,CAAC,MAAM,EAAE;QACnG,IAAI,EAAE,EAAE,MAAM,EAAE,SAAS,CAAC,MAAM,EAAE,KAAK,IAAI,IAAI,EAAE,WAAW,EAAE,UAAU,EAAE,oBAAoB,EAAE,SAAS,CAAC,0BAA0B,EAAE;QACtI,iBAAiB,EAAE,WAAW,CAAC,WAAW;QAC1C,WAAW,EAAE,IAAI;KAClB,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAAC,OAAuB,EAAE,UAA6C,EAAE,eAAqC;IACxI,qBAAqB,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,YAAY,CAAC,MAAM,MAAM,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { decodeCursor, encodeCursor } from "../../domain/history.js";
|
|
3
|
+
import { canonicalBytes } from "../../domain/models/encoding.js";
|
|
4
|
+
import { revert as revertStaged } from "../../domain/service/revert.js";
|
|
5
|
+
import { requireAllowedArguments, requireExactArguments } from "./shared.js";
|
|
6
|
+
function operationDigest(value) {
|
|
7
|
+
return `sha256:${createHash("sha256").update(canonicalBytes(value)).digest("hex")}`;
|
|
8
|
+
}
|
|
9
|
+
function commitLogItem(commit) {
|
|
10
|
+
const item = {
|
|
11
|
+
commit_id: commit.commitId,
|
|
12
|
+
parent_id: commit.parentCommitId,
|
|
13
|
+
operations_digest: operationDigest(commit.operations.map(operation => operation.toMapping())),
|
|
14
|
+
latest_values_digest: operationDigest([...commit.latestStateDigests]),
|
|
15
|
+
operations: commit.operations.map(operation => operation.toMapping()),
|
|
16
|
+
message: commit.message,
|
|
17
|
+
};
|
|
18
|
+
if (commit.rebasedFrom !== null)
|
|
19
|
+
item.rebased_from = commit.rebasedFrom;
|
|
20
|
+
return item;
|
|
21
|
+
}
|
|
22
|
+
async function reachableCommits(context, head) {
|
|
23
|
+
const commits = [];
|
|
24
|
+
let afterCommitId = null;
|
|
25
|
+
while (true) {
|
|
26
|
+
const page = await context.store.listCommits(context.repositoryId, head, afterCommitId, 256);
|
|
27
|
+
commits.push(...page.commits);
|
|
28
|
+
if (page.nextCommitId === null)
|
|
29
|
+
return commits;
|
|
30
|
+
if (page.nextCommitId === afterCommitId)
|
|
31
|
+
throw new Error("repository_local_history_changed");
|
|
32
|
+
afterCommitId = page.nextCommitId;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export async function log(context, arguments_) {
|
|
36
|
+
requireAllowedArguments(arguments_, ["after", "limit"]);
|
|
37
|
+
const limit = arguments_.limit ?? 50;
|
|
38
|
+
const after = arguments_.after;
|
|
39
|
+
if (typeof limit !== "number" || !Number.isInteger(limit) || limit < 1 || limit > 256 || (after !== undefined && after !== null && typeof after !== "string")) {
|
|
40
|
+
throw new Error("invalid internal operation arguments");
|
|
41
|
+
}
|
|
42
|
+
const head = await context.store.loadHead(context.repositoryId);
|
|
43
|
+
if (head.commitId === null) {
|
|
44
|
+
if (after !== undefined && after !== null)
|
|
45
|
+
throw new Error("repository_local_history_changed");
|
|
46
|
+
return { at_head: null, commits: [], next_cursor: null };
|
|
47
|
+
}
|
|
48
|
+
const afterCommitId = after === undefined || after === null ? null : decodeCursor(after, context.repositoryId, head.commitId);
|
|
49
|
+
const page = await context.store.listCommits(context.repositoryId, head.commitId, afterCommitId, limit);
|
|
50
|
+
return {
|
|
51
|
+
at_head: head.commitId,
|
|
52
|
+
commits: page.commits.map(commitLogItem),
|
|
53
|
+
next_cursor: page.nextCommitId === null ? null : encodeCursor(context.repositoryId, head.commitId, page.nextCommitId),
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
function operationsBetween(commits, base, head) {
|
|
57
|
+
if (base === head)
|
|
58
|
+
return [];
|
|
59
|
+
const byId = new Map(commits.map(commit => [commit.commitId, commit]));
|
|
60
|
+
const chain = [];
|
|
61
|
+
let cursor = head;
|
|
62
|
+
while (cursor !== base) {
|
|
63
|
+
const commit = cursor === null ? undefined : byId.get(cursor);
|
|
64
|
+
if (commit === undefined)
|
|
65
|
+
throw new Error("internal diff base is not reachable");
|
|
66
|
+
chain.push(commit);
|
|
67
|
+
cursor = commit.parentCommitId;
|
|
68
|
+
}
|
|
69
|
+
return chain.reverse().flatMap(commit => commit.operations);
|
|
70
|
+
}
|
|
71
|
+
function latestChanges(operations) {
|
|
72
|
+
const changes = [];
|
|
73
|
+
for (const operation of operations) {
|
|
74
|
+
const payload = operation.payload;
|
|
75
|
+
if (operation.type === "node.field.set.v1") {
|
|
76
|
+
changes.push({ owner_type: "node", owner_id: payload.node_id, field: payload.field, value_digest: payload.new_digest });
|
|
77
|
+
}
|
|
78
|
+
else if (operation.type === "edge.add.v1" || operation.type === "edge.field.set.v1") {
|
|
79
|
+
changes.push({ owner_type: "edge", owner_id: payload.edge_id, field: "content", value_digest: payload[operation.type === "edge.add.v1" ? "content_digest" : "new_digest"] });
|
|
80
|
+
}
|
|
81
|
+
else if (operation.type === "artifact.metadata.set.v1") {
|
|
82
|
+
changes.push({ owner_type: "artifact", owner_id: payload.artifact_id, field: payload.field, value_digest: payload.new_digest });
|
|
83
|
+
}
|
|
84
|
+
else if (operation.type === "artifact.properties.set.v1") {
|
|
85
|
+
changes.push({ owner_type: "artifact", owner_id: payload.artifact_id, field: "properties", value_digest: payload.new_digest });
|
|
86
|
+
}
|
|
87
|
+
else if (operation.type === "artifact.attach.v2") {
|
|
88
|
+
changes.push({ owner_type: "artifact", owner_id: payload.artifact_id, field: "properties", value_digest: payload.properties_digest });
|
|
89
|
+
}
|
|
90
|
+
else if (operation.type === "artifact.content.set.v1") {
|
|
91
|
+
changes.push({ owner_type: "artifact", owner_id: payload.artifact_id, field: "content", value_digest: payload.object_digest });
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
return changes;
|
|
95
|
+
}
|
|
96
|
+
export async function diff(context, arguments_) {
|
|
97
|
+
requireAllowedArguments(arguments_, ["base", "head"]);
|
|
98
|
+
const requestedBase = arguments_.base;
|
|
99
|
+
const requestedHead = arguments_.head;
|
|
100
|
+
if ((requestedBase !== undefined && requestedBase !== null && typeof requestedBase !== "string") ||
|
|
101
|
+
(requestedHead !== undefined && requestedHead !== null && typeof requestedHead !== "string")) {
|
|
102
|
+
throw new Error("invalid internal operation arguments");
|
|
103
|
+
}
|
|
104
|
+
const [headRecord, workspace] = await Promise.all([context.store.loadHead(context.repositoryId), context.store.loadWorkspace(context.repositoryId)]);
|
|
105
|
+
const base = requestedBase === undefined || requestedBase === null ? workspace.remoteTrackingHeadCommitId : requestedBase;
|
|
106
|
+
const head = requestedHead === undefined || requestedHead === null ? headRecord.commitId : requestedHead;
|
|
107
|
+
if (head !== headRecord.commitId)
|
|
108
|
+
throw new Error("internal diff head is not current");
|
|
109
|
+
const operations = head === null ? [] : operationsBetween(await reachableCommits(context, head), base, head);
|
|
110
|
+
return {
|
|
111
|
+
base,
|
|
112
|
+
head,
|
|
113
|
+
operation_changes: operations.map(operation => operation.toMapping()),
|
|
114
|
+
latest_field_changes: latestChanges(operations),
|
|
115
|
+
staging: { operation_count: workspace.staging.operations.length, digest: workspace.staging.digest },
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
export async function revert(context, arguments_) {
|
|
119
|
+
requireExactArguments(arguments_, ["commit_id", "expected_local_head", "operation_id"]);
|
|
120
|
+
const operationId = arguments_.operation_id;
|
|
121
|
+
const expectedHead = arguments_.expected_local_head;
|
|
122
|
+
const commitId = arguments_.commit_id;
|
|
123
|
+
if (typeof operationId !== "string" || typeof commitId !== "string" || (expectedHead !== null && typeof expectedHead !== "string")) {
|
|
124
|
+
throw new Error("invalid internal operation arguments");
|
|
125
|
+
}
|
|
126
|
+
const result = await revertStaged(context.store, context.repositoryId, context.clientId, operationId, expectedHead, commitId);
|
|
127
|
+
return { repository_id: result.repositoryId, commit_id: result.commitId, head: result.head, skipped_latest_fields: [...result.skippedLatestFields] };
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.js","sourceRoot":"","sources":["../../../../src/local/runtime/operations/history.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,EAAE,MAAM,IAAI,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAExE,OAAO,EAAE,uBAAuB,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAiB7E,SAAS,eAAe,CAAC,KAAc;IACrC,OAAO,UAAU,UAAU,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;AACtF,CAAC;AAED,SAAS,aAAa,CAAC,MAAmB;IACxC,MAAM,IAAI,GAA4B;QACpC,SAAS,EAAE,MAAM,CAAC,QAAQ;QAC1B,SAAS,EAAE,MAAM,CAAC,cAAc;QAChC,iBAAiB,EAAE,eAAe,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,SAAS,EAAE,CAAC,CAAC;QAC7F,oBAAoB,EAAE,eAAe,CAAC,CAAC,GAAG,MAAM,CAAC,kBAAkB,CAAC,CAAC;QACrE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AAQ,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,qBAAqB,EAAE,CAAC,GAAG,MAAM,CAAC,mBAAmB,CAAC,EAAE,CAAC;AACvJ,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { commit, doctor, localHead, stage, staging, status } from "./core.js";
|
|
2
|
+
import { conflictsList, conflictsResolve, conflictsShow, rebaseAbort, rebaseContinue } from "./conflicts.js";
|
|
3
|
+
import { diff, log, revert } from "./history.js";
|
|
4
|
+
import { backup, gc, restore } from "./maintenance.js";
|
|
5
|
+
import { projection, projectionOperations } from "./projections.js";
|
|
6
|
+
/** Dispatch one command while the caller retains the repository's write scope. */
|
|
7
|
+
export async function dispatchLocalOperation(context, operation, arguments_, runtimeIdentity) {
|
|
8
|
+
if (Object.hasOwn(projectionOperations, operation))
|
|
9
|
+
return projection(context, operation, arguments_);
|
|
10
|
+
switch (operation) {
|
|
11
|
+
case "staging": return staging(context, arguments_);
|
|
12
|
+
case "stage": return stage(context, arguments_);
|
|
13
|
+
case "commit": return commit(context, arguments_);
|
|
14
|
+
case "local-head": return localHead(context, arguments_);
|
|
15
|
+
case "status": return status(context, arguments_, runtimeIdentity);
|
|
16
|
+
case "log": return log(context, arguments_);
|
|
17
|
+
case "diff": return diff(context, arguments_);
|
|
18
|
+
case "revert": return revert(context, arguments_);
|
|
19
|
+
case "conflicts:list": return conflictsList(context, arguments_);
|
|
20
|
+
case "conflicts:show": return conflictsShow(context, arguments_);
|
|
21
|
+
case "conflicts:resolve": return conflictsResolve(context, arguments_);
|
|
22
|
+
case "rebase:continue": return rebaseContinue(context, arguments_);
|
|
23
|
+
case "rebase:abort": return rebaseAbort(context, arguments_);
|
|
24
|
+
case "backup": return backup(context, arguments_);
|
|
25
|
+
case "restore": return restore(context, arguments_);
|
|
26
|
+
case "doctor": return doctor(context, arguments_, runtimeIdentity);
|
|
27
|
+
case "gc": return gc(context, arguments_);
|
|
28
|
+
default: throw new Error("unknown internal runtime operation");
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=index.js.map
|