@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,346 @@
|
|
|
1
|
+
import { randomUUID } from "node:crypto";
|
|
2
|
+
import { RepositoryServiceError } from "../errors.js";
|
|
3
|
+
import { isRecord, isUuid } from "../models/constants.js";
|
|
4
|
+
import { RepositoryCommit } from "../models/commits.js";
|
|
5
|
+
import { RepositoryOperation } from "../models/operations.js";
|
|
6
|
+
import { artifactReferenceSetDigest, foldArtifactPropertiesOperation, legacyArtifactMetadata, legacyArtifactProperties, parseArtifactProperties } from "../models/artifact-properties.js";
|
|
7
|
+
import { parseRepositoryJson, valueDigest } from "../models/encoding.js";
|
|
8
|
+
import { artifactDigests, latestStateDigests } from "../service/writes.js";
|
|
9
|
+
import { LatestValueWrite } from "../../store/contract.js";
|
|
10
|
+
import { conflictContext, conflictResolutionByKey } from "./conflicts.js";
|
|
11
|
+
import { RepositoryRebaseError } from "./context.js";
|
|
12
|
+
import { operationKey } from "./keys.js";
|
|
13
|
+
import { pullBatch } from "./pull.js";
|
|
14
|
+
const LEGACY_ATTACHMENT_FIELDS = ["name", "media_type", "notes", "tags"];
|
|
15
|
+
function commitTimestamp(clock) {
|
|
16
|
+
const value = clock();
|
|
17
|
+
if (!(value instanceof Date) || Number.isNaN(value.valueOf()))
|
|
18
|
+
throw new RepositoryServiceError("repository rebase clock is invalid");
|
|
19
|
+
return value.toISOString().replace(/\.(\d{3})Z$/, ".$1000Z");
|
|
20
|
+
}
|
|
21
|
+
export async function continueRebase(store, repositoryId, operationId, rebaseId, expectedHead, clock = () => new Date()) {
|
|
22
|
+
if (!isUuid(operationId))
|
|
23
|
+
throw new RepositoryServiceError("operation_id must be UUIDv4");
|
|
24
|
+
const workspace = await store.loadWorkspace(repositoryId);
|
|
25
|
+
requireRebase(workspace, rebaseId, expectedHead);
|
|
26
|
+
let context;
|
|
27
|
+
let resolutions;
|
|
28
|
+
try {
|
|
29
|
+
context = conflictContext(workspace.conflicts);
|
|
30
|
+
resolutions = conflictResolutionByKey(workspace.conflicts);
|
|
31
|
+
}
|
|
32
|
+
catch (error) {
|
|
33
|
+
if (error instanceof RepositoryRebaseError)
|
|
34
|
+
throw new RepositoryServiceError(error.message, { cause: error });
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
const actorId = context.localCommits.at(-1)?.authorId;
|
|
38
|
+
if (actorId === undefined)
|
|
39
|
+
throw new RepositoryServiceError("repository rebase is corrupt");
|
|
40
|
+
const rebased = rebaseLocalCommits(context.localCommits, context.targetHead, actorId, rebaseId, resolutions, clock, context.remoteSnapshot, await loadRebaseLatestValues(store, repositoryId, context.localCommits));
|
|
41
|
+
const result = await store.applyAtomic(pullBatch({
|
|
42
|
+
mode: "continue", workspace, context,
|
|
43
|
+
commits: [...context.remoteCommits, ...rebased.commits],
|
|
44
|
+
latestValues: [...context.remoteLatestValues, ...rebased.latestValuesByCommit],
|
|
45
|
+
manualValues: rebased.manualValues,
|
|
46
|
+
resultingHead: rebased.commits.at(-1)?.commitId ?? context.targetHead,
|
|
47
|
+
clearRebase: true,
|
|
48
|
+
}));
|
|
49
|
+
return { repositoryId, rebaseId, head: result.head.commitId, state: "continued" };
|
|
50
|
+
}
|
|
51
|
+
export async function abortRebase(store, repositoryId, operationId, rebaseId, expectedHead) {
|
|
52
|
+
if (!isUuid(operationId))
|
|
53
|
+
throw new RepositoryServiceError("operation_id must be UUIDv4");
|
|
54
|
+
const workspace = await store.loadWorkspace(repositoryId);
|
|
55
|
+
requireRebase(workspace, rebaseId, expectedHead);
|
|
56
|
+
let context;
|
|
57
|
+
try {
|
|
58
|
+
context = conflictContext(workspace.conflicts);
|
|
59
|
+
}
|
|
60
|
+
catch (error) {
|
|
61
|
+
if (error instanceof RepositoryRebaseError)
|
|
62
|
+
throw new RepositoryServiceError(error.message, { cause: error });
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
const actorId = context.localCommits.at(-1)?.authorId;
|
|
66
|
+
if (actorId === undefined)
|
|
67
|
+
throw new RepositoryServiceError("repository rebase is corrupt");
|
|
68
|
+
await store.applyAtomic(pullBatch({
|
|
69
|
+
mode: "abort", workspace, context, commits: [], latestValues: [],
|
|
70
|
+
resultingHead: workspace.localHeadCommitId, clearRebase: true,
|
|
71
|
+
}));
|
|
72
|
+
return { repositoryId, rebaseId, head: workspace.localHeadCommitId, state: "aborted" };
|
|
73
|
+
}
|
|
74
|
+
export function requireRebase(workspace, rebaseId, expectedHead) {
|
|
75
|
+
if (workspace.rebase === null || workspace.rebase.rebaseId !== rebaseId || workspace.localHeadCommitId !== expectedHead) {
|
|
76
|
+
throw new RepositoryServiceError("repository_rebase_id_mismatch");
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
function referenceSetsFromSnapshot(snapshot) {
|
|
80
|
+
try {
|
|
81
|
+
const projection = parseRepositoryJson(Buffer.from(snapshot.canonicalBytes).toString("utf8"));
|
|
82
|
+
const rows = isRecord(projection) && isRecord(projection.tables)
|
|
83
|
+
? projection.tables.repository_artifact_references
|
|
84
|
+
: isRecord(projection) && (projection.format === "flywheel.repository.projection.v1" || projection.format === "flywheel.repository.projection.v2")
|
|
85
|
+
? projection.artifact_references : (() => { throw new Error(); })();
|
|
86
|
+
const sets = new Map();
|
|
87
|
+
for (const row of rows) {
|
|
88
|
+
const value = Array.isArray(row)
|
|
89
|
+
? { artifact_id: row[1], owner_type: row[2], owner_id: row[3], order: row[6] }
|
|
90
|
+
: isRecord(row)
|
|
91
|
+
? { artifact_id: row.artifact_id, owner_type: row.owner_kind, owner_id: row.owner_id, order: row.reference_order }
|
|
92
|
+
: null;
|
|
93
|
+
if (value === null || !isUuid(value.artifact_id) || (value.owner_type !== "node" && value.owner_type !== "edge") ||
|
|
94
|
+
!isUuid(value.owner_id) || (typeof value.order !== "number" && typeof value.order !== "bigint") ||
|
|
95
|
+
(typeof value.order === "number" && (!Number.isSafeInteger(value.order) || value.order < 0)) || value.order < 0)
|
|
96
|
+
throw new Error();
|
|
97
|
+
const owners = sets.get(value.artifact_id) ?? new Map();
|
|
98
|
+
const key = `${value.owner_type}\u0000${value.owner_id}`;
|
|
99
|
+
if (owners.has(key))
|
|
100
|
+
throw new Error();
|
|
101
|
+
owners.set(key, value.order);
|
|
102
|
+
sets.set(value.artifact_id, owners);
|
|
103
|
+
}
|
|
104
|
+
return sets;
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
throw new RepositoryServiceError("remote artifact references are invalid", { cause: error });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function artifactPropertiesFromSnapshot(snapshot) {
|
|
111
|
+
try {
|
|
112
|
+
const projection = parseRepositoryJson(Buffer.from(snapshot.canonicalBytes).toString("utf8"));
|
|
113
|
+
const rows = isRecord(projection) && isRecord(projection.tables)
|
|
114
|
+
? projection.tables.repository_artifacts
|
|
115
|
+
: isRecord(projection) && (projection.format === "flywheel.repository.projection.v1" || projection.format === "flywheel.repository.projection.v2")
|
|
116
|
+
? projection.artifacts : (() => { throw new Error(); })();
|
|
117
|
+
const values = new Map();
|
|
118
|
+
for (const row of rows) {
|
|
119
|
+
const artifactId = Array.isArray(row) ? row[1] : isRecord(row) ? row.artifact_id : undefined;
|
|
120
|
+
const properties = Array.isArray(row)
|
|
121
|
+
? row.length === 6
|
|
122
|
+
? row[3]
|
|
123
|
+
: legacyArtifactProperties({ name: row[3], media_type: row[4], notes: row[5], tags: row[6] })
|
|
124
|
+
: isRecord(row) && typeof row.properties === "string"
|
|
125
|
+
? row.properties
|
|
126
|
+
: isRecord(row)
|
|
127
|
+
? legacyArtifactProperties({ name: row.name, media_type: row.media_type, notes: row.notes, tags: row.tags })
|
|
128
|
+
: undefined;
|
|
129
|
+
if (!isUuid(artifactId) || typeof properties !== "string")
|
|
130
|
+
throw new Error();
|
|
131
|
+
parseArtifactProperties(properties);
|
|
132
|
+
values.set(artifactId, properties);
|
|
133
|
+
}
|
|
134
|
+
return values;
|
|
135
|
+
}
|
|
136
|
+
catch (error) {
|
|
137
|
+
throw new RepositoryServiceError("remote artifact properties are invalid", { cause: error });
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
function applyReferenceOperation(referenceSets, operation) {
|
|
141
|
+
const payload = operation.payload;
|
|
142
|
+
if (operation.type === "artifact.attach.v1" || operation.type === "artifact.attach.v2") {
|
|
143
|
+
const owner = payload.owner;
|
|
144
|
+
if (!isRecord(owner) || !isUuid(payload.artifact_id) || !isUuid(owner.owner_id) ||
|
|
145
|
+
(owner.owner_type !== "node" && owner.owner_type !== "edge") ||
|
|
146
|
+
(typeof payload.order !== "number" && typeof payload.order !== "bigint")) {
|
|
147
|
+
throw new RepositoryServiceError("local artifact reference is invalid");
|
|
148
|
+
}
|
|
149
|
+
const owners = referenceSets.get(payload.artifact_id) ?? new Map();
|
|
150
|
+
owners.set(`${owner.owner_type}\u0000${owner.owner_id}`, payload.order);
|
|
151
|
+
referenceSets.set(payload.artifact_id, owners);
|
|
152
|
+
}
|
|
153
|
+
else if (operation.type === "artifact.detach.v1") {
|
|
154
|
+
const owner = payload.owner;
|
|
155
|
+
if (!isRecord(owner) || !isUuid(payload.artifact_id) || !isUuid(owner.owner_id) ||
|
|
156
|
+
(owner.owner_type !== "node" && owner.owner_type !== "edge"))
|
|
157
|
+
throw new RepositoryServiceError("local artifact reference is invalid");
|
|
158
|
+
referenceSets.get(payload.artifact_id)?.delete(`${owner.owner_type}\u0000${owner.owner_id}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
function latestTarget(operation) {
|
|
162
|
+
const payload = operation.payload;
|
|
163
|
+
if (operation.type === "node.field.set.v1")
|
|
164
|
+
return ["node", payload.node_id, payload.field, payload.new_digest];
|
|
165
|
+
if (operation.type === "edge.field.set.v1")
|
|
166
|
+
return ["edge", payload.edge_id, "content", payload.new_digest];
|
|
167
|
+
if (operation.type === "artifact.metadata.set.v1")
|
|
168
|
+
return ["artifact", payload.artifact_id, payload.field, payload.new_digest];
|
|
169
|
+
if (operation.type === "artifact.properties.set.v1")
|
|
170
|
+
return ["artifact", payload.artifact_id, "properties", payload.new_digest];
|
|
171
|
+
return undefined;
|
|
172
|
+
}
|
|
173
|
+
function latestGroups(rebased, originalWrites, manualValues) {
|
|
174
|
+
const finalTargets = new Set();
|
|
175
|
+
const finalAttachments = new Map();
|
|
176
|
+
for (const [index, operation] of rebased.operations.entries()) {
|
|
177
|
+
const target = latestTarget(operation);
|
|
178
|
+
if (target)
|
|
179
|
+
finalTargets.add(JSON.stringify(target.slice(0, 3)));
|
|
180
|
+
if (operation.type === "artifact.attach.v1" || operation.type === "artifact.attach.v2") {
|
|
181
|
+
finalAttachments.set(operation.payload.artifact_id, index);
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
const writes = [];
|
|
185
|
+
const retainedKeys = new Set();
|
|
186
|
+
for (const [index, operation] of rebased.operations.entries()) {
|
|
187
|
+
const target = latestTarget(operation);
|
|
188
|
+
const manualValue = manualValues[operation.operationId];
|
|
189
|
+
if (manualValue !== undefined) {
|
|
190
|
+
if (!target || valueDigest(manualValue) !== target[3])
|
|
191
|
+
throw new RepositoryServiceError("manual rebase value digest is invalid");
|
|
192
|
+
writes.push(LatestValueWrite.fromMapping({
|
|
193
|
+
owner_type: target[0], owner_id: target[1], field: target[2], value: manualValue, value_digest: target[3],
|
|
194
|
+
}).canonicalBytes);
|
|
195
|
+
continue;
|
|
196
|
+
}
|
|
197
|
+
if (target) {
|
|
198
|
+
const key = JSON.stringify(target.slice(0, 3));
|
|
199
|
+
const original = originalWrites.get(key);
|
|
200
|
+
if (original?.valueDigest === target[3]) {
|
|
201
|
+
writes.push(original.canonicalBytes);
|
|
202
|
+
retainedKeys.add(key);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
if (operation.type === "artifact.attach.v1") {
|
|
206
|
+
const artifactId = operation.payload.artifact_id;
|
|
207
|
+
if (finalAttachments.get(artifactId) === index) {
|
|
208
|
+
for (const field of LEGACY_ATTACHMENT_FIELDS) {
|
|
209
|
+
const key = JSON.stringify(["artifact", artifactId, field]);
|
|
210
|
+
const original = originalWrites.get(key);
|
|
211
|
+
if (!finalTargets.has(key) && !retainedKeys.has(key) && original !== undefined) {
|
|
212
|
+
writes.push(original.canonicalBytes);
|
|
213
|
+
retainedKeys.add(key);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
if (operation.type === "artifact.attach.v2") {
|
|
219
|
+
const key = JSON.stringify(["artifact", operation.payload.artifact_id, "properties"]);
|
|
220
|
+
const original = originalWrites.get(key);
|
|
221
|
+
if (!finalTargets.has(key) && finalAttachments.get(operation.payload.artifact_id) === index &&
|
|
222
|
+
!retainedKeys.has(key) && original !== undefined && original.valueDigest === operation.payload.properties_digest) {
|
|
223
|
+
writes.push(original.canonicalBytes);
|
|
224
|
+
retainedKeys.add(key);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
return writes;
|
|
229
|
+
}
|
|
230
|
+
export function rebaseLocalCommits(localCommitsNewestFirst, targetHead, clientId, rebaseId, resolutions, clock, remoteSnapshot, localLatestValues = new Map()) {
|
|
231
|
+
let parent = targetHead;
|
|
232
|
+
const commits = [];
|
|
233
|
+
const latestValuesByCommit = [];
|
|
234
|
+
const manualValues = {};
|
|
235
|
+
const fieldResolutionHeads = new Map();
|
|
236
|
+
const referenceSets = remoteSnapshot === undefined ? undefined : referenceSetsFromSnapshot(remoteSnapshot);
|
|
237
|
+
const artifactProperties = remoteSnapshot === undefined ? undefined : artifactPropertiesFromSnapshot(remoteSnapshot);
|
|
238
|
+
for (const original of [...localCommitsNewestFirst].reverse()) {
|
|
239
|
+
const originalWrites = localLatestValues.get(original.commitId) ?? new Map();
|
|
240
|
+
const operations = [];
|
|
241
|
+
for (const operation of original.operations) {
|
|
242
|
+
const key = operationKey(operation);
|
|
243
|
+
const resolution = resolutionFor(resolutions, key);
|
|
244
|
+
const [strategy, manualValue, remoteDigest] = resolution ?? ["local", null, null];
|
|
245
|
+
if (strategy === "remote")
|
|
246
|
+
continue;
|
|
247
|
+
const mapping = { ...operation.toMapping(), operation_id: randomUUID() };
|
|
248
|
+
if (strategy === "manual") {
|
|
249
|
+
if (manualValue === null)
|
|
250
|
+
throw new RepositoryServiceError("manual conflict value is missing");
|
|
251
|
+
mapping.new_digest = valueDigest(manualValue);
|
|
252
|
+
manualValues[mapping.operation_id] = manualValue;
|
|
253
|
+
}
|
|
254
|
+
if (resolution !== undefined && (strategy === "local" || strategy === "manual")) {
|
|
255
|
+
if (operation.type === "artifact.properties.set.v1" && artifactProperties !== undefined) {
|
|
256
|
+
const current = artifactProperties.get(operation.payload.artifact_id);
|
|
257
|
+
if (current === undefined)
|
|
258
|
+
throw new RepositoryServiceError("remote artifact properties are invalid");
|
|
259
|
+
mapping.expected_digest = valueDigest(current);
|
|
260
|
+
}
|
|
261
|
+
else if (operation.type === "artifact.metadata.set.v1" && artifactProperties !== undefined) {
|
|
262
|
+
const current = artifactProperties.get(operation.payload.artifact_id);
|
|
263
|
+
const field = operation.payload.field;
|
|
264
|
+
if (current === undefined)
|
|
265
|
+
throw new RepositoryServiceError("remote artifact properties are invalid");
|
|
266
|
+
mapping.expected_digest = valueDigest(legacyArtifactMetadata(current)[field]);
|
|
267
|
+
}
|
|
268
|
+
else if ((Object.hasOwn(mapping, "expected_digest") && Object.hasOwn(mapping, "new_digest")) ||
|
|
269
|
+
(Object.hasOwn(mapping, "expected_object_digest") && Object.hasOwn(mapping, "object_digest"))) {
|
|
270
|
+
const expectedName = Object.hasOwn(mapping, "expected_digest") ? "expected_digest" : "expected_object_digest";
|
|
271
|
+
const newName = expectedName === "expected_digest" ? "new_digest" : "object_digest";
|
|
272
|
+
const expected = fieldResolutionHeads.get(JSON.stringify(key)) ?? remoteDigest;
|
|
273
|
+
if (expected !== null)
|
|
274
|
+
mapping[expectedName] = expected;
|
|
275
|
+
if (typeof mapping[newName] !== "string")
|
|
276
|
+
throw new RepositoryServiceError("field conflict new digest is invalid");
|
|
277
|
+
fieldResolutionHeads.set(JSON.stringify(key), mapping[newName]);
|
|
278
|
+
}
|
|
279
|
+
if (referenceSets !== undefined && Object.hasOwn(mapping, "expected_reference_digest")) {
|
|
280
|
+
const artifactId = mapping.artifact_id;
|
|
281
|
+
if (typeof artifactId !== "string")
|
|
282
|
+
throw new RepositoryServiceError("artifact conflict reference is invalid");
|
|
283
|
+
const references = referenceSets.get(artifactId) ?? new Map();
|
|
284
|
+
mapping.expected_reference_digest = artifactReferenceSetDigest([...references.entries()].map(([owner, order]) => {
|
|
285
|
+
const [owner_type, owner_id] = owner.split("\u0000");
|
|
286
|
+
return { owner_type: owner_type, owner_id, order };
|
|
287
|
+
}));
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
const rebased = RepositoryOperation.fromMapping(mapping);
|
|
291
|
+
operations.push(rebased);
|
|
292
|
+
if (referenceSets !== undefined)
|
|
293
|
+
applyReferenceOperation(referenceSets, rebased);
|
|
294
|
+
if (artifactProperties !== undefined && rebased.type.startsWith("artifact.")) {
|
|
295
|
+
const writes = new Map(originalWrites);
|
|
296
|
+
const manual = manualValues[rebased.operationId];
|
|
297
|
+
if (manual !== undefined && rebased.type === "artifact.properties.set.v1") {
|
|
298
|
+
writes.set("manual", LatestValueWrite.fromMapping({
|
|
299
|
+
owner_type: "artifact", owner_id: rebased.payload.artifact_id, field: "properties",
|
|
300
|
+
value: manual, value_digest: rebased.payload.new_digest,
|
|
301
|
+
}));
|
|
302
|
+
}
|
|
303
|
+
const properties = foldArtifactPropertiesOperation(artifactProperties.get(rebased.payload.artifact_id), rebased, writes);
|
|
304
|
+
if (properties !== undefined)
|
|
305
|
+
artifactProperties.set(rebased.payload.artifact_id, properties);
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (operations.length === 0)
|
|
309
|
+
continue;
|
|
310
|
+
const commit = RepositoryCommit.create({
|
|
311
|
+
repositoryId: original.repositoryId, operations, parentCommitId: parent,
|
|
312
|
+
authorKind: "client", authorId: clientId, authoredAt: commitTimestamp(clock),
|
|
313
|
+
message: original.message, intent: `rebase:${rebaseId}:${original.commitId}`,
|
|
314
|
+
latestStateDigests: latestStateDigests(operations), artifactDigests: artifactDigests(operations), rebasedFrom: original.commitId,
|
|
315
|
+
});
|
|
316
|
+
commits.push(commit);
|
|
317
|
+
latestValuesByCommit.push(latestGroups(commit, originalWrites, manualValues));
|
|
318
|
+
parent = commit.commitId;
|
|
319
|
+
}
|
|
320
|
+
return { commits, latestValuesByCommit, manualValues };
|
|
321
|
+
}
|
|
322
|
+
export async function loadRebaseLatestValues(store, repositoryId, commits) {
|
|
323
|
+
const values = new Map();
|
|
324
|
+
try {
|
|
325
|
+
for (const commit of commits) {
|
|
326
|
+
const writes = new Map();
|
|
327
|
+
for (const raw of await store.loadCommitLatestValues(repositoryId, commit.commitId)) {
|
|
328
|
+
const write = LatestValueWrite.fromCanonicalBytes(raw);
|
|
329
|
+
writes.set(JSON.stringify(write.key), write);
|
|
330
|
+
}
|
|
331
|
+
values.set(commit.commitId, writes);
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
catch (error) {
|
|
335
|
+
throw new RepositoryServiceError("original commit latest values are invalid", { cause: error });
|
|
336
|
+
}
|
|
337
|
+
return values;
|
|
338
|
+
}
|
|
339
|
+
function resolutionFor(resolutions, key) {
|
|
340
|
+
for (const [candidate, resolution] of resolutions) {
|
|
341
|
+
if (candidate.length === key.length && candidate.every((value, index) => value === key[index]))
|
|
342
|
+
return resolution;
|
|
343
|
+
}
|
|
344
|
+
return undefined;
|
|
345
|
+
}
|
|
346
|
+
//# sourceMappingURL=replay.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"replay.js","sourceRoot":"","sources":["../../../../src/local/domain/rebase/replay.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,0BAA0B,EAAE,+BAA+B,EAAE,sBAAsB,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,kCAAkC,CAAC;AAC1L,OAAO,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACzE,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAG3E,OAAO,EAAE,gBAAgB,EAAgD,MAAM,yBAAyB,CAAC;AACzG,OAAO,EAAE,eAAe,EAAE,uBAAuB,EAAE,MAAM,gBAAgB,CAAC;AAE1E,OAAO,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;A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ionDigest, resolveConflictBytes } from "./conflicts.js";
|
|
4
|
+
import { RepositoryRebaseError } from "./context.js";
|
|
5
|
+
export async function resolveConflict(store, repositoryId, operationId, conflictId, strategy, manualValue) {
|
|
6
|
+
if (!isUuid(operationId))
|
|
7
|
+
throw new RepositoryServiceError("operation_id must be UUIDv4");
|
|
8
|
+
const workspace = await store.loadWorkspace(repositoryId);
|
|
9
|
+
if (workspace.rebase === null)
|
|
10
|
+
throw new RepositoryServiceError("repository rebase is not active");
|
|
11
|
+
const conflict = workspace.conflicts.find(candidate => candidate.conflictId === conflictId);
|
|
12
|
+
if (conflict === undefined || conflict.rebaseId !== workspace.rebase.rebaseId) {
|
|
13
|
+
throw new RepositoryServiceError("repository conflict is not active");
|
|
14
|
+
}
|
|
15
|
+
let canonicalBytes;
|
|
16
|
+
try {
|
|
17
|
+
canonicalBytes = resolveConflictBytes(conflict, strategy, manualValue);
|
|
18
|
+
}
|
|
19
|
+
catch (error) {
|
|
20
|
+
if (error instanceof RepositoryRebaseError)
|
|
21
|
+
throw new RepositoryServiceError(error.message, { cause: error });
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
const resolved = { ...conflict, state: "resolved", canonicalBytes };
|
|
25
|
+
const conflicts = workspace.conflicts.map(candidate => candidate.conflictId === conflictId ? resolved : candidate);
|
|
26
|
+
const rebase = {
|
|
27
|
+
repositoryId, rebaseId: workspace.rebase.rebaseId, state: "resolving",
|
|
28
|
+
baseCommitId: workspace.rebase.baseCommitId, pendingResolutionDigest: resolutionDigest(conflicts),
|
|
29
|
+
};
|
|
30
|
+
const batch = {
|
|
31
|
+
repositoryId, expectedStaging: workspace.staging, expectedRebase: workspace.rebase,
|
|
32
|
+
expectedConflicts: workspace.conflicts, staging: workspace.staging, rebase, conflicts,
|
|
33
|
+
};
|
|
34
|
+
await store.applyWorkspaceAtomic(batch);
|
|
35
|
+
return resolved;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -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AAK,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC9G,MAAM,KAAK,CAAC;IACd,CAAC;IACD,MAAM,QAAQ,GAAmB,EAAE,GAAG,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,CAAC;IACpF,MAAM,SAAS,GAAG,SAAS,CAAC,SAAS,CAAC,GAAG,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,UAAU,KAAK,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IACnH,MAAM,MAAM,GAAgB;QAC1B,YAAY,EAAE,QAAQ,EAAE,SAAS,CAAC,MAAM,CAAC,QAAQ,EAAE,KAAK,EAAE,WAAW;QACrE,YAAY,EAAE,SAAS,CAAC,MAAM,CAAC,YAAY,EAAE,uBAAuB,EAAE,gBAAgB,CAAC,SAAS,CAAC;KAClG,CAAC;IACF,MAAM,KAAK,GAAyB;QAClC,YAAY,EAAE,eAAe,EAAE,SAAS,CAAC,OAAO,EAAE,cAAc,EAAE,SAAS,CAAC,MAAM;QAClF,iBAAiB,EAAE,SAAS,CAAC,SAAS,EAAE,OAAO,EAAE,SAAS,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS;KACtF,CAAC;IACF,MAAM,KAAK,CAAC,oBAAoB,CAAC,KAAK,CAAC,CAAC;IACxC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
import { createHash } from "node:crypto";
|
|
2
|
+
import { RepositoryRevertError } from "./plan.js";
|
|
3
|
+
import { canonicalBytes, valueDigest } from "../models/encoding.js";
|
|
4
|
+
import { legacyArtifactMetadata } from "../models/artifact-properties.js";
|
|
5
|
+
import { inverseTagAssignment } from "./tag-inverses.js";
|
|
6
|
+
import { isDeepStrictEqual } from "node:util";
|
|
7
|
+
function baseMapping(operation, inverseOperationId, inverseType) {
|
|
8
|
+
return {
|
|
9
|
+
type: inverseType,
|
|
10
|
+
operation_id: inverseOperationId,
|
|
11
|
+
repository_id: operation.repositoryId,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
function copyPayload(operation, keys) {
|
|
15
|
+
const copied = {};
|
|
16
|
+
for (const key of keys)
|
|
17
|
+
copied[key] = operation.payload[key];
|
|
18
|
+
return copied;
|
|
19
|
+
}
|
|
20
|
+
function projectionDigest(value) {
|
|
21
|
+
return `sha256:${createHash("sha256").update(canonicalBytes(value)).digest("hex")}`;
|
|
22
|
+
}
|
|
23
|
+
function retainedOperation(operationTypes, context, keys, expected) {
|
|
24
|
+
const candidates = [
|
|
25
|
+
...context.target.operations.slice(0, context.targetPosition).reverse(),
|
|
26
|
+
...context.history.slice(context.targetIndex + 1).flatMap((commit) => [...commit.operations].reverse()),
|
|
27
|
+
];
|
|
28
|
+
for (const candidate of candidates) {
|
|
29
|
+
if ((typeof operationTypes === "string" ? candidate.type === operationTypes : operationTypes.includes(candidate.type)) &&
|
|
30
|
+
keys.every((key) => isDeepStrictEqual(candidate.payload[key], expected[key])))
|
|
31
|
+
return candidate;
|
|
32
|
+
}
|
|
33
|
+
throw new RepositoryRevertError("repository_revert_retained_payload_missing");
|
|
34
|
+
}
|
|
35
|
+
export function inverseMapping(operation, inverseOperationId, context) {
|
|
36
|
+
const payload = operation.payload;
|
|
37
|
+
switch (operation.type) {
|
|
38
|
+
case "node.create.v1":
|
|
39
|
+
return {
|
|
40
|
+
...baseMapping(operation, inverseOperationId, "node.tombstone.v1"),
|
|
41
|
+
node_id: payload.node_id,
|
|
42
|
+
expected_lifecycle: "live",
|
|
43
|
+
relation_reference_digest: projectionDigest({
|
|
44
|
+
node_id: payload.node_id,
|
|
45
|
+
references: payload.initial_reference_digests,
|
|
46
|
+
}),
|
|
47
|
+
};
|
|
48
|
+
case "node.tombstone.v1":
|
|
49
|
+
case "node.restore.v1": {
|
|
50
|
+
const inverseType = operation.type === "node.tombstone.v1" ? "node.restore.v1" : "node.tombstone.v1";
|
|
51
|
+
return {
|
|
52
|
+
...baseMapping(operation, inverseOperationId, inverseType),
|
|
53
|
+
node_id: payload.node_id,
|
|
54
|
+
expected_lifecycle: inverseType === "node.restore.v1" ? "tombstoned" : "live",
|
|
55
|
+
relation_reference_digest: payload.relation_reference_digest,
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
case "tag.define.v1":
|
|
59
|
+
return {
|
|
60
|
+
...baseMapping(operation, inverseOperationId, "tag.retire.v1"),
|
|
61
|
+
scope_node_id: payload.scope_node_id,
|
|
62
|
+
tag_id: payload.tag_id,
|
|
63
|
+
expected_definition_digest: projectionDigest(payload.definition),
|
|
64
|
+
previous_definition: payload.definition,
|
|
65
|
+
};
|
|
66
|
+
case "tag.update.v1":
|
|
67
|
+
return {
|
|
68
|
+
...baseMapping(operation, inverseOperationId, "tag.update.v1"),
|
|
69
|
+
scope_node_id: payload.scope_node_id,
|
|
70
|
+
tag_id: payload.tag_id,
|
|
71
|
+
expected_definition_digest: projectionDigest(payload.definition),
|
|
72
|
+
previous_definition: payload.definition,
|
|
73
|
+
definition: payload.previous_definition,
|
|
74
|
+
};
|
|
75
|
+
case "tag.retire.v1":
|
|
76
|
+
return {
|
|
77
|
+
...baseMapping(operation, inverseOperationId, "tag.define.v1"),
|
|
78
|
+
scope_node_id: payload.scope_node_id,
|
|
79
|
+
tag_id: payload.tag_id,
|
|
80
|
+
expected_tag_state: "absent",
|
|
81
|
+
definition: payload.previous_definition,
|
|
82
|
+
};
|
|
83
|
+
case "node.tag.assign.v1":
|
|
84
|
+
return inverseTagAssignment(operation, inverseOperationId, context, baseMapping, copyPayload);
|
|
85
|
+
case "node.tag.remove.v1":
|
|
86
|
+
return {
|
|
87
|
+
...baseMapping(operation, inverseOperationId, "node.tag.assign.v1"),
|
|
88
|
+
scope_node_id: payload.scope_node_id,
|
|
89
|
+
node_id: payload.node_id,
|
|
90
|
+
tag_id: payload.tag_id,
|
|
91
|
+
expected_holder: null,
|
|
92
|
+
new_holder: payload.node_id,
|
|
93
|
+
assignment_mode: "initial",
|
|
94
|
+
relation_metadata: payload.relation_metadata,
|
|
95
|
+
};
|
|
96
|
+
case "lineage.add.v1":
|
|
97
|
+
case "lineage.remove.v1": {
|
|
98
|
+
const inverseType = operation.type === "lineage.add.v1" ? "lineage.remove.v1" : "lineage.add.v1";
|
|
99
|
+
return {
|
|
100
|
+
...baseMapping(operation, inverseOperationId, inverseType),
|
|
101
|
+
parent_node_id: payload.parent_node_id,
|
|
102
|
+
child_node_id: payload.child_node_id,
|
|
103
|
+
expected_relation_state: inverseType === "lineage.remove.v1" ? "present" : "absent",
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
case "containment.assign.v1":
|
|
107
|
+
return {
|
|
108
|
+
...baseMapping(operation, inverseOperationId, "containment.remove.v1"),
|
|
109
|
+
containment_id: payload.containment_id,
|
|
110
|
+
child_node_id: payload.child_node_id,
|
|
111
|
+
expected_relation_state: "present",
|
|
112
|
+
relation_digest: payload.relation_digest,
|
|
113
|
+
};
|
|
114
|
+
case "containment.remove.v1": {
|
|
115
|
+
const retained = retainedOperation("containment.assign.v1", context, ["containment_id", "child_node_id", "relation_digest"], payload);
|
|
116
|
+
return {
|
|
117
|
+
...baseMapping(operation, inverseOperationId, "containment.assign.v1"),
|
|
118
|
+
...copyPayload(retained, [
|
|
119
|
+
"containment_id", "container_node_id", "child_node_id", "relation_digest", "ordinal", "source_artifact_id",
|
|
120
|
+
]),
|
|
121
|
+
expected_relation_state: "absent",
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
case "edge.add.v1":
|
|
125
|
+
return {
|
|
126
|
+
...baseMapping(operation, inverseOperationId, "edge.remove.v1"),
|
|
127
|
+
edge_id: payload.edge_id,
|
|
128
|
+
expected_relation_state: "present",
|
|
129
|
+
relation_digest: payload.relation_digest,
|
|
130
|
+
};
|
|
131
|
+
case "artifact.content.set.v1":
|
|
132
|
+
return {
|
|
133
|
+
...baseMapping(operation, inverseOperationId, "artifact.content.set.v1"),
|
|
134
|
+
artifact_id: payload.artifact_id,
|
|
135
|
+
expected_object_digest: payload.object_digest,
|
|
136
|
+
object_digest: payload.expected_object_digest,
|
|
137
|
+
expected_reference_digest: payload.expected_reference_digest,
|
|
138
|
+
change_metadata: payload.change_metadata,
|
|
139
|
+
};
|
|
140
|
+
case "artifact.properties.set.v1": {
|
|
141
|
+
const artifactId = payload.artifact_id;
|
|
142
|
+
const current = typeof artifactId === "string" ? context.currentArtifactProperties.get(artifactId) : undefined;
|
|
143
|
+
const reverted = context.revertedArtifactProperties?.get(operation.operationId);
|
|
144
|
+
return {
|
|
145
|
+
...baseMapping(operation, inverseOperationId, "artifact.properties.set.v1"),
|
|
146
|
+
artifact_id: artifactId,
|
|
147
|
+
expected_digest: current === undefined || reverted === undefined ? payload.new_digest : valueDigest(current),
|
|
148
|
+
new_digest: reverted === undefined ? payload.expected_digest : valueDigest(reverted),
|
|
149
|
+
expected_reference_digest: payload.expected_reference_digest,
|
|
150
|
+
change_metadata: payload.change_metadata,
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
case "artifact.attach.v1":
|
|
154
|
+
case "artifact.attach.v2": {
|
|
155
|
+
const owner = payload.owner;
|
|
156
|
+
if (owner === null || typeof owner !== "object" || Array.isArray(owner) || JSON.isRawJSON(owner)) {
|
|
157
|
+
throw new RepositoryRevertError("repository_revert_unsupported_operation");
|
|
158
|
+
}
|
|
159
|
+
const ownerMapping = owner;
|
|
160
|
+
return {
|
|
161
|
+
...baseMapping(operation, inverseOperationId, "artifact.detach.v1"),
|
|
162
|
+
owner,
|
|
163
|
+
artifact_id: payload.artifact_id,
|
|
164
|
+
object_digest: payload.object_digest,
|
|
165
|
+
expected_reference_state: "present",
|
|
166
|
+
reference_digest: projectionDigest({
|
|
167
|
+
artifact_id: payload.artifact_id,
|
|
168
|
+
object_digest: payload.object_digest,
|
|
169
|
+
owner_kind: ownerMapping.owner_type,
|
|
170
|
+
owner_id: ownerMapping.owner_id,
|
|
171
|
+
reference_order: payload.order,
|
|
172
|
+
}),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
case "artifact.detach.v1": {
|
|
176
|
+
const retained = retainedOperation(["artifact.attach.v1", "artifact.attach.v2"], context, ["owner", "artifact_id"], payload);
|
|
177
|
+
const digestField = retained.type === "artifact.attach.v2" ? "properties_digest" : "metadata_digest";
|
|
178
|
+
const restored = copyPayload(retained, [
|
|
179
|
+
"owner", "artifact_id", "object_digest", "order", digestField, "reference_metadata",
|
|
180
|
+
]);
|
|
181
|
+
const properties = context.currentArtifactProperties.get(payload.artifact_id);
|
|
182
|
+
if (properties === undefined)
|
|
183
|
+
throw new RepositoryRevertError("repository_revert_retained_payload_missing");
|
|
184
|
+
restored.object_digest = payload.object_digest;
|
|
185
|
+
try {
|
|
186
|
+
restored[digestField] = retained.type === "artifact.attach.v2"
|
|
187
|
+
? valueDigest(properties)
|
|
188
|
+
: projectionDigest(legacyArtifactMetadata(properties));
|
|
189
|
+
}
|
|
190
|
+
catch (error) {
|
|
191
|
+
throw new RepositoryRevertError("repository_revert_retained_payload_missing", { cause: error });
|
|
192
|
+
}
|
|
193
|
+
return {
|
|
194
|
+
...baseMapping(operation, inverseOperationId, retained.type),
|
|
195
|
+
...restored,
|
|
196
|
+
expected_reference_state: "absent",
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
default:
|
|
200
|
+
throw new RepositoryRevertError("repository_revert_unsupported_operation");
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
//# sourceMappingURL=inverses.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"inverses.js","sourceRoot":"","sources":["../../../../src/local/domain/revert/inverses.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,uBAA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