@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
|
@@ -5,345 +5,345 @@ import { rm } from "node:fs/promises";
|
|
|
5
5
|
import path from "node:path";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
ALL_HOST_NAMES,
|
|
9
|
+
SERVER_NAME,
|
|
10
|
+
detectHosts,
|
|
11
|
+
getHost,
|
|
12
|
+
isSkillOnlyHost,
|
|
13
|
+
normalizeHosts,
|
|
14
14
|
} from "../../agents.mjs";
|
|
15
15
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
readEntryServerUrl,
|
|
17
|
+
readNamedConfigEntry,
|
|
18
|
+
readJsonConfig,
|
|
19
|
+
readTomlServerEntry,
|
|
20
|
+
readYamlConfig,
|
|
21
|
+
resolveMcpPath,
|
|
22
22
|
} from "../../mcp-writer.mjs";
|
|
23
23
|
import { resolveSetupApiKey } from "../../setup-auth.mjs";
|
|
24
24
|
import {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
25
|
+
cleanupInstalledSkillArtifactsForHosts,
|
|
26
|
+
formatSupportedInstallSkillHosts,
|
|
27
|
+
inspectInstalledSkillArtifactsForHosts,
|
|
28
|
+
installBundledSkillForHosts,
|
|
29
|
+
isDirectCopySkillHost,
|
|
30
|
+
listBundledSkills,
|
|
31
|
+
partitionInstallSkillHosts,
|
|
32
|
+
resolveInstalledSkillDir,
|
|
33
|
+
resolvePackageRoot,
|
|
34
|
+
resolveSkillsAgentName,
|
|
35
35
|
} from "../../skill-installer.mjs";
|
|
36
36
|
import { runMcpSetupMode } from "./mcp.mjs";
|
|
37
37
|
import { SetupModeUsageError } from "../mode.mjs";
|
|
38
38
|
import { recordResolvedHosts } from "../resolved-selection-record.mjs";
|
|
39
39
|
import {
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
detectPriorModeForSetup,
|
|
41
|
+
formatPriorModeConflictError,
|
|
42
42
|
} from "../shared/prior-mode-detect.mjs";
|
|
43
43
|
import { renderSetupSummary } from "../shared/summary.mjs";
|
|
44
44
|
import { resolveSetupBaseUrl } from "../base-url.mjs";
|
|
45
45
|
|
|
46
46
|
const NON_INTERACTIVE_SKILL_DECISION_ERROR =
|
|
47
|
-
|
|
47
|
+
"Non-interactive setup requires one of --install-skill or --skip-skill.";
|
|
48
48
|
const MUTUALLY_EXCLUSIVE_SKILL_FLAGS_ERROR =
|
|
49
|
-
|
|
49
|
+
"--install-skill and --skip-skill cannot be used together.";
|
|
50
50
|
const GUIDED_SKILL_DECISION_TEST_ENV =
|
|
51
|
-
|
|
51
|
+
"FLYWHEEL_GUIDED_SKILL_DECISION_FOR_TESTS";
|
|
52
52
|
const ENABLE_TEST_SEAMS_ENV = "FLYWHEEL_ENABLE_TEST_SEAMS";
|
|
53
53
|
|
|
54
54
|
const log = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
info: (message) => console.log(pc.cyan(message)),
|
|
56
|
+
warn: (message) => console.log(pc.yellow(`⚠ ${message}`)),
|
|
57
|
+
error: (message) => console.log(pc.red(`✖ ${message}`)),
|
|
58
|
+
plain: (message) => console.log(message),
|
|
59
|
+
blank: () => console.log(""),
|
|
60
60
|
};
|
|
61
61
|
|
|
62
62
|
const CHECKBOX_THEME = {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
style: {
|
|
64
|
+
highlight: (text) => pc.green(text),
|
|
65
|
+
disabledChoice: (text) => ` ${pc.dim("◯")} ${pc.dim(text)}`,
|
|
66
|
+
},
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
function hostChoiceDescription({ detected = false, configured = false } = {}) {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
if (configured) return "Already has a Flywheel entry for this scope.";
|
|
71
|
+
if (detected) return "Detected on this machine.";
|
|
72
|
+
return "Supported host; select it if you use it here.";
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
function normalizeBaseUrl(value) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
76
|
+
const normalized = String(value || "").trim();
|
|
77
|
+
let parsedUrl;
|
|
78
|
+
try {
|
|
79
|
+
parsedUrl = new URL(normalized);
|
|
80
|
+
} catch {
|
|
81
|
+
throw new Error("Base URL must be a valid absolute URL.");
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
if (parsedUrl.pathname !== "/" || parsedUrl.search || parsedUrl.hash) {
|
|
85
|
+
throw new Error(
|
|
86
|
+
"Base URL must be a public Flywheel origin without a path, query, or hash.",
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
89
|
|
|
90
|
-
|
|
90
|
+
return parsedUrl.origin;
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
function normalizeServerName(value) {
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
const normalized = String(value || "").trim();
|
|
95
|
+
if (!normalized) {
|
|
96
|
+
throw new Error("Server name cannot be empty.");
|
|
97
|
+
}
|
|
98
|
+
return normalized;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
function selectedHostsFromOptions(options) {
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
102
|
+
const hosts = [];
|
|
103
|
+
if (options.claude) hosts.push("claude");
|
|
104
|
+
if (options.cursor) hosts.push("cursor");
|
|
105
|
+
if (options.universal) hosts.push("universal");
|
|
106
|
+
if (options.antigravity) hosts.push("antigravity");
|
|
107
|
+
if (options.opencode) hosts.push("opencode");
|
|
108
|
+
if (options.codex) hosts.push("codex");
|
|
109
|
+
if (options.gemini) hosts.push("gemini");
|
|
110
|
+
if (options.piMono) hosts.push("pi-mono");
|
|
111
|
+
if (options.hermesAgent) hosts.push("hermes-agent");
|
|
112
|
+
if (options.openclaw) hosts.push("openclaw");
|
|
113
|
+
return hosts;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
function mcpCandidatesForScope(host, scope) {
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
117
|
+
if (scope === "global") return host.mcp.globalPaths;
|
|
118
|
+
return host.mcp.projectPaths.map((candidate) =>
|
|
119
|
+
path.join(process.cwd(), candidate),
|
|
120
|
+
);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
async function readExistingServerState(hostName, scope, serverName) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
124
|
+
const host = getHost(hostName);
|
|
125
|
+
if (isSkillOnlyHost(host)) {
|
|
126
|
+
return { exists: false, url: null, mcpPath: null };
|
|
127
|
+
}
|
|
128
|
+
const mcpPath = await resolveMcpPath(mcpCandidatesForScope(host, scope));
|
|
129
|
+
|
|
130
|
+
if (host.mcp.configType === "toml") {
|
|
131
|
+
const { exists, url } = await readTomlServerEntry(mcpPath, serverName);
|
|
132
|
+
return { exists, url, mcpPath };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
const existing =
|
|
136
|
+
host.mcp.configType === "yaml"
|
|
137
|
+
? await readYamlConfig(mcpPath)
|
|
138
|
+
: await readJsonConfig(mcpPath);
|
|
139
|
+
const entry = readNamedConfigEntry(existing, host.mcp.configKey, serverName);
|
|
140
|
+
return {
|
|
141
|
+
exists: entry !== null,
|
|
142
|
+
url: readEntryServerUrl(entry),
|
|
143
|
+
mcpPath,
|
|
144
|
+
};
|
|
145
145
|
}
|
|
146
146
|
|
|
147
147
|
async function isAlreadyConfigured(hostName, scope, serverName) {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
148
|
+
const existingState = await readExistingServerState(
|
|
149
|
+
hostName,
|
|
150
|
+
scope,
|
|
151
|
+
serverName,
|
|
152
|
+
);
|
|
153
|
+
return existingState.exists;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
async function inspectInstallSkillHosts({
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
157
|
+
hostNames,
|
|
158
|
+
scope,
|
|
159
|
+
serverName,
|
|
160
|
+
serverUrl,
|
|
161
161
|
}) {
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
for (const hostName of hostNames) {
|
|
167
|
-
const host = getHost(hostName);
|
|
168
|
-
// Skill-only hosts (universal, antigravity) never write an MCP config, so
|
|
169
|
-
// they are not candidates for "needs setup" / "drift" / "matching"
|
|
170
|
-
// classification. Skipping them here is what keeps the auth-resolution
|
|
171
|
-
// gate downstream accurate: without this branch they would land in
|
|
172
|
-
// `needsSetupHosts` and force an API-key mint on `setup --mode mcp
|
|
173
|
-
// --universal --skip-skill`, which is a pure no-op path that must stay
|
|
174
|
-
// hermetic (no browser, no blocking prompt).
|
|
175
|
-
if (isSkillOnlyHost(host)) {
|
|
176
|
-
hostStates.set(hostName, {
|
|
177
|
-
classification: "skill-only",
|
|
178
|
-
mcpPath: null,
|
|
179
|
-
});
|
|
180
|
-
continue;
|
|
181
|
-
}
|
|
182
|
-
// eslint-disable-next-line no-await-in-loop
|
|
183
|
-
const existingState = await readExistingServerState(
|
|
184
|
-
hostName,
|
|
185
|
-
scope,
|
|
186
|
-
serverName,
|
|
187
|
-
);
|
|
188
|
-
if (!existingState.exists) {
|
|
189
|
-
needsSetupHosts.push(hostName);
|
|
190
|
-
hostStates.set(hostName, {
|
|
191
|
-
classification: "needs-setup",
|
|
192
|
-
mcpPath: existingState.mcpPath,
|
|
193
|
-
});
|
|
194
|
-
continue;
|
|
195
|
-
}
|
|
162
|
+
const hostStates = new Map();
|
|
163
|
+
const needsSetupHosts = [];
|
|
164
|
+
const driftHosts = [];
|
|
196
165
|
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
mcpPath: existingState.mcpPath,
|
|
213
|
-
});
|
|
166
|
+
for (const hostName of hostNames) {
|
|
167
|
+
const host = getHost(hostName);
|
|
168
|
+
// Skill-only hosts (universal, antigravity) never write an MCP config, so
|
|
169
|
+
// they are not candidates for "needs setup" / "drift" / "matching"
|
|
170
|
+
// classification. Skipping them here is what keeps the auth-resolution
|
|
171
|
+
// gate downstream accurate: without this branch they would land in
|
|
172
|
+
// `needsSetupHosts` and force an API-key mint on `setup --mode mcp
|
|
173
|
+
// --universal --skip-skill`, which is a pure no-op path that must stay
|
|
174
|
+
// hermetic (no browser, no blocking prompt).
|
|
175
|
+
if (isSkillOnlyHost(host)) {
|
|
176
|
+
hostStates.set(hostName, {
|
|
177
|
+
classification: "skill-only",
|
|
178
|
+
mcpPath: null,
|
|
179
|
+
});
|
|
180
|
+
continue;
|
|
214
181
|
}
|
|
182
|
+
// eslint-disable-next-line no-await-in-loop
|
|
183
|
+
const existingState = await readExistingServerState(
|
|
184
|
+
hostName,
|
|
185
|
+
scope,
|
|
186
|
+
serverName,
|
|
187
|
+
);
|
|
188
|
+
if (!existingState.exists) {
|
|
189
|
+
needsSetupHosts.push(hostName);
|
|
190
|
+
hostStates.set(hostName, {
|
|
191
|
+
classification: "needs-setup",
|
|
192
|
+
mcpPath: existingState.mcpPath,
|
|
193
|
+
});
|
|
194
|
+
continue;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
if (existingState.url === serverUrl) {
|
|
198
|
+
hostStates.set(hostName, {
|
|
199
|
+
classification: "matching",
|
|
200
|
+
mcpPath: existingState.mcpPath,
|
|
201
|
+
});
|
|
202
|
+
continue;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
driftHosts.push({
|
|
206
|
+
hostName,
|
|
207
|
+
mcpPath: existingState.mcpPath,
|
|
208
|
+
existingUrl: existingState.url ?? "(missing URL)",
|
|
209
|
+
});
|
|
210
|
+
hostStates.set(hostName, {
|
|
211
|
+
classification: "drift",
|
|
212
|
+
mcpPath: existingState.mcpPath,
|
|
213
|
+
});
|
|
214
|
+
}
|
|
215
215
|
|
|
216
|
-
|
|
216
|
+
return { hostStates, needsSetupHosts, driftHosts };
|
|
217
217
|
}
|
|
218
218
|
|
|
219
219
|
function formatInstallSkillDriftError({
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
220
|
+
hostName,
|
|
221
|
+
scope,
|
|
222
|
+
serverName,
|
|
223
|
+
existingUrl,
|
|
224
|
+
requestedUrl,
|
|
225
225
|
}) {
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
226
|
+
const host = getHost(hostName);
|
|
227
|
+
const scopeFlag = scope === "project" ? "--scope project" : "--scope global";
|
|
228
|
+
return `Flywheel MCP entry '${serverName}' for ${host.displayName} already points to ${existingUrl}, not ${requestedUrl}. Run 'flywheel uninstall ${scopeFlag} --${hostName} --name ${serverName}' first or choose a different --name.`;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
231
|
function getGuidedSkillDecisionOverrideForTests() {
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
232
|
+
const testSeamsEnabled =
|
|
233
|
+
String(process.env[ENABLE_TEST_SEAMS_ENV] || "").trim() === "1";
|
|
234
|
+
if (!testSeamsEnabled) {
|
|
235
|
+
return "";
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
const normalizedGuidedDecisionOverride = String(
|
|
239
|
+
process.env[GUIDED_SKILL_DECISION_TEST_ENV] || "",
|
|
240
|
+
)
|
|
241
|
+
.trim()
|
|
242
|
+
.toLowerCase();
|
|
243
|
+
if (normalizedGuidedDecisionOverride.length === 0) {
|
|
244
|
+
return "";
|
|
245
|
+
}
|
|
246
|
+
if (
|
|
247
|
+
normalizedGuidedDecisionOverride === "accept" ||
|
|
248
|
+
normalizedGuidedDecisionOverride === "decline" ||
|
|
249
|
+
normalizedGuidedDecisionOverride === "abort"
|
|
250
|
+
) {
|
|
251
|
+
return normalizedGuidedDecisionOverride;
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
throw new Error(
|
|
255
|
+
`${GUIDED_SKILL_DECISION_TEST_ENV} must be one of: accept, decline, abort`,
|
|
256
|
+
);
|
|
257
257
|
}
|
|
258
258
|
|
|
259
259
|
async function promptHosts(scope, detected, serverName) {
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
260
|
+
const choices = [];
|
|
261
|
+
for (const hostName of ALL_HOST_NAMES) {
|
|
262
|
+
// eslint-disable-next-line no-await-in-loop
|
|
263
|
+
const configured = await isAlreadyConfigured(
|
|
264
|
+
hostName,
|
|
265
|
+
scope,
|
|
266
|
+
serverName,
|
|
267
|
+
).catch(() => false);
|
|
268
|
+
choices.push({
|
|
269
|
+
name: getHost(hostName).displayName,
|
|
270
|
+
value: hostName,
|
|
271
|
+
short: getHost(hostName).displayName,
|
|
272
|
+
description: hostChoiceDescription({
|
|
273
|
+
detected: detected.includes(hostName),
|
|
274
|
+
configured,
|
|
275
|
+
}),
|
|
276
|
+
checked: detected.includes(hostName),
|
|
277
|
+
disabled: configured ? "(already configured)" : false,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
try {
|
|
282
|
+
return await checkbox({
|
|
283
|
+
message: "Which hosts do you want to set up?",
|
|
284
|
+
choices,
|
|
285
|
+
loop: false,
|
|
286
|
+
theme: CHECKBOX_THEME,
|
|
287
|
+
validate: (selected) =>
|
|
288
|
+
selected.length > 0 || "Select at least one host.",
|
|
289
|
+
});
|
|
290
|
+
} catch {
|
|
291
|
+
return null;
|
|
292
|
+
}
|
|
293
293
|
}
|
|
294
294
|
|
|
295
295
|
async function resolveHosts(options, scope, serverName, allowPrompt = true) {
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
296
|
+
const explicit = selectedHostsFromOptions(options);
|
|
297
|
+
if (explicit.length > 0) return explicit;
|
|
298
|
+
|
|
299
|
+
const detected = await detectHosts(scope);
|
|
300
|
+
const promptDisabled =
|
|
301
|
+
options.yes || process.stdout.isTTY !== true || !allowPrompt;
|
|
302
|
+
if (detected.length > 0 && promptDisabled) {
|
|
303
|
+
return detected;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
if (promptDisabled) {
|
|
307
|
+
log.warn(
|
|
308
|
+
"No hosts were detected for prompt-free setup. Pass explicit host flags such as --codex.",
|
|
309
|
+
);
|
|
310
|
+
return [];
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
log.blank();
|
|
314
|
+
const selected = await promptHosts(scope, detected, serverName);
|
|
315
|
+
if (!selected) {
|
|
316
|
+
log.warn("Setup cancelled");
|
|
317
|
+
return [];
|
|
318
|
+
}
|
|
319
|
+
return selected;
|
|
320
320
|
}
|
|
321
321
|
|
|
322
322
|
async function resolveApiKey(options, baseUrl) {
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
323
|
+
if (Object.hasOwn(options, "apiKey")) {
|
|
324
|
+
const resolved = await resolveSetupApiKey({
|
|
325
|
+
options,
|
|
326
|
+
baseUrl,
|
|
327
|
+
});
|
|
328
|
+
return resolved.apiKey;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
const spinner = ora("Configuring authentication...").start();
|
|
332
|
+
try {
|
|
333
|
+
const resolved = await resolveSetupApiKey({
|
|
334
|
+
options,
|
|
335
|
+
baseUrl,
|
|
336
|
+
});
|
|
337
|
+
spinner.succeed(`Authenticated (${resolved.authMode})`);
|
|
338
|
+
return resolved.apiKey;
|
|
339
|
+
} catch (error) {
|
|
340
|
+
spinner.fail("Authentication failed");
|
|
341
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
342
|
+
if (/cancelled/i.test(message)) {
|
|
343
|
+
return null;
|
|
344
|
+
}
|
|
345
|
+
throw new Error(message);
|
|
346
|
+
}
|
|
347
347
|
}
|
|
348
348
|
|
|
349
349
|
/**
|
|
@@ -366,593 +366,602 @@ async function resolveApiKey(options, baseUrl) {
|
|
|
366
366
|
* a Bearer token into the host config.
|
|
367
367
|
*/
|
|
368
368
|
function classifyAgentOutcome(agentResult, { oauthMode = false } = {}) {
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
369
|
+
if (agentResult.success === false) {
|
|
370
|
+
return "failed";
|
|
371
|
+
}
|
|
372
|
+
if (
|
|
373
|
+
agentResult.success === null ||
|
|
374
|
+
agentResult.status === "skipped" ||
|
|
375
|
+
(Array.isArray(agentResult.skippedSteps) &&
|
|
376
|
+
(agentResult.skippedSteps.includes("skill-only-host") ||
|
|
377
|
+
agentResult.skippedSteps.includes("unsupported-host")))
|
|
378
|
+
) {
|
|
379
|
+
return "skipped";
|
|
380
|
+
}
|
|
381
|
+
const alreadyConfigured =
|
|
382
|
+
Array.isArray(agentResult.skippedSteps) &&
|
|
383
|
+
agentResult.skippedSteps.includes("already-configured");
|
|
384
|
+
if (alreadyConfigured) {
|
|
385
|
+
return "already configured";
|
|
386
|
+
}
|
|
387
|
+
return oauthMode ? "configured (OAuth)" : "configured with API Key";
|
|
388
388
|
}
|
|
389
389
|
|
|
390
390
|
function buildSetupResultRows({
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
391
|
+
selectedHosts,
|
|
392
|
+
hostStates,
|
|
393
|
+
setupResult,
|
|
394
|
+
oauthMode = false,
|
|
395
395
|
}) {
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
396
|
+
const byAgent = new Map(
|
|
397
|
+
setupResult.agentResults.map((result) => [result.agent, result]),
|
|
398
|
+
);
|
|
399
399
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
400
|
+
return selectedHosts.map((hostName) => {
|
|
401
|
+
const host = getHost(hostName);
|
|
402
|
+
const agentResult = byAgent.get(hostName);
|
|
403
|
+
if (!agentResult) {
|
|
404
|
+
return {
|
|
405
|
+
host: host.displayName,
|
|
406
|
+
status: "unknown",
|
|
407
|
+
filePath: hostStates.get(hostName)?.mcpPath || "(unknown)",
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
410
|
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
411
|
+
const status = classifyAgentOutcome(agentResult, { oauthMode });
|
|
412
|
+
return {
|
|
413
|
+
host: host.displayName,
|
|
414
|
+
status,
|
|
415
|
+
filePath:
|
|
416
|
+
agentResult.touchedFiles?.[0] ||
|
|
417
|
+
hostStates.get(hostName)?.mcpPath ||
|
|
418
|
+
"(unknown)",
|
|
419
|
+
};
|
|
420
|
+
});
|
|
421
421
|
}
|
|
422
422
|
|
|
423
423
|
function printSetupResults(
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
424
|
+
results,
|
|
425
|
+
scope,
|
|
426
|
+
serverUrl,
|
|
427
|
+
{ showSkillRefreshGuidance = false, experimentalSyncAgents = [] } = {},
|
|
428
428
|
) {
|
|
429
|
+
log.blank();
|
|
430
|
+
log.plain(pc.green("✔ Flywheel setup complete"));
|
|
431
|
+
log.blank();
|
|
432
|
+
log.plain(` Scope: ${pc.bold(scope)}`);
|
|
433
|
+
log.plain(` Server URL: ${pc.bold(serverUrl)}`);
|
|
434
|
+
for (const result of results) {
|
|
435
|
+
const icon = result.status.startsWith("configured")
|
|
436
|
+
? pc.green("+")
|
|
437
|
+
: pc.dim("~");
|
|
438
|
+
log.plain(` ${pc.bold(result.host)}`);
|
|
439
|
+
log.plain(` ${icon} ${result.status}`);
|
|
440
|
+
log.plain(` ${pc.dim(result.filePath)}`);
|
|
441
|
+
}
|
|
442
|
+
if (showSkillRefreshGuidance) {
|
|
429
443
|
log.blank();
|
|
430
|
-
log.plain(
|
|
431
|
-
log.
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
if (
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
);
|
|
444
|
+
log.plain(" Bundled skill refresh guidance");
|
|
445
|
+
log.plain(
|
|
446
|
+
` Preferred: ${pc.bold("npx --yes @paradigma-inc/flywheel@latest setup --mode mcp --install-skill --project")}`,
|
|
447
|
+
);
|
|
448
|
+
log.plain(
|
|
449
|
+
` ${pc.bold("npm install --save-dev @paradigma-inc/flywheel@latest")}`,
|
|
450
|
+
);
|
|
451
|
+
if (experimentalSyncAgents.length === 1) {
|
|
452
|
+
log.plain(" Optional path via skills experimental_sync:");
|
|
453
|
+
log.plain(
|
|
454
|
+
` ${pc.bold(`npx skills experimental_sync --agent ${experimentalSyncAgents[0]} -y`)}`,
|
|
455
|
+
);
|
|
456
|
+
} else if (experimentalSyncAgents.length > 1) {
|
|
457
|
+
log.plain(
|
|
458
|
+
" Optional path via skills experimental_sync for selected hosts:",
|
|
459
|
+
);
|
|
460
|
+
for (const agentName of experimentalSyncAgents) {
|
|
448
461
|
log.plain(
|
|
449
|
-
|
|
462
|
+
` ${pc.bold(`npx skills experimental_sync --agent ${agentName} -y`)}`,
|
|
450
463
|
);
|
|
451
|
-
|
|
452
|
-
log.plain(" Optional path via skills experimental_sync:");
|
|
453
|
-
log.plain(
|
|
454
|
-
` ${pc.bold(`npx skills experimental_sync --agent ${experimentalSyncAgents[0]} -y`)}`,
|
|
455
|
-
);
|
|
456
|
-
} else if (experimentalSyncAgents.length > 1) {
|
|
457
|
-
log.plain(
|
|
458
|
-
" Optional path via skills experimental_sync for selected hosts:",
|
|
459
|
-
);
|
|
460
|
-
for (const agentName of experimentalSyncAgents) {
|
|
461
|
-
log.plain(
|
|
462
|
-
` ${pc.bold(`npx skills experimental_sync --agent ${agentName} -y`)}`,
|
|
463
|
-
);
|
|
464
|
-
}
|
|
465
|
-
}
|
|
464
|
+
}
|
|
466
465
|
}
|
|
467
|
-
|
|
466
|
+
}
|
|
467
|
+
log.blank();
|
|
468
468
|
}
|
|
469
469
|
|
|
470
470
|
function resolveExperimentalSyncAgentsForHosts(supportedHosts) {
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
}
|
|
481
|
-
const agentName = resolveSkillsAgentName(hostName);
|
|
482
|
-
if (seenAgentNames.has(agentName)) {
|
|
483
|
-
continue;
|
|
484
|
-
}
|
|
485
|
-
seenAgentNames.add(agentName);
|
|
486
|
-
agentNames.push(agentName);
|
|
471
|
+
const agentNames = [];
|
|
472
|
+
const seenAgentNames = new Set();
|
|
473
|
+
|
|
474
|
+
for (const hostName of supportedHosts) {
|
|
475
|
+
// Direct-copy hosts (gemini, universal, antigravity) bypass the `skills`
|
|
476
|
+
// CLI entirely, so they have no agent name to sync with. Skip them from
|
|
477
|
+
// the experimental_sync guidance block.
|
|
478
|
+
if (isDirectCopySkillHost(hostName)) {
|
|
479
|
+
continue;
|
|
487
480
|
}
|
|
481
|
+
const agentName = resolveSkillsAgentName(hostName);
|
|
482
|
+
if (seenAgentNames.has(agentName)) {
|
|
483
|
+
continue;
|
|
484
|
+
}
|
|
485
|
+
seenAgentNames.add(agentName);
|
|
486
|
+
agentNames.push(agentName);
|
|
487
|
+
}
|
|
488
488
|
|
|
489
|
-
|
|
489
|
+
return agentNames;
|
|
490
490
|
}
|
|
491
491
|
|
|
492
492
|
export function buildGuidedSkillInstallPrompt({
|
|
493
|
-
|
|
494
|
-
|
|
493
|
+
unsupportedHosts,
|
|
494
|
+
bundledSkillNames,
|
|
495
495
|
}) {
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
return usesPlural
|
|
499
|
-
? `Also install or refresh the bundled Flywheel skills for supported hosts? Unsupported hosts (${unsupportedHosts.join(", ")}) will remain MCP-only.`
|
|
500
|
-
: `Also install or refresh the bundled Flywheel skill for supported hosts? Unsupported hosts (${unsupportedHosts.join(", ")}) will remain MCP-only.`;
|
|
501
|
-
}
|
|
496
|
+
const usesPlural = bundledSkillNames.length > 1;
|
|
497
|
+
if (unsupportedHosts.length > 0) {
|
|
502
498
|
return usesPlural
|
|
503
|
-
|
|
504
|
-
|
|
499
|
+
? `Also install or refresh the bundled Flywheel skills for supported hosts? Unsupported hosts (${unsupportedHosts.join(", ")}) will remain MCP-only.`
|
|
500
|
+
: `Also install or refresh the bundled Flywheel skill for supported hosts? Unsupported hosts (${unsupportedHosts.join(", ")}) will remain MCP-only.`;
|
|
501
|
+
}
|
|
502
|
+
return usesPlural
|
|
503
|
+
? "Also install or refresh the bundled Flywheel skills?"
|
|
504
|
+
: "Also install or refresh the bundled Flywheel skill?";
|
|
505
505
|
}
|
|
506
506
|
|
|
507
507
|
async function promptGuidedSkillInstall(
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
508
|
+
bundledSkillNames,
|
|
509
|
+
unsupportedHosts,
|
|
510
|
+
guidedSkillDecisionOverride,
|
|
511
511
|
) {
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
512
|
+
if (guidedSkillDecisionOverride === "accept") {
|
|
513
|
+
return true;
|
|
514
|
+
}
|
|
515
|
+
if (
|
|
516
|
+
guidedSkillDecisionOverride === "decline" ||
|
|
517
|
+
guidedSkillDecisionOverride === "abort"
|
|
518
|
+
) {
|
|
519
|
+
return false;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
log.blank();
|
|
523
|
+
const message = buildGuidedSkillInstallPrompt({
|
|
524
|
+
unsupportedHosts,
|
|
525
|
+
bundledSkillNames,
|
|
526
|
+
});
|
|
521
527
|
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
528
|
+
try {
|
|
529
|
+
return await confirm({
|
|
530
|
+
message,
|
|
531
|
+
default: true,
|
|
532
|
+
theme: CHECKBOX_THEME,
|
|
526
533
|
});
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
message,
|
|
531
|
-
default: true,
|
|
532
|
-
theme: CHECKBOX_THEME,
|
|
533
|
-
});
|
|
534
|
-
} catch {
|
|
535
|
-
return false;
|
|
536
|
-
}
|
|
534
|
+
} catch {
|
|
535
|
+
return false;
|
|
536
|
+
}
|
|
537
537
|
}
|
|
538
538
|
|
|
539
539
|
function logBundledSkillInstallPlan({
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
540
|
+
bundledSkillNames,
|
|
541
|
+
projectRoot,
|
|
542
|
+
scope,
|
|
543
|
+
supportedHosts,
|
|
544
544
|
}) {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
545
|
+
for (const hostName of supportedHosts) {
|
|
546
|
+
const hostDisplayName = getHost(hostName).displayName;
|
|
547
|
+
const resolvedSkillRoot = path.dirname(
|
|
548
|
+
resolveInstalledSkillDir(
|
|
549
|
+
projectRoot,
|
|
550
|
+
hostName,
|
|
551
|
+
scope,
|
|
552
|
+
bundledSkillNames[0],
|
|
553
|
+
),
|
|
554
|
+
);
|
|
555
|
+
log.plain(
|
|
556
|
+
`Installing bundled skills for ${hostDisplayName} (${scope}: ${resolvedSkillRoot}): ${bundledSkillNames.join(", ")}`,
|
|
557
|
+
);
|
|
558
|
+
}
|
|
559
559
|
}
|
|
560
560
|
|
|
561
561
|
function normalizeSkillDecisionMode(options) {
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
562
|
+
if (options.installSkill && options.skipSkill) {
|
|
563
|
+
throw new Error(MUTUALLY_EXCLUSIVE_SKILL_FLAGS_ERROR);
|
|
564
|
+
}
|
|
565
|
+
if (options.installSkill) return "install";
|
|
566
|
+
if (options.skipSkill) return "skip";
|
|
567
|
+
return "guided";
|
|
568
568
|
}
|
|
569
569
|
|
|
570
570
|
async function discardInstallSkillCleanupState(cleanupState) {
|
|
571
|
-
|
|
572
|
-
return null;
|
|
573
|
-
}
|
|
574
|
-
await rm(cleanupState.backupRoot, { force: true, recursive: true });
|
|
571
|
+
if (!cleanupState?.backupRoot) {
|
|
575
572
|
return null;
|
|
573
|
+
}
|
|
574
|
+
await rm(cleanupState.backupRoot, { force: true, recursive: true });
|
|
575
|
+
return null;
|
|
576
576
|
}
|
|
577
577
|
|
|
578
578
|
function printSetupResultSummary(setupResult) {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
579
|
+
const lines = renderSetupSummary(setupResult);
|
|
580
|
+
log.blank();
|
|
581
|
+
for (const line of lines) {
|
|
582
|
+
log.plain(` ${line}`);
|
|
583
|
+
}
|
|
584
|
+
log.blank();
|
|
585
585
|
}
|
|
586
586
|
|
|
587
587
|
export async function runMcpModeCommand(options, deps = {}) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
588
|
+
const projectRoot = process.cwd();
|
|
589
|
+
const skillDecisionMode = normalizeSkillDecisionMode(options);
|
|
590
|
+
const guidedSkillDecisionOverride = getGuidedSkillDecisionOverrideForTests();
|
|
591
|
+
const nonInteractive = process.stdout.isTTY !== true;
|
|
592
|
+
const hasGuidedDecisionOverride = guidedSkillDecisionOverride.length > 0;
|
|
593
|
+
if (
|
|
594
|
+
nonInteractive &&
|
|
595
|
+
skillDecisionMode === "guided" &&
|
|
596
|
+
!hasGuidedDecisionOverride
|
|
597
|
+
) {
|
|
598
|
+
throw new Error(NON_INTERACTIVE_SKILL_DECISION_ERROR);
|
|
599
|
+
}
|
|
600
|
+
|
|
601
|
+
const oauthMode = options.oauth === true;
|
|
602
|
+
if (oauthMode && (Object.hasOwn(options, "apiKey") || options.apiKeyStdin === true)) {
|
|
603
|
+
throw new SetupModeUsageError(
|
|
604
|
+
"--api-key and --oauth are mutually exclusive: choose one.",
|
|
605
|
+
);
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
const scope = options.project ? "project" : "global";
|
|
609
|
+
const baseUrl = normalizeBaseUrl(
|
|
610
|
+
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
611
|
+
);
|
|
612
|
+
const serverUrl = `${baseUrl}/mcp-server`;
|
|
613
|
+
const serverName = normalizeServerName(options.name || SERVER_NAME);
|
|
614
|
+
const resolveHostsForSetup =
|
|
615
|
+
deps.resolveHostsForSetup ||
|
|
616
|
+
(async ({
|
|
617
|
+
options: hostOptions,
|
|
618
|
+
scope: hostScope,
|
|
619
|
+
serverName: hostServerName,
|
|
620
|
+
allowPrompt,
|
|
621
|
+
}) =>
|
|
622
|
+
await resolveHosts(hostOptions, hostScope, hostServerName, allowPrompt));
|
|
623
|
+
const hosts = await resolveHostsForSetup({
|
|
624
|
+
options,
|
|
625
|
+
scope,
|
|
626
|
+
serverName,
|
|
627
|
+
// `--install-skill` is an explicit refresh request. Keep the advertised
|
|
628
|
+
// no-host update command prompt-free on detected hosts; `--skip-skill`
|
|
629
|
+
// remains guided unless host flags or --yes are provided.
|
|
630
|
+
allowPrompt: skillDecisionMode !== "install",
|
|
631
|
+
});
|
|
632
|
+
recordResolvedHosts(hosts);
|
|
633
|
+
if (options.apiKeyStdin === true &&
|
|
634
|
+
(scope !== "global" || hosts.length !== 1 || hosts[0] !== "codex")) {
|
|
635
|
+
throw new SetupModeUsageError(
|
|
636
|
+
"--api-key-stdin in MCP mode requires only Codex in the home directory. Use --codex without --project.",
|
|
637
|
+
);
|
|
638
|
+
}
|
|
639
|
+
const authResult = options.apiKeyStdin === true ? await deps.readStdinAuth() : undefined;
|
|
640
|
+
if (hosts.length === 0) {
|
|
641
|
+
return { exitCode: 0 };
|
|
642
|
+
}
|
|
643
|
+
|
|
644
|
+
const { supportedHosts, unsupportedHosts } =
|
|
645
|
+
partitionInstallSkillHosts(hosts);
|
|
646
|
+
const packageRoot = resolvePackageRoot();
|
|
647
|
+
const bundledSkillNames =
|
|
648
|
+
skillDecisionMode === "skip" || supportedHosts.length === 0
|
|
649
|
+
? []
|
|
650
|
+
: await listBundledSkills(packageRoot);
|
|
651
|
+
|
|
652
|
+
if (skillDecisionMode === "install" && supportedHosts.length === 0) {
|
|
653
|
+
if (options.allowUnsupportedSkillInstall !== true) {
|
|
654
|
+
throw new Error(
|
|
655
|
+
`--install-skill is not supported for: ${unsupportedHosts.join(", ")}. Supported hosts: ${formatSupportedInstallSkillHosts()}.`,
|
|
656
|
+
);
|
|
657
|
+
}
|
|
658
|
+
log.plain(
|
|
659
|
+
`Bundled skill install skipped (unsupported-only host selection: ${unsupportedHosts.join(", ")}).`,
|
|
660
|
+
);
|
|
661
|
+
}
|
|
662
|
+
if (
|
|
663
|
+
skillDecisionMode !== "skip" &&
|
|
664
|
+
supportedHosts.length > 0 &&
|
|
665
|
+
bundledSkillNames.length === 0
|
|
666
|
+
) {
|
|
667
|
+
throw new Error(
|
|
668
|
+
`No bundled skills found under ${path.join(packageRoot, "skills")}.`,
|
|
669
|
+
);
|
|
670
|
+
}
|
|
671
|
+
|
|
672
|
+
const {
|
|
673
|
+
hostStates = new Map(),
|
|
674
|
+
needsSetupHosts = [],
|
|
675
|
+
driftHosts = [],
|
|
676
|
+
} = await inspectInstallSkillHosts({
|
|
677
|
+
hostNames: hosts,
|
|
678
|
+
scope,
|
|
679
|
+
serverName,
|
|
680
|
+
serverUrl,
|
|
681
|
+
});
|
|
682
|
+
|
|
683
|
+
// Capture prior-mode state before any install/auth side effects so the
|
|
684
|
+
// detector does not classify artifacts created by this same command as
|
|
685
|
+
// pre-existing CLI-mode installs, and so a refuse or reconcile decision
|
|
686
|
+
// happens before we touch disk or start a browser auth flow. Running this
|
|
687
|
+
// inside runMcpSetupMode (the prior placement) meant --force would uninstall
|
|
688
|
+
// the freshly installed bundled skills, and the non-force path would still
|
|
689
|
+
// have run auth before surfacing the conflict.
|
|
690
|
+
const priorModeSnapshot = await detectPriorModeForSetup({
|
|
691
|
+
targetMode: "mcp",
|
|
692
|
+
selectedHosts: hosts,
|
|
693
|
+
scope,
|
|
694
|
+
cwd: projectRoot,
|
|
695
|
+
serverName,
|
|
696
|
+
serverUrl,
|
|
697
|
+
});
|
|
698
|
+
const reconciled = [];
|
|
699
|
+
if (
|
|
700
|
+
priorModeSnapshot.priorMode &&
|
|
701
|
+
priorModeSnapshot.affectedHosts.length > 0
|
|
702
|
+
) {
|
|
703
|
+
if (deps.force !== true) {
|
|
704
|
+
throw new SetupModeUsageError(
|
|
705
|
+
formatPriorModeConflictError(priorModeSnapshot),
|
|
706
|
+
);
|
|
707
|
+
}
|
|
708
|
+
if (typeof deps.reconcilePriorMode !== "function") {
|
|
709
|
+
throw new Error(
|
|
710
|
+
"reconcilePriorMode dependency is required when --force is used.",
|
|
711
|
+
);
|
|
712
|
+
}
|
|
713
|
+
const reconcileEntries = Array.isArray(priorModeSnapshot.entries)
|
|
714
|
+
? priorModeSnapshot.entries
|
|
715
|
+
: priorModeSnapshot.affectedHosts.map((hostName) => ({
|
|
716
|
+
hostName,
|
|
717
|
+
serverNames: [],
|
|
718
|
+
}));
|
|
719
|
+
for (const entry of reconcileEntries) {
|
|
720
|
+
try {
|
|
721
|
+
// eslint-disable-next-line no-await-in-loop
|
|
722
|
+
await deps.reconcilePriorMode({
|
|
723
|
+
priorMode: priorModeSnapshot.priorMode,
|
|
724
|
+
targetMode: "mcp",
|
|
725
|
+
hostNames: [entry.hostName],
|
|
726
|
+
serverNames: entry.serverNames,
|
|
727
|
+
scope,
|
|
728
|
+
cwd: projectRoot,
|
|
729
|
+
serverName,
|
|
730
|
+
serverUrl,
|
|
731
|
+
});
|
|
732
|
+
} catch (error) {
|
|
733
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
734
|
+
const reconcileError = new Error(
|
|
735
|
+
`Failed to reconcile prior --mode ${priorModeSnapshot.priorMode} artifacts for host ${entry.hostName}: ${message}`,
|
|
605
736
|
);
|
|
737
|
+
reconcileError.exitCode = 4;
|
|
738
|
+
throw reconcileError;
|
|
739
|
+
}
|
|
606
740
|
}
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
const baseUrl = normalizeBaseUrl(
|
|
610
|
-
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
741
|
+
reconciled.push(
|
|
742
|
+
`removed prior --mode ${priorModeSnapshot.priorMode} artifacts for host(s): ${priorModeSnapshot.affectedHosts.join(", ")}`,
|
|
611
743
|
);
|
|
612
|
-
|
|
613
|
-
const serverName = normalizeServerName(options.name || SERVER_NAME);
|
|
614
|
-
const resolveHostsForSetup =
|
|
615
|
-
deps.resolveHostsForSetup ||
|
|
616
|
-
(async ({
|
|
617
|
-
options: hostOptions,
|
|
618
|
-
scope: hostScope,
|
|
619
|
-
serverName: hostServerName,
|
|
620
|
-
allowPrompt,
|
|
621
|
-
}) =>
|
|
622
|
-
await resolveHosts(hostOptions, hostScope, hostServerName, allowPrompt));
|
|
623
|
-
const hosts = await resolveHostsForSetup({
|
|
624
|
-
options,
|
|
625
|
-
scope,
|
|
626
|
-
serverName,
|
|
627
|
-
// `--install-skill` is an explicit refresh request. Keep the advertised
|
|
628
|
-
// no-host update command prompt-free on detected hosts; `--skip-skill`
|
|
629
|
-
// remains guided unless host flags or --yes are provided.
|
|
630
|
-
allowPrompt: skillDecisionMode !== "install",
|
|
631
|
-
});
|
|
632
|
-
recordResolvedHosts(hosts);
|
|
633
|
-
if (hosts.length === 0) {
|
|
634
|
-
return { exitCode: 0 };
|
|
635
|
-
}
|
|
744
|
+
}
|
|
636
745
|
|
|
637
|
-
|
|
638
|
-
partitionInstallSkillHosts(hosts);
|
|
639
|
-
const packageRoot = resolvePackageRoot();
|
|
640
|
-
const bundledSkillNames =
|
|
641
|
-
skillDecisionMode === "skip" || supportedHosts.length === 0
|
|
642
|
-
? []
|
|
643
|
-
: await listBundledSkills(packageRoot);
|
|
644
|
-
|
|
645
|
-
if (skillDecisionMode === "install" && supportedHosts.length === 0) {
|
|
646
|
-
if (options.allowUnsupportedSkillInstall !== true) {
|
|
647
|
-
throw new Error(
|
|
648
|
-
`--install-skill is not supported for: ${unsupportedHosts.join(", ")}. Supported hosts: ${formatSupportedInstallSkillHosts()}.`,
|
|
649
|
-
);
|
|
650
|
-
}
|
|
651
|
-
log.plain(
|
|
652
|
-
`Bundled skill install skipped (unsupported-only host selection: ${unsupportedHosts.join(", ")}).`,
|
|
653
|
-
);
|
|
654
|
-
}
|
|
655
|
-
if (
|
|
656
|
-
skillDecisionMode !== "skip" &&
|
|
657
|
-
supportedHosts.length > 0 &&
|
|
658
|
-
bundledSkillNames.length === 0
|
|
659
|
-
) {
|
|
660
|
-
throw new Error(
|
|
661
|
-
`No bundled skills found under ${path.join(packageRoot, "skills")}.`,
|
|
662
|
-
);
|
|
663
|
-
}
|
|
746
|
+
const installDriftHosts = driftHosts;
|
|
664
747
|
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
} = await inspectInstallSkillHosts({
|
|
670
|
-
hostNames: hosts,
|
|
748
|
+
if (skillDecisionMode === "install" && installDriftHosts.length > 0) {
|
|
749
|
+
throw new Error(
|
|
750
|
+
formatInstallSkillDriftError({
|
|
751
|
+
hostName: installDriftHosts[0].hostName,
|
|
671
752
|
scope,
|
|
672
753
|
serverName,
|
|
673
|
-
|
|
674
|
-
|
|
754
|
+
existingUrl: installDriftHosts[0].existingUrl,
|
|
755
|
+
requestedUrl: serverUrl,
|
|
756
|
+
}),
|
|
757
|
+
);
|
|
758
|
+
}
|
|
675
759
|
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
760
|
+
let cleanupState = null;
|
|
761
|
+
try {
|
|
762
|
+
if (skillDecisionMode === "install") {
|
|
763
|
+
logBundledSkillInstallPlan({
|
|
764
|
+
bundledSkillNames,
|
|
765
|
+
projectRoot,
|
|
766
|
+
scope,
|
|
767
|
+
supportedHosts,
|
|
768
|
+
});
|
|
769
|
+
cleanupState = await inspectInstalledSkillArtifactsForHosts({
|
|
770
|
+
projectRoot,
|
|
771
|
+
hostNames: supportedHosts,
|
|
772
|
+
scope,
|
|
773
|
+
skillNames: bundledSkillNames,
|
|
774
|
+
});
|
|
775
|
+
await installBundledSkillForHosts({
|
|
776
|
+
projectRoot,
|
|
777
|
+
hostNames: supportedHosts,
|
|
686
778
|
scope,
|
|
687
|
-
cwd: projectRoot,
|
|
688
779
|
serverName,
|
|
689
780
|
serverUrl,
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
) {
|
|
696
|
-
if (deps.force !== true) {
|
|
697
|
-
throw new SetupModeUsageError(
|
|
698
|
-
formatPriorModeConflictError(priorModeSnapshot),
|
|
699
|
-
);
|
|
700
|
-
}
|
|
701
|
-
if (typeof deps.reconcilePriorMode !== "function") {
|
|
702
|
-
throw new Error(
|
|
703
|
-
"reconcilePriorMode dependency is required when --force is used.",
|
|
704
|
-
);
|
|
705
|
-
}
|
|
706
|
-
const reconcileEntries = Array.isArray(priorModeSnapshot.entries)
|
|
707
|
-
? priorModeSnapshot.entries
|
|
708
|
-
: priorModeSnapshot.affectedHosts.map((hostName) => ({
|
|
709
|
-
hostName,
|
|
710
|
-
serverNames: [],
|
|
711
|
-
}));
|
|
712
|
-
for (const entry of reconcileEntries) {
|
|
713
|
-
try {
|
|
714
|
-
// eslint-disable-next-line no-await-in-loop
|
|
715
|
-
await deps.reconcilePriorMode({
|
|
716
|
-
priorMode: priorModeSnapshot.priorMode,
|
|
717
|
-
targetMode: "mcp",
|
|
718
|
-
hostNames: [entry.hostName],
|
|
719
|
-
serverNames: entry.serverNames,
|
|
720
|
-
scope,
|
|
721
|
-
cwd: projectRoot,
|
|
722
|
-
serverName,
|
|
723
|
-
serverUrl,
|
|
724
|
-
});
|
|
725
|
-
} catch (error) {
|
|
726
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
727
|
-
const reconcileError = new Error(
|
|
728
|
-
`Failed to reconcile prior --mode ${priorModeSnapshot.priorMode} artifacts for host ${entry.hostName}: ${message}`,
|
|
729
|
-
);
|
|
730
|
-
reconcileError.exitCode = 4;
|
|
731
|
-
throw reconcileError;
|
|
732
|
-
}
|
|
733
|
-
}
|
|
734
|
-
reconciled.push(
|
|
735
|
-
`removed prior --mode ${priorModeSnapshot.priorMode} artifacts for host(s): ${priorModeSnapshot.affectedHosts.join(", ")}`,
|
|
736
|
-
);
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
const installDriftHosts = driftHosts;
|
|
740
|
-
|
|
741
|
-
if (skillDecisionMode === "install" && installDriftHosts.length > 0) {
|
|
742
|
-
throw new Error(
|
|
743
|
-
formatInstallSkillDriftError({
|
|
744
|
-
hostName: installDriftHosts[0].hostName,
|
|
745
|
-
scope,
|
|
746
|
-
serverName,
|
|
747
|
-
existingUrl: installDriftHosts[0].existingUrl,
|
|
748
|
-
requestedUrl: serverUrl,
|
|
749
|
-
}),
|
|
781
|
+
skillNames: bundledSkillNames,
|
|
782
|
+
});
|
|
783
|
+
if (unsupportedHosts.length > 0) {
|
|
784
|
+
log.plain(
|
|
785
|
+
`--install-skill skipped unsupported hosts (MCP-only): ${unsupportedHosts.join(", ")}.`,
|
|
750
786
|
);
|
|
787
|
+
}
|
|
751
788
|
}
|
|
752
789
|
|
|
753
|
-
let
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
cleanupState = await inspectInstalledSkillArtifactsForHosts({
|
|
763
|
-
projectRoot,
|
|
764
|
-
hostNames: supportedHosts,
|
|
765
|
-
scope,
|
|
766
|
-
skillNames: bundledSkillNames,
|
|
767
|
-
});
|
|
768
|
-
await installBundledSkillForHosts({
|
|
769
|
-
projectRoot,
|
|
770
|
-
hostNames: supportedHosts,
|
|
771
|
-
scope,
|
|
772
|
-
serverName,
|
|
773
|
-
serverUrl,
|
|
774
|
-
skillNames: bundledSkillNames,
|
|
775
|
-
});
|
|
776
|
-
if (unsupportedHosts.length > 0) {
|
|
777
|
-
log.plain(
|
|
778
|
-
`--install-skill skipped unsupported hosts (MCP-only): ${unsupportedHosts.join(", ")}.`,
|
|
779
|
-
);
|
|
780
|
-
}
|
|
781
|
-
}
|
|
782
|
-
|
|
783
|
-
let apiKey = null;
|
|
784
|
-
const explicitApiKeyProvided = Object.hasOwn(options, "apiKey");
|
|
785
|
-
const shouldResolveApiKey =
|
|
786
|
-
!oauthMode && (needsSetupHosts.length > 0 || explicitApiKeyProvided);
|
|
787
|
-
if (shouldResolveApiKey) {
|
|
788
|
-
apiKey = await resolveApiKey(options, baseUrl);
|
|
789
|
-
if (!apiKey) {
|
|
790
|
-
if (cleanupState) {
|
|
791
|
-
await cleanupInstalledSkillArtifactsForHosts({
|
|
792
|
-
projectRoot,
|
|
793
|
-
hostNames: supportedHosts,
|
|
794
|
-
priorState: cleanupState,
|
|
795
|
-
scope,
|
|
796
|
-
skillNames: bundledSkillNames,
|
|
797
|
-
});
|
|
798
|
-
cleanupState = null;
|
|
799
|
-
}
|
|
800
|
-
log.warn("Setup cancelled");
|
|
801
|
-
return { exitCode: 0 };
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
|
|
805
|
-
const setupResult = await runMcpSetupMode({
|
|
806
|
-
selectedHosts: hosts,
|
|
807
|
-
scope,
|
|
808
|
-
cwd: projectRoot,
|
|
809
|
-
// Prior-mode enforcement already ran before install/auth (above); skip
|
|
810
|
-
// the inner detector so a --force reconcile cannot re-uninstall the
|
|
811
|
-
// skills this command just installed, and so the non-force conflict
|
|
812
|
-
// path short-circuits before we reach this point.
|
|
813
|
-
force: false,
|
|
814
|
-
serverName,
|
|
815
|
-
serverUrl,
|
|
816
|
-
apiKey,
|
|
817
|
-
// Tell the writers to reconcile auth-mode mismatches (Authorization
|
|
818
|
-
// header added/removed) only when the user explicitly set `--oauth` or
|
|
819
|
-
// `--api-key`. Without that, a passive rerun must stay idempotent and
|
|
820
|
-
// preserve the existing bearer header on disk rather than stripping it.
|
|
821
|
-
enforceAuthMode: oauthMode || explicitApiKeyProvided,
|
|
822
|
-
detectPriorMode: async () => ({
|
|
823
|
-
priorMode: null,
|
|
824
|
-
affectedHosts: [],
|
|
825
|
-
entries: [],
|
|
826
|
-
}),
|
|
827
|
-
reconcilePriorMode: deps.reconcilePriorMode,
|
|
828
|
-
});
|
|
829
|
-
if (reconciled.length > 0) {
|
|
830
|
-
setupResult.reconciled = [
|
|
831
|
-
...(Array.isArray(setupResult.reconciled)
|
|
832
|
-
? setupResult.reconciled
|
|
833
|
-
: []),
|
|
834
|
-
...reconciled,
|
|
835
|
-
];
|
|
836
|
-
}
|
|
837
|
-
|
|
838
|
-
if (setupResult.exitCode !== 0) {
|
|
839
|
-
printSetupResultSummary(setupResult);
|
|
840
|
-
const failureDetails = setupResult.agentResults
|
|
841
|
-
.filter((result) => result.success !== true)
|
|
842
|
-
.flatMap((result) =>
|
|
843
|
-
Array.isArray(result.warnings) ? result.warnings : [],
|
|
844
|
-
)
|
|
845
|
-
.join(" | ");
|
|
846
|
-
const error = new Error(
|
|
847
|
-
failureDetails.length > 0
|
|
848
|
-
? `MCP setup encountered host-level failures: ${failureDetails}`
|
|
849
|
-
: "MCP setup encountered host-level failures.",
|
|
850
|
-
);
|
|
851
|
-
error.exitCode = setupResult.exitCode;
|
|
852
|
-
throw error;
|
|
853
|
-
}
|
|
854
|
-
|
|
855
|
-
const setupRows = buildSetupResultRows({
|
|
856
|
-
selectedHosts: hosts,
|
|
857
|
-
hostStates,
|
|
858
|
-
setupResult,
|
|
859
|
-
oauthMode,
|
|
860
|
-
});
|
|
861
|
-
|
|
862
|
-
if (skillDecisionMode !== "guided") {
|
|
863
|
-
const completedCleanupState = cleanupState;
|
|
864
|
-
cleanupState = null;
|
|
865
|
-
await discardInstallSkillCleanupState(completedCleanupState);
|
|
866
|
-
const showSkillRefreshGuidance =
|
|
867
|
-
scope === "project" &&
|
|
868
|
-
skillDecisionMode === "install" &&
|
|
869
|
-
supportedHosts.length > 0;
|
|
870
|
-
printSetupResults(setupRows, scope, serverUrl, {
|
|
871
|
-
showSkillRefreshGuidance,
|
|
872
|
-
experimentalSyncAgents: showSkillRefreshGuidance
|
|
873
|
-
? resolveExperimentalSyncAgentsForHosts(supportedHosts)
|
|
874
|
-
: [],
|
|
875
|
-
});
|
|
876
|
-
return setupResult;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
if (supportedHosts.length === 0) {
|
|
880
|
-
log.plain(
|
|
881
|
-
`Bundled skill installation is unavailable for the selected hosts (${hosts.join(", ")}). Continuing with MCP-only setup.`,
|
|
882
|
-
);
|
|
883
|
-
printSetupResults(setupRows, scope, serverUrl);
|
|
884
|
-
return setupResult;
|
|
885
|
-
}
|
|
886
|
-
|
|
887
|
-
const shouldInstallSkill = await promptGuidedSkillInstall(
|
|
888
|
-
bundledSkillNames,
|
|
889
|
-
unsupportedHosts,
|
|
890
|
-
guidedSkillDecisionOverride,
|
|
891
|
-
);
|
|
892
|
-
if (!shouldInstallSkill) {
|
|
893
|
-
printSetupResults(setupRows, scope, serverUrl);
|
|
894
|
-
return setupResult;
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
if (installDriftHosts.length > 0) {
|
|
898
|
-
throw new Error(
|
|
899
|
-
formatInstallSkillDriftError({
|
|
900
|
-
hostName: installDriftHosts[0].hostName,
|
|
901
|
-
scope,
|
|
902
|
-
serverName,
|
|
903
|
-
existingUrl: installDriftHosts[0].existingUrl,
|
|
904
|
-
requestedUrl: serverUrl,
|
|
905
|
-
}),
|
|
906
|
-
);
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
logBundledSkillInstallPlan({
|
|
910
|
-
bundledSkillNames,
|
|
911
|
-
projectRoot,
|
|
912
|
-
scope,
|
|
913
|
-
supportedHosts,
|
|
914
|
-
});
|
|
915
|
-
cleanupState = await inspectInstalledSkillArtifactsForHosts({
|
|
916
|
-
projectRoot,
|
|
917
|
-
hostNames: supportedHosts,
|
|
918
|
-
scope,
|
|
919
|
-
skillNames: bundledSkillNames,
|
|
920
|
-
});
|
|
921
|
-
await installBundledSkillForHosts({
|
|
790
|
+
let apiKey = null;
|
|
791
|
+
const explicitApiKeyProvided = Object.hasOwn(options, "apiKey") || options.apiKeyStdin === true;
|
|
792
|
+
const shouldResolveApiKey =
|
|
793
|
+
!oauthMode && (needsSetupHosts.length > 0 || explicitApiKeyProvided);
|
|
794
|
+
if (shouldResolveApiKey) {
|
|
795
|
+
apiKey = authResult?.apiKey ?? await resolveApiKey(options, baseUrl);
|
|
796
|
+
if (!apiKey) {
|
|
797
|
+
if (cleanupState) {
|
|
798
|
+
await cleanupInstalledSkillArtifactsForHosts({
|
|
922
799
|
projectRoot,
|
|
923
800
|
hostNames: supportedHosts,
|
|
801
|
+
priorState: cleanupState,
|
|
924
802
|
scope,
|
|
925
|
-
serverName,
|
|
926
|
-
serverUrl,
|
|
927
803
|
skillNames: bundledSkillNames,
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
log.plain(
|
|
931
|
-
`Guided skill install skipped unsupported hosts (MCP-only): ${unsupportedHosts.join(", ")}.`,
|
|
932
|
-
);
|
|
933
|
-
}
|
|
934
|
-
const completedCleanupState = cleanupState;
|
|
935
|
-
cleanupState = null;
|
|
936
|
-
await discardInstallSkillCleanupState(completedCleanupState);
|
|
937
|
-
const showSkillRefreshGuidance =
|
|
938
|
-
scope === "project" && supportedHosts.length > 0;
|
|
939
|
-
printSetupResults(setupRows, scope, serverUrl, {
|
|
940
|
-
showSkillRefreshGuidance,
|
|
941
|
-
experimentalSyncAgents: showSkillRefreshGuidance
|
|
942
|
-
? resolveExperimentalSyncAgentsForHosts(supportedHosts)
|
|
943
|
-
: [],
|
|
944
|
-
});
|
|
945
|
-
return setupResult;
|
|
946
|
-
} catch (error) {
|
|
947
|
-
if (cleanupState) {
|
|
948
|
-
await cleanupInstalledSkillArtifactsForHosts({
|
|
949
|
-
projectRoot,
|
|
950
|
-
hostNames: supportedHosts,
|
|
951
|
-
priorState: cleanupState,
|
|
952
|
-
scope,
|
|
953
|
-
skillNames: bundledSkillNames,
|
|
954
|
-
});
|
|
804
|
+
});
|
|
805
|
+
cleanupState = null;
|
|
955
806
|
}
|
|
956
|
-
|
|
807
|
+
log.warn("Setup cancelled");
|
|
808
|
+
return { exitCode: 0 };
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
|
|
812
|
+
const setupResult = await runMcpSetupMode({
|
|
813
|
+
selectedHosts: hosts,
|
|
814
|
+
scope,
|
|
815
|
+
cwd: projectRoot,
|
|
816
|
+
// Prior-mode enforcement already ran before install/auth (above); skip
|
|
817
|
+
// the inner detector so a --force reconcile cannot re-uninstall the
|
|
818
|
+
// skills this command just installed, and so the non-force conflict
|
|
819
|
+
// path short-circuits before we reach this point.
|
|
820
|
+
force: false,
|
|
821
|
+
serverName,
|
|
822
|
+
serverUrl,
|
|
823
|
+
apiKey,
|
|
824
|
+
privateCodexConfig: options.apiKeyStdin === true,
|
|
825
|
+
replaceExisting: options.force === true,
|
|
826
|
+
// Tell the writers to reconcile auth-mode mismatches (Authorization
|
|
827
|
+
// header added/removed) only when the user explicitly set `--oauth` or
|
|
828
|
+
// `--api-key`. Without that, a passive rerun must stay idempotent and
|
|
829
|
+
// preserve the existing bearer header on disk rather than stripping it.
|
|
830
|
+
enforceAuthMode: oauthMode || explicitApiKeyProvided,
|
|
831
|
+
detectPriorMode: async () => ({
|
|
832
|
+
priorMode: null,
|
|
833
|
+
affectedHosts: [],
|
|
834
|
+
entries: [],
|
|
835
|
+
}),
|
|
836
|
+
reconcilePriorMode: deps.reconcilePriorMode,
|
|
837
|
+
});
|
|
838
|
+
if (reconciled.length > 0) {
|
|
839
|
+
setupResult.reconciled = [
|
|
840
|
+
...(Array.isArray(setupResult.reconciled)
|
|
841
|
+
? setupResult.reconciled
|
|
842
|
+
: []),
|
|
843
|
+
...reconciled,
|
|
844
|
+
];
|
|
845
|
+
}
|
|
846
|
+
|
|
847
|
+
if (setupResult.exitCode !== 0) {
|
|
848
|
+
printSetupResultSummary(setupResult);
|
|
849
|
+
const failureDetails = setupResult.agentResults
|
|
850
|
+
.filter((result) => result.success !== true)
|
|
851
|
+
.flatMap((result) =>
|
|
852
|
+
Array.isArray(result.warnings) ? result.warnings : [],
|
|
853
|
+
)
|
|
854
|
+
.join(" | ");
|
|
855
|
+
const error = new Error(
|
|
856
|
+
failureDetails.length > 0
|
|
857
|
+
? `MCP setup encountered host-level failures: ${failureDetails}`
|
|
858
|
+
: "MCP setup encountered host-level failures.",
|
|
859
|
+
);
|
|
860
|
+
error.exitCode = setupResult.exitCode;
|
|
861
|
+
throw error;
|
|
862
|
+
}
|
|
863
|
+
|
|
864
|
+
const setupRows = buildSetupResultRows({
|
|
865
|
+
selectedHosts: hosts,
|
|
866
|
+
hostStates,
|
|
867
|
+
setupResult,
|
|
868
|
+
oauthMode,
|
|
869
|
+
});
|
|
870
|
+
|
|
871
|
+
if (skillDecisionMode !== "guided") {
|
|
872
|
+
const completedCleanupState = cleanupState;
|
|
873
|
+
cleanupState = null;
|
|
874
|
+
await discardInstallSkillCleanupState(completedCleanupState);
|
|
875
|
+
const showSkillRefreshGuidance =
|
|
876
|
+
scope === "project" &&
|
|
877
|
+
skillDecisionMode === "install" &&
|
|
878
|
+
supportedHosts.length > 0;
|
|
879
|
+
printSetupResults(setupRows, scope, serverUrl, {
|
|
880
|
+
showSkillRefreshGuidance,
|
|
881
|
+
experimentalSyncAgents: showSkillRefreshGuidance
|
|
882
|
+
? resolveExperimentalSyncAgentsForHosts(supportedHosts)
|
|
883
|
+
: [],
|
|
884
|
+
});
|
|
885
|
+
return setupResult;
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
if (supportedHosts.length === 0) {
|
|
889
|
+
log.plain(
|
|
890
|
+
`Bundled skill installation is unavailable for the selected hosts (${hosts.join(", ")}). Continuing with MCP-only setup.`,
|
|
891
|
+
);
|
|
892
|
+
printSetupResults(setupRows, scope, serverUrl);
|
|
893
|
+
return setupResult;
|
|
894
|
+
}
|
|
895
|
+
|
|
896
|
+
const shouldInstallSkill = await promptGuidedSkillInstall(
|
|
897
|
+
bundledSkillNames,
|
|
898
|
+
unsupportedHosts,
|
|
899
|
+
guidedSkillDecisionOverride,
|
|
900
|
+
);
|
|
901
|
+
if (!shouldInstallSkill) {
|
|
902
|
+
printSetupResults(setupRows, scope, serverUrl);
|
|
903
|
+
return setupResult;
|
|
904
|
+
}
|
|
905
|
+
|
|
906
|
+
if (installDriftHosts.length > 0) {
|
|
907
|
+
throw new Error(
|
|
908
|
+
formatInstallSkillDriftError({
|
|
909
|
+
hostName: installDriftHosts[0].hostName,
|
|
910
|
+
scope,
|
|
911
|
+
serverName,
|
|
912
|
+
existingUrl: installDriftHosts[0].existingUrl,
|
|
913
|
+
requestedUrl: serverUrl,
|
|
914
|
+
}),
|
|
915
|
+
);
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
logBundledSkillInstallPlan({
|
|
919
|
+
bundledSkillNames,
|
|
920
|
+
projectRoot,
|
|
921
|
+
scope,
|
|
922
|
+
supportedHosts,
|
|
923
|
+
});
|
|
924
|
+
cleanupState = await inspectInstalledSkillArtifactsForHosts({
|
|
925
|
+
projectRoot,
|
|
926
|
+
hostNames: supportedHosts,
|
|
927
|
+
scope,
|
|
928
|
+
skillNames: bundledSkillNames,
|
|
929
|
+
});
|
|
930
|
+
await installBundledSkillForHosts({
|
|
931
|
+
projectRoot,
|
|
932
|
+
hostNames: supportedHosts,
|
|
933
|
+
scope,
|
|
934
|
+
serverName,
|
|
935
|
+
serverUrl,
|
|
936
|
+
skillNames: bundledSkillNames,
|
|
937
|
+
});
|
|
938
|
+
if (unsupportedHosts.length > 0) {
|
|
939
|
+
log.plain(
|
|
940
|
+
`Guided skill install skipped unsupported hosts (MCP-only): ${unsupportedHosts.join(", ")}.`,
|
|
941
|
+
);
|
|
942
|
+
}
|
|
943
|
+
const completedCleanupState = cleanupState;
|
|
944
|
+
cleanupState = null;
|
|
945
|
+
await discardInstallSkillCleanupState(completedCleanupState);
|
|
946
|
+
const showSkillRefreshGuidance =
|
|
947
|
+
scope === "project" && supportedHosts.length > 0;
|
|
948
|
+
printSetupResults(setupRows, scope, serverUrl, {
|
|
949
|
+
showSkillRefreshGuidance,
|
|
950
|
+
experimentalSyncAgents: showSkillRefreshGuidance
|
|
951
|
+
? resolveExperimentalSyncAgentsForHosts(supportedHosts)
|
|
952
|
+
: [],
|
|
953
|
+
});
|
|
954
|
+
return setupResult;
|
|
955
|
+
} catch (error) {
|
|
956
|
+
if (cleanupState) {
|
|
957
|
+
await cleanupInstalledSkillArtifactsForHosts({
|
|
958
|
+
projectRoot,
|
|
959
|
+
hostNames: supportedHosts,
|
|
960
|
+
priorState: cleanupState,
|
|
961
|
+
scope,
|
|
962
|
+
skillNames: bundledSkillNames,
|
|
963
|
+
});
|
|
957
964
|
}
|
|
965
|
+
throw error;
|
|
966
|
+
}
|
|
958
967
|
}
|