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