@unbrained/pm-cli 2026.5.14 → 2026.5.24
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/.claude-plugin/marketplace.json +4 -4
- package/AGENTS.md +78 -457
- package/CHANGELOG.md +71 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +8 -6
- package/dist/cli/argv-utils.js +4 -1
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.js +4 -1
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +19 -1
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +4 -1
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.js +5 -2
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +49 -0
- package/dist/cli/commands/annotation-command.js +135 -0
- package/dist/cli/commands/annotation-command.js.map +1 -0
- package/dist/cli/commands/append.js +5 -6
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +5 -5
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.d.ts +3 -0
- package/dist/cli/commands/claim.js +29 -23
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +63 -8
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +4 -1
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +5 -0
- package/dist/cli/commands/comments.js +29 -116
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +198 -15
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.js +4 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +21 -13
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +9 -0
- package/dist/cli/commands/contracts.js +314 -64
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +77 -48
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +9 -3
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.d.ts +3 -0
- package/dist/cli/commands/delete.js +11 -7
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/deps.js +4 -1
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +1 -0
- package/dist/cli/commands/docs.js +6 -7
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.d.ts +3 -0
- package/dist/cli/commands/event-validation-messages.js +44 -0
- package/dist/cli/commands/event-validation-messages.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +3 -1
- package/dist/cli/commands/extension.js +259 -52
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +8 -12
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +19 -3
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +10 -5
- package/dist/cli/commands/get.js +135 -20
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/guide.js +6 -8
- package/dist/cli/commands/guide.js.map +1 -1
- package/dist/cli/commands/health.d.ts +14 -0
- package/dist/cli/commands/health.js +269 -67
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +50 -0
- package/dist/cli/commands/history-redact.js +476 -0
- package/dist/cli/commands/history-redact.js.map +1 -0
- package/dist/cli/commands/history-repair.d.ts +33 -0
- package/dist/cli/commands/history-repair.js +166 -0
- package/dist/cli/commands/history-repair.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -0
- package/dist/cli/commands/history.js +12 -79
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +5 -1
- package/dist/cli/commands/index.js +9 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +31 -0
- package/dist/cli/commands/init-agent-guidance.js +336 -0
- package/dist/cli/commands/init-agent-guidance.js.map +1 -0
- package/dist/cli/commands/init.d.ts +42 -0
- package/dist/cli/commands/init.js +96 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +22 -118
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/linked-test-entry.d.ts +3 -0
- package/dist/cli/commands/linked-test-entry.js +62 -0
- package/dist/cli/commands/linked-test-entry.js.map +1 -0
- package/dist/cli/commands/list.d.ts +1 -0
- package/dist/cli/commands/list.js +72 -38
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/metadata-normalizers.js +4 -1
- package/dist/cli/commands/metadata-normalizers.js.map +1 -1
- package/dist/cli/commands/normalize.js +4 -1
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +22 -118
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +121 -0
- package/dist/cli/commands/plan.js +1137 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/reindex.js +4 -1
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.js +9 -49
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +31 -0
- package/dist/cli/commands/schema.js +98 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.js +156 -40
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.js +4 -1
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +4 -0
- package/dist/cli/commands/templates.js +91 -16
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.js +6 -7
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test-runs.js +4 -1
- package/dist/cli/commands/test-runs.js.map +1 -1
- package/dist/cli/commands/test.d.ts +1 -0
- package/dist/cli/commands/test.js +9 -9
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +6 -7
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +204 -103
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/upgrade.js +6 -3
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -1
- package/dist/cli/commands/validate.js +44 -64
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +99 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +0 -1
- package/dist/cli/extension-command-help.js +4 -12
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +108 -6
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/guide-topics.js +4 -1
- package/dist/cli/guide-topics.js.map +1 -1
- package/dist/cli/help-content.d.ts +0 -1
- package/dist/cli/help-content.js +46 -22
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +1 -0
- package/dist/cli/help-json-payload.js +35 -2
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +214 -30
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.js +4 -1
- package/dist/cli/migration-gates.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +75 -29
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +1 -1
- package/dist/cli/register-mutation.js +430 -38
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +47 -10
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +47 -25
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/registration-helpers.js +21 -40
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli/shared-parsers.js +4 -1
- package/dist/cli/shared-parsers.js.map +1 -1
- package/dist/cli/telemetry-flush.js +4 -1
- package/dist/cli/telemetry-flush.js.map +1 -1
- package/dist/cli.js +65 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/extension-types.js +4 -1
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +4 -13
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.js +4 -1
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +78 -60
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runtime-registrations.js +4 -1
- package/dist/core/extensions/runtime-registrations.js.map +1 -1
- package/dist/core/fs/fs-utils.js +4 -1
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/fs/index.js +4 -1
- package/dist/core/fs/index.js.map +1 -1
- package/dist/core/fs/path-utils.d.ts +1 -0
- package/dist/core/fs/path-utils.js +12 -0
- package/dist/core/fs/path-utils.js.map +1 -0
- package/dist/core/history/drift-scan.d.ts +11 -0
- package/dist/core/history/drift-scan.js +67 -0
- package/dist/core/history/drift-scan.js.map +1 -0
- package/dist/core/history/history-stream-policy.js +4 -1
- package/dist/core/history/history-stream-policy.js.map +1 -1
- package/dist/core/history/history.js +4 -1
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/history/index.js +4 -1
- package/dist/core/history/index.js.map +1 -1
- package/dist/core/history/replay.d.ts +82 -0
- package/dist/core/history/replay.js +249 -0
- package/dist/core/history/replay.js.map +1 -0
- package/dist/core/item/id.js +4 -1
- package/dist/core/item/id.js.map +1 -1
- package/dist/core/item/index.js +4 -1
- package/dist/core/item/index.js.map +1 -1
- package/dist/core/item/item-format.js +250 -8
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-type-definition.d.ts +52 -0
- package/dist/core/item/item-type-definition.js +123 -0
- package/dist/core/item/item-type-definition.js.map +1 -0
- package/dist/core/item/parent-reference-policy.js +4 -1
- package/dist/core/item/parent-reference-policy.js.map +1 -1
- package/dist/core/item/parse.js +34 -3
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/priority.d.ts +23 -0
- package/dist/core/item/priority.js +55 -0
- package/dist/core/item/priority.js.map +1 -0
- package/dist/core/item/sprint-release-format.js +4 -1
- package/dist/core/item/sprint-release-format.js.map +1 -1
- package/dist/core/item/status.d.ts +14 -1
- package/dist/core/item/status.js +24 -1
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +19 -0
- package/dist/core/item/toon-decode.js +69 -0
- package/dist/core/item/toon-decode.js.map +1 -0
- package/dist/core/item/type-registry.js +15 -83
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/index.js +4 -1
- package/dist/core/lock/index.js.map +1 -1
- package/dist/core/lock/lock.js +4 -1
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/output/output.d.ts +4 -0
- package/dist/core/output/output.js +47 -6
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/packages/manifest.d.ts +1 -0
- package/dist/core/packages/manifest.js +6 -8
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/packages/root.d.ts +3 -0
- package/dist/core/packages/root.js +51 -0
- package/dist/core/packages/root.js.map +1 -0
- package/dist/core/schema/item-types-file.d.ts +85 -0
- package/dist/core/schema/item-types-file.js +243 -0
- package/dist/core/schema/item-types-file.js.map +1 -0
- package/dist/core/schema/runtime-field-filters.js +4 -1
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.js +4 -1
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.d.ts +2 -1
- package/dist/core/schema/runtime-schema.js +13 -8
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/cache.js +7 -2
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +2 -0
- package/dist/core/search/corpus.js +77 -2
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/embedding-batches.js +21 -7
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/search/http-client.js +4 -1
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/search/providers.js +4 -1
- package/dist/core/search/providers.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +12 -3
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +4 -1
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.js +4 -1
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/sentry/instrument.js +10 -13
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/author.d.ts +1 -0
- package/dist/core/shared/author.js +9 -0
- package/dist/core/shared/author.js.map +1 -0
- package/dist/core/shared/command-types.js +4 -1
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/conflict-markers.js +4 -1
- package/dist/core/shared/conflict-markers.js.map +1 -1
- package/dist/core/shared/constants.d.ts +2 -2
- package/dist/core/shared/constants.js +24 -1
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.js +4 -1
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/index.js +4 -1
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/lazy-module.d.ts +1 -0
- package/dist/core/shared/lazy-module.js +11 -0
- package/dist/core/shared/lazy-module.js.map +1 -0
- package/dist/core/shared/levenshtein.js +4 -1
- package/dist/core/shared/levenshtein.js.map +1 -1
- package/dist/core/shared/option-alias-visibility.d.ts +44 -0
- package/dist/core/shared/option-alias-visibility.js +76 -0
- package/dist/core/shared/option-alias-visibility.js.map +1 -0
- package/dist/core/shared/primitives.js +4 -1
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/shared/serialization.js +4 -1
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/text-normalization.d.ts +0 -1
- package/dist/core/shared/text-normalization.js +4 -4
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/shared/time.js +4 -1
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.js +8 -3
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/index.js +4 -1
- package/dist/core/store/index.js.map +1 -1
- package/dist/core/store/item-format-migration.js +4 -1
- package/dist/core/store/item-format-migration.js.map +1 -1
- package/dist/core/store/item-store.d.ts +4 -0
- package/dist/core/store/item-store.js +133 -39
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.js +4 -1
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +106 -0
- package/dist/core/store/settings-validator.js +279 -0
- package/dist/core/store/settings-validator.js.map +1 -0
- package/dist/core/store/settings.js +32 -331
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.js +4 -1
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/telemetry/observability.d.ts +1 -1
- package/dist/core/telemetry/observability.js +11 -2
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +34 -6
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.js +4 -1
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/test/item-test-run-tracking.js +4 -1
- package/dist/core/test/item-test-run-tracking.js.map +1 -1
- package/dist/mcp/server.js +182 -22
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +10 -3
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +4 -1
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +13 -2
- package/dist/sdk/cli-contracts.js +410 -26
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.js +4 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +25 -1
- package/dist/sdk/runtime.js +48 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types/index.js +4 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types.d.ts +92 -2
- package/dist/types.js +42 -1
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +23 -7
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +10 -10
- package/docs/CODEX_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +117 -12
- package/docs/CONFIGURATION.md +5 -2
- package/docs/EXTENSIONS.md +158 -814
- package/docs/QUICKSTART.md +11 -5
- package/docs/README.md +7 -6
- package/docs/RELEASING.md +13 -9
- package/docs/SDK.md +11 -2
- package/docs/TESTING.md +2 -2
- package/marketplace.json +3 -3
- package/package.json +15 -12
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/README.md +4 -2
- package/packages/pm-calendar/extensions/calendar/index.js +22 -3
- package/packages/pm-calendar/extensions/calendar/index.ts +22 -3
- package/packages/pm-calendar/extensions/calendar/runtime.js +26 -7
- package/packages/pm-calendar/extensions/calendar/runtime.ts +26 -7
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/README.md +8 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +75 -1
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +67 -9
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +67 -9
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/README.md +1 -1
- package/packages/pm-templates/extensions/templates/runtime.js +11 -202
- package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/plugins/{pm-cli-claude → pm-claude}/.claude-plugin/plugin.json +2 -2
- package/plugins/{pm-cli-claude → pm-claude}/.mcp.json +1 -1
- package/plugins/{pm-cli-claude → pm-claude}/README.md +4 -4
- package/plugins/{pm-cli-claude → pm-claude}/agents/pm-coordinator.md +1 -1
- package/plugins/{pm-cli-claude → pm-claude}/commands/pm-init.md +10 -1
- package/plugins/{pm-cli-claude → pm-claude}/commands/pm-planner.md +18 -0
- package/plugins/{pm-cli-claude → pm-claude}/skills/pm-planner/SKILL.md +46 -1
- package/plugins/{pm-cli-codex → pm-codex}/.codex-plugin/plugin.json +3 -3
- package/plugins/{pm-cli-codex → pm-codex}/.mcp.json +1 -1
- package/plugins/{pm-cli-codex → pm-codex}/README.md +7 -4
- package/plugins/pm-codex/skills/pm-native/SKILL.md +81 -0
- package/scripts/finalize-build.mjs +28 -0
- package/scripts/prepare-build-cache.mjs +37 -0
- package/dist/core/output/command-aware.d.ts +0 -1
- package/dist/core/output/command-aware.js +0 -394
- package/dist/core/output/command-aware.js.map +0 -1
- package/plugins/pm-cli-codex/skills/pm-native/SKILL.md +0 -57
- /package/plugins/{pm-cli-claude → pm-claude}/agents/pm-delivery-chain.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/agents/pm-triage-agent.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/agents/pm-verification-agent.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-audit.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-calendar.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-close-task.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-developer.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-list.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-new.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-release.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-search.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-start-task.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-status.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-triage.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-workflow.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/hooks/hooks.json +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/hooks/session-start.mjs +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/scripts/pm-mcp-server.mjs +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-audit/SKILL.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-developer/SKILL.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-release/SKILL.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-workflow/SKILL.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/assets/pm-cli-small.svg +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/commands/pm-audit.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/commands/pm-close-task.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/commands/pm-start-task.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/scripts/pm-mcp-server.mjs +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-auditor/SKILL.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-auditor/agents/openai.yaml +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-native/agents/openai.yaml +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-release/SKILL.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-release/agents/openai.yaml +0 -0
package/dist/cli/main.js
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="bb46ecaf-3f2f-526b-b6fa-4d87511ede62")}catch(e){}}();
|
|
2
4
|
import fs from "node:fs";
|
|
3
5
|
import path from "node:path";
|
|
4
|
-
import { fileURLToPath } from "node:url";
|
|
5
6
|
import { Command } from "commander";
|
|
6
7
|
import { activateExtensions, clearActiveExtensionHooks, getActiveCommandResult, getActiveExtensionRegistrations, loadExtensions, runActiveCommandHandler, runActiveParserOverride, runActivePreflightOverride, runAfterCommandHooks, runBeforeCommandHooks, setActiveCommandResult, setActiveCommandContext, setActiveExtensionCommands, setActiveExtensionHooks, setActiveExtensionParsers, setActiveExtensionPreflight, setActiveExtensionRegistrations, setActiveExtensionRenderers, setActiveExtensionServices, } from "../core/extensions/index.js";
|
|
7
8
|
import { pathExists } from "../core/fs/fs-utils.js";
|
|
9
|
+
import { resolvePmPackageRootFromModule } from "../core/packages/root.js";
|
|
8
10
|
import { resolveItemTypeRegistry, } from "../core/item/type-registry.js";
|
|
9
11
|
import { resolveRuntimeFieldRegistry, } from "../core/schema/runtime-schema.js";
|
|
10
12
|
import { EXIT_CODE, resolveTelemetryErrorCategory } from "../core/shared/constants.js";
|
|
@@ -17,15 +19,12 @@ import { sentryCaptureCliError, sentryFinishCommandSpan, sentryFlush, sentryLogC
|
|
|
17
19
|
import { ensureSentryInit } from "../core/sentry/instrument.js";
|
|
18
20
|
import { getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
|
|
19
21
|
import { readSettings } from "../core/store/settings.js";
|
|
20
|
-
import { coerceLooseCommandOptionsWithFlagDefinitions, parseLooseCommandOptions } from "./extension-command-options.js";
|
|
22
|
+
import { coerceLooseCommandOptionsWithFlagDefinitions, parseLooseCommandOptions, validateLooseCommandOptionsWithFlagDefinitions, } from "./extension-command-options.js";
|
|
21
23
|
import { attachRichHelpText } from "./help-content.js";
|
|
22
24
|
import { extractProvidedOptionFlags, normalizeLongOptionFlag, renderPmCommand, } from "./argv-utils.js";
|
|
23
25
|
import { classifyCommanderError, classifyPmCliError, classifyUnknownError, formatPmCliErrorForDisplay, formatPmCliErrorForJson, formatUnknownErrorForJson, } from "./error-guidance.js";
|
|
24
26
|
import { applyDefaultOutputFormat, clearResolvedGlobalOptions, collect, formatHookWarnings, getCommandPath, getGlobalOptions, invalidateSearchCachesForMutation, setResolvedGlobalOptions, } from "./registration-helpers.js";
|
|
25
|
-
import {
|
|
26
|
-
import { registerListQueryCommands } from "./register-list-query.js";
|
|
27
|
-
import { registerMutationCommands } from "./register-mutation.js";
|
|
28
|
-
import { registerOperationCommands } from "./register-operations.js";
|
|
27
|
+
import { createLazyModule } from "../core/shared/lazy-module.js";
|
|
29
28
|
import { normalizeExtensionCommandPath, collectDynamicExtensionFlagHelpByCommand, collectExtensionCommandHelpDescriptors, applyDynamicExtensionArguments, buildDynamicExtensionCommandMetadataHelp, findCommandByPath, ensureCommandPath, } from "./extension-command-help.js";
|
|
30
29
|
import { parseBootstrapGlobalOptions, applyBootstrapPagerPolicy, parseBootstrapHelpRequest, parseBootstrapCommandName, normalizeBootstrapInvocation, } from "./bootstrap-args.js";
|
|
31
30
|
import { collectMandatoryMigrationBlockers, enforceMandatoryMigrationWriteGate, enforceItemFormatWriteGateAndPreflightMigration, resolveMigrationId, resolveNormalizedMigrationStatus, } from "./migration-gates.js";
|
|
@@ -33,8 +32,7 @@ import { isKnownHelpCommandPath, formatCommanderUsageMessage, formatCommanderUsa
|
|
|
33
32
|
import { maybeRenderBootstrapJsonHelp, attachCreateUpdatePolicyHelpText, } from "./help-json-payload.js";
|
|
34
33
|
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
35
34
|
function resolvePmPackageRoot() {
|
|
36
|
-
|
|
37
|
-
return path.resolve(path.dirname(mainPath), "../..");
|
|
35
|
+
return resolvePmPackageRootFromModule(import.meta.url, ["../.."]);
|
|
38
36
|
}
|
|
39
37
|
if (typeof process.env[PM_PACKAGE_ROOT_ENV] !== "string" || process.env[PM_PACKAGE_ROOT_ENV]?.trim().length === 0) {
|
|
40
38
|
process.env[PM_PACKAGE_ROOT_ENV] = resolvePmPackageRoot();
|
|
@@ -49,6 +47,8 @@ const TELEMETRY_COMMAND_RESOLUTION_SET = new Set([
|
|
|
49
47
|
"missing_required_argument",
|
|
50
48
|
"invalid_usage",
|
|
51
49
|
"validation_failed",
|
|
50
|
+
"health_findings",
|
|
51
|
+
"validation_findings",
|
|
52
52
|
"conflict",
|
|
53
53
|
"runtime_failed",
|
|
54
54
|
"unknown_failed",
|
|
@@ -57,6 +57,10 @@ const TELEMETRY_RESOLUTION_STAGE_SET = new Set(["parse", "preflight", "execute",
|
|
|
57
57
|
const TELEMETRY_ERROR_CATEGORY_SET = new Set(["usage", "validation", "conflict", "runtime", "unknown"]);
|
|
58
58
|
let runtimeExtensionSnapshotCache = null;
|
|
59
59
|
let activeRuntimeExtensionCommandDescriptors = new Map();
|
|
60
|
+
const loadSetupRegistrationModule = createLazyModule(() => import("./register-setup.js"));
|
|
61
|
+
const loadListQueryRegistrationModule = createLazyModule(() => import("./register-list-query.js"));
|
|
62
|
+
const loadMutationRegistrationModule = createLazyModule(() => import("./register-mutation.js"));
|
|
63
|
+
const loadOperationRegistrationModule = createLazyModule(() => import("./register-operations.js"));
|
|
60
64
|
function describeUnknownError(error) {
|
|
61
65
|
if (error instanceof PmCliError) {
|
|
62
66
|
return error.message;
|
|
@@ -80,28 +84,31 @@ function inferMissingFieldsFromErrorMessage(message) {
|
|
|
80
84
|
function buildPmCliRecoveryContext(context, invocationArgv, rawMessage) {
|
|
81
85
|
const attemptedCommand = renderAttemptedCommand(invocationArgv);
|
|
82
86
|
const providedFields = extractProvidedOptionFlags(invocationArgv);
|
|
83
|
-
const
|
|
87
|
+
const providedSet = new Set(providedFields.map((flag) => normalizeLongOptionFlag(flag) ?? flag));
|
|
84
88
|
const existingRecovery = context?.recovery;
|
|
89
|
+
const rawInferred = existingRecovery?.suggested_retry ? undefined : inferMissingFieldsFromErrorMessage(rawMessage);
|
|
90
|
+
const trulyMissing = rawInferred?.filter((flag) => !providedSet.has(normalizeLongOptionFlag(flag) ?? flag));
|
|
91
|
+
const inferredMissing = trulyMissing && trulyMissing.length > 0 ? trulyMissing : undefined;
|
|
85
92
|
let suggestedRetry = existingRecovery?.suggested_retry;
|
|
86
93
|
if (!suggestedRetry && inferredMissing && inferredMissing.length > 0) {
|
|
87
94
|
const missingFlag = inferredMissing[0];
|
|
88
95
|
const normalizedMissing = normalizeLongOptionFlag(missingFlag);
|
|
89
96
|
if (normalizedMissing) {
|
|
90
|
-
|
|
91
|
-
if (!alreadyProvided) {
|
|
92
|
-
suggestedRetry = renderAttemptedCommand([...invocationArgv, normalizedMissing, "<value>"]);
|
|
93
|
-
}
|
|
97
|
+
suggestedRetry = renderAttemptedCommand([...invocationArgv, normalizedMissing, "<value>"]);
|
|
94
98
|
}
|
|
95
99
|
}
|
|
96
100
|
if (!suggestedRetry) {
|
|
97
101
|
suggestedRetry = attemptedCommand;
|
|
98
102
|
}
|
|
103
|
+
if (suggestedRetry === attemptedCommand) {
|
|
104
|
+
suggestedRetry = undefined;
|
|
105
|
+
}
|
|
99
106
|
const recovery = {
|
|
100
107
|
attempted_command: existingRecovery?.attempted_command ?? attemptedCommand,
|
|
101
108
|
normalized_args: existingRecovery?.normalized_args ?? [...invocationArgv],
|
|
102
109
|
provided_fields: existingRecovery?.provided_fields ?? (providedFields.length > 0 ? providedFields : undefined),
|
|
103
110
|
missing: existingRecovery?.missing ?? inferredMissing,
|
|
104
|
-
suggested_retry: suggestedRetry,
|
|
111
|
+
...(suggestedRetry ? { suggested_retry: suggestedRetry } : {}),
|
|
105
112
|
};
|
|
106
113
|
return {
|
|
107
114
|
...(context ?? {}),
|
|
@@ -240,8 +247,7 @@ function buildPostActionTelemetryOutcome() {
|
|
|
240
247
|
: undefined;
|
|
241
248
|
const resultExitCode = readRecordNumber(result, "exit_code", "exitCode");
|
|
242
249
|
const exitCode = processExitCode ?? resultExitCode ?? EXIT_CODE.SUCCESS;
|
|
243
|
-
const
|
|
244
|
-
const ok = resultOk ?? exitCode === EXIT_CODE.SUCCESS;
|
|
250
|
+
const ok = exitCode === EXIT_CODE.SUCCESS;
|
|
245
251
|
const errorCode = readRecordString(result, "error_code", "errorCode") ?? inferPostActionErrorCode(ok, exitCode);
|
|
246
252
|
const errorCategory = normalizeTelemetryErrorCategory(readRecordString(result, "error_category", "errorCategory")) ??
|
|
247
253
|
(!ok ? resolveTelemetryErrorCategory(errorCode) : undefined);
|
|
@@ -313,6 +319,9 @@ function extractCommandScopedOptions(command, commandArgs, extensionFlagDefiniti
|
|
|
313
319
|
delete scoped.profile;
|
|
314
320
|
delete scoped.pager;
|
|
315
321
|
const looseOptions = parseLooseCommandOptions(commandArgs);
|
|
322
|
+
if (extensionFlagDefinitions.length > 0) {
|
|
323
|
+
validateLooseCommandOptionsWithFlagDefinitions(looseOptions, extensionFlagDefinitions, getCommandPath(command));
|
|
324
|
+
}
|
|
316
325
|
for (const [key, value] of Object.entries(looseOptions)) {
|
|
317
326
|
if (scoped[key] === undefined) {
|
|
318
327
|
scoped[key] = value;
|
|
@@ -332,6 +341,22 @@ function collectExtensionFlagDefinitionsForCommand(registrations, commandPath) {
|
|
|
332
341
|
.filter((entry) => normalizeExtensionCommandPath(entry.target_command) === normalizedCommandPath)
|
|
333
342
|
.flatMap((entry) => entry.flags);
|
|
334
343
|
}
|
|
344
|
+
function collectExtensionFlagDefinitionsForInvocation(registrations, commandPath, commandArgs) {
|
|
345
|
+
const exact = collectExtensionFlagDefinitionsForCommand(registrations, commandPath);
|
|
346
|
+
const pathParts = [commandPath];
|
|
347
|
+
let nestedMatch = [];
|
|
348
|
+
for (const arg of commandArgs) {
|
|
349
|
+
if (arg.startsWith("-")) {
|
|
350
|
+
break;
|
|
351
|
+
}
|
|
352
|
+
pathParts.push(arg);
|
|
353
|
+
const nested = collectExtensionFlagDefinitionsForCommand(registrations, pathParts.join(" "));
|
|
354
|
+
if (nested.length > 0) {
|
|
355
|
+
nestedMatch = nested;
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
return nestedMatch.length > 0 ? nestedMatch : exact;
|
|
359
|
+
}
|
|
335
360
|
const RUNTIME_FIELD_COMMAND_BY_COMMAND_PATH = {
|
|
336
361
|
create: "create",
|
|
337
362
|
update: "update",
|
|
@@ -663,7 +688,7 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
663
688
|
let commandArgs = actionCommand.args.map(String);
|
|
664
689
|
const activeRegistrations = getActiveExtensionRegistrations();
|
|
665
690
|
const extensionFlagDefinitions = activeRegistrations
|
|
666
|
-
?
|
|
691
|
+
? collectExtensionFlagDefinitionsForInvocation(activeRegistrations, commandPath, commandArgs)
|
|
667
692
|
: [];
|
|
668
693
|
const runtimeFieldFlagDefinitions = await collectRuntimeFieldLooseFlagDefinitionsForCommand(commandPath, pmRoot);
|
|
669
694
|
let commandOptions = extractCommandScopedOptions(actionCommand, commandArgs, [
|
|
@@ -715,7 +740,13 @@ function wrapProgramActionsForExtensionHandlers(rootProgram) {
|
|
|
715
740
|
}
|
|
716
741
|
if (extensionCommandResult.handled) {
|
|
717
742
|
setActiveCommandResult(extensionCommandResult.result);
|
|
718
|
-
printResult(extensionCommandResult.result,
|
|
743
|
+
printResult(extensionCommandResult.result, {
|
|
744
|
+
...globalOptions,
|
|
745
|
+
command: commandPath,
|
|
746
|
+
commandArgs,
|
|
747
|
+
commandOptions,
|
|
748
|
+
pmRoot,
|
|
749
|
+
});
|
|
719
750
|
if (globalOptions.profile) {
|
|
720
751
|
printError(`profile:command=${commandPath} took_ms=${Date.now() - startedAt}`);
|
|
721
752
|
}
|
|
@@ -789,14 +820,22 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
|
|
|
789
820
|
dynamicCommand
|
|
790
821
|
.allowUnknownOption(true)
|
|
791
822
|
.allowExcessArguments(true)
|
|
792
|
-
.action(async (
|
|
823
|
+
.action(async (...actionArgs) => {
|
|
824
|
+
const maybeCommand = actionArgs[actionArgs.length - 1];
|
|
825
|
+
const command = maybeCommand instanceof Command ? maybeCommand : dynamicCommand;
|
|
793
826
|
const globalOptions = getGlobalOptions(command);
|
|
794
827
|
const startedAt = Date.now();
|
|
795
|
-
const extensionFlagDefinitions =
|
|
828
|
+
const extensionFlagDefinitions = collectExtensionFlagDefinitionsForInvocation(snapshot.registrations, commandPath, command.args.map(String));
|
|
796
829
|
const scopedOptions = extractCommandScopedOptions(command, command.args.map(String), extensionFlagDefinitions);
|
|
797
830
|
const result = await runRequiredExtensionCommand(command, scopedOptions, globalOptions);
|
|
798
831
|
await invalidateSearchCachesForMutation(globalOptions, result);
|
|
799
|
-
printResult(result,
|
|
832
|
+
printResult(result, {
|
|
833
|
+
...globalOptions,
|
|
834
|
+
command: commandPath,
|
|
835
|
+
commandArgs: command.args.map(String),
|
|
836
|
+
commandOptions: scopedOptions,
|
|
837
|
+
pmRoot,
|
|
838
|
+
});
|
|
800
839
|
if (globalOptions.profile) {
|
|
801
840
|
printError(`profile:command=${commandPath} took_ms=${Date.now() - startedAt}`);
|
|
802
841
|
}
|
|
@@ -805,8 +844,7 @@ async function registerDynamicExtensionCommandPaths(rootProgram, invocationArgv)
|
|
|
805
844
|
}
|
|
806
845
|
function resolveCliVersion() {
|
|
807
846
|
try {
|
|
808
|
-
const
|
|
809
|
-
const packageJsonPath = path.resolve(path.dirname(currentFilePath), "../../package.json");
|
|
847
|
+
const packageJsonPath = path.join(resolvePmPackageRoot(), "package.json");
|
|
810
848
|
const raw = fs.readFileSync(packageJsonPath, "utf8");
|
|
811
849
|
const parsed = JSON.parse(raw);
|
|
812
850
|
return typeof parsed.version === "string" ? parsed.version : "0.0.0";
|
|
@@ -876,7 +914,7 @@ program.hook("preAction", async (_thisCommand, actionCommand) => {
|
|
|
876
914
|
setActiveExtensionServices(runtimeExtensions.services);
|
|
877
915
|
setActiveExtensionRenderers(runtimeExtensions.renderers);
|
|
878
916
|
setActiveExtensionRegistrations(runtimeExtensions.registrations);
|
|
879
|
-
const extensionFlagDefinitions =
|
|
917
|
+
const extensionFlagDefinitions = collectExtensionFlagDefinitionsForInvocation(runtimeExtensions.registrations, commandPath, commandArgs);
|
|
880
918
|
commandOptions = extractCommandScopedOptions(actionCommand, commandArgs, extensionFlagDefinitions);
|
|
881
919
|
const parserOverride = await runActiveParserOverride({
|
|
882
920
|
command: commandPath,
|
|
@@ -970,11 +1008,73 @@ program.hook("postAction", async () => {
|
|
|
970
1008
|
});
|
|
971
1009
|
await runAndClearAfterCommandHooks(outcome);
|
|
972
1010
|
});
|
|
973
|
-
registerSetupCommands(program);
|
|
974
|
-
registerListQueryCommands(program);
|
|
975
|
-
registerMutationCommands(program);
|
|
976
|
-
registerOperationCommands(program);
|
|
977
1011
|
const VERSION_FLAG_TOKENS = new Set(["--version", "-V"]);
|
|
1012
|
+
const SETUP_COMMAND_NAMES = new Set([
|
|
1013
|
+
"config",
|
|
1014
|
+
"extension",
|
|
1015
|
+
"init",
|
|
1016
|
+
"install",
|
|
1017
|
+
"package",
|
|
1018
|
+
"packages",
|
|
1019
|
+
"templates",
|
|
1020
|
+
"upgrade",
|
|
1021
|
+
]);
|
|
1022
|
+
const LIST_QUERY_COMMAND_NAMES = new Set([
|
|
1023
|
+
"activity",
|
|
1024
|
+
"aggregate",
|
|
1025
|
+
"context",
|
|
1026
|
+
"ctx",
|
|
1027
|
+
"get",
|
|
1028
|
+
"history",
|
|
1029
|
+
"list",
|
|
1030
|
+
"list-all",
|
|
1031
|
+
"list-blocked",
|
|
1032
|
+
"list-canceled",
|
|
1033
|
+
"list-closed",
|
|
1034
|
+
"list-draft",
|
|
1035
|
+
"list-in-progress",
|
|
1036
|
+
"list-open",
|
|
1037
|
+
"search",
|
|
1038
|
+
]);
|
|
1039
|
+
const MUTATION_COMMAND_NAMES = new Set([
|
|
1040
|
+
"append",
|
|
1041
|
+
"close",
|
|
1042
|
+
"comments",
|
|
1043
|
+
"delete",
|
|
1044
|
+
"deps",
|
|
1045
|
+
"discover",
|
|
1046
|
+
"docs",
|
|
1047
|
+
"files",
|
|
1048
|
+
"learnings",
|
|
1049
|
+
"notes",
|
|
1050
|
+
"plan",
|
|
1051
|
+
"restore",
|
|
1052
|
+
"update",
|
|
1053
|
+
"update-many",
|
|
1054
|
+
"create",
|
|
1055
|
+
]);
|
|
1056
|
+
const OPERATION_COMMAND_NAMES = new Set([
|
|
1057
|
+
"claim",
|
|
1058
|
+
"close-task",
|
|
1059
|
+
"contracts",
|
|
1060
|
+
"gc",
|
|
1061
|
+
"health",
|
|
1062
|
+
"pause-task",
|
|
1063
|
+
"release",
|
|
1064
|
+
"start-task",
|
|
1065
|
+
"stats",
|
|
1066
|
+
"test",
|
|
1067
|
+
"test-all",
|
|
1068
|
+
"test-runs",
|
|
1069
|
+
"test-runs-worker",
|
|
1070
|
+
"validate",
|
|
1071
|
+
]);
|
|
1072
|
+
const REGISTER_ALL_CORE_COMMAND_FAMILIES = {
|
|
1073
|
+
setup: true,
|
|
1074
|
+
listQuery: true,
|
|
1075
|
+
mutation: true,
|
|
1076
|
+
operation: true,
|
|
1077
|
+
};
|
|
978
1078
|
const RUNTIME_SCHEMA_FLAG_BOOTSTRAP_COMMANDS = new Set([
|
|
979
1079
|
"create",
|
|
980
1080
|
"update",
|
|
@@ -995,6 +1095,80 @@ const RUNTIME_SCHEMA_FLAG_BOOTSTRAP_COMMANDS = new Set([
|
|
|
995
1095
|
function invocationRequestsVersion(invocationArgv) {
|
|
996
1096
|
return invocationArgv.some((token) => VERSION_FLAG_TOKENS.has(token));
|
|
997
1097
|
}
|
|
1098
|
+
function resolveCoreCommandRegistrationSelection(invocationArgv) {
|
|
1099
|
+
if (invocationRequestsVersion(invocationArgv)) {
|
|
1100
|
+
return {
|
|
1101
|
+
setup: false,
|
|
1102
|
+
listQuery: false,
|
|
1103
|
+
mutation: false,
|
|
1104
|
+
operation: false,
|
|
1105
|
+
};
|
|
1106
|
+
}
|
|
1107
|
+
if (invocationArgv.length === 0 ||
|
|
1108
|
+
parseBootstrapHelpRequest(invocationArgv).requested) {
|
|
1109
|
+
return REGISTER_ALL_CORE_COMMAND_FAMILIES;
|
|
1110
|
+
}
|
|
1111
|
+
const commandName = parseBootstrapCommandName(invocationArgv);
|
|
1112
|
+
if (!commandName) {
|
|
1113
|
+
return REGISTER_ALL_CORE_COMMAND_FAMILIES;
|
|
1114
|
+
}
|
|
1115
|
+
const normalizedCommand = commandName.trim().toLowerCase();
|
|
1116
|
+
if (SETUP_COMMAND_NAMES.has(normalizedCommand)) {
|
|
1117
|
+
return {
|
|
1118
|
+
setup: true,
|
|
1119
|
+
listQuery: false,
|
|
1120
|
+
mutation: false,
|
|
1121
|
+
operation: false,
|
|
1122
|
+
};
|
|
1123
|
+
}
|
|
1124
|
+
if (LIST_QUERY_COMMAND_NAMES.has(normalizedCommand)) {
|
|
1125
|
+
return {
|
|
1126
|
+
setup: false,
|
|
1127
|
+
listQuery: true,
|
|
1128
|
+
mutation: false,
|
|
1129
|
+
operation: false,
|
|
1130
|
+
};
|
|
1131
|
+
}
|
|
1132
|
+
if (MUTATION_COMMAND_NAMES.has(normalizedCommand)) {
|
|
1133
|
+
return {
|
|
1134
|
+
setup: false,
|
|
1135
|
+
listQuery: false,
|
|
1136
|
+
mutation: true,
|
|
1137
|
+
operation: false,
|
|
1138
|
+
};
|
|
1139
|
+
}
|
|
1140
|
+
if (OPERATION_COMMAND_NAMES.has(normalizedCommand)) {
|
|
1141
|
+
return {
|
|
1142
|
+
setup: false,
|
|
1143
|
+
listQuery: false,
|
|
1144
|
+
mutation: false,
|
|
1145
|
+
operation: true,
|
|
1146
|
+
};
|
|
1147
|
+
}
|
|
1148
|
+
return REGISTER_ALL_CORE_COMMAND_FAMILIES;
|
|
1149
|
+
}
|
|
1150
|
+
function shouldAttachRichHelpTextForInvocation(invocationArgv) {
|
|
1151
|
+
return (invocationArgv.length === 0 ||
|
|
1152
|
+
parseBootstrapHelpRequest(invocationArgv).requested);
|
|
1153
|
+
}
|
|
1154
|
+
async function registerCoreCommandFamilies(rootProgram, selection) {
|
|
1155
|
+
if (selection.setup) {
|
|
1156
|
+
const { registerSetupCommands } = await loadSetupRegistrationModule();
|
|
1157
|
+
registerSetupCommands(rootProgram);
|
|
1158
|
+
}
|
|
1159
|
+
if (selection.listQuery) {
|
|
1160
|
+
const { registerListQueryCommands } = await loadListQueryRegistrationModule();
|
|
1161
|
+
registerListQueryCommands(rootProgram);
|
|
1162
|
+
}
|
|
1163
|
+
if (selection.mutation) {
|
|
1164
|
+
const { registerMutationCommands } = await loadMutationRegistrationModule();
|
|
1165
|
+
registerMutationCommands(rootProgram);
|
|
1166
|
+
}
|
|
1167
|
+
if (selection.operation) {
|
|
1168
|
+
const { registerOperationCommands } = await loadOperationRegistrationModule();
|
|
1169
|
+
registerOperationCommands(rootProgram);
|
|
1170
|
+
}
|
|
1171
|
+
}
|
|
998
1172
|
function isKnownTopLevelCommandOrAlias(rootProgram, commandName) {
|
|
999
1173
|
const normalized = commandName.trim().toLowerCase();
|
|
1000
1174
|
for (const command of rootProgram.commands) {
|
|
@@ -1032,12 +1206,17 @@ function shouldRegisterRuntimeSchemaFlags(invocationArgv) {
|
|
|
1032
1206
|
return RUNTIME_SCHEMA_FLAG_BOOTSTRAP_COMMANDS.has(commandName);
|
|
1033
1207
|
}
|
|
1034
1208
|
const bootstrapInvocation = normalizeBootstrapInvocation(process.argv.slice(2));
|
|
1035
|
-
attachRichHelpText(program, bootstrapInvocation.argv);
|
|
1036
1209
|
async function main() {
|
|
1037
1210
|
const invocationArgv = bootstrapInvocation.argv;
|
|
1038
1211
|
const invocationProcessArgv = [process.argv[0], process.argv[1], ...invocationArgv];
|
|
1212
|
+
const isBareInvocation = invocationArgv.length === 0;
|
|
1039
1213
|
try {
|
|
1040
1214
|
applyBootstrapPagerPolicy(invocationArgv);
|
|
1215
|
+
const registrationSelection = resolveCoreCommandRegistrationSelection(invocationArgv);
|
|
1216
|
+
await registerCoreCommandFamilies(program, registrationSelection);
|
|
1217
|
+
if (shouldAttachRichHelpTextForInvocation(invocationArgv)) {
|
|
1218
|
+
attachRichHelpText(program, invocationArgv);
|
|
1219
|
+
}
|
|
1041
1220
|
const registerDynamicCommands = shouldRegisterDynamicExtensionPaths(program, invocationArgv);
|
|
1042
1221
|
if (registerDynamicCommands) {
|
|
1043
1222
|
await registerDynamicExtensionCommandPaths(program, invocationArgv);
|
|
@@ -1054,6 +1233,10 @@ async function main() {
|
|
|
1054
1233
|
if (renderedBootstrapJsonHelp) {
|
|
1055
1234
|
return;
|
|
1056
1235
|
}
|
|
1236
|
+
if (isBareInvocation) {
|
|
1237
|
+
program.outputHelp();
|
|
1238
|
+
return;
|
|
1239
|
+
}
|
|
1057
1240
|
await program.parseAsync(invocationProcessArgv);
|
|
1058
1241
|
}
|
|
1059
1242
|
catch (error) {
|
|
@@ -1345,4 +1528,5 @@ async function main() {
|
|
|
1345
1528
|
}
|
|
1346
1529
|
}
|
|
1347
1530
|
void main();
|
|
1348
|
-
//# sourceMappingURL=main.js.map
|
|
1531
|
+
//# sourceMappingURL=main.js.map
|
|
1532
|
+
//# debugId=bb46ecaf-3f2f-526b-b6fa-4d87511ede62
|