@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/SDK.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The supported programmatic surface is `@unbrained/pm-cli/sdk`.
|
|
4
4
|
|
|
5
|
-
Use
|
|
5
|
+
Use it for extension authoring, package authoring, command/action contract discovery, and deterministic app or CI automation. Do not import private `src/core/...` modules from external integrations or packages.
|
|
6
6
|
|
|
7
7
|
## Install
|
|
8
8
|
|
|
@@ -10,302 +10,45 @@ Use this package for extension authoring, command/action contract discovery, and
|
|
|
10
10
|
npm install @unbrained/pm-cli
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
##
|
|
14
|
-
|
|
15
|
-
### Extension authoring
|
|
16
|
-
|
|
17
|
-
- `defineExtension`
|
|
18
|
-
- `EXTENSION_CAPABILITIES`
|
|
19
|
-
- `EXTENSION_CAPABILITY_CONTRACT`
|
|
20
|
-
- `EXTENSION_CAPABILITY_CONTRACT_VERSION`
|
|
21
|
-
- `EXTENSION_CAPABILITY_LEGACY_ALIASES`
|
|
22
|
-
- `EXTENSION_POLICY_MODES`
|
|
23
|
-
- `EXTENSION_POLICY_SURFACES`
|
|
24
|
-
- `EXTENSION_TRUST_MODES`
|
|
25
|
-
- `EXTENSION_SANDBOX_PROFILES`
|
|
26
|
-
|
|
27
|
-
### Command and action contracts
|
|
28
|
-
|
|
29
|
-
- `PM_CORE_COMMAND_NAMES`
|
|
30
|
-
- `PM_TOOL_ACTIONS`
|
|
31
|
-
- `PM_TOOL_PARAMETERS_SCHEMA`
|
|
32
|
-
- `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`
|
|
33
|
-
- `PM_TOOL_ACTION_PARAMETER_CONTRACTS`
|
|
34
|
-
|
|
35
|
-
`PM_TOOL_ACTIONS` includes the package lifecycle actions and `upgrade`, so agents and apps can discover `pm upgrade` through `pm contracts` instead of hard-coding flags.
|
|
36
|
-
|
|
37
|
-
### Runtime contract constants
|
|
38
|
-
|
|
39
|
-
- `PM_EXTENSION_CAPABILITY_CONTRACTS`
|
|
40
|
-
- `PM_EXTENSION_SERVICE_NAME_CONTRACTS`
|
|
41
|
-
- `PM_EXTENSION_POLICY_MODE_CONTRACTS`
|
|
42
|
-
- `PM_EXTENSION_POLICY_SURFACE_CONTRACTS`
|
|
43
|
-
- `PM_EXTENSION_TRUST_MODE_CONTRACTS`
|
|
44
|
-
- `PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS`
|
|
45
|
-
|
|
46
|
-
### Type guards
|
|
47
|
-
|
|
48
|
-
- `isPmToolAction`
|
|
49
|
-
- `isPmExtensionCapabilityContract`
|
|
50
|
-
- `isPmExtensionServiceNameContract`
|
|
51
|
-
- `isPmExtensionPolicyModeContract`
|
|
52
|
-
- `isPmExtensionPolicySurfaceContract`
|
|
53
|
-
|
|
54
|
-
## Capability Mapping
|
|
55
|
-
|
|
56
|
-
- `commands` -> `registerCommand`
|
|
57
|
-
- `schema` -> `registerFlags`, `registerItemFields`, `registerItemTypes`, `registerMigration`
|
|
58
|
-
- `importers` -> `registerImporter`, `registerExporter`
|
|
59
|
-
- `search` -> `registerSearchProvider`, `registerVectorStoreAdapter`
|
|
60
|
-
- `hooks` -> `api.hooks.*`
|
|
61
|
-
- `parser` -> `registerParser`
|
|
62
|
-
- `preflight` -> `registerPreflight`
|
|
63
|
-
- `services` -> `registerService`
|
|
64
|
-
- `renderers` -> `registerRenderer`
|
|
65
|
-
|
|
66
|
-
## Extension Example
|
|
13
|
+
## Import Surfaces
|
|
67
14
|
|
|
68
15
|
```ts
|
|
69
16
|
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
70
|
-
|
|
71
|
-
export default defineExtension({
|
|
72
|
-
activate(api) {
|
|
73
|
-
api.registerCommand({
|
|
74
|
-
name: "release audit",
|
|
75
|
-
action: "release-audit",
|
|
76
|
-
description: "Collect release-readiness diagnostics.",
|
|
77
|
-
intent: "Produce deterministic gate payloads for CI.",
|
|
78
|
-
flags: [{ long: "--strict", description: "Enable strict gate mode." }],
|
|
79
|
-
run: async (context) => ({
|
|
80
|
-
ok: true,
|
|
81
|
-
command: context.command,
|
|
82
|
-
strict: context.options.strict === true,
|
|
83
|
-
}),
|
|
84
|
-
});
|
|
85
|
-
},
|
|
86
|
-
});
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## Contracts-First Automation
|
|
90
|
-
|
|
91
|
-
Use runtime contracts for extension-aware schemas:
|
|
92
|
-
|
|
93
|
-
```bash
|
|
94
|
-
pm contracts --json
|
|
95
|
-
pm contracts --schema-only --json
|
|
96
|
-
pm contracts --command package --flags-only --json
|
|
97
|
-
pm contracts --action create --schema-only --json
|
|
98
17
|
```
|
|
99
18
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
```ts
|
|
103
|
-
import { PM_TOOL_ACTION_PARAMETER_CONTRACTS, isPmToolAction } from "@unbrained/pm-cli/sdk";
|
|
104
|
-
import { spawnSync } from "node:child_process";
|
|
105
|
-
|
|
106
|
-
const action = "package-reload";
|
|
107
|
-
if (!isPmToolAction(action)) throw new Error("Unsupported action");
|
|
108
|
-
const contract = PM_TOOL_ACTION_PARAMETER_CONTRACTS[action];
|
|
109
|
-
console.log(contract.required, contract.optional);
|
|
110
|
-
|
|
111
|
-
const result = spawnSync("pm", ["contracts", "--json"], { encoding: "utf8" });
|
|
112
|
-
if (result.status !== 0) throw new Error(result.stderr);
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
## Compatibility Metadata
|
|
116
|
-
|
|
117
|
-
`pm contracts --json` includes compatibility metadata for extension integrations:
|
|
118
|
-
|
|
119
|
-
- `extension_contracts.trust_modes`
|
|
120
|
-
- `extension_contracts.sandbox_profiles`
|
|
121
|
-
- `extension_contracts.manifest_versions`
|
|
122
|
-
- `extension_contracts.compatibility`
|
|
123
|
-
- `action_availability[].policy_state`
|
|
124
|
-
|
|
125
|
-
Current compatibility model:
|
|
126
|
-
|
|
127
|
-
- manifest current: `v2`
|
|
128
|
-
- supported previous: `v1`
|
|
129
|
-
- strategy: `versioned_breaking`
|
|
130
|
-
|
|
131
|
-
## Runnable Examples
|
|
132
|
-
|
|
133
|
-
- `docs/examples/sdk-contract-consumer/`
|
|
134
|
-
- `docs/examples/sdk-app-embedding/`
|
|
135
|
-
- `docs/examples/ci/`
|
|
136
|
-
|
|
137
|
-
## Related Docs
|
|
138
|
-
|
|
139
|
-
- `docs/EXTENSIONS.md`
|
|
140
|
-
- `docs/CLAUDE_CODE_PLUGIN.md`
|
|
141
|
-
# SDK
|
|
142
|
-
|
|
143
|
-
The supported programmatic surface is `@unbrained/pm-cli/sdk`.
|
|
144
|
-
|
|
145
|
-
Use this for:
|
|
146
|
-
|
|
147
|
-
- extension authoring (`defineExtension`)
|
|
148
|
-
- command/action schema discovery (`PM_TOOL_PARAMETERS_SCHEMA`)
|
|
149
|
-
- runtime action contracts (`PM_TOOL_ACTION_PARAMETER_CONTRACTS`)
|
|
150
|
-
- capability/policy/trust/sandbox contract constants
|
|
19
|
+
Supported package exports:
|
|
151
20
|
|
|
152
|
-
|
|
21
|
+
- `@unbrained/pm-cli/sdk` - stable extension and package authoring API plus CLI contract exports.
|
|
22
|
+
- `@unbrained/pm-cli/cli` - runtime CLI module entrypoint for package resolution, not a typed library API.
|
|
153
23
|
|
|
154
|
-
##
|
|
24
|
+
## Public Exports
|
|
155
25
|
|
|
156
|
-
|
|
157
|
-
npm install @unbrained/pm-cli
|
|
158
|
-
```
|
|
26
|
+
Source of truth:
|
|
159
27
|
|
|
160
|
-
|
|
28
|
+
- [`src/sdk/index.ts`](../src/sdk/index.ts)
|
|
29
|
+
- [`src/sdk/runtime.ts`](../src/sdk/runtime.ts)
|
|
30
|
+
- [`src/sdk/cli-contracts.ts`](../src/sdk/cli-contracts.ts)
|
|
31
|
+
- [`src/sdk/cli-contracts/commander-types.ts`](../src/sdk/cli-contracts/commander-types.ts)
|
|
32
|
+
- [`src/sdk/cli-contracts/commander-mutation-options.ts`](../src/sdk/cli-contracts/commander-mutation-options.ts)
|
|
161
33
|
|
|
162
|
-
|
|
34
|
+
Common authoring exports:
|
|
163
35
|
|
|
164
36
|
- `defineExtension`
|
|
165
37
|
- `EXTENSION_CAPABILITIES`
|
|
38
|
+
- `EXTENSION_CAPABILITY_CONTRACT`
|
|
39
|
+
- `EXTENSION_CAPABILITY_CONTRACT_VERSION`
|
|
40
|
+
- `EXTENSION_CAPABILITY_LEGACY_ALIASES`
|
|
166
41
|
- `EXTENSION_POLICY_MODES`
|
|
167
42
|
- `EXTENSION_POLICY_SURFACES`
|
|
168
43
|
- `EXTENSION_TRUST_MODES`
|
|
169
44
|
- `EXTENSION_SANDBOX_PROFILES`
|
|
170
|
-
- `EXTENSION_CAPABILITY_CONTRACT`
|
|
171
|
-
- `EXTENSION_CAPABILITY_CONTRACT_VERSION`
|
|
172
|
-
- `EXTENSION_CAPABILITY_LEGACY_ALIASES`
|
|
173
|
-
|
|
174
|
-
### Command/Action Contracts
|
|
175
|
-
|
|
176
|
-
- `PM_CORE_COMMAND_NAMES`
|
|
177
|
-
- `PM_TOOL_ACTIONS`
|
|
178
|
-
- `PM_TOOL_PARAMETERS_SCHEMA`
|
|
179
|
-
- `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`
|
|
180
|
-
- `PM_TOOL_ACTION_PARAMETER_CONTRACTS`
|
|
181
|
-
|
|
182
|
-
### Extension Runtime Contract Constants
|
|
183
|
-
|
|
184
|
-
- `PM_EXTENSION_CAPABILITY_CONTRACTS`
|
|
185
|
-
- `PM_EXTENSION_SERVICE_NAME_CONTRACTS`
|
|
186
|
-
- `PM_EXTENSION_POLICY_MODE_CONTRACTS`
|
|
187
|
-
- `PM_EXTENSION_POLICY_SURFACE_CONTRACTS`
|
|
188
|
-
- `PM_EXTENSION_TRUST_MODE_CONTRACTS`
|
|
189
|
-
- `PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS`
|
|
190
|
-
|
|
191
|
-
### Type Guards
|
|
192
|
-
|
|
193
|
-
- `isPmToolAction`
|
|
194
|
-
- `isPmExtensionCapabilityContract`
|
|
195
|
-
- `isPmExtensionServiceNameContract`
|
|
196
|
-
- `isPmExtensionPolicyModeContract`
|
|
197
|
-
- `isPmExtensionPolicySurfaceContract`
|
|
198
|
-
|
|
199
|
-
## Extension Example
|
|
200
|
-
|
|
201
|
-
```ts
|
|
202
|
-
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
203
|
-
|
|
204
|
-
export default defineExtension({
|
|
205
|
-
activate(api) {
|
|
206
|
-
api.registerCommand({
|
|
207
|
-
name: "release audit",
|
|
208
|
-
action: "release-audit",
|
|
209
|
-
description: "Collect release-readiness diagnostics.",
|
|
210
|
-
intent: "Produce deterministic gate payloads for CI.",
|
|
211
|
-
run: async (context) => ({
|
|
212
|
-
ok: true,
|
|
213
|
-
command: context.command,
|
|
214
|
-
}),
|
|
215
|
-
});
|
|
216
|
-
},
|
|
217
|
-
});
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
## Contracts-First Automation Pattern
|
|
221
|
-
|
|
222
|
-
```ts
|
|
223
|
-
import { PM_TOOL_ACTION_PARAMETER_CONTRACTS, isPmToolAction } from "@unbrained/pm-cli/sdk";
|
|
224
|
-
import { spawnSync } from "node:child_process";
|
|
225
|
-
|
|
226
|
-
const action = "extension-reload";
|
|
227
|
-
if (!isPmToolAction(action)) throw new Error("Unsupported action");
|
|
228
|
-
const contract = PM_TOOL_ACTION_PARAMETER_CONTRACTS[action];
|
|
229
|
-
console.log(contract.required, contract.optional);
|
|
230
|
-
|
|
231
|
-
const contracts = spawnSync("pm", ["contracts", "--json"], { encoding: "utf8" });
|
|
232
|
-
if (contracts.status !== 0) throw new Error(contracts.stderr);
|
|
233
|
-
```
|
|
234
|
-
|
|
235
|
-
## Runtime Metadata Added For v2
|
|
236
|
-
|
|
237
|
-
`pm contracts --json` now includes richer extension metadata:
|
|
238
|
-
|
|
239
|
-
- `extension_contracts.trust_modes`
|
|
240
|
-
- `extension_contracts.sandbox_profiles`
|
|
241
|
-
- `extension_contracts.manifest_versions`
|
|
242
|
-
- `extension_contracts.compatibility`
|
|
243
|
-
- `action_availability[].policy_state` for extension-backed actions
|
|
244
|
-
|
|
245
|
-
Use these fields to gate CI and to route compatibility behavior in embedded runtimes.
|
|
246
|
-
|
|
247
|
-
## Versioned-Breaking Compatibility
|
|
248
|
-
|
|
249
|
-
Current contract compatibility model:
|
|
250
|
-
|
|
251
|
-
- `manifest` current: `v2`
|
|
252
|
-
- supported previous: `v1`
|
|
253
|
-
- strategy: `versioned_breaking`
|
|
254
45
|
|
|
255
|
-
|
|
46
|
+
Package manifest exports:
|
|
256
47
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
## Runnable Examples
|
|
263
|
-
|
|
264
|
-
- contracts consumer: `docs/examples/sdk-contract-consumer/`
|
|
265
|
-
- app embedding runner: `docs/examples/sdk-app-embedding/`
|
|
266
|
-
- CI gates: `docs/examples/ci/`
|
|
267
|
-
|
|
268
|
-
## Related Docs
|
|
269
|
-
|
|
270
|
-
- `docs/EXTENSIONS.md`
|
|
271
|
-
- `docs/CLAUDE_CODE_PLUGIN.md`
|
|
272
|
-
# SDK
|
|
273
|
-
|
|
274
|
-
The stable integration surface is `@unbrained/pm-cli/sdk`. Use it for extension authoring, action/flag contract discovery, and deterministic app/CI automation.
|
|
275
|
-
|
|
276
|
-
## Install
|
|
277
|
-
|
|
278
|
-
```bash
|
|
279
|
-
npm install @unbrained/pm-cli
|
|
280
|
-
```
|
|
281
|
-
|
|
282
|
-
```ts
|
|
283
|
-
import {
|
|
284
|
-
defineExtension,
|
|
285
|
-
EXTENSION_CAPABILITIES,
|
|
286
|
-
EXTENSION_POLICY_MODES,
|
|
287
|
-
EXTENSION_POLICY_SURFACES,
|
|
288
|
-
PM_TOOL_ACTIONS,
|
|
289
|
-
PM_TOOL_PARAMETERS_SCHEMA,
|
|
290
|
-
PM_TOOL_ACTION_PARAMETER_CONTRACTS,
|
|
291
|
-
PM_EXTENSION_CAPABILITY_CONTRACTS,
|
|
292
|
-
PM_EXTENSION_SERVICE_NAME_CONTRACTS,
|
|
293
|
-
PM_EXTENSION_POLICY_MODE_CONTRACTS,
|
|
294
|
-
PM_EXTENSION_POLICY_SURFACE_CONTRACTS,
|
|
295
|
-
isPmToolAction,
|
|
296
|
-
isPmExtensionCapabilityContract,
|
|
297
|
-
} from "@unbrained/pm-cli/sdk";
|
|
298
|
-
```
|
|
299
|
-
|
|
300
|
-
## What Is Exported
|
|
301
|
-
|
|
302
|
-
Core authoring exports:
|
|
303
|
-
|
|
304
|
-
- `defineExtension`
|
|
305
|
-
- `EXTENSION_CAPABILITIES`
|
|
306
|
-
- `EXTENSION_CAPABILITY_CONTRACT`
|
|
307
|
-
- `EXTENSION_POLICY_MODES`
|
|
308
|
-
- `EXTENSION_POLICY_SURFACES`
|
|
48
|
+
- `PM_PACKAGE_RESOURCE_KINDS` (`extensions`, `docs`, `examples`)
|
|
49
|
+
- `PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS`
|
|
50
|
+
- `readPmPackageManifest`
|
|
51
|
+
- `collectPackageExtensionDirectories`
|
|
309
52
|
|
|
310
53
|
Command/action contract exports:
|
|
311
54
|
|
|
@@ -315,160 +58,30 @@ Command/action contract exports:
|
|
|
315
58
|
- `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`
|
|
316
59
|
- `PM_TOOL_ACTION_PARAMETER_CONTRACTS`
|
|
317
60
|
|
|
61
|
+
Commander option contract exports:
|
|
62
|
+
|
|
63
|
+
- `CREATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS`
|
|
64
|
+
- `UPDATE_COMMANDER_OPTION_REGISTRATION_CONTRACTS`
|
|
65
|
+
- `CREATE_COMMANDER_STRING_OPTION_CONTRACTS`
|
|
66
|
+
- `CREATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS`
|
|
67
|
+
- `UPDATE_COMMANDER_STRING_OPTION_CONTRACTS`
|
|
68
|
+
- `UPDATE_COMMANDER_REPEATABLE_OPTION_CONTRACTS`
|
|
69
|
+
- `LIST_COMMANDER_STRING_OPTION_CONTRACTS`
|
|
70
|
+
- `SEARCH_COMMANDER_STRING_OPTION_CONTRACTS`
|
|
71
|
+
- `CALENDAR_COMMANDER_STRING_OPTION_CONTRACTS`
|
|
72
|
+
- `CONTEXT_COMMANDER_STRING_OPTION_CONTRACTS`
|
|
73
|
+
- `ACTIVITY_COMMANDER_STRING_OPTION_CONTRACTS`
|
|
74
|
+
- `readFirstStringFromCommanderOptions`
|
|
75
|
+
- `readStringArrayFromCommanderOptions`
|
|
76
|
+
|
|
318
77
|
Extension runtime contract exports:
|
|
319
78
|
|
|
320
79
|
- `PM_EXTENSION_CAPABILITY_CONTRACTS`
|
|
321
80
|
- `PM_EXTENSION_SERVICE_NAME_CONTRACTS`
|
|
322
81
|
- `PM_EXTENSION_POLICY_MODE_CONTRACTS`
|
|
323
82
|
- `PM_EXTENSION_POLICY_SURFACE_CONTRACTS`
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
- `isPmToolAction(value)`
|
|
328
|
-
- `isPmExtensionCapabilityContract(value)`
|
|
329
|
-
- `isPmExtensionServiceNameContract(value)`
|
|
330
|
-
- `isPmExtensionPolicyModeContract(value)`
|
|
331
|
-
- `isPmExtensionPolicySurfaceContract(value)`
|
|
332
|
-
|
|
333
|
-
## Capability Mapping
|
|
334
|
-
|
|
335
|
-
- `commands` -> `registerCommand`
|
|
336
|
-
- `schema` -> `registerFlags`, `registerItemFields`, `registerItemTypes`, `registerMigration`
|
|
337
|
-
- `importers` -> `registerImporter`, `registerExporter`
|
|
338
|
-
- `search` -> `registerSearchProvider`, `registerVectorStoreAdapter`
|
|
339
|
-
- `hooks` -> `api.hooks.*`
|
|
340
|
-
- `parser` -> `registerParser`
|
|
341
|
-
- `preflight` -> `registerPreflight`
|
|
342
|
-
- `services` -> `registerService`
|
|
343
|
-
- `renderers` -> `registerRenderer`
|
|
344
|
-
|
|
345
|
-
## Extension Authoring Example
|
|
346
|
-
|
|
347
|
-
```ts
|
|
348
|
-
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
349
|
-
|
|
350
|
-
export default defineExtension({
|
|
351
|
-
activate(api) {
|
|
352
|
-
api.registerCommand({
|
|
353
|
-
name: "release audit",
|
|
354
|
-
action: "release-audit",
|
|
355
|
-
description: "Collect release readiness diagnostics.",
|
|
356
|
-
intent: "provide deterministic audit payloads for CI gates",
|
|
357
|
-
examples: ["pm release audit --strict"],
|
|
358
|
-
failure_hints: ["Run pm package doctor --detail deep --trace on activation failures."],
|
|
359
|
-
flags: [{ long: "--strict", description: "Enable strict gate mode." }],
|
|
360
|
-
run: async (context) => ({
|
|
361
|
-
ok: true,
|
|
362
|
-
command: context.command,
|
|
363
|
-
strict: context.options.strict === true,
|
|
364
|
-
}),
|
|
365
|
-
});
|
|
366
|
-
},
|
|
367
|
-
});
|
|
368
|
-
```
|
|
369
|
-
|
|
370
|
-
## Programmatic Contracts (App/Script)
|
|
371
|
-
|
|
372
|
-
Use runtime `pm contracts` for extension-aware schemas:
|
|
373
|
-
|
|
374
|
-
```bash
|
|
375
|
-
pm contracts --json
|
|
376
|
-
pm contracts --schema-only --json
|
|
377
|
-
pm contracts --command package --flags-only --json
|
|
378
|
-
pm contracts --action create --schema-only --json
|
|
379
|
-
```
|
|
380
|
-
|
|
381
|
-
The result includes:
|
|
382
|
-
|
|
383
|
-
- `actions`: runtime-invocable action list
|
|
384
|
-
- `action_availability`: invocable/disabled reasons
|
|
385
|
-
- `schema`: strict action-scoped JSON schema
|
|
386
|
-
- `command_flags`: merged core + extension + runtime field flags
|
|
387
|
-
- `extension_contracts`: capabilities/services/policy mode/surface contract metadata
|
|
388
|
-
|
|
389
|
-
## Robust Script Pattern
|
|
390
|
-
|
|
391
|
-
See runnable example: `docs/examples/sdk-contract-consumer/inspect-contracts.mjs`.
|
|
392
|
-
|
|
393
|
-
Minimal pattern:
|
|
394
|
-
|
|
395
|
-
1. Read contracts JSON.
|
|
396
|
-
2. Validate action exists in `actions`.
|
|
397
|
-
3. Validate required fields with `PM_TOOL_ACTION_PARAMETER_CONTRACTS`.
|
|
398
|
-
4. Execute the action only after preflight passes.
|
|
399
|
-
|
|
400
|
-
## CI/CD Pattern
|
|
401
|
-
|
|
402
|
-
Recommended gate sequence:
|
|
403
|
-
|
|
404
|
-
```bash
|
|
405
|
-
pnpm build
|
|
406
|
-
pm contracts --schema-only --json > /tmp/pm-contracts.json
|
|
407
|
-
pm package doctor --project --detail summary --strict-exit
|
|
408
|
-
node scripts/run-tests.mjs test -- tests/unit/contracts-command.spec.ts
|
|
409
|
-
node scripts/run-tests.mjs coverage
|
|
410
|
-
```
|
|
411
|
-
|
|
412
|
-
Reference workflow file:
|
|
413
|
-
|
|
414
|
-
- `docs/examples/ci/github-actions-pm-extension-gate.yml`
|
|
415
|
-
|
|
416
|
-
## Tooling Compatibility
|
|
417
|
-
|
|
418
|
-
For provider-safe schemas, use `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`. It is flat, non-`oneOf`, and designed for tool providers that reject advanced schema constructs. Agent-specific adapters should consume this SDK export from their own packages instead of adding agent runtime code to the main `pm` CLI.
|
|
419
|
-
|
|
420
|
-
## Related Docs
|
|
421
|
-
|
|
422
|
-
- `docs/EXTENSIONS.md`
|
|
423
|
-
- `docs/examples/starter-extension/README.md`
|
|
424
|
-
- `docs/examples/sdk-contract-consumer/README.md`
|
|
425
|
-
# SDK
|
|
426
|
-
|
|
427
|
-
The public SDK is exported from `@unbrained/pm-cli/sdk`. Use it for extension authoring and command-contract introspection. Do not import internal `src/core/...` modules from extensions.
|
|
428
|
-
|
|
429
|
-
## Agent Quick Context
|
|
430
|
-
|
|
431
|
-
- Primary import: `@unbrained/pm-cli/sdk`.
|
|
432
|
-
- Runtime extension lifecycle is documented in [Extensions](EXTENSIONS.md).
|
|
433
|
-
- Exact command/action contracts are available through `pm contracts`.
|
|
434
|
-
- Local deep-dive routing is available through `pm guide sdk --depth deep`.
|
|
435
|
-
|
|
436
|
-
Tracked documentation work: [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon).
|
|
437
|
-
|
|
438
|
-
## Import Surfaces
|
|
439
|
-
|
|
440
|
-
```ts
|
|
441
|
-
import { defineExtension } from "@unbrained/pm-cli/sdk";
|
|
442
|
-
```
|
|
443
|
-
|
|
444
|
-
Supported package exports:
|
|
445
|
-
|
|
446
|
-
- `@unbrained/pm-cli/sdk` - stable extension authoring API and CLI contract exports.
|
|
447
|
-
- `@unbrained/pm-cli/cli` - runtime CLI module entrypoint for package resolution, not a typed library API.
|
|
448
|
-
|
|
449
|
-
## Public Exports
|
|
450
|
-
|
|
451
|
-
Source of truth:
|
|
452
|
-
|
|
453
|
-
- [`src/sdk/index.ts`](../src/sdk/index.ts)
|
|
454
|
-
- [`src/sdk/cli-contracts.ts`](../src/sdk/cli-contracts.ts)
|
|
455
|
-
|
|
456
|
-
Common authoring exports:
|
|
457
|
-
|
|
458
|
-
- `defineExtension`
|
|
459
|
-
- `EXTENSION_CAPABILITIES`
|
|
460
|
-
- `EXTENSION_CAPABILITY_CONTRACT`
|
|
461
|
-
- `EXTENSION_CAPABILITY_CONTRACT_VERSION`
|
|
462
|
-
- `EXTENSION_CAPABILITY_LEGACY_ALIASES`
|
|
463
|
-
- `PM_PACKAGE_RESOURCE_KINDS`
|
|
464
|
-
- `PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS`
|
|
465
|
-
- `readPmPackageManifest`
|
|
466
|
-
- `collectPackageExtensionDirectories`
|
|
467
|
-
- `PM_CORE_COMMAND_NAMES`
|
|
468
|
-
- `PM_TOOL_ACTIONS`
|
|
469
|
-
- `PM_TOOL_PARAMETERS_SCHEMA`
|
|
470
|
-
- `PM_EXTENSION_CAPABILITY_CONTRACTS`
|
|
471
|
-
- `PM_EXTENSION_SERVICE_NAME_CONTRACTS`
|
|
83
|
+
- `PM_EXTENSION_TRUST_MODE_CONTRACTS`
|
|
84
|
+
- `PM_EXTENSION_SANDBOX_PROFILE_CONTRACTS`
|
|
472
85
|
|
|
473
86
|
Common types:
|
|
474
87
|
|
|
@@ -476,13 +89,35 @@ Common types:
|
|
|
476
89
|
- `ExtensionManifest`
|
|
477
90
|
- `CommandDefinition`
|
|
478
91
|
- `FlagDefinition`
|
|
92
|
+
- `ServiceOverrideContext`
|
|
479
93
|
- `SchemaFieldDefinition`
|
|
480
94
|
- `SchemaItemTypeDefinition`
|
|
481
95
|
- `SearchProviderDefinition`
|
|
482
96
|
- `VectorStoreAdapterDefinition`
|
|
483
97
|
- `GlobalOptions`
|
|
98
|
+
- `ItemDocument`
|
|
484
99
|
- `PmSettings`
|
|
485
100
|
|
|
101
|
+
## Static And Runtime Contracts
|
|
102
|
+
|
|
103
|
+
`PM_TOOL_ACTIONS` and `PM_TOOL_PARAMETERS_SCHEMA` describe the always-on static core action surface. They include core project-management primitives, package lifecycle actions, and `upgrade`.
|
|
104
|
+
|
|
105
|
+
Package-owned actions such as `beads-import`, `todos-export`, `calendar`, and `templates-save` are intentionally not advertised as static core actions. Discover installed package actions with runtime contracts:
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
pm contracts --runtime-only --json
|
|
109
|
+
pm contracts --action calendar --runtime-only --schema-only --json
|
|
110
|
+
pm contracts --command templates --runtime-only --flags-only --json
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Use static SDK contracts for baseline validation, then use `pm contracts --runtime-only` in the target project before invoking package-provided commands or actions.
|
|
114
|
+
|
|
115
|
+
When a package-owned command is missing at runtime, CLI usage guidance now includes a deterministic install hint (for example `pm install calendar` or `pm install search-advanced`) so agents can recover in one retry.
|
|
116
|
+
|
|
117
|
+
Package installs currently activate only extension resources. Additional package resource kinds (`docs`, `examples`) are metadata-first and available through package manifest/catalog inspection.
|
|
118
|
+
|
|
119
|
+
For provider-safe schemas, use `PM_PROVIDER_TOOL_PARAMETERS_SCHEMA`. It is flat and avoids advanced schema constructs such as root `oneOf`.
|
|
120
|
+
|
|
486
121
|
## Capability Requirements
|
|
487
122
|
|
|
488
123
|
| Registration | Manifest capability |
|
|
@@ -512,9 +147,11 @@ export default defineExtension({
|
|
|
512
147
|
activate(api) {
|
|
513
148
|
api.registerCommand({
|
|
514
149
|
name: "hello",
|
|
150
|
+
action: "hello",
|
|
515
151
|
description: "Return a deterministic hello payload.",
|
|
516
152
|
intent: "verify SDK extension activation",
|
|
517
153
|
examples: ["pm hello"],
|
|
154
|
+
failure_hints: ["Run pm package doctor --detail deep --trace on activation failures."],
|
|
518
155
|
run: async () => ({ ok: true, message: "hello" }),
|
|
519
156
|
});
|
|
520
157
|
},
|
|
@@ -583,23 +220,23 @@ export default defineExtension({
|
|
|
583
220
|
|
|
584
221
|
Manifest capability: `search`.
|
|
585
222
|
|
|
586
|
-
##
|
|
223
|
+
## Robust Automation Pattern
|
|
587
224
|
|
|
588
|
-
|
|
225
|
+
1. Read `PM_TOOL_ACTIONS` or `PM_TOOL_PARAMETERS_SCHEMA` for baseline static validation.
|
|
226
|
+
2. Run `pm contracts --runtime-only --json` inside the target project.
|
|
227
|
+
3. Verify the action appears in `actions` and has `action_availability[].invocable: true`.
|
|
228
|
+
4. Validate required fields with `PM_TOOL_ACTION_PARAMETER_CONTRACTS` for static actions or the runtime schema for package actions.
|
|
229
|
+
5. Execute only after preflight passes.
|
|
589
230
|
|
|
590
|
-
|
|
591
|
-
pm contracts --json
|
|
592
|
-
pm contracts --command create --flags-only --json
|
|
593
|
-
pm contracts --action create --schema-only --json
|
|
594
|
-
```
|
|
231
|
+
Runnable examples:
|
|
595
232
|
|
|
596
|
-
|
|
233
|
+
- [SDK contract consumer](examples/sdk-contract-consumer/README.md)
|
|
234
|
+
- [SDK app embedding](examples/sdk-app-embedding/README.md)
|
|
235
|
+
- [CI examples](examples/ci/)
|
|
597
236
|
|
|
598
237
|
## CLI Simplification Migration
|
|
599
238
|
|
|
600
|
-
The conservative full-surface simplification pass updated invocation parsing and error envelopes. Integration details are documented in
|
|
601
|
-
|
|
602
|
-
- [CLI Simplification Migration](MIGRATION_CLI_SIMPLIFICATION.md)
|
|
239
|
+
The conservative full-surface simplification pass updated invocation parsing and error envelopes. Integration details are documented in [CLI Simplification Migration](MIGRATION_CLI_SIMPLIFICATION.md).
|
|
603
240
|
|
|
604
241
|
For SDK and automation consumers, the key runtime change is the optional `recovery` object in CLI usage/error JSON payloads:
|
|
605
242
|
|
|
@@ -614,15 +251,15 @@ Treat `recovery.suggested_retry` as the first-choice deterministic replay comman
|
|
|
614
251
|
## Authoring Pattern
|
|
615
252
|
|
|
616
253
|
- Keep handlers deterministic and JSON-like.
|
|
617
|
-
- Return data, not pre-rendered terminal text, unless implementing a renderer.
|
|
254
|
+
- Return data, not pre-rendered terminal text, unless implementing a renderer or output service.
|
|
618
255
|
- Keep service and preflight overrides narrow.
|
|
619
256
|
- Declare only capabilities in use.
|
|
620
257
|
- Include examples and failure hints in dynamic commands.
|
|
621
|
-
- Add `pm
|
|
258
|
+
- Add `pm package doctor` diagnostics to testing instructions.
|
|
622
259
|
|
|
623
260
|
## Related Docs
|
|
624
261
|
|
|
625
|
-
- [Extensions](EXTENSIONS.md)
|
|
262
|
+
- [Extensions And Packages](EXTENSIONS.md)
|
|
626
263
|
- [CLI Simplification Migration](MIGRATION_CLI_SIMPLIFICATION.md)
|
|
627
264
|
- [Architecture](ARCHITECTURE.md)
|
|
628
|
-
- [
|
|
265
|
+
- [Starter Extension](examples/starter-extension/README.md)
|
package/docs/TESTING.md
CHANGED
|
@@ -36,7 +36,7 @@ Use focused runs while iterating, then run coverage before closure when risk or
|
|
|
36
36
|
Add tests to the item that owns the work:
|
|
37
37
|
|
|
38
38
|
```bash
|
|
39
|
-
pm test <item-id> --add command="node scripts/run-tests.mjs test -- tests/unit/output.spec.ts",
|
|
39
|
+
pm test <item-id> --add command="node scripts/run-tests.mjs test -- tests/unit/output.spec.ts",timeout_seconds=240
|
|
40
40
|
pm test <item-id> --run --progress
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -76,7 +76,7 @@ Linked tests can include assertion metadata:
|
|
|
76
76
|
|
|
77
77
|
```bash
|
|
78
78
|
pm test <item-id> --add \
|
|
79
|
-
command="pm list-open --json",
|
|
79
|
+
command="pm list-open --json",timeout_seconds=120,assert_json_field_gte=count:0
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
Common assertion keys include:
|
package/marketplace.json
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
},
|
|
8
8
|
"plugins": [
|
|
9
9
|
{
|
|
10
|
-
"name": "pm-
|
|
10
|
+
"name": "pm-claude",
|
|
11
11
|
"description": "Native pm CLI integration for Claude Code — 18 MCP tools, 5 workflow skills, 14 slash commands, 3 subagents, hybrid TUI task tracking, session context injection, and coordination subagents for git-based project management without leaving Claude Code.",
|
|
12
|
-
"version": "1.
|
|
13
|
-
"source": "./plugins/pm-
|
|
12
|
+
"version": "1.4.0",
|
|
13
|
+
"source": "./plugins/pm-claude",
|
|
14
14
|
"author": {
|
|
15
15
|
"name": "unbrained",
|
|
16
16
|
"url": "https://github.com/unbraind/pm-cli"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unbrained/pm-cli",
|
|
3
|
-
"version": "2026.5.
|
|
3
|
+
"version": "2026.5.18",
|
|
4
4
|
"description": "Git-native project management CLI for humans and agents.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"author": "unbrained",
|
|
@@ -48,14 +48,15 @@
|
|
|
48
48
|
"docs/**",
|
|
49
49
|
".claude-plugin/**",
|
|
50
50
|
"plugins/**",
|
|
51
|
-
"packages/pm
|
|
52
|
-
"
|
|
51
|
+
"packages/pm-*/**",
|
|
52
|
+
"scripts/finalize-build.mjs",
|
|
53
53
|
"scripts/install.sh",
|
|
54
54
|
"scripts/install.ps1",
|
|
55
|
+
"scripts/prepare-build-cache.mjs",
|
|
55
56
|
"marketplace.json"
|
|
56
57
|
],
|
|
57
58
|
"scripts": {
|
|
58
|
-
"build": "tsc -p tsconfig.json",
|
|
59
|
+
"build": "node scripts/prepare-build-cache.mjs && tsc -p tsconfig.json && node scripts/finalize-build.mjs",
|
|
59
60
|
"typecheck": "tsc --noEmit -p tsconfig.json && tsc -p tsconfig.packages.json",
|
|
60
61
|
"start": "node dist/cli.js",
|
|
61
62
|
"dev": "tsx src/cli.ts",
|
|
@@ -63,6 +64,7 @@
|
|
|
63
64
|
"test:coverage": "node scripts/run-tests.mjs coverage",
|
|
64
65
|
"quality:static": "node scripts/release/static-quality-gate.mjs",
|
|
65
66
|
"quality:docs-skills": "node scripts/release/docs-skills-gate.mjs",
|
|
67
|
+
"dogfood:package-first": "node scripts/dogfood-package-first.mjs",
|
|
66
68
|
"smoke:codex-plugin": "node scripts/smoke-codex-plugin-mcp.mjs",
|
|
67
69
|
"smoke:claude-plugin": "node scripts/smoke-claude-plugin.mjs",
|
|
68
70
|
"version:check": "node scripts/release-version.mjs check",
|
|
@@ -72,6 +74,7 @@
|
|
|
72
74
|
"release:gates": "node scripts/release/run-gates.mjs --telemetry-mode best-effort",
|
|
73
75
|
"release:pipeline": "node scripts/release/run-release-pipeline.mjs",
|
|
74
76
|
"release:pipeline:dry-run": "node scripts/release/run-release-pipeline.mjs --dry-run",
|
|
77
|
+
"release:verify-published": "node scripts/release/verify-published-release.mjs",
|
|
75
78
|
"security:scan": "node scripts/check-secrets.mjs",
|
|
76
79
|
"smoke:npx": "node scripts/smoke-npx-from-pack.mjs",
|
|
77
80
|
"sentry:inject": "sentry-cli sourcemaps inject dist/",
|