@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
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
import type { CalendarOptions, CalendarResult } from "../../../../src/sdk/runtime.js";
|
|
4
|
+
import type { GlobalOptions, ServiceOverrideContext } from "../../../../src/sdk/index.js";
|
|
5
|
+
|
|
6
|
+
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
7
|
+
|
|
8
|
+
interface CalendarCoreModule {
|
|
9
|
+
runCalendar: (options: CalendarOptions, global: GlobalOptions) => Promise<CalendarResult>;
|
|
10
|
+
renderCalendarMarkdown: (result: CalendarResult) => string;
|
|
11
|
+
resolveCalendarOutputFormat: (options: CalendarOptions, global: GlobalOptions) => "markdown" | "toon" | "json";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let calendarCore: CalendarCoreModule | null = null;
|
|
15
|
+
let calendarCoreLoadPromise: Promise<CalendarCoreModule> | null = null;
|
|
16
|
+
|
|
17
|
+
async function ensureCalendarCoreModule(): Promise<CalendarCoreModule> {
|
|
18
|
+
if (calendarCore) {
|
|
19
|
+
return calendarCore;
|
|
20
|
+
}
|
|
21
|
+
if (!calendarCoreLoadPromise) {
|
|
22
|
+
calendarCoreLoadPromise = loadCalendarCoreModule();
|
|
23
|
+
}
|
|
24
|
+
calendarCore = await calendarCoreLoadPromise;
|
|
25
|
+
return calendarCore;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function loadCalendarCoreModule(): Promise<CalendarCoreModule> {
|
|
29
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
30
|
+
if (typeof envRoot !== "string" || envRoot.trim().length === 0) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`builtin-calendar requires ${PM_PACKAGE_ROOT_ENV} to locate core SDK runtime exports.`,
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
const modulePath = path.join(path.resolve(envRoot.trim()), "dist", "sdk", "runtime.js");
|
|
36
|
+
try {
|
|
37
|
+
const loaded = (await import(pathToFileURL(modulePath).href)) as Partial<CalendarCoreModule>;
|
|
38
|
+
if (
|
|
39
|
+
typeof loaded.runCalendar === "function" &&
|
|
40
|
+
typeof loaded.renderCalendarMarkdown === "function" &&
|
|
41
|
+
typeof loaded.resolveCalendarOutputFormat === "function"
|
|
42
|
+
) {
|
|
43
|
+
return loaded as CalendarCoreModule;
|
|
44
|
+
}
|
|
45
|
+
} catch {
|
|
46
|
+
// Fall through to deterministic failure message below.
|
|
47
|
+
}
|
|
48
|
+
throw new Error(
|
|
49
|
+
`builtin-calendar failed to load calendar SDK runtime exports from ${modulePath}.`,
|
|
50
|
+
);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function isCalendarResult(value: unknown): value is CalendarResult {
|
|
54
|
+
return (
|
|
55
|
+
typeof value === "object" &&
|
|
56
|
+
value !== null &&
|
|
57
|
+
(value as { output_default?: unknown }).output_default === "markdown" &&
|
|
58
|
+
Array.isArray((value as { events?: unknown }).events) &&
|
|
59
|
+
Array.isArray((value as { days?: unknown }).days)
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
function readPayloadFormat(payload: unknown): "toon" | "json" {
|
|
64
|
+
if (typeof payload === "object" && payload !== null) {
|
|
65
|
+
const format = (payload as { format?: unknown }).format;
|
|
66
|
+
if (format === "json") {
|
|
67
|
+
return "json";
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return "toon";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function readPayloadResult(payload: unknown): unknown {
|
|
74
|
+
if (typeof payload === "object" && payload !== null && "result" in payload) {
|
|
75
|
+
return (payload as { result?: unknown }).result;
|
|
76
|
+
}
|
|
77
|
+
return payload;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
function readPayloadCommandOptions(payload: unknown): CalendarOptions {
|
|
81
|
+
if (typeof payload === "object" && payload !== null) {
|
|
82
|
+
const commandOptions = (payload as { command_options?: unknown }).command_options;
|
|
83
|
+
if (typeof commandOptions === "object" && commandOptions !== null) {
|
|
84
|
+
return commandOptions as CalendarOptions;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
return {};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function readPayloadGlobalOptions(payload: unknown): GlobalOptions {
|
|
91
|
+
if (typeof payload === "object" && payload !== null) {
|
|
92
|
+
const global = (payload as { global?: unknown }).global;
|
|
93
|
+
if (typeof global === "object" && global !== null) {
|
|
94
|
+
return global as GlobalOptions;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
return {};
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export async function runCalendarPackage(options: CalendarOptions, global: GlobalOptions): Promise<CalendarResult> {
|
|
101
|
+
const loaded = await ensureCalendarCoreModule();
|
|
102
|
+
return loaded.runCalendar(options, global);
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export function renderCalendarPackageOutput(context: ServiceOverrideContext): string | null {
|
|
106
|
+
const result = readPayloadResult(context.payload);
|
|
107
|
+
if (!calendarCore || !isCalendarResult(result)) {
|
|
108
|
+
return null;
|
|
109
|
+
}
|
|
110
|
+
const options =
|
|
111
|
+
context.options && Object.keys(context.options).length > 0
|
|
112
|
+
? (context.options as CalendarOptions)
|
|
113
|
+
: readPayloadCommandOptions(context.payload);
|
|
114
|
+
const global = context.global ?? readPayloadGlobalOptions(context.payload);
|
|
115
|
+
const outputFormat = calendarCore.resolveCalendarOutputFormat(options, global);
|
|
116
|
+
if (outputFormat === "markdown") {
|
|
117
|
+
return `${calendarCore.renderCalendarMarkdown(result)}\n`;
|
|
118
|
+
}
|
|
119
|
+
if (outputFormat === "json" || readPayloadFormat(context.payload) === "json") {
|
|
120
|
+
return `${JSON.stringify(result, null, 2)}\n`;
|
|
121
|
+
}
|
|
122
|
+
return null;
|
|
123
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@unbrained/pm-calendar",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": true,
|
|
5
|
+
"type": "module",
|
|
6
|
+
"description": "First-party pm package for calendar and agenda views.",
|
|
7
|
+
"homepage": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/unbraind/pm-cli.git",
|
|
11
|
+
"directory": "packages/pm-calendar"
|
|
12
|
+
},
|
|
13
|
+
"bugs": {
|
|
14
|
+
"url": "https://github.com/unbraind/pm-cli/issues"
|
|
15
|
+
},
|
|
16
|
+
"keywords": [
|
|
17
|
+
"pm-package",
|
|
18
|
+
"project-management",
|
|
19
|
+
"calendar",
|
|
20
|
+
"agenda"
|
|
21
|
+
],
|
|
22
|
+
"pm": {
|
|
23
|
+
"aliases": [
|
|
24
|
+
"calendar"
|
|
25
|
+
],
|
|
26
|
+
"extensions": [
|
|
27
|
+
"extensions/calendar"
|
|
28
|
+
],
|
|
29
|
+
"catalog": {
|
|
30
|
+
"display_name": "Calendar Views",
|
|
31
|
+
"category": "workflow",
|
|
32
|
+
"summary": "Show agenda, day, week, and month views for deadlines, reminders, and scheduled events.",
|
|
33
|
+
"tags": [
|
|
34
|
+
"calendar",
|
|
35
|
+
"agenda",
|
|
36
|
+
"workflow"
|
|
37
|
+
],
|
|
38
|
+
"links": {
|
|
39
|
+
"docs": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar#readme",
|
|
40
|
+
"repository": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-calendar",
|
|
41
|
+
"report": "https://github.com/unbraind/pm-cli/issues"
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
"docs": [
|
|
45
|
+
"README.md"
|
|
46
|
+
],
|
|
47
|
+
"examples": [
|
|
48
|
+
"README.md"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# pm-governance-audit
|
|
2
|
+
|
|
3
|
+
First-party package that restores optional governance audit surfaces in bare-core `pm`.
|
|
4
|
+
|
|
5
|
+
## Commands
|
|
6
|
+
|
|
7
|
+
- `pm dedupe-audit`
|
|
8
|
+
- `pm comments-audit`
|
|
9
|
+
- `pm normalize`
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
pm install governance-audit --project
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Verify
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
pm dedupe-audit --mode parent_scope --limit 20 --json
|
|
21
|
+
pm comments-audit --latest 3 --limit-items 20 --json
|
|
22
|
+
pm normalize --dry-run --json
|
|
23
|
+
```
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import {
|
|
2
|
+
runCommentsAuditPackage,
|
|
3
|
+
runDedupeAuditPackage,
|
|
4
|
+
runNormalizePackage,
|
|
5
|
+
} from "./runtime.js";
|
|
6
|
+
|
|
7
|
+
export const manifest = {
|
|
8
|
+
name: "builtin-governance-audit",
|
|
9
|
+
version: "0.1.0",
|
|
10
|
+
entry: "./index.js",
|
|
11
|
+
priority: 0,
|
|
12
|
+
capabilities: ["commands", "schema"],
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const dedupeAuditFlags = [
|
|
16
|
+
{ long: "--mode", value_name: "value", value_type: "string", description: "Audit mode: title_exact|title_fuzzy|parent_scope." },
|
|
17
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
|
|
18
|
+
{ long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
|
|
19
|
+
{ long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
|
|
20
|
+
{ long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
|
|
21
|
+
{ long: "--deadline-before", value_name: "value", value_type: "string", description: "Filter by deadline upper bound." },
|
|
22
|
+
{ long: "--deadline-after", value_name: "value", value_type: "string", description: "Filter by deadline lower bound." },
|
|
23
|
+
{ long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
|
|
24
|
+
{ long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
|
|
25
|
+
{ long: "--parent", value_name: "value", value_type: "string", description: "Filter by parent item ID." },
|
|
26
|
+
{ long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
|
|
27
|
+
{ long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
|
|
28
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit analyzed items." },
|
|
29
|
+
{ long: "--threshold", value_name: "value", value_type: "string", description: "Similarity threshold for fuzzy modes." },
|
|
30
|
+
];
|
|
31
|
+
|
|
32
|
+
const commentsAuditFlags = [
|
|
33
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
|
|
34
|
+
{ long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
|
|
35
|
+
{ long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
|
|
36
|
+
{ long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
|
|
37
|
+
{ long: "--parent", value_name: "value", value_type: "string", description: "Filter by parent item ID." },
|
|
38
|
+
{ long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
|
|
39
|
+
{ long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
|
|
40
|
+
{ long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
|
|
41
|
+
{ long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
|
|
42
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit output rows." },
|
|
43
|
+
{ long: "--limit-items", value_name: "n", value_type: "string", description: "Limit scanned items before comment expansion." },
|
|
44
|
+
{ long: "--latest", value_name: "n", value_type: "string", description: "Include latest n comments per item." },
|
|
45
|
+
{ long: "--full-history", value_type: "boolean", description: "Emit full comment history rows." },
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
const normalizeFlags = [
|
|
49
|
+
{ long: "--filter-status", value_name: "value", value_type: "string", description: "Status filter applied before normalize planning." },
|
|
50
|
+
{ long: "--filter_status", value_name: "value", value_type: "string", description: "Alias for --filter-status." },
|
|
51
|
+
{ long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
|
|
52
|
+
{ long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
|
|
53
|
+
{ long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
|
|
54
|
+
{ long: "--deadline-before", value_name: "value", value_type: "string", description: "Filter by deadline upper bound." },
|
|
55
|
+
{ long: "--deadline-after", value_name: "value", value_type: "string", description: "Filter by deadline lower bound." },
|
|
56
|
+
{ long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
|
|
57
|
+
{ long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
|
|
58
|
+
{ long: "--parent", value_name: "value", value_type: "string", description: "Filter by parent item ID." },
|
|
59
|
+
{ long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
|
|
60
|
+
{ long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
|
|
61
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit listed items." },
|
|
62
|
+
{ long: "--offset", value_name: "n", value_type: "string", description: "Skip first n listed items." },
|
|
63
|
+
{ long: "--include-body", value_type: "boolean", description: "Include body while listing candidate items." },
|
|
64
|
+
{ long: "--include_body", value_type: "boolean", description: "Alias for --include-body." },
|
|
65
|
+
{ long: "--compact", value_type: "boolean", description: "Request compact list projection." },
|
|
66
|
+
{ long: "--fields", value_name: "value", value_type: "string", description: "Comma-separated list projection fields." },
|
|
67
|
+
{ long: "--sort", value_name: "value", value_type: "string", description: "Sort field." },
|
|
68
|
+
{ long: "--order", value_name: "value", value_type: "string", description: "Sort order." },
|
|
69
|
+
{ long: "--dry-run", value_type: "boolean", description: "Preview normalize mutations without applying." },
|
|
70
|
+
{ long: "--apply", value_type: "boolean", description: "Apply normalize mutations." },
|
|
71
|
+
{ long: "--author", value_name: "value", value_type: "string", description: "Author used for apply-mode updates." },
|
|
72
|
+
{ long: "--message", value_name: "value", value_type: "string", description: "History message used for apply-mode updates." },
|
|
73
|
+
{ long: "--force", value_type: "boolean", description: "Force apply-mode updates." },
|
|
74
|
+
{ long: "--allow-audit-update", value_type: "boolean", description: "Allow append-only audit updates across owners." },
|
|
75
|
+
{ long: "--allow_audit_update", value_type: "boolean", description: "Alias for --allow-audit-update." },
|
|
76
|
+
];
|
|
77
|
+
|
|
78
|
+
function dedupeAuditCommand() {
|
|
79
|
+
return {
|
|
80
|
+
name: "dedupe-audit",
|
|
81
|
+
action: "dedupe-audit",
|
|
82
|
+
description: "Audit likely duplicate items by title and parent scope heuristics.",
|
|
83
|
+
flags: [...dedupeAuditFlags],
|
|
84
|
+
run: async (context) => runDedupeAuditPackage(context.options, context.global),
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
function commentsAuditCommand() {
|
|
89
|
+
return {
|
|
90
|
+
name: "comments-audit",
|
|
91
|
+
action: "comments-audit",
|
|
92
|
+
description: "Audit item comment coverage and export comment history rows.",
|
|
93
|
+
flags: [...commentsAuditFlags],
|
|
94
|
+
run: async (context) => runCommentsAuditPackage(context.options, context.global),
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function normalizeCommand() {
|
|
99
|
+
return {
|
|
100
|
+
name: "normalize",
|
|
101
|
+
action: "normalize",
|
|
102
|
+
description: "Plan/apply lifecycle metadata normalization sweeps.",
|
|
103
|
+
flags: [...normalizeFlags],
|
|
104
|
+
run: async (context) => runNormalizePackage(context.options, context.global),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
export function activate(api) {
|
|
109
|
+
api.registerCommand(dedupeAuditCommand());
|
|
110
|
+
api.registerCommand(commentsAuditCommand());
|
|
111
|
+
api.registerCommand(normalizeCommand());
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export default {
|
|
115
|
+
manifest,
|
|
116
|
+
activate,
|
|
117
|
+
};
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import type { CommandDefinition, ExtensionApi } from "../../../../src/sdk/index.js";
|
|
2
|
+
import {
|
|
3
|
+
runCommentsAuditPackage,
|
|
4
|
+
runDedupeAuditPackage,
|
|
5
|
+
runNormalizePackage,
|
|
6
|
+
} from "./runtime.js";
|
|
7
|
+
|
|
8
|
+
export const manifest = {
|
|
9
|
+
name: "builtin-governance-audit",
|
|
10
|
+
version: "0.1.0",
|
|
11
|
+
entry: "./index.js",
|
|
12
|
+
priority: 0,
|
|
13
|
+
capabilities: ["commands", "schema"],
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const dedupeAuditFlags = [
|
|
17
|
+
{ long: "--mode", value_name: "value", value_type: "string", description: "Audit mode: title_exact|title_fuzzy|parent_scope." },
|
|
18
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
|
|
19
|
+
{ long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
|
|
20
|
+
{ long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
|
|
21
|
+
{ long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
|
|
22
|
+
{ long: "--deadline-before", value_name: "value", value_type: "string", description: "Filter by deadline upper bound." },
|
|
23
|
+
{ long: "--deadline-after", value_name: "value", value_type: "string", description: "Filter by deadline lower bound." },
|
|
24
|
+
{ long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
|
|
25
|
+
{ long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
|
|
26
|
+
{ long: "--parent", value_name: "value", value_type: "string", description: "Filter by parent item ID." },
|
|
27
|
+
{ long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
|
|
28
|
+
{ long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
|
|
29
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit analyzed items." },
|
|
30
|
+
{ long: "--threshold", value_name: "value", value_type: "string", description: "Similarity threshold for fuzzy modes." },
|
|
31
|
+
] as const;
|
|
32
|
+
|
|
33
|
+
const commentsAuditFlags = [
|
|
34
|
+
{ long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
|
|
35
|
+
{ long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
|
|
36
|
+
{ long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
|
|
37
|
+
{ long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
|
|
38
|
+
{ long: "--parent", value_name: "value", value_type: "string", description: "Filter by parent item ID." },
|
|
39
|
+
{ long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
|
|
40
|
+
{ long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
|
|
41
|
+
{ long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
|
|
42
|
+
{ long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
|
|
43
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit output rows." },
|
|
44
|
+
{ long: "--limit-items", value_name: "n", value_type: "string", description: "Limit scanned items before comment expansion." },
|
|
45
|
+
{ long: "--latest", value_name: "n", value_type: "string", description: "Include latest n comments per item." },
|
|
46
|
+
{ long: "--full-history", value_type: "boolean", description: "Emit full comment history rows." },
|
|
47
|
+
] as const;
|
|
48
|
+
|
|
49
|
+
const normalizeFlags = [
|
|
50
|
+
{ long: "--filter-status", value_name: "value", value_type: "string", description: "Status filter applied before normalize planning." },
|
|
51
|
+
{ long: "--filter_status", value_name: "value", value_type: "string", description: "Alias for --filter-status." },
|
|
52
|
+
{ long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
|
|
53
|
+
{ long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
|
|
54
|
+
{ long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
|
|
55
|
+
{ long: "--deadline-before", value_name: "value", value_type: "string", description: "Filter by deadline upper bound." },
|
|
56
|
+
{ long: "--deadline-after", value_name: "value", value_type: "string", description: "Filter by deadline lower bound." },
|
|
57
|
+
{ long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
|
|
58
|
+
{ long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
|
|
59
|
+
{ long: "--parent", value_name: "value", value_type: "string", description: "Filter by parent item ID." },
|
|
60
|
+
{ long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
|
|
61
|
+
{ long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
|
|
62
|
+
{ long: "--limit", value_name: "n", value_type: "string", description: "Limit listed items." },
|
|
63
|
+
{ long: "--offset", value_name: "n", value_type: "string", description: "Skip first n listed items." },
|
|
64
|
+
{ long: "--include-body", value_type: "boolean", description: "Include body while listing candidate items." },
|
|
65
|
+
{ long: "--include_body", value_type: "boolean", description: "Alias for --include-body." },
|
|
66
|
+
{ long: "--compact", value_type: "boolean", description: "Request compact list projection." },
|
|
67
|
+
{ long: "--fields", value_name: "value", value_type: "string", description: "Comma-separated list projection fields." },
|
|
68
|
+
{ long: "--sort", value_name: "value", value_type: "string", description: "Sort field." },
|
|
69
|
+
{ long: "--order", value_name: "value", value_type: "string", description: "Sort order." },
|
|
70
|
+
{ long: "--dry-run", value_type: "boolean", description: "Preview normalize mutations without applying." },
|
|
71
|
+
{ long: "--apply", value_type: "boolean", description: "Apply normalize mutations." },
|
|
72
|
+
{ long: "--author", value_name: "value", value_type: "string", description: "Author used for apply-mode updates." },
|
|
73
|
+
{ long: "--message", value_name: "value", value_type: "string", description: "History message used for apply-mode updates." },
|
|
74
|
+
{ long: "--force", value_type: "boolean", description: "Force apply-mode updates." },
|
|
75
|
+
{ long: "--allow-audit-update", value_type: "boolean", description: "Allow append-only audit updates across owners." },
|
|
76
|
+
{ long: "--allow_audit_update", value_type: "boolean", description: "Alias for --allow-audit-update." },
|
|
77
|
+
] as const;
|
|
78
|
+
|
|
79
|
+
function dedupeAuditCommand(): CommandDefinition {
|
|
80
|
+
return {
|
|
81
|
+
name: "dedupe-audit",
|
|
82
|
+
action: "dedupe-audit",
|
|
83
|
+
description: "Audit likely duplicate items by title and parent scope heuristics.",
|
|
84
|
+
flags: [...dedupeAuditFlags],
|
|
85
|
+
run: async (context) => runDedupeAuditPackage(context.options, context.global),
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function commentsAuditCommand(): CommandDefinition {
|
|
90
|
+
return {
|
|
91
|
+
name: "comments-audit",
|
|
92
|
+
action: "comments-audit",
|
|
93
|
+
description: "Audit item comment coverage and export comment history rows.",
|
|
94
|
+
flags: [...commentsAuditFlags],
|
|
95
|
+
run: async (context) => runCommentsAuditPackage(context.options, context.global),
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function normalizeCommand(): CommandDefinition {
|
|
100
|
+
return {
|
|
101
|
+
name: "normalize",
|
|
102
|
+
action: "normalize",
|
|
103
|
+
description: "Plan/apply lifecycle metadata normalization sweeps.",
|
|
104
|
+
flags: [...normalizeFlags],
|
|
105
|
+
run: async (context) => runNormalizePackage(context.options, context.global),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
export function activate(api: ExtensionApi): void {
|
|
110
|
+
api.registerCommand(dedupeAuditCommand());
|
|
111
|
+
api.registerCommand(commentsAuditCommand());
|
|
112
|
+
api.registerCommand(normalizeCommand());
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export default {
|
|
116
|
+
manifest,
|
|
117
|
+
activate,
|
|
118
|
+
};
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { pathToFileURL } from "node:url";
|
|
3
|
+
|
|
4
|
+
const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
|
|
5
|
+
let governanceModule = null;
|
|
6
|
+
let governanceModulePromise = null;
|
|
7
|
+
|
|
8
|
+
async function ensureGovernanceModule() {
|
|
9
|
+
if (governanceModule) {
|
|
10
|
+
return governanceModule;
|
|
11
|
+
}
|
|
12
|
+
if (!governanceModulePromise) {
|
|
13
|
+
governanceModulePromise = loadGovernanceModule();
|
|
14
|
+
}
|
|
15
|
+
governanceModule = await governanceModulePromise;
|
|
16
|
+
return governanceModule;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async function loadGovernanceModule() {
|
|
20
|
+
const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
|
|
21
|
+
if (typeof envRoot !== "string" || envRoot.trim().length === 0) {
|
|
22
|
+
throw new Error(
|
|
23
|
+
`builtin-governance-audit requires ${PM_PACKAGE_ROOT_ENV} to locate core SDK runtime exports.`,
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
const modulePath = path.join(path.resolve(envRoot.trim()), "dist", "sdk", "runtime.js");
|
|
27
|
+
try {
|
|
28
|
+
const loaded = await import(pathToFileURL(modulePath).href);
|
|
29
|
+
if (
|
|
30
|
+
typeof loaded.runDedupeAudit === "function" &&
|
|
31
|
+
typeof loaded.runCommentsAudit === "function" &&
|
|
32
|
+
typeof loaded.runNormalize === "function"
|
|
33
|
+
) {
|
|
34
|
+
return loaded;
|
|
35
|
+
}
|
|
36
|
+
} catch {
|
|
37
|
+
// Fall through to deterministic failure message below.
|
|
38
|
+
}
|
|
39
|
+
throw new Error(
|
|
40
|
+
`builtin-governance-audit failed to load governance SDK runtime exports from ${modulePath}.`,
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function readStringOption(options, key, aliases = []) {
|
|
45
|
+
const keys = [key, ...aliases];
|
|
46
|
+
for (const candidate of keys) {
|
|
47
|
+
const value = options[candidate];
|
|
48
|
+
if (typeof value === "string" && value.trim().length > 0) {
|
|
49
|
+
return value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
return undefined;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function readBooleanOption(options, key, aliases = []) {
|
|
56
|
+
const keys = [key, ...aliases];
|
|
57
|
+
for (const candidate of keys) {
|
|
58
|
+
const value = options[candidate];
|
|
59
|
+
if (value === undefined) {
|
|
60
|
+
continue;
|
|
61
|
+
}
|
|
62
|
+
if (typeof value === "boolean") {
|
|
63
|
+
return value;
|
|
64
|
+
}
|
|
65
|
+
if (typeof value === "string") {
|
|
66
|
+
const normalized = value.trim().toLowerCase();
|
|
67
|
+
if (normalized === "true" || normalized === "1" || normalized === "yes" || normalized === "on") {
|
|
68
|
+
return true;
|
|
69
|
+
}
|
|
70
|
+
if (normalized === "false" || normalized === "0" || normalized === "no" || normalized === "off") {
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return undefined;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function normalizeDedupeAuditOptions(raw) {
|
|
79
|
+
return {
|
|
80
|
+
mode: readStringOption(raw, "mode"),
|
|
81
|
+
status: readStringOption(raw, "status"),
|
|
82
|
+
type: readStringOption(raw, "type"),
|
|
83
|
+
tag: readStringOption(raw, "tag"),
|
|
84
|
+
priority: readStringOption(raw, "priority"),
|
|
85
|
+
deadlineBefore: readStringOption(raw, "deadlineBefore", ["deadline_before"]),
|
|
86
|
+
deadlineAfter: readStringOption(raw, "deadlineAfter", ["deadline_after"]),
|
|
87
|
+
assignee: readStringOption(raw, "assignee"),
|
|
88
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
89
|
+
parent: readStringOption(raw, "parent"),
|
|
90
|
+
sprint: readStringOption(raw, "sprint"),
|
|
91
|
+
release: readStringOption(raw, "release"),
|
|
92
|
+
limit: readStringOption(raw, "limit"),
|
|
93
|
+
threshold: readStringOption(raw, "threshold"),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function normalizeCommentsAuditOptions(raw) {
|
|
98
|
+
return {
|
|
99
|
+
status: readStringOption(raw, "status"),
|
|
100
|
+
type: readStringOption(raw, "type"),
|
|
101
|
+
tag: readStringOption(raw, "tag"),
|
|
102
|
+
priority: readStringOption(raw, "priority"),
|
|
103
|
+
parent: readStringOption(raw, "parent"),
|
|
104
|
+
sprint: readStringOption(raw, "sprint"),
|
|
105
|
+
release: readStringOption(raw, "release"),
|
|
106
|
+
assignee: readStringOption(raw, "assignee"),
|
|
107
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
108
|
+
limit: readStringOption(raw, "limit"),
|
|
109
|
+
limitItems: readStringOption(raw, "limitItems", ["limit_items"]),
|
|
110
|
+
latest: readStringOption(raw, "latest"),
|
|
111
|
+
fullHistory: readBooleanOption(raw, "fullHistory", ["full_history"]) === true ? true : undefined,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
function normalizeNormalizeOptions(raw) {
|
|
116
|
+
return {
|
|
117
|
+
status: readStringOption(raw, "filterStatus", ["filter_status", "status"]),
|
|
118
|
+
list: {
|
|
119
|
+
type: readStringOption(raw, "type"),
|
|
120
|
+
tag: readStringOption(raw, "tag"),
|
|
121
|
+
priority: readStringOption(raw, "priority"),
|
|
122
|
+
deadlineBefore: readStringOption(raw, "deadlineBefore", ["deadline_before"]),
|
|
123
|
+
deadlineAfter: readStringOption(raw, "deadlineAfter", ["deadline_after"]),
|
|
124
|
+
assignee: readStringOption(raw, "assignee"),
|
|
125
|
+
assigneeFilter: readStringOption(raw, "assigneeFilter", ["assignee_filter"]),
|
|
126
|
+
parent: readStringOption(raw, "parent"),
|
|
127
|
+
sprint: readStringOption(raw, "sprint"),
|
|
128
|
+
release: readStringOption(raw, "release"),
|
|
129
|
+
limit: readStringOption(raw, "limit"),
|
|
130
|
+
offset: readStringOption(raw, "offset"),
|
|
131
|
+
includeBody: readBooleanOption(raw, "includeBody", ["include_body"]) === true ? true : undefined,
|
|
132
|
+
compact: readBooleanOption(raw, "compact") === true ? true : undefined,
|
|
133
|
+
fields: readStringOption(raw, "fields"),
|
|
134
|
+
sort: readStringOption(raw, "sort"),
|
|
135
|
+
order: readStringOption(raw, "order"),
|
|
136
|
+
},
|
|
137
|
+
dryRun: readBooleanOption(raw, "dryRun", ["dry_run"]) === true ? true : undefined,
|
|
138
|
+
apply: readBooleanOption(raw, "apply") === true ? true : undefined,
|
|
139
|
+
author: readStringOption(raw, "author"),
|
|
140
|
+
message: readStringOption(raw, "message"),
|
|
141
|
+
force: readBooleanOption(raw, "force") === true ? true : undefined,
|
|
142
|
+
allowAuditUpdate: readBooleanOption(raw, "allowAuditUpdate", ["allow_audit_update"]) === true ? true : undefined,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
export async function runDedupeAuditPackage(options, global) {
|
|
147
|
+
const module = await ensureGovernanceModule();
|
|
148
|
+
return module.runDedupeAudit(normalizeDedupeAuditOptions(options), global);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
export async function runCommentsAuditPackage(options, global) {
|
|
152
|
+
const module = await ensureGovernanceModule();
|
|
153
|
+
return module.runCommentsAudit(normalizeCommentsAuditOptions(options), global);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
export async function runNormalizePackage(options, global) {
|
|
157
|
+
const module = await ensureGovernanceModule();
|
|
158
|
+
return module.runNormalize(normalizeNormalizeOptions(options), global);
|
|
159
|
+
}
|