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