@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
package/docs/EXTENSIONS.md
CHANGED
|
@@ -1,85 +1,53 @@
|
|
|
1
1
|
# Packages and Extensions
|
|
2
2
|
|
|
3
|
-
Packages
|
|
4
|
-
|
|
5
|
-
`pm extension ...` remains supported for compatibility. New scripts and docs should prefer `pm install ...` and `pm package ...`.
|
|
6
|
-
|
|
7
|
-
This document is the canonical package/extension reference for manifest contracts, governance policy, trust and sandbox controls, reload workflows, and diagnostics.
|
|
8
|
-
|
|
9
|
-
## Quick Start
|
|
3
|
+
Packages add optional `pm` workflows without changing the core CLI. A package can ship one or more runtime extensions plus metadata such as docs and examples. Prefer the package-first commands in new docs and automation:
|
|
10
4
|
|
|
11
5
|
```bash
|
|
12
|
-
|
|
13
|
-
pm package init ./my-package-extension
|
|
14
|
-
|
|
15
|
-
# 2) Install in project scope
|
|
6
|
+
pm package init ./my-package
|
|
16
7
|
pm install ./my-package --project
|
|
17
|
-
|
|
18
|
-
# Or install all bundled first-party packages
|
|
19
|
-
pm install '*' --project
|
|
20
|
-
|
|
21
|
-
# 3) Run diagnostics
|
|
22
8
|
pm package doctor --project --detail summary
|
|
23
|
-
|
|
24
|
-
# 4) Plan CLI/SDK and package upgrades
|
|
25
|
-
pm upgrade --dry-run
|
|
26
|
-
|
|
27
|
-
# 5) Reload runtime modules after local edits
|
|
28
9
|
pm package reload --project
|
|
10
|
+
pm upgrade --dry-run
|
|
29
11
|
```
|
|
30
12
|
|
|
31
|
-
|
|
13
|
+
`pm extension ...` remains supported for compatibility and low-level runtime debugging.
|
|
32
14
|
|
|
33
|
-
|
|
34
|
-
pm extension init ./my-package # prefer: pm package init ./my-package
|
|
35
|
-
pm extension install ./my-package --project
|
|
36
|
-
pm extension doctor --project --detail summary
|
|
37
|
-
pm extension reload --project
|
|
38
|
-
```
|
|
15
|
+
Related docs:
|
|
39
16
|
|
|
40
|
-
|
|
17
|
+
- [SDK](SDK.md)
|
|
18
|
+
- [Configuration](CONFIGURATION.md)
|
|
19
|
+
- [Testing](TESTING.md)
|
|
20
|
+
- [Command Reference](COMMANDS.md)
|
|
41
21
|
|
|
42
|
-
##
|
|
22
|
+
## Package Sources
|
|
43
23
|
|
|
44
|
-
`pm
|
|
24
|
+
`pm install` accepts local, registry, and GitHub sources:
|
|
45
25
|
|
|
46
26
|
```bash
|
|
47
|
-
pm
|
|
48
|
-
pm
|
|
49
|
-
pm
|
|
50
|
-
pm
|
|
51
|
-
pm
|
|
27
|
+
pm install ./local-package --project
|
|
28
|
+
pm install /absolute/path/to/package --project
|
|
29
|
+
pm install npm:@scope/package --project
|
|
30
|
+
pm install npm:package@1.2.3 --project
|
|
31
|
+
pm install https://github.com/org/repo --project
|
|
32
|
+
pm install --github org/repo/path --ref main --project
|
|
52
33
|
```
|
|
53
34
|
|
|
54
|
-
|
|
55
|
-
Managed package upgrades reuse the source recorded at install time, including `npm:`, GitHub, local, and first-party package paths.
|
|
56
|
-
Use `--tag <version-or-dist-tag>` to target a registry tag such as `latest` or `next`.
|
|
57
|
-
|
|
58
|
-
## Extension Locations
|
|
59
|
-
|
|
60
|
-
- project scope: `.agents/pm/extensions/<name>/`
|
|
61
|
-
- global scope: `~/.pm-cli/extensions/<name>/`
|
|
62
|
-
- project entries override global entries for matching command paths
|
|
63
|
-
|
|
64
|
-
Runtime path overrides:
|
|
65
|
-
|
|
66
|
-
- `PM_PATH`: project tracker root override
|
|
67
|
-
- `PM_GLOBAL_PATH`: global profile root override
|
|
68
|
-
|
|
69
|
-
## Package Sources
|
|
70
|
-
|
|
71
|
-
`pm install` accepts these package sources:
|
|
35
|
+
Bundled first-party packages live under `packages/pm-*`:
|
|
72
36
|
|
|
73
37
|
```bash
|
|
74
|
-
pm
|
|
75
|
-
pm install
|
|
76
|
-
pm install
|
|
77
|
-
pm install
|
|
78
|
-
pm install
|
|
79
|
-
pm install
|
|
38
|
+
pm package catalog --project
|
|
39
|
+
pm install '*' --project
|
|
40
|
+
pm install all --project
|
|
41
|
+
pm install calendar --project
|
|
42
|
+
pm install search-advanced --project
|
|
43
|
+
pm install governance-audit --project
|
|
80
44
|
```
|
|
81
45
|
|
|
82
|
-
|
|
46
|
+
`pm install '*'`, `pm install all`, and shell-expanded `pm install *` are normalized to the same bundled install-all request. First-party package aliases come from each package manifest, with a fallback derived from the `packages/pm-*` directory name.
|
|
47
|
+
|
|
48
|
+
## Package Manifest
|
|
49
|
+
|
|
50
|
+
Package roots declare resources in `package.json` under `pm`:
|
|
83
51
|
|
|
84
52
|
```json
|
|
85
53
|
{
|
|
@@ -89,7 +57,7 @@ Package roots can expose resources with a `pm` manifest in `package.json`:
|
|
|
89
57
|
"aliases": ["my-workflow"],
|
|
90
58
|
"extensions": ["extensions/my-extension"],
|
|
91
59
|
"docs": ["README.md"],
|
|
92
|
-
"examples": ["
|
|
60
|
+
"examples": ["examples/basic.md"],
|
|
93
61
|
"catalog": {
|
|
94
62
|
"display_name": "My pm Package",
|
|
95
63
|
"category": "workflow",
|
|
@@ -99,301 +67,70 @@ Package roots can expose resources with a `pm` manifest in `package.json`:
|
|
|
99
67
|
"docs": "https://example.com/docs",
|
|
100
68
|
"repository": "https://github.com/org/my-pm-package",
|
|
101
69
|
"report": "https://github.com/org/my-pm-package/issues"
|
|
102
|
-
},
|
|
103
|
-
"media": {
|
|
104
|
-
"image": "https://example.com/preview.png"
|
|
105
70
|
}
|
|
106
71
|
}
|
|
107
72
|
}
|
|
108
73
|
}
|
|
109
74
|
```
|
|
110
75
|
|
|
111
|
-
|
|
76
|
+
Current resource kinds are:
|
|
77
|
+
|
|
78
|
+
- `extensions`
|
|
79
|
+
- `docs`
|
|
80
|
+
- `examples`
|
|
112
81
|
|
|
113
|
-
|
|
82
|
+
Installation activates `pm.extensions`. `pm.docs` and `pm.examples` are catalog metadata. Agent-specific assets such as prompts, skills, or MCP servers should live in agent adapter packages, not in the core `pm` package contract.
|
|
83
|
+
|
|
84
|
+
When no package manifest is present, `pm` discovers conventional extension directories:
|
|
114
85
|
|
|
115
86
|
- `.agents/pm/extensions/`
|
|
116
87
|
- `extensions/`
|
|
117
88
|
- `.custom/pm-extensions/`
|
|
118
89
|
- `.custom/pm-extension/`
|
|
119
90
|
|
|
120
|
-
If a
|
|
121
|
-
|
|
122
|
-
First-party optional packages are shipped as package roots under `packages/`:
|
|
123
|
-
|
|
124
|
-
```bash
|
|
125
|
-
pm package catalog --project
|
|
126
|
-
pm install '*' --project
|
|
127
|
-
pm install all --project
|
|
128
|
-
pm install packages/pm-calendar --project
|
|
129
|
-
pm install packages/pm-beads --project
|
|
130
|
-
pm install packages/pm-todos --project
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
`pm install '*'` and `pm install all` install every bundled first-party package in deterministic alias order. If your shell expands `pm install *`, pm recognizes that expansion and treats it as the same bundled-package install-all request.
|
|
134
|
-
|
|
135
|
-
Compatibility aliases remain available:
|
|
91
|
+
If a source contains multiple extension manifests, install the exact extension path so managed state has one deterministic target.
|
|
136
92
|
|
|
137
|
-
|
|
138
|
-
pm install beads --project
|
|
139
|
-
pm install calendar --project
|
|
140
|
-
pm install todos --project
|
|
141
|
-
```
|
|
93
|
+
## Extension Layout
|
|
142
94
|
|
|
143
|
-
|
|
95
|
+
Project extensions are stored under `.agents/pm/extensions/<name>/`. Global extensions are stored under `~/.pm-cli/extensions/<name>/`. Project entries override global entries when they register the same command path or runtime surface.
|
|
144
96
|
|
|
145
|
-
|
|
97
|
+
Runtime path overrides:
|
|
146
98
|
|
|
147
|
-
|
|
99
|
+
- `PM_PATH`: project tracker root
|
|
100
|
+
- `PM_GLOBAL_PATH`: global profile root
|
|
148
101
|
|
|
149
|
-
|
|
102
|
+
A minimal extension has a `manifest.json` and an entrypoint:
|
|
150
103
|
|
|
151
104
|
```json
|
|
152
105
|
{
|
|
153
|
-
"name": "
|
|
106
|
+
"name": "hello",
|
|
154
107
|
"version": "0.1.0",
|
|
155
108
|
"entry": "./index.js",
|
|
156
|
-
"priority": 100,
|
|
157
109
|
"capabilities": ["commands"]
|
|
158
110
|
}
|
|
159
111
|
```
|
|
160
112
|
|
|
161
|
-
|
|
113
|
+
```js
|
|
114
|
+
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
162
115
|
|
|
163
|
-
|
|
164
|
-
{
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
},
|
|
175
|
-
"sandbox_profile": "restricted",
|
|
176
|
-
"permissions": {
|
|
177
|
-
"fs_read": true,
|
|
178
|
-
"fs_write": false,
|
|
179
|
-
"network": false,
|
|
180
|
-
"env_read": true,
|
|
181
|
-
"env_write": false,
|
|
182
|
-
"process_spawn": false
|
|
116
|
+
export default defineExtension({
|
|
117
|
+
activate(api) {
|
|
118
|
+
api.registerCommand({
|
|
119
|
+
name: "hello",
|
|
120
|
+
description: "Print a deterministic hello payload.",
|
|
121
|
+
intent: "verify extension command activation",
|
|
122
|
+
examples: ["pm hello"],
|
|
123
|
+
run() {
|
|
124
|
+
return { ok: true, message: "hello" };
|
|
125
|
+
},
|
|
126
|
+
});
|
|
183
127
|
},
|
|
184
|
-
|
|
185
|
-
}
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Capability values
|
|
189
|
-
|
|
190
|
-
- `commands`
|
|
191
|
-
- `parser`
|
|
192
|
-
- `preflight`
|
|
193
|
-
- `services`
|
|
194
|
-
- `renderers`
|
|
195
|
-
- `hooks`
|
|
196
|
-
- `schema`
|
|
197
|
-
- `importers`
|
|
198
|
-
- `search`
|
|
199
|
-
|
|
200
|
-
## Governance Policy (`extensions.policy`)
|
|
201
|
-
|
|
202
|
-
Policy is configured in `settings.json` under `extensions.policy`.
|
|
203
|
-
|
|
204
|
-
```json
|
|
205
|
-
{
|
|
206
|
-
"extensions": {
|
|
207
|
-
"policy": {
|
|
208
|
-
"mode": "enforce",
|
|
209
|
-
"trust_mode": "warn",
|
|
210
|
-
"require_provenance": true,
|
|
211
|
-
"default_sandbox_profile": "restricted",
|
|
212
|
-
"allowed_extensions": [],
|
|
213
|
-
"blocked_extensions": [],
|
|
214
|
-
"allowed_capabilities": [],
|
|
215
|
-
"blocked_capabilities": ["services"],
|
|
216
|
-
"allowed_surfaces": [],
|
|
217
|
-
"blocked_surfaces": ["commands.override"],
|
|
218
|
-
"allowed_commands": [],
|
|
219
|
-
"blocked_commands": ["dangerous command"],
|
|
220
|
-
"allowed_actions": [],
|
|
221
|
-
"blocked_actions": ["dangerous-command"],
|
|
222
|
-
"allowed_services": [],
|
|
223
|
-
"blocked_services": ["output_format"]
|
|
224
|
-
}
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
Mode semantics:
|
|
230
|
-
|
|
231
|
-
- `mode`: `off|warn|enforce` for extension/capability/surface/command/action/service checks
|
|
232
|
-
- `trust_mode`: `off|warn|enforce` for trust checks
|
|
233
|
-
- `default_sandbox_profile`: `none|restricted|strict`
|
|
234
|
-
|
|
235
|
-
Sandbox profiles:
|
|
236
|
-
|
|
237
|
-
- `none`: no sandbox permission gating
|
|
238
|
-
- `restricted`: blocks sensitive writes and spawn (`process_spawn`, `env_write`)
|
|
239
|
-
- `strict`: blocks spawn/network/write style permissions (`process_spawn`, `network`, `fs_write`, `env_write`)
|
|
240
|
-
|
|
241
|
-
If profile is non-`none` and manifest permissions are missing, policy emits a deterministic warning or block.
|
|
242
|
-
|
|
243
|
-
## Supported Surface Tokens
|
|
244
|
-
|
|
245
|
-
Use these values with `allowed_surfaces` and `blocked_surfaces`:
|
|
246
|
-
|
|
247
|
-
- `commands.override`
|
|
248
|
-
- `commands.handler`
|
|
249
|
-
- `hooks.beforecommand`
|
|
250
|
-
- `hooks.aftercommand`
|
|
251
|
-
- `hooks.onwrite`
|
|
252
|
-
- `hooks.onread`
|
|
253
|
-
- `hooks.onindex`
|
|
254
|
-
- `schema.flags`
|
|
255
|
-
- `schema.itemfields`
|
|
256
|
-
- `schema.itemtypes`
|
|
257
|
-
- `schema.migrations`
|
|
258
|
-
- `parser.override`
|
|
259
|
-
- `preflight.override`
|
|
260
|
-
- `services.override`
|
|
261
|
-
- `renderers.override`
|
|
262
|
-
- `importers.importer`
|
|
263
|
-
- `importers.exporter`
|
|
264
|
-
- `search.provider`
|
|
265
|
-
- `search.vectorstore`
|
|
266
|
-
|
|
267
|
-
## Reload and Watch Workflows
|
|
268
|
-
|
|
269
|
-
Manual reload:
|
|
270
|
-
|
|
271
|
-
```bash
|
|
272
|
-
pm extension --reload --project
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
Watch-mode semantics:
|
|
276
|
-
|
|
277
|
-
```bash
|
|
278
|
-
pm extension --reload --project --watch
|
|
279
|
-
```
|
|
280
|
-
|
|
281
|
-
In non-interactive automation, `--watch` performs a deterministic single-pass reload and emits a watch-hint warning.
|
|
282
|
-
|
|
283
|
-
## Diagnostics and Management
|
|
284
|
-
|
|
285
|
-
Basic diagnostics:
|
|
286
|
-
|
|
287
|
-
```bash
|
|
288
|
-
pm extension --doctor --project --detail summary
|
|
289
|
-
```
|
|
290
|
-
|
|
291
|
-
Deep diagnostics:
|
|
292
|
-
|
|
293
|
-
```bash
|
|
294
|
-
pm extension --doctor --project --detail deep --trace
|
|
295
|
-
```
|
|
296
|
-
|
|
297
|
-
Management commands:
|
|
298
|
-
|
|
299
|
-
```bash
|
|
300
|
-
pm package catalog --project
|
|
301
|
-
pm package explore
|
|
302
|
-
pm package manage --project
|
|
303
|
-
pm package manage --project --runtime-probe
|
|
304
|
-
pm package manage --project --fix-managed-state
|
|
305
|
-
pm package activate my-extension --project
|
|
306
|
-
pm package deactivate my-extension --project
|
|
307
|
-
pm package uninstall my-extension --project
|
|
308
|
-
```
|
|
309
|
-
|
|
310
|
-
Common warning prefixes:
|
|
311
|
-
|
|
312
|
-
- `extension_policy_violation_extension`
|
|
313
|
-
- `extension_policy_violation_capability`
|
|
314
|
-
- `extension_policy_violation_registration`
|
|
315
|
-
- `extension_policy_violation_trust`
|
|
316
|
-
- `extension_policy_blocked_extension`
|
|
317
|
-
- `extension_policy_blocked_capability`
|
|
318
|
-
- `extension_policy_blocked_registration`
|
|
319
|
-
- `extension_policy_blocked_trust`
|
|
320
|
-
|
|
321
|
-
## Migration Checklist (v1 -> v2)
|
|
322
|
-
|
|
323
|
-
1. Keep existing manifest fields.
|
|
324
|
-
2. Add `manifest_version: 2`.
|
|
325
|
-
3. Add `trusted`, `provenance`, `sandbox_profile`, and `permissions`.
|
|
326
|
-
4. Extend `extensions.policy` with trust/sandbox and command/action/service controls.
|
|
327
|
-
5. Run:
|
|
328
|
-
|
|
329
|
-
```bash
|
|
330
|
-
pm contracts --json
|
|
331
|
-
pm package doctor --project --detail summary --strict-exit
|
|
332
|
-
```
|
|
333
|
-
|
|
334
|
-
6. Resolve warnings before enforcing `mode=enforce` and `trust_mode=enforce`.
|
|
335
|
-
|
|
336
|
-
## Runnable Examples
|
|
337
|
-
|
|
338
|
-
- `docs/examples/starter-extension/`
|
|
339
|
-
- `docs/examples/policy-restricted-extension/`
|
|
340
|
-
- `docs/examples/sdk-contract-consumer/`
|
|
341
|
-
- `docs/examples/sdk-app-embedding/`
|
|
342
|
-
- `docs/examples/ci/github-actions-pm-extension-gate.yml`
|
|
343
|
-
- `docs/examples/ci/gitlab-ci-pm-extension-gate.yml`
|
|
344
|
-
- `docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile`
|
|
345
|
-
# Extension Runtime Details
|
|
346
|
-
|
|
347
|
-
Extensions let you add or override `pm` runtime behavior without modifying core `pm-cli`.
|
|
348
|
-
|
|
349
|
-
This guide is the authoritative reference for:
|
|
350
|
-
|
|
351
|
-
- manifest `v1` and `v2` contracts
|
|
352
|
-
- governance policy (`extensions.policy`) controls
|
|
353
|
-
- trust/provenance and sandbox restrictions
|
|
354
|
-
- manual reload and watch-mode workflows
|
|
355
|
-
- migration from policy-only setups to enterprise controls
|
|
356
|
-
|
|
357
|
-
## Quick Start
|
|
358
|
-
|
|
359
|
-
```bash
|
|
360
|
-
# 1) Scaffold a package-backed extension
|
|
361
|
-
pm package init ./my-package
|
|
362
|
-
|
|
363
|
-
# 2) Install in project scope
|
|
364
|
-
pm install ./my-package --project
|
|
365
|
-
|
|
366
|
-
# 3) Run diagnostics
|
|
367
|
-
pm package doctor --project --detail summary
|
|
368
|
-
|
|
369
|
-
# 4) Reload runtime modules after local edits
|
|
370
|
-
pm package reload --project
|
|
128
|
+
});
|
|
371
129
|
```
|
|
372
130
|
|
|
373
|
-
##
|
|
374
|
-
|
|
375
|
-
Compared to the previous policy-only extension surface, this release adds:
|
|
376
|
-
|
|
377
|
-
- **Manifest v2 metadata** for trust, provenance, sandbox profile, and runtime permission declarations.
|
|
378
|
-
- **Policy v2 controls** for trust mode, provenance requirement, sandbox defaults, and command/action/service allow/block maps.
|
|
379
|
-
- **Registration enforcement upgrades** so command/action/service restrictions are evaluated at registration boundaries.
|
|
380
|
-
- **Hot reload controls** via cache-busted package reload (`pm package reload`) with watch-mode semantics (`--watch`).
|
|
381
|
-
- **Contracts metadata upgrades** for trust/sandbox compatibility information in `pm contracts`.
|
|
131
|
+
## Extension Manifest
|
|
382
132
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
- Project scope: `.agents/pm/extensions/<name>/`
|
|
386
|
-
- Global scope: `~/.pm-cli/extensions/<name>/`
|
|
387
|
-
- Project entries override global entries when command paths collide.
|
|
388
|
-
|
|
389
|
-
Overrides:
|
|
390
|
-
|
|
391
|
-
- `PM_PATH`: project tracker root override
|
|
392
|
-
- `PM_GLOBAL_PATH`: global profile root override
|
|
393
|
-
|
|
394
|
-
## Manifest Contract
|
|
395
|
-
|
|
396
|
-
### Manifest v1 (still supported)
|
|
133
|
+
Manifest v1 is supported:
|
|
397
134
|
|
|
398
135
|
```json
|
|
399
136
|
{
|
|
@@ -405,7 +142,7 @@ Overrides:
|
|
|
405
142
|
}
|
|
406
143
|
```
|
|
407
144
|
|
|
408
|
-
|
|
145
|
+
Manifest v2 is recommended when governance, trust, or sandbox metadata matters:
|
|
409
146
|
|
|
410
147
|
```json
|
|
411
148
|
{
|
|
@@ -428,11 +165,18 @@ Overrides:
|
|
|
428
165
|
"env_write": false,
|
|
429
166
|
"process_spawn": false
|
|
430
167
|
},
|
|
431
|
-
"capabilities": ["commands", "
|
|
168
|
+
"capabilities": ["commands", "schema"]
|
|
432
169
|
}
|
|
433
170
|
```
|
|
434
171
|
|
|
435
|
-
|
|
172
|
+
Rules:
|
|
173
|
+
|
|
174
|
+
- `entry` must resolve inside the extension directory.
|
|
175
|
+
- Declare only capabilities the extension actually uses.
|
|
176
|
+
- Unknown capabilities emit deterministic warnings.
|
|
177
|
+
- Legacy aliases such as `migration` and `validation` are normalized to `schema` with warnings.
|
|
178
|
+
|
|
179
|
+
Supported capabilities:
|
|
436
180
|
|
|
437
181
|
- `commands`
|
|
438
182
|
- `parser`
|
|
@@ -444,9 +188,9 @@ Overrides:
|
|
|
444
188
|
- `importers`
|
|
445
189
|
- `search`
|
|
446
190
|
|
|
447
|
-
## Governance Policy
|
|
191
|
+
## Governance Policy
|
|
448
192
|
|
|
449
|
-
|
|
193
|
+
Governance policy is configured in `settings.json` under `extensions.policy`:
|
|
450
194
|
|
|
451
195
|
```json
|
|
452
196
|
{
|
|
@@ -455,7 +199,6 @@ Policy is configured under `settings.json` -> `extensions.policy`.
|
|
|
455
199
|
"mode": "enforce",
|
|
456
200
|
"trust_mode": "warn",
|
|
457
201
|
"require_provenance": true,
|
|
458
|
-
"trusted_extensions": ["policy-restricted-extension"],
|
|
459
202
|
"default_sandbox_profile": "restricted",
|
|
460
203
|
"allowed_extensions": [],
|
|
461
204
|
"blocked_extensions": [],
|
|
@@ -466,240 +209,34 @@ Policy is configured under `settings.json` -> `extensions.policy`.
|
|
|
466
209
|
"allowed_commands": [],
|
|
467
210
|
"blocked_commands": ["dangerous command"],
|
|
468
211
|
"allowed_actions": [],
|
|
469
|
-
"blocked_actions": [
|
|
212
|
+
"blocked_actions": [],
|
|
470
213
|
"allowed_services": [],
|
|
471
|
-
"blocked_services": [
|
|
472
|
-
"extension_overrides": [
|
|
473
|
-
{
|
|
474
|
-
"name": "policy-restricted-extension",
|
|
475
|
-
"require_trusted": true,
|
|
476
|
-
"require_provenance": true,
|
|
477
|
-
"sandbox_profile": "strict",
|
|
478
|
-
"allowed_surfaces": ["commands.handler", "hooks.beforecommand"],
|
|
479
|
-
"blocked_surfaces": ["services.override"]
|
|
480
|
-
}
|
|
481
|
-
]
|
|
214
|
+
"blocked_services": []
|
|
482
215
|
}
|
|
483
216
|
}
|
|
484
217
|
}
|
|
485
218
|
```
|
|
486
219
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
- `mode`: `off|warn|enforce` for extension/capability/surface/command/action/service restrictions
|
|
490
|
-
- `trust_mode`: `off|warn|enforce` for trust checks
|
|
491
|
-
- `default_sandbox_profile`: `none|restricted|strict`
|
|
492
|
-
|
|
493
|
-
### Sandbox Profiles
|
|
494
|
-
|
|
495
|
-
Sandbox profiles are policy-driven gates evaluated against manifest permission declarations:
|
|
220
|
+
Policy modes:
|
|
496
221
|
|
|
497
|
-
- `
|
|
498
|
-
- `
|
|
499
|
-
- `
|
|
222
|
+
- `off`: no policy enforcement or warnings
|
|
223
|
+
- `warn`: allow registrations but emit policy warnings
|
|
224
|
+
- `enforce`: block disallowed extensions, capabilities, commands, actions, services, or surfaces
|
|
500
225
|
|
|
501
|
-
|
|
226
|
+
Sandbox profiles:
|
|
502
227
|
|
|
503
|
-
|
|
228
|
+
- `none`: no extra sandbox restriction
|
|
229
|
+
- `restricted`: safe default for normal package workflows
|
|
230
|
+
- `strict`: most restrictive policy profile
|
|
504
231
|
|
|
505
|
-
|
|
232
|
+
Surface tokens include:
|
|
506
233
|
|
|
507
|
-
- `commands.override`
|
|
508
234
|
- `commands.handler`
|
|
509
|
-
- `
|
|
510
|
-
- `hooks.aftercommand`
|
|
511
|
-
- `hooks.onwrite`
|
|
512
|
-
- `hooks.onread`
|
|
513
|
-
- `hooks.onindex`
|
|
514
|
-
- `schema.flags`
|
|
515
|
-
- `schema.itemfields`
|
|
516
|
-
- `schema.itemtypes`
|
|
517
|
-
- `schema.migrations`
|
|
235
|
+
- `commands.override`
|
|
518
236
|
- `parser.override`
|
|
519
237
|
- `preflight.override`
|
|
520
238
|
- `services.override`
|
|
521
239
|
- `renderers.override`
|
|
522
|
-
- `importers.importer`
|
|
523
|
-
- `importers.exporter`
|
|
524
|
-
- `search.provider`
|
|
525
|
-
- `search.vectorstore`
|
|
526
|
-
|
|
527
|
-
## Hot Reload
|
|
528
|
-
|
|
529
|
-
### Manual reload
|
|
530
|
-
|
|
531
|
-
```bash
|
|
532
|
-
pm extension --reload --project
|
|
533
|
-
```
|
|
534
|
-
|
|
535
|
-
This runs extension discovery/load with cache-busted import URLs and returns deterministic load/activation diagnostics.
|
|
536
|
-
|
|
537
|
-
### Watch mode
|
|
538
|
-
|
|
539
|
-
```bash
|
|
540
|
-
pm extension --reload --project --watch
|
|
541
|
-
```
|
|
542
|
-
|
|
543
|
-
`--watch` enables watch-mode semantics for reload workflows. In non-interactive automation, it executes a deterministic single-pass reload and emits a watch hint warning.
|
|
544
|
-
|
|
545
|
-
## Diagnostics and Warning Codes
|
|
546
|
-
|
|
547
|
-
Common warning prefixes:
|
|
548
|
-
|
|
549
|
-
- `extension_policy_violation_extension`
|
|
550
|
-
- `extension_policy_violation_capability`
|
|
551
|
-
- `extension_policy_violation_registration`
|
|
552
|
-
- `extension_policy_violation_trust`
|
|
553
|
-
- `extension_policy_blocked_extension`
|
|
554
|
-
- `extension_policy_blocked_capability`
|
|
555
|
-
- `extension_policy_blocked_registration`
|
|
556
|
-
- `extension_policy_blocked_trust`
|
|
557
|
-
|
|
558
|
-
Use:
|
|
559
|
-
|
|
560
|
-
```bash
|
|
561
|
-
pm extension --doctor --project --detail deep --trace
|
|
562
|
-
```
|
|
563
|
-
|
|
564
|
-
for full activation traces.
|
|
565
|
-
|
|
566
|
-
## Migration (v1 -> v2)
|
|
567
|
-
|
|
568
|
-
1. Keep existing manifest fields unchanged.
|
|
569
|
-
2. Add `manifest_version: 2`.
|
|
570
|
-
3. Add `trusted`, `provenance`, `sandbox_profile`, and `permissions`.
|
|
571
|
-
4. Extend `extensions.policy` with trust/sandbox/command-action-service fields.
|
|
572
|
-
5. Run:
|
|
573
|
-
|
|
574
|
-
```bash
|
|
575
|
-
pm contracts --json
|
|
576
|
-
pm extension --doctor --project --detail summary --strict-exit
|
|
577
|
-
```
|
|
578
|
-
|
|
579
|
-
6. Fix any policy warnings before enforcing (`mode=enforce`, `trust_mode=enforce`).
|
|
580
|
-
|
|
581
|
-
## Runnable Examples
|
|
582
|
-
|
|
583
|
-
- `docs/examples/starter-extension/`
|
|
584
|
-
- `docs/examples/policy-restricted-extension/`
|
|
585
|
-
- `docs/examples/sdk-contract-consumer/`
|
|
586
|
-
- `docs/examples/sdk-app-embedding/`
|
|
587
|
-
- `docs/examples/ci/github-actions-pm-extension-gate.yml`
|
|
588
|
-
- `docs/examples/ci/gitlab-ci-pm-extension-gate.yml`
|
|
589
|
-
- `docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile`
|
|
590
|
-
# Extension Runtime Governance
|
|
591
|
-
|
|
592
|
-
Extensions let you add or override `pm` runtime behavior without editing core `pm-cli` sources. They are loaded at runtime, gated by manifest capabilities, and now support granular governance policies for capability/surface allow/block controls.
|
|
593
|
-
|
|
594
|
-
## Quick Start
|
|
595
|
-
|
|
596
|
-
```bash
|
|
597
|
-
# 1) Scaffold a new package
|
|
598
|
-
pm package init ./my-package
|
|
599
|
-
|
|
600
|
-
# 2) Install into project scope
|
|
601
|
-
pm install ./my-package --project
|
|
602
|
-
|
|
603
|
-
# 3) Run package diagnostics
|
|
604
|
-
pm package doctor --project --detail summary
|
|
605
|
-
|
|
606
|
-
# 4) Deep diagnostics with traces
|
|
607
|
-
pm package doctor --project --detail deep --trace
|
|
608
|
-
```
|
|
609
|
-
|
|
610
|
-
Expected summary signals from `pm package doctor`:
|
|
611
|
-
|
|
612
|
-
- `details.summary.status`: `ok` or `warn`
|
|
613
|
-
- `details.summary.warning_codes`: deterministic warning code list
|
|
614
|
-
- `details.summary.policy`: active policy mode and configured counts
|
|
615
|
-
- `details.triage.remediation`: actionable follow-up guidance
|
|
616
|
-
|
|
617
|
-
## Extension Locations and Precedence
|
|
618
|
-
|
|
619
|
-
- Project extensions: `.agents/pm/extensions/<name>/`
|
|
620
|
-
- Global extensions: `~/.pm-cli/extensions/<name>/`
|
|
621
|
-
- Project takes precedence when both scopes register the same command/surface.
|
|
622
|
-
- Discovery and activation remain deterministic across runs.
|
|
623
|
-
|
|
624
|
-
Environment overrides:
|
|
625
|
-
|
|
626
|
-
- `PM_PATH`: project tracker root override
|
|
627
|
-
- `PM_GLOBAL_PATH`: global profile root override
|
|
628
|
-
|
|
629
|
-
## Manifest and Capabilities
|
|
630
|
-
|
|
631
|
-
Minimal `manifest.json`:
|
|
632
|
-
|
|
633
|
-
```json
|
|
634
|
-
{
|
|
635
|
-
"name": "pm-ext-example",
|
|
636
|
-
"version": "0.1.0",
|
|
637
|
-
"entry": "./index.js",
|
|
638
|
-
"priority": 100,
|
|
639
|
-
"capabilities": ["commands"]
|
|
640
|
-
}
|
|
641
|
-
```
|
|
642
|
-
|
|
643
|
-
Rules:
|
|
644
|
-
|
|
645
|
-
- `entry` must resolve inside extension directory (symlink-safe canonical checks apply).
|
|
646
|
-
- Declare only capabilities actually used.
|
|
647
|
-
- Unknown capabilities produce deterministic warnings with guidance.
|
|
648
|
-
- Legacy aliases (`migration`, `validation`) are remapped to `schema` with guidance warnings.
|
|
649
|
-
|
|
650
|
-
Supported capabilities:
|
|
651
|
-
|
|
652
|
-
- `commands`
|
|
653
|
-
- `parser`
|
|
654
|
-
- `preflight`
|
|
655
|
-
- `services`
|
|
656
|
-
- `renderers`
|
|
657
|
-
- `hooks`
|
|
658
|
-
- `schema`
|
|
659
|
-
- `importers`
|
|
660
|
-
- `search`
|
|
661
|
-
|
|
662
|
-
## Governance Policy (Granular Controls)
|
|
663
|
-
|
|
664
|
-
Extension governance policy is configured in `settings.json` under `extensions.policy`.
|
|
665
|
-
|
|
666
|
-
Policy modes:
|
|
667
|
-
|
|
668
|
-
- `off`: no policy enforcement/warnings
|
|
669
|
-
- `warn`: allow registrations but emit policy violation warnings
|
|
670
|
-
- `enforce`: block disallowed extensions/capabilities/surfaces
|
|
671
|
-
|
|
672
|
-
Example policy:
|
|
673
|
-
|
|
674
|
-
```json
|
|
675
|
-
{
|
|
676
|
-
"extensions": {
|
|
677
|
-
"policy": {
|
|
678
|
-
"mode": "enforce",
|
|
679
|
-
"allowed_extensions": ["release-audit-ext"],
|
|
680
|
-
"blocked_extensions": [],
|
|
681
|
-
"allowed_capabilities": [],
|
|
682
|
-
"blocked_capabilities": ["services"],
|
|
683
|
-
"allowed_surfaces": [],
|
|
684
|
-
"blocked_surfaces": ["commands.override"],
|
|
685
|
-
"extension_overrides": [
|
|
686
|
-
{
|
|
687
|
-
"name": "release-audit-ext",
|
|
688
|
-
"allowed_surfaces": ["commands.handler", "hooks.beforecommand"],
|
|
689
|
-
"blocked_surfaces": ["services.override"]
|
|
690
|
-
}
|
|
691
|
-
]
|
|
692
|
-
}
|
|
693
|
-
}
|
|
694
|
-
}
|
|
695
|
-
```
|
|
696
|
-
|
|
697
|
-
### Surface Tokens
|
|
698
|
-
|
|
699
|
-
Use these exact values for `allowed_surfaces` / `blocked_surfaces`:
|
|
700
|
-
|
|
701
|
-
- `commands.override`
|
|
702
|
-
- `commands.handler`
|
|
703
240
|
- `hooks.beforecommand`
|
|
704
241
|
- `hooks.aftercommand`
|
|
705
242
|
- `hooks.onwrite`
|
|
@@ -709,323 +246,130 @@ Use these exact values for `allowed_surfaces` / `blocked_surfaces`:
|
|
|
709
246
|
- `schema.itemfields`
|
|
710
247
|
- `schema.itemtypes`
|
|
711
248
|
- `schema.migrations`
|
|
712
|
-
- `
|
|
713
|
-
- `preflight.override`
|
|
714
|
-
- `services.override`
|
|
715
|
-
- `renderers.override`
|
|
716
|
-
- `importers.importer`
|
|
717
|
-
- `importers.exporter`
|
|
249
|
+
- `importers`
|
|
718
250
|
- `search.provider`
|
|
719
|
-
- `search.vectorstore`
|
|
720
|
-
|
|
721
|
-
Policy diagnostics use deterministic warning codes:
|
|
722
|
-
|
|
723
|
-
- `extension_policy_violation_extension`
|
|
724
|
-
- `extension_policy_violation_capability`
|
|
725
|
-
- `extension_policy_violation_registration`
|
|
726
|
-
- `extension_policy_blocked_extension`
|
|
727
|
-
- `extension_policy_blocked_capability`
|
|
728
|
-
- `extension_policy_blocked_registration`
|
|
729
|
-
|
|
730
|
-
## Runtime APIs (Public SDK)
|
|
731
|
-
|
|
732
|
-
Use `@unbrained/pm-cli/sdk` only (no internal imports).
|
|
733
|
-
|
|
734
|
-
- `api.registerCommand(def)` -> `commands`
|
|
735
|
-
- `api.registerParser(command, fn)` -> `parser`
|
|
736
|
-
- `api.registerPreflight(fn)` -> `preflight`
|
|
737
|
-
- `api.registerService(name, fn)` -> `services`
|
|
738
|
-
- `api.registerRenderer(format, fn)` -> `renderers`
|
|
739
|
-
- `api.registerFlags(command, flags)` -> `schema`
|
|
740
|
-
- `api.registerItemFields(fields)` -> `schema`
|
|
741
|
-
- `api.registerItemTypes(types)` -> `schema`
|
|
742
|
-
- `api.registerMigration(def)` -> `schema`
|
|
743
|
-
- `api.registerImporter(name, fn)` -> `importers`
|
|
744
|
-
- `api.registerExporter(name, fn)` -> `importers`
|
|
745
|
-
- `api.registerSearchProvider(provider)` -> `search`
|
|
746
|
-
- `api.registerVectorStoreAdapter(adapter)` -> `search`
|
|
747
|
-
- `api.hooks.beforeCommand/afterCommand/onWrite/onRead/onIndex(fn)` -> `hooks`
|
|
748
|
-
|
|
749
|
-
## Lifecycle Commands
|
|
750
|
-
|
|
751
|
-
```bash
|
|
752
|
-
# Explore
|
|
753
|
-
pm extension --explore --project
|
|
754
|
-
|
|
755
|
-
# Manage (update checks + managed state diagnostics)
|
|
756
|
-
pm extension --manage --project
|
|
757
251
|
|
|
758
|
-
|
|
759
|
-
pm extension --manage --project --runtime-probe
|
|
252
|
+
Use `pm package doctor --project --detail deep --trace` to inspect active policy state and warning codes.
|
|
760
253
|
|
|
761
|
-
|
|
762
|
-
pm extension --manage --project --fix-managed-state
|
|
254
|
+
## Runtime APIs
|
|
763
255
|
|
|
764
|
-
|
|
765
|
-
pm extension --activate my-extension --project
|
|
766
|
-
pm extension --deactivate my-extension --project
|
|
256
|
+
Use the public SDK barrel. Do not deep-import from `src/core` or `dist/core`.
|
|
767
257
|
|
|
768
|
-
|
|
769
|
-
|
|
258
|
+
```js
|
|
259
|
+
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
770
260
|
```
|
|
771
261
|
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
For CI/CD and agents:
|
|
775
|
-
|
|
776
|
-
- Prefer `--json` outputs.
|
|
777
|
-
- Use `pm contracts --schema-only --json` before invoking action payloads.
|
|
778
|
-
- Run `pm extension --doctor --detail summary --strict-exit` as a gate.
|
|
779
|
-
- Add `--detail deep --trace` on failure paths for remediation payloads.
|
|
780
|
-
- Use `--no-extensions` as a deterministic fallback for core-only triage.
|
|
781
|
-
|
|
782
|
-
## Runnable Examples
|
|
783
|
-
|
|
784
|
-
- Full starter extension: `docs/examples/starter-extension/`
|
|
785
|
-
- Capability-restricted policy example: `docs/examples/policy-restricted-extension/`
|
|
786
|
-
- Programmatic contracts consumer: `docs/examples/sdk-contract-consumer/`
|
|
787
|
-
- CI gating workflow: `docs/examples/ci/github-actions-pm-extension-gate.yml`
|
|
788
|
-
|
|
789
|
-
## Troubleshooting
|
|
262
|
+
Common APIs:
|
|
790
263
|
|
|
791
|
-
-
|
|
792
|
-
-
|
|
793
|
-
-
|
|
794
|
-
-
|
|
795
|
-
-
|
|
264
|
+
- `api.registerCommand(definition)` adds package-owned commands.
|
|
265
|
+
- `api.registerFlags(command, flags)` adds runtime command flags.
|
|
266
|
+
- `api.registerItemFields(fields)` adds custom metadata fields.
|
|
267
|
+
- `api.registerItemTypes(types)` adds custom item types.
|
|
268
|
+
- `api.registerMigration(definition)` adds schema migrations.
|
|
269
|
+
- `api.registerOutputService(definition)` customizes output rendering.
|
|
270
|
+
- `api.registerRenderer(definition)` adds format-specific renderers.
|
|
271
|
+
- `api.registerHook(name, handler)` adds lifecycle hooks.
|
|
796
272
|
|
|
797
|
-
|
|
273
|
+
Inline command flags require both `commands` and `schema` capabilities. Runtime schema changes should be verified with:
|
|
798
274
|
|
|
799
|
-
|
|
800
|
-
-
|
|
801
|
-
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
Extensions add commands, schema, renderers, importers/exporters, search adapters, lifecycle hooks, and selected runtime overrides without modifying core `pm-cli`.
|
|
805
|
-
|
|
806
|
-
## Agent Quick Context
|
|
807
|
-
|
|
808
|
-
- Use `pm package init ./my-package` for a starter scaffold.
|
|
809
|
-
- Use `@unbrained/pm-cli/sdk` for public extension APIs.
|
|
810
|
-
- Declare only the capabilities your extension uses.
|
|
811
|
-
- Run `pm package doctor --detail deep --trace` for activation failures.
|
|
812
|
-
- Use `--no-extensions` to isolate core behavior during incident triage.
|
|
813
|
-
- Use `pm guide extensions --depth standard` for local docs routing.
|
|
814
|
-
|
|
815
|
-
Tracked documentation work: [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon).
|
|
816
|
-
|
|
817
|
-
## Extension Locations
|
|
818
|
-
|
|
819
|
-
| Scope | Path |
|
|
820
|
-
|-------|------|
|
|
821
|
-
| Project | `.agents/pm/extensions/<name>/` |
|
|
822
|
-
| Global | `~/.pm-cli/extensions/<name>/` |
|
|
823
|
-
|
|
824
|
-
Environment overrides:
|
|
825
|
-
|
|
826
|
-
- `PM_PATH` changes project tracker root.
|
|
827
|
-
- `PM_GLOBAL_PATH` changes global profile root.
|
|
828
|
-
|
|
829
|
-
Load order is global, then project. Project extensions take precedence when keys collide.
|
|
275
|
+
```bash
|
|
276
|
+
pm contracts --runtime-only --schema-only --json
|
|
277
|
+
pm contracts --command <command> --flags-only --json
|
|
278
|
+
```
|
|
830
279
|
|
|
831
|
-
## Lifecycle
|
|
280
|
+
## Lifecycle Commands
|
|
832
281
|
|
|
833
|
-
|
|
282
|
+
Explore installed runtime entries:
|
|
834
283
|
|
|
835
284
|
```bash
|
|
836
|
-
pm package
|
|
837
|
-
pm package
|
|
285
|
+
pm package explore --project
|
|
286
|
+
pm package explore --project --json
|
|
838
287
|
```
|
|
839
288
|
|
|
840
|
-
|
|
289
|
+
Run diagnostics:
|
|
841
290
|
|
|
842
291
|
```bash
|
|
843
|
-
pm package
|
|
844
|
-
pm package
|
|
845
|
-
pm
|
|
292
|
+
pm package doctor --project --detail summary
|
|
293
|
+
pm package doctor --project --detail deep --trace
|
|
294
|
+
pm package doctor --project --strict-exit
|
|
846
295
|
```
|
|
847
296
|
|
|
848
|
-
|
|
297
|
+
Manage state and update checks:
|
|
849
298
|
|
|
850
299
|
```bash
|
|
851
|
-
pm package explore --project
|
|
852
300
|
pm package manage --project
|
|
853
|
-
pm package
|
|
854
|
-
pm package
|
|
301
|
+
pm package manage --project --fix-managed-state
|
|
302
|
+
pm package adopt my-extension --project
|
|
303
|
+
pm package adopt-all --project
|
|
855
304
|
```
|
|
856
305
|
|
|
857
|
-
Activate
|
|
306
|
+
Activate or deactivate:
|
|
858
307
|
|
|
859
308
|
```bash
|
|
860
309
|
pm package activate my-extension --project
|
|
861
310
|
pm package deactivate my-extension --project
|
|
862
311
|
```
|
|
863
312
|
|
|
864
|
-
|
|
313
|
+
Uninstall:
|
|
865
314
|
|
|
866
315
|
```bash
|
|
867
|
-
pm package
|
|
868
|
-
pm package adopt-all --project
|
|
869
|
-
```
|
|
870
|
-
|
|
871
|
-
## Install Sources
|
|
872
|
-
|
|
873
|
-
`pm install` and `pm package install` accept:
|
|
874
|
-
|
|
875
|
-
- local directories
|
|
876
|
-
- GitHub HTTPS URLs
|
|
877
|
-
- `github.com/<owner>/<repo>[/path]`
|
|
878
|
-
- `--gh <owner>/<repo>[/path]`
|
|
879
|
-
- optional `--ref <branch|tag|sha>`
|
|
880
|
-
|
|
881
|
-
When a GitHub source omits a subpath, the installer accepts a repository root containing one extension manifest or exactly one extension under known extension roots.
|
|
882
|
-
|
|
883
|
-
## Manifest
|
|
884
|
-
|
|
885
|
-
Every extension has `manifest.json`:
|
|
886
|
-
|
|
887
|
-
```json
|
|
888
|
-
{
|
|
889
|
-
"name": "pm-ext-example",
|
|
890
|
-
"version": "0.1.0",
|
|
891
|
-
"entry": "./index.js",
|
|
892
|
-
"priority": 100,
|
|
893
|
-
"capabilities": ["commands"]
|
|
894
|
-
}
|
|
316
|
+
pm package uninstall my-extension --project
|
|
895
317
|
```
|
|
896
318
|
|
|
897
|
-
|
|
319
|
+
Reload local edits:
|
|
898
320
|
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
- Legacy capability aliases are normalized for compatibility with warnings.
|
|
903
|
-
|
|
904
|
-
Capability names:
|
|
905
|
-
|
|
906
|
-
- `commands`
|
|
907
|
-
- `parser`
|
|
908
|
-
- `preflight`
|
|
909
|
-
- `services`
|
|
910
|
-
- `renderers`
|
|
911
|
-
- `hooks`
|
|
912
|
-
- `schema`
|
|
913
|
-
- `importers`
|
|
914
|
-
- `search`
|
|
915
|
-
|
|
916
|
-
## Minimal Extension
|
|
917
|
-
|
|
918
|
-
`manifest.json`:
|
|
919
|
-
|
|
920
|
-
```json
|
|
921
|
-
{
|
|
922
|
-
"name": "hello",
|
|
923
|
-
"version": "0.1.0",
|
|
924
|
-
"entry": "./index.js",
|
|
925
|
-
"capabilities": ["commands"]
|
|
926
|
-
}
|
|
321
|
+
```bash
|
|
322
|
+
pm package reload --project
|
|
323
|
+
pm package reload --project --watch
|
|
927
324
|
```
|
|
928
325
|
|
|
929
|
-
`
|
|
930
|
-
|
|
931
|
-
```js
|
|
932
|
-
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
326
|
+
Compatibility equivalents remain available through `pm extension ...` for existing automation.
|
|
933
327
|
|
|
934
|
-
|
|
935
|
-
activate(api) {
|
|
936
|
-
api.registerCommand({
|
|
937
|
-
name: "hello",
|
|
938
|
-
description: "Print a deterministic hello payload.",
|
|
939
|
-
intent: "verify extension command activation",
|
|
940
|
-
examples: ["pm hello"],
|
|
941
|
-
run: async () => ({ message: "hello" }),
|
|
942
|
-
});
|
|
943
|
-
},
|
|
944
|
-
});
|
|
945
|
-
```
|
|
328
|
+
## Upgrade Workflow
|
|
946
329
|
|
|
947
|
-
|
|
330
|
+
`pm upgrade` is the package-first update entrypoint:
|
|
948
331
|
|
|
949
332
|
```bash
|
|
950
|
-
pm
|
|
951
|
-
pm
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
Use [SDK](SDK.md) for typed examples. Runtime APIs include:
|
|
957
|
-
|
|
958
|
-
| API | Capability | Purpose |
|
|
959
|
-
|-----|------------|---------|
|
|
960
|
-
| `api.registerCommand(def)` | `commands` | add or replace command handlers |
|
|
961
|
-
| `api.registerParser(command, fn)` | `parser` | normalize args/options before dispatch |
|
|
962
|
-
| `api.registerPreflight(fn)` | `preflight` | influence mutation gate decisions |
|
|
963
|
-
| `api.registerService(name, fn)` | `services` | replace selected runtime services |
|
|
964
|
-
| `api.registerRenderer(format, fn)` | `renderers` | override TOON or JSON output |
|
|
965
|
-
| `api.registerImporter(name, fn)` | `importers` | add `<name> import` |
|
|
966
|
-
| `api.registerExporter(name, fn)` | `importers` | add `<name> export` |
|
|
967
|
-
| `api.registerFlags(command, flags)` | `schema` | describe dynamic command flags |
|
|
968
|
-
| `api.registerItemFields(fields)` | `schema` | add item metadata fields |
|
|
969
|
-
| `api.registerItemTypes(types)` | `schema` | add custom item types |
|
|
970
|
-
| `api.registerMigration(def)` | `schema` | add schema migrations |
|
|
971
|
-
| `api.registerSearchProvider(provider)` | `search` | add search provider |
|
|
972
|
-
| `api.registerVectorStoreAdapter(adapter)` | `search` | add vector adapter |
|
|
973
|
-
| `api.hooks.beforeCommand(fn)` | `hooks` | run before commands |
|
|
974
|
-
| `api.hooks.afterCommand(fn)` | `hooks` | run after commands |
|
|
975
|
-
| `api.hooks.onWrite(fn)` | `hooks` | observe writes |
|
|
976
|
-
| `api.hooks.onRead(fn)` | `hooks` | observe reads |
|
|
977
|
-
| `api.hooks.onIndex(fn)` | `hooks` | observe index operations |
|
|
978
|
-
|
|
979
|
-
## Command Metadata
|
|
980
|
-
|
|
981
|
-
Dynamic commands should include human and machine metadata:
|
|
982
|
-
|
|
983
|
-
```js
|
|
984
|
-
api.registerCommand({
|
|
985
|
-
name: "acme sync",
|
|
986
|
-
action: "acme-sync",
|
|
987
|
-
description: "Synchronize ACME records into pm items.",
|
|
988
|
-
intent: "run deterministic import before release prep",
|
|
989
|
-
examples: ["pm acme sync --source ./records.json --dry-run"],
|
|
990
|
-
failure_hints: ["Ensure --source points to readable JSON."],
|
|
991
|
-
flags: [
|
|
992
|
-
{ long: "--source", value_name: "path", description: "Input file path", required: true },
|
|
993
|
-
{ long: "--dry-run", description: "Preview without writing", type: "boolean" }
|
|
994
|
-
],
|
|
995
|
-
run: async (context) => ({ ok: true, args: context.args }),
|
|
996
|
-
});
|
|
333
|
+
pm upgrade --dry-run
|
|
334
|
+
pm upgrade
|
|
335
|
+
pm upgrade --packages-only
|
|
336
|
+
pm upgrade todos --dry-run
|
|
337
|
+
pm upgrade --cli-only --repair
|
|
997
338
|
```
|
|
998
339
|
|
|
999
|
-
|
|
340
|
+
CLI/SDK upgrades use `npm install -g @unbrained/pm-cli@<tag>`. Managed package upgrades reuse the source recorded at install time, including registry, GitHub, local, and first-party package sources.
|
|
1000
341
|
|
|
1001
|
-
##
|
|
342
|
+
## Automation Patterns
|
|
1002
343
|
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
For troubleshooting:
|
|
344
|
+
Use non-interactive commands with explicit project scope:
|
|
1006
345
|
|
|
1007
346
|
```bash
|
|
1008
|
-
pm --
|
|
1009
|
-
pm
|
|
1010
|
-
pm
|
|
347
|
+
pm init --defaults --author codex-agent
|
|
348
|
+
pm install '*' --project
|
|
349
|
+
pm package doctor --project --detail summary --json
|
|
350
|
+
pm contracts --flags-only --json
|
|
351
|
+
pm health --check-only --json
|
|
1011
352
|
```
|
|
1012
353
|
|
|
1013
|
-
|
|
354
|
+
For package-owned commands, install the package before assuming the command is available. Runtime contracts expose installed package actions; static SDK contracts intentionally expose only core actions.
|
|
1014
355
|
|
|
1015
|
-
`pm
|
|
356
|
+
If a package-owned command is invoked before installation, usage guidance includes the recovery install command when `pm` can map the command to a bundled package.
|
|
1016
357
|
|
|
1017
|
-
|
|
1018
|
-
|-------|------------------------|---------|
|
|
1019
|
-
| `beads` | `pm beads import` | import Beads JSONL records |
|
|
1020
|
-
| `todos` | `pm todos import`, `pm todos export` | round-trip todos markdown format |
|
|
358
|
+
## Troubleshooting
|
|
1021
359
|
|
|
1022
|
-
|
|
360
|
+
- Manifest or entry failure: run `pm package explore --project`.
|
|
361
|
+
- Activation failure: run `pm package doctor --detail deep --trace`.
|
|
362
|
+
- Policy block: inspect `settings.extensions.policy` and `details.summary.policy`.
|
|
363
|
+
- Runtime drift: compare with `pm --no-extensions <command>`.
|
|
364
|
+
- Managed-state update-check gap: run `pm package manage --fix-managed-state`.
|
|
365
|
+
- Unknown package command: run `pm package catalog --project` and install the owning package.
|
|
1023
366
|
|
|
1024
|
-
|
|
1025
|
-
pm install beads --project
|
|
1026
|
-
pm install todos --project
|
|
1027
|
-
```
|
|
1028
|
-
|
|
1029
|
-
## Starter Extension
|
|
367
|
+
## Runnable Examples
|
|
1030
368
|
|
|
1031
|
-
|
|
369
|
+
- `docs/examples/starter-extension/`
|
|
370
|
+
- `docs/examples/policy-restricted-extension/`
|
|
371
|
+
- `docs/examples/sdk-contract-consumer/`
|
|
372
|
+
- `docs/examples/sdk-app-embedding/`
|
|
373
|
+
- `docs/examples/ci/github-actions-pm-extension-gate.yml`
|
|
374
|
+
- `docs/examples/ci/gitlab-ci-pm-extension-gate.yml`
|
|
375
|
+
- `docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile`
|