@unbrained/pm-cli 2026.5.12 → 2026.5.18
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 +22 -0
- package/CONTRIBUTING.md +1 -0
- package/PRD.md +7 -28
- package/README.md +8 -14
- 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 +32 -1
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +23 -5
- 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/append.js +4 -1
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +9 -3
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.d.ts +3 -0
- package/dist/cli/commands/claim.js +19 -3
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +4 -1
- 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.js +4 -1
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +98 -2
- 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 +19 -5
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +9 -0
- package/dist/cli/commands/contracts.js +205 -49
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +88 -9
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +4 -1
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.js +4 -1
- 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.js +4 -1
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/extension.d.ts +7 -2
- package/dist/cli/commands/extension.js +360 -64
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +4 -1
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +4 -1
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +7 -3
- package/dist/cli/commands/get.js +91 -18
- 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 +4 -0
- package/dist/cli/commands/health.js +31 -8
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +42 -0
- package/dist/cli/commands/history-redact.js +559 -0
- package/dist/cli/commands/history-redact.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -0
- package/dist/cli/commands/history.js +14 -3
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +2 -8
- package/dist/cli/commands/index.js +6 -9
- 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 +14 -0
- package/dist/cli/commands/init.js +75 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +4 -1
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/list.d.ts +1 -0
- package/dist/cli/commands/list.js +42 -18
- 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 +4 -1
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +118 -0
- package/dist/cli/commands/plan.js +975 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/reindex.d.ts +8 -0
- package/dist/cli/commands/reindex.js +100 -24
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.js +4 -1
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/search.js +58 -27
- 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.js +4 -1
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.js +4 -1
- 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.js +4 -1
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +4 -1
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +114 -71
- 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.js +32 -4
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +5 -2
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.js +4 -1
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.js +4 -1
- 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.js +52 -33
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.js +4 -1
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +276 -32
- 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.js +55 -150
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.js +277 -261
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +62 -199
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +55 -146
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +2 -2
- package/dist/cli/registration-helpers.js +11 -21
- 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 +45 -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.js +4 -1
- 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 +84 -54
- 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/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/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 +241 -2
- package/dist/core/item/item-format.js.map +1 -1
- 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 +33 -3
- package/dist/core/item/parse.js.map +1 -1
- 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.js +4 -1
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/type-registry.js +4 -1
- 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/command-aware.js +4 -1
- package/dist/core/output/command-aware.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 +27 -1
- package/dist/core/packages/manifest.js +87 -1
- 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/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.js +4 -1
- 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.d.ts +13 -1
- package/dist/core/search/embedding-batches.js +40 -8
- 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 +11 -2
- 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/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/levenshtein.js +4 -1
- package/dist/core/shared/levenshtein.js.map +1 -1
- 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.js +4 -1
- 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.d.ts +8 -1
- package/dist/core/store/front-matter-cache.js +28 -14
- 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 +2 -0
- package/dist/core/store/item-store.js +66 -3
- 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.js +39 -1
- 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 +31 -5
- 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.d.ts +8 -0
- package/dist/mcp/server.js +212 -53
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +7 -0
- package/dist/sdk/cli-contracts/commander-mutation-options.js +484 -0
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -0
- package/dist/sdk/cli-contracts/commander-types.d.ts +21 -0
- package/dist/sdk/cli-contracts/commander-types.js +95 -0
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -0
- package/dist/sdk/cli-contracts.d.ts +10 -17
- package/dist/sdk/cli-contracts.js +232 -282
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.d.ts +2 -1
- package/dist/sdk/index.js +5 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +29 -0
- package/dist/sdk/runtime.js +31 -0
- package/dist/sdk/runtime.js.map +1 -0
- package/dist/types/index.js +4 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types.d.ts +86 -2
- package/dist/types.js +34 -1
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +16 -6
- package/docs/CLAUDE_CODE_PLUGIN.md +10 -10
- package/docs/CODEX_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +83 -8
- package/docs/CONFIGURATION.md +4 -1
- package/docs/EXTENSIONS.md +176 -807
- package/docs/QUICKSTART.md +12 -5
- package/docs/README.md +7 -6
- package/docs/RELEASING.md +6 -4
- package/docs/SDK.md +78 -441
- package/docs/TESTING.md +2 -2
- package/marketplace.json +3 -3
- package/package.json +7 -4
- package/packages/pm-beads/extensions/beads/index.js +90 -101
- package/packages/pm-beads/extensions/beads/index.ts +2 -2
- package/packages/pm-beads/extensions/beads/runtime.js +2 -17
- package/packages/pm-beads/extensions/beads/runtime.ts +41 -18
- package/packages/pm-beads/package.json +34 -1
- package/packages/pm-calendar/README.md +13 -0
- package/packages/pm-calendar/extensions/calendar/index.js +56 -0
- package/packages/pm-calendar/extensions/calendar/index.ts +62 -0
- package/packages/pm-calendar/extensions/calendar/manifest.json +7 -0
- package/packages/pm-calendar/extensions/calendar/runtime.js +114 -0
- package/packages/pm-calendar/extensions/calendar/runtime.ts +123 -0
- package/packages/pm-calendar/package.json +51 -0
- package/packages/pm-governance-audit/README.md +23 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.js +117 -0
- package/packages/pm-governance-audit/extensions/governance-audit/index.ts +118 -0
- package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +7 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +159 -0
- package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +176 -0
- package/packages/pm-governance-audit/package.json +52 -0
- package/packages/pm-guide-shell/README.md +23 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +76 -0
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +81 -0
- package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +7 -0
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +263 -0
- package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +327 -0
- package/packages/pm-guide-shell/package.json +52 -0
- package/packages/pm-linked-test-adapters/README.md +24 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +101 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +102 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +7 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +142 -0
- package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +173 -0
- package/packages/pm-linked-test-adapters/package.json +53 -0
- package/packages/pm-search-advanced/README.md +27 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +93 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +94 -0
- package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +7 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +120 -0
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +144 -0
- package/packages/pm-search-advanced/package.json +54 -0
- package/packages/pm-templates/README.md +20 -0
- package/packages/pm-templates/extensions/templates/index.js +101 -0
- package/packages/pm-templates/extensions/templates/index.ts +109 -0
- package/packages/pm-templates/extensions/templates/manifest.json +7 -0
- package/packages/pm-templates/extensions/templates/runtime.js +226 -0
- package/packages/pm-templates/extensions/templates/runtime.ts +283 -0
- package/packages/pm-templates/package.json +50 -0
- package/packages/pm-todos/extensions/todos/index.js +105 -116
- package/packages/pm-todos/extensions/todos/index.ts +3 -2
- package/packages/pm-todos/extensions/todos/runtime.js +2 -17
- package/packages/pm-todos/extensions/todos/runtime.ts +40 -18
- package/packages/pm-todos/package.json +35 -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}/scripts/pm-mcp-server.mjs +4 -2
- 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-cli-codex → pm-codex}/scripts/pm-mcp-server.mjs +4 -2
- 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/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}/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}/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]="dc0f1970-8a30-56c5-827f-573784a38d54")}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,
|
|
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, 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, 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",
|
|
@@ -17,16 +19,56 @@ const LIST_COMMAND_NAMES = new Set([
|
|
|
17
19
|
"list-closed",
|
|
18
20
|
"list-canceled",
|
|
19
21
|
]);
|
|
20
|
-
const
|
|
21
|
-
"
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
22
|
+
const PACKAGE_OWNED_ACTIONS = new Set([
|
|
23
|
+
"calendar",
|
|
24
|
+
"dedupe-audit",
|
|
25
|
+
"guide",
|
|
26
|
+
"reindex",
|
|
27
|
+
"normalize",
|
|
28
|
+
"comments-audit",
|
|
29
|
+
"completion",
|
|
30
|
+
"test-runs-list",
|
|
31
|
+
"test-runs-status",
|
|
32
|
+
"test-runs-logs",
|
|
33
|
+
"test-runs-stop",
|
|
34
|
+
"test-runs-resume",
|
|
35
|
+
"templates-list",
|
|
36
|
+
"templates-save",
|
|
37
|
+
"templates-show",
|
|
38
|
+
]);
|
|
39
|
+
const PACKAGE_OWNED_COMMANDS = new Set([
|
|
40
|
+
"cal",
|
|
41
|
+
"calendar",
|
|
42
|
+
"comments-audit",
|
|
43
|
+
"completion",
|
|
44
|
+
"completion-tags",
|
|
45
|
+
"dedupe-audit",
|
|
46
|
+
"guide",
|
|
47
|
+
"normalize",
|
|
48
|
+
"reindex",
|
|
49
|
+
"templates",
|
|
50
|
+
"templates list",
|
|
51
|
+
"templates save",
|
|
52
|
+
"templates show",
|
|
53
|
+
"test-runs",
|
|
54
|
+
"test-runs list",
|
|
55
|
+
"test-runs status",
|
|
56
|
+
"test-runs logs",
|
|
57
|
+
"test-runs stop",
|
|
58
|
+
"test-runs resume",
|
|
59
|
+
]);
|
|
60
|
+
const CANONICAL_COMMAND_ALIASES = [
|
|
61
|
+
{
|
|
62
|
+
canonical: "context",
|
|
63
|
+
aliases: ["ctx"],
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
canonical: "package",
|
|
67
|
+
aliases: ["extension", "packages", "install"],
|
|
68
|
+
},
|
|
69
|
+
];
|
|
70
|
+
const COMMAND_ALIAS_TO_CANONICAL = new Map(CANONICAL_COMMAND_ALIASES.flatMap((entry) => entry.aliases.map((alias) => [alias, entry.canonical])));
|
|
25
71
|
function resolveActionCommandPath(action) {
|
|
26
|
-
const extensionCommandPath = EXTENSION_ACTION_COMMAND_PATHS[action];
|
|
27
|
-
if (extensionCommandPath) {
|
|
28
|
-
return normalizeCommandPath(extensionCommandPath);
|
|
29
|
-
}
|
|
30
72
|
if (PM_CORE_COMMAND_NAMES.includes(action)) {
|
|
31
73
|
return normalizeCommandPath(action);
|
|
32
74
|
}
|
|
@@ -168,8 +210,12 @@ function normalizeStringList(values) {
|
|
|
168
210
|
function toExtensionFlagContract(definition) {
|
|
169
211
|
const longName = toOptionalTrimmedString(definition.long);
|
|
170
212
|
const shortName = toOptionalTrimmedString(definition.short);
|
|
171
|
-
const normalizedLong = longName && longName.startsWith("--") && longName.length > 2
|
|
172
|
-
|
|
213
|
+
const normalizedLong = longName && longName.startsWith("--") && longName.length > 2
|
|
214
|
+
? longName
|
|
215
|
+
: null;
|
|
216
|
+
const normalizedShort = shortName && shortName.startsWith("-") && !shortName.startsWith("--")
|
|
217
|
+
? shortName
|
|
218
|
+
: null;
|
|
173
219
|
const flag = normalizedLong ?? normalizedShort;
|
|
174
220
|
if (!flag) {
|
|
175
221
|
return null;
|
|
@@ -224,7 +270,7 @@ function collectExtensionFlagContractsByCommand(registrations) {
|
|
|
224
270
|
if (layerOrder !== 0) {
|
|
225
271
|
return layerOrder;
|
|
226
272
|
}
|
|
227
|
-
return left.name.localeCompare(right.name);
|
|
273
|
+
return (left.name ?? "").localeCompare(right.name ?? "");
|
|
228
274
|
}),
|
|
229
275
|
});
|
|
230
276
|
}
|
|
@@ -238,7 +284,8 @@ function collectExtensionCommandContracts(runtimeProbe) {
|
|
|
238
284
|
if (command.length === 0) {
|
|
239
285
|
continue;
|
|
240
286
|
}
|
|
241
|
-
const action = toOptionalTrimmedString(definition.action) ??
|
|
287
|
+
const action = toOptionalTrimmedString(definition.action) ??
|
|
288
|
+
normalizeActionNameFromCommand(command);
|
|
242
289
|
const args = Array.isArray(definition.arguments)
|
|
243
290
|
? definition.arguments
|
|
244
291
|
.map((argument) => {
|
|
@@ -286,7 +333,9 @@ function collectExtensionCommandContracts(runtimeProbe) {
|
|
|
286
333
|
if (definition) {
|
|
287
334
|
contracts.push({
|
|
288
335
|
...definition,
|
|
289
|
-
flags: definition.flags.length > 0
|
|
336
|
+
flags: definition.flags.length > 0
|
|
337
|
+
? definition.flags
|
|
338
|
+
: (flagsByCommand.get(command)?.flags ?? []),
|
|
290
339
|
});
|
|
291
340
|
continue;
|
|
292
341
|
}
|
|
@@ -318,7 +367,9 @@ function buildExtensionActionSchemaBranch(contract) {
|
|
|
318
367
|
action: {
|
|
319
368
|
type: "string",
|
|
320
369
|
const: contract.action,
|
|
321
|
-
description: contract.intent ??
|
|
370
|
+
description: contract.intent ??
|
|
371
|
+
contract.description ??
|
|
372
|
+
`Invoke extension command '${contract.command}'.`,
|
|
322
373
|
},
|
|
323
374
|
};
|
|
324
375
|
const required = ["action"];
|
|
@@ -327,13 +378,15 @@ function buildExtensionActionSchemaBranch(contract) {
|
|
|
327
378
|
properties[argument.name] = {
|
|
328
379
|
type: "array",
|
|
329
380
|
items: { type: "string" },
|
|
330
|
-
description: argument.description ??
|
|
381
|
+
description: argument.description ??
|
|
382
|
+
`Variadic argument '${argument.name}' for extension action '${contract.action}'.`,
|
|
331
383
|
};
|
|
332
384
|
}
|
|
333
385
|
else {
|
|
334
386
|
properties[argument.name] = {
|
|
335
387
|
type: "string",
|
|
336
|
-
description: argument.description ??
|
|
388
|
+
description: argument.description ??
|
|
389
|
+
`Argument '${argument.name}' for extension action '${contract.action}'.`,
|
|
337
390
|
};
|
|
338
391
|
}
|
|
339
392
|
if (argument.required) {
|
|
@@ -423,12 +476,14 @@ async function resolveRuntimeExtensionActionProbe(global) {
|
|
|
423
476
|
function collectActionContractDescriptors(extensionContracts) {
|
|
424
477
|
const descriptors = new Map();
|
|
425
478
|
for (const action of PM_TOOL_ACTIONS) {
|
|
426
|
-
|
|
479
|
+
if (PACKAGE_OWNED_ACTIONS.has(action)) {
|
|
480
|
+
continue;
|
|
481
|
+
}
|
|
427
482
|
const commandPath = resolveActionCommandPath(action);
|
|
428
483
|
descriptors.set(action, {
|
|
429
484
|
action,
|
|
430
|
-
provider:
|
|
431
|
-
requires_extension:
|
|
485
|
+
provider: "core",
|
|
486
|
+
requires_extension: false,
|
|
432
487
|
command_path: commandPath,
|
|
433
488
|
});
|
|
434
489
|
}
|
|
@@ -443,7 +498,7 @@ function collectActionContractDescriptors(extensionContracts) {
|
|
|
443
498
|
command_path: normalizeCommandPath(contract.command),
|
|
444
499
|
});
|
|
445
500
|
}
|
|
446
|
-
return [...descriptors.values()].sort((left, right) => left.action.localeCompare(right.action));
|
|
501
|
+
return [...descriptors.values()].sort((left, right) => (left.action ?? "").localeCompare(right.action ?? ""));
|
|
447
502
|
}
|
|
448
503
|
function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
449
504
|
if (descriptor.provider === "core" && !descriptor.requires_extension) {
|
|
@@ -458,7 +513,9 @@ function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
|
458
513
|
cli_exposed: descriptor.command_path !== null,
|
|
459
514
|
};
|
|
460
515
|
}
|
|
461
|
-
const commandPath = descriptor.command_path
|
|
516
|
+
const commandPath = descriptor.command_path
|
|
517
|
+
? normalizeCommandPath(descriptor.command_path)
|
|
518
|
+
: "";
|
|
462
519
|
const extensionCommandAvailable = commandPath.length > 0 && runtimeProbe.handlers.has(commandPath);
|
|
463
520
|
const invocable = runtimeProbe.disabledReason === null && extensionCommandAvailable;
|
|
464
521
|
return {
|
|
@@ -467,7 +524,9 @@ function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
|
467
524
|
available: invocable,
|
|
468
525
|
requires_extension: true,
|
|
469
526
|
provider: "extension",
|
|
470
|
-
disabled_reason: invocable
|
|
527
|
+
disabled_reason: invocable
|
|
528
|
+
? null
|
|
529
|
+
: (runtimeProbe.disabledReason ?? "extension_command_not_registered"),
|
|
471
530
|
command_path: descriptor.command_path,
|
|
472
531
|
cli_exposed: extensionCommandAvailable,
|
|
473
532
|
policy_state: {
|
|
@@ -478,12 +537,20 @@ function resolveActionAvailability(descriptor, runtimeProbe) {
|
|
|
478
537
|
};
|
|
479
538
|
}
|
|
480
539
|
function resolveCoreCommandFlags(command) {
|
|
540
|
+
if (command === "init") {
|
|
541
|
+
return INIT_FLAG_CONTRACTS;
|
|
542
|
+
}
|
|
481
543
|
if (command === "config") {
|
|
482
544
|
return CONFIG_FLAG_CONTRACTS;
|
|
483
545
|
}
|
|
484
|
-
if (command === "extension" ||
|
|
546
|
+
if (command === "extension" ||
|
|
547
|
+
command === "package" ||
|
|
548
|
+
command === "packages") {
|
|
485
549
|
return EXTENSION_FLAG_CONTRACTS;
|
|
486
550
|
}
|
|
551
|
+
if (command === "install") {
|
|
552
|
+
return INSTALL_FLAG_CONTRACTS;
|
|
553
|
+
}
|
|
487
554
|
if (command === "create") {
|
|
488
555
|
return CREATE_FLAG_CONTRACTS;
|
|
489
556
|
}
|
|
@@ -505,6 +572,9 @@ function resolveCoreCommandFlags(command) {
|
|
|
505
572
|
if (command === "context" || command === "ctx") {
|
|
506
573
|
return CONTEXT_FLAG_CONTRACTS;
|
|
507
574
|
}
|
|
575
|
+
if (command === "get") {
|
|
576
|
+
return GET_FLAG_CONTRACTS;
|
|
577
|
+
}
|
|
508
578
|
if (command === "search") {
|
|
509
579
|
return SEARCH_FLAG_CONTRACTS;
|
|
510
580
|
}
|
|
@@ -526,6 +596,12 @@ function resolveCoreCommandFlags(command) {
|
|
|
526
596
|
if (command === "history") {
|
|
527
597
|
return HISTORY_FLAG_CONTRACTS;
|
|
528
598
|
}
|
|
599
|
+
if (command === "history-redact") {
|
|
600
|
+
return HISTORY_REDACT_FLAG_CONTRACTS;
|
|
601
|
+
}
|
|
602
|
+
if (command === "plan") {
|
|
603
|
+
return PLAN_FLAG_CONTRACTS;
|
|
604
|
+
}
|
|
529
605
|
if (command === "restore") {
|
|
530
606
|
return RESTORE_FLAG_CONTRACTS;
|
|
531
607
|
}
|
|
@@ -651,13 +727,20 @@ function buildRuntimeFieldFlagContracts(fieldRegistry) {
|
|
|
651
727
|
if (!primaryFlag) {
|
|
652
728
|
continue;
|
|
653
729
|
}
|
|
654
|
-
const shortAlias = definition.cli_aliases
|
|
730
|
+
const shortAlias = definition.cli_aliases
|
|
731
|
+
.map((alias) => toRuntimeShortFlagToken(alias))
|
|
732
|
+
.find((alias) => alias !== null);
|
|
655
733
|
const longAliases = definition.cli_aliases
|
|
656
734
|
.map((alias) => toRuntimeLongFlagToken(alias))
|
|
657
735
|
.filter((alias) => alias !== null && alias !== primaryFlag);
|
|
658
736
|
for (const command of definition.commands) {
|
|
659
|
-
const bucket = buckets.get(command) ?? {
|
|
660
|
-
|
|
737
|
+
const bucket = buckets.get(command) ?? {
|
|
738
|
+
flags: [],
|
|
739
|
+
seen: new Set(),
|
|
740
|
+
};
|
|
741
|
+
const primaryContract = shortAlias
|
|
742
|
+
? { flag: primaryFlag, short: shortAlias }
|
|
743
|
+
: { flag: primaryFlag };
|
|
661
744
|
const primaryKey = `${primaryContract.flag}|${primaryContract.short ?? ""}`;
|
|
662
745
|
if (!bucket.seen.has(primaryKey)) {
|
|
663
746
|
bucket.seen.add(primaryKey);
|
|
@@ -676,7 +759,7 @@ function buildRuntimeFieldFlagContracts(fieldRegistry) {
|
|
|
676
759
|
}
|
|
677
760
|
const result = new Map();
|
|
678
761
|
for (const [command, bucket] of buckets.entries()) {
|
|
679
|
-
result.set(command,
|
|
762
|
+
result.set(command, compactFlagAliasContracts(bucket.flags));
|
|
680
763
|
}
|
|
681
764
|
return result;
|
|
682
765
|
}
|
|
@@ -691,12 +774,12 @@ function mergeFlagContracts(primary, secondary) {
|
|
|
691
774
|
seen.add(key);
|
|
692
775
|
merged.push(contract);
|
|
693
776
|
}
|
|
694
|
-
return
|
|
777
|
+
return compactFlagAliasContracts(merged);
|
|
695
778
|
}
|
|
696
779
|
function buildCommandFlagSurface(commands, extensionFlagMap, runtimeFieldFlagMap) {
|
|
697
780
|
return commands
|
|
698
781
|
.map((command) => {
|
|
699
|
-
const isCoreCommand = PM_CORE_COMMAND_NAMES.includes(command);
|
|
782
|
+
const isCoreCommand = PM_CORE_COMMAND_NAMES.includes(command) && !PACKAGE_OWNED_COMMANDS.has(command);
|
|
700
783
|
const coreFlags = isCoreCommand ? resolveCoreCommandFlags(command) : [];
|
|
701
784
|
const runtimeFlags = runtimeFieldFlagMap.get(normalizeCommandForRuntimeFieldFlags(command)) ?? [];
|
|
702
785
|
const extensionFlags = extensionFlagMap.get(command);
|
|
@@ -716,6 +799,25 @@ function buildCommandFlagSurface(commands, extensionFlagMap, runtimeFieldFlagMap
|
|
|
716
799
|
})
|
|
717
800
|
.sort((left, right) => left.command.localeCompare(right.command));
|
|
718
801
|
}
|
|
802
|
+
function compactCommandAliasSurface(commands) {
|
|
803
|
+
const commandSet = new Set(commands);
|
|
804
|
+
const result = [];
|
|
805
|
+
for (const command of commands) {
|
|
806
|
+
const canonical = COMMAND_ALIAS_TO_CANONICAL.get(command);
|
|
807
|
+
if (canonical && commandSet.has(canonical)) {
|
|
808
|
+
continue;
|
|
809
|
+
}
|
|
810
|
+
result.push(command);
|
|
811
|
+
}
|
|
812
|
+
return result;
|
|
813
|
+
}
|
|
814
|
+
function buildCommandAliasSurface(commands) {
|
|
815
|
+
const commandSet = new Set(commands);
|
|
816
|
+
return CANONICAL_COMMAND_ALIASES.map((entry) => ({
|
|
817
|
+
canonical: entry.canonical,
|
|
818
|
+
aliases: entry.aliases.filter((alias) => commandSet.has(alias)),
|
|
819
|
+
})).filter((entry) => commandSet.has(entry.canonical) && entry.aliases.length > 0);
|
|
820
|
+
}
|
|
719
821
|
function buildCommanderAliasSurface() {
|
|
720
822
|
return {
|
|
721
823
|
create_string_options: CREATE_COMMANDER_STRING_OPTION_CONTRACTS,
|
|
@@ -730,7 +832,7 @@ function buildCommanderAliasSurface() {
|
|
|
730
832
|
};
|
|
731
833
|
}
|
|
732
834
|
function resolveCreateRequiredOptionContract(typeDefinition, createMode) {
|
|
733
|
-
const baseRequiredOptions = new Set(["title", "
|
|
835
|
+
const baseRequiredOptions = new Set(["title", "type"]);
|
|
734
836
|
if (createMode === "strict") {
|
|
735
837
|
for (const field of typeDefinition.required_create_fields) {
|
|
736
838
|
baseRequiredOptions.add(field);
|
|
@@ -741,8 +843,14 @@ function resolveCreateRequiredOptionContract(typeDefinition, createMode) {
|
|
|
741
843
|
}
|
|
742
844
|
const policyState = resolveCommandOptionPolicyState(typeDefinition, "create", baseRequiredOptions);
|
|
743
845
|
const requiredOptionKeys = [...new Set(policyState.required)].sort((left, right) => left.localeCompare(right));
|
|
744
|
-
const requiredFlags = [
|
|
745
|
-
|
|
846
|
+
const requiredFlags = [
|
|
847
|
+
...new Set(requiredOptionKeys.map((option) => commandOptionFlagLabel("create", option))),
|
|
848
|
+
].sort((left, right) => left.localeCompare(right));
|
|
849
|
+
const requiredTypeOptions = [
|
|
850
|
+
...new Set(typeDefinition.options
|
|
851
|
+
.filter((option) => option.required === true)
|
|
852
|
+
.map((option) => option.key)),
|
|
853
|
+
].sort((left, right) => left.localeCompare(right));
|
|
746
854
|
return {
|
|
747
855
|
required_option_keys: requiredOptionKeys,
|
|
748
856
|
required_flags: requiredFlags,
|
|
@@ -809,7 +917,19 @@ export async function runContracts(options, global) {
|
|
|
809
917
|
const flagsOnly = options.flagsOnly === true;
|
|
810
918
|
const availabilityOnly = options.availabilityOnly === true;
|
|
811
919
|
const runtimeOnly = options.runtimeOnly === true;
|
|
812
|
-
const
|
|
920
|
+
const fullOutput = options.full === true;
|
|
921
|
+
const unfilteredDefaultBriefMode = !fullOutput && !schemaOnly && !flagsOnly && !availabilityOnly && !selectedAction && !selectedCommand;
|
|
922
|
+
// Agent token-cost guard: when no filter and no projection flag and not --full,
|
|
923
|
+
// skip the giant schema oneOf union (the 200KB+ chunk). Restore via --full
|
|
924
|
+
// or by scoping to a specific --command/--action.
|
|
925
|
+
const omitUnfilteredSchema = unfilteredDefaultBriefMode;
|
|
926
|
+
const omitUnfilteredCommandFlags = unfilteredDefaultBriefMode;
|
|
927
|
+
const omitUnfilteredCommanderAliases = unfilteredDefaultBriefMode;
|
|
928
|
+
const projectionFlagsEnabled = [
|
|
929
|
+
schemaOnly,
|
|
930
|
+
flagsOnly,
|
|
931
|
+
availabilityOnly,
|
|
932
|
+
].filter((value) => value).length;
|
|
813
933
|
if (projectionFlagsEnabled > 1) {
|
|
814
934
|
throw new PmCliError("Choose only one projection flag: --schema-only, --flags-only, or --availability-only.", EXIT_CODE.USAGE);
|
|
815
935
|
}
|
|
@@ -834,7 +954,12 @@ export async function runContracts(options, global) {
|
|
|
834
954
|
if (selectedAction && !actionNames.has(selectedAction)) {
|
|
835
955
|
throw new PmCliError(`Unknown action: "${options.action}".`, EXIT_CODE.USAGE);
|
|
836
956
|
}
|
|
837
|
-
const commandCatalog = [
|
|
957
|
+
const commandCatalog = [
|
|
958
|
+
...new Set([
|
|
959
|
+
...PM_CORE_COMMAND_NAMES.filter((entry) => !PACKAGE_OWNED_COMMANDS.has(entry)),
|
|
960
|
+
...extensionContracts.map((entry) => entry.command),
|
|
961
|
+
]),
|
|
962
|
+
]
|
|
838
963
|
.map((entry) => normalizeCommandPath(entry))
|
|
839
964
|
.filter((entry) => entry.length > 0)
|
|
840
965
|
.sort((left, right) => left.localeCompare(right));
|
|
@@ -879,13 +1004,16 @@ export async function runContracts(options, global) {
|
|
|
879
1004
|
? commandScopedDescriptors.filter((descriptor) => descriptor.action === selectedAction)
|
|
880
1005
|
: commandScopedDescriptors;
|
|
881
1006
|
const allActionAvailability = scopedActionDescriptors.map((descriptor) => resolveActionAvailability(descriptor, runtimeProbe));
|
|
882
|
-
const actionAvailability = runtimeOnly && !selectedAction
|
|
1007
|
+
const actionAvailability = runtimeOnly && !selectedAction
|
|
1008
|
+
? allActionAvailability.filter((entry) => entry.invocable)
|
|
1009
|
+
: allActionAvailability;
|
|
883
1010
|
const actions = actionAvailability.map((entry) => entry.action);
|
|
1011
|
+
const descriptorActionSet = new Set(actionDescriptors.map((descriptor) => descriptor.action));
|
|
884
1012
|
let filteredSchema = selectedAction
|
|
885
1013
|
? filterSchemaByAction(mergedSchema, selectedAction)
|
|
886
1014
|
: selectedCommand
|
|
887
1015
|
? filterSchemaByActions(mergedSchema, new Set(scopedActionDescriptors.map((descriptor) => descriptor.action)))
|
|
888
|
-
: mergedSchema;
|
|
1016
|
+
: filterSchemaByActions(mergedSchema, descriptorActionSet);
|
|
889
1017
|
if (runtimeOnly && !selectedAction) {
|
|
890
1018
|
filteredSchema = filterSchemaByActions(filteredSchema, new Set(actions));
|
|
891
1019
|
}
|
|
@@ -898,14 +1026,22 @@ export async function runContracts(options, global) {
|
|
|
898
1026
|
: selectedAction
|
|
899
1027
|
? resolveScopedCommandsFromActionDescriptors(scopedActionDescriptors, commandCatalog)
|
|
900
1028
|
: commandCatalog;
|
|
1029
|
+
const outputCommands = flagsOnly && selectedCommand === undefined && selectedAction === undefined
|
|
1030
|
+
? compactCommandAliasSurface(commands)
|
|
1031
|
+
: commands;
|
|
1032
|
+
const commandAliases = buildCommandAliasSurface(commands);
|
|
901
1033
|
const extensionCommandContracts = selectedCommand
|
|
902
1034
|
? extensionContracts.filter((entry) => entry.command === selectedCommand)
|
|
903
1035
|
: selectedAction
|
|
904
|
-
? extensionContracts.filter((entry) =>
|
|
1036
|
+
? extensionContracts.filter((entry) => outputCommands.includes(normalizeCommandPath(entry.command)))
|
|
905
1037
|
: extensionContracts;
|
|
906
1038
|
const result = {
|
|
907
|
-
schema_version: typeof mergedSchema["x-schema-version"] === "string"
|
|
908
|
-
|
|
1039
|
+
schema_version: typeof mergedSchema["x-schema-version"] === "string"
|
|
1040
|
+
? mergedSchema["x-schema-version"]
|
|
1041
|
+
: null,
|
|
1042
|
+
schema_id: typeof mergedSchema.$id === "string"
|
|
1043
|
+
? mergedSchema.$id
|
|
1044
|
+
: null,
|
|
909
1045
|
selected: {
|
|
910
1046
|
action: selectedAction ?? null,
|
|
911
1047
|
command: selectedCommand ?? null,
|
|
@@ -915,7 +1051,7 @@ export async function runContracts(options, global) {
|
|
|
915
1051
|
runtime_only: runtimeOnly,
|
|
916
1052
|
command_scoped: selectedCommand !== undefined,
|
|
917
1053
|
},
|
|
918
|
-
commands,
|
|
1054
|
+
commands: outputCommands,
|
|
919
1055
|
runtime_schema: {
|
|
920
1056
|
statuses: statusRegistry.definitions.map((definition) => definition.id),
|
|
921
1057
|
open_status: statusRegistry.open_status,
|
|
@@ -924,7 +1060,9 @@ export async function runContracts(options, global) {
|
|
|
924
1060
|
types: [...typeRegistry.types],
|
|
925
1061
|
fields_by_command: Object.fromEntries([...runtimeFieldRegistry.command_to_fields.entries()].map(([command, definitions]) => [
|
|
926
1062
|
command,
|
|
927
|
-
[
|
|
1063
|
+
[
|
|
1064
|
+
...new Set(definitions.map((definition) => `--${definition.cli_flag}`)),
|
|
1065
|
+
].sort((left, right) => left.localeCompare(right)),
|
|
928
1066
|
])),
|
|
929
1067
|
},
|
|
930
1068
|
extension_contracts: {
|
|
@@ -946,16 +1084,34 @@ export async function runContracts(options, global) {
|
|
|
946
1084
|
result.actions = actions;
|
|
947
1085
|
result.action_availability = actionAvailability;
|
|
948
1086
|
}
|
|
949
|
-
if (includeSchemaSurface) {
|
|
1087
|
+
if (includeSchemaSurface && !omitUnfilteredSchema) {
|
|
950
1088
|
result.schema = filteredSchema;
|
|
951
1089
|
result.extension_commands = extensionCommandContracts;
|
|
952
1090
|
}
|
|
1091
|
+
else if (includeSchemaSurface && omitUnfilteredSchema) {
|
|
1092
|
+
result.schema_omitted_reason = "unfiltered_default_brief";
|
|
1093
|
+
result.extension_commands = extensionCommandContracts;
|
|
1094
|
+
}
|
|
953
1095
|
if (!schemaOnly && !availabilityOnly) {
|
|
954
|
-
|
|
1096
|
+
if (!omitUnfilteredCommandFlags) {
|
|
1097
|
+
result.command_flags = buildCommandFlagSurface(outputCommands, extensionFlagMap, runtimeFieldFlagMap);
|
|
1098
|
+
}
|
|
1099
|
+
else {
|
|
1100
|
+
result.command_flags_omitted_reason = "unfiltered_default_brief";
|
|
1101
|
+
}
|
|
1102
|
+
if (commandAliases.length > 0) {
|
|
1103
|
+
result.command_aliases = commandAliases;
|
|
1104
|
+
}
|
|
955
1105
|
}
|
|
956
1106
|
if (!schemaOnly && !flagsOnly && !availabilityOnly) {
|
|
957
|
-
|
|
1107
|
+
if (!omitUnfilteredCommanderAliases) {
|
|
1108
|
+
result.commander_aliases = buildCommanderAliasSurface();
|
|
1109
|
+
}
|
|
1110
|
+
else {
|
|
1111
|
+
result.commander_aliases_omitted_reason = "unfiltered_default_brief";
|
|
1112
|
+
}
|
|
958
1113
|
}
|
|
959
1114
|
return result;
|
|
960
1115
|
}
|
|
961
|
-
//# sourceMappingURL=contracts.js.map
|
|
1116
|
+
//# sourceMappingURL=contracts.js.map
|
|
1117
|
+
//# debugId=dc0f1970-8a30-56c5-827f-573784a38d54
|