@unbrained/pm-cli 2026.5.14 → 2026.5.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude-plugin/marketplace.json +4 -4
- package/AGENTS.md +78 -457
- package/CHANGELOG.md +71 -0
- package/CONTRIBUTING.md +1 -0
- package/README.md +8 -6
- package/dist/cli/argv-utils.js +4 -1
- package/dist/cli/argv-utils.js.map +1 -1
- package/dist/cli/bootstrap-args.js +4 -1
- package/dist/cli/bootstrap-args.js.map +1 -1
- package/dist/cli/commander-usage.js +19 -1
- package/dist/cli/commander-usage.js.map +1 -1
- package/dist/cli/commands/activity.js +4 -1
- package/dist/cli/commands/activity.js.map +1 -1
- package/dist/cli/commands/aggregate.js +5 -2
- package/dist/cli/commands/aggregate.js.map +1 -1
- package/dist/cli/commands/annotation-command.d.ts +49 -0
- package/dist/cli/commands/annotation-command.js +135 -0
- package/dist/cli/commands/annotation-command.js.map +1 -0
- package/dist/cli/commands/append.js +5 -6
- package/dist/cli/commands/append.js.map +1 -1
- package/dist/cli/commands/calendar.js +5 -5
- package/dist/cli/commands/calendar.js.map +1 -1
- package/dist/cli/commands/claim.d.ts +3 -0
- package/dist/cli/commands/claim.js +29 -23
- package/dist/cli/commands/claim.js.map +1 -1
- package/dist/cli/commands/close.js +63 -8
- package/dist/cli/commands/close.js.map +1 -1
- package/dist/cli/commands/comments-audit.js +4 -1
- package/dist/cli/commands/comments-audit.js.map +1 -1
- package/dist/cli/commands/comments.d.ts +5 -0
- package/dist/cli/commands/comments.js +29 -116
- package/dist/cli/commands/comments.js.map +1 -1
- package/dist/cli/commands/completion.js +198 -15
- package/dist/cli/commands/completion.js.map +1 -1
- package/dist/cli/commands/config.js +4 -1
- package/dist/cli/commands/config.js.map +1 -1
- package/dist/cli/commands/context.js +21 -13
- package/dist/cli/commands/context.js.map +1 -1
- package/dist/cli/commands/contracts.d.ts +9 -0
- package/dist/cli/commands/contracts.js +314 -64
- package/dist/cli/commands/contracts.js.map +1 -1
- package/dist/cli/commands/create.js +77 -48
- package/dist/cli/commands/create.js.map +1 -1
- package/dist/cli/commands/dedupe-audit.js +9 -3
- package/dist/cli/commands/dedupe-audit.js.map +1 -1
- package/dist/cli/commands/delete.d.ts +3 -0
- package/dist/cli/commands/delete.js +11 -7
- package/dist/cli/commands/delete.js.map +1 -1
- package/dist/cli/commands/deps.js +4 -1
- package/dist/cli/commands/deps.js.map +1 -1
- package/dist/cli/commands/docs.d.ts +1 -0
- package/dist/cli/commands/docs.js +6 -7
- package/dist/cli/commands/docs.js.map +1 -1
- package/dist/cli/commands/event-validation-messages.d.ts +3 -0
- package/dist/cli/commands/event-validation-messages.js +44 -0
- package/dist/cli/commands/event-validation-messages.js.map +1 -0
- package/dist/cli/commands/extension.d.ts +3 -1
- package/dist/cli/commands/extension.js +259 -52
- package/dist/cli/commands/extension.js.map +1 -1
- package/dist/cli/commands/files.js +8 -12
- package/dist/cli/commands/files.js.map +1 -1
- package/dist/cli/commands/gc.js +19 -3
- package/dist/cli/commands/gc.js.map +1 -1
- package/dist/cli/commands/get.d.ts +10 -5
- package/dist/cli/commands/get.js +135 -20
- package/dist/cli/commands/get.js.map +1 -1
- package/dist/cli/commands/guide.js +6 -8
- package/dist/cli/commands/guide.js.map +1 -1
- package/dist/cli/commands/health.d.ts +14 -0
- package/dist/cli/commands/health.js +269 -67
- package/dist/cli/commands/health.js.map +1 -1
- package/dist/cli/commands/history-redact.d.ts +50 -0
- package/dist/cli/commands/history-redact.js +476 -0
- package/dist/cli/commands/history-redact.js.map +1 -0
- package/dist/cli/commands/history-repair.d.ts +33 -0
- package/dist/cli/commands/history-repair.js +166 -0
- package/dist/cli/commands/history-repair.js.map +1 -0
- package/dist/cli/commands/history.d.ts +4 -0
- package/dist/cli/commands/history.js +12 -79
- package/dist/cli/commands/history.js.map +1 -1
- package/dist/cli/commands/index.d.ts +5 -1
- package/dist/cli/commands/index.js +9 -2
- package/dist/cli/commands/index.js.map +1 -1
- package/dist/cli/commands/init-agent-guidance.d.ts +31 -0
- package/dist/cli/commands/init-agent-guidance.js +336 -0
- package/dist/cli/commands/init-agent-guidance.js.map +1 -0
- package/dist/cli/commands/init.d.ts +42 -0
- package/dist/cli/commands/init.js +96 -1
- package/dist/cli/commands/init.js.map +1 -1
- package/dist/cli/commands/learnings.js +22 -118
- package/dist/cli/commands/learnings.js.map +1 -1
- package/dist/cli/commands/linked-test-entry.d.ts +3 -0
- package/dist/cli/commands/linked-test-entry.js +62 -0
- package/dist/cli/commands/linked-test-entry.js.map +1 -0
- package/dist/cli/commands/list.d.ts +1 -0
- package/dist/cli/commands/list.js +72 -38
- package/dist/cli/commands/list.js.map +1 -1
- package/dist/cli/commands/metadata-normalizers.js +4 -1
- package/dist/cli/commands/metadata-normalizers.js.map +1 -1
- package/dist/cli/commands/normalize.js +4 -1
- package/dist/cli/commands/normalize.js.map +1 -1
- package/dist/cli/commands/notes.js +22 -118
- package/dist/cli/commands/notes.js.map +1 -1
- package/dist/cli/commands/plan.d.ts +121 -0
- package/dist/cli/commands/plan.js +1137 -0
- package/dist/cli/commands/plan.js.map +1 -0
- package/dist/cli/commands/reindex.js +4 -1
- package/dist/cli/commands/reindex.js.map +1 -1
- package/dist/cli/commands/restore.js +9 -49
- package/dist/cli/commands/restore.js.map +1 -1
- package/dist/cli/commands/schema.d.ts +31 -0
- package/dist/cli/commands/schema.js +98 -0
- package/dist/cli/commands/schema.js.map +1 -0
- package/dist/cli/commands/search.js +156 -40
- package/dist/cli/commands/search.js.map +1 -1
- package/dist/cli/commands/stats.js +4 -1
- package/dist/cli/commands/stats.js.map +1 -1
- package/dist/cli/commands/templates.d.ts +4 -0
- package/dist/cli/commands/templates.js +91 -16
- package/dist/cli/commands/templates.js.map +1 -1
- package/dist/cli/commands/test-all.js +6 -7
- package/dist/cli/commands/test-all.js.map +1 -1
- package/dist/cli/commands/test-runs.js +4 -1
- package/dist/cli/commands/test-runs.js.map +1 -1
- package/dist/cli/commands/test.d.ts +1 -0
- package/dist/cli/commands/test.js +9 -9
- package/dist/cli/commands/test.js.map +1 -1
- package/dist/cli/commands/update-many.js +6 -7
- package/dist/cli/commands/update-many.js.map +1 -1
- package/dist/cli/commands/update.js +204 -103
- package/dist/cli/commands/update.js.map +1 -1
- package/dist/cli/commands/upgrade.js +6 -3
- package/dist/cli/commands/upgrade.js.map +1 -1
- package/dist/cli/commands/validate.d.ts +3 -1
- package/dist/cli/commands/validate.js +44 -64
- package/dist/cli/commands/validate.js.map +1 -1
- package/dist/cli/error-guidance.js +99 -6
- package/dist/cli/error-guidance.js.map +1 -1
- package/dist/cli/extension-command-help.d.ts +0 -1
- package/dist/cli/extension-command-help.js +4 -12
- package/dist/cli/extension-command-help.js.map +1 -1
- package/dist/cli/extension-command-options.d.ts +1 -0
- package/dist/cli/extension-command-options.js +108 -6
- package/dist/cli/extension-command-options.js.map +1 -1
- package/dist/cli/guide-topics.js +4 -1
- package/dist/cli/guide-topics.js.map +1 -1
- package/dist/cli/help-content.d.ts +0 -1
- package/dist/cli/help-content.js +46 -22
- package/dist/cli/help-content.js.map +1 -1
- package/dist/cli/help-json-payload.d.ts +1 -0
- package/dist/cli/help-json-payload.js +35 -2
- package/dist/cli/help-json-payload.js.map +1 -1
- package/dist/cli/main.js +214 -30
- package/dist/cli/main.js.map +1 -1
- package/dist/cli/migration-gates.js +4 -1
- package/dist/cli/migration-gates.js.map +1 -1
- package/dist/cli/register-list-query.d.ts +1 -1
- package/dist/cli/register-list-query.js +75 -29
- package/dist/cli/register-list-query.js.map +1 -1
- package/dist/cli/register-mutation.d.ts +1 -1
- package/dist/cli/register-mutation.js +430 -38
- package/dist/cli/register-mutation.js.map +1 -1
- package/dist/cli/register-operations.js +47 -10
- package/dist/cli/register-operations.js.map +1 -1
- package/dist/cli/register-setup.js +47 -25
- package/dist/cli/register-setup.js.map +1 -1
- package/dist/cli/registration-helpers.d.ts +0 -2
- package/dist/cli/registration-helpers.js +21 -40
- package/dist/cli/registration-helpers.js.map +1 -1
- package/dist/cli/shared-parsers.js +4 -1
- package/dist/cli/shared-parsers.js.map +1 -1
- package/dist/cli/telemetry-flush.js +4 -1
- package/dist/cli/telemetry-flush.js.map +1 -1
- package/dist/cli.js +65 -3
- package/dist/cli.js.map +1 -1
- package/dist/core/extensions/extension-types.js +4 -1
- package/dist/core/extensions/extension-types.js.map +1 -1
- package/dist/core/extensions/index.d.ts +0 -1
- package/dist/core/extensions/index.js +4 -13
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/item-fields.js +4 -1
- package/dist/core/extensions/item-fields.js.map +1 -1
- package/dist/core/extensions/loader.js +78 -60
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runtime-registrations.js +4 -1
- package/dist/core/extensions/runtime-registrations.js.map +1 -1
- package/dist/core/fs/fs-utils.js +4 -1
- package/dist/core/fs/fs-utils.js.map +1 -1
- package/dist/core/fs/index.js +4 -1
- package/dist/core/fs/index.js.map +1 -1
- package/dist/core/fs/path-utils.d.ts +1 -0
- package/dist/core/fs/path-utils.js +12 -0
- package/dist/core/fs/path-utils.js.map +1 -0
- package/dist/core/history/drift-scan.d.ts +11 -0
- package/dist/core/history/drift-scan.js +67 -0
- package/dist/core/history/drift-scan.js.map +1 -0
- package/dist/core/history/history-stream-policy.js +4 -1
- package/dist/core/history/history-stream-policy.js.map +1 -1
- package/dist/core/history/history.js +4 -1
- package/dist/core/history/history.js.map +1 -1
- package/dist/core/history/index.js +4 -1
- package/dist/core/history/index.js.map +1 -1
- package/dist/core/history/replay.d.ts +82 -0
- package/dist/core/history/replay.js +249 -0
- package/dist/core/history/replay.js.map +1 -0
- package/dist/core/item/id.js +4 -1
- package/dist/core/item/id.js.map +1 -1
- package/dist/core/item/index.js +4 -1
- package/dist/core/item/index.js.map +1 -1
- package/dist/core/item/item-format.js +250 -8
- package/dist/core/item/item-format.js.map +1 -1
- package/dist/core/item/item-type-definition.d.ts +52 -0
- package/dist/core/item/item-type-definition.js +123 -0
- package/dist/core/item/item-type-definition.js.map +1 -0
- package/dist/core/item/parent-reference-policy.js +4 -1
- package/dist/core/item/parent-reference-policy.js.map +1 -1
- package/dist/core/item/parse.js +34 -3
- package/dist/core/item/parse.js.map +1 -1
- package/dist/core/item/priority.d.ts +23 -0
- package/dist/core/item/priority.js +55 -0
- package/dist/core/item/priority.js.map +1 -0
- package/dist/core/item/sprint-release-format.js +4 -1
- package/dist/core/item/sprint-release-format.js.map +1 -1
- package/dist/core/item/status.d.ts +14 -1
- package/dist/core/item/status.js +24 -1
- package/dist/core/item/status.js.map +1 -1
- package/dist/core/item/toon-decode.d.ts +19 -0
- package/dist/core/item/toon-decode.js +69 -0
- package/dist/core/item/toon-decode.js.map +1 -0
- package/dist/core/item/type-registry.js +15 -83
- package/dist/core/item/type-registry.js.map +1 -1
- package/dist/core/lock/index.js +4 -1
- package/dist/core/lock/index.js.map +1 -1
- package/dist/core/lock/lock.js +4 -1
- package/dist/core/lock/lock.js.map +1 -1
- package/dist/core/output/output.d.ts +4 -0
- package/dist/core/output/output.js +47 -6
- package/dist/core/output/output.js.map +1 -1
- package/dist/core/packages/manifest.d.ts +1 -0
- package/dist/core/packages/manifest.js +6 -8
- package/dist/core/packages/manifest.js.map +1 -1
- package/dist/core/packages/root.d.ts +3 -0
- package/dist/core/packages/root.js +51 -0
- package/dist/core/packages/root.js.map +1 -0
- package/dist/core/schema/item-types-file.d.ts +85 -0
- package/dist/core/schema/item-types-file.js +243 -0
- package/dist/core/schema/item-types-file.js.map +1 -0
- package/dist/core/schema/runtime-field-filters.js +4 -1
- package/dist/core/schema/runtime-field-filters.js.map +1 -1
- package/dist/core/schema/runtime-field-values.js +4 -1
- package/dist/core/schema/runtime-field-values.js.map +1 -1
- package/dist/core/schema/runtime-schema.d.ts +2 -1
- package/dist/core/schema/runtime-schema.js +13 -8
- package/dist/core/schema/runtime-schema.js.map +1 -1
- package/dist/core/search/cache.js +7 -2
- package/dist/core/search/cache.js.map +1 -1
- package/dist/core/search/corpus.d.ts +2 -0
- package/dist/core/search/corpus.js +77 -2
- package/dist/core/search/corpus.js.map +1 -1
- package/dist/core/search/embedding-batches.js +21 -7
- package/dist/core/search/embedding-batches.js.map +1 -1
- package/dist/core/search/http-client.js +4 -1
- package/dist/core/search/http-client.js.map +1 -1
- package/dist/core/search/providers.js +4 -1
- package/dist/core/search/providers.js.map +1 -1
- package/dist/core/search/semantic-defaults.js +12 -3
- package/dist/core/search/semantic-defaults.js.map +1 -1
- package/dist/core/search/vector-stores.js +4 -1
- package/dist/core/search/vector-stores.js.map +1 -1
- package/dist/core/sentry/helpers.js +4 -1
- package/dist/core/sentry/helpers.js.map +1 -1
- package/dist/core/sentry/instrument.js +10 -13
- package/dist/core/sentry/instrument.js.map +1 -1
- package/dist/core/shared/author.d.ts +1 -0
- package/dist/core/shared/author.js +9 -0
- package/dist/core/shared/author.js.map +1 -0
- package/dist/core/shared/command-types.js +4 -1
- package/dist/core/shared/command-types.js.map +1 -1
- package/dist/core/shared/conflict-markers.js +4 -1
- package/dist/core/shared/conflict-markers.js.map +1 -1
- package/dist/core/shared/constants.d.ts +2 -2
- package/dist/core/shared/constants.js +24 -1
- package/dist/core/shared/constants.js.map +1 -1
- package/dist/core/shared/errors.js +4 -1
- package/dist/core/shared/errors.js.map +1 -1
- package/dist/core/shared/index.js +4 -1
- package/dist/core/shared/index.js.map +1 -1
- package/dist/core/shared/lazy-module.d.ts +1 -0
- package/dist/core/shared/lazy-module.js +11 -0
- package/dist/core/shared/lazy-module.js.map +1 -0
- package/dist/core/shared/levenshtein.js +4 -1
- package/dist/core/shared/levenshtein.js.map +1 -1
- package/dist/core/shared/option-alias-visibility.d.ts +44 -0
- package/dist/core/shared/option-alias-visibility.js +76 -0
- package/dist/core/shared/option-alias-visibility.js.map +1 -0
- package/dist/core/shared/primitives.js +4 -1
- package/dist/core/shared/primitives.js.map +1 -1
- package/dist/core/shared/serialization.js +4 -1
- package/dist/core/shared/serialization.js.map +1 -1
- package/dist/core/shared/text-normalization.d.ts +0 -1
- package/dist/core/shared/text-normalization.js +4 -4
- package/dist/core/shared/text-normalization.js.map +1 -1
- package/dist/core/shared/time.js +4 -1
- package/dist/core/shared/time.js.map +1 -1
- package/dist/core/store/front-matter-cache.js +8 -3
- package/dist/core/store/front-matter-cache.js.map +1 -1
- package/dist/core/store/index.js +4 -1
- package/dist/core/store/index.js.map +1 -1
- package/dist/core/store/item-format-migration.js +4 -1
- package/dist/core/store/item-format-migration.js.map +1 -1
- package/dist/core/store/item-store.d.ts +4 -0
- package/dist/core/store/item-store.js +133 -39
- package/dist/core/store/item-store.js.map +1 -1
- package/dist/core/store/paths.js +4 -1
- package/dist/core/store/paths.js.map +1 -1
- package/dist/core/store/settings-validator.d.ts +106 -0
- package/dist/core/store/settings-validator.js +279 -0
- package/dist/core/store/settings-validator.js.map +1 -0
- package/dist/core/store/settings.js +32 -331
- package/dist/core/store/settings.js.map +1 -1
- package/dist/core/telemetry/consent.js +4 -1
- package/dist/core/telemetry/consent.js.map +1 -1
- package/dist/core/telemetry/observability.d.ts +1 -1
- package/dist/core/telemetry/observability.js +11 -2
- package/dist/core/telemetry/observability.js.map +1 -1
- package/dist/core/telemetry/runtime.js +34 -6
- package/dist/core/telemetry/runtime.js.map +1 -1
- package/dist/core/test/background-runs.js +4 -1
- package/dist/core/test/background-runs.js.map +1 -1
- package/dist/core/test/item-test-run-tracking.js +4 -1
- package/dist/core/test/item-test-run-tracking.js.map +1 -1
- package/dist/mcp/server.js +182 -22
- package/dist/mcp/server.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-mutation-options.js +10 -3
- package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -1
- package/dist/sdk/cli-contracts/commander-types.js +4 -1
- package/dist/sdk/cli-contracts/commander-types.js.map +1 -1
- package/dist/sdk/cli-contracts.d.ts +13 -2
- package/dist/sdk/cli-contracts.js +410 -26
- package/dist/sdk/cli-contracts.js.map +1 -1
- package/dist/sdk/index.js +4 -1
- package/dist/sdk/index.js.map +1 -1
- package/dist/sdk/runtime.d.ts +25 -1
- package/dist/sdk/runtime.js +48 -2
- package/dist/sdk/runtime.js.map +1 -1
- package/dist/types/index.js +4 -1
- package/dist/types/index.js.map +1 -1
- package/dist/types.d.ts +92 -2
- package/dist/types.js +42 -1
- package/dist/types.js.map +1 -1
- package/docs/AGENT_GUIDE.md +23 -7
- package/docs/ARCHITECTURE.md +1 -1
- package/docs/CLAUDE_CODE_PLUGIN.md +10 -10
- package/docs/CODEX_PLUGIN.md +2 -2
- package/docs/COMMANDS.md +117 -12
- package/docs/CONFIGURATION.md +5 -2
- package/docs/EXTENSIONS.md +158 -814
- package/docs/QUICKSTART.md +11 -5
- package/docs/README.md +7 -6
- package/docs/RELEASING.md +13 -9
- package/docs/SDK.md +11 -2
- package/docs/TESTING.md +2 -2
- package/marketplace.json +3 -3
- package/package.json +15 -12
- package/packages/pm-beads/package.json +1 -1
- package/packages/pm-calendar/README.md +4 -2
- package/packages/pm-calendar/extensions/calendar/index.js +22 -3
- package/packages/pm-calendar/extensions/calendar/index.ts +22 -3
- package/packages/pm-calendar/extensions/calendar/runtime.js +26 -7
- package/packages/pm-calendar/extensions/calendar/runtime.ts +26 -7
- package/packages/pm-calendar/package.json +1 -1
- package/packages/pm-governance-audit/package.json +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.js +1 -1
- package/packages/pm-guide-shell/extensions/guide-shell/index.ts +1 -1
- package/packages/pm-guide-shell/package.json +1 -1
- package/packages/pm-linked-test-adapters/package.json +1 -1
- package/packages/pm-search-advanced/README.md +8 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.js +74 -0
- package/packages/pm-search-advanced/extensions/search-advanced/index.ts +75 -1
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +67 -9
- package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +67 -9
- package/packages/pm-search-advanced/package.json +1 -1
- package/packages/pm-templates/README.md +1 -1
- package/packages/pm-templates/extensions/templates/runtime.js +11 -202
- package/packages/pm-templates/extensions/templates/runtime.ts +38 -230
- package/packages/pm-templates/package.json +1 -1
- package/packages/pm-todos/package.json +1 -1
- package/plugins/{pm-cli-claude → pm-claude}/.claude-plugin/plugin.json +2 -2
- package/plugins/{pm-cli-claude → pm-claude}/.mcp.json +1 -1
- package/plugins/{pm-cli-claude → pm-claude}/README.md +4 -4
- package/plugins/{pm-cli-claude → pm-claude}/agents/pm-coordinator.md +1 -1
- package/plugins/{pm-cli-claude → pm-claude}/commands/pm-init.md +10 -1
- package/plugins/{pm-cli-claude → pm-claude}/commands/pm-planner.md +18 -0
- package/plugins/{pm-cli-claude → pm-claude}/skills/pm-planner/SKILL.md +46 -1
- package/plugins/{pm-cli-codex → pm-codex}/.codex-plugin/plugin.json +3 -3
- package/plugins/{pm-cli-codex → pm-codex}/.mcp.json +1 -1
- package/plugins/{pm-cli-codex → pm-codex}/README.md +7 -4
- package/plugins/pm-codex/skills/pm-native/SKILL.md +81 -0
- package/scripts/finalize-build.mjs +28 -0
- package/scripts/prepare-build-cache.mjs +37 -0
- package/dist/core/output/command-aware.d.ts +0 -1
- package/dist/core/output/command-aware.js +0 -394
- package/dist/core/output/command-aware.js.map +0 -1
- package/plugins/pm-cli-codex/skills/pm-native/SKILL.md +0 -57
- /package/plugins/{pm-cli-claude → pm-claude}/agents/pm-delivery-chain.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/agents/pm-triage-agent.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/agents/pm-verification-agent.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-audit.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-calendar.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-close-task.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-developer.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-list.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-new.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-release.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-search.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-start-task.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-status.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-triage.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/commands/pm-workflow.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/hooks/hooks.json +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/hooks/session-start.mjs +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/scripts/pm-mcp-server.mjs +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-audit/SKILL.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-developer/SKILL.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-release/SKILL.md +0 -0
- /package/plugins/{pm-cli-claude → pm-claude}/skills/pm-workflow/SKILL.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/assets/pm-cli-small.svg +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/commands/pm-audit.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/commands/pm-close-task.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/commands/pm-start-task.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/scripts/pm-mcp-server.mjs +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-auditor/SKILL.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-auditor/agents/openai.yaml +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-native/agents/openai.yaml +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-release/SKILL.md +0 -0
- /package/plugins/{pm-cli-codex → pm-codex}/skills/pm-release/agents/openai.yaml +0 -0
|
@@ -1,9 +1,13 @@
|
|
|
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]="689e9580-d7f6-5b07-be3d-28c381d20260")}catch(e){}}();
|
|
1
3
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
2
4
|
import { canonicalizeCommandOptionKey, commandOptionFlagLabel, resolveItemTypeRegistry, resolveCommandOptionPolicyState, resolveTypeDefinition, resolveTypeName, validateTypeOptions, } from "../../core/item/type-registry.js";
|
|
3
5
|
import { normalizeItemId } from "../../core/item/id.js";
|
|
6
|
+
import { buildInvalidTypeError } from "../../core/schema/item-types-file.js";
|
|
4
7
|
import { normalizeParentReferenceValue, validateMissingParentReference, } from "../../core/item/parent-reference-policy.js";
|
|
5
8
|
import { validateSprintOrReleaseValue } from "../../core/item/sprint-release-format.js";
|
|
6
9
|
import { createStdinTokenResolver, parseCsvKv, parseOptionalNumber, parseTags } from "../../core/item/parse.js";
|
|
10
|
+
import { resolvePriority } from "../../core/item/priority.js";
|
|
7
11
|
import { normalizeStatusInput } from "../../core/item/status.js";
|
|
8
12
|
import { collectRuntimeUpdateFieldValues } from "../../core/schema/runtime-field-values.js";
|
|
9
13
|
import { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry, } from "../../core/schema/runtime-schema.js";
|
|
@@ -12,11 +16,13 @@ import { PmCliError } from "../../core/shared/errors.js";
|
|
|
12
16
|
import { resolveIsoOrRelative } from "../../core/shared/time.js";
|
|
13
17
|
import { getActiveExtensionRegistrations } from "../../core/extensions/index.js";
|
|
14
18
|
import { applyRegisteredItemFieldDefaultsAndValidation } from "../../core/extensions/item-fields.js";
|
|
15
|
-
import { locateItem, mutateItem } from "../../core/store/item-store.js";
|
|
19
|
+
import { buildItemNotFoundError, locateItem, mutateItem, readLocatedItem } from "../../core/store/item-store.js";
|
|
16
20
|
import { getSettingsPath, resolvePmRoot } from "../../core/store/paths.js";
|
|
17
21
|
import { readSettings } from "../../core/store/settings.js";
|
|
22
|
+
import { runClose } from "./close.js";
|
|
18
23
|
import { normalizeRiskInput, normalizeSeverityInput, parseConfidenceInput, parseRegressionInput, } from "./metadata-normalizers.js";
|
|
19
|
-
import {
|
|
24
|
+
import { resolveEventEndAt } from "./event-validation-messages.js";
|
|
25
|
+
import { DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RECURRENCE_FREQUENCY_VALUES, RECURRENCE_WEEKDAY_VALUES, RISK_VALUES, weekdayOrderIndex, } from "../../types/index.js";
|
|
20
26
|
import { parseDocs, parseFiles, parseLogSeed, parseTests } from "./create.js";
|
|
21
27
|
const LEGACY_NONE_TOKENS = new Set(["none", "null"]);
|
|
22
28
|
const UPDATE_UNSET_FIELD_DEFINITIONS = [
|
|
@@ -477,7 +483,7 @@ function enforceAllowAuditUpdateScope(options, clearFrontMatterKeys) {
|
|
|
477
483
|
}
|
|
478
484
|
function ensureEnum(value, allowed, label) {
|
|
479
485
|
if (!allowed.includes(value)) {
|
|
480
|
-
throw new PmCliError(`Invalid ${label} value "${value}"`, EXIT_CODE.USAGE);
|
|
486
|
+
throw new PmCliError(`Invalid ${label} value "${value}". Allowed: ${allowed.join(", ")}`, EXIT_CODE.USAGE);
|
|
481
487
|
}
|
|
482
488
|
return value;
|
|
483
489
|
}
|
|
@@ -489,16 +495,13 @@ function parseStatus(value, statusRegistry) {
|
|
|
489
495
|
}
|
|
490
496
|
return normalized;
|
|
491
497
|
}
|
|
492
|
-
function weekdayOrderIndex(value) {
|
|
493
|
-
return RECURRENCE_WEEKDAY_VALUES.indexOf(value);
|
|
494
|
-
}
|
|
495
498
|
function parseReminderEntries(raw, nowValue) {
|
|
496
499
|
return raw.map((entry) => {
|
|
497
500
|
const kv = parseCsvKv(entry, "--reminder");
|
|
498
|
-
const atRaw = kv.at?.trim();
|
|
499
|
-
const textRaw = kv.text?.trim();
|
|
501
|
+
const atRaw = (kv.at ?? kv.date)?.trim();
|
|
502
|
+
const textRaw = (kv.text ?? kv.title)?.trim();
|
|
500
503
|
if (!atRaw || !textRaw) {
|
|
501
|
-
throw new PmCliError("--reminder requires at=<iso|relative>
|
|
504
|
+
throw new PmCliError("--reminder requires at=<iso|relative> or date=<iso|relative>, plus text=<value> or title=<value>", EXIT_CODE.USAGE);
|
|
502
505
|
}
|
|
503
506
|
return {
|
|
504
507
|
at: resolveIsoOrRelative(atRaw, nowValue, "reminder.at"),
|
|
@@ -584,10 +587,8 @@ function parseEventEntries(raw, nowValue) {
|
|
|
584
587
|
}
|
|
585
588
|
const startAt = resolveIsoOrRelative(startRaw, nowValue, "event.start");
|
|
586
589
|
const endRaw = kv.end?.trim();
|
|
587
|
-
const
|
|
588
|
-
|
|
589
|
-
throw new PmCliError("--event end must be after start", EXIT_CODE.USAGE);
|
|
590
|
-
}
|
|
590
|
+
const durationRaw = kv.duration?.trim();
|
|
591
|
+
const endAt = resolveEventEndAt(startAt, endRaw, durationRaw, nowValue);
|
|
591
592
|
const titleRaw = kv.title;
|
|
592
593
|
const descriptionRaw = kv.description;
|
|
593
594
|
const locationRaw = kv.location;
|
|
@@ -747,6 +748,63 @@ function parseDependencyRemovals(raw, prefix) {
|
|
|
747
748
|
function dependencyKey(value) {
|
|
748
749
|
return `${value.id}::${value.kind}::${value.source_kind ?? ""}`;
|
|
749
750
|
}
|
|
751
|
+
// pm-kyd6: `--blocked-by` writes the `blocked_by` scalar, but the dependency
|
|
752
|
+
// graph (`pm deps`) is built only from the `dependencies` array. Mirror the
|
|
753
|
+
// behaviour create.ts already has so the metadata and the graph agree: a
|
|
754
|
+
// resolvable blocker also gets a `blocked_by` dependency edge, clearing the
|
|
755
|
+
// scalar removes that edge, and re-pointing it replaces the prior edge.
|
|
756
|
+
function reconcileBlockedByDependency(current, nextBlockedById, nowIsoValue, author) {
|
|
757
|
+
let next = [...(current ?? [])];
|
|
758
|
+
let changed = false;
|
|
759
|
+
const filtered = next.filter((dep) => dep.kind !== "blocked_by" || dep.id === nextBlockedById);
|
|
760
|
+
if (filtered.length !== next.length) {
|
|
761
|
+
next = filtered;
|
|
762
|
+
changed = true;
|
|
763
|
+
}
|
|
764
|
+
if (nextBlockedById && !next.some((dep) => dep.kind === "blocked_by" && dep.id === nextBlockedById)) {
|
|
765
|
+
next.push({ id: nextBlockedById, kind: "blocked_by", created_at: nowIsoValue, author });
|
|
766
|
+
changed = true;
|
|
767
|
+
}
|
|
768
|
+
if (!changed) {
|
|
769
|
+
return { dependencies: current, changed: false };
|
|
770
|
+
}
|
|
771
|
+
return { dependencies: next.length > 0 ? next : undefined, changed: true };
|
|
772
|
+
}
|
|
773
|
+
// pm-kyd6: resolve the --blocked-by target before the synchronous mutate
|
|
774
|
+
// callback so a real blocker can also become a `blocked_by` dependency edge.
|
|
775
|
+
// `id` is set when the target resolves; `unresolved` carries the raw value when
|
|
776
|
+
// --blocked-by points at an item that does not exist (the scalar is still set,
|
|
777
|
+
// mirroring create.ts and the never-block missing-parent behaviour, but the
|
|
778
|
+
// caller surfaces a warning so the metadata/graph mismatch is visible).
|
|
779
|
+
async function resolveBlockedByDependencyTarget(blockedByOption, blockedByCleared, pmRoot, idPrefix, itemFormat, typeToFolder) {
|
|
780
|
+
if (blockedByOption === undefined || blockedByCleared) {
|
|
781
|
+
return {};
|
|
782
|
+
}
|
|
783
|
+
const blockedByValue = blockedByOption.trim();
|
|
784
|
+
if (blockedByValue.length === 0) {
|
|
785
|
+
return {};
|
|
786
|
+
}
|
|
787
|
+
const located = await locateItem(pmRoot, normalizeItemId(blockedByValue, idPrefix), idPrefix, itemFormat, typeToFolder);
|
|
788
|
+
return located ? { id: located.id } : { unresolved: blockedByValue };
|
|
789
|
+
}
|
|
790
|
+
// pm-kyd6: apply the reconciled blocked_by dependency edge to the item metadata
|
|
791
|
+
// and record the `dependencies` change. Kept out of the mutate callback so the
|
|
792
|
+
// large runUpdate function stays under the static-quality complexity budget.
|
|
793
|
+
function applyBlockedByDependencyEdge(metadata, resolvedBlockedById, nowIsoValue, author, changedFields) {
|
|
794
|
+
const reconciled = reconcileBlockedByDependency(metadata.dependencies, resolvedBlockedById, nowIsoValue, author);
|
|
795
|
+
if (!reconciled.changed) {
|
|
796
|
+
return;
|
|
797
|
+
}
|
|
798
|
+
if (reconciled.dependencies === undefined) {
|
|
799
|
+
delete metadata.dependencies;
|
|
800
|
+
}
|
|
801
|
+
else {
|
|
802
|
+
metadata.dependencies = reconciled.dependencies;
|
|
803
|
+
}
|
|
804
|
+
if (!changedFields.includes("dependencies")) {
|
|
805
|
+
changedFields.push("dependencies");
|
|
806
|
+
}
|
|
807
|
+
}
|
|
750
808
|
function fileKey(value) {
|
|
751
809
|
return `${value.path}::${value.scope}`;
|
|
752
810
|
}
|
|
@@ -769,11 +827,7 @@ function matchesDependencySelector(value, selector) {
|
|
|
769
827
|
return true;
|
|
770
828
|
}
|
|
771
829
|
function ensurePriority(raw) {
|
|
772
|
-
|
|
773
|
-
if (![0, 1, 2, 3, 4].includes(parsed)) {
|
|
774
|
-
throw new PmCliError("Priority must be 0..4 (0=critical, 1=high, 2=medium, 3=low, 4=minimal)", EXIT_CODE.USAGE);
|
|
775
|
-
}
|
|
776
|
-
return parsed;
|
|
830
|
+
return resolvePriority(raw);
|
|
777
831
|
}
|
|
778
832
|
function normalizeUpdatePolicyOptionKey(raw, typeName) {
|
|
779
833
|
const canonical = canonicalizeCommandOptionKey("update", raw);
|
|
@@ -1131,76 +1185,132 @@ export async function runUpdate(id, options, global) {
|
|
|
1131
1185
|
parentReferenceWarnings.push(...validateMissingParentReference(normalizedParentId, parentReferencePolicy).warnings);
|
|
1132
1186
|
}
|
|
1133
1187
|
}
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
options.
|
|
1143
|
-
options.
|
|
1144
|
-
options.
|
|
1145
|
-
options.
|
|
1146
|
-
options.
|
|
1147
|
-
options.
|
|
1148
|
-
options.
|
|
1149
|
-
options.
|
|
1150
|
-
options.
|
|
1151
|
-
options.
|
|
1152
|
-
options.
|
|
1153
|
-
options.
|
|
1154
|
-
options.
|
|
1155
|
-
options.
|
|
1156
|
-
options.
|
|
1157
|
-
options.
|
|
1158
|
-
options.
|
|
1159
|
-
options.
|
|
1160
|
-
options.
|
|
1161
|
-
options.
|
|
1162
|
-
options.
|
|
1163
|
-
options.
|
|
1164
|
-
options.
|
|
1165
|
-
options.
|
|
1166
|
-
options.
|
|
1167
|
-
options.
|
|
1168
|
-
options.
|
|
1169
|
-
options.
|
|
1170
|
-
options.
|
|
1171
|
-
options.
|
|
1172
|
-
options.
|
|
1173
|
-
options.
|
|
1174
|
-
options.
|
|
1175
|
-
options.
|
|
1176
|
-
options.
|
|
1177
|
-
options.
|
|
1178
|
-
options.
|
|
1179
|
-
options.
|
|
1180
|
-
options.
|
|
1181
|
-
options.
|
|
1182
|
-
options.
|
|
1183
|
-
options.
|
|
1184
|
-
options.
|
|
1185
|
-
options.
|
|
1186
|
-
options.
|
|
1187
|
-
options.
|
|
1188
|
-
options.
|
|
1189
|
-
options.
|
|
1190
|
-
options.
|
|
1191
|
-
options.
|
|
1192
|
-
options.
|
|
1193
|
-
options.
|
|
1194
|
-
options.
|
|
1195
|
-
options.
|
|
1196
|
-
options.
|
|
1197
|
-
options.
|
|
1198
|
-
options.
|
|
1199
|
-
options.
|
|
1200
|
-
options.
|
|
1201
|
-
|
|
1188
|
+
// pm-kyd6: resolve the --blocked-by target up front (async) so the sync
|
|
1189
|
+
// mutate callback can mirror create.ts and add a `blocked_by` dependency edge.
|
|
1190
|
+
const blockedByResolution = await resolveBlockedByDependencyTarget(options.blockedBy, clearFrontMatterKeys.has("blocked_by"), pmRoot, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
1191
|
+
const resolvedBlockedByDependencyId = blockedByResolution.id;
|
|
1192
|
+
if (blockedByResolution.unresolved !== undefined) {
|
|
1193
|
+
parentReferenceWarnings.push(`blocked_by_unresolved:${blockedByResolution.unresolved}`);
|
|
1194
|
+
}
|
|
1195
|
+
const fieldFlags = {
|
|
1196
|
+
title: options.title !== undefined,
|
|
1197
|
+
description: options.description !== undefined,
|
|
1198
|
+
body: options.body !== undefined,
|
|
1199
|
+
status: options.status !== undefined,
|
|
1200
|
+
closeReason: options.closeReason !== undefined,
|
|
1201
|
+
priority: options.priority !== undefined,
|
|
1202
|
+
type: options.type !== undefined,
|
|
1203
|
+
tags: options.tags !== undefined,
|
|
1204
|
+
deadline: options.deadline !== undefined,
|
|
1205
|
+
estimatedMinutes: options.estimatedMinutes !== undefined,
|
|
1206
|
+
acceptanceCriteria: options.acceptanceCriteria !== undefined,
|
|
1207
|
+
definitionOfReady: options.definitionOfReady !== undefined,
|
|
1208
|
+
order: options.order !== undefined,
|
|
1209
|
+
rank: options.rank !== undefined,
|
|
1210
|
+
goal: options.goal !== undefined,
|
|
1211
|
+
objective: options.objective !== undefined,
|
|
1212
|
+
value: options.value !== undefined,
|
|
1213
|
+
impact: options.impact !== undefined,
|
|
1214
|
+
outcome: options.outcome !== undefined,
|
|
1215
|
+
whyNow: options.whyNow !== undefined,
|
|
1216
|
+
assignee: options.assignee !== undefined,
|
|
1217
|
+
parent: options.parent !== undefined,
|
|
1218
|
+
reviewer: options.reviewer !== undefined,
|
|
1219
|
+
risk: options.risk !== undefined,
|
|
1220
|
+
confidence: options.confidence !== undefined,
|
|
1221
|
+
sprint: options.sprint !== undefined,
|
|
1222
|
+
release: options.release !== undefined,
|
|
1223
|
+
blockedBy: options.blockedBy !== undefined,
|
|
1224
|
+
blockedReason: options.blockedReason !== undefined,
|
|
1225
|
+
unblockNote: options.unblockNote !== undefined,
|
|
1226
|
+
reporter: options.reporter !== undefined,
|
|
1227
|
+
severity: options.severity !== undefined,
|
|
1228
|
+
environment: options.environment !== undefined,
|
|
1229
|
+
reproSteps: options.reproSteps !== undefined,
|
|
1230
|
+
resolution: options.resolution !== undefined,
|
|
1231
|
+
expectedResult: options.expectedResult !== undefined,
|
|
1232
|
+
actualResult: options.actualResult !== undefined,
|
|
1233
|
+
affectedVersion: options.affectedVersion !== undefined,
|
|
1234
|
+
fixedVersion: options.fixedVersion !== undefined,
|
|
1235
|
+
component: options.component !== undefined,
|
|
1236
|
+
regression: options.regression !== undefined,
|
|
1237
|
+
customerImpact: options.customerImpact !== undefined,
|
|
1238
|
+
dep: options.dep !== undefined,
|
|
1239
|
+
depRemove: options.depRemove !== undefined,
|
|
1240
|
+
replaceDeps: options.replaceDeps === true,
|
|
1241
|
+
comment: options.comment !== undefined,
|
|
1242
|
+
note: options.note !== undefined,
|
|
1243
|
+
learning: options.learning !== undefined,
|
|
1244
|
+
file: options.file !== undefined,
|
|
1245
|
+
test: options.test !== undefined,
|
|
1246
|
+
replaceTests: options.replaceTests === true,
|
|
1247
|
+
doc: options.doc !== undefined,
|
|
1248
|
+
reminder: options.reminder !== undefined,
|
|
1249
|
+
event: options.event !== undefined,
|
|
1250
|
+
typeOption: options.typeOption !== undefined,
|
|
1251
|
+
unset: options.unset !== undefined && options.unset.length > 0,
|
|
1252
|
+
clearDeps: options.clearDeps === true,
|
|
1253
|
+
clearComments: options.clearComments === true,
|
|
1254
|
+
clearNotes: options.clearNotes === true,
|
|
1255
|
+
clearLearnings: options.clearLearnings === true,
|
|
1256
|
+
clearFiles: options.clearFiles === true,
|
|
1257
|
+
clearTests: options.clearTests === true,
|
|
1258
|
+
clearDocs: options.clearDocs === true,
|
|
1259
|
+
clearReminders: options.clearReminders === true,
|
|
1260
|
+
clearEvents: options.clearEvents === true,
|
|
1261
|
+
clearTypeOptions: options.clearTypeOptions === true,
|
|
1262
|
+
};
|
|
1263
|
+
const changedFlags = Object.values(fieldFlags).some(Boolean);
|
|
1202
1264
|
if (!changedFlags) {
|
|
1203
|
-
|
|
1265
|
+
const located = await locateItem(pmRoot, id, settings.id_prefix, settings.item_format, typeRegistry.type_to_folder);
|
|
1266
|
+
if (!located) {
|
|
1267
|
+
throw await buildItemNotFoundError(pmRoot, id, settings.id_prefix, typeRegistry.type_to_folder);
|
|
1268
|
+
}
|
|
1269
|
+
const { document } = await readLocatedItem(located, { schema: settings.schema });
|
|
1270
|
+
return {
|
|
1271
|
+
item: document.metadata,
|
|
1272
|
+
changed_fields: [],
|
|
1273
|
+
warnings: ["noop_no_update_fields"],
|
|
1274
|
+
};
|
|
1275
|
+
}
|
|
1276
|
+
// `pm update --status <close_status>` always routes to the auditable close
|
|
1277
|
+
// workflow so agents are never blocked by close-through-update errors. Any
|
|
1278
|
+
// other field updates in the same call are applied first, then the item is
|
|
1279
|
+
// closed with the supplied --close-reason (or a derived default when omitted).
|
|
1280
|
+
if (fieldFlags.status) {
|
|
1281
|
+
const targetStatus = normalizeStatusInput(options.status, statusRegistry);
|
|
1282
|
+
if (targetStatus === statusRegistry.close_status) {
|
|
1283
|
+
const otherFieldKeys = Object.entries(fieldFlags)
|
|
1284
|
+
.filter(([key, value]) => value && key !== "status" && key !== "closeReason")
|
|
1285
|
+
.map(([key]) => key);
|
|
1286
|
+
const routeWarnings = [];
|
|
1287
|
+
let preChangedFields = [];
|
|
1288
|
+
if (otherFieldKeys.length > 0) {
|
|
1289
|
+
const preUpdate = await runUpdate(id, { ...options, status: undefined, closeReason: undefined, message: undefined }, global);
|
|
1290
|
+
preChangedFields = preUpdate.changed_fields;
|
|
1291
|
+
routeWarnings.push(...preUpdate.warnings);
|
|
1292
|
+
}
|
|
1293
|
+
const explicitReason = typeof options.closeReason === "string" ? options.closeReason.trim() : "";
|
|
1294
|
+
const fallbackMessage = typeof options.message === "string" ? options.message.trim() : "";
|
|
1295
|
+
const closeReason = explicitReason || fallbackMessage || "Closed via pm update";
|
|
1296
|
+
// Only flag a defaulted reason when neither --close-reason nor --message
|
|
1297
|
+
// supplied any text and we had to invent the generic placeholder.
|
|
1298
|
+
const reasonDefaulted = explicitReason.length === 0 && fallbackMessage.length === 0;
|
|
1299
|
+
const closeResult = await runClose(id, closeReason, {
|
|
1300
|
+
author: options.author,
|
|
1301
|
+
message: options.message,
|
|
1302
|
+
force: options.force,
|
|
1303
|
+
}, global);
|
|
1304
|
+
const warnings = [...routeWarnings, ...closeResult.warnings, "auto_routed_from_update_to_close"];
|
|
1305
|
+
if (reasonDefaulted) {
|
|
1306
|
+
warnings.push("close_reason_defaulted");
|
|
1307
|
+
}
|
|
1308
|
+
return {
|
|
1309
|
+
item: closeResult.item,
|
|
1310
|
+
changed_fields: [...preChangedFields, ...closeResult.changed_fields],
|
|
1311
|
+
warnings,
|
|
1312
|
+
};
|
|
1313
|
+
}
|
|
1204
1314
|
}
|
|
1205
1315
|
if (options.order !== undefined && options.rank !== undefined && options.order !== options.rank) {
|
|
1206
1316
|
throw new PmCliError("--order and --rank must match when both are provided", EXIT_CODE.USAGE);
|
|
@@ -1234,21 +1344,9 @@ export async function runUpdate(id, options, global) {
|
|
|
1234
1344
|
const previousStatus = document.metadata.status;
|
|
1235
1345
|
const previousStatusNormalized = normalizeStatusInput(previousStatus, statusRegistry) ?? previousStatus;
|
|
1236
1346
|
if (options.status !== undefined) {
|
|
1347
|
+
// Close-status routing (with reason + audit) is handled before mutateItem
|
|
1348
|
+
// by the close gate above, so only non-close transitions reach this path.
|
|
1237
1349
|
const status = parseStatus(options.status, statusRegistry);
|
|
1238
|
-
if (status === statusRegistry.close_status) {
|
|
1239
|
-
throw new PmCliError(`Invalid --status value "${statusRegistry.close_status}". Use "pm close <ID> <TEXT>" to close an item.`, EXIT_CODE.USAGE, {
|
|
1240
|
-
code: "close_through_update",
|
|
1241
|
-
why: "Closing requires a close reason and optional validation checks that pm update cannot enforce. Use pm close for auditable close workflows.",
|
|
1242
|
-
examples: [
|
|
1243
|
-
`pm close ${id} "All acceptance criteria met" --author "${author}" --message "Close: verified"`,
|
|
1244
|
-
`pm close ${id} "Resolved" --validate-close warn --author "${author}"`,
|
|
1245
|
-
],
|
|
1246
|
-
nextSteps: [
|
|
1247
|
-
'Use "pm close <ID> <reason>" to close with required close reason and optional --validate-close.',
|
|
1248
|
-
'To cancel instead, use "pm update <ID> --status canceled".',
|
|
1249
|
-
],
|
|
1250
|
-
});
|
|
1251
|
-
}
|
|
1252
1350
|
document.metadata.status = status;
|
|
1253
1351
|
if (status === statusRegistry.canceled_status) {
|
|
1254
1352
|
delete document.metadata.assignee;
|
|
@@ -1282,7 +1380,7 @@ export async function runUpdate(id, options, global) {
|
|
|
1282
1380
|
if (options.type !== undefined) {
|
|
1283
1381
|
const resolvedTypeName = resolveTypeName(options.type, typeRegistry);
|
|
1284
1382
|
if (!resolvedTypeName) {
|
|
1285
|
-
throw new PmCliError(
|
|
1383
|
+
throw new PmCliError(buildInvalidTypeError(options.type, typeRegistry.types), EXIT_CODE.USAGE);
|
|
1286
1384
|
}
|
|
1287
1385
|
document.metadata.type = resolvedTypeName;
|
|
1288
1386
|
activeTypeName = resolvedTypeName;
|
|
@@ -1622,6 +1720,8 @@ export async function runUpdate(id, options, global) {
|
|
|
1622
1720
|
document.metadata.blocked_by = options.blockedBy.trim();
|
|
1623
1721
|
}
|
|
1624
1722
|
changedFields.push("blocked_by");
|
|
1723
|
+
// pm-kyd6: keep the dependency graph in sync with the blocked_by scalar.
|
|
1724
|
+
applyBlockedByDependencyEdge(document.metadata, resolvedBlockedByDependencyId, nowIso, author, changedFields);
|
|
1625
1725
|
}
|
|
1626
1726
|
if (options.blockedReason !== undefined || clearFrontMatterKeys.has("blocked_reason")) {
|
|
1627
1727
|
if (clearFrontMatterKeys.has("blocked_reason")) {
|
|
@@ -1804,4 +1904,5 @@ export async function runUpdate(id, options, global) {
|
|
|
1804
1904
|
...(options.allowAuditUpdate === true || options.allowAuditDepUpdate === true ? { audit_update: true } : {}),
|
|
1805
1905
|
};
|
|
1806
1906
|
}
|
|
1807
|
-
//# sourceMappingURL=update.js.map
|
|
1907
|
+
//# sourceMappingURL=update.js.map
|
|
1908
|
+
//# debugId=689e9580-d7f6-5b07-be3d-28c381d20260
|