@unbrained/pm-cli 2026.5.11 → 2026.5.14

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.
Files changed (171) hide show
  1. package/AGENTS.md +3 -116
  2. package/CHANGELOG.md +18 -0
  3. package/PRD.md +18 -39
  4. package/README.md +8 -5
  5. package/dist/cli/commander-usage.js +27 -0
  6. package/dist/cli/commander-usage.js.map +1 -1
  7. package/dist/cli/commands/activity.js +19 -4
  8. package/dist/cli/commands/activity.js.map +1 -1
  9. package/dist/cli/commands/calendar.js +5 -2
  10. package/dist/cli/commands/calendar.js.map +1 -1
  11. package/dist/cli/commands/contracts.js +63 -19
  12. package/dist/cli/commands/contracts.js.map +1 -1
  13. package/dist/cli/commands/create.js +58 -3
  14. package/dist/cli/commands/create.js.map +1 -1
  15. package/dist/cli/commands/extension.d.ts +14 -3
  16. package/dist/cli/commands/extension.js +481 -95
  17. package/dist/cli/commands/extension.js.map +1 -1
  18. package/dist/cli/commands/index.d.ts +1 -8
  19. package/dist/cli/commands/index.js +1 -8
  20. package/dist/cli/commands/index.js.map +1 -1
  21. package/dist/cli/commands/reindex.d.ts +8 -0
  22. package/dist/cli/commands/reindex.js +96 -23
  23. package/dist/cli/commands/reindex.js.map +1 -1
  24. package/dist/cli/commands/search.js +51 -25
  25. package/dist/cli/commands/search.js.map +1 -1
  26. package/dist/cli/commands/test.js +14 -6
  27. package/dist/cli/commands/test.js.map +1 -1
  28. package/dist/cli/commands/upgrade.d.ts +63 -0
  29. package/dist/cli/commands/upgrade.js +260 -0
  30. package/dist/cli/commands/upgrade.js.map +1 -0
  31. package/dist/cli/guide-topics.js +18 -16
  32. package/dist/cli/guide-topics.js.map +1 -1
  33. package/dist/cli/help-content.js +57 -18
  34. package/dist/cli/help-content.js.map +1 -1
  35. package/dist/cli/main.js +73 -7
  36. package/dist/cli/main.js.map +1 -1
  37. package/dist/cli/register-list-query.js +24 -142
  38. package/dist/cli/register-list-query.js.map +1 -1
  39. package/dist/cli/register-mutation.js +49 -257
  40. package/dist/cli/register-mutation.js.map +1 -1
  41. package/dist/cli/register-operations.js +29 -198
  42. package/dist/cli/register-operations.js.map +1 -1
  43. package/dist/cli/register-setup.js +181 -204
  44. package/dist/cli/register-setup.js.map +1 -1
  45. package/dist/cli/registration-helpers.d.ts +2 -2
  46. package/dist/cli/registration-helpers.js +1 -19
  47. package/dist/cli/registration-helpers.js.map +1 -1
  48. package/dist/core/extensions/loader.js +7 -1
  49. package/dist/core/extensions/loader.js.map +1 -1
  50. package/dist/core/packages/manifest.d.ts +38 -0
  51. package/dist/core/packages/manifest.js +221 -0
  52. package/dist/core/packages/manifest.js.map +1 -0
  53. package/dist/core/search/embedding-batches.d.ts +13 -1
  54. package/dist/core/search/embedding-batches.js +19 -1
  55. package/dist/core/search/embedding-batches.js.map +1 -1
  56. package/dist/core/store/front-matter-cache.d.ts +8 -1
  57. package/dist/core/store/front-matter-cache.js +20 -11
  58. package/dist/core/store/front-matter-cache.js.map +1 -1
  59. package/dist/mcp/server.d.ts +8 -0
  60. package/dist/mcp/server.js +100 -43
  61. package/dist/mcp/server.js.map +1 -1
  62. package/dist/sdk/cli-contracts/commander-mutation-options.d.ts +7 -0
  63. package/dist/sdk/cli-contracts/commander-mutation-options.js +477 -0
  64. package/dist/sdk/cli-contracts/commander-mutation-options.js.map +1 -0
  65. package/dist/sdk/cli-contracts/commander-types.d.ts +21 -0
  66. package/dist/sdk/cli-contracts/commander-types.js +92 -0
  67. package/dist/sdk/cli-contracts/commander-types.js.map +1 -0
  68. package/dist/sdk/cli-contracts.d.ts +22 -32
  69. package/dist/sdk/cli-contracts.js +155 -296
  70. package/dist/sdk/cli-contracts.js.map +1 -1
  71. package/dist/sdk/index.d.ts +2 -0
  72. package/dist/sdk/index.js +2 -0
  73. package/dist/sdk/index.js.map +1 -1
  74. package/dist/sdk/runtime.d.ts +29 -0
  75. package/dist/sdk/runtime.js +28 -0
  76. package/dist/sdk/runtime.js.map +1 -0
  77. package/docs/ARCHITECTURE.md +1 -1
  78. package/docs/COMMANDS.md +17 -1
  79. package/docs/EXTENSIONS.md +169 -61
  80. package/docs/QUICKSTART.md +11 -2
  81. package/docs/README.md +4 -6
  82. package/docs/RELEASING.md +4 -2
  83. package/docs/SDK.md +79 -438
  84. package/package.json +6 -23
  85. package/packages/pm-beads/README.md +10 -0
  86. package/packages/pm-beads/extensions/beads/index.js +113 -0
  87. package/{.agents/pm/extensions/beads/index.js → packages/pm-beads/extensions/beads/index.ts} +42 -20
  88. package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.js +2 -17
  89. package/{.agents/pm → packages/pm-beads}/extensions/beads/runtime.ts +41 -18
  90. package/packages/pm-beads/package.json +50 -0
  91. package/packages/pm-calendar/README.md +13 -0
  92. package/packages/pm-calendar/extensions/calendar/index.js +56 -0
  93. package/packages/pm-calendar/extensions/calendar/index.ts +62 -0
  94. package/packages/pm-calendar/extensions/calendar/manifest.json +7 -0
  95. package/packages/pm-calendar/extensions/calendar/runtime.js +95 -0
  96. package/packages/pm-calendar/extensions/calendar/runtime.ts +104 -0
  97. package/packages/pm-calendar/package.json +51 -0
  98. package/packages/pm-governance-audit/README.md +23 -0
  99. package/packages/pm-governance-audit/extensions/governance-audit/index.js +117 -0
  100. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +118 -0
  101. package/packages/pm-governance-audit/extensions/governance-audit/manifest.json +7 -0
  102. package/packages/pm-governance-audit/extensions/governance-audit/runtime.js +159 -0
  103. package/packages/pm-governance-audit/extensions/governance-audit/runtime.ts +176 -0
  104. package/packages/pm-governance-audit/package.json +52 -0
  105. package/packages/pm-guide-shell/README.md +23 -0
  106. package/packages/pm-guide-shell/extensions/guide-shell/index.js +76 -0
  107. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +81 -0
  108. package/packages/pm-guide-shell/extensions/guide-shell/manifest.json +7 -0
  109. package/packages/pm-guide-shell/extensions/guide-shell/runtime.js +263 -0
  110. package/packages/pm-guide-shell/extensions/guide-shell/runtime.ts +327 -0
  111. package/packages/pm-guide-shell/package.json +52 -0
  112. package/packages/pm-linked-test-adapters/README.md +24 -0
  113. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.js +101 -0
  114. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +102 -0
  115. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/manifest.json +7 -0
  116. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.js +142 -0
  117. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/runtime.ts +173 -0
  118. package/packages/pm-linked-test-adapters/package.json +53 -0
  119. package/packages/pm-search-advanced/README.md +27 -0
  120. package/packages/pm-search-advanced/extensions/search-advanced/index.js +93 -0
  121. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +94 -0
  122. package/packages/pm-search-advanced/extensions/search-advanced/manifest.json +7 -0
  123. package/packages/pm-search-advanced/extensions/search-advanced/runtime.js +120 -0
  124. package/packages/pm-search-advanced/extensions/search-advanced/runtime.ts +144 -0
  125. package/packages/pm-search-advanced/package.json +54 -0
  126. package/packages/pm-templates/README.md +20 -0
  127. package/packages/pm-templates/extensions/templates/index.js +101 -0
  128. package/packages/pm-templates/extensions/templates/index.ts +109 -0
  129. package/packages/pm-templates/extensions/templates/manifest.json +7 -0
  130. package/packages/pm-templates/extensions/templates/runtime.js +226 -0
  131. package/packages/pm-templates/extensions/templates/runtime.ts +283 -0
  132. package/packages/pm-templates/package.json +50 -0
  133. package/packages/pm-todos/README.md +11 -0
  134. package/packages/pm-todos/extensions/todos/index.js +130 -0
  135. package/{.agents/pm/extensions/todos/index.js → packages/pm-todos/extensions/todos/index.ts} +47 -23
  136. package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.js +3 -18
  137. package/{.agents/pm → packages/pm-todos}/extensions/todos/runtime.ts +42 -20
  138. package/packages/pm-todos/package.json +51 -0
  139. package/plugins/pm-cli-claude/README.md +1 -2
  140. package/plugins/pm-cli-claude/hooks/session-start.mjs +4 -55
  141. package/plugins/pm-cli-claude/scripts/pm-mcp-server.mjs +4 -2
  142. package/plugins/pm-cli-codex/scripts/pm-mcp-server.mjs +4 -2
  143. package/.agents/pm/extensions/.managed-extensions.json +0 -42
  144. package/.agents/skills/HARNESS_COMPATIBILITY.md +0 -45
  145. package/.agents/skills/README.md +0 -21
  146. package/.agents/skills/pm-developer/SKILL.md +0 -73
  147. package/.agents/skills/pm-developer/references/COMMAND_PLAYBOOK.md +0 -48
  148. package/.agents/skills/pm-developer/references/PROMPTS.md +0 -17
  149. package/.agents/skills/pm-extensions/SKILL.md +0 -57
  150. package/.agents/skills/pm-extensions/references/LIFECYCLE.md +0 -40
  151. package/.agents/skills/pm-extensions/references/TROUBLESHOOTING.md +0 -25
  152. package/.agents/skills/pm-sdk/SKILL.md +0 -50
  153. package/.agents/skills/pm-sdk/references/INTEGRATION_CHECKLIST.md +0 -31
  154. package/.agents/skills/pm-sdk/references/PROMPTS.md +0 -13
  155. package/.agents/skills/pm-user/SKILL.md +0 -59
  156. package/.agents/skills/pm-user/references/PROMPTS.md +0 -17
  157. package/.agents/skills/pm-user/references/WORKFLOWS.md +0 -35
  158. package/.pi/README.md +0 -35
  159. package/.pi/agents/pm-triage-agent.md +0 -19
  160. package/.pi/agents/pm-verification-agent.md +0 -21
  161. package/.pi/chains/pm-native-delivery.chain.md +0 -11
  162. package/.pi/extensions/pm-cli/index.js +0 -387
  163. package/.pi/prompts/pm-workflow.md +0 -5
  164. package/.pi/skills/pm-native/SKILL.md +0 -44
  165. package/.pi/skills/pm-release/SKILL.md +0 -35
  166. package/dist/pi/native.d.ts +0 -5
  167. package/dist/pi/native.js +0 -236
  168. package/dist/pi/native.js.map +0 -1
  169. package/docs/PI_PACKAGE.md +0 -141
  170. /package/{.agents/pm → packages/pm-beads}/extensions/beads/manifest.json +0 -0
  171. /package/{.agents/pm → packages/pm-todos}/extensions/todos/manifest.json +0 -0
@@ -1,5 +1,7 @@
1
1
  import { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES, type ExtensionApi, type ExtensionManifest } from "../core/extensions/loader.js";
2
+ export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, type PmPackageCatalogLinkMap, type PmPackageCatalogMediaMap, type PmPackageCatalogMetadata, type PmPackageManifest, type PmPackageResourceKind, type PmPackageResourceMap, } from "../core/packages/manifest.js";
2
3
  export * from "./cli-contracts.js";
4
+ export * from "./runtime.js";
3
5
  /**
4
6
  * Canonical extension capability names accepted by pm.
5
7
  *
package/dist/sdk/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES, KNOWN_EXTENSION_CAPABILITIES, KNOWN_EXTENSION_POLICY_MODES, KNOWN_EXTENSION_POLICY_SURFACES, KNOWN_EXTENSION_SANDBOX_PROFILES, KNOWN_EXTENSION_TRUST_MODES, } from "../core/extensions/loader.js";
2
+ export { PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS, PM_PACKAGE_RESOURCE_KINDS, collectPackageExtensionDirectories, readPmPackageManifest, } from "../core/packages/manifest.js";
2
3
  export * from "./cli-contracts.js";
4
+ export * from "./runtime.js";
3
5
  /**
4
6
  * Canonical extension capability names accepted by pm.
5
7
  *
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"/","sources":["sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,mCAAmC,EACnC,4BAA4B,EAC5B,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,GAG5B,MAAM,8BAA8B,CAAC;AACtC,cAAc,oBAAoB,CAAC;AAEnC;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAM3E;;GAEG;AACH,OAAO,EAAE,6BAA6B,EAAE,qCAAqC,EAAE,mCAAmC,EAAE,CAAC;AAarH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAkC,MAAe;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n type ExtensionApi,\n type ExtensionManifest,\n} from \"../core/extensions/loader.js\";\nexport * from \"./cli-contracts.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/**\n * Canonical extension governance policy modes and registration surfaces.\n */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\nexport type ExtensionSandboxProfile = (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/**\n * Versioned capability contract metadata emitted by runtime diagnostics.\n */\nexport { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES };\n\nexport interface ExtensionModule {\n /**\n * Optional in-module metadata mirror.\n *\n * The authoritative manifest remains on-disk `manifest.json`; this field is\n * useful when authors want colocated metadata for tooling/tests.\n */\n manifest?: ExtensionManifest;\n activate(api: ExtensionApi): void | Promise<void>;\n}\n\n/**\n * Typed identity helper for extension module exports.\n *\n * Use as:\n * `export default defineExtension({ activate(api) { ... } })`\n */\nexport function defineExtension<TModule extends ExtensionModule>(module: TModule): TModule {\n return module;\n}\n\nexport type {\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type { ItemDocument, ItemFrontMatter, ItemStatus, ItemType, PmSettings } from \"../types/index.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"/","sources":["sdk/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,6BAA6B,EAC7B,qCAAqC,EACrC,mCAAmC,EACnC,4BAA4B,EAC5B,4BAA4B,EAC5B,+BAA+B,EAC/B,gCAAgC,EAChC,2BAA2B,GAG5B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,sCAAsC,EACtC,yBAAyB,EACzB,kCAAkC,EAClC,qBAAqB,GAOtB,MAAM,8BAA8B,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,cAAc,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AAGnE;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,4BAA4B,CAAC;AACnE,MAAM,CAAC,MAAM,yBAAyB,GAAG,+BAA+B,CAAC;AACzE,MAAM,CAAC,MAAM,qBAAqB,GAAG,2BAA2B,CAAC;AACjE,MAAM,CAAC,MAAM,0BAA0B,GAAG,gCAAgC,CAAC;AAM3E;;GAEG;AACH,OAAO,EAAE,6BAA6B,EAAE,qCAAqC,EAAE,mCAAmC,EAAE,CAAC;AAarH;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAkC,MAAe;IAC9E,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["import {\n EXTENSION_CAPABILITY_CONTRACT,\n EXTENSION_CAPABILITY_CONTRACT_VERSION,\n EXTENSION_CAPABILITY_LEGACY_ALIASES,\n KNOWN_EXTENSION_CAPABILITIES,\n KNOWN_EXTENSION_POLICY_MODES,\n KNOWN_EXTENSION_POLICY_SURFACES,\n KNOWN_EXTENSION_SANDBOX_PROFILES,\n KNOWN_EXTENSION_TRUST_MODES,\n type ExtensionApi,\n type ExtensionManifest,\n} from \"../core/extensions/loader.js\";\nexport {\n PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS,\n PM_PACKAGE_RESOURCE_KINDS,\n collectPackageExtensionDirectories,\n readPmPackageManifest,\n type PmPackageCatalogLinkMap,\n type PmPackageCatalogMediaMap,\n type PmPackageCatalogMetadata,\n type PmPackageManifest,\n type PmPackageResourceKind,\n type PmPackageResourceMap,\n} from \"../core/packages/manifest.js\";\nexport * from \"./cli-contracts.js\";\nexport * from \"./runtime.js\";\n\n/**\n * Canonical extension capability names accepted by pm.\n *\n * Extension manifests should declare one or more of these values in\n * `capabilities`.\n */\nexport const EXTENSION_CAPABILITIES = KNOWN_EXTENSION_CAPABILITIES;\nexport type ExtensionCapability = (typeof EXTENSION_CAPABILITIES)[number];\n\n/**\n * Canonical extension governance policy modes and registration surfaces.\n */\nexport const EXTENSION_POLICY_MODES = KNOWN_EXTENSION_POLICY_MODES;\nexport const EXTENSION_POLICY_SURFACES = KNOWN_EXTENSION_POLICY_SURFACES;\nexport const EXTENSION_TRUST_MODES = KNOWN_EXTENSION_TRUST_MODES;\nexport const EXTENSION_SANDBOX_PROFILES = KNOWN_EXTENSION_SANDBOX_PROFILES;\nexport type ExtensionPolicyMode = (typeof EXTENSION_POLICY_MODES)[number];\nexport type ExtensionPolicySurface = (typeof EXTENSION_POLICY_SURFACES)[number];\nexport type ExtensionTrustMode = (typeof EXTENSION_TRUST_MODES)[number];\nexport type ExtensionSandboxProfile = (typeof EXTENSION_SANDBOX_PROFILES)[number];\n\n/**\n * Versioned capability contract metadata emitted by runtime diagnostics.\n */\nexport { EXTENSION_CAPABILITY_CONTRACT, EXTENSION_CAPABILITY_CONTRACT_VERSION, EXTENSION_CAPABILITY_LEGACY_ALIASES };\n\nexport interface ExtensionModule {\n /**\n * Optional in-module metadata mirror.\n *\n * The authoritative manifest remains on-disk `manifest.json`; this field is\n * useful when authors want colocated metadata for tooling/tests.\n */\n manifest?: ExtensionManifest;\n activate(api: ExtensionApi): void | Promise<void>;\n}\n\n/**\n * Typed identity helper for extension module exports.\n *\n * Use as:\n * `export default defineExtension({ activate(api) { ... } })`\n */\nexport function defineExtension<TModule extends ExtensionModule>(module: TModule): TModule {\n return module;\n}\n\nexport type {\n AfterCommandHook,\n AfterCommandHookContext,\n BeforeCommandHook,\n BeforeCommandHookContext,\n CommandDefinition,\n ExtensionCommandArgumentDefinition,\n CommandHandler,\n CommandHandlerContext,\n CommandOverride,\n CommandOverrideContext,\n ExtensionServiceName,\n Exporter,\n ExtensionActivationResult,\n ExtensionApi,\n ExtensionCommandRegistry,\n ExtensionDiagnostic,\n ExtensionDiscoveryResult,\n ExtensionLoadResult,\n ExtensionManifest,\n ExtensionGovernancePolicy,\n ExtensionPolicyOverride,\n ExtensionProvenanceMetadata,\n ExtensionRuntimePermissionDeclaration,\n ExtensionSearchMode,\n ExtensionParserRegistry,\n ExtensionPreflightRegistry,\n ExtensionRegistrationRegistry,\n ExtensionRendererRegistry,\n ExtensionServiceRegistry,\n FlagValueType,\n FlagDefinition,\n ImportExportContext,\n Importer,\n OnIndexHook,\n OnIndexHookContext,\n OnReadHook,\n OnReadHookContext,\n OnWriteHook,\n OnWriteHookContext,\n OutputRendererFormat,\n ParserOverride,\n ParserOverrideContext,\n ParserOverrideDelta,\n PreflightOverride,\n PreflightOverrideContext,\n PreflightOverrideDelta,\n PreflightRuntimeDecision,\n RendererOverride,\n RendererOverrideContext,\n SchemaFieldDefinition,\n SchemaItemTypeCommandOptionPolicyDefinition,\n SchemaItemTypeOptionDefinition,\n SchemaItemTypeDefinition,\n SchemaMigrationDefinition,\n SchemaMigrationRunContext,\n SchemaMigrationRunner,\n SearchProviderEmbedBatchContext,\n SearchProviderEmbedContext,\n SearchProviderDefinition,\n SearchProviderHit,\n SearchProviderQueryContext,\n SearchProviderQueryResult,\n ServiceOverride,\n ServiceOverrideContext,\n VectorStoreAdapterDefinition,\n VectorStoreDeleteContext,\n VectorStoreQueryContext,\n VectorStoreQueryHit,\n VectorStoreUpsertContext,\n VectorStoreUpsertPoint,\n} from \"../core/extensions/loader.js\";\n\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type { ItemDocument, ItemFrontMatter, ItemStatus, ItemType, PmSettings } from \"../types/index.js\";\n"]}
@@ -0,0 +1,29 @@
1
+ export { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks, } from "../core/extensions/index.js";
2
+ export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from "../core/fs/fs-utils.js";
3
+ export { appendHistoryEntry, createHistoryEntry } from "../core/history/history.js";
4
+ export { generateItemId, normalizeItemId, normalizeRawItemId } from "../core/item/id.js";
5
+ export { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter, } from "../core/item/item-format.js";
6
+ export { parseTags } from "../core/item/parse.js";
7
+ export { normalizeStatusInput } from "../core/item/status.js";
8
+ export { resolveItemTypeRegistry } from "../core/item/type-registry.js";
9
+ export { acquireLock } from "../core/lock/lock.js";
10
+ export { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
11
+ export { EXIT_CODE } from "../core/shared/constants.js";
12
+ export { PmCliError } from "../core/shared/errors.js";
13
+ export { isTimestampLiteral, nowIso } from "../core/shared/time.js";
14
+ export { listAllFrontMatter, locateItem, readLocatedItem } from "../core/store/item-store.js";
15
+ export { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
16
+ export { readSettings } from "../core/store/settings.js";
17
+ export { renderCalendarMarkdown, resolveCalendarOutputFormat, runCalendar, type CalendarOptions, type CalendarResult, } from "../cli/commands/calendar.js";
18
+ export { renderGuideMarkdown, resolveGuideOutputFormat, runGuide, type GuideDepth, type GuideOptions, type GuideOutputFormat, type GuideResult, } from "../cli/commands/guide.js";
19
+ export { runCompletion, type CompletionResult, type CompletionShell } from "../cli/commands/completion.js";
20
+ export { runCommentsAudit, type CommentsAuditEntry, type CommentsAuditHistoryRow, type CommentsAuditOptions, type CommentsAuditResult, type CommentsAuditSummary, type CommentsAuditTypeSummary, } from "../cli/commands/comments-audit.js";
21
+ export { runDedupeAudit, type DedupeAuditCandidate, type DedupeAuditCluster, type DedupeAuditOptions, type DedupeAuditResult, } from "../cli/commands/dedupe-audit.js";
22
+ export { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from "../cli/commands/normalize.js";
23
+ export { runReindex, type ReindexOptions, type ReindexResult } from "../cli/commands/reindex.js";
24
+ export { runSearch, type SearchOptions, type SearchResult } from "../cli/commands/search.js";
25
+ export { loadCreateTemplateOptions, runTemplatesList, runTemplatesSave, runTemplatesShow, type CreateTemplateOptions, type TemplatesListResult, type TemplatesSaveResult, type TemplatesShowResult, } from "../cli/commands/templates.js";
26
+ export { runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, type TestRunsListCommandOptions, type TestRunsLogsCommandOptions, type TestRunsResumeCommandOptions, type TestRunsStopCommandOptions, } from "../cli/commands/test-runs.js";
27
+ export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, } from "../types/index.js";
28
+ export type { GlobalOptions } from "../core/shared/command-types.js";
29
+ export type { Dependency, ItemDocument, ItemMetadata, ItemStatus, ItemType, LinkedDoc, LinkedFile, LinkedTest, LogNote, PmSettings, } from "../types/index.js";
@@ -0,0 +1,28 @@
1
+ export { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks, } from "../core/extensions/index.js";
2
+ export { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from "../core/fs/fs-utils.js";
3
+ export { appendHistoryEntry, createHistoryEntry } from "../core/history/history.js";
4
+ export { generateItemId, normalizeItemId, normalizeRawItemId } from "../core/item/id.js";
5
+ export { canonicalDocument, normalizeFrontMatter, serializeItemDocument, splitFrontMatter, } from "../core/item/item-format.js";
6
+ export { parseTags } from "../core/item/parse.js";
7
+ export { normalizeStatusInput } from "../core/item/status.js";
8
+ export { resolveItemTypeRegistry } from "../core/item/type-registry.js";
9
+ export { acquireLock } from "../core/lock/lock.js";
10
+ export { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from "../core/schema/runtime-schema.js";
11
+ export { EXIT_CODE } from "../core/shared/constants.js";
12
+ export { PmCliError } from "../core/shared/errors.js";
13
+ export { isTimestampLiteral, nowIso } from "../core/shared/time.js";
14
+ export { listAllFrontMatter, locateItem, readLocatedItem } from "../core/store/item-store.js";
15
+ export { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../core/store/paths.js";
16
+ export { readSettings } from "../core/store/settings.js";
17
+ export { renderCalendarMarkdown, resolveCalendarOutputFormat, runCalendar, } from "../cli/commands/calendar.js";
18
+ export { renderGuideMarkdown, resolveGuideOutputFormat, runGuide, } from "../cli/commands/guide.js";
19
+ export { runCompletion } from "../cli/commands/completion.js";
20
+ export { runCommentsAudit, } from "../cli/commands/comments-audit.js";
21
+ export { runDedupeAudit, } from "../cli/commands/dedupe-audit.js";
22
+ export { runNormalize } from "../cli/commands/normalize.js";
23
+ export { runReindex } from "../cli/commands/reindex.js";
24
+ export { runSearch } from "../cli/commands/search.js";
25
+ export { loadCreateTemplateOptions, runTemplatesList, runTemplatesSave, runTemplatesShow, } from "../cli/commands/templates.js";
26
+ export { runTestRunsList, runTestRunsLogs, runTestRunsResume, runTestRunsStatus, runTestRunsStop, } from "../cli/commands/test-runs.js";
27
+ export { CONFIDENCE_TEXT_VALUES, DEPENDENCY_KIND_VALUES, ISSUE_SEVERITY_VALUES, RISK_VALUES, } from "../types/index.js";
28
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"/","sources":["sdk/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,+BAA+B,EAC/B,oBAAoB,EACpB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC3G,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AACpF,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACzF,OAAO,EACL,iBAAiB,EACjB,oBAAoB,EACpB,qBAAqB,EACrB,gBAAgB,GACjB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,uBAAuB,EAAE,MAAM,+BAA+B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,EAAE,2BAA2B,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAC7G,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAC;AACtD,OAAO,EAAE,kBAAkB,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,kBAAkB,EAAE,UAAU,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EACL,sBAAsB,EACtB,2BAA2B,EAC3B,WAAW,GAGZ,MAAM,6BAA6B,CAAC;AACrC,OAAO,EACL,mBAAmB,EACnB,wBAAwB,EACxB,QAAQ,GAKT,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,aAAa,EAA+C,MAAM,+BAA+B,CAAC;AAC3G,OAAO,EACL,gBAAgB,GAOjB,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EACL,cAAc,GAKf,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,YAAY,EAAsD,MAAM,8BAA8B,CAAC;AAChH,OAAO,EAAE,UAAU,EAA2C,MAAM,4BAA4B,CAAC;AACjG,OAAO,EAAE,SAAS,EAAyC,MAAM,2BAA2B,CAAC;AAC7F,OAAO,EACL,yBAAyB,EACzB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,GAKjB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,eAAe,EACf,eAAe,EACf,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAKhB,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,sBAAsB,EACtB,sBAAsB,EACtB,qBAAqB,EACrB,WAAW,GACZ,MAAM,mBAAmB,CAAC","sourcesContent":["export {\n getActiveExtensionRegistrations,\n runActiveOnReadHooks,\n runActiveOnWriteHooks,\n} from \"../core/extensions/index.js\";\nexport { pathExists, readFileIfExists, removeFileIfExists, writeFileAtomic } from \"../core/fs/fs-utils.js\";\nexport { appendHistoryEntry, createHistoryEntry } from \"../core/history/history.js\";\nexport { generateItemId, normalizeItemId, normalizeRawItemId } from \"../core/item/id.js\";\nexport {\n canonicalDocument,\n normalizeFrontMatter,\n serializeItemDocument,\n splitFrontMatter,\n} from \"../core/item/item-format.js\";\nexport { parseTags } from \"../core/item/parse.js\";\nexport { normalizeStatusInput } from \"../core/item/status.js\";\nexport { resolveItemTypeRegistry } from \"../core/item/type-registry.js\";\nexport { acquireLock } from \"../core/lock/lock.js\";\nexport { resolveRuntimeFieldRegistry, resolveRuntimeStatusRegistry } from \"../core/schema/runtime-schema.js\";\nexport { EXIT_CODE } from \"../core/shared/constants.js\";\nexport { PmCliError } from \"../core/shared/errors.js\";\nexport { isTimestampLiteral, nowIso } from \"../core/shared/time.js\";\nexport { listAllFrontMatter, locateItem, readLocatedItem } from \"../core/store/item-store.js\";\nexport { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from \"../core/store/paths.js\";\nexport { readSettings } from \"../core/store/settings.js\";\nexport {\n renderCalendarMarkdown,\n resolveCalendarOutputFormat,\n runCalendar,\n type CalendarOptions,\n type CalendarResult,\n} from \"../cli/commands/calendar.js\";\nexport {\n renderGuideMarkdown,\n resolveGuideOutputFormat,\n runGuide,\n type GuideDepth,\n type GuideOptions,\n type GuideOutputFormat,\n type GuideResult,\n} from \"../cli/commands/guide.js\";\nexport { runCompletion, type CompletionResult, type CompletionShell } from \"../cli/commands/completion.js\";\nexport {\n runCommentsAudit,\n type CommentsAuditEntry,\n type CommentsAuditHistoryRow,\n type CommentsAuditOptions,\n type CommentsAuditResult,\n type CommentsAuditSummary,\n type CommentsAuditTypeSummary,\n} from \"../cli/commands/comments-audit.js\";\nexport {\n runDedupeAudit,\n type DedupeAuditCandidate,\n type DedupeAuditCluster,\n type DedupeAuditOptions,\n type DedupeAuditResult,\n} from \"../cli/commands/dedupe-audit.js\";\nexport { runNormalize, type NormalizeCommandOptions, type NormalizeResult } from \"../cli/commands/normalize.js\";\nexport { runReindex, type ReindexOptions, type ReindexResult } from \"../cli/commands/reindex.js\";\nexport { runSearch, type SearchOptions, type SearchResult } from \"../cli/commands/search.js\";\nexport {\n loadCreateTemplateOptions,\n runTemplatesList,\n runTemplatesSave,\n runTemplatesShow,\n type CreateTemplateOptions,\n type TemplatesListResult,\n type TemplatesSaveResult,\n type TemplatesShowResult,\n} from \"../cli/commands/templates.js\";\nexport {\n runTestRunsList,\n runTestRunsLogs,\n runTestRunsResume,\n runTestRunsStatus,\n runTestRunsStop,\n type TestRunsListCommandOptions,\n type TestRunsLogsCommandOptions,\n type TestRunsResumeCommandOptions,\n type TestRunsStopCommandOptions,\n} from \"../cli/commands/test-runs.js\";\nexport {\n CONFIDENCE_TEXT_VALUES,\n DEPENDENCY_KIND_VALUES,\n ISSUE_SEVERITY_VALUES,\n RISK_VALUES,\n} from \"../types/index.js\";\nexport type { GlobalOptions } from \"../core/shared/command-types.js\";\nexport type {\n Dependency,\n ItemDocument,\n ItemMetadata,\n ItemStatus,\n ItemType,\n LinkedDoc,\n LinkedFile,\n LinkedTest,\n LogNote,\n PmSettings,\n} from \"../types/index.js\";\n"]}
@@ -193,7 +193,7 @@ Command/action metadata is centralized in `src/sdk/cli-contracts.ts` and used by
193
193
  - CLI option normalization
194
194
  - help output
195
195
  - completion generation
196
- - Pi wrapper schema
196
+ - provider-safe tool schemas
197
197
  - `pm contracts`
198
198
  - extension command/action contract exposure
199
199
 
package/docs/COMMANDS.md CHANGED
@@ -31,7 +31,7 @@ Tracked documentation work: [pm-1sb2](../.agents/pm/tasks/pm-1sb2.toon).
31
31
  | Verification | `test`, `test-all`, `test-runs`, `validate`, `gc` | run linked tests and repository checks |
32
32
  | History | `history`, `activity`, `restore`, `stats` | inspect and recover item state |
33
33
  | Calendar | `calendar`, `cal` | project deadlines, reminders, and events |
34
- | Extensions | `extension`, extension command groups | install, manage, and run extension commands |
34
+ | Packages | `install`, `upgrade`, `package`, `packages`, `extension`, package/extension command groups | install, upgrade, manage, and run package-backed extension commands |
35
35
  | Machines | `guide`, `contracts`, `completion`, `help` | local docs routing plus command contracts and shell helpers |
36
36
 
37
37
  ## Bootstrap
@@ -44,6 +44,21 @@ pm health --check-only
44
44
 
45
45
  `pm init` creates `.agents/pm`. `pm health --check-only` inspects without refreshing optional search artifacts.
46
46
 
47
+ ## Packages
48
+
49
+ ```bash
50
+ pm install '*' --project
51
+ pm package catalog --project
52
+ pm install npm:@scope/pm-package --project
53
+ pm package doctor --project --detail summary
54
+ pm upgrade --dry-run
55
+ pm upgrade --packages-only
56
+ pm upgrade --cli-only --repair
57
+ ```
58
+
59
+ `pm install` and `pm package` are the preferred package-first workflow. `pm install '*'`, shell-expanded `pm install *`, and `pm install all` install bundled first-party packages. `pm extension` remains as a compatibility command for direct extension lifecycle operations.
60
+ When package-owned commands are unavailable, usage guidance includes an install-ready retry (for example `pm install calendar`, `pm install search-advanced`, `pm install governance-audit`, or `pm install guide-shell`).
61
+
47
62
  ## Triage
48
63
 
49
64
  ```bash
@@ -168,6 +183,7 @@ pm context --from today --to +7d --limit 10
168
183
  ```
169
184
 
170
185
  `calendar` defaults to markdown for human and agent readability. Other commands default to TOON unless configured otherwise.
186
+ For `--include events` without explicit `--to`, `--recurrence-lookahead-days`, or `--occurrence-limit`, recurring expansion is intentionally capped to a bounded default window and emits a warning with retry hints for broader windows.
171
187
 
172
188
  ## Validation and Maintenance
173
189
 
@@ -1,25 +1,60 @@
1
- # Extensions
1
+ # Packages and Extensions
2
2
 
3
- Extensions let you add or override `pm` runtime behavior without modifying core `pm-cli` sources.
3
+ Packages let you add or override `pm` runtime behavior without modifying core `pm-cli` sources. A package can currently contain one or more runtime extensions, and the package-first command surface is the preferred user-facing workflow.
4
4
 
5
- This document is the canonical extension reference for manifest contracts, governance policy, trust and sandbox controls, reload workflows, and diagnostics.
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.
6
8
 
7
9
  ## Quick Start
8
10
 
9
11
  ```bash
10
- # 1) Scaffold an extension
11
- pm extension --init ./my-extension
12
+ # 1) Scaffold a package extension
13
+ pm package init ./my-package-extension
12
14
 
13
15
  # 2) Install in project scope
14
- pm extension --install --project ./my-extension
16
+ pm install ./my-package --project
17
+
18
+ # Or install all bundled first-party packages
19
+ pm install '*' --project
15
20
 
16
21
  # 3) Run diagnostics
17
- pm extension --doctor --project --detail summary
22
+ pm package doctor --project --detail summary
18
23
 
19
- # 4) Reload runtime modules after local edits
20
- pm extension --reload --project
24
+ # 4) Plan CLI/SDK and package upgrades
25
+ pm upgrade --dry-run
26
+
27
+ # 5) Reload runtime modules after local edits
28
+ pm package reload --project
21
29
  ```
22
30
 
31
+ Compatibility equivalents:
32
+
33
+ ```bash
34
+ pm extension init ./my-package # prefer: pm package init ./my-package
35
+ pm extension install ./my-package --project
36
+ pm extension doctor --project --detail summary
37
+ pm extension reload --project
38
+ ```
39
+
40
+ Use compatibility equivalents only for existing automation or for debugging extension-runtime behavior directly.
41
+
42
+ ## Upgrade Workflow
43
+
44
+ `pm upgrade` is the package-first update entrypoint:
45
+
46
+ ```bash
47
+ pm upgrade --dry-run # plan CLI/SDK and project package updates
48
+ pm upgrade # update the global pm CLI/SDK, then refresh project packages
49
+ pm upgrade --packages-only # refresh managed packages without changing the CLI
50
+ pm upgrade todos --dry-run # plan one managed package refresh
51
+ pm upgrade --cli-only --repair # force a global CLI/SDK reinstall through npm
52
+ ```
53
+
54
+ CLI/SDK upgrades use `npm install -g @unbrained/pm-cli@<tag>`.
55
+ Managed package upgrades reuse the source recorded at install time, including `npm:`, GitHub, local, and first-party package paths.
56
+ Use `--tag <version-or-dist-tag>` to target a registry tag such as `latest` or `next`.
57
+
23
58
  ## Extension Locations
24
59
 
25
60
  - project scope: `.agents/pm/extensions/<name>/`
@@ -31,6 +66,84 @@ Runtime path overrides:
31
66
  - `PM_PATH`: project tracker root override
32
67
  - `PM_GLOBAL_PATH`: global profile root override
33
68
 
69
+ ## Package Sources
70
+
71
+ `pm install` accepts these package sources:
72
+
73
+ ```bash
74
+ pm install ./local-package
75
+ pm install /absolute/path/to/package
76
+ pm install npm:@scope/package
77
+ pm install npm:package@1.2.3
78
+ pm install https://github.com/org/repo
79
+ pm install --github org/repo/path --ref main
80
+ ```
81
+
82
+ Package roots can expose resources with a `pm` manifest in `package.json`:
83
+
84
+ ```json
85
+ {
86
+ "name": "my-pm-package",
87
+ "keywords": ["pm-package"],
88
+ "pm": {
89
+ "aliases": ["my-workflow"],
90
+ "extensions": ["extensions/my-extension"],
91
+ "docs": ["README.md"],
92
+ "examples": ["README.md"],
93
+ "catalog": {
94
+ "display_name": "My pm Package",
95
+ "category": "workflow",
96
+ "summary": "Adds a custom workflow to pm.",
97
+ "tags": ["workflow"],
98
+ "links": {
99
+ "docs": "https://example.com/docs",
100
+ "repository": "https://github.com/org/my-pm-package",
101
+ "report": "https://github.com/org/my-pm-package/issues"
102
+ },
103
+ "media": {
104
+ "image": "https://example.com/preview.png"
105
+ }
106
+ }
107
+ }
108
+ }
109
+ ```
110
+
111
+ `pm.aliases` declares short install targets for bundled first-party packages. If aliases are omitted, `pm` derives a default alias from the `packages/pm-*` directory name. The SDK exposes this project-management package model through `PM_PACKAGE_RESOURCE_KINDS`, `PM_PACKAGE_CONVENTIONAL_RESOURCE_ROOTS`, and `readPmPackageManifest`. Package installation currently activates only `pm.extensions`; `pm.docs` and `pm.examples` are metadata-first catalog resources. Agent-specific bundles such as prompts, skills, and MCP servers should live in separate agent adapter packages rather than the core `pm` package contract.
112
+
113
+ When no manifest is present, `pm` discovers conventional extension directories:
114
+
115
+ - `.agents/pm/extensions/`
116
+ - `extensions/`
117
+ - `.custom/pm-extensions/`
118
+ - `.custom/pm-extension/`
119
+
120
+ If a package contains multiple extension manifests, install the exact extension path so the managed state has one deterministic package target.
121
+
122
+ First-party optional packages are shipped as package roots under `packages/`:
123
+
124
+ ```bash
125
+ pm package catalog --project
126
+ pm install '*' --project
127
+ pm install all --project
128
+ pm install packages/pm-calendar --project
129
+ pm install packages/pm-beads --project
130
+ pm install packages/pm-todos --project
131
+ ```
132
+
133
+ `pm install '*'` and `pm install all` install every bundled first-party package in deterministic alias order. If your shell expands `pm install *`, pm recognizes that expansion and treats it as the same bundled-package install-all request.
134
+
135
+ Compatibility aliases remain available:
136
+
137
+ ```bash
138
+ pm install beads --project
139
+ pm install calendar --project
140
+ pm install todos --project
141
+ ```
142
+
143
+ Those aliases install package-shipped extension sources. They are then tracked in managed package state and can be refreshed with `pm upgrade --packages-only`.
144
+
145
+ If a package-owned command is invoked before installation (for example `pm calendar --help`, `pm reindex --help`, or `pm normalize --help` in bare core mode), runtime usage guidance now includes a direct recovery command such as `pm install calendar`, `pm install search-advanced`, or `pm install governance-audit`.
146
+
34
147
  ## Manifest Contract
35
148
 
36
149
  ### Manifest v1 (supported)
@@ -184,13 +297,14 @@ pm extension --doctor --project --detail deep --trace
184
297
  Management commands:
185
298
 
186
299
  ```bash
187
- pm extension --explore
188
- pm extension --manage --project
189
- pm extension --manage --project --probe-runtime
190
- pm extension --manage --project --adopt-unmanaged
191
- pm extension --activate my-extension --project
192
- pm extension --deactivate my-extension --project
193
- pm extension --uninstall my-extension --project
300
+ pm package catalog --project
301
+ pm package explore
302
+ pm package manage --project
303
+ pm package manage --project --runtime-probe
304
+ pm package manage --project --fix-managed-state
305
+ pm package activate my-extension --project
306
+ pm package deactivate my-extension --project
307
+ pm package uninstall my-extension --project
194
308
  ```
195
309
 
196
310
  Common warning prefixes:
@@ -214,7 +328,7 @@ Common warning prefixes:
214
328
 
215
329
  ```bash
216
330
  pm contracts --json
217
- pm extension --doctor --project --detail summary --strict-exit
331
+ pm package doctor --project --detail summary --strict-exit
218
332
  ```
219
333
 
220
334
  6. Resolve warnings before enforcing `mode=enforce` and `trust_mode=enforce`.
@@ -228,7 +342,7 @@ pm extension --doctor --project --detail summary --strict-exit
228
342
  - `docs/examples/ci/github-actions-pm-extension-gate.yml`
229
343
  - `docs/examples/ci/gitlab-ci-pm-extension-gate.yml`
230
344
  - `docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile`
231
- # Extensions
345
+ # Extension Runtime Details
232
346
 
233
347
  Extensions let you add or override `pm` runtime behavior without modifying core `pm-cli`.
234
348
 
@@ -243,17 +357,17 @@ This guide is the authoritative reference for:
243
357
  ## Quick Start
244
358
 
245
359
  ```bash
246
- # 1) Scaffold an extension
247
- pm extension --init ./my-extension
360
+ # 1) Scaffold a package-backed extension
361
+ pm package init ./my-package
248
362
 
249
363
  # 2) Install in project scope
250
- pm extension --install --project ./my-extension
364
+ pm install ./my-package --project
251
365
 
252
366
  # 3) Run diagnostics
253
- pm extension --doctor --project --detail summary
367
+ pm package doctor --project --detail summary
254
368
 
255
369
  # 4) Reload runtime modules after local edits
256
- pm extension --reload --project
370
+ pm package reload --project
257
371
  ```
258
372
 
259
373
  ## Delta From Previous Scope
@@ -263,7 +377,7 @@ Compared to the previous policy-only extension surface, this release adds:
263
377
  - **Manifest v2 metadata** for trust, provenance, sandbox profile, and runtime permission declarations.
264
378
  - **Policy v2 controls** for trust mode, provenance requirement, sandbox defaults, and command/action/service allow/block maps.
265
379
  - **Registration enforcement upgrades** so command/action/service restrictions are evaluated at registration boundaries.
266
- - **Hot reload controls** via cache-busted extension reload (`pm extension --reload`) with watch-mode semantics (`--watch`).
380
+ - **Hot reload controls** via cache-busted package reload (`pm package reload`) with watch-mode semantics (`--watch`).
267
381
  - **Contracts metadata upgrades** for trust/sandbox compatibility information in `pm contracts`.
268
382
 
269
383
  ## Extension Locations
@@ -473,27 +587,27 @@ pm extension --doctor --project --detail summary --strict-exit
473
587
  - `docs/examples/ci/github-actions-pm-extension-gate.yml`
474
588
  - `docs/examples/ci/gitlab-ci-pm-extension-gate.yml`
475
589
  - `docs/examples/ci/jenkins-pm-extension-gate.Jenkinsfile`
476
- # Extensions
590
+ # Extension Runtime Governance
477
591
 
478
592
  Extensions let you add or override `pm` runtime behavior without editing core `pm-cli` sources. They are loaded at runtime, gated by manifest capabilities, and now support granular governance policies for capability/surface allow/block controls.
479
593
 
480
594
  ## Quick Start
481
595
 
482
596
  ```bash
483
- # 1) Scaffold a new extension
484
- pm extension --init ./my-extension
597
+ # 1) Scaffold a new package
598
+ pm package init ./my-package
485
599
 
486
600
  # 2) Install into project scope
487
- pm extension --install --project ./my-extension
601
+ pm install ./my-package --project
488
602
 
489
- # 3) Run extension diagnostics
490
- pm extension --doctor --project --detail summary
603
+ # 3) Run package diagnostics
604
+ pm package doctor --project --detail summary
491
605
 
492
606
  # 4) Deep diagnostics with traces
493
- pm extension --doctor --project --detail deep --trace
607
+ pm package doctor --project --detail deep --trace
494
608
  ```
495
609
 
496
- Expected summary signals from `extension --doctor`:
610
+ Expected summary signals from `pm package doctor`:
497
611
 
498
612
  - `details.summary.status`: `ok` or `warn`
499
613
  - `details.summary.warning_codes`: deterministic warning code list
@@ -674,27 +788,27 @@ For CI/CD and agents:
674
788
 
675
789
  ## Troubleshooting
676
790
 
677
- - Manifest/entry failures: run `pm extension --explore --project`
678
- - Activation failures: run `pm extension --doctor --detail deep --trace`
791
+ - Manifest/entry failures: run `pm package explore --project`
792
+ - Activation failures: run `pm package doctor --detail deep --trace`
679
793
  - Policy blocks: review `settings.extensions.policy` and `details.summary.policy`
680
794
  - Runtime drift suspicion: compare with `pm --no-extensions <command>`
681
- - Managed-state update-check gaps: run `pm extension --manage --fix-managed-state`
795
+ - Managed-state update-check gaps: run `pm package manage --fix-managed-state`
682
796
 
683
797
  ## Related Docs
684
798
 
685
799
  - `docs/SDK.md`
686
800
  - `docs/examples/starter-extension/README.md`
687
801
  - `docs/CLAUDE_CODE_PLUGIN.md`
688
- # Extensions
802
+ # Extension Runtime Reference
689
803
 
690
804
  Extensions add commands, schema, renderers, importers/exporters, search adapters, lifecycle hooks, and selected runtime overrides without modifying core `pm-cli`.
691
805
 
692
806
  ## Agent Quick Context
693
807
 
694
- - Use `pm extension init ./my-extension` for a starter scaffold.
808
+ - Use `pm package init ./my-package` for a starter scaffold.
695
809
  - Use `@unbrained/pm-cli/sdk` for public extension APIs.
696
810
  - Declare only the capabilities your extension uses.
697
- - Run `pm extension doctor --detail deep --trace` for activation failures.
811
+ - Run `pm package doctor --detail deep --trace` for activation failures.
698
812
  - Use `--no-extensions` to isolate core behavior during incident triage.
699
813
  - Use `pm guide extensions --depth standard` for local docs routing.
700
814
 
@@ -719,44 +833,44 @@ Load order is global, then project. Project extensions take precedence when keys
719
833
  Scaffold:
720
834
 
721
835
  ```bash
722
- pm extension init ./my-extension
723
- pm extension scaffold ./my-extension
836
+ pm package init ./my-package
837
+ pm package scaffold ./my-package
724
838
  ```
725
839
 
726
840
  Install:
727
841
 
728
842
  ```bash
729
- pm extension install ./my-extension --project
730
- pm extension install github.com/unbraind/pm-cli/.agents/pm/extensions/todos --project
731
- pm extension --install --project todos
843
+ pm package install ./my-package --project
844
+ pm package install github.com/unbraind/pm-cli/packages/pm-todos --project
845
+ pm install todos --project
732
846
  ```
733
847
 
734
848
  Inspect and manage:
735
849
 
736
850
  ```bash
737
- pm extension explore --project
738
- pm extension manage --project
739
- pm extension doctor --detail summary
740
- pm extension doctor --detail deep --trace
851
+ pm package explore --project
852
+ pm package manage --project
853
+ pm package doctor --detail summary
854
+ pm package doctor --detail deep --trace
741
855
  ```
742
856
 
743
857
  Activate and deactivate:
744
858
 
745
859
  ```bash
746
- pm extension activate my-extension --project
747
- pm extension deactivate my-extension --project
860
+ pm package activate my-extension --project
861
+ pm package deactivate my-extension --project
748
862
  ```
749
863
 
750
864
  Adopt unmanaged extensions:
751
865
 
752
866
  ```bash
753
- pm extension adopt my-extension --project
754
- pm extension adopt-all --project
867
+ pm package adopt my-extension --project
868
+ pm package adopt-all --project
755
869
  ```
756
870
 
757
871
  ## Install Sources
758
872
 
759
- `pm extension install` accepts:
873
+ `pm install` and `pm package install` accept:
760
874
 
761
875
  - local directories
762
876
  - GitHub HTTPS URLs
@@ -898,7 +1012,7 @@ pm health --check-only
898
1012
 
899
1013
  ## Bundled Managed Extensions
900
1014
 
901
- `pm-cli` ships bundled extension sources that are not auto-installed:
1015
+ `pm-cli` ships optional first-party package roots that are not auto-installed:
902
1016
 
903
1017
  | Alias | Commands after install | Purpose |
904
1018
  |-------|------------------------|---------|
@@ -908,16 +1022,10 @@ pm health --check-only
908
1022
  Install:
909
1023
 
910
1024
  ```bash
911
- pm extension --install --project beads
912
- pm extension --install --project todos
1025
+ pm install beads --project
1026
+ pm install todos --project
913
1027
  ```
914
1028
 
915
1029
  ## Starter Extension
916
1030
 
917
1031
  See [examples/starter-extension](examples/starter-extension/README.md) for a compact extension that demonstrates all capability categories through the public SDK.
918
-
919
- ## Pi Wrapper
920
-
921
- The Pi wrapper source is `.pi/extensions/pm-cli/index.ts`. It is an agent wrapper, not a runtime extension managed by `pm extension`.
922
-
923
- Use [AGENTS.md](../AGENTS.md) for repository-specific Pi wrapper operating rules.
@@ -23,10 +23,10 @@ pm --version
23
23
  For updates, use the registry package again:
24
24
 
25
25
  ```bash
26
- npm install -g @unbrained/pm-cli@latest
26
+ pm upgrade --cli-only
27
27
  ```
28
28
 
29
- Do not use the GitHub git URL as the normal global update path. If a previous git-sourced install left a stale `pm` shim, run `bash scripts/install.sh --repair` from a checkout or uninstall the package before reinstalling from npm.
29
+ `pm upgrade` uses `npm install -g @unbrained/pm-cli@latest` for the CLI/SDK and can also refresh installed pm packages. Do not use the GitHub git URL as the normal global update path. If a previous git-sourced install left a stale `pm` shim, run `pm upgrade --cli-only --repair`, run `bash scripts/install.sh --repair` from a checkout, or uninstall the package before reinstalling from npm.
30
30
 
31
31
  For one-off use:
32
32
 
@@ -34,6 +34,15 @@ For one-off use:
34
34
  npx @unbrained/pm-cli --help
35
35
  ```
36
36
 
37
+ Optional first-party packages are installable on demand:
38
+
39
+ ```bash
40
+ pm package catalog --project
41
+ pm install '*' --project
42
+ pm install all --project
43
+ pm package doctor --project --detail summary
44
+ ```
45
+
37
46
  ## Initialize a Repository
38
47
 
39
48
  ```bash
package/docs/README.md CHANGED
@@ -21,8 +21,7 @@ pm guide release --json
21
21
  | New user | [Quickstart](QUICKSTART.md) | [Command Reference](COMMANDS.md) |
22
22
  | Coding agent | [Agent Guide](AGENT_GUIDE.md) | [Configuration](CONFIGURATION.md), then command help |
23
23
  | Maintainer | [Contributing](../CONTRIBUTING.md) | [Testing](TESTING.md), [Releasing](RELEASING.md), [Architecture](ARCHITECTURE.md) |
24
- | Extension author | [Extensions](EXTENSIONS.md) | [SDK](SDK.md), [starter extension](examples/starter-extension/README.md) |
25
- | Pi user | [Pi Package](PI_PACKAGE.md) | [Agent Guide](AGENT_GUIDE.md), then [Command Reference](COMMANDS.md) |
24
+ | Package author | [Packages and Extensions](EXTENSIONS.md) | [SDK](SDK.md), [starter extension](examples/starter-extension/README.md) |
26
25
  | Codex user | [Codex Plugin](CODEX_PLUGIN.md) | [Agent Guide](AGENT_GUIDE.md), then [Command Reference](COMMANDS.md) |
27
26
  | Machine client | `pm guide commands` | [Command Reference](COMMANDS.md#machine-contracts), then `pm contracts --json` |
28
27
 
@@ -34,9 +33,8 @@ pm guide release --json
34
33
  - [Configuration](CONFIGURATION.md) - settings, storage formats, output, search, validation, and environment variables.
35
34
  - [Testing](TESTING.md) - sandbox-safe local tests and linked-test orchestration.
36
35
  - [Architecture](ARCHITECTURE.md) - contributor internals: storage, mutation flow, search, extensions, and command contracts.
37
- - [Extensions](EXTENSIONS.md) - runtime extension lifecycle and API reference.
36
+ - [Packages and Extensions](EXTENSIONS.md) - package install workflows, runtime extension lifecycle, and API reference.
38
37
  - [SDK](SDK.md) - public import surfaces and typed authoring examples.
39
- - [Pi Package](PI_PACKAGE.md) - official Pi package install, native tool, skills, prompts, and workflows.
40
38
  - [Codex Plugin](CODEX_PLUGIN.md) - native MCP plugin install, tools, skills, and safety notes.
41
39
  - [Releasing](RELEASING.md) - maintainer release checklist and failure handling.
42
40
  - [starter extension](examples/starter-extension/README.md) - compact extension scaffold reference.
@@ -49,7 +47,7 @@ pm guide release --json
49
47
  | `commands` | [Command Reference](COMMANDS.md), [Configuration](CONFIGURATION.md) |
50
48
  | `workflows` | [Agent Guide](AGENT_GUIDE.md), [Testing](TESTING.md) |
51
49
  | `sdk` | [SDK](SDK.md), [Architecture](ARCHITECTURE.md) |
52
- | `extensions` | [Extensions](EXTENSIONS.md), [starter extension](examples/starter-extension/README.md) |
50
+ | `extensions`, `packages` | [Packages and Extensions](EXTENSIONS.md), [starter extension](examples/starter-extension/README.md) |
53
51
  | `skills` | [Agent Guide](AGENT_GUIDE.md) plus `.agents/skills/*` |
54
52
  | `harnesses` | [Agent Guide](AGENT_GUIDE.md) plus `.agents/skills/HARNESS_COMPATIBILITY.md` |
55
53
  | `release` | [Releasing](RELEASING.md), [CHANGELOG](../CHANGELOG.md) |
@@ -68,7 +66,7 @@ Community files:
68
66
  2. Use [Command Reference](COMMANDS.md) for command families, not exhaustive flag memory.
69
67
  3. Use `pm <command> --help --json` or `pm contracts --command <name> --flags-only --json` for exact flags.
70
68
  4. Use [Architecture](ARCHITECTURE.md) only when changing internals or debugging behavior.
71
- 5. Use [SDK](SDK.md) and [Extensions](EXTENSIONS.md) only when authoring or troubleshooting extensions.
69
+ 5. Use [SDK](SDK.md) and [Packages and Extensions](EXTENSIONS.md) only when authoring or troubleshooting packages/extensions.
72
70
 
73
71
  ## Tracker References
74
72