@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,3 +1,5 @@
|
|
|
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]="69ff4814-0641-5d85-962e-a798cfd1a78e")}catch(e){}}();
|
|
1
3
|
import { execFile } from "node:child_process";
|
|
2
4
|
import fs from "node:fs/promises";
|
|
3
5
|
import os from "node:os";
|
|
@@ -7,7 +9,9 @@ import { promisify } from "node:util";
|
|
|
7
9
|
import { activateExtensions, loadExtensions, nextExtensionReloadToken } from "../../core/extensions/index.js";
|
|
8
10
|
import { EXTENSION_CAPABILITY_CONTRACT, KNOWN_EXTENSION_CAPABILITIES, parseLegacyExtensionCapabilityAliasWarning, parseUnknownExtensionCapabilityWarning, resolveExtensionRoots, } from "../../core/extensions/loader.js";
|
|
9
11
|
import { pathExists } from "../../core/fs/fs-utils.js";
|
|
12
|
+
import { isPathWithinDirectory } from "../../core/fs/path-utils.js";
|
|
10
13
|
import { PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, } from "../../core/packages/manifest.js";
|
|
14
|
+
import { resolvePmPackageRootFromModule } from "../../core/packages/root.js";
|
|
11
15
|
import { EXIT_CODE } from "../../core/shared/constants.js";
|
|
12
16
|
import { PmCliError } from "../../core/shared/errors.js";
|
|
13
17
|
import { nowIso } from "../../core/shared/time.js";
|
|
@@ -35,8 +39,7 @@ function resolvePackageRootCandidates() {
|
|
|
35
39
|
if (typeof envRoot === "string" && envRoot.trim().length > 0) {
|
|
36
40
|
candidates.push(path.resolve(envRoot.trim()));
|
|
37
41
|
}
|
|
38
|
-
|
|
39
|
-
candidates.push(moduleRoot);
|
|
42
|
+
candidates.push(resolvePmPackageRootFromModule(import.meta.url, ["../../.."]));
|
|
40
43
|
return [...new Set(candidates)];
|
|
41
44
|
}
|
|
42
45
|
async function resolveBundledExtensionAliasSource(input) {
|
|
@@ -253,13 +256,6 @@ function parseExtensionManifest(raw) {
|
|
|
253
256
|
capabilities,
|
|
254
257
|
};
|
|
255
258
|
}
|
|
256
|
-
function isPathWithinDirectory(directory, targetPath) {
|
|
257
|
-
const relative = path.relative(directory, targetPath);
|
|
258
|
-
if (relative.length === 0) {
|
|
259
|
-
return true;
|
|
260
|
-
}
|
|
261
|
-
return !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
262
|
-
}
|
|
263
259
|
async function isCanonicalPathWithinDirectory(directory, targetPath) {
|
|
264
260
|
const [resolvedDirectory, resolvedTargetPath] = await Promise.all([fs.realpath(directory), fs.realpath(targetPath)]);
|
|
265
261
|
return isPathWithinDirectory(resolvedDirectory, resolvedTargetPath);
|
|
@@ -320,6 +316,21 @@ function sortManagedEntries(entries) {
|
|
|
320
316
|
return left.directory.localeCompare(right.directory);
|
|
321
317
|
});
|
|
322
318
|
}
|
|
319
|
+
function managedExtensionSourcesEquivalent(left, right) {
|
|
320
|
+
if (left.kind !== right.kind || left.input !== right.input || left.location !== right.location) {
|
|
321
|
+
return false;
|
|
322
|
+
}
|
|
323
|
+
if (left.kind === "npm" && right.kind === "npm") {
|
|
324
|
+
return left.package === right.package && left.version === right.version;
|
|
325
|
+
}
|
|
326
|
+
if (left.kind === "github" && right.kind === "github") {
|
|
327
|
+
return left.repository === right.repository && left.ref === right.ref && left.subpath === right.subpath && left.commit === right.commit;
|
|
328
|
+
}
|
|
329
|
+
if (left.kind === "builtin" && right.kind === "builtin") {
|
|
330
|
+
return left.name === right.name;
|
|
331
|
+
}
|
|
332
|
+
return true;
|
|
333
|
+
}
|
|
323
334
|
function normalizeManagedState(raw) {
|
|
324
335
|
if (typeof raw !== "object" || raw === null) {
|
|
325
336
|
return null;
|
|
@@ -350,7 +361,7 @@ function normalizeManagedState(raw) {
|
|
|
350
361
|
continue;
|
|
351
362
|
}
|
|
352
363
|
const source = entry.source;
|
|
353
|
-
if ((source.kind !== "local" && source.kind !== "github" && source.kind !== "npm") ||
|
|
364
|
+
if ((source.kind !== "local" && source.kind !== "github" && source.kind !== "npm" && source.kind !== "builtin") ||
|
|
354
365
|
typeof source.input !== "string" ||
|
|
355
366
|
typeof source.location !== "string") {
|
|
356
367
|
continue;
|
|
@@ -368,6 +379,7 @@ function normalizeManagedState(raw) {
|
|
|
368
379
|
kind: source.kind,
|
|
369
380
|
input: source.input,
|
|
370
381
|
location: source.location,
|
|
382
|
+
name: typeof source.name === "string" ? source.name : undefined,
|
|
371
383
|
package: typeof source.package === "string" ? source.package : undefined,
|
|
372
384
|
version: typeof source.version === "string" ? source.version : undefined,
|
|
373
385
|
repository: typeof source.repository === "string" ? source.repository : undefined,
|
|
@@ -557,7 +569,19 @@ function resolveAction(target, options) {
|
|
|
557
569
|
if (typeof target === "string" && (target.trim().toLowerCase() === "init" || target.trim().toLowerCase() === "scaffold")) {
|
|
558
570
|
return "init";
|
|
559
571
|
}
|
|
560
|
-
|
|
572
|
+
if (typeof target === "string" && target.trim().toLowerCase() === "explore") {
|
|
573
|
+
return "explore";
|
|
574
|
+
}
|
|
575
|
+
if (typeof target === "string" && target.trim().toLowerCase() === "manage") {
|
|
576
|
+
return "manage";
|
|
577
|
+
}
|
|
578
|
+
if (typeof target === "string" && (target.trim().toLowerCase() === "list" || target.trim() === "")) {
|
|
579
|
+
return "explore";
|
|
580
|
+
}
|
|
581
|
+
if (target === undefined) {
|
|
582
|
+
return "explore";
|
|
583
|
+
}
|
|
584
|
+
throw new PmCliError("One action flag is required. Use one of: --install, --uninstall, --explore, --manage, --reload, --doctor, --catalog, --init/--scaffold, --adopt, --adopt-all, --activate, --deactivate. Bare `pm package` and `pm extension` default to --explore.", EXIT_CODE.USAGE);
|
|
561
585
|
}
|
|
562
586
|
if (selected.length > 1) {
|
|
563
587
|
throw new PmCliError("Extension action flags are mutually exclusive.", EXIT_CODE.USAGE);
|
|
@@ -572,13 +596,19 @@ function resolveScope(options) {
|
|
|
572
596
|
}
|
|
573
597
|
return global ? "global" : "project";
|
|
574
598
|
}
|
|
575
|
-
async function buildBundledPackageCatalog(scope, global) {
|
|
599
|
+
async function buildBundledPackageCatalog(scope, global, options = {}) {
|
|
576
600
|
const roots = resolveExtensionRoots(resolvePmRoot(process.cwd(), global.path), process.cwd());
|
|
577
601
|
const selectedRoot = scope === "global" ? roots.global : roots.project;
|
|
578
602
|
const managedStateRead = await readManagedExtensionState(selectedRoot);
|
|
579
603
|
const installedLocations = new Set(managedStateRead.state.entries
|
|
580
604
|
.filter((entry) => entry.scope === scope)
|
|
605
|
+
.filter((entry) => entry.source.kind !== "builtin")
|
|
581
606
|
.map((entry) => path.resolve(entry.source.location)));
|
|
607
|
+
const installedBuiltinAliases = new Set(managedStateRead.state.entries
|
|
608
|
+
.filter((entry) => entry.scope === scope && entry.source.kind === "builtin")
|
|
609
|
+
.flatMap((entry) => [entry.source.name, entry.source.input, entry.source.location])
|
|
610
|
+
.filter((value) => typeof value === "string" && value.trim().length > 0)
|
|
611
|
+
.map((value) => value.trim().toLowerCase()));
|
|
582
612
|
const packages = [];
|
|
583
613
|
for (const alias of await listBundledPackageAliases()) {
|
|
584
614
|
const packageRoot = await resolveBundledPackageRoot(alias);
|
|
@@ -599,7 +629,9 @@ async function buildBundledPackageCatalog(scope, global) {
|
|
|
599
629
|
const report = manifest.catalog?.links?.report ?? manifest.package_bugs_url;
|
|
600
630
|
const docs = manifest.catalog?.links?.docs ?? manifest.package_homepage;
|
|
601
631
|
const npm = manifest.catalog?.links?.npm ??
|
|
602
|
-
(manifest.package_name
|
|
632
|
+
(manifest.package_name && manifest.package_private !== true
|
|
633
|
+
? `https://www.npmjs.com/package/${encodeURIComponent(manifest.package_name)}`
|
|
634
|
+
: undefined);
|
|
603
635
|
const metadataOnlyResources = Object.fromEntries(PM_PACKAGE_RESOURCE_KINDS
|
|
604
636
|
.filter((resourceKind) => resourceKind !== "extensions")
|
|
605
637
|
.map((resourceKind) => [resourceKind, manifest.resources[resourceKind] ?? []])
|
|
@@ -608,10 +640,9 @@ async function buildBundledPackageCatalog(scope, global) {
|
|
|
608
640
|
alias,
|
|
609
641
|
bundled: true,
|
|
610
642
|
available: true,
|
|
611
|
-
installed: installedLocations.has(path.resolve(packageRoot)),
|
|
643
|
+
installed: installedBuiltinAliases.has(alias) || installedLocations.has(path.resolve(packageRoot)),
|
|
612
644
|
install_target: alias,
|
|
613
645
|
install_command: `pm install ${alias} ${installScopeFlag}`,
|
|
614
|
-
package_root: packageRoot,
|
|
615
646
|
package_name: manifest.package_name,
|
|
616
647
|
package_version: manifest.package_version,
|
|
617
648
|
description: manifest.catalog?.summary ?? manifest.package_description,
|
|
@@ -635,14 +666,68 @@ async function buildBundledPackageCatalog(scope, global) {
|
|
|
635
666
|
},
|
|
636
667
|
});
|
|
637
668
|
}
|
|
669
|
+
const fields = parsePackageCatalogFields(options.fields);
|
|
670
|
+
const outputPackages = fields ? packages.map((entry) => projectPackageCatalogEntry(entry, fields)) : packages;
|
|
638
671
|
return {
|
|
639
|
-
total:
|
|
672
|
+
total: outputPackages.length,
|
|
640
673
|
scope,
|
|
641
674
|
installable_resource_kinds: ["extensions"],
|
|
642
675
|
metadata_only_resource_kinds: PM_PACKAGE_RESOURCE_KINDS.filter((resourceKind) => resourceKind !== "extensions"),
|
|
643
|
-
packages,
|
|
676
|
+
packages: outputPackages,
|
|
644
677
|
};
|
|
645
678
|
}
|
|
679
|
+
const PACKAGE_CATALOG_FIELD_KEYS = new Set([
|
|
680
|
+
"alias",
|
|
681
|
+
"bundled",
|
|
682
|
+
"available",
|
|
683
|
+
"installed",
|
|
684
|
+
"install_target",
|
|
685
|
+
"install_command",
|
|
686
|
+
"package_name",
|
|
687
|
+
"package_version",
|
|
688
|
+
"description",
|
|
689
|
+
"keywords",
|
|
690
|
+
"resources",
|
|
691
|
+
"installable_resources",
|
|
692
|
+
"metadata_only_resources",
|
|
693
|
+
"catalog",
|
|
694
|
+
"category",
|
|
695
|
+
"display_name",
|
|
696
|
+
]);
|
|
697
|
+
function parsePackageCatalogFields(raw) {
|
|
698
|
+
if (raw === undefined) {
|
|
699
|
+
return undefined;
|
|
700
|
+
}
|
|
701
|
+
const fields = [...new Set(raw.split(",").map((entry) => entry.trim()).filter((entry) => entry.length > 0))];
|
|
702
|
+
if (fields.length === 0) {
|
|
703
|
+
throw new PmCliError("Package catalog --fields requires a comma-separated list of field names", EXIT_CODE.USAGE);
|
|
704
|
+
}
|
|
705
|
+
const unknown = fields.filter((field) => !PACKAGE_CATALOG_FIELD_KEYS.has(field));
|
|
706
|
+
if (unknown.length > 0) {
|
|
707
|
+
throw new PmCliError(`Unknown package catalog --fields value(s): ${unknown.join(", ")}`, EXIT_CODE.USAGE, {
|
|
708
|
+
examples: [
|
|
709
|
+
"pm package list --project --fields alias,installed,install_command",
|
|
710
|
+
"pm package catalog --project --fields alias,package_name,category",
|
|
711
|
+
],
|
|
712
|
+
});
|
|
713
|
+
}
|
|
714
|
+
return fields;
|
|
715
|
+
}
|
|
716
|
+
function projectPackageCatalogEntry(entry, fields) {
|
|
717
|
+
const projected = {};
|
|
718
|
+
for (const field of fields) {
|
|
719
|
+
if (field === "category") {
|
|
720
|
+
projected[field] = entry.catalog?.category ?? null;
|
|
721
|
+
}
|
|
722
|
+
else if (field === "display_name") {
|
|
723
|
+
projected[field] = entry.catalog?.display_name ?? null;
|
|
724
|
+
}
|
|
725
|
+
else {
|
|
726
|
+
projected[field] = entry[field] ?? null;
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
return projected;
|
|
730
|
+
}
|
|
646
731
|
function parseGithubPathSpec(pathSpec, input, refOverride) {
|
|
647
732
|
const segments = pathSpec
|
|
648
733
|
.split("/")
|
|
@@ -843,6 +928,7 @@ async function resolveNpmSourceDirectory(source) {
|
|
|
843
928
|
const packed = parsePackedNpmPackage(packStdout, packDirectory);
|
|
844
929
|
await execFileAsync("tar", ["-xzf", packed.tarball, "-C", extractDirectory], { encoding: "utf8" });
|
|
845
930
|
const packageRoot = path.join(extractDirectory, "package");
|
|
931
|
+
await installNpmPackageRuntimeDependencies(packageRoot);
|
|
846
932
|
const directory = await resolvePackageExtensionDirectory(packageRoot, source.input);
|
|
847
933
|
return {
|
|
848
934
|
directory,
|
|
@@ -858,6 +944,50 @@ async function resolveNpmSourceDirectory(source) {
|
|
|
858
944
|
throw error;
|
|
859
945
|
}
|
|
860
946
|
}
|
|
947
|
+
async function installNpmPackageRuntimeDependencies(packageRoot) {
|
|
948
|
+
const packageJsonPath = path.join(packageRoot, "package.json");
|
|
949
|
+
if (!(await pathExists(packageJsonPath))) {
|
|
950
|
+
return;
|
|
951
|
+
}
|
|
952
|
+
let parsed;
|
|
953
|
+
try {
|
|
954
|
+
parsed = JSON.parse(await fs.readFile(packageJsonPath, "utf8"));
|
|
955
|
+
}
|
|
956
|
+
catch {
|
|
957
|
+
return;
|
|
958
|
+
}
|
|
959
|
+
if (typeof parsed !== "object" || parsed === null) {
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
const manifest = parsed;
|
|
963
|
+
const dependencySpecs = runtimeDependencyInstallSpecs(manifest);
|
|
964
|
+
if (dependencySpecs.length === 0) {
|
|
965
|
+
return;
|
|
966
|
+
}
|
|
967
|
+
const runtimeOnlyManifest = { ...parsed };
|
|
968
|
+
delete runtimeOnlyManifest.devDependencies;
|
|
969
|
+
await fs.writeFile(packageJsonPath, `${JSON.stringify(runtimeOnlyManifest, null, 2)}\n`, "utf8");
|
|
970
|
+
await Promise.all([
|
|
971
|
+
fs.rm(path.join(packageRoot, "package-lock.json"), { force: true }),
|
|
972
|
+
fs.rm(path.join(packageRoot, "npm-shrinkwrap.json"), { force: true }),
|
|
973
|
+
]);
|
|
974
|
+
await runNpmCommand(["install", "--ignore-scripts", "--no-audit", "--fund=false", "--package-lock=false", "--no-save", ...dependencySpecs], packageRoot);
|
|
975
|
+
}
|
|
976
|
+
function runtimeDependencyInstallSpecs(manifest) {
|
|
977
|
+
const specs = new Map();
|
|
978
|
+
for (const dependencyMap of [manifest.dependencies, manifest.optionalDependencies, manifest.peerDependencies]) {
|
|
979
|
+
if (typeof dependencyMap !== "object" || dependencyMap === null) {
|
|
980
|
+
continue;
|
|
981
|
+
}
|
|
982
|
+
for (const [name, version] of Object.entries(dependencyMap)) {
|
|
983
|
+
if (typeof version !== "string" || version.trim().length === 0 || specs.has(name)) {
|
|
984
|
+
continue;
|
|
985
|
+
}
|
|
986
|
+
specs.set(name, `${name}@${version.trim()}`);
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
return [...specs.values()];
|
|
990
|
+
}
|
|
861
991
|
async function resolvePackageExtensionDirectory(packageRoot, sourceLabel) {
|
|
862
992
|
const discovered = await collectPackageExtensionDirectories(packageRoot);
|
|
863
993
|
if (discovered.length === 1) {
|
|
@@ -896,11 +1026,14 @@ async function resolveGithubSourceDirectory(cloneDirectory, source) {
|
|
|
896
1026
|
}
|
|
897
1027
|
async function resolveInstallSource(source) {
|
|
898
1028
|
if (source.kind === "local") {
|
|
899
|
-
|
|
1029
|
+
let localStats;
|
|
1030
|
+
try {
|
|
1031
|
+
localStats = await fs.stat(source.absolute_path);
|
|
1032
|
+
}
|
|
1033
|
+
catch {
|
|
900
1034
|
throw new PmCliError(`Local extension source does not exist: "${source.absolute_path}".`, EXIT_CODE.NOT_FOUND);
|
|
901
1035
|
}
|
|
902
|
-
|
|
903
|
-
if (!stats.isDirectory()) {
|
|
1036
|
+
if (!localStats.isDirectory()) {
|
|
904
1037
|
throw new PmCliError(`Local extension source must be a directory: "${source.absolute_path}".`, EXIT_CODE.USAGE);
|
|
905
1038
|
}
|
|
906
1039
|
const directory = await resolvePackageExtensionDirectory(source.absolute_path, source.input);
|
|
@@ -1319,6 +1452,7 @@ function lifecycleFlagCommand(options, action) {
|
|
|
1319
1452
|
return options.vocabulary === "package" ? `pm package ${action}` : `pm extension --${action}`;
|
|
1320
1453
|
}
|
|
1321
1454
|
function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabulary) {
|
|
1455
|
+
const packageName = `pm-${extensionName}`;
|
|
1322
1456
|
const manifest = `${JSON.stringify({
|
|
1323
1457
|
name: extensionName,
|
|
1324
1458
|
version: "0.1.0",
|
|
@@ -1344,10 +1478,63 @@ function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabula
|
|
|
1344
1478
|
"};",
|
|
1345
1479
|
"",
|
|
1346
1480
|
].join("\n");
|
|
1481
|
+
if (vocabulary === "package") {
|
|
1482
|
+
const packageJson = `${JSON.stringify({
|
|
1483
|
+
name: packageName,
|
|
1484
|
+
version: "0.1.0",
|
|
1485
|
+
private: true,
|
|
1486
|
+
type: "module",
|
|
1487
|
+
keywords: ["pm-package"],
|
|
1488
|
+
peerDependencies: {
|
|
1489
|
+
"@unbrained/pm-cli": "*",
|
|
1490
|
+
},
|
|
1491
|
+
pm: {
|
|
1492
|
+
aliases: [extensionName],
|
|
1493
|
+
extensions: [`extensions/${extensionName}`],
|
|
1494
|
+
docs: ["README.md"],
|
|
1495
|
+
examples: ["README.md"],
|
|
1496
|
+
catalog: {
|
|
1497
|
+
display_name: extensionName,
|
|
1498
|
+
category: "workflow",
|
|
1499
|
+
summary: "Starter pm package scaffold.",
|
|
1500
|
+
tags: ["starter"],
|
|
1501
|
+
},
|
|
1502
|
+
},
|
|
1503
|
+
}, null, 2)}\n`;
|
|
1504
|
+
const packageReadme = [
|
|
1505
|
+
`# ${packageName}`,
|
|
1506
|
+
"",
|
|
1507
|
+
"Generated by `pm package init`.",
|
|
1508
|
+
"",
|
|
1509
|
+
"## Included Files",
|
|
1510
|
+
"- `package.json`: package metadata and `pm` resource manifest.",
|
|
1511
|
+
`- \`extensions/${extensionName}/manifest.json\`: extension metadata and capabilities.`,
|
|
1512
|
+
`- \`extensions/${extensionName}/index.js\`: starter command registration using the \`commands\` capability.`,
|
|
1513
|
+
"",
|
|
1514
|
+
"## Quick Start",
|
|
1515
|
+
"```bash",
|
|
1516
|
+
"pm install --project <package-path>",
|
|
1517
|
+
`pm ${commandName}`,
|
|
1518
|
+
"pm package doctor --project --detail summary",
|
|
1519
|
+
"```",
|
|
1520
|
+
"",
|
|
1521
|
+
"## Notes",
|
|
1522
|
+
"- Keep package metadata in `package.json` and runtime behavior under `extensions/`.",
|
|
1523
|
+
"- Add capabilities to the extension manifest only when the entrypoint uses the matching SDK API.",
|
|
1524
|
+
"- Use `@unbrained/pm-cli/sdk` as the public SDK import for richer package runtimes.",
|
|
1525
|
+
"",
|
|
1526
|
+
].join("\n");
|
|
1527
|
+
return {
|
|
1528
|
+
"package.json": packageJson,
|
|
1529
|
+
[`extensions/${extensionName}/manifest.json`]: manifest,
|
|
1530
|
+
[`extensions/${extensionName}/index.js`]: entrypoint,
|
|
1531
|
+
"README.md": packageReadme,
|
|
1532
|
+
};
|
|
1533
|
+
}
|
|
1347
1534
|
const readme = [
|
|
1348
1535
|
`# ${extensionName}`,
|
|
1349
1536
|
"",
|
|
1350
|
-
|
|
1537
|
+
"Generated by `pm extension init`.",
|
|
1351
1538
|
"",
|
|
1352
1539
|
"## Included Files",
|
|
1353
1540
|
"- `manifest.json`: extension metadata and capabilities.",
|
|
@@ -1355,9 +1542,9 @@ function buildStarterExtensionScaffoldFiles(extensionName, commandName, vocabula
|
|
|
1355
1542
|
"",
|
|
1356
1543
|
"## Quick Start",
|
|
1357
1544
|
"```bash",
|
|
1358
|
-
|
|
1545
|
+
"pm extension --install --project <scaffold-path>",
|
|
1359
1546
|
`pm ${commandName}`,
|
|
1360
|
-
|
|
1547
|
+
"pm extension --doctor --project --detail summary",
|
|
1361
1548
|
"```",
|
|
1362
1549
|
"",
|
|
1363
1550
|
"## Notes",
|
|
@@ -1391,6 +1578,7 @@ async function scaffoldExtensionProject(target, vocabulary = "extension") {
|
|
|
1391
1578
|
const files = [];
|
|
1392
1579
|
for (const [relativePath, content] of Object.entries(scaffoldFiles)) {
|
|
1393
1580
|
const absolutePath = path.join(targetPath, relativePath);
|
|
1581
|
+
await fs.mkdir(path.dirname(absolutePath), { recursive: true });
|
|
1394
1582
|
if (await pathExists(absolutePath)) {
|
|
1395
1583
|
const existingContent = await fs.readFile(absolutePath, "utf8");
|
|
1396
1584
|
if (existingContent !== content) {
|
|
@@ -1689,12 +1877,19 @@ export async function runExtension(target, options, global) {
|
|
|
1689
1877
|
ok: true,
|
|
1690
1878
|
action,
|
|
1691
1879
|
scope,
|
|
1692
|
-
roots:
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1880
|
+
roots: action === "catalog" && typeof options.fields === "string" && options.fields.trim().length > 0
|
|
1881
|
+
? {
|
|
1882
|
+
project: "project",
|
|
1883
|
+
global: "global",
|
|
1884
|
+
selected: scope,
|
|
1885
|
+
settings_root: "project",
|
|
1886
|
+
}
|
|
1887
|
+
: {
|
|
1888
|
+
project: resolvedRoots.roots.project,
|
|
1889
|
+
global: resolvedRoots.roots.global,
|
|
1890
|
+
selected: resolvedRoots.selected_root,
|
|
1891
|
+
settings_root: resolvedRoots.settings_root,
|
|
1892
|
+
},
|
|
1698
1893
|
warnings: [...new Set(warnings)].sort((left, right) => left.localeCompare(right)),
|
|
1699
1894
|
details,
|
|
1700
1895
|
});
|
|
@@ -1774,7 +1969,7 @@ export async function runExtension(target, options, global) {
|
|
|
1774
1969
|
if (typeof normalizedTarget === "string" && normalizedTarget.length > 0 && normalizedTarget !== "catalog") {
|
|
1775
1970
|
throw new PmCliError('Action "catalog" does not accept a package target.', EXIT_CODE.USAGE);
|
|
1776
1971
|
}
|
|
1777
|
-
return withResult(await buildBundledPackageCatalog(scope, global));
|
|
1972
|
+
return withResult(await buildBundledPackageCatalog(scope, global, options));
|
|
1778
1973
|
}
|
|
1779
1974
|
if (action === "install") {
|
|
1780
1975
|
const githubOption = resolveGithubOption(options);
|
|
@@ -1810,6 +2005,7 @@ export async function runExtension(target, options, global) {
|
|
|
1810
2005
|
});
|
|
1811
2006
|
}
|
|
1812
2007
|
const bundledAliasSource = typeof githubOption === "string" ? null : await resolveBundledExtensionAliasSource(explicitSourceInput);
|
|
2008
|
+
const bundledAliasName = bundledAliasSource === null ? null : explicitSourceInput.trim().toLowerCase();
|
|
1813
2009
|
const sourceInput = bundledAliasSource ?? explicitSourceInput;
|
|
1814
2010
|
const installSource = parseExtensionInstallSource(sourceInput, {
|
|
1815
2011
|
forceGithub: typeof githubOption === "string",
|
|
@@ -1832,33 +2028,43 @@ export async function runExtension(target, options, global) {
|
|
|
1832
2028
|
}
|
|
1833
2029
|
await fs.cp(validated.directory, destinationDirectory, { recursive: true, force: true });
|
|
1834
2030
|
}
|
|
1835
|
-
const sourceRecord =
|
|
2031
|
+
const sourceRecord = bundledAliasName
|
|
1836
2032
|
? {
|
|
1837
|
-
kind: "
|
|
1838
|
-
input:
|
|
1839
|
-
location:
|
|
2033
|
+
kind: "builtin",
|
|
2034
|
+
input: bundledAliasName,
|
|
2035
|
+
location: bundledAliasName,
|
|
2036
|
+
name: bundledAliasName,
|
|
1840
2037
|
}
|
|
1841
|
-
: installSource.kind === "
|
|
2038
|
+
: installSource.kind === "local"
|
|
1842
2039
|
? {
|
|
1843
|
-
kind: "
|
|
2040
|
+
kind: "local",
|
|
1844
2041
|
input: installSource.input,
|
|
1845
|
-
location:
|
|
1846
|
-
package: resolvedSource.npm_package,
|
|
1847
|
-
version: resolvedSource.npm_version,
|
|
2042
|
+
location: installSource.absolute_path,
|
|
1848
2043
|
}
|
|
1849
|
-
:
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
2044
|
+
: installSource.kind === "npm"
|
|
2045
|
+
? {
|
|
2046
|
+
kind: "npm",
|
|
2047
|
+
input: installSource.input,
|
|
2048
|
+
location: resolvedSource.resolved_subpath ?? ".",
|
|
2049
|
+
package: resolvedSource.npm_package,
|
|
2050
|
+
version: resolvedSource.npm_version,
|
|
2051
|
+
}
|
|
2052
|
+
: {
|
|
2053
|
+
kind: "github",
|
|
2054
|
+
input: installSource.input,
|
|
2055
|
+
location: resolvedSource.resolved_subpath ?? installSource.subpath ?? ".",
|
|
2056
|
+
repository: installSource.repository,
|
|
2057
|
+
owner: installSource.owner,
|
|
2058
|
+
repo: installSource.repo,
|
|
2059
|
+
ref: installSource.ref,
|
|
2060
|
+
subpath: resolvedSource.resolved_subpath ?? installSource.subpath,
|
|
2061
|
+
commit: resolvedSource.commit,
|
|
2062
|
+
};
|
|
1860
2063
|
const now = nowIso();
|
|
1861
2064
|
const existingManagedEntry = managedStateRead.state.entries.find((entry) => normalizeExtensionNameForMatch(entry.name) === normalizeExtensionNameForMatch(validated.manifest.name));
|
|
2065
|
+
const sourceUnchanged = existingManagedEntry !== undefined &&
|
|
2066
|
+
existingManagedEntry.manifest_version === validated.manifest.version &&
|
|
2067
|
+
managedExtensionSourcesEquivalent(existingManagedEntry.source, sourceRecord);
|
|
1862
2068
|
const managedState = upsertManagedEntry(managedStateRead.state, {
|
|
1863
2069
|
name: validated.manifest.name,
|
|
1864
2070
|
directory: destinationDirectoryName,
|
|
@@ -1867,7 +2073,7 @@ export async function runExtension(target, options, global) {
|
|
|
1867
2073
|
manifest_entry: validated.manifest.entry,
|
|
1868
2074
|
capabilities: [...validated.manifest.capabilities],
|
|
1869
2075
|
installed_at: existingManagedEntry?.installed_at ?? now,
|
|
1870
|
-
updated_at: now,
|
|
2076
|
+
updated_at: sourceUnchanged ? existingManagedEntry.updated_at : now,
|
|
1871
2077
|
source: sourceRecord,
|
|
1872
2078
|
});
|
|
1873
2079
|
await writeManagedExtensionState(resolvedRoots.selected_root, managedState);
|
|
@@ -2405,4 +2611,5 @@ export async function runExtension(target, options, global) {
|
|
|
2405
2611
|
}
|
|
2406
2612
|
throw new PmCliError(`Unsupported extension action "${action}".`, EXIT_CODE.USAGE);
|
|
2407
2613
|
}
|
|
2408
|
-
//# sourceMappingURL=extension.js.map
|
|
2614
|
+
//# sourceMappingURL=extension.js.map
|
|
2615
|
+
//# debugId=69ff4814-0641-5d85-962e-a798cfd1a78e
|