@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
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
|
|
2
|
+
!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]="478936e5-660a-5f89-b15d-93b37468c7ed")}catch(e){}}();
|
|
1
3
|
import { EXIT_CODE, SETTINGS_DEFAULTS } from "../../core/shared/constants.js";
|
|
2
4
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
3
|
-
import { activateExtensions, getActiveExtensionRegistrations, loadExtensions } from "../../core/extensions/index.js";
|
|
5
|
+
import { activateExtensions, getActiveExtensionRegistrations, loadExtensions, } from "../../core/extensions/index.js";
|
|
4
6
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
5
|
-
import { commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveItemTypeRegistry } from "../../core/item/type-registry.js";
|
|
7
|
+
import { commandOptionFlagLabel, resolveCommandOptionPolicyState, resolveItemTypeRegistry, } from "../../core/item/type-registry.js";
|
|
6
8
|
import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
7
9
|
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
8
10
|
import { readSettings } from "../../core/store/settings.js";
|
|
9
|
-
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMMENTS_AUDIT_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DEDUPE_AUDIT_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, NORMALIZE_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_TOOL_ACTIONS, PM_TOOL_PARAMETERS_SCHEMA, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, compactFlagAliasContracts, } from "../../sdk/cli-contracts.js";
|
|
11
|
+
import { ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS, ACTIVITY_FLAG_CONTRACTS, AGGREGATE_FLAG_CONTRACTS, APPEND_FLAG_CONTRACTS, CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS, CALENDAR_FLAG_CONTRACTS, CLAIM_FLAG_CONTRACTS, CLOSE_TASK_FLAG_CONTRACTS, COMMENTS_FLAG_CONTRACTS, COMMENTS_AUDIT_FLAG_CONTRACTS, CLOSE_FLAG_CONTRACTS, COMPLETION_FLAG_CONTRACTS, CONFIG_FLAG_CONTRACTS, CONTRACTS_FLAG_CONTRACTS, CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS, CONTEXT_FLAG_CONTRACTS, CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, CREATE_COMMANDER_STRING_OPTION_CONTRACTS, CREATE_FLAG_CONTRACTS, DELETE_FLAG_CONTRACTS, DEPS_FLAG_CONTRACTS, DEDUPE_AUDIT_FLAG_CONTRACTS, DOCS_FLAG_CONTRACTS, EXTENSION_FLAG_CONTRACTS, FILES_FLAG_CONTRACTS, GC_FLAG_CONTRACTS, GET_FLAG_CONTRACTS, GUIDE_FLAG_CONTRACTS, GLOBAL_FLAG_CONTRACTS, HEALTH_FLAG_CONTRACTS, HISTORY_FLAG_CONTRACTS, HISTORY_REDACT_FLAG_CONTRACTS, HISTORY_REPAIR_FLAG_CONTRACTS, INSTALL_FLAG_CONTRACTS, INIT_FLAG_CONTRACTS, LEARNINGS_FLAG_CONTRACTS, LIST_COMMANDER_STRING_OPTION_CONTRACTS, LIST_FILTER_FLAG_CONTRACTS, NORMALIZE_FLAG_CONTRACTS, NOTES_FLAG_CONTRACTS, PM_EXTENSION_CAPABILITY_CONTRACTS, PM_EXTENSION_POLICY_MODE_CONTRACTS, PM_EXTENSION_POLICY_SURFACE_CONTRACTS, PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS, PM_EXTENSION_SERVICE_NAME_CONTRACTS, PM_EXTENSION_TRUST_MODE_CONTRACTS, PLAN_FLAG_CONTRACTS, PM_CORE_COMMAND_NAMES, PM_TOOL_ACTIONS, PM_TOOL_PARAMETERS_SCHEMA, REINDEX_FLAG_CONTRACTS, RELEASE_FLAG_CONTRACTS, RESTORE_FLAG_CONTRACTS, SCHEMA_FLAG_CONTRACTS, SEARCH_COMMANDER_STRING_OPTION_CONTRACTS, SEARCH_FLAG_CONTRACTS, START_TASK_FLAG_CONTRACTS, PAUSE_TASK_FLAG_CONTRACTS, TEST_ALL_FLAG_CONTRACTS, TEST_FLAG_CONTRACTS, TEST_RUNS_FLAG_CONTRACTS, UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS, UPDATE_COMMANDER_STRING_OPTION_CONTRACTS, UPDATE_FLAG_CONTRACTS, UPDATE_MANY_FLAG_CONTRACTS, UPGRADE_FLAG_CONTRACTS, VALIDATE_FLAG_CONTRACTS, compactFlagAliasContracts, } from "../../sdk/cli-contracts.js";
|
|
10
12
|
const LIST_COMMAND_NAMES = new Set([
|
|
11
13
|
"list",
|
|
12
14
|
"list-all",
|
|
@@ -55,6 +57,38 @@ const PACKAGE_OWNED_COMMANDS = new Set([
|
|
|
55
57
|
"test-runs stop",
|
|
56
58
|
"test-runs resume",
|
|
57
59
|
]);
|
|
60
|
+
const PACKAGE_OWNED_COMMAND_INSTALL_HINTS = new Map([
|
|
61
|
+
["cal", "calendar"],
|
|
62
|
+
["calendar", "calendar"],
|
|
63
|
+
["comments-audit", "governance-audit"],
|
|
64
|
+
["completion", "guide-shell"],
|
|
65
|
+
["completion-tags", "guide-shell"],
|
|
66
|
+
["dedupe-audit", "governance-audit"],
|
|
67
|
+
["guide", "guide-shell"],
|
|
68
|
+
["normalize", "governance-audit"],
|
|
69
|
+
["reindex", "search-advanced"],
|
|
70
|
+
["templates", "templates"],
|
|
71
|
+
["templates list", "templates"],
|
|
72
|
+
["templates save", "templates"],
|
|
73
|
+
["templates show", "templates"],
|
|
74
|
+
["test-runs", "linked-test-adapters"],
|
|
75
|
+
["test-runs list", "linked-test-adapters"],
|
|
76
|
+
["test-runs status", "linked-test-adapters"],
|
|
77
|
+
["test-runs logs", "linked-test-adapters"],
|
|
78
|
+
["test-runs stop", "linked-test-adapters"],
|
|
79
|
+
["test-runs resume", "linked-test-adapters"],
|
|
80
|
+
]);
|
|
81
|
+
const CANONICAL_COMMAND_ALIASES = [
|
|
82
|
+
{
|
|
83
|
+
canonical: "context",
|
|
84
|
+
aliases: ["ctx"],
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
canonical: "package",
|
|
88
|
+
aliases: ["extension", "packages", "install"],
|
|
89
|
+
},
|
|
90
|
+
];
|
|
91
|
+
const COMMAND_ALIAS_TO_CANONICAL = new Map(CANONICAL_COMMAND_ALIASES.flatMap((entry) => entry.aliases.map((alias) => [alias, entry.canonical])));
|
|
58
92
|
function resolveActionCommandPath(action) {
|
|
59
93
|
if (PM_CORE_COMMAND_NAMES.includes(action)) {
|
|
60
94
|
return normalizeCommandPath(action);
|
|
@@ -77,11 +111,18 @@ function actionDescriptorMatchesSelectedCommand(descriptor, selectedCommand) {
|
|
|
77
111
|
if (descriptor.command_path === null) {
|
|
78
112
|
return false;
|
|
79
113
|
}
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
114
|
+
return splitCommandPathAliases(descriptor.command_path).some((commandPath) => {
|
|
115
|
+
if (commandPath === selectedCommand) {
|
|
116
|
+
return true;
|
|
117
|
+
}
|
|
118
|
+
return commandPath.startsWith(`${selectedCommand} `);
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
function splitCommandPathAliases(commandPath) {
|
|
122
|
+
return commandPath
|
|
123
|
+
.split("|")
|
|
124
|
+
.map((entry) => normalizeCommandPath(entry))
|
|
125
|
+
.filter((entry) => entry.length > 0);
|
|
85
126
|
}
|
|
86
127
|
function resolveScopedCommandsFromActionDescriptors(descriptors, commandCatalog) {
|
|
87
128
|
const commandSet = new Set(commandCatalog);
|
|
@@ -90,18 +131,19 @@ function resolveScopedCommandsFromActionDescriptors(descriptors, commandCatalog)
|
|
|
90
131
|
if (!descriptor.command_path) {
|
|
91
132
|
continue;
|
|
92
133
|
}
|
|
93
|
-
const commandPath
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
continue;
|
|
97
|
-
}
|
|
98
|
-
for (let end = tokens.length; end > 0; end -= 1) {
|
|
99
|
-
const candidate = tokens.slice(0, end).join(" ");
|
|
100
|
-
if (!commandSet.has(candidate)) {
|
|
134
|
+
for (const commandPath of splitCommandPathAliases(descriptor.command_path)) {
|
|
135
|
+
const tokens = commandPath.split(" ").filter((entry) => entry.length > 0);
|
|
136
|
+
if (tokens.length === 0) {
|
|
101
137
|
continue;
|
|
102
138
|
}
|
|
103
|
-
|
|
104
|
-
|
|
139
|
+
for (let end = tokens.length; end > 0; end -= 1) {
|
|
140
|
+
const candidate = tokens.slice(0, end).join(" ");
|
|
141
|
+
if (!commandSet.has(candidate)) {
|
|
142
|
+
continue;
|
|
143
|
+
}
|
|
144
|
+
scoped.add(candidate);
|
|
145
|
+
break;
|
|
146
|
+
}
|
|
105
147
|
}
|
|
106
148
|
}
|
|
107
149
|
return [...scoped].sort((left, right) => left.localeCompare(right));
|
|
@@ -197,8 +239,12 @@ function normalizeStringList(values) {
|
|
|
197
239
|
function toExtensionFlagContract(definition) {
|
|
198
240
|
const longName = toOptionalTrimmedString(definition.long);
|
|
199
241
|
const shortName = toOptionalTrimmedString(definition.short);
|
|
200
|
-
const normalizedLong = longName && longName.startsWith("--") && longName.length > 2
|
|
201
|
-
|
|
242
|
+
const normalizedLong = longName && longName.startsWith("--") && longName.length > 2
|
|
243
|
+
? longName
|
|
244
|
+
: null;
|
|
245
|
+
const normalizedShort = shortName && shortName.startsWith("-") && !shortName.startsWith("--")
|
|
246
|
+
? shortName
|
|
247
|
+
: null;
|
|
202
248
|
const flag = normalizedLong ?? normalizedShort;
|
|
203
249
|
if (!flag) {
|
|
204
250
|
return null;
|
|
@@ -207,6 +253,28 @@ function toExtensionFlagContract(definition) {
|
|
|
207
253
|
if (normalizedShort && normalizedLong) {
|
|
208
254
|
contract.short = normalizedShort;
|
|
209
255
|
}
|
|
256
|
+
const description = toOptionalTrimmedString(definition.description);
|
|
257
|
+
if (description) {
|
|
258
|
+
contract.description = description;
|
|
259
|
+
}
|
|
260
|
+
if (definition.required === true) {
|
|
261
|
+
contract.required = true;
|
|
262
|
+
}
|
|
263
|
+
if (definition.repeatable === true) {
|
|
264
|
+
contract.repeatable = true;
|
|
265
|
+
}
|
|
266
|
+
const valueName = toOptionalTrimmedString(definition.value_name);
|
|
267
|
+
if (valueName) {
|
|
268
|
+
contract.value_name = valueName;
|
|
269
|
+
}
|
|
270
|
+
const rawValueType = [
|
|
271
|
+
toOptionalTrimmedString(definition.value_type),
|
|
272
|
+
toOptionalTrimmedString(definition.type),
|
|
273
|
+
valueName ? "string" : null,
|
|
274
|
+
].find((candidate) => candidate === "string" || candidate === "number" || candidate === "boolean");
|
|
275
|
+
if (rawValueType) {
|
|
276
|
+
contract.value_type = rawValueType;
|
|
277
|
+
}
|
|
210
278
|
return contract;
|
|
211
279
|
}
|
|
212
280
|
function collectExtensionFlagContractsByCommand(registrations) {
|
|
@@ -253,7 +321,7 @@ function collectExtensionFlagContractsByCommand(registrations) {
|
|
|
253
321
|
if (layerOrder !== 0) {
|
|
254
322
|
return layerOrder;
|
|
255
323
|
}
|
|
256
|
-
return left.name.localeCompare(right.name);
|
|
324
|
+
return (left.name ?? "").localeCompare(right.name ?? "");
|
|
257
325
|
}),
|
|
258
326
|
});
|
|
259
327
|
}
|
|
@@ -267,7 +335,8 @@ function collectExtensionCommandContracts(runtimeProbe) {
|
|
|
267
335
|
if (command.length === 0) {
|
|
268
336
|
continue;
|
|
269
337
|
}
|
|
270
|
-
const action = toOptionalTrimmedString(definition.action) ??
|
|
338
|
+
const action = toOptionalTrimmedString(definition.action) ??
|
|
339
|
+
normalizeActionNameFromCommand(command);
|
|
271
340
|
const args = Array.isArray(definition.arguments)
|
|
272
341
|
? definition.arguments
|
|
273
342
|
.map((argument) => {
|
|
@@ -315,7 +384,9 @@ function collectExtensionCommandContracts(runtimeProbe) {
|
|
|
315
384
|
if (definition) {
|
|
316
385
|
contracts.push({
|
|
317
386
|
...definition,
|
|
318
|
-
flags: definition.flags.length > 0
|
|
387
|
+
flags: definition.flags.length > 0
|
|
388
|
+
? definition.flags
|
|
389
|
+
: (flagsByCommand.get(command)?.flags ?? []),
|
|
319
390
|
});
|
|
320
391
|
continue;
|
|
321
392
|
}
|
|
@@ -343,11 +414,17 @@ function extensionSchemaPropertyNameFromFlag(flag) {
|
|
|
343
414
|
return cleaned.length > 0 ? cleaned : null;
|
|
344
415
|
}
|
|
345
416
|
function buildExtensionActionSchemaBranch(contract) {
|
|
417
|
+
const commands = contract.command
|
|
418
|
+
.split("|")
|
|
419
|
+
.map((command) => command.trim())
|
|
420
|
+
.filter((command) => command.length > 0);
|
|
346
421
|
const properties = {
|
|
347
422
|
action: {
|
|
348
423
|
type: "string",
|
|
349
424
|
const: contract.action,
|
|
350
|
-
description: contract.intent ??
|
|
425
|
+
description: contract.intent ??
|
|
426
|
+
contract.description ??
|
|
427
|
+
`Invoke extension command '${contract.command}'.`,
|
|
351
428
|
},
|
|
352
429
|
};
|
|
353
430
|
const required = ["action"];
|
|
@@ -356,13 +433,15 @@ function buildExtensionActionSchemaBranch(contract) {
|
|
|
356
433
|
properties[argument.name] = {
|
|
357
434
|
type: "array",
|
|
358
435
|
items: { type: "string" },
|
|
359
|
-
description: argument.description ??
|
|
436
|
+
description: argument.description ??
|
|
437
|
+
`Variadic argument '${argument.name}' for extension action '${contract.action}'.`,
|
|
360
438
|
};
|
|
361
439
|
}
|
|
362
440
|
else {
|
|
363
441
|
properties[argument.name] = {
|
|
364
442
|
type: "string",
|
|
365
|
-
description: argument.description ??
|
|
443
|
+
description: argument.description ??
|
|
444
|
+
`Argument '${argument.name}' for extension action '${contract.action}'.`,
|
|
366
445
|
};
|
|
367
446
|
}
|
|
368
447
|
if (argument.required) {
|
|
@@ -374,11 +453,16 @@ function buildExtensionActionSchemaBranch(contract) {
|
|
|
374
453
|
if (!propertyName || properties[propertyName] !== undefined) {
|
|
375
454
|
continue;
|
|
376
455
|
}
|
|
377
|
-
const
|
|
456
|
+
const valueType = flag.value_type ?? "boolean";
|
|
457
|
+
const schemaType = valueType === "boolean" ? "boolean" : valueType === "number" ? ["number", "string"] : "string";
|
|
378
458
|
properties[propertyName] = {
|
|
379
|
-
type:
|
|
380
|
-
|
|
459
|
+
type: flag.repeatable ? "array" : schemaType,
|
|
460
|
+
...(flag.repeatable ? { items: { type: schemaType } } : {}),
|
|
461
|
+
description: flag.description ?? `Extension option '${flag.flag}' for action '${contract.action}'.`,
|
|
381
462
|
};
|
|
463
|
+
if (flag.required === true) {
|
|
464
|
+
required.push(propertyName);
|
|
465
|
+
}
|
|
382
466
|
}
|
|
383
467
|
return {
|
|
384
468
|
type: "object",
|
|
@@ -386,9 +470,57 @@ function buildExtensionActionSchemaBranch(contract) {
|
|
|
386
470
|
required,
|
|
387
471
|
additionalProperties: true,
|
|
388
472
|
"x-extension-source": contract.source,
|
|
389
|
-
"x-extension-command": contract.command,
|
|
473
|
+
"x-extension-command": commands[0] ?? contract.command,
|
|
474
|
+
"x-extension-commands": commands,
|
|
390
475
|
};
|
|
391
476
|
}
|
|
477
|
+
function mergeExtensionFlagContract(existing, incoming) {
|
|
478
|
+
existing.description ??= incoming.description;
|
|
479
|
+
existing.value_name ??= incoming.value_name;
|
|
480
|
+
existing.value_type ??= incoming.value_type;
|
|
481
|
+
if (incoming.required === true) {
|
|
482
|
+
existing.required = true;
|
|
483
|
+
}
|
|
484
|
+
if (incoming.repeatable === true) {
|
|
485
|
+
existing.repeatable = true;
|
|
486
|
+
}
|
|
487
|
+
}
|
|
488
|
+
function mergeExtensionContractsByAction(contracts) {
|
|
489
|
+
const byAction = new Map();
|
|
490
|
+
for (const contract of contracts) {
|
|
491
|
+
const existing = byAction.get(contract.action);
|
|
492
|
+
if (!existing) {
|
|
493
|
+
byAction.set(contract.action, {
|
|
494
|
+
...contract,
|
|
495
|
+
flags: [...contract.flags],
|
|
496
|
+
examples: [...contract.examples],
|
|
497
|
+
failure_hints: [...contract.failure_hints],
|
|
498
|
+
});
|
|
499
|
+
continue;
|
|
500
|
+
}
|
|
501
|
+
existing.command = [...new Set([existing.command, contract.command])]
|
|
502
|
+
.sort((left, right) => left.localeCompare(right))
|
|
503
|
+
.join("|");
|
|
504
|
+
existing.arguments = existing.arguments.length >= contract.arguments.length ? existing.arguments : contract.arguments;
|
|
505
|
+
const flagKeys = new Set(existing.flags.map((flag) => `${flag.flag}|${flag.short ?? ""}`));
|
|
506
|
+
for (const flag of contract.flags) {
|
|
507
|
+
const key = `${flag.flag}|${flag.short ?? ""}`;
|
|
508
|
+
if (!flagKeys.has(key)) {
|
|
509
|
+
flagKeys.add(key);
|
|
510
|
+
existing.flags.push(flag);
|
|
511
|
+
}
|
|
512
|
+
else {
|
|
513
|
+
const existingFlag = existing.flags.find((candidate) => `${candidate.flag}|${candidate.short ?? ""}` === key);
|
|
514
|
+
if (existingFlag) {
|
|
515
|
+
mergeExtensionFlagContract(existingFlag, flag);
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
existing.examples = [...new Set([...existing.examples, ...contract.examples])];
|
|
520
|
+
existing.failure_hints = [...new Set([...existing.failure_hints, ...contract.failure_hints])];
|
|
521
|
+
}
|
|
522
|
+
return [...byAction.values()].sort((left, right) => left.action.localeCompare(right.action));
|
|
523
|
+
}
|
|
392
524
|
async function resolveRuntimeExtensionActionProbe(global) {
|
|
393
525
|
const defaultPolicyState = {
|
|
394
526
|
mode: SETTINGS_DEFAULTS.extensions.policy.mode,
|
|
@@ -401,6 +533,7 @@ async function resolveRuntimeExtensionActionProbe(global) {
|
|
|
401
533
|
disabledReason: "extensions_disabled",
|
|
402
534
|
commandDefinitions: [],
|
|
403
535
|
flagRegistrations: [],
|
|
536
|
+
registrations: null,
|
|
404
537
|
policyState: defaultPolicyState,
|
|
405
538
|
};
|
|
406
539
|
}
|
|
@@ -411,6 +544,7 @@ async function resolveRuntimeExtensionActionProbe(global) {
|
|
|
411
544
|
disabledReason: null,
|
|
412
545
|
commandDefinitions: [],
|
|
413
546
|
flagRegistrations: [],
|
|
547
|
+
registrations: null,
|
|
414
548
|
policyState: defaultPolicyState,
|
|
415
549
|
};
|
|
416
550
|
}
|
|
@@ -432,6 +566,7 @@ async function resolveRuntimeExtensionActionProbe(global) {
|
|
|
432
566
|
disabledReason: null,
|
|
433
567
|
commandDefinitions: activationResult.registrations.commands,
|
|
434
568
|
flagRegistrations: activationResult.registrations.flags,
|
|
569
|
+
registrations: activationResult.registrations,
|
|
435
570
|
policyState: {
|
|
436
571
|
mode: loadResult.policy.mode,
|
|
437
572
|
trust_mode: loadResult.policy.trust_mode,
|
|
@@ -445,6 +580,7 @@ async function resolveRuntimeExtensionActionProbe(global) {
|
|
|
445
580
|
disabledReason: "extension_runtime_probe_failed",
|
|
446
581
|
commandDefinitions: [],
|
|
447
582
|
flagRegistrations: [],
|
|
583
|
+
registrations: null,
|
|
448
584
|
policyState: defaultPolicyState,
|
|
449
585
|
};
|
|
450
586
|
}
|
|
@@ -474,7 +610,7 @@ function collectActionContractDescriptors(extensionContracts) {
|
|
|
474
610
|
command_path: normalizeCommandPath(contract.command),
|
|
475
611
|
});
|
|
476
612
|
}
|
|
477
|
-
return [...descriptors.values()].sort((left, right) => left.action.localeCompare(right.action));
|
|
613
|
+
return [...descriptors.values()].sort((left, right) => (left.action ?? "").localeCompare(right.action ?? ""));
|
|
478
614
|
}
|
|
479
615
|
function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
480
616
|
if (descriptor.provider === "core" && !descriptor.requires_extension) {
|
|
@@ -489,8 +625,10 @@ function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
|
489
625
|
cli_exposed: descriptor.command_path !== null,
|
|
490
626
|
};
|
|
491
627
|
}
|
|
492
|
-
const
|
|
493
|
-
|
|
628
|
+
const commandPaths = descriptor.command_path
|
|
629
|
+
? splitCommandPathAliases(descriptor.command_path)
|
|
630
|
+
: [];
|
|
631
|
+
const extensionCommandAvailable = commandPaths.some((commandPath) => runtimeProbe.handlers.has(commandPath));
|
|
494
632
|
const invocable = runtimeProbe.disabledReason === null && extensionCommandAvailable;
|
|
495
633
|
return {
|
|
496
634
|
action: descriptor.action,
|
|
@@ -498,7 +636,9 @@ function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
|
498
636
|
available: invocable,
|
|
499
637
|
requires_extension: true,
|
|
500
638
|
provider: "extension",
|
|
501
|
-
disabled_reason: invocable
|
|
639
|
+
disabled_reason: invocable
|
|
640
|
+
? null
|
|
641
|
+
: (runtimeProbe.disabledReason ?? "extension_command_not_registered"),
|
|
502
642
|
command_path: descriptor.command_path,
|
|
503
643
|
cli_exposed: extensionCommandAvailable,
|
|
504
644
|
policy_state: {
|
|
@@ -509,12 +649,20 @@ function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
|
509
649
|
};
|
|
510
650
|
}
|
|
511
651
|
function resolveCoreCommandFlags(command) {
|
|
652
|
+
if (command === "init") {
|
|
653
|
+
return INIT_FLAG_CONTRACTS;
|
|
654
|
+
}
|
|
512
655
|
if (command === "config") {
|
|
513
656
|
return CONFIG_FLAG_CONTRACTS;
|
|
514
657
|
}
|
|
515
|
-
if (command === "extension" ||
|
|
658
|
+
if (command === "extension" ||
|
|
659
|
+
command === "package" ||
|
|
660
|
+
command === "packages") {
|
|
516
661
|
return EXTENSION_FLAG_CONTRACTS;
|
|
517
662
|
}
|
|
663
|
+
if (command === "install") {
|
|
664
|
+
return INSTALL_FLAG_CONTRACTS;
|
|
665
|
+
}
|
|
518
666
|
if (command === "create") {
|
|
519
667
|
return CREATE_FLAG_CONTRACTS;
|
|
520
668
|
}
|
|
@@ -536,6 +684,9 @@ function resolveCoreCommandFlags(command) {
|
|
|
536
684
|
if (command === "context" || command === "ctx") {
|
|
537
685
|
return CONTEXT_FLAG_CONTRACTS;
|
|
538
686
|
}
|
|
687
|
+
if (command === "get") {
|
|
688
|
+
return GET_FLAG_CONTRACTS;
|
|
689
|
+
}
|
|
539
690
|
if (command === "search") {
|
|
540
691
|
return SEARCH_FLAG_CONTRACTS;
|
|
541
692
|
}
|
|
@@ -557,6 +708,18 @@ function resolveCoreCommandFlags(command) {
|
|
|
557
708
|
if (command === "history") {
|
|
558
709
|
return HISTORY_FLAG_CONTRACTS;
|
|
559
710
|
}
|
|
711
|
+
if (command === "history-redact") {
|
|
712
|
+
return HISTORY_REDACT_FLAG_CONTRACTS;
|
|
713
|
+
}
|
|
714
|
+
if (command === "history-repair") {
|
|
715
|
+
return HISTORY_REPAIR_FLAG_CONTRACTS;
|
|
716
|
+
}
|
|
717
|
+
if (command === "schema") {
|
|
718
|
+
return SCHEMA_FLAG_CONTRACTS;
|
|
719
|
+
}
|
|
720
|
+
if (command === "plan") {
|
|
721
|
+
return PLAN_FLAG_CONTRACTS;
|
|
722
|
+
}
|
|
560
723
|
if (command === "restore") {
|
|
561
724
|
return RESTORE_FLAG_CONTRACTS;
|
|
562
725
|
}
|
|
@@ -682,13 +845,20 @@ function buildRuntimeFieldFlagContracts(fieldRegistry) {
|
|
|
682
845
|
if (!primaryFlag) {
|
|
683
846
|
continue;
|
|
684
847
|
}
|
|
685
|
-
const shortAlias = definition.cli_aliases
|
|
848
|
+
const shortAlias = definition.cli_aliases
|
|
849
|
+
.map((alias) => toRuntimeShortFlagToken(alias))
|
|
850
|
+
.find((alias) => alias !== null);
|
|
686
851
|
const longAliases = definition.cli_aliases
|
|
687
852
|
.map((alias) => toRuntimeLongFlagToken(alias))
|
|
688
853
|
.filter((alias) => alias !== null && alias !== primaryFlag);
|
|
689
854
|
for (const command of definition.commands) {
|
|
690
|
-
const bucket = buckets.get(command) ?? {
|
|
691
|
-
|
|
855
|
+
const bucket = buckets.get(command) ?? {
|
|
856
|
+
flags: [],
|
|
857
|
+
seen: new Set(),
|
|
858
|
+
};
|
|
859
|
+
const primaryContract = shortAlias
|
|
860
|
+
? { flag: primaryFlag, short: shortAlias }
|
|
861
|
+
: { flag: primaryFlag };
|
|
692
862
|
const primaryKey = `${primaryContract.flag}|${primaryContract.short ?? ""}`;
|
|
693
863
|
if (!bucket.seen.has(primaryKey)) {
|
|
694
864
|
bucket.seen.add(primaryKey);
|
|
@@ -727,8 +897,7 @@ function mergeFlagContracts(primary, secondary) {
|
|
|
727
897
|
function buildCommandFlagSurface(commands, extensionFlagMap, runtimeFieldFlagMap) {
|
|
728
898
|
return commands
|
|
729
899
|
.map((command) => {
|
|
730
|
-
const isCoreCommand = PM_CORE_COMMAND_NAMES.includes(command) &&
|
|
731
|
-
!PACKAGE_OWNED_COMMANDS.has(command);
|
|
900
|
+
const isCoreCommand = PM_CORE_COMMAND_NAMES.includes(command) && !PACKAGE_OWNED_COMMANDS.has(command);
|
|
732
901
|
const coreFlags = isCoreCommand ? resolveCoreCommandFlags(command) : [];
|
|
733
902
|
const runtimeFlags = runtimeFieldFlagMap.get(normalizeCommandForRuntimeFieldFlags(command)) ?? [];
|
|
734
903
|
const extensionFlags = extensionFlagMap.get(command);
|
|
@@ -748,6 +917,25 @@ function buildCommandFlagSurface(commands, extensionFlagMap, runtimeFieldFlagMap
|
|
|
748
917
|
})
|
|
749
918
|
.sort((left, right) => left.command.localeCompare(right.command));
|
|
750
919
|
}
|
|
920
|
+
function compactCommandAliasSurface(commands) {
|
|
921
|
+
const commandSet = new Set(commands);
|
|
922
|
+
const result = [];
|
|
923
|
+
for (const command of commands) {
|
|
924
|
+
const canonical = COMMAND_ALIAS_TO_CANONICAL.get(command);
|
|
925
|
+
if (canonical && commandSet.has(canonical)) {
|
|
926
|
+
continue;
|
|
927
|
+
}
|
|
928
|
+
result.push(command);
|
|
929
|
+
}
|
|
930
|
+
return result;
|
|
931
|
+
}
|
|
932
|
+
function buildCommandAliasSurface(commands) {
|
|
933
|
+
const commandSet = new Set(commands);
|
|
934
|
+
return CANONICAL_COMMAND_ALIASES.map((entry) => ({
|
|
935
|
+
canonical: entry.canonical,
|
|
936
|
+
aliases: entry.aliases.filter((alias) => commandSet.has(alias)),
|
|
937
|
+
})).filter((entry) => commandSet.has(entry.canonical) && entry.aliases.length > 0);
|
|
938
|
+
}
|
|
751
939
|
function buildCommanderAliasSurface() {
|
|
752
940
|
return {
|
|
753
941
|
create_string_options: CREATE_COMMANDER_STRING_OPTION_CONTRACTS,
|
|
@@ -762,7 +950,7 @@ function buildCommanderAliasSurface() {
|
|
|
762
950
|
};
|
|
763
951
|
}
|
|
764
952
|
function resolveCreateRequiredOptionContract(typeDefinition, createMode) {
|
|
765
|
-
const baseRequiredOptions = new Set(["title", "
|
|
953
|
+
const baseRequiredOptions = new Set(["title", "type"]);
|
|
766
954
|
if (createMode === "strict") {
|
|
767
955
|
for (const field of typeDefinition.required_create_fields) {
|
|
768
956
|
baseRequiredOptions.add(field);
|
|
@@ -773,8 +961,14 @@ function resolveCreateRequiredOptionContract(typeDefinition, createMode) {
|
|
|
773
961
|
}
|
|
774
962
|
const policyState = resolveCommandOptionPolicyState(typeDefinition, "create", baseRequiredOptions);
|
|
775
963
|
const requiredOptionKeys = [...new Set(policyState.required)].sort((left, right) => left.localeCompare(right));
|
|
776
|
-
const requiredFlags = [
|
|
777
|
-
|
|
964
|
+
const requiredFlags = [
|
|
965
|
+
...new Set(requiredOptionKeys.map((option) => commandOptionFlagLabel("create", option))),
|
|
966
|
+
].sort((left, right) => left.localeCompare(right));
|
|
967
|
+
const requiredTypeOptions = [
|
|
968
|
+
...new Set(typeDefinition.options
|
|
969
|
+
.filter((option) => option.required === true)
|
|
970
|
+
.map((option) => option.key)),
|
|
971
|
+
].sort((left, right) => left.localeCompare(right));
|
|
778
972
|
return {
|
|
779
973
|
required_option_keys: requiredOptionKeys,
|
|
780
974
|
required_flags: requiredFlags,
|
|
@@ -841,7 +1035,19 @@ export async function runContracts(options, global) {
|
|
|
841
1035
|
const flagsOnly = options.flagsOnly === true;
|
|
842
1036
|
const availabilityOnly = options.availabilityOnly === true;
|
|
843
1037
|
const runtimeOnly = options.runtimeOnly === true;
|
|
844
|
-
const
|
|
1038
|
+
const fullOutput = options.full === true;
|
|
1039
|
+
const unfilteredDefaultBriefMode = !fullOutput && !schemaOnly && !flagsOnly && !availabilityOnly && !selectedAction && !selectedCommand;
|
|
1040
|
+
// Agent token-cost guard: when no filter and no projection flag and not --full,
|
|
1041
|
+
// skip the giant schema oneOf union (the 200KB+ chunk). Restore via --full
|
|
1042
|
+
// or by scoping to a specific --command/--action.
|
|
1043
|
+
const omitUnfilteredSchema = unfilteredDefaultBriefMode;
|
|
1044
|
+
const omitUnfilteredCommandFlags = unfilteredDefaultBriefMode;
|
|
1045
|
+
const omitUnfilteredCommanderAliases = unfilteredDefaultBriefMode;
|
|
1046
|
+
const projectionFlagsEnabled = [
|
|
1047
|
+
schemaOnly,
|
|
1048
|
+
flagsOnly,
|
|
1049
|
+
availabilityOnly,
|
|
1050
|
+
].filter((value) => value).length;
|
|
845
1051
|
if (projectionFlagsEnabled > 1) {
|
|
846
1052
|
throw new PmCliError("Choose only one projection flag: --schema-only, --flags-only, or --availability-only.", EXIT_CODE.USAGE);
|
|
847
1053
|
}
|
|
@@ -853,15 +1059,16 @@ export async function runContracts(options, global) {
|
|
|
853
1059
|
catch {
|
|
854
1060
|
settings = structuredClone(SETTINGS_DEFAULTS);
|
|
855
1061
|
}
|
|
856
|
-
const
|
|
1062
|
+
const runtimeProbe = await resolveRuntimeExtensionActionProbe(global);
|
|
1063
|
+
const typeRegistry = resolveItemTypeRegistry(settings, runtimeProbe.registrations ?? getActiveExtensionRegistrations());
|
|
857
1064
|
const statusRegistry = resolveRuntimeStatusRegistry(settings.schema);
|
|
858
1065
|
const runtimeFieldRegistry = resolveRuntimeFieldRegistry(settings.schema);
|
|
859
1066
|
const runtimeFieldFlagMap = buildRuntimeFieldFlagContracts(runtimeFieldRegistry);
|
|
860
1067
|
const createRequiredOptionContracts = buildCreateRequiredOptionContracts(typeRegistry);
|
|
861
|
-
const runtimeProbe = await resolveRuntimeExtensionActionProbe(global);
|
|
862
1068
|
const extensionContracts = collectExtensionCommandContracts(runtimeProbe);
|
|
1069
|
+
const mergedExtensionContracts = mergeExtensionContractsByAction(extensionContracts);
|
|
863
1070
|
const extensionFlagMap = collectExtensionFlagContractsByCommand(runtimeProbe.flagRegistrations);
|
|
864
|
-
const actionDescriptors = collectActionContractDescriptors(
|
|
1071
|
+
const actionDescriptors = collectActionContractDescriptors(mergedExtensionContracts);
|
|
865
1072
|
const actionNames = new Set(actionDescriptors.map((entry) => entry.action));
|
|
866
1073
|
if (selectedAction && !actionNames.has(selectedAction)) {
|
|
867
1074
|
throw new PmCliError(`Unknown action: "${options.action}".`, EXIT_CODE.USAGE);
|
|
@@ -869,7 +1076,7 @@ export async function runContracts(options, global) {
|
|
|
869
1076
|
const commandCatalog = [
|
|
870
1077
|
...new Set([
|
|
871
1078
|
...PM_CORE_COMMAND_NAMES.filter((entry) => !PACKAGE_OWNED_COMMANDS.has(entry)),
|
|
872
|
-
...
|
|
1079
|
+
...mergedExtensionContracts.flatMap((entry) => entry.command.split("|")),
|
|
873
1080
|
]),
|
|
874
1081
|
]
|
|
875
1082
|
.map((entry) => normalizeCommandPath(entry))
|
|
@@ -877,6 +1084,16 @@ export async function runContracts(options, global) {
|
|
|
877
1084
|
.sort((left, right) => left.localeCompare(right));
|
|
878
1085
|
const commandNames = new Set(commandCatalog);
|
|
879
1086
|
if (selectedCommand && !commandNames.has(selectedCommand)) {
|
|
1087
|
+
const packageHint = PACKAGE_OWNED_COMMAND_INSTALL_HINTS.get(selectedCommand);
|
|
1088
|
+
if (packageHint) {
|
|
1089
|
+
throw new PmCliError(`Unknown command: "${options.command}". Command "${selectedCommand}" is provided by the optional "${packageHint}" package. Run "pm install ${packageHint} --project" and retry.`, EXIT_CODE.USAGE, {
|
|
1090
|
+
examples: [`pm install ${packageHint} --project`, `pm contracts --command ${selectedCommand} --flags-only --json`],
|
|
1091
|
+
nextSteps: [`Install the optional package first: pm install ${packageHint} --project`],
|
|
1092
|
+
recovery: {
|
|
1093
|
+
suggested_retry: `pm install ${packageHint} --project`,
|
|
1094
|
+
},
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
880
1097
|
throw new PmCliError(`Unknown command: "${options.command}".`, EXIT_CODE.USAGE);
|
|
881
1098
|
}
|
|
882
1099
|
const commandScopedDescriptors = selectedCommand
|
|
@@ -903,7 +1120,7 @@ export async function runContracts(options, global) {
|
|
|
903
1120
|
return typeof actionConst === "string" ? actionConst : null;
|
|
904
1121
|
})
|
|
905
1122
|
.filter((entry) => entry !== null));
|
|
906
|
-
const extensionBranches =
|
|
1123
|
+
const extensionBranches = mergedExtensionContracts
|
|
907
1124
|
.filter((contract) => !schemaActionSet.has(contract.action))
|
|
908
1125
|
.map((contract) => buildExtensionActionSchemaBranch(contract));
|
|
909
1126
|
const mergedSchema = extensionBranches.length > 0
|
|
@@ -916,7 +1133,9 @@ export async function runContracts(options, global) {
|
|
|
916
1133
|
? commandScopedDescriptors.filter((descriptor) => descriptor.action === selectedAction)
|
|
917
1134
|
: commandScopedDescriptors;
|
|
918
1135
|
const allActionAvailability = scopedActionDescriptors.map((descriptor) => resolveActionAvailability(descriptor, runtimeProbe));
|
|
919
|
-
const actionAvailability = runtimeOnly && !selectedAction
|
|
1136
|
+
const actionAvailability = runtimeOnly && !selectedAction
|
|
1137
|
+
? allActionAvailability.filter((entry) => entry.invocable)
|
|
1138
|
+
: allActionAvailability;
|
|
920
1139
|
const actions = actionAvailability.map((entry) => entry.action);
|
|
921
1140
|
const descriptorActionSet = new Set(actionDescriptors.map((descriptor) => descriptor.action));
|
|
922
1141
|
let filteredSchema = selectedAction
|
|
@@ -936,14 +1155,23 @@ export async function runContracts(options, global) {
|
|
|
936
1155
|
: selectedAction
|
|
937
1156
|
? resolveScopedCommandsFromActionDescriptors(scopedActionDescriptors, commandCatalog)
|
|
938
1157
|
: commandCatalog;
|
|
1158
|
+
const outputCommands = flagsOnly && selectedCommand === undefined && selectedAction === undefined
|
|
1159
|
+
? compactCommandAliasSurface(commands)
|
|
1160
|
+
: commands;
|
|
1161
|
+
const commandAliases = buildCommandAliasSurface(commands);
|
|
939
1162
|
const extensionCommandContracts = selectedCommand
|
|
940
1163
|
? extensionContracts.filter((entry) => entry.command === selectedCommand)
|
|
941
1164
|
: selectedAction
|
|
942
|
-
? extensionContracts.filter((entry) =>
|
|
1165
|
+
? extensionContracts.filter((entry) => outputCommands.includes(normalizeCommandPath(entry.command)))
|
|
943
1166
|
: extensionContracts;
|
|
1167
|
+
const includeRuntimeContractSections = !(flagsOnly && !fullOutput);
|
|
944
1168
|
const result = {
|
|
945
|
-
schema_version: typeof mergedSchema["x-schema-version"] === "string"
|
|
946
|
-
|
|
1169
|
+
schema_version: typeof mergedSchema["x-schema-version"] === "string"
|
|
1170
|
+
? mergedSchema["x-schema-version"]
|
|
1171
|
+
: null,
|
|
1172
|
+
schema_id: typeof mergedSchema.$id === "string"
|
|
1173
|
+
? mergedSchema.$id
|
|
1174
|
+
: null,
|
|
947
1175
|
selected: {
|
|
948
1176
|
action: selectedAction ?? null,
|
|
949
1177
|
command: selectedCommand ?? null,
|
|
@@ -953,8 +1181,10 @@ export async function runContracts(options, global) {
|
|
|
953
1181
|
runtime_only: runtimeOnly,
|
|
954
1182
|
command_scoped: selectedCommand !== undefined,
|
|
955
1183
|
},
|
|
956
|
-
commands,
|
|
957
|
-
|
|
1184
|
+
commands: outputCommands,
|
|
1185
|
+
};
|
|
1186
|
+
if (includeRuntimeContractSections) {
|
|
1187
|
+
result.runtime_schema = {
|
|
958
1188
|
statuses: statusRegistry.definitions.map((definition) => definition.id),
|
|
959
1189
|
open_status: statusRegistry.open_status,
|
|
960
1190
|
close_status: statusRegistry.close_status,
|
|
@@ -962,10 +1192,12 @@ export async function runContracts(options, global) {
|
|
|
962
1192
|
types: [...typeRegistry.types],
|
|
963
1193
|
fields_by_command: Object.fromEntries([...runtimeFieldRegistry.command_to_fields.entries()].map(([command, definitions]) => [
|
|
964
1194
|
command,
|
|
965
|
-
[
|
|
1195
|
+
[
|
|
1196
|
+
...new Set(definitions.map((definition) => `--${definition.cli_flag}`)),
|
|
1197
|
+
].sort((left, right) => left.localeCompare(right)),
|
|
966
1198
|
])),
|
|
967
|
-
}
|
|
968
|
-
extension_contracts
|
|
1199
|
+
};
|
|
1200
|
+
result.extension_contracts = {
|
|
969
1201
|
capabilities: [...PM_EXTENSION_CAPABILITY_CONTRACTS],
|
|
970
1202
|
services: [...PM_EXTENSION_SERVICE_NAME_CONTRACTS],
|
|
971
1203
|
policy_modes: [...PM_EXTENSION_POLICY_MODE_CONTRACTS],
|
|
@@ -978,22 +1210,40 @@ export async function runContracts(options, global) {
|
|
|
978
1210
|
previous: ["v1"],
|
|
979
1211
|
breaking_strategy: "versioned_breaking",
|
|
980
1212
|
},
|
|
981
|
-
}
|
|
982
|
-
}
|
|
1213
|
+
};
|
|
1214
|
+
}
|
|
983
1215
|
if (!flagsOnly) {
|
|
984
1216
|
result.actions = actions;
|
|
985
1217
|
result.action_availability = actionAvailability;
|
|
986
1218
|
}
|
|
987
|
-
if (includeSchemaSurface) {
|
|
1219
|
+
if (includeSchemaSurface && !omitUnfilteredSchema) {
|
|
988
1220
|
result.schema = filteredSchema;
|
|
989
1221
|
result.extension_commands = extensionCommandContracts;
|
|
990
1222
|
}
|
|
1223
|
+
else if (includeSchemaSurface && omitUnfilteredSchema) {
|
|
1224
|
+
result.schema_omitted_reason = "unfiltered_default_brief";
|
|
1225
|
+
result.extension_commands = extensionCommandContracts;
|
|
1226
|
+
}
|
|
991
1227
|
if (!schemaOnly && !availabilityOnly) {
|
|
992
|
-
|
|
1228
|
+
if (!omitUnfilteredCommandFlags) {
|
|
1229
|
+
result.command_flags = buildCommandFlagSurface(outputCommands, extensionFlagMap, runtimeFieldFlagMap);
|
|
1230
|
+
}
|
|
1231
|
+
else {
|
|
1232
|
+
result.command_flags_omitted_reason = "unfiltered_default_brief";
|
|
1233
|
+
}
|
|
1234
|
+
if (commandAliases.length > 0) {
|
|
1235
|
+
result.command_aliases = commandAliases;
|
|
1236
|
+
}
|
|
993
1237
|
}
|
|
994
1238
|
if (!schemaOnly && !flagsOnly && !availabilityOnly) {
|
|
995
|
-
|
|
1239
|
+
if (!omitUnfilteredCommanderAliases) {
|
|
1240
|
+
result.commander_aliases = buildCommanderAliasSurface();
|
|
1241
|
+
}
|
|
1242
|
+
else {
|
|
1243
|
+
result.commander_aliases_omitted_reason = "unfiltered_default_brief";
|
|
1244
|
+
}
|
|
996
1245
|
}
|
|
997
1246
|
return result;
|
|
998
1247
|
}
|
|
999
|
-
//# sourceMappingURL=contracts.js.map
|
|
1248
|
+
//# sourceMappingURL=contracts.js.map
|
|
1249
|
+
//# debugId=478936e5-660a-5f89-b15d-93b37468c7ed
|