@paradigma-inc/flywheel 0.1.115 → 0.1.134
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +67 -10
- package/package.json +14 -6
- package/skills/flywheel/SKILL.md +9 -6
- package/skills/flywheel/example-workflows/organizing-exploring-and-iterating-on-a-research-topic.md +38 -46
- package/skills/flywheel/example-workflows/reproducing-papers-on-a-budget.md +34 -36
- package/skills/flywheel/getting-started/flywheel-quickstart.md +2 -5
- package/skills/flywheel/references/INTERFACES.md +2 -2
- package/skills/flywheel/references/experiment-design-protocol.md +32 -25
- package/skills/flywheel/references/flywheel-cli-tool-map.md +120 -76
- package/skills/flywheel/references/flywheel-mcp-tool-map.md +42 -32
- package/skills/flywheel/setting-up-flywheel/claude-code-cli-installation.md +1 -1
- package/skills/flywheel/setting-up-flywheel/codex-cli-installation.md +1 -1
- package/skills/flywheel/setting-up-flywheel/installation-overview.md +2 -6
- package/skills/flywheel/setting-up-flywheel/other-hosts-installation.md +45 -25
- package/skills/flywheel/setting-up-flywheel/updating-flywheel-mcp.md +34 -11
- package/skills/flywheel-auto/SKILL.md +40 -23
- package/skills/flywheel-auto/evals/evals.json +1 -1
- package/skills/flywheel-auto/references/INTERFACES.md +2 -2
- package/skills/flywheel-auto/references/experiment-design-protocol.md +31 -23
- package/skills/flywheel-auto/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-auto/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-lookahead/SKILL.md +47 -28
- package/skills/flywheel-lookahead/agents/openai.yaml +1 -1
- package/skills/flywheel-lookahead/evals/evals.json +6 -6
- package/skills/flywheel-lookahead/references/INTERFACES.md +2 -2
- package/skills/flywheel-lookahead/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-lookahead/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-prove/SKILL.md +2 -2
- package/skills/flywheel-prove/references/workflow.md +21 -2
- package/skills/flywheel-reproduce/SKILL.md +39 -19
- package/skills/flywheel-reproduce/evals/evals.json +1 -1
- package/skills/flywheel-reproduce/references/INTERFACES.md +2 -2
- package/skills/flywheel-reproduce/references/experiment-design-protocol.md +31 -23
- package/skills/flywheel-reproduce/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-reproduce/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-to-graph/SKILL.md +37 -17
- package/skills/flywheel-to-graph/references/INTERFACES.md +2 -2
- package/skills/flywheel-to-graph/references/flywheel-cli-tool-map.md +172 -127
- package/skills/flywheel-to-graph/references/flywheel-mcp-tool-map.md +22 -24
- package/skills/flywheel-tree/references/workflow.md +6 -37
- package/src/cli.mjs +1145 -1141
- package/src/mcp-writer.mjs +413 -435
- package/src/public-command-metadata.mjs +28 -5
- package/src/runtime/delegate.mjs +2 -19
- package/src/runtime/required-runtime-commands.json +80 -28
- package/src/runtime/runtime-config.mjs +39 -60
- package/src/runtime/vendor/flywheel-cli-dist/auth/credentials.js +330 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/credentials.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js +90 -139
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/secure-write.js +116 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/secure-write.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js +248 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js +65 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-revoke-api-key.js +17 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-revoke-api-key.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js +3 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-clear.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-clear.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-set.js +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-credentials-set.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js +46 -10
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js +17 -40
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js +305 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-resources.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-support.js +72 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation-support.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation.js +286 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-operation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js +30 -5
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js +27 -12
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-commit-replay.js +284 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-commit-replay.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-graph.js +169 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-graph.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-lineage-list.js +13 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-lineage-list.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-repository-snapshot.js +227 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/hosted-repository-snapshot.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js +21 -51
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/node-create-schema.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/node-create-schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js +11 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js +38 -45
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js +14 -17
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js +13 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js +34 -3
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js +9 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hosted.js +76 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hosted.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js +4 -138
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js +8 -13
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js +362 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/repository.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js +45 -183
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-edit.js +47 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-edit.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js +181 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-operation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-output.js +163 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-output.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js +79 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js +80 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/repository-selection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/retired-command-names.js +78 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/retired-command-names.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js +3 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/config/index.js +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/index.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/io.js +139 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/io.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/migration.js +299 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/migration.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/model.js +214 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/model.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/path.js +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/config/path.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/credential-output.js +29 -0
- package/src/runtime/vendor/flywheel-cli-dist/credential-output.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/errors.js +1 -16
- package/src/runtime/vendor/flywheel-cli-dist/errors.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.js +3 -3
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js +19 -9
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js +33 -4
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js +322 -304
- package/src/runtime/vendor/flywheel-cli-dist/http/client.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js +1 -21
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js +244 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/adapter.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/errors.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/errors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/history.js +35 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/history.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/invariants.js +42 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/invariants.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/artifact-properties.js +179 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/artifact-properties.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/commits.js +152 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/constants.js +71 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/constants.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/encoding.js +73 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/encoding.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/imported-artifact-properties.js +82 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/imported-artifact-properties.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/operations.js +345 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/operations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/tags.js +57 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/models/tags.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/conflicts.js +149 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/conflicts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/context.js +115 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/context.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/keys.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/keys.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/pull.js +159 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js +346 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/replay.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/resolve.js +37 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/rebase/resolve.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/inverses.js +203 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/inverses.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/plan.js +207 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/plan.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/tag-inverses.js +109 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/revert/tag-inverses.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js +61 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/commit.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/projection.js +46 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/revert.js +203 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/revert.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/staging.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js +188 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/service/writes.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/cursors.js +54 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/cursors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/local-pull.js +25 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync/local-pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync-models.js +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/domain/sync-models.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/native.js +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/native.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/state.js +129 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/state.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/writer-lock.js +277 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/fs/writer-lock.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/bootstrap.js +183 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/bootstrap.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/context.js +2 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/context.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js +121 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/dispatch.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/doctor.js +16 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/doctor.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/identity.js +72 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/identity.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/conflicts.js +59 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/conflicts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js +125 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/core.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/history.js +129 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/history.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js +31 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/index.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/maintenance.js +49 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/maintenance.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js +30 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/projections.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/shared.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/operations/shared.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/platform.js +18 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/platform.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js +125 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/projection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/clone.js +37 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/clone.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/pull.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/pull.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/purge.js +58 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/purge.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/push.js +118 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/push.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/transport.js +277 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/runtime/remote/transport.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js +132 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/apply.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/archive.js +372 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/archive.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/backup.js +210 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/backup.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/restore.js +278 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/restore.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/retained-directory.js +192 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/backup/retained-directory.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/commits.js +114 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js +65 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/contract.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics-worker.js +145 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics-worker.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics.js +218 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/diagnostics.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/gc.js +71 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/gc.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js +298 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/history-validation.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js +121 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/latest-values.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrate.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/provenance.js +49 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/provenance.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/steps.js +424 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/steps.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/versions.js +10 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migration/versions.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/001_initial.sql +319 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/002_staged_latest_values.sql +8 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/003_remove_cli_editing_lease.sql +21 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/004_hosted_association.sql +7 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations/005_artifact_properties.sql +68 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations.js +12 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/migrations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/objects.js +410 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/objects.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/apply.js +77 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/apply.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js +240 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/artifacts.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/nodes.js +127 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/nodes.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/relations.js +107 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/relations.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/rules.js +80 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/rules.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/tags.js +219 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/projection/tags.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/hosted.js +164 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/hosted.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/read.js +20 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/read.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/replace.js +41 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/replace.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/schema.js +22 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/validate.js +188 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot/validate.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot.js +5 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/snapshot.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/connection.js +214 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/connection.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/errors.js +4 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/errors.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/rows.js +44 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/rows.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/schema.js +38 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/schema.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js +284 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/store.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/verify.js +133 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sqlite/verify.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync-commits.js +98 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync-commits.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js +161 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/sync.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace-state.js +97 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace-state.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace.js +69 -0
- package/src/runtime/vendor/flywheel-cli-dist/local/store/workspace.js.map +1 -0
- package/src/runtime/vendor/flywheel-cli-dist/main.js +651 -376
- package/src/runtime/vendor/flywheel-cli-dist/main.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js +18 -11
- package/src/runtime/vendor/flywheel-cli-dist/output/format.js.map +1 -1
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-arm64/node.napi.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/darwin-x64/node.napi.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-arm64/node.napi.glibc.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-arm64/node.napi.musl.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-x64/node.napi.glibc.node +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/prebuilds/linux-x64/node.napi.musl.node +0 -0
- package/src/runtime/vendor/manifest.json +246 -257
- package/src/setup/command.mjs +5 -0
- package/src/setup/io/patchers/json.mjs +1 -1
- package/src/setup/io/patchers/toml.mjs +3 -1
- package/src/setup/io/patchers/yaml.mjs +1 -1
- package/src/setup/modes/cli.mjs +76 -7
- package/src/setup/modes/mcp-command.mjs +802 -793
- package/src/setup/modes/mcp.mjs +7 -3
- package/src/setup/shared/prior-mode-detect.mjs +18 -21
- package/src/setup/test-seams.mjs +25 -0
- package/src/setup-auth.mjs +76 -10
- package/src/toml-lines.mjs +52 -0
- package/src/unified-cli.mjs +31 -16
- package/skills/flywheel-llm-proof-paper/scripts/__pycache__/check_paper.cpython-312.pyc +0 -0
- package/src/runtime/vendor/flywheel-cli-dist/auth/active-key-id.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/baseurl.d.ts +0 -35
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.d.ts +0 -34
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js +0 -92
- package/src/runtime/vendor/flywheel-cli-dist/auth/config.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/fingerprint.d.ts +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js +0 -31
- package/src/runtime/vendor/flywheel-cli-dist/auth/keychain.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/login.d.ts +0 -24
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.d.ts +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js +0 -150
- package/src/runtime/vendor/flywheel-cli-dist/auth/profile.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/auth/profiles.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/_admin-auth.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.d.ts +0 -32
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js +0 -213
- package/src/runtime/vendor/flywheel-cli-dist/commands/_artifacts-upload-helpers.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/_browser-handoff.d.ts +0 -35
- package/src/runtime/vendor/flywheel-cli-dist/commands/_open-url.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/_secret-param.d.ts +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-file-out.d.ts +0 -39
- package/src/runtime/vendor/flywheel-cli-dist/commands/_stream-writer.d.ts +0 -34
- package/src/runtime/vendor/flywheel-cli-dist/commands/_wait-polling.d.ts +0 -50
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-detach.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-add.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-remove.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-emails-set-primary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-preview.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge-proof.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/account-merge.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-compute-policy-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export-stream.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-export.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-graphs-list.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-nodes-audit-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/admin-test-users-login.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/aliases.d.ts +0 -13
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-list.d.ts +0 -18
- package/src/runtime/vendor/flywheel-cli-dist/commands/api-keys-rotate.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-expire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-heartbeat.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/approval-sessions-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.js +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete-bulk.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js +0 -9
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-note-set.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-finalize.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload-prepare.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/commands/artifacts-upload.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-clear.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-keychain-set.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-login.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-mode.d.ts +0 -4
- package/src/runtime/vendor/flywheel-cli-dist/commands/auth-status.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/blobs-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-revoke.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-budgets-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/campaign-snapshot.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-acquire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-budgets.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-connection.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-funding.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-grants-request-approval.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-options.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release-all.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-release.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/compute-status.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-balance.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-billing-portal.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-purchase.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral-claim.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-referral.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscribe.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-subscription.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-transactions.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/credits-usage.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/destructive-confirmation.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/enums.d.ts +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/env.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-launch.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/executions-terminate.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-history.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-subgraph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-pdf.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-render-pdf.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary-stream.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/export-summary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/feedback-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/files-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-disconnect.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-link.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-refresh-repos.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/github-status.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/graph-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/handler-factory.d.ts +0 -22
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-format.d.ts +0 -31
- package/src/runtime/vendor/flywheel-cli-dist/commands/help-metadata.d.ts +0 -36
- package/src/runtime/vendor/flywheel-cli-dist/commands/help.d.ts +0 -17
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-delete.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-runs-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-delete.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-secrets-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-set-enabled.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/hooks-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/import-subgraph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/index.d.ts +0 -23
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-remove.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-huggingface-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-status.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-remove.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/integrations-wandb-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/machines-list.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-add-parent.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js +0 -10
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-branch.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-children.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit-new.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js +0 -7
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-commit.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-create.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js +0 -16
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete-bulk.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-files.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-get.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js +0 -33
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-merge.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.js +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-parents.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js +0 -15
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-remove-parent.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-ancestry.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-summary.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-render-tree.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-resolve-slug.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-get.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set-bulk.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-sharing-summaries.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-acquire.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-heartbeat.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/nodes-stage-lease-release.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-set.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-show.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/profile-unset.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/account.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/admin.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/api-keys.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/approval.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js +0 -140
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/artifacts.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/auth.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/budgets.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/compute.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/credits.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/env.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/executions.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/export.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/github.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/graph.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/hooks.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/integrations.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/lifecycle.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/profile.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/resources.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/sharing.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js +0 -98
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/tagging.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry/updates.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/registry.d.ts +0 -27
- package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-refresh.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/remote-artifacts-resolve.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js +0 -25
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-assign.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js +0 -25
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-create.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-delete.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js +0 -28
- package/src/runtime/vendor/flywheel-cli-dist/commands/tags-update.js.map +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/types.d.ts +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide-all-active.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-hide.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/updates-list.d.ts +0 -2
- package/src/runtime/vendor/flywheel-cli-dist/commands/usage-spec.d.ts +0 -6
- package/src/runtime/vendor/flywheel-cli-dist/commands/utils.d.ts +0 -11
- package/src/runtime/vendor/flywheel-cli-dist/errors.d.ts +0 -86
- package/src/runtime/vendor/flywheel-cli-dist/exit-codes.d.ts +0 -8
- package/src/runtime/vendor/flywheel-cli-dist/generatedFeedbackContract.d.ts +0 -41
- package/src/runtime/vendor/flywheel-cli-dist/generatedProductTelemetryContract.d.ts +0 -13
- package/src/runtime/vendor/flywheel-cli-dist/grammar/globals.d.ts +0 -26
- package/src/runtime/vendor/flywheel-cli-dist/grammar/parse.d.ts +0 -17
- package/src/runtime/vendor/flywheel-cli-dist/http/client.d.ts +0 -91
- package/src/runtime/vendor/flywheel-cli-dist/http/debug.d.ts +0 -5
- package/src/runtime/vendor/flywheel-cli-dist/http/poll.d.ts +0 -18
- package/src/runtime/vendor/flywheel-cli-dist/http/retry.d.ts +0 -30
- package/src/runtime/vendor/flywheel-cli-dist/main.d.ts +0 -33
- package/src/runtime/vendor/flywheel-cli-dist/output/format.d.ts +0 -9
- package/src/runtime/vendor/flywheel-cli-dist/runtime-entry.d.ts +0 -1
- package/src/runtime/vendor/flywheel-cli-dist/version.d.ts +0 -3
- package/src/secure-write.mjs +0 -43
package/src/cli.mjs
CHANGED
|
@@ -4,42 +4,43 @@ import ora from "ora";
|
|
|
4
4
|
import pc from "picocolors";
|
|
5
5
|
import { access, readFile, rm } from "node:fs/promises";
|
|
6
6
|
import path from "node:path";
|
|
7
|
+
import { isatty } from "node:tty";
|
|
7
8
|
|
|
8
9
|
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
10
|
+
ALL_HOST_NAMES,
|
|
11
|
+
SERVER_NAME,
|
|
12
|
+
SETUP_HOST_NAMES,
|
|
13
|
+
SKILL_ONLY_HOST_NAMES,
|
|
14
|
+
detectHosts,
|
|
15
|
+
getHost,
|
|
16
|
+
isSkillOnlyHost,
|
|
17
|
+
normalizeHosts,
|
|
17
18
|
} from "./agents.mjs";
|
|
18
19
|
import { generateCompletionScript } from "./completion.mjs";
|
|
19
20
|
import {
|
|
20
|
-
|
|
21
|
-
|
|
21
|
+
installCompletion,
|
|
22
|
+
uninstallCompletion,
|
|
22
23
|
} from "./completion-install.mjs";
|
|
23
24
|
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
readEntryServerUrl,
|
|
26
|
+
readNamedConfigEntry,
|
|
27
|
+
readJsonConfig,
|
|
28
|
+
readTomlServerEntry,
|
|
29
|
+
readYamlConfig,
|
|
30
|
+
removeCodexTomlServer,
|
|
31
|
+
removeJsonServerEntry,
|
|
32
|
+
resolveMcpPath,
|
|
33
|
+
writeJsonConfig,
|
|
34
|
+
writeYamlConfig,
|
|
34
35
|
} from "./mcp-writer.mjs";
|
|
35
36
|
import {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
listBundledSkills,
|
|
38
|
+
partitionInstallSkillHosts,
|
|
39
|
+
removeInstalledSkillsForHosts,
|
|
40
|
+
resolveInstalledSkillDir,
|
|
41
|
+
resolveFlywheelInstalledMarkerPath,
|
|
42
|
+
SUPPORTED_INSTALL_SKILL_HOSTS,
|
|
43
|
+
resolvePackageRoot,
|
|
43
44
|
} from "./skill-installer.mjs";
|
|
44
45
|
import { normalizeSetupAuthMode } from "./setup-auth.mjs";
|
|
45
46
|
import { resolveSetupBaseUrl } from "./setup/base-url.mjs";
|
|
@@ -47,292 +48,292 @@ import { runSetupRouter } from "./setup/command.mjs";
|
|
|
47
48
|
import { SetupModeUsageError } from "./setup/mode.mjs";
|
|
48
49
|
import { runCliSetupMode } from "./setup/modes/cli.mjs";
|
|
49
50
|
import {
|
|
50
|
-
|
|
51
|
-
|
|
51
|
+
buildGuidedSkillInstallPrompt,
|
|
52
|
+
runMcpModeCommand,
|
|
52
53
|
} from "./setup/modes/mcp-command.mjs";
|
|
53
54
|
import { COMPLETION_SHELL_CHOICES } from "./public-command-metadata.mjs";
|
|
54
55
|
import { findFlywheelMcpEntryNames } from "./setup/shared/prior-mode-detect.mjs";
|
|
55
56
|
import { renderSetupSummary } from "./setup/shared/summary.mjs";
|
|
56
57
|
|
|
57
58
|
async function pathExists(targetPath) {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
59
|
+
try {
|
|
60
|
+
await access(targetPath);
|
|
61
|
+
return true;
|
|
62
|
+
} catch {
|
|
63
|
+
return false;
|
|
64
|
+
}
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
export { buildGuidedSkillInstallPrompt };
|
|
67
68
|
|
|
68
69
|
const log = {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
70
|
+
info: (message) => console.log(pc.cyan(message)),
|
|
71
|
+
warn: (message) => console.log(pc.yellow(`⚠ ${message}`)),
|
|
72
|
+
error: (message) => console.log(pc.red(`✖ ${message}`)),
|
|
73
|
+
plain: (message) => console.log(message),
|
|
74
|
+
blank: () => console.log(""),
|
|
74
75
|
};
|
|
75
76
|
|
|
76
77
|
const CHECKBOX_THEME = {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
78
|
+
style: {
|
|
79
|
+
highlight: (text) => pc.green(text),
|
|
80
|
+
disabledChoice: (text) => ` ${pc.dim("◯")} ${pc.dim(text)}`,
|
|
81
|
+
},
|
|
81
82
|
};
|
|
82
83
|
|
|
83
84
|
function hostChoiceDescription({ detected = false, configured = false } = {}) {
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
85
|
+
if (configured) return "Already has a Flywheel entry for this scope.";
|
|
86
|
+
if (detected) return "Detected on this machine.";
|
|
87
|
+
return "Supported host; select it if you use it here.";
|
|
87
88
|
}
|
|
88
89
|
|
|
89
90
|
function normalizeBaseUrl(value) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
const normalized = String(value || "").trim();
|
|
92
|
+
let parsedUrl;
|
|
93
|
+
try {
|
|
94
|
+
parsedUrl = new URL(normalized);
|
|
95
|
+
} catch {
|
|
96
|
+
throw new Error("Base URL must be a valid absolute URL.");
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (parsedUrl.pathname !== "/" || parsedUrl.search || parsedUrl.hash) {
|
|
100
|
+
throw new Error(
|
|
101
|
+
"Base URL must be a public Flywheel origin without a path, query, or hash.",
|
|
102
|
+
);
|
|
103
|
+
}
|
|
103
104
|
|
|
104
|
-
|
|
105
|
+
return parsedUrl.origin;
|
|
105
106
|
}
|
|
106
107
|
|
|
107
108
|
function normalizeServerName(value) {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
109
|
+
const normalized = String(value || "").trim();
|
|
110
|
+
if (!normalized) {
|
|
111
|
+
throw new Error("Server name cannot be empty.");
|
|
112
|
+
}
|
|
113
|
+
return normalized;
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
function normalizeAuthMode(value) {
|
|
116
|
-
|
|
117
|
+
return normalizeSetupAuthMode(value);
|
|
117
118
|
}
|
|
118
119
|
|
|
119
120
|
function selectedHostsFromOptions(options) {
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
121
|
+
const hosts = [];
|
|
122
|
+
if (options.claude) hosts.push("claude");
|
|
123
|
+
if (options.cursor) hosts.push("cursor");
|
|
124
|
+
if (options.universal) hosts.push("universal");
|
|
125
|
+
if (options.antigravity) hosts.push("antigravity");
|
|
126
|
+
if (options.opencode) hosts.push("opencode");
|
|
127
|
+
if (options.codex) hosts.push("codex");
|
|
128
|
+
if (options.gemini) hosts.push("gemini");
|
|
129
|
+
if (options.piMono) hosts.push("pi-mono");
|
|
130
|
+
if (options.hermesAgent) hosts.push("hermes-agent");
|
|
131
|
+
if (options.openclaw) hosts.push("openclaw");
|
|
132
|
+
return hosts;
|
|
132
133
|
}
|
|
133
134
|
|
|
134
135
|
const UNINSTALL_OPTION_KEY_BY_HOST = Object.freeze({
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
claude: "claude",
|
|
137
|
+
codex: "codex",
|
|
138
|
+
opencode: "opencode",
|
|
139
|
+
cursor: "cursor",
|
|
140
|
+
gemini: "gemini",
|
|
141
|
+
universal: "universal",
|
|
142
|
+
antigravity: "antigravity",
|
|
143
|
+
"pi-mono": "piMono",
|
|
144
|
+
"hermes-agent": "hermesAgent",
|
|
145
|
+
openclaw: "openclaw",
|
|
145
146
|
});
|
|
146
147
|
|
|
147
148
|
function buildUninstallOptionsForHosts({
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
149
|
+
hostNames = [],
|
|
150
|
+
scope = "project",
|
|
151
|
+
serverName = SERVER_NAME,
|
|
151
152
|
} = {}) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
153
|
+
const options = {
|
|
154
|
+
yes: true,
|
|
155
|
+
scope,
|
|
156
|
+
name: serverName,
|
|
157
|
+
};
|
|
157
158
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
}
|
|
159
|
+
for (const hostName of hostNames) {
|
|
160
|
+
const optionKey = UNINSTALL_OPTION_KEY_BY_HOST[hostName];
|
|
161
|
+
if (optionKey) {
|
|
162
|
+
options[optionKey] = true;
|
|
163
163
|
}
|
|
164
|
+
}
|
|
164
165
|
|
|
165
|
-
|
|
166
|
+
return options;
|
|
166
167
|
}
|
|
167
168
|
|
|
168
169
|
function parseHostsList(value) {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
170
|
+
if (!value) return [];
|
|
171
|
+
return normalizeHosts(
|
|
172
|
+
String(value)
|
|
173
|
+
.split(",")
|
|
174
|
+
.map((item) => item.trim())
|
|
175
|
+
.filter(Boolean),
|
|
176
|
+
);
|
|
176
177
|
}
|
|
177
178
|
|
|
178
179
|
function collectModeValues(value, previousValues = []) {
|
|
179
|
-
|
|
180
|
+
return [...previousValues, value];
|
|
180
181
|
}
|
|
181
182
|
|
|
182
183
|
function mcpCandidatesForScope(host, scope) {
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
184
|
+
if (scope === "global") return host.mcp.globalPaths;
|
|
185
|
+
return host.mcp.projectPaths.map((candidate) =>
|
|
186
|
+
path.join(process.cwd(), candidate),
|
|
187
|
+
);
|
|
187
188
|
}
|
|
188
189
|
|
|
189
190
|
async function isAlreadyConfigured(hostName, scope, serverName) {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
191
|
+
const existingState = await readExistingServerState(
|
|
192
|
+
hostName,
|
|
193
|
+
scope,
|
|
194
|
+
serverName,
|
|
195
|
+
);
|
|
196
|
+
return existingState.exists;
|
|
196
197
|
}
|
|
197
198
|
|
|
198
199
|
async function readExistingServerState(hostName, scope, serverName) {
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
200
|
+
const host = getHost(hostName);
|
|
201
|
+
if (isSkillOnlyHost(host)) {
|
|
202
|
+
return { exists: false, url: null, mcpPath: null };
|
|
203
|
+
}
|
|
204
|
+
const mcpPath = await resolveMcpPath(mcpCandidatesForScope(host, scope));
|
|
205
|
+
|
|
206
|
+
if (host.mcp.configType === "toml") {
|
|
207
|
+
const { exists, url } = await readTomlServerEntry(mcpPath, serverName);
|
|
208
|
+
return { exists, url, mcpPath };
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const existing =
|
|
212
|
+
host.mcp.configType === "yaml"
|
|
213
|
+
? await readYamlConfig(mcpPath)
|
|
214
|
+
: await readJsonConfig(mcpPath);
|
|
215
|
+
const entry = readNamedConfigEntry(existing, host.mcp.configKey, serverName);
|
|
216
|
+
return {
|
|
217
|
+
exists: entry !== null,
|
|
218
|
+
url: readEntryServerUrl(entry),
|
|
219
|
+
mcpPath,
|
|
220
|
+
};
|
|
220
221
|
}
|
|
221
222
|
|
|
222
223
|
async function promptHosts(
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
224
|
+
scope,
|
|
225
|
+
detected,
|
|
226
|
+
serverName,
|
|
227
|
+
{ disableAlreadyConfigured = true } = {},
|
|
227
228
|
) {
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}),
|
|
243
|
-
checked: detected.includes(hostName),
|
|
244
|
-
disabled:
|
|
245
|
-
disableAlreadyConfigured && configured
|
|
246
|
-
? "(already configured)"
|
|
247
|
-
: false,
|
|
248
|
-
};
|
|
229
|
+
const choices = await Promise.all(
|
|
230
|
+
ALL_HOST_NAMES.map(async (hostName) => {
|
|
231
|
+
const configured = await isAlreadyConfigured(
|
|
232
|
+
hostName,
|
|
233
|
+
scope,
|
|
234
|
+
serverName,
|
|
235
|
+
).catch(() => false);
|
|
236
|
+
return {
|
|
237
|
+
name: SETUP_HOST_NAMES[hostName],
|
|
238
|
+
value: hostName,
|
|
239
|
+
short: SETUP_HOST_NAMES[hostName],
|
|
240
|
+
description: hostChoiceDescription({
|
|
241
|
+
detected: detected.includes(hostName),
|
|
242
|
+
configured,
|
|
249
243
|
}),
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
244
|
+
checked: detected.includes(hostName),
|
|
245
|
+
disabled:
|
|
246
|
+
disableAlreadyConfigured && configured
|
|
247
|
+
? "(already configured)"
|
|
248
|
+
: false,
|
|
249
|
+
};
|
|
250
|
+
}),
|
|
251
|
+
);
|
|
252
|
+
|
|
253
|
+
if (
|
|
254
|
+
disableAlreadyConfigured &&
|
|
255
|
+
choices.every((choice) => Boolean(choice.disabled))
|
|
256
|
+
) {
|
|
257
|
+
log.info("Flywheel is already configured for all detected hosts.");
|
|
258
|
+
return null;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
try {
|
|
262
|
+
return await checkbox({
|
|
263
|
+
message: "Which hosts do you want to set up?",
|
|
264
|
+
choices,
|
|
265
|
+
loop: false,
|
|
266
|
+
theme: CHECKBOX_THEME,
|
|
267
|
+
validate: (selected) =>
|
|
268
|
+
selected.length > 0 || "Select at least one host.",
|
|
269
|
+
});
|
|
270
|
+
} catch {
|
|
271
|
+
return null;
|
|
272
|
+
}
|
|
272
273
|
}
|
|
273
274
|
|
|
274
275
|
async function resolveHosts(
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
276
|
+
options,
|
|
277
|
+
scope,
|
|
278
|
+
serverName,
|
|
279
|
+
{ allowPrompt = true, disableAlreadyConfigured = true } = {},
|
|
279
280
|
) {
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
281
|
+
const explicit = selectedHostsFromOptions(options);
|
|
282
|
+
if (explicit.length > 0) return explicit;
|
|
283
|
+
|
|
284
|
+
const detected = await detectHosts(scope);
|
|
285
|
+
const promptDisabled =
|
|
286
|
+
options.yes || process.stdout.isTTY !== true || !allowPrompt;
|
|
287
|
+
if (detected.length > 0 && promptDisabled) {
|
|
288
|
+
return detected;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
if (promptDisabled) {
|
|
292
|
+
log.warn(
|
|
293
|
+
"No hosts were detected for prompt-free setup. Pass explicit host flags such as --codex.",
|
|
294
|
+
);
|
|
295
|
+
return [];
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
log.blank();
|
|
299
|
+
const selected = await promptHosts(scope, detected, serverName, {
|
|
300
|
+
disableAlreadyConfigured,
|
|
301
|
+
});
|
|
302
|
+
if (!selected) {
|
|
303
|
+
log.warn("Setup cancelled");
|
|
304
|
+
return [];
|
|
305
|
+
}
|
|
306
|
+
return selected;
|
|
306
307
|
}
|
|
307
308
|
|
|
308
309
|
export function buildSetupModePromptConfig() {
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
310
|
+
return {
|
|
311
|
+
message: "How should your agent access Flywheel?",
|
|
312
|
+
choices: [
|
|
313
|
+
{
|
|
314
|
+
name: "MCP + bundled skills",
|
|
315
|
+
value: "mcp",
|
|
316
|
+
short: "MCP + skills",
|
|
317
|
+
description:
|
|
318
|
+
"Configure MCP tools plus bundled skills for supported AI hosts.",
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
name: "CLI + bundled skills",
|
|
322
|
+
value: "cli",
|
|
323
|
+
short: "CLI + skills",
|
|
324
|
+
description:
|
|
325
|
+
"Install bundled skills for agents that call the flywheel binary.",
|
|
326
|
+
},
|
|
327
|
+
],
|
|
328
|
+
default: "mcp",
|
|
329
|
+
loop: false,
|
|
330
|
+
pageSize: 4,
|
|
331
|
+
theme: CHECKBOX_THEME,
|
|
332
|
+
};
|
|
332
333
|
}
|
|
333
334
|
|
|
334
335
|
async function promptSetupMode() {
|
|
335
|
-
|
|
336
|
+
return await select(buildSetupModePromptConfig());
|
|
336
337
|
}
|
|
337
338
|
|
|
338
339
|
/**
|
|
@@ -348,327 +349,329 @@ async function promptSetupMode() {
|
|
|
348
349
|
* it up front with guidance toward the correct invocation.
|
|
349
350
|
*/
|
|
350
351
|
function validateCliModeFlags(options) {
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
);
|
|
355
|
-
}
|
|
356
|
-
// CLI mode is intentionally "skills only", so --skip-skill would contradict
|
|
357
|
-
// the mode contract and silently surprising behavior should be rejected.
|
|
358
|
-
if (options.skipSkill) {
|
|
359
|
-
throw new SetupModeUsageError(
|
|
360
|
-
"--skip-skill is not supported with --mode cli; use --mode mcp --skip-skill for MCP-only setup.",
|
|
361
|
-
);
|
|
362
|
-
}
|
|
363
|
-
if (options.oauth === true) {
|
|
364
|
-
throw new SetupModeUsageError(
|
|
365
|
-
"--oauth is not supported with --mode cli. --oauth only affects the MCP config written by --mode mcp; re-run with --mode mcp --oauth, or drop --oauth for a CLI-mode setup.",
|
|
366
|
-
);
|
|
367
|
-
}
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
async function runCliModeCommand(options) {
|
|
371
|
-
validateCliModeFlags(options);
|
|
372
|
-
const scope = options.project ? "project" : "global";
|
|
373
|
-
const baseUrl = normalizeBaseUrl(
|
|
374
|
-
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
352
|
+
if (options.installSkill && options.skipSkill) {
|
|
353
|
+
throw new SetupModeUsageError(
|
|
354
|
+
"--install-skill and --skip-skill cannot be used together.",
|
|
375
355
|
);
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
scope,
|
|
391
|
-
cwd: process.cwd(),
|
|
392
|
-
force: options.force === true,
|
|
393
|
-
apiKey: options.apiKey,
|
|
394
|
-
authMode: options.authMode,
|
|
395
|
-
baseUrl,
|
|
396
|
-
serverName,
|
|
397
|
-
serverUrl,
|
|
398
|
-
reconcilePriorMode: async ({ hostNames, serverNames }) => {
|
|
399
|
-
// Uninstall each detected server name so renamed/drifted Flywheel MCP
|
|
400
|
-
// entries are actually removed. When the detector found no explicit
|
|
401
|
-
// names (prior CLI artifacts case), fall back to the current request's
|
|
402
|
-
// --name so the skill cleanup path still runs.
|
|
403
|
-
const targetNames =
|
|
404
|
-
Array.isArray(serverNames) && serverNames.length > 0
|
|
405
|
-
? serverNames
|
|
406
|
-
: [serverName];
|
|
407
|
-
for (const targetName of targetNames) {
|
|
408
|
-
// eslint-disable-next-line no-await-in-loop
|
|
409
|
-
await runUninstallCommand(
|
|
410
|
-
buildUninstallOptionsForHosts({
|
|
411
|
-
hostNames,
|
|
412
|
-
scope,
|
|
413
|
-
serverName: targetName,
|
|
414
|
-
}),
|
|
415
|
-
);
|
|
416
|
-
}
|
|
417
|
-
},
|
|
418
|
-
});
|
|
356
|
+
}
|
|
357
|
+
// CLI mode is intentionally "skills only", so --skip-skill would contradict
|
|
358
|
+
// the mode contract and silently surprising behavior should be rejected.
|
|
359
|
+
if (options.skipSkill) {
|
|
360
|
+
throw new SetupModeUsageError(
|
|
361
|
+
"--skip-skill is not supported with --mode cli; use --mode mcp --skip-skill for MCP-only setup.",
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
if (options.oauth === true) {
|
|
365
|
+
throw new SetupModeUsageError(
|
|
366
|
+
"--oauth is not supported with --mode cli. --oauth only affects the MCP config written by --mode mcp; re-run with --mode mcp --oauth, or drop --oauth for a CLI-mode setup.",
|
|
367
|
+
);
|
|
368
|
+
}
|
|
369
|
+
}
|
|
419
370
|
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
371
|
+
async function runCliModeCommand(options, readStdinAuth) {
|
|
372
|
+
validateCliModeFlags(options);
|
|
373
|
+
const scope = options.project ? "project" : "global";
|
|
374
|
+
const baseUrl = normalizeBaseUrl(
|
|
375
|
+
resolveSetupBaseUrl({ explicitBaseUrl: options.baseUrl }),
|
|
376
|
+
);
|
|
377
|
+
const serverUrl = `${baseUrl}/mcp-server`;
|
|
378
|
+
const serverName = normalizeServerName(options.name || SERVER_NAME);
|
|
379
|
+
const hosts = await resolveHosts(options, scope, serverName, {
|
|
380
|
+
allowPrompt: true,
|
|
381
|
+
// CLI mode is a skills refresh/install path, so existing MCP wiring should
|
|
382
|
+
// not make hosts ineligible for selection.
|
|
383
|
+
disableAlreadyConfigured: false,
|
|
384
|
+
});
|
|
385
|
+
if (hosts.length === 0 && readStdinAuth === undefined) {
|
|
386
|
+
return { exitCode: 0 };
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
const result = await runCliSetupMode({
|
|
390
|
+
selectedHosts: hosts,
|
|
391
|
+
scope,
|
|
392
|
+
cwd: process.cwd(),
|
|
393
|
+
force: options.force === true,
|
|
394
|
+
apiKey: options.apiKey,
|
|
395
|
+
authMode: options.authMode,
|
|
396
|
+
readStdinAuth,
|
|
397
|
+
baseUrl,
|
|
398
|
+
serverName,
|
|
399
|
+
serverUrl,
|
|
400
|
+
reconcilePriorMode: async ({ hostNames, serverNames }) => {
|
|
401
|
+
// Uninstall each detected server name so renamed/drifted Flywheel MCP
|
|
402
|
+
// entries are actually removed. When the detector found no explicit
|
|
403
|
+
// names (prior CLI artifacts case), fall back to the current request's
|
|
404
|
+
// --name so the skill cleanup path still runs.
|
|
405
|
+
const targetNames =
|
|
406
|
+
Array.isArray(serverNames) && serverNames.length > 0
|
|
407
|
+
? serverNames
|
|
408
|
+
: [serverName];
|
|
409
|
+
for (const targetName of targetNames) {
|
|
410
|
+
// eslint-disable-next-line no-await-in-loop
|
|
411
|
+
await runUninstallCommand(
|
|
412
|
+
buildUninstallOptionsForHosts({
|
|
413
|
+
hostNames,
|
|
414
|
+
scope,
|
|
415
|
+
serverName: targetName,
|
|
416
|
+
}),
|
|
438
417
|
);
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
418
|
+
}
|
|
419
|
+
},
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
const lines = renderSetupSummary(result);
|
|
423
|
+
log.blank();
|
|
424
|
+
for (const line of lines) {
|
|
425
|
+
log.plain(` ${line}`);
|
|
426
|
+
}
|
|
427
|
+
log.blank();
|
|
428
|
+
|
|
429
|
+
if (result.exitCode !== 0) {
|
|
430
|
+
const failureDetails = result.agentResults
|
|
431
|
+
.filter((agentResult) => agentResult.success !== true)
|
|
432
|
+
.flatMap((agentResult) =>
|
|
433
|
+
Array.isArray(agentResult.warnings) ? agentResult.warnings : [],
|
|
434
|
+
)
|
|
435
|
+
.join(" | ");
|
|
436
|
+
const error = new Error(
|
|
437
|
+
failureDetails.length > 0
|
|
438
|
+
? `CLI setup encountered host-level failures: ${failureDetails}`
|
|
439
|
+
: "CLI setup encountered host-level failures.",
|
|
440
|
+
);
|
|
441
|
+
error.exitCode = result.exitCode;
|
|
442
|
+
throw error;
|
|
443
|
+
}
|
|
442
444
|
|
|
443
|
-
|
|
445
|
+
return result;
|
|
444
446
|
}
|
|
445
447
|
|
|
446
448
|
async function runSetupCommandViaRouter(options) {
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
})
|
|
449
|
+
return await runSetupRouter(options, {
|
|
450
|
+
isInteractive:
|
|
451
|
+
isatty(0) && process.stdout.isTTY === true,
|
|
452
|
+
promptMode: promptSetupMode,
|
|
453
|
+
runMcpMode: async ({ readStdinAuth }) =>
|
|
454
|
+
await runMcpModeCommand(options, {
|
|
455
|
+
readStdinAuth,
|
|
456
|
+
force: options.force === true,
|
|
457
|
+
reconcilePriorMode: async ({
|
|
458
|
+
hostNames,
|
|
459
|
+
serverNames,
|
|
460
|
+
scope: reconcileScope,
|
|
461
|
+
serverName: requestedServerName,
|
|
462
|
+
}) => {
|
|
463
|
+
// Prior CLI artifacts have no MCP entry name, so fall back to the
|
|
464
|
+
// current request's --name for the skill uninstall path. Prior MCP
|
|
465
|
+
// entries may carry drifted names; uninstall each detected name so
|
|
466
|
+
// the reconcile actually removes what we detected.
|
|
467
|
+
const targetNames =
|
|
468
|
+
Array.isArray(serverNames) && serverNames.length > 0
|
|
469
|
+
? serverNames
|
|
470
|
+
: [requestedServerName];
|
|
471
|
+
for (const targetName of targetNames) {
|
|
472
|
+
// eslint-disable-next-line no-await-in-loop
|
|
473
|
+
await runUninstallCommand(
|
|
474
|
+
buildUninstallOptionsForHosts({
|
|
475
|
+
hostNames,
|
|
476
|
+
scope: reconcileScope,
|
|
477
|
+
serverName: targetName,
|
|
478
|
+
}),
|
|
479
|
+
);
|
|
480
|
+
}
|
|
481
|
+
},
|
|
482
|
+
}),
|
|
483
|
+
runCliMode: async ({ readStdinAuth }) => await runCliModeCommand(options, readStdinAuth),
|
|
484
|
+
});
|
|
482
485
|
}
|
|
483
486
|
|
|
484
487
|
async function runCompletionCommand(shell, options) {
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
488
|
+
try {
|
|
489
|
+
const script = await generateCompletionScript({
|
|
490
|
+
shell,
|
|
491
|
+
includeBashCompletionLib: options.includeBashCompletionLib === true,
|
|
492
|
+
});
|
|
493
|
+
process.stdout.write(script);
|
|
494
|
+
} catch (error) {
|
|
495
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
496
|
+
process.stderr.write(`${message}\n`);
|
|
497
|
+
process.exitCode = 1;
|
|
498
|
+
}
|
|
496
499
|
}
|
|
497
500
|
|
|
498
501
|
async function runCompletionInstallCommand(shell, options) {
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
502
|
+
try {
|
|
503
|
+
await installCompletion({
|
|
504
|
+
shell,
|
|
505
|
+
dir: options.dir,
|
|
506
|
+
force: options.force === true,
|
|
507
|
+
dryRun: options.dryRun === true,
|
|
508
|
+
updateProfile: options.updateProfile === true,
|
|
509
|
+
yes: options.yes === true,
|
|
510
|
+
isInteractive:
|
|
511
|
+
process.stdin.isTTY === true && process.stdout.isTTY === true,
|
|
512
|
+
stdout: (chunk) => process.stdout.write(chunk),
|
|
513
|
+
stderr: (chunk) => process.stderr.write(chunk),
|
|
514
|
+
confirmProfileUpdate: async ({ message, default: defaultValue }) =>
|
|
515
|
+
await confirm({ message, default: defaultValue }),
|
|
516
|
+
generateCompletionScript,
|
|
517
|
+
});
|
|
518
|
+
} catch (error) {
|
|
519
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
520
|
+
process.stderr.write(`${message}\n`);
|
|
521
|
+
process.exitCode = 1;
|
|
522
|
+
}
|
|
520
523
|
}
|
|
521
524
|
|
|
522
525
|
async function runCompletionUninstallCommand(shell, options) {
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
526
|
+
try {
|
|
527
|
+
await uninstallCompletion({
|
|
528
|
+
shell,
|
|
529
|
+
dir: options.dir,
|
|
530
|
+
dryRun: options.dryRun === true,
|
|
531
|
+
updateProfile: options.updateProfile === true,
|
|
532
|
+
yes: options.yes === true,
|
|
533
|
+
isInteractive:
|
|
534
|
+
process.stdin.isTTY === true && process.stdout.isTTY === true,
|
|
535
|
+
stdout: (chunk) => process.stdout.write(chunk),
|
|
536
|
+
stderr: (chunk) => process.stderr.write(chunk),
|
|
537
|
+
confirmProfileUpdate: async ({ message, default: defaultValue }) =>
|
|
538
|
+
await confirm({ message, default: defaultValue }),
|
|
539
|
+
});
|
|
540
|
+
} catch (error) {
|
|
541
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
542
|
+
process.stderr.write(`${message}\n`);
|
|
543
|
+
process.exitCode = 1;
|
|
544
|
+
}
|
|
542
545
|
}
|
|
543
546
|
|
|
544
547
|
function parseUninstallScope(value) {
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
548
|
+
const normalized = String(value || "")
|
|
549
|
+
.trim()
|
|
550
|
+
.toLowerCase();
|
|
551
|
+
if (
|
|
552
|
+
normalized === "global" ||
|
|
553
|
+
normalized === "project" ||
|
|
554
|
+
normalized === "all"
|
|
555
|
+
) {
|
|
556
|
+
return normalized;
|
|
557
|
+
}
|
|
558
|
+
return "all";
|
|
556
559
|
}
|
|
557
560
|
|
|
558
561
|
function scopesFromUninstallScope(scope) {
|
|
559
|
-
|
|
562
|
+
return scope === "all" ? ["global", "project"] : [scope];
|
|
560
563
|
}
|
|
561
564
|
|
|
562
565
|
function keyPath(configKey) {
|
|
563
|
-
|
|
566
|
+
return Array.isArray(configKey) ? configKey : [configKey];
|
|
564
567
|
}
|
|
565
568
|
|
|
566
569
|
function readConfigSection(config, configKey) {
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
}
|
|
582
|
-
current = next;
|
|
570
|
+
const pathParts = keyPath(configKey);
|
|
571
|
+
let current = config && typeof config === "object" ? config : {};
|
|
572
|
+
for (const part of pathParts) {
|
|
573
|
+
if (
|
|
574
|
+
!current ||
|
|
575
|
+
typeof current !== "object" ||
|
|
576
|
+
Array.isArray(current) ||
|
|
577
|
+
!(part in current)
|
|
578
|
+
) {
|
|
579
|
+
return {};
|
|
580
|
+
}
|
|
581
|
+
const next = current[part];
|
|
582
|
+
if (!next || typeof next !== "object" || Array.isArray(next)) {
|
|
583
|
+
return {};
|
|
583
584
|
}
|
|
584
|
-
|
|
585
|
+
current = next;
|
|
586
|
+
}
|
|
587
|
+
return current;
|
|
585
588
|
}
|
|
586
589
|
|
|
587
590
|
function parseTomlServerNames(tomlText) {
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
}
|
|
598
|
-
serverNames.add(match[1]);
|
|
591
|
+
const serverNames = new Set();
|
|
592
|
+
for (const line of String(tomlText || "")
|
|
593
|
+
.replace(/\r\n/g, "\n")
|
|
594
|
+
.split("\n")) {
|
|
595
|
+
const match = line
|
|
596
|
+
.trim()
|
|
597
|
+
.match(/^\[mcp_servers\.([A-Za-z0-9_-]+)\](?:\s*#.*)?$/);
|
|
598
|
+
if (!match) {
|
|
599
|
+
continue;
|
|
599
600
|
}
|
|
600
|
-
|
|
601
|
+
serverNames.add(match[1]);
|
|
602
|
+
}
|
|
603
|
+
return [...serverNames].sort();
|
|
601
604
|
}
|
|
602
605
|
|
|
603
606
|
function isLikelyFlywheelMcpUrl(url) {
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
607
|
+
if (typeof url !== "string" || url.trim().length === 0) {
|
|
608
|
+
return false;
|
|
609
|
+
}
|
|
610
|
+
try {
|
|
611
|
+
const parsed = new URL(url);
|
|
612
|
+
return parsed.pathname === "/mcp-server";
|
|
613
|
+
} catch {
|
|
614
|
+
return false;
|
|
615
|
+
}
|
|
613
616
|
}
|
|
614
617
|
|
|
615
618
|
async function listHostMcpEntries(hostName, scope) {
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
+
const host = getHost(hostName);
|
|
620
|
+
if (isSkillOnlyHost(host)) {
|
|
621
|
+
return [];
|
|
622
|
+
}
|
|
623
|
+
const filePath = await resolveMcpPath(mcpCandidatesForScope(host, scope));
|
|
624
|
+
|
|
625
|
+
if (host.mcp.configType === "toml") {
|
|
626
|
+
let raw = "";
|
|
627
|
+
try {
|
|
628
|
+
raw = await readFile(filePath, "utf8");
|
|
629
|
+
} catch {
|
|
630
|
+
return [];
|
|
619
631
|
}
|
|
620
|
-
const
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
// eslint-disable-next-line no-await-in-loop
|
|
632
|
-
const entry = await readTomlServerEntry(filePath, serverName);
|
|
633
|
-
if (!entry.exists) {
|
|
634
|
-
continue;
|
|
635
|
-
}
|
|
636
|
-
entries.push({
|
|
637
|
-
serverName,
|
|
638
|
-
url: typeof entry.url === "string" ? entry.url : null,
|
|
639
|
-
});
|
|
640
|
-
}
|
|
641
|
-
return entries;
|
|
632
|
+
const entries = [];
|
|
633
|
+
for (const serverName of parseTomlServerNames(raw)) {
|
|
634
|
+
// eslint-disable-next-line no-await-in-loop
|
|
635
|
+
const entry = await readTomlServerEntry(filePath, serverName);
|
|
636
|
+
if (!entry.exists) {
|
|
637
|
+
continue;
|
|
638
|
+
}
|
|
639
|
+
entries.push({
|
|
640
|
+
serverName,
|
|
641
|
+
url: typeof entry.url === "string" ? entry.url : null,
|
|
642
|
+
});
|
|
642
643
|
}
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
644
|
+
return entries;
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const config =
|
|
648
|
+
host.mcp.configType === "yaml"
|
|
649
|
+
? await readYamlConfig(filePath)
|
|
650
|
+
: await readJsonConfig(filePath);
|
|
651
|
+
const section = readConfigSection(config, host.mcp.configKey);
|
|
652
|
+
return Object.entries(section)
|
|
653
|
+
.filter(
|
|
654
|
+
([, entry]) =>
|
|
655
|
+
entry && typeof entry === "object" && !Array.isArray(entry),
|
|
656
|
+
)
|
|
657
|
+
.map(([serverName, entry]) => ({
|
|
658
|
+
serverName,
|
|
659
|
+
url: readEntryServerUrl(entry),
|
|
660
|
+
}));
|
|
658
661
|
}
|
|
659
662
|
|
|
660
663
|
async function resolveHostsWithRemainingFlywheelMcpEntries({ scope }) {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
}
|
|
664
|
+
const remainingHosts = [];
|
|
665
|
+
for (const hostName of SUPPORTED_INSTALL_SKILL_HOSTS) {
|
|
666
|
+
// eslint-disable-next-line no-await-in-loop
|
|
667
|
+
const hostEntries = await listHostMcpEntries(hostName, scope).catch(
|
|
668
|
+
() => [],
|
|
669
|
+
);
|
|
670
|
+
if (hostEntries.some((entry) => isLikelyFlywheelMcpUrl(entry.url))) {
|
|
671
|
+
remainingHosts.push(hostName);
|
|
670
672
|
}
|
|
671
|
-
|
|
673
|
+
}
|
|
674
|
+
return remainingHosts;
|
|
672
675
|
}
|
|
673
676
|
|
|
674
677
|
/**
|
|
@@ -697,95 +700,95 @@ async function resolveHostsWithRemainingFlywheelMcpEntries({ scope }) {
|
|
|
697
700
|
* they are excluded from retention here.
|
|
698
701
|
*/
|
|
699
702
|
async function resolveSkillOnlyHostsRetainingArtifacts({
|
|
700
|
-
|
|
701
|
-
|
|
703
|
+
scope,
|
|
704
|
+
excludedHostNames = [],
|
|
702
705
|
}) {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
}
|
|
706
|
+
const excluded = new Set(excludedHostNames);
|
|
707
|
+
const retained = [];
|
|
708
|
+
for (const hostName of SUPPORTED_INSTALL_SKILL_HOSTS) {
|
|
709
|
+
if (excluded.has(hostName)) continue;
|
|
710
|
+
let markerPath;
|
|
711
|
+
try {
|
|
712
|
+
markerPath = resolveFlywheelInstalledMarkerPath(
|
|
713
|
+
process.cwd(),
|
|
714
|
+
hostName,
|
|
715
|
+
scope,
|
|
716
|
+
);
|
|
717
|
+
} catch {
|
|
718
|
+
// Host isn't registered with the flywheel skill installer; no marker
|
|
719
|
+
// to consult, nothing to retain.
|
|
720
|
+
continue;
|
|
721
|
+
}
|
|
722
|
+
// eslint-disable-next-line no-await-in-loop
|
|
723
|
+
const markerExists = await pathExists(markerPath);
|
|
724
|
+
if (markerExists) {
|
|
725
|
+
retained.push(hostName);
|
|
724
726
|
}
|
|
725
|
-
|
|
727
|
+
}
|
|
728
|
+
return retained;
|
|
726
729
|
}
|
|
727
730
|
|
|
728
731
|
async function findFlywheelServerNamesOnHost(hostName, scope) {
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
732
|
+
// Mirror setup's prior-mode detector: walk every MCP entry on the host and
|
|
733
|
+
// keep those whose URL is Flywheel-identifying (hostname contains "flywheel"
|
|
734
|
+
// or path === /mcp-server with a matching target origin). Uninstall must
|
|
735
|
+
// catch renamed or drifted entries (e.g. a non-default TOML section name
|
|
736
|
+
// under `[mcp_servers.*]`) that setup already detects; otherwise a user
|
|
737
|
+
// whose host has a non-default entry name is stuck between setup ("already
|
|
738
|
+
// installed") and uninstall ("not configured").
|
|
739
|
+
return await findFlywheelMcpEntryNames({ hostName, scope }).catch(() => []);
|
|
737
740
|
}
|
|
738
741
|
|
|
739
742
|
async function resolveUninstallServerNamesForHost(
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
+
hostName,
|
|
744
|
+
scope,
|
|
745
|
+
{ explicitServerName },
|
|
743
746
|
) {
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
747
|
+
if (explicitServerName) {
|
|
748
|
+
const configured = await isAlreadyConfigured(
|
|
749
|
+
hostName,
|
|
750
|
+
scope,
|
|
751
|
+
explicitServerName,
|
|
752
|
+
).catch(() => false);
|
|
753
|
+
return configured ? [explicitServerName] : [];
|
|
754
|
+
}
|
|
755
|
+
return await findFlywheelServerNamesOnHost(hostName, scope);
|
|
753
756
|
}
|
|
754
757
|
|
|
755
758
|
async function isConfiguredForUninstallScope(
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
+
hostName,
|
|
760
|
+
scope,
|
|
761
|
+
{ explicitServerName },
|
|
759
762
|
) {
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
763
|
+
const scopes = scopesFromUninstallScope(scope);
|
|
764
|
+
for (const singleScope of scopes) {
|
|
765
|
+
// eslint-disable-next-line no-await-in-loop
|
|
766
|
+
const targets = await resolveUninstallServerNamesForHost(
|
|
767
|
+
hostName,
|
|
768
|
+
singleScope,
|
|
769
|
+
{ explicitServerName },
|
|
770
|
+
);
|
|
771
|
+
if (targets.length > 0) return true;
|
|
772
|
+
// Skill-only hosts and CLI-mode MCP-capable hosts never write an MCP
|
|
773
|
+
// entry, so the sweep above finds nothing for them. Fall back to the
|
|
774
|
+
// install marker: if this host wrote its own ownership marker in the
|
|
775
|
+
// selected scope, it IS configured for the purposes of the uninstall
|
|
776
|
+
// prompt.
|
|
777
|
+
if (SUPPORTED_INSTALL_SKILL_HOSTS.includes(hostName)) {
|
|
778
|
+
try {
|
|
779
|
+
const markerPath = resolveFlywheelInstalledMarkerPath(
|
|
780
|
+
process.cwd(),
|
|
781
|
+
hostName,
|
|
782
|
+
singleScope,
|
|
767
783
|
);
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
//
|
|
772
|
-
|
|
773
|
-
// prompt.
|
|
774
|
-
if (SUPPORTED_INSTALL_SKILL_HOSTS.includes(hostName)) {
|
|
775
|
-
try {
|
|
776
|
-
const markerPath = resolveFlywheelInstalledMarkerPath(
|
|
777
|
-
process.cwd(),
|
|
778
|
-
hostName,
|
|
779
|
-
singleScope,
|
|
780
|
-
);
|
|
781
|
-
// eslint-disable-next-line no-await-in-loop
|
|
782
|
-
if (await pathExists(markerPath)) return true;
|
|
783
|
-
} catch {
|
|
784
|
-
// Host isn't registered with the skill installer; nothing to check.
|
|
785
|
-
}
|
|
786
|
-
}
|
|
784
|
+
// eslint-disable-next-line no-await-in-loop
|
|
785
|
+
if (await pathExists(markerPath)) return true;
|
|
786
|
+
} catch {
|
|
787
|
+
// Host isn't registered with the skill installer; nothing to check.
|
|
788
|
+
}
|
|
787
789
|
}
|
|
788
|
-
|
|
790
|
+
}
|
|
791
|
+
return false;
|
|
789
792
|
}
|
|
790
793
|
|
|
791
794
|
/**
|
|
@@ -796,23 +799,23 @@ async function isConfiguredForUninstallScope(
|
|
|
796
799
|
* prompt even though they write no MCP entry.
|
|
797
800
|
*/
|
|
798
801
|
export async function isHostConfiguredForUninstall({
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
+
hostName,
|
|
803
|
+
scope = "project",
|
|
804
|
+
serverName = SERVER_NAME,
|
|
802
805
|
} = {}) {
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
806
|
+
// Mirror `runUninstallCommand`'s derivation: only treat the caller's
|
|
807
|
+
// `serverName` as "explicit" when it differs from the package default.
|
|
808
|
+
// An explicit name short-circuits the Flywheel-identifying sweep in
|
|
809
|
+
// `resolveUninstallServerNamesForHost`, which the default-named case
|
|
810
|
+
// needs to run so drifted entries (and the marker fallback for
|
|
811
|
+
// skill-only / CLI-mode hosts) are reachable.
|
|
812
|
+
const explicitServerName =
|
|
813
|
+
typeof serverName === "string" &&
|
|
814
|
+
serverName.length > 0 &&
|
|
815
|
+
serverName !== SERVER_NAME
|
|
816
|
+
? serverName
|
|
817
|
+
: null;
|
|
818
|
+
return isConfiguredForUninstallScope(hostName, scope, { explicitServerName });
|
|
816
819
|
}
|
|
817
820
|
|
|
818
821
|
/**
|
|
@@ -830,380 +833,380 @@ export async function isHostConfiguredForUninstall({
|
|
|
830
833
|
* without pre-filtering.
|
|
831
834
|
*/
|
|
832
835
|
export async function cleanupHostInstallMarkers({
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
+
cwd = process.cwd(),
|
|
837
|
+
scopes = ["project"],
|
|
838
|
+
hostNames = [],
|
|
836
839
|
} = {}) {
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
}
|
|
840
|
+
for (const singleScope of scopes) {
|
|
841
|
+
for (const hostName of hostNames) {
|
|
842
|
+
let markerPath;
|
|
843
|
+
try {
|
|
844
|
+
markerPath = resolveFlywheelInstalledMarkerPath(
|
|
845
|
+
cwd,
|
|
846
|
+
hostName,
|
|
847
|
+
singleScope,
|
|
848
|
+
);
|
|
849
|
+
} catch {
|
|
850
|
+
continue;
|
|
851
|
+
}
|
|
852
|
+
// eslint-disable-next-line no-await-in-loop
|
|
853
|
+
await rm(markerPath, { force: true });
|
|
852
854
|
}
|
|
855
|
+
}
|
|
853
856
|
}
|
|
854
857
|
|
|
855
858
|
async function promptUninstallScope(defaultScope) {
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
859
|
+
try {
|
|
860
|
+
return await select({
|
|
861
|
+
message: "Which scope do you want to uninstall from?",
|
|
862
|
+
choices: [
|
|
863
|
+
{ name: "All (global and project)", value: "all" },
|
|
864
|
+
{ name: "Global", value: "global" },
|
|
865
|
+
{ name: "Project", value: "project" },
|
|
866
|
+
],
|
|
867
|
+
default: defaultScope,
|
|
868
|
+
theme: CHECKBOX_THEME,
|
|
869
|
+
});
|
|
870
|
+
} catch {
|
|
871
|
+
return null;
|
|
872
|
+
}
|
|
870
873
|
}
|
|
871
874
|
|
|
872
875
|
async function promptUninstallHosts(scope, { explicitServerName }) {
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
876
|
+
const choices = await Promise.all(
|
|
877
|
+
ALL_HOST_NAMES.map(async (hostName) => {
|
|
878
|
+
const configured = await isConfiguredForUninstallScope(hostName, scope, {
|
|
879
|
+
explicitServerName,
|
|
880
|
+
});
|
|
881
|
+
return {
|
|
882
|
+
name: SETUP_HOST_NAMES[hostName],
|
|
883
|
+
value: hostName,
|
|
884
|
+
checked: configured,
|
|
885
|
+
disabled: configured ? false : "(not configured)",
|
|
886
|
+
};
|
|
887
|
+
}),
|
|
888
|
+
);
|
|
889
|
+
|
|
890
|
+
if (choices.every((choice) => Boolean(choice.disabled))) {
|
|
891
|
+
log.info("Flywheel is not configured for the selected scope.");
|
|
892
|
+
return null;
|
|
893
|
+
}
|
|
894
|
+
|
|
895
|
+
try {
|
|
896
|
+
return await checkbox({
|
|
897
|
+
message: "Which hosts do you want to uninstall?",
|
|
898
|
+
choices,
|
|
899
|
+
loop: false,
|
|
900
|
+
theme: CHECKBOX_THEME,
|
|
901
|
+
validate: (selected) =>
|
|
902
|
+
selected.length > 0 || "Select at least one host.",
|
|
903
|
+
});
|
|
904
|
+
} catch {
|
|
905
|
+
return null;
|
|
906
|
+
}
|
|
907
|
+
}
|
|
886
908
|
|
|
887
|
-
|
|
888
|
-
|
|
909
|
+
async function resolveUninstallTargets(options, { explicitServerName }) {
|
|
910
|
+
const explicitHostsFromFlags = selectedHostsFromOptions(options);
|
|
911
|
+
const explicitHostsFromList =
|
|
912
|
+
explicitHostsFromFlags.length === 0 ? parseHostsList(options.hosts) : [];
|
|
913
|
+
const hasExplicitHosts =
|
|
914
|
+
explicitHostsFromFlags.length > 0 || explicitHostsFromList.length > 0;
|
|
915
|
+
const hasExplicitScope =
|
|
916
|
+
typeof options.scope === "string" && options.scope.trim().length > 0;
|
|
917
|
+
|
|
918
|
+
let scope = parseUninstallScope(options.scope || "all");
|
|
919
|
+
let hosts =
|
|
920
|
+
explicitHostsFromFlags.length > 0
|
|
921
|
+
? explicitHostsFromFlags
|
|
922
|
+
: explicitHostsFromList.length > 0
|
|
923
|
+
? explicitHostsFromList
|
|
924
|
+
: [...ALL_HOST_NAMES];
|
|
925
|
+
|
|
926
|
+
if (!options.yes) {
|
|
927
|
+
if (!hasExplicitScope) {
|
|
928
|
+
log.blank();
|
|
929
|
+
const selectedScope = await promptUninstallScope(scope);
|
|
930
|
+
if (!selectedScope) {
|
|
931
|
+
log.warn("Uninstall cancelled");
|
|
889
932
|
return null;
|
|
933
|
+
}
|
|
934
|
+
scope = selectedScope;
|
|
890
935
|
}
|
|
891
936
|
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
validate: (selected) =>
|
|
899
|
-
selected.length > 0 || "Select at least one host.",
|
|
900
|
-
});
|
|
901
|
-
} catch {
|
|
937
|
+
if (!hasExplicitHosts) {
|
|
938
|
+
const selectedHosts = await promptUninstallHosts(scope, {
|
|
939
|
+
explicitServerName,
|
|
940
|
+
});
|
|
941
|
+
if (!selectedHosts) {
|
|
942
|
+
log.warn("Uninstall cancelled");
|
|
902
943
|
return null;
|
|
944
|
+
}
|
|
945
|
+
hosts = selectedHosts;
|
|
903
946
|
}
|
|
904
|
-
}
|
|
905
|
-
|
|
906
|
-
async function resolveUninstallTargets(options, { explicitServerName }) {
|
|
907
|
-
const explicitHostsFromFlags = selectedHostsFromOptions(options);
|
|
908
|
-
const explicitHostsFromList =
|
|
909
|
-
explicitHostsFromFlags.length === 0 ? parseHostsList(options.hosts) : [];
|
|
910
|
-
const hasExplicitHosts =
|
|
911
|
-
explicitHostsFromFlags.length > 0 || explicitHostsFromList.length > 0;
|
|
912
|
-
const hasExplicitScope =
|
|
913
|
-
typeof options.scope === "string" && options.scope.trim().length > 0;
|
|
914
|
-
|
|
915
|
-
let scope = parseUninstallScope(options.scope || "all");
|
|
916
|
-
let hosts =
|
|
917
|
-
explicitHostsFromFlags.length > 0
|
|
918
|
-
? explicitHostsFromFlags
|
|
919
|
-
: explicitHostsFromList.length > 0
|
|
920
|
-
? explicitHostsFromList
|
|
921
|
-
: [...ALL_HOST_NAMES];
|
|
922
|
-
|
|
923
|
-
if (!options.yes) {
|
|
924
|
-
if (!hasExplicitScope) {
|
|
925
|
-
log.blank();
|
|
926
|
-
const selectedScope = await promptUninstallScope(scope);
|
|
927
|
-
if (!selectedScope) {
|
|
928
|
-
log.warn("Uninstall cancelled");
|
|
929
|
-
return null;
|
|
930
|
-
}
|
|
931
|
-
scope = selectedScope;
|
|
932
|
-
}
|
|
933
|
-
|
|
934
|
-
if (!hasExplicitHosts) {
|
|
935
|
-
const selectedHosts = await promptUninstallHosts(scope, {
|
|
936
|
-
explicitServerName,
|
|
937
|
-
});
|
|
938
|
-
if (!selectedHosts) {
|
|
939
|
-
log.warn("Uninstall cancelled");
|
|
940
|
-
return null;
|
|
941
|
-
}
|
|
942
|
-
hosts = selectedHosts;
|
|
943
|
-
}
|
|
944
|
-
}
|
|
947
|
+
}
|
|
945
948
|
|
|
946
|
-
|
|
949
|
+
return { scope, hosts };
|
|
947
950
|
}
|
|
948
951
|
|
|
949
952
|
async function removeHostConfig(hostName, scope, serverName) {
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
if (host.mcp.configType === "toml") {
|
|
962
|
-
const result = await removeCodexTomlServer({
|
|
963
|
-
filePath,
|
|
964
|
-
serverName,
|
|
965
|
-
});
|
|
966
|
-
return {
|
|
967
|
-
host: host.displayName,
|
|
968
|
-
scope,
|
|
969
|
-
filePath,
|
|
970
|
-
status: result.changed ? "removed" : "not present",
|
|
971
|
-
};
|
|
972
|
-
}
|
|
953
|
+
const host = getHost(hostName);
|
|
954
|
+
if (isSkillOnlyHost(host)) {
|
|
955
|
+
return {
|
|
956
|
+
host: host.displayName,
|
|
957
|
+
scope,
|
|
958
|
+
filePath: null,
|
|
959
|
+
status: "not present",
|
|
960
|
+
};
|
|
961
|
+
}
|
|
962
|
+
const filePath = await resolveMcpPath(mcpCandidatesForScope(host, scope));
|
|
973
963
|
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
const next = removeJsonServerEntry({
|
|
979
|
-
config: current,
|
|
980
|
-
configKey: host.mcp.configKey,
|
|
981
|
-
serverName,
|
|
964
|
+
if (host.mcp.configType === "toml") {
|
|
965
|
+
const result = await removeCodexTomlServer({
|
|
966
|
+
filePath,
|
|
967
|
+
serverName,
|
|
982
968
|
});
|
|
983
|
-
if (next.changed) {
|
|
984
|
-
if (host.mcp.configType === "yaml") {
|
|
985
|
-
await writeYamlConfig(filePath, next.config);
|
|
986
|
-
} else {
|
|
987
|
-
await writeJsonConfig(filePath, next.config);
|
|
988
|
-
}
|
|
989
|
-
}
|
|
990
969
|
return {
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
970
|
+
host: host.displayName,
|
|
971
|
+
scope,
|
|
972
|
+
filePath,
|
|
973
|
+
status: result.changed ? "removed" : "not present",
|
|
995
974
|
};
|
|
975
|
+
}
|
|
976
|
+
|
|
977
|
+
const current =
|
|
978
|
+
host.mcp.configType === "yaml"
|
|
979
|
+
? await readYamlConfig(filePath)
|
|
980
|
+
: await readJsonConfig(filePath);
|
|
981
|
+
const next = removeJsonServerEntry({
|
|
982
|
+
config: current,
|
|
983
|
+
configKey: host.mcp.configKey,
|
|
984
|
+
serverName,
|
|
985
|
+
});
|
|
986
|
+
if (next.changed) {
|
|
987
|
+
if (host.mcp.configType === "yaml") {
|
|
988
|
+
await writeYamlConfig(filePath, next.config);
|
|
989
|
+
} else {
|
|
990
|
+
await writeJsonConfig(filePath, next.config);
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
return {
|
|
994
|
+
host: host.displayName,
|
|
995
|
+
scope,
|
|
996
|
+
filePath,
|
|
997
|
+
status: next.changed ? "removed" : "not present",
|
|
998
|
+
};
|
|
996
999
|
}
|
|
997
1000
|
|
|
998
1001
|
async function runUninstallCommand(options) {
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
});
|
|
1045
|
-
continue;
|
|
1046
|
-
}
|
|
1047
|
-
for (const targetName of targetNames) {
|
|
1048
|
-
// eslint-disable-next-line no-await-in-loop
|
|
1049
|
-
mcpResults.push(await removeHostConfig(host, singleScope, targetName));
|
|
1050
|
-
}
|
|
1051
|
-
}
|
|
1052
|
-
}
|
|
1053
|
-
mcpSpinner.succeed("MCP uninstall complete");
|
|
1054
|
-
|
|
1055
|
-
const { supportedHosts, unsupportedHosts } =
|
|
1056
|
-
partitionInstallSkillHosts(hosts);
|
|
1057
|
-
const bundledSkillResults = [];
|
|
1058
|
-
let bundledSkillNames = [];
|
|
1059
|
-
|
|
1060
|
-
if (supportedHosts.length > 0) {
|
|
1061
|
-
const packageRoot = resolvePackageRoot();
|
|
1062
|
-
bundledSkillNames = await listBundledSkills(packageRoot);
|
|
1063
|
-
if (bundledSkillNames.length > 0) {
|
|
1064
|
-
const skillSpinner = ora("Removing Flywheel bundled skills...").start();
|
|
1065
|
-
for (const singleScope of scopes) {
|
|
1066
|
-
// Retain any skill directory still claimed by a non-uninstalled host.
|
|
1067
|
-
// Two signals combine: (a) MCP-backed hosts whose Flywheel entries
|
|
1068
|
-
// survived the MCP-removal pass above, and (b) any host with bundled
|
|
1069
|
-
// skill artifacts still on disk (including skill-only hosts like
|
|
1070
|
-
// universal/antigravity, which never advertise themselves via MCP
|
|
1071
|
-
// entries). Without (b), uninstalling one MCP host would silently
|
|
1072
|
-
// wipe a shared `.agents/skills/<skill>/` that another host still
|
|
1073
|
-
// relies on.
|
|
1074
|
-
// eslint-disable-next-line no-await-in-loop
|
|
1075
|
-
const mcpRetained = await resolveHostsWithRemainingFlywheelMcpEntries({
|
|
1076
|
-
scope: singleScope,
|
|
1077
|
-
});
|
|
1078
|
-
// eslint-disable-next-line no-await-in-loop
|
|
1079
|
-
const skillOnlyRetained = await resolveSkillOnlyHostsRetainingArtifacts(
|
|
1080
|
-
{
|
|
1081
|
-
scope: singleScope,
|
|
1082
|
-
excludedHostNames: supportedHosts,
|
|
1083
|
-
},
|
|
1084
|
-
);
|
|
1085
|
-
const configuredRetainHostNames = [
|
|
1086
|
-
...new Set([...mcpRetained, ...skillOnlyRetained]),
|
|
1087
|
-
];
|
|
1088
|
-
skillSpinner.text = `Removing bundled skills from ${supportedHosts.length} host(s) (${singleScope})...`;
|
|
1089
|
-
// eslint-disable-next-line no-await-in-loop
|
|
1090
|
-
bundledSkillResults.push(
|
|
1091
|
-
...(await removeInstalledSkillsForHosts({
|
|
1092
|
-
projectRoot: process.cwd(),
|
|
1093
|
-
hostNames: supportedHosts,
|
|
1094
|
-
retainHostNames: configuredRetainHostNames,
|
|
1095
|
-
scope: singleScope,
|
|
1096
|
-
skillNames: bundledSkillNames,
|
|
1097
|
-
})),
|
|
1098
|
-
);
|
|
1099
|
-
}
|
|
1100
|
-
skillSpinner.succeed("Bundled skill uninstall complete");
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
// Install-marker cleanup runs independently of bundled-skill discovery.
|
|
1104
|
-
// A broken or trimmed package (missing `skills/`) can leave
|
|
1105
|
-
// `bundledSkillNames` empty — the skill-removal pass above legitimately
|
|
1106
|
-
// no-ops in that case, but the ownership markers must still be cleared,
|
|
1107
|
-
// otherwise a later `uninstall`/`setup` would treat the uninstalled
|
|
1108
|
-
// host as still owning shared skill dirs (wrong retention) or as a
|
|
1109
|
-
// prior CLI install (false cross-mode conflict).
|
|
1110
|
-
await cleanupHostInstallMarkers({
|
|
1111
|
-
cwd: process.cwd(),
|
|
1112
|
-
scopes,
|
|
1113
|
-
hostNames: supportedHosts,
|
|
1002
|
+
const explicitServerName =
|
|
1003
|
+
typeof options.name === "string" && options.name.trim().length > 0
|
|
1004
|
+
? normalizeServerName(options.name)
|
|
1005
|
+
: null;
|
|
1006
|
+
const resolved = await resolveUninstallTargets(options, {
|
|
1007
|
+
explicitServerName,
|
|
1008
|
+
});
|
|
1009
|
+
if (!resolved) return;
|
|
1010
|
+
const { scope, hosts } = resolved;
|
|
1011
|
+
const scopes = scopesFromUninstallScope(scope);
|
|
1012
|
+
|
|
1013
|
+
const mcpSpinner = ora("Removing Flywheel MCP entries...").start();
|
|
1014
|
+
const mcpResults = [];
|
|
1015
|
+
for (const singleScope of scopes) {
|
|
1016
|
+
for (const host of hosts) {
|
|
1017
|
+
mcpSpinner.text = `Removing from ${getHost(host).displayName} (${singleScope})...`;
|
|
1018
|
+
// Resolve the concrete server name(s) to remove at the host/scope level.
|
|
1019
|
+
// When --name was not given, this iterates every Flywheel-identifying
|
|
1020
|
+
// entry (matching setup's prior-mode detector) so renamed or drifted
|
|
1021
|
+
// entries (non-default TOML section names under `[mcp_servers.*]`) are
|
|
1022
|
+
// actually cleared.
|
|
1023
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1024
|
+
const targetNames = await resolveUninstallServerNamesForHost(
|
|
1025
|
+
host,
|
|
1026
|
+
singleScope,
|
|
1027
|
+
{ explicitServerName },
|
|
1028
|
+
);
|
|
1029
|
+
if (targetNames.length === 0) {
|
|
1030
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1031
|
+
const hostForDisplay = getHost(host);
|
|
1032
|
+
// Skill-only hosts (universal, antigravity) have no MCP surface
|
|
1033
|
+
// at all — `host.mcp` is null, so dereferencing `projectPaths` via
|
|
1034
|
+
// `mcpCandidatesForScope` throws. Report the absence without
|
|
1035
|
+
// consulting a path that doesn't exist for them.
|
|
1036
|
+
const filePath = isSkillOnlyHost(hostForDisplay)
|
|
1037
|
+
? null
|
|
1038
|
+
: // eslint-disable-next-line no-await-in-loop
|
|
1039
|
+
await resolveMcpPath(
|
|
1040
|
+
mcpCandidatesForScope(hostForDisplay, singleScope),
|
|
1041
|
+
);
|
|
1042
|
+
mcpResults.push({
|
|
1043
|
+
host: hostForDisplay.displayName,
|
|
1044
|
+
scope: singleScope,
|
|
1045
|
+
filePath,
|
|
1046
|
+
status: "not present",
|
|
1114
1047
|
});
|
|
1048
|
+
continue;
|
|
1049
|
+
}
|
|
1050
|
+
for (const targetName of targetNames) {
|
|
1051
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1052
|
+
mcpResults.push(await removeHostConfig(host, singleScope, targetName));
|
|
1053
|
+
}
|
|
1115
1054
|
}
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
);
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1055
|
+
}
|
|
1056
|
+
mcpSpinner.succeed("MCP uninstall complete");
|
|
1057
|
+
|
|
1058
|
+
const { supportedHosts, unsupportedHosts } =
|
|
1059
|
+
partitionInstallSkillHosts(hosts);
|
|
1060
|
+
const bundledSkillResults = [];
|
|
1061
|
+
let bundledSkillNames = [];
|
|
1062
|
+
|
|
1063
|
+
if (supportedHosts.length > 0) {
|
|
1064
|
+
const packageRoot = resolvePackageRoot();
|
|
1065
|
+
bundledSkillNames = await listBundledSkills(packageRoot);
|
|
1066
|
+
if (bundledSkillNames.length > 0) {
|
|
1067
|
+
const skillSpinner = ora("Removing Flywheel bundled skills...").start();
|
|
1068
|
+
for (const singleScope of scopes) {
|
|
1069
|
+
// Retain any skill directory still claimed by a non-uninstalled host.
|
|
1070
|
+
// Two signals combine: (a) MCP-backed hosts whose Flywheel entries
|
|
1071
|
+
// survived the MCP-removal pass above, and (b) any host with bundled
|
|
1072
|
+
// skill artifacts still on disk (including skill-only hosts like
|
|
1073
|
+
// universal/antigravity, which never advertise themselves via MCP
|
|
1074
|
+
// entries). Without (b), uninstalling one MCP host would silently
|
|
1075
|
+
// wipe a shared `.agents/skills/<skill>/` that another host still
|
|
1076
|
+
// relies on.
|
|
1077
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1078
|
+
const mcpRetained = await resolveHostsWithRemainingFlywheelMcpEntries({
|
|
1079
|
+
scope: singleScope,
|
|
1080
|
+
});
|
|
1081
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1082
|
+
const skillOnlyRetained = await resolveSkillOnlyHostsRetainingArtifacts(
|
|
1083
|
+
{
|
|
1084
|
+
scope: singleScope,
|
|
1085
|
+
excludedHostNames: supportedHosts,
|
|
1086
|
+
},
|
|
1087
|
+
);
|
|
1088
|
+
const configuredRetainHostNames = [
|
|
1089
|
+
...new Set([...mcpRetained, ...skillOnlyRetained]),
|
|
1090
|
+
];
|
|
1091
|
+
skillSpinner.text = `Removing bundled skills from ${supportedHosts.length} host(s) (${singleScope})...`;
|
|
1092
|
+
// eslint-disable-next-line no-await-in-loop
|
|
1093
|
+
bundledSkillResults.push(
|
|
1094
|
+
...(await removeInstalledSkillsForHosts({
|
|
1095
|
+
projectRoot: process.cwd(),
|
|
1096
|
+
hostNames: supportedHosts,
|
|
1097
|
+
retainHostNames: configuredRetainHostNames,
|
|
1098
|
+
scope: singleScope,
|
|
1099
|
+
skillNames: bundledSkillNames,
|
|
1100
|
+
})),
|
|
1101
|
+
);
|
|
1102
|
+
}
|
|
1103
|
+
skillSpinner.succeed("Bundled skill uninstall complete");
|
|
1127
1104
|
}
|
|
1128
1105
|
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1106
|
+
// Install-marker cleanup runs independently of bundled-skill discovery.
|
|
1107
|
+
// A broken or trimmed package (missing `skills/`) can leave
|
|
1108
|
+
// `bundledSkillNames` empty — the skill-removal pass above legitimately
|
|
1109
|
+
// no-ops in that case, but the ownership markers must still be cleared,
|
|
1110
|
+
// otherwise a later `uninstall`/`setup` would treat the uninstalled
|
|
1111
|
+
// host as still owning shared skill dirs (wrong retention) or as a
|
|
1112
|
+
// prior CLI install (false cross-mode conflict).
|
|
1113
|
+
await cleanupHostInstallMarkers({
|
|
1114
|
+
cwd: process.cwd(),
|
|
1115
|
+
scopes,
|
|
1116
|
+
hostNames: supportedHosts,
|
|
1117
|
+
});
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
log.blank();
|
|
1121
|
+
log.plain(
|
|
1122
|
+
pc.green("✔ Flywheel uninstall complete (MCP entries and bundled skills)"),
|
|
1123
|
+
);
|
|
1124
|
+
log.blank();
|
|
1125
|
+
for (const result of mcpResults) {
|
|
1126
|
+
const icon = result.status === "removed" ? pc.green("-") : pc.dim("~");
|
|
1127
|
+
log.plain(` ${pc.bold(result.host)} ${pc.dim(`(${result.scope})`)}`);
|
|
1128
|
+
log.plain(` ${icon} ${result.status}`);
|
|
1129
|
+
log.plain(` ${pc.dim(result.filePath)}`);
|
|
1130
|
+
}
|
|
1131
|
+
|
|
1132
|
+
log.blank();
|
|
1133
|
+
log.plain(` ${pc.bold("Bundled skills")}`);
|
|
1134
|
+
if (supportedHosts.length === 0) {
|
|
1135
|
+
log.plain(` ${pc.dim("~")} no skill-supporting hosts selected`);
|
|
1136
|
+
} else if (bundledSkillNames.length === 0) {
|
|
1137
|
+
log.plain(` ${pc.dim("~")} no bundled skills found in this package`);
|
|
1138
|
+
} else {
|
|
1139
|
+
const groupedSkillResults = new Map();
|
|
1140
|
+
for (const skillResult of bundledSkillResults) {
|
|
1141
|
+
for (const hostName of skillResult.hostNames) {
|
|
1142
|
+
const groupingKey = `${hostName}:${skillResult.scope}`;
|
|
1143
|
+
const existingGroup = groupedSkillResults.get(groupingKey);
|
|
1144
|
+
if (existingGroup) {
|
|
1145
|
+
existingGroup.entries.push(skillResult);
|
|
1146
|
+
continue;
|
|
1151
1147
|
}
|
|
1148
|
+
groupedSkillResults.set(groupingKey, {
|
|
1149
|
+
hostName,
|
|
1150
|
+
scope: skillResult.scope,
|
|
1151
|
+
entries: [skillResult],
|
|
1152
|
+
});
|
|
1153
|
+
}
|
|
1154
|
+
}
|
|
1152
1155
|
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1156
|
+
const sortedGroups = [...groupedSkillResults.values()].sort(
|
|
1157
|
+
(left, right) => {
|
|
1158
|
+
const leftKey = `${left.hostName}:${left.scope}`;
|
|
1159
|
+
const rightKey = `${right.hostName}:${right.scope}`;
|
|
1160
|
+
return leftKey.localeCompare(rightKey);
|
|
1161
|
+
},
|
|
1162
|
+
);
|
|
1163
|
+
for (const groupedResult of sortedGroups) {
|
|
1164
|
+
log.plain(
|
|
1165
|
+
` ${pc.bold(getHost(groupedResult.hostName).displayName)} ${pc.dim(`(${groupedResult.scope})`)}`,
|
|
1166
|
+
);
|
|
1167
|
+
for (const entry of groupedResult.entries) {
|
|
1168
|
+
const icon =
|
|
1169
|
+
entry.status === "removed"
|
|
1170
|
+
? pc.green("-")
|
|
1171
|
+
: entry.status === "retained"
|
|
1172
|
+
? pc.yellow("~")
|
|
1173
|
+
: pc.dim("~");
|
|
1174
|
+
const retainedSuffix =
|
|
1175
|
+
entry.status === "retained" && Array.isArray(entry.retainedHostNames)
|
|
1176
|
+
? ` (shared with configured host(s): ${entry.retainedHostNames.join(", ")})`
|
|
1177
|
+
: "";
|
|
1178
|
+
log.plain(
|
|
1179
|
+
` ${icon} ${entry.status}${retainedSuffix}: ${entry.skillNames.join(", ")}`,
|
|
1159
1180
|
);
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
` ${pc.bold(getHost(groupedResult.hostName).displayName)} ${pc.dim(`(${groupedResult.scope})`)}`,
|
|
1163
|
-
);
|
|
1164
|
-
for (const entry of groupedResult.entries) {
|
|
1165
|
-
const icon =
|
|
1166
|
-
entry.status === "removed"
|
|
1167
|
-
? pc.green("-")
|
|
1168
|
-
: entry.status === "retained"
|
|
1169
|
-
? pc.yellow("~")
|
|
1170
|
-
: pc.dim("~");
|
|
1171
|
-
const retainedSuffix =
|
|
1172
|
-
entry.status === "retained" && Array.isArray(entry.retainedHostNames)
|
|
1173
|
-
? ` (shared with configured host(s): ${entry.retainedHostNames.join(", ")})`
|
|
1174
|
-
: "";
|
|
1175
|
-
log.plain(
|
|
1176
|
-
` ${icon} ${entry.status}${retainedSuffix}: ${entry.skillNames.join(", ")}`,
|
|
1177
|
-
);
|
|
1178
|
-
log.plain(` ${pc.dim(entry.installedSkillDir)}`);
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
+
log.plain(` ${pc.dim(entry.installedSkillDir)}`);
|
|
1182
|
+
}
|
|
1181
1183
|
}
|
|
1184
|
+
}
|
|
1182
1185
|
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
}
|
|
1186
|
+
for (const unsupportedHostName of unsupportedHosts) {
|
|
1187
|
+
for (const singleScope of scopes) {
|
|
1188
|
+
log.plain(
|
|
1189
|
+
` ${pc.bold(getHost(unsupportedHostName).displayName)} ${pc.dim(`(${singleScope})`)}`,
|
|
1190
|
+
);
|
|
1191
|
+
log.plain(
|
|
1192
|
+
` ${pc.dim("~")} skill uninstall not supported (MCP-only host)`,
|
|
1193
|
+
);
|
|
1192
1194
|
}
|
|
1193
|
-
|
|
1195
|
+
}
|
|
1196
|
+
log.blank();
|
|
1194
1197
|
}
|
|
1195
1198
|
|
|
1196
1199
|
function buildProgram({ exitOverride = false } = {}) {
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1200
|
+
const program = new Command();
|
|
1201
|
+
if (exitOverride) {
|
|
1202
|
+
program.exitOverride();
|
|
1203
|
+
}
|
|
1204
|
+
program
|
|
1205
|
+
.name("flywheel")
|
|
1206
|
+
.description("Flywheel setup CLI")
|
|
1207
|
+
.addHelpText(
|
|
1208
|
+
"after",
|
|
1209
|
+
`
|
|
1207
1210
|
Examples:
|
|
1208
1211
|
${pc.green("npx --yes @paradigma-inc/flywheel setup --mode mcp")}
|
|
1209
1212
|
${pc.green("npx --yes @paradigma-inc/flywheel setup --mode mcp --install-skill")}
|
|
@@ -1213,28 +1216,28 @@ Examples:
|
|
|
1213
1216
|
${pc.green("npx --yes @paradigma-inc/flywheel setup --mode mcp --yes --codex --claude --cursor")}
|
|
1214
1217
|
${pc.green("npx --yes @paradigma-inc/flywheel uninstall --yes --scope all")}
|
|
1215
1218
|
`,
|
|
1216
|
-
|
|
1219
|
+
);
|
|
1217
1220
|
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1221
|
+
const completionCommand = program
|
|
1222
|
+
.command("completion")
|
|
1223
|
+
.description("Generate a shell completion script")
|
|
1224
|
+
.argument("[shell]", "Shell to generate completions for")
|
|
1225
|
+
.addHelpText(
|
|
1226
|
+
"before",
|
|
1227
|
+
`${pc.bold(pc.cyan("✻ Flywheel Completion"))}
|
|
1225
1228
|
|
|
1226
1229
|
Generate shell completion scripts from the public Flywheel Usage spec.
|
|
1227
1230
|
Supported shells: ${COMPLETION_SHELL_CHOICES.join(", ")}.
|
|
1228
1231
|
Requires the official Usage CLI executable on PATH.
|
|
1229
1232
|
`,
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1233
|
+
)
|
|
1234
|
+
.option(
|
|
1235
|
+
"--include-bash-completion-lib",
|
|
1236
|
+
"Include Usage's bash completion library in bash output",
|
|
1237
|
+
)
|
|
1238
|
+
.addHelpText(
|
|
1239
|
+
"after",
|
|
1240
|
+
`
|
|
1238
1241
|
Usage CLI prerequisite:
|
|
1239
1242
|
${pc.green("mise use -g usage")}
|
|
1240
1243
|
${pc.green("brew install usage")}
|
|
@@ -1250,38 +1253,38 @@ Examples:
|
|
|
1250
1253
|
${pc.green("flywheel completion nu > ~/.config/nushell/autoload/flywheel.nu")}
|
|
1251
1254
|
${pc.green("flywheel completion nushell > ~/.config/nushell/autoload/flywheel.nu")}
|
|
1252
1255
|
`,
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1256
|
+
)
|
|
1257
|
+
.action(async (shell, options) => {
|
|
1258
|
+
if (!shell) {
|
|
1259
|
+
if (exitOverride) {
|
|
1260
|
+
completionCommand.outputHelp();
|
|
1261
|
+
return;
|
|
1262
|
+
}
|
|
1263
|
+
completionCommand.help();
|
|
1264
|
+
return;
|
|
1265
|
+
}
|
|
1266
|
+
await runCompletionCommand(shell, options);
|
|
1267
|
+
});
|
|
1265
1268
|
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1269
|
+
completionCommand
|
|
1270
|
+
.command("install <shell>")
|
|
1271
|
+
.description("Install generated shell completion scripts")
|
|
1272
|
+
.option("--dir <path>", "Override completion script destination directory")
|
|
1273
|
+
.option("--force", "Replace an existing unmarked destination file")
|
|
1274
|
+
.option("--dry-run", "Print planned changes without writing files")
|
|
1275
|
+
.option("--update-profile", "Allow shell startup/profile file updates")
|
|
1276
|
+
.option("-y, --yes", "Skip confirmation prompts")
|
|
1277
|
+
.addHelpText(
|
|
1278
|
+
"before",
|
|
1279
|
+
`${pc.bold(pc.cyan("✻ Flywheel Completion Install"))}
|
|
1277
1280
|
|
|
1278
1281
|
Install generated Flywheel shell completions to user-level locations.
|
|
1279
1282
|
Supported shells: ${COMPLETION_SHELL_CHOICES.join(", ")}.
|
|
1280
1283
|
`,
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1284
|
+
)
|
|
1285
|
+
.addHelpText(
|
|
1286
|
+
"after",
|
|
1287
|
+
`
|
|
1285
1288
|
Examples:
|
|
1286
1289
|
${pc.green("flywheel completion install bash")}
|
|
1287
1290
|
${pc.green("flywheel completion install zsh --update-profile --yes")}
|
|
@@ -1289,29 +1292,29 @@ Examples:
|
|
|
1289
1292
|
${pc.green("flywheel completion install powershell --update-profile --yes")}
|
|
1290
1293
|
${pc.green("flywheel completion install nu")}
|
|
1291
1294
|
`,
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1295
|
+
)
|
|
1296
|
+
.action(async (shell, options) => {
|
|
1297
|
+
await runCompletionInstallCommand(shell, options);
|
|
1298
|
+
});
|
|
1296
1299
|
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1300
|
+
completionCommand
|
|
1301
|
+
.command("uninstall <shell>")
|
|
1302
|
+
.description("Uninstall Flywheel-managed shell completion scripts")
|
|
1303
|
+
.option("--dir <path>", "Override completion script destination directory")
|
|
1304
|
+
.option("--dry-run", "Print planned removals without writing files")
|
|
1305
|
+
.option("--update-profile", "Allow shell startup/profile file updates")
|
|
1306
|
+
.option("-y, --yes", "Skip confirmation prompts")
|
|
1307
|
+
.addHelpText(
|
|
1308
|
+
"before",
|
|
1309
|
+
`${pc.bold(pc.cyan("✻ Flywheel Completion Uninstall"))}
|
|
1307
1310
|
|
|
1308
1311
|
Remove only Flywheel-managed shell completion files and profile blocks.
|
|
1309
1312
|
Supported shells: ${COMPLETION_SHELL_CHOICES.join(", ")}.
|
|
1310
1313
|
`,
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1314
|
+
)
|
|
1315
|
+
.addHelpText(
|
|
1316
|
+
"after",
|
|
1317
|
+
`
|
|
1315
1318
|
Examples:
|
|
1316
1319
|
${pc.green("flywheel completion uninstall bash")}
|
|
1317
1320
|
${pc.green("flywheel completion uninstall zsh --update-profile --yes")}
|
|
@@ -1319,73 +1322,74 @@ Examples:
|
|
|
1319
1322
|
${pc.green("flywheel completion uninstall powershell --update-profile --yes")}
|
|
1320
1323
|
${pc.green("flywheel completion uninstall nu")}
|
|
1321
1324
|
`,
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1325
|
+
)
|
|
1326
|
+
.action(async (shell, options) => {
|
|
1327
|
+
await runCompletionUninstallCommand(shell, options);
|
|
1328
|
+
});
|
|
1326
1329
|
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1330
|
+
program
|
|
1331
|
+
.command("setup")
|
|
1332
|
+
.description("Set up Flywheel for your AI coding host")
|
|
1333
|
+
.addHelpText(
|
|
1334
|
+
"before",
|
|
1335
|
+
`${pc.bold(pc.cyan("✻ Flywheel Setup"))}
|
|
1333
1336
|
|
|
1334
1337
|
Configure the Flywheel CLI, MCP host entries, and bundled skills without changing command names or setup modes.
|
|
1335
1338
|
`,
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
|
|
1369
|
-
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1339
|
+
)
|
|
1340
|
+
.optionsGroup("Hosts:")
|
|
1341
|
+
.option("--claude", "Set up for Claude Code")
|
|
1342
|
+
.option("--cursor", "Set up for Cursor")
|
|
1343
|
+
.option("--universal", "Set up for Universal (.agents/skills)")
|
|
1344
|
+
.option("--antigravity", "Set up for Antigravity (.agent/skills)")
|
|
1345
|
+
.option("--opencode", "Set up for OpenCode")
|
|
1346
|
+
.option("--codex", "Set up for Codex")
|
|
1347
|
+
.option("--gemini", "Set up for Gemini CLI")
|
|
1348
|
+
.option("--pi-mono", "Set up for Pi (pi-mono)")
|
|
1349
|
+
.option("--hermes-agent", "Set up for Hermes Agent")
|
|
1350
|
+
.option("--openclaw", "Set up for OpenClaw")
|
|
1351
|
+
.optionsGroup("Mode:")
|
|
1352
|
+
.option(
|
|
1353
|
+
"--mode <mode>",
|
|
1354
|
+
"Install mode: mcp | cli (required in non-interactive; prompted in TTY, default: mcp)",
|
|
1355
|
+
collectModeValues,
|
|
1356
|
+
[],
|
|
1357
|
+
)
|
|
1358
|
+
.option("--mcp", "Alias for --mode mcp")
|
|
1359
|
+
.option("--cli", "Alias for --mode cli")
|
|
1360
|
+
.optionsGroup("Scope:")
|
|
1361
|
+
.option(
|
|
1362
|
+
"-p, --project",
|
|
1363
|
+
"Configure for current project instead of globally",
|
|
1364
|
+
)
|
|
1365
|
+
.option("-y, --yes", "Skip confirmation prompts")
|
|
1366
|
+
.optionsGroup("Authentication:")
|
|
1367
|
+
.option("--api-key <key>", "Use API key authentication")
|
|
1368
|
+
.option("--api-key-stdin", "Read one API key privately from stdin without browser authentication")
|
|
1369
|
+
.option("--oauth", "Use OAuth endpoint (IDE handles auth flow)")
|
|
1370
|
+
.optionsGroup("Skills:")
|
|
1371
|
+
.option("--install-skill", "Install or refresh the bundled Flywheel skills")
|
|
1372
|
+
.option("--skip-skill", "Skip bundled skill installation (MCP-only setup)")
|
|
1373
|
+
.optionsGroup("Advanced:")
|
|
1374
|
+
.option(
|
|
1375
|
+
"--auth-mode <mode>",
|
|
1376
|
+
"Device approval flow; default auto. " +
|
|
1377
|
+
"Explicit loopback is retired and returns FLY-416 guidance",
|
|
1378
|
+
normalizeAuthMode,
|
|
1379
|
+
"auto",
|
|
1380
|
+
)
|
|
1381
|
+
.option(
|
|
1382
|
+
"--base-url <url>",
|
|
1383
|
+
`Public Flywheel origin used for setup and MCP config (default: ${resolveSetupBaseUrl()})`,
|
|
1384
|
+
)
|
|
1385
|
+
.option("--name <name>", `MCP server name (default: ${SERVER_NAME})`)
|
|
1386
|
+
.option(
|
|
1387
|
+
"--force",
|
|
1388
|
+
"Reconcile prior install mode automatically via uninstall",
|
|
1389
|
+
)
|
|
1390
|
+
.addHelpText(
|
|
1391
|
+
"after",
|
|
1392
|
+
`
|
|
1389
1393
|
Examples:
|
|
1390
1394
|
${pc.green("npx --yes @paradigma-inc/flywheel setup --mode mcp --install-skill")}
|
|
1391
1395
|
${pc.green("npx --yes @paradigma-inc/flywheel setup --mode mcp --skip-skill --codex --project")}
|
|
@@ -1395,48 +1399,48 @@ Next steps:
|
|
|
1395
1399
|
${pc.green("flywheel help")}
|
|
1396
1400
|
${pc.green("flywheel auth:status")}
|
|
1397
1401
|
`,
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
+
)
|
|
1403
|
+
.action(async (options) => {
|
|
1404
|
+
await runSetupCommandViaRouter(options);
|
|
1405
|
+
});
|
|
1402
1406
|
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1407
|
+
program
|
|
1408
|
+
.command("uninstall")
|
|
1409
|
+
.description(
|
|
1410
|
+
"Remove Flywheel MCP entries and bundled skills from selected hosts",
|
|
1411
|
+
)
|
|
1412
|
+
.addHelpText(
|
|
1413
|
+
"before",
|
|
1414
|
+
`${pc.bold(pc.cyan("✻ Flywheel Uninstall"))}
|
|
1411
1415
|
|
|
1412
1416
|
Remove Flywheel MCP entries and bundled skills from selected hosts without changing command names or uninstall scopes.
|
|
1413
1417
|
`,
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
|
|
1424
|
-
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1418
|
+
)
|
|
1419
|
+
.optionsGroup("Hosts:")
|
|
1420
|
+
.option("--claude", "Uninstall for Claude Code")
|
|
1421
|
+
.option("--cursor", "Uninstall for Cursor")
|
|
1422
|
+
.option("--universal", "Uninstall bundled skills from .agents/skills")
|
|
1423
|
+
.option("--antigravity", "Uninstall bundled skills from .agent/skills")
|
|
1424
|
+
.option("--opencode", "Uninstall for OpenCode")
|
|
1425
|
+
.option("--codex", "Uninstall for Codex")
|
|
1426
|
+
.option("--gemini", "Uninstall for Gemini CLI")
|
|
1427
|
+
.option("--pi-mono", "Uninstall for Pi (pi-mono)")
|
|
1428
|
+
.option("--hermes-agent", "Uninstall for Hermes Agent")
|
|
1429
|
+
.option("--openclaw", "Uninstall for OpenClaw")
|
|
1430
|
+
.optionsGroup("Selection:")
|
|
1431
|
+
.option(
|
|
1432
|
+
"--hosts <list>",
|
|
1433
|
+
"Comma-separated: claude,cursor,universal,antigravity,opencode,codex,gemini,pi-mono,hermes-agent,openclaw",
|
|
1434
|
+
)
|
|
1435
|
+
.option("--scope <scope>", "all | global | project")
|
|
1436
|
+
.option(
|
|
1437
|
+
"--name <name>",
|
|
1438
|
+
`MCP server name to remove (default: ${SERVER_NAME})`,
|
|
1439
|
+
)
|
|
1440
|
+
.option("-y, --yes", "Skip uninstall selection prompts")
|
|
1441
|
+
.addHelpText(
|
|
1442
|
+
"after",
|
|
1443
|
+
`
|
|
1440
1444
|
Examples:
|
|
1441
1445
|
${pc.green("npx --yes @paradigma-inc/flywheel uninstall --codex --scope project")}
|
|
1442
1446
|
${pc.green("npx --yes @paradigma-inc/flywheel uninstall --hosts claude,codex --scope all --yes")}
|
|
@@ -1445,43 +1449,43 @@ Next steps:
|
|
|
1445
1449
|
${pc.green("flywheel help setup")}
|
|
1446
1450
|
${pc.green("npx --yes @paradigma-inc/flywheel setup --mode mcp")}
|
|
1447
1451
|
`,
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
+
)
|
|
1453
|
+
.action(async (options) => {
|
|
1454
|
+
await runUninstallCommand(options);
|
|
1455
|
+
});
|
|
1452
1456
|
|
|
1453
|
-
|
|
1457
|
+
return program;
|
|
1454
1458
|
}
|
|
1455
1459
|
|
|
1456
1460
|
export async function runCli(argv = process.argv, { exitOverride = false } = {}) {
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
}
|
|
1485
|
-
throw error;
|
|
1461
|
+
try {
|
|
1462
|
+
const program = buildProgram({ exitOverride });
|
|
1463
|
+
await program.parseAsync(argv);
|
|
1464
|
+
return process.exitCode ?? 0;
|
|
1465
|
+
} catch (error) {
|
|
1466
|
+
if (error instanceof Error && error.name === "ExitPromptError") {
|
|
1467
|
+
if (exitOverride) {
|
|
1468
|
+
return 0;
|
|
1469
|
+
}
|
|
1470
|
+
process.exit(0);
|
|
1471
|
+
}
|
|
1472
|
+
if (error instanceof Error && /cancelled/i.test(error.message)) {
|
|
1473
|
+
log.warn(error.message);
|
|
1474
|
+
if (exitOverride) {
|
|
1475
|
+
return 0;
|
|
1476
|
+
}
|
|
1477
|
+
process.exit(0);
|
|
1478
|
+
}
|
|
1479
|
+
if (
|
|
1480
|
+
exitOverride &&
|
|
1481
|
+
error &&
|
|
1482
|
+
typeof error === "object" &&
|
|
1483
|
+
typeof error.code === "string" &&
|
|
1484
|
+
error.code.startsWith("commander.") &&
|
|
1485
|
+
Number.isInteger(error.exitCode)
|
|
1486
|
+
) {
|
|
1487
|
+
return error.exitCode;
|
|
1486
1488
|
}
|
|
1489
|
+
throw error;
|
|
1490
|
+
}
|
|
1487
1491
|
}
|