@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,124 +1,113 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath, pathToFileURL } from "node:url";
3
-
4
3
  const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
5
4
  const CURRENT_EXTENSION_ROOT = path.dirname(fileURLToPath(import.meta.url));
6
-
7
5
  export const manifest = {
8
- name: "builtin-beads-import",
9
- version: "0.1.0",
10
- entry: "./index.js",
11
- priority: 0,
12
- capabilities: ["commands", "schema"],
6
+ name: "builtin-beads-import",
7
+ version: "0.1.0",
8
+ entry: "./index.js",
9
+ priority: 0,
10
+ capabilities: ["commands", "schema"],
13
11
  };
14
-
15
12
  function asOptionalString(value) {
16
- return typeof value === "string" ? value : undefined;
13
+ return typeof value === "string" ? value : undefined;
17
14
  }
18
-
19
15
  function asBoolean(value) {
20
- return typeof value === "boolean" ? value : undefined;
16
+ return typeof value === "boolean" ? value : undefined;
21
17
  }
22
-
23
18
  function toBeadsImportOptions(options) {
24
- return {
25
- file: asOptionalString(options.file),
26
- author: asOptionalString(options.author),
27
- message: asOptionalString(options.message),
28
- preserveSourceIds: asBoolean(options.preserveSourceIds),
29
- };
19
+ return {
20
+ file: asOptionalString(options.file),
21
+ author: asOptionalString(options.author),
22
+ message: asOptionalString(options.message),
23
+ preserveSourceIds: asBoolean(options.preserveSourceIds),
24
+ };
30
25
  }
31
-
32
26
  function resolvePackageRootCandidates() {
33
- const candidates = [];
34
- const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
35
- if (typeof envRoot === "string" && envRoot.trim().length > 0) {
36
- candidates.push(path.resolve(envRoot.trim()));
37
- }
38
- const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
39
- if (argvEntry.length > 0) {
40
- const resolvedEntry = path.resolve(argvEntry);
41
- const entryDir = path.dirname(resolvedEntry);
42
- candidates.push(path.resolve(entryDir, ".."));
43
- candidates.push(path.resolve(entryDir, "../.."));
44
- candidates.push(path.resolve(entryDir, "../../.."));
45
- }
46
- return [...new Set(candidates)];
27
+ const candidates = [];
28
+ const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
29
+ if (typeof envRoot === "string" && envRoot.trim().length > 0) {
30
+ candidates.push(path.resolve(envRoot.trim()));
31
+ }
32
+ const argvEntry = typeof process.argv[1] === "string" ? process.argv[1].trim() : "";
33
+ if (argvEntry.length > 0) {
34
+ const resolvedEntry = path.resolve(argvEntry);
35
+ const entryDir = path.dirname(resolvedEntry);
36
+ candidates.push(path.resolve(entryDir, ".."));
37
+ candidates.push(path.resolve(entryDir, "../.."));
38
+ candidates.push(path.resolve(entryDir, "../../.."));
39
+ }
40
+ return [...new Set(candidates)];
47
41
  }
48
-
49
42
  async function loadRuntimeModule() {
50
- const attempted = [];
51
- for (const packageRoot of resolvePackageRootCandidates()) {
52
- const modulePaths = [
53
- path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js"),
54
- path.join(packageRoot, "packages", "pm-beads", "extensions", "beads", "runtime.js"),
55
- ];
56
- for (const modulePath of modulePaths) {
57
- attempted.push(modulePath);
58
- try {
59
- return await import(pathToFileURL(modulePath).href);
60
- } catch {
61
- // Try the next package-root candidate.
62
- }
43
+ const attempted = [];
44
+ for (const packageRoot of resolvePackageRootCandidates()) {
45
+ const modulePaths = [
46
+ path.join(packageRoot, ".agents", "pm", "extensions", "beads", "runtime.js"),
47
+ path.join(packageRoot, "packages", "pm-beads", "extensions", "beads", "runtime.js"),
48
+ ];
49
+ for (const modulePath of modulePaths) {
50
+ attempted.push(modulePath);
51
+ try {
52
+ return await import(pathToFileURL(modulePath).href);
53
+ }
54
+ catch {
55
+ // Try the next package-root candidate.
56
+ }
57
+ }
58
+ }
59
+ const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
60
+ attempted.push(localRuntimePath);
61
+ try {
62
+ return await import(pathToFileURL(localRuntimePath).href);
63
63
  }
64
- }
65
-
66
- const localRuntimePath = path.join(CURRENT_EXTENSION_ROOT, "runtime.js");
67
- attempted.push(localRuntimePath);
68
- try {
69
- return await import(pathToFileURL(localRuntimePath).href);
70
- } catch {
71
- // Fall through to the diagnostic below.
72
- }
73
-
74
- throw new Error(
75
- "Unable to resolve packaged beads extension runtime module. " +
76
- `Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`,
77
- );
64
+ catch {
65
+ // Fall through to the diagnostic below.
66
+ }
67
+ throw new Error("Unable to resolve packaged beads extension runtime module. " +
68
+ `Tried: ${attempted.join(", ")}. Ensure the installed extension includes runtime.js or PM_CLI_PACKAGE_ROOT points to an installed pm package root.`);
78
69
  }
79
-
80
70
  async function runBeadsImportFromRuntime(options, global) {
81
- const runtime = await loadRuntimeModule();
82
- if (typeof runtime.runBeadsImport !== "function") {
83
- throw new Error('Bundled beads runtime module is missing runBeadsImport().');
84
- }
85
- return runtime.runBeadsImport(options, global);
71
+ const runtime = await loadRuntimeModule();
72
+ if (typeof runtime.runBeadsImport !== "function") {
73
+ throw new Error("Bundled beads runtime module is missing runBeadsImport().");
74
+ }
75
+ return runtime.runBeadsImport(options, global);
86
76
  }
87
-
88
77
  export function activate(api) {
89
- api.registerCommand({
90
- name: "beads import",
91
- description: "Import Beads JSONL records into pm items.",
92
- flags: [
93
- {
94
- long: "--file",
95
- value_name: "path",
96
- value_type: "string",
97
- description: "Path to the Beads JSONL source file.",
98
- },
99
- {
100
- long: "--author",
101
- value_name: "author",
102
- value_type: "string",
103
- description: "Override import mutation author.",
104
- },
105
- {
106
- long: "--message",
107
- value_name: "text",
108
- value_type: "string",
109
- description: "Override import history message.",
110
- },
111
- {
112
- long: "--preserve-source-ids",
113
- value_type: "boolean",
114
- description: "Preserve source IDs from Beads payload records when possible.",
115
- },
116
- ],
117
- run: async (context) => runBeadsImportFromRuntime(toBeadsImportOptions(context.options), context.global),
118
- });
78
+ api.registerCommand({
79
+ name: "beads import",
80
+ action: "beads-import",
81
+ description: "Import Beads JSONL records into pm items.",
82
+ flags: [
83
+ {
84
+ long: "--file",
85
+ value_name: "path",
86
+ value_type: "string",
87
+ description: "Path to the Beads JSONL source file.",
88
+ },
89
+ {
90
+ long: "--author",
91
+ value_name: "author",
92
+ value_type: "string",
93
+ description: "Override import mutation author.",
94
+ },
95
+ {
96
+ long: "--message",
97
+ value_name: "text",
98
+ value_type: "string",
99
+ description: "Override import history message.",
100
+ },
101
+ {
102
+ long: "--preserve-source-ids",
103
+ value_type: "boolean",
104
+ description: "Preserve source IDs from Beads payload records when possible.",
105
+ },
106
+ ],
107
+ run: async (context) => runBeadsImportFromRuntime(toBeadsImportOptions(context.options), context.global),
108
+ });
119
109
  }
120
-
121
110
  export default {
122
- manifest,
123
- activate,
111
+ manifest,
112
+ activate,
124
113
  };
@@ -1,7 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath, pathToFileURL } from "node:url";
3
- import type { CommandDefinition, ExtensionApi } from "../../../../src/core/extensions/loader.js";
4
- import type { GlobalOptions } from "../../../../src/core/shared/command-types.js";
3
+ import type { CommandDefinition, ExtensionApi, GlobalOptions } from "../../../../src/sdk/index.js";
5
4
  import type { BeadsImportOptions, BeadsImportResult } from "./runtime.js";
6
5
 
7
6
  const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
@@ -95,6 +94,7 @@ async function runBeadsImportFromRuntime(options: BeadsImportOptions, global: Gl
95
94
  export function activate(api: ExtensionApi): void {
96
95
  api.registerCommand({
97
96
  name: "beads import",
97
+ action: "beads-import",
98
98
  description: "Import Beads JSONL records into pm items.",
99
99
  flags: [
100
100
  {
@@ -1,21 +1,6 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { pathExists, removeFileIfExists, writeFileAtomic } from "../../../../dist/core/fs/fs-utils.js";
4
- import { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../../../dist/core/extensions/index.js";
5
- import { appendHistoryEntry, createHistoryEntry } from "../../../../dist/core/history/history.js";
6
- import { generateItemId, normalizeItemId, normalizeRawItemId } from "../../../../dist/core/item/id.js";
7
- import { canonicalDocument, normalizeFrontMatter, serializeItemDocument } from "../../../../dist/core/item/item-format.js";
8
- import { normalizeStatusInput } from "../../../../dist/core/item/status.js";
9
- import { resolveItemTypeRegistry } from "../../../../dist/core/item/type-registry.js";
10
- import { parseTags } from "../../../../dist/core/item/parse.js";
11
- import { acquireLock } from "../../../../dist/core/lock/lock.js";
12
- import { EXIT_CODE } from "../../../../dist/core/shared/constants.js";
13
- import { PmCliError } from "../../../../dist/core/shared/errors.js";
14
- import { isTimestampLiteral, nowIso } from "../../../../dist/core/shared/time.js";
15
- import { locateItem } from "../../../../dist/core/store/item-store.js";
16
- import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../../../dist/core/store/paths.js";
17
- import { readSettings } from "../../../../dist/core/store/settings.js";
18
- import { DEPENDENCY_KIND_VALUES } from "../../../../dist/types/index.js";
3
+ import { DEPENDENCY_KIND_VALUES, EXIT_CODE, PmCliError, acquireLock, appendHistoryEntry, canonicalDocument, createHistoryEntry, generateItemId, getActiveExtensionRegistrations, getHistoryPath, getItemPath, getSettingsPath, isTimestampLiteral, locateItem, normalizeFrontMatter, normalizeItemId, normalizeRawItemId, normalizeStatusInput, nowIso, parseTags, pathExists, readSettings, removeFileIfExists, resolveItemTypeRegistry, resolvePmRoot, runActiveOnReadHooks, runActiveOnWriteHooks, serializeItemDocument, writeFileAtomic, } from "../../../../dist/sdk/index.js";
19
4
  const PRIMARY_AUTO_DISCOVERY_FILES = [
20
5
  ".beads/issues.jsonl",
21
6
  "issues.jsonl",
@@ -583,4 +568,4 @@ export async function runBeadsImport(options, global) {
583
568
  ids,
584
569
  warnings,
585
570
  };
586
- }
571
+ }
@@ -1,23 +1,46 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import { pathExists, removeFileIfExists, writeFileAtomic } from "../../../../src/core/fs/fs-utils.js";
4
- import { getActiveExtensionRegistrations, runActiveOnReadHooks, runActiveOnWriteHooks } from "../../../../src/core/extensions/index.js";
5
- import { appendHistoryEntry, createHistoryEntry } from "../../../../src/core/history/history.js";
6
- import { generateItemId, normalizeItemId, normalizeRawItemId } from "../../../../src/core/item/id.js";
7
- import { canonicalDocument, normalizeFrontMatter, serializeItemDocument } from "../../../../src/core/item/item-format.js";
8
- import { normalizeStatusInput } from "../../../../src/core/item/status.js";
9
- import { resolveItemTypeRegistry } from "../../../../src/core/item/type-registry.js";
10
- import { parseTags } from "../../../../src/core/item/parse.js";
11
- import { acquireLock } from "../../../../src/core/lock/lock.js";
12
- import { EXIT_CODE } from "../../../../src/core/shared/constants.js";
13
- import type { GlobalOptions } from "../../../../src/core/shared/command-types.js";
14
- import { PmCliError } from "../../../../src/core/shared/errors.js";
15
- import { isTimestampLiteral, nowIso } from "../../../../src/core/shared/time.js";
16
- import { locateItem } from "../../../../src/core/store/item-store.js";
17
- import { getHistoryPath, getItemPath, getSettingsPath, resolvePmRoot } from "../../../../src/core/store/paths.js";
18
- import { readSettings } from "../../../../src/core/store/settings.js";
19
- import type { Dependency, ItemDocument, ItemMetadata, ItemStatus, ItemType, LogNote, LinkedFile, LinkedTest, LinkedDoc } from "../../../../src/types/index.js";
20
- import { DEPENDENCY_KIND_VALUES } from "../../../../src/types/index.js";
3
+ import {
4
+ DEPENDENCY_KIND_VALUES,
5
+ EXIT_CODE,
6
+ PmCliError,
7
+ acquireLock,
8
+ appendHistoryEntry,
9
+ canonicalDocument,
10
+ createHistoryEntry,
11
+ generateItemId,
12
+ getActiveExtensionRegistrations,
13
+ getHistoryPath,
14
+ getItemPath,
15
+ getSettingsPath,
16
+ isTimestampLiteral,
17
+ locateItem,
18
+ normalizeFrontMatter,
19
+ normalizeItemId,
20
+ normalizeRawItemId,
21
+ normalizeStatusInput,
22
+ nowIso,
23
+ parseTags,
24
+ pathExists,
25
+ readSettings,
26
+ removeFileIfExists,
27
+ resolveItemTypeRegistry,
28
+ resolvePmRoot,
29
+ runActiveOnReadHooks,
30
+ runActiveOnWriteHooks,
31
+ serializeItemDocument,
32
+ writeFileAtomic,
33
+ type Dependency,
34
+ type GlobalOptions,
35
+ type ItemDocument,
36
+ type ItemMetadata,
37
+ type ItemStatus,
38
+ type ItemType,
39
+ type LinkedDoc,
40
+ type LinkedFile,
41
+ type LinkedTest,
42
+ type LogNote,
43
+ } from "../../../../src/sdk/index.js";
21
44
 
22
45
  const PRIMARY_AUTO_DISCOVERY_FILES = [
23
46
  ".beads/issues.jsonl",
@@ -1,17 +1,50 @@
1
1
  {
2
- "name": "@unbrained/pm-package-beads",
2
+ "name": "@unbrained/pm-beads",
3
3
  "version": "0.1.0",
4
4
  "private": true,
5
5
  "type": "module",
6
6
  "description": "First-party pm package for importing Beads JSONL records.",
7
+ "homepage": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "git+https://github.com/unbraind/pm-cli.git",
11
+ "directory": "packages/pm-beads"
12
+ },
13
+ "bugs": {
14
+ "url": "https://github.com/unbraind/pm-cli/issues"
15
+ },
7
16
  "keywords": [
8
17
  "pm-package",
9
18
  "project-management",
10
19
  "beads"
11
20
  ],
12
21
  "pm": {
22
+ "aliases": [
23
+ "beads"
24
+ ],
13
25
  "extensions": [
14
26
  "extensions/beads"
27
+ ],
28
+ "catalog": {
29
+ "display_name": "Beads Import",
30
+ "category": "migration",
31
+ "summary": "Import Beads JSONL records into pm while preserving source IDs.",
32
+ "tags": [
33
+ "migration",
34
+ "beads",
35
+ "import"
36
+ ],
37
+ "links": {
38
+ "docs": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads#readme",
39
+ "repository": "https://github.com/unbraind/pm-cli/tree/main/packages/pm-beads",
40
+ "report": "https://github.com/unbraind/pm-cli/issues"
41
+ }
42
+ },
43
+ "docs": [
44
+ "README.md"
45
+ ],
46
+ "examples": [
47
+ "README.md"
15
48
  ]
16
49
  }
17
50
  }
@@ -0,0 +1,13 @@
1
+ # pm Calendar Package
2
+
3
+ `@unbrained/pm-calendar` provides agenda and calendar views as an installable pm package.
4
+
5
+ ```bash
6
+ pm install calendar
7
+ pm calendar --view week --full-period
8
+ pm cal --json --view agenda --include reminders,events
9
+ ```
10
+
11
+ The package owns presentation commands for deadline, reminder, and scheduled event views. Core pm still owns item metadata such as `deadline`, `reminders`, and `events`, plus create/update parsing for those fields.
12
+
13
+ Runtime sources are authored in TypeScript and use only the public `@unbrained/pm-cli/sdk` surface.
@@ -0,0 +1,56 @@
1
+ import { renderCalendarPackageOutput, runCalendarPackage } from "./runtime.js";
2
+
3
+ export const manifest = {
4
+ name: "builtin-calendar",
5
+ version: "0.1.0",
6
+ entry: "./index.js",
7
+ priority: 0,
8
+ capabilities: ["commands", "schema", "services"],
9
+ };
10
+
11
+ const calendarFlags = [
12
+ { long: "--view", value_name: "value", value_type: "string", description: "Calendar view: agenda|day|week|month." },
13
+ { long: "--date", value_name: "value", value_type: "string", description: "Anchor date/time for view calculations." },
14
+ { long: "--from", value_name: "value", value_type: "string", description: "Agenda lower bound." },
15
+ { long: "--to", value_name: "value", value_type: "string", description: "Agenda upper bound." },
16
+ { long: "--past", value_type: "boolean", description: "Include past entries." },
17
+ { long: "--full-period", value_type: "boolean", description: "Include the full anchored day/week/month period." },
18
+ { long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
19
+ { long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
20
+ { long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
21
+ { long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
22
+ { long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
23
+ { long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
24
+ { long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
25
+ { long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
26
+ { long: "--include", value_name: "value", value_type: "string", description: "Include sources: deadlines|reminders|events|all." },
27
+ { long: "--recurrence-lookahead-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookahead days." },
28
+ { long: "--recurrence-lookback-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookback days." },
29
+ { long: "--occurrence-limit", value_name: "n", value_type: "string", description: "Cap generated occurrences per recurring event." },
30
+ { long: "--limit", value_name: "n", value_type: "string", description: "Limit returned event count." },
31
+ { long: "--format", value_name: "value", value_type: "string", description: "Calendar output override: markdown|toon|json." },
32
+ ];
33
+
34
+ function calendarCommand(name) {
35
+ return {
36
+ name,
37
+ action: "calendar",
38
+ description: "Show deadline, reminder, and scheduled event calendar views.",
39
+ flags: [...calendarFlags],
40
+ run: async (context) => runCalendarPackage(context.options, context.global),
41
+ };
42
+ }
43
+
44
+ export function activate(api) {
45
+ api.registerCommand(calendarCommand("calendar"));
46
+ api.registerCommand(calendarCommand("cal"));
47
+ api.registerService("output_format", (context) => {
48
+ const rendered = renderCalendarPackageOutput(context);
49
+ return rendered ?? null;
50
+ });
51
+ }
52
+
53
+ export default {
54
+ manifest,
55
+ activate,
56
+ };
@@ -0,0 +1,62 @@
1
+ import type {
2
+ CommandDefinition,
3
+ ExtensionApi,
4
+ ServiceOverrideContext,
5
+ } from "../../../../src/sdk/index.js";
6
+ import type { CalendarOptions } from "../../../../src/sdk/runtime.js";
7
+ import { renderCalendarPackageOutput, runCalendarPackage } from "./runtime.js";
8
+
9
+ export const manifest = {
10
+ name: "builtin-calendar",
11
+ version: "0.1.0",
12
+ entry: "./index.js",
13
+ priority: 0,
14
+ capabilities: ["commands", "schema", "services"],
15
+ };
16
+
17
+ const calendarFlags = [
18
+ { long: "--view", value_name: "value", value_type: "string", description: "Calendar view: agenda|day|week|month." },
19
+ { long: "--date", value_name: "value", value_type: "string", description: "Anchor date/time for view calculations." },
20
+ { long: "--from", value_name: "value", value_type: "string", description: "Agenda lower bound." },
21
+ { long: "--to", value_name: "value", value_type: "string", description: "Agenda upper bound." },
22
+ { long: "--past", value_type: "boolean", description: "Include past entries." },
23
+ { long: "--full-period", value_type: "boolean", description: "Include the full anchored day/week/month period." },
24
+ { long: "--type", value_name: "value", value_type: "string", description: "Filter by item type." },
25
+ { long: "--tag", value_name: "value", value_type: "string", description: "Filter by tag." },
26
+ { long: "--priority", value_name: "value", value_type: "string", description: "Filter by priority." },
27
+ { long: "--status", value_name: "value", value_type: "string", description: "Filter by status." },
28
+ { long: "--assignee", value_name: "value", value_type: "string", description: "Filter by assignee." },
29
+ { long: "--assignee-filter", value_name: "value", value_type: "string", description: "Filter assignee presence." },
30
+ { long: "--sprint", value_name: "value", value_type: "string", description: "Filter by sprint." },
31
+ { long: "--release", value_name: "value", value_type: "string", description: "Filter by release." },
32
+ { long: "--include", value_name: "value", value_type: "string", description: "Include sources: deadlines|reminders|events|all." },
33
+ { long: "--recurrence-lookahead-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookahead days." },
34
+ { long: "--recurrence-lookback-days", value_name: "n", value_type: "string", description: "Bound open-ended recurrence lookback days." },
35
+ { long: "--occurrence-limit", value_name: "n", value_type: "string", description: "Cap generated occurrences per recurring event." },
36
+ { long: "--limit", value_name: "n", value_type: "string", description: "Limit returned event count." },
37
+ { long: "--format", value_name: "value", value_type: "string", description: "Calendar output override: markdown|toon|json." },
38
+ ] as const;
39
+
40
+ function calendarCommand(name: "calendar" | "cal"): CommandDefinition {
41
+ return {
42
+ name,
43
+ action: "calendar",
44
+ description: "Show deadline, reminder, and scheduled event calendar views.",
45
+ flags: [...calendarFlags],
46
+ run: async (context) => runCalendarPackage(context.options as CalendarOptions, context.global),
47
+ };
48
+ }
49
+
50
+ export function activate(api: ExtensionApi): void {
51
+ api.registerCommand(calendarCommand("calendar"));
52
+ api.registerCommand(calendarCommand("cal"));
53
+ api.registerService("output_format", (context) => {
54
+ const rendered = renderCalendarPackageOutput(context as ServiceOverrideContext);
55
+ return rendered ?? null;
56
+ });
57
+ }
58
+
59
+ export default {
60
+ manifest,
61
+ activate,
62
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "builtin-calendar",
3
+ "version": "0.1.0",
4
+ "entry": "./index.js",
5
+ "priority": 0,
6
+ "capabilities": ["commands", "schema", "services"]
7
+ }
@@ -0,0 +1,114 @@
1
+ import path from "node:path";
2
+ import { pathToFileURL } from "node:url";
3
+
4
+ const PM_PACKAGE_ROOT_ENV = "PM_CLI_PACKAGE_ROOT";
5
+ let calendarCore = null;
6
+ let calendarCoreLoadPromise = null;
7
+
8
+ async function ensureCalendarCoreModule() {
9
+ if (calendarCore) {
10
+ return calendarCore;
11
+ }
12
+ if (!calendarCoreLoadPromise) {
13
+ calendarCoreLoadPromise = loadCalendarCoreModule();
14
+ }
15
+ calendarCore = await calendarCoreLoadPromise;
16
+ return calendarCore;
17
+ }
18
+
19
+ async function loadCalendarCoreModule() {
20
+ const envRoot = process.env[PM_PACKAGE_ROOT_ENV];
21
+ if (typeof envRoot !== "string" || envRoot.trim().length === 0) {
22
+ throw new Error(
23
+ `builtin-calendar requires ${PM_PACKAGE_ROOT_ENV} to locate core SDK runtime exports.`,
24
+ );
25
+ }
26
+ const modulePath = path.join(path.resolve(envRoot.trim()), "dist", "sdk", "runtime.js");
27
+ try {
28
+ const loaded = await import(pathToFileURL(modulePath).href);
29
+ if (
30
+ typeof loaded.runCalendar === "function" &&
31
+ typeof loaded.renderCalendarMarkdown === "function" &&
32
+ typeof loaded.resolveCalendarOutputFormat === "function"
33
+ ) {
34
+ return loaded;
35
+ }
36
+ } catch {
37
+ // Fall through to deterministic failure message below.
38
+ }
39
+ throw new Error(
40
+ `builtin-calendar failed to load calendar SDK runtime exports from ${modulePath}.`,
41
+ );
42
+ }
43
+
44
+ function isCalendarResult(value) {
45
+ return (
46
+ typeof value === "object" &&
47
+ value !== null &&
48
+ value.output_default === "markdown" &&
49
+ Array.isArray(value.events) &&
50
+ Array.isArray(value.days)
51
+ );
52
+ }
53
+
54
+ function readPayloadFormat(payload) {
55
+ if (typeof payload === "object" && payload !== null) {
56
+ const format = payload.format;
57
+ if (format === "json") {
58
+ return "json";
59
+ }
60
+ }
61
+ return "toon";
62
+ }
63
+
64
+ function readPayloadResult(payload) {
65
+ if (typeof payload === "object" && payload !== null && "result" in payload) {
66
+ return payload.result;
67
+ }
68
+ return payload;
69
+ }
70
+
71
+ function readPayloadCommandOptions(payload) {
72
+ if (typeof payload === "object" && payload !== null) {
73
+ const commandOptions = payload.command_options;
74
+ if (typeof commandOptions === "object" && commandOptions !== null) {
75
+ return commandOptions;
76
+ }
77
+ }
78
+ return {};
79
+ }
80
+
81
+ function readPayloadGlobalOptions(payload) {
82
+ if (typeof payload === "object" && payload !== null) {
83
+ const global = payload.global;
84
+ if (typeof global === "object" && global !== null) {
85
+ return global;
86
+ }
87
+ }
88
+ return {};
89
+ }
90
+
91
+ export async function runCalendarPackage(options, global) {
92
+ const loaded = await ensureCalendarCoreModule();
93
+ return loaded.runCalendar(options, global);
94
+ }
95
+
96
+ export function renderCalendarPackageOutput(context) {
97
+ const result = readPayloadResult(context.payload);
98
+ if (!calendarCore || !isCalendarResult(result)) {
99
+ return null;
100
+ }
101
+ const options =
102
+ context.options && Object.keys(context.options).length > 0
103
+ ? context.options
104
+ : readPayloadCommandOptions(context.payload);
105
+ const global = context.global ?? readPayloadGlobalOptions(context.payload);
106
+ const outputFormat = calendarCore.resolveCalendarOutputFormat(options, global);
107
+ if (outputFormat === "markdown") {
108
+ return `${calendarCore.renderCalendarMarkdown(result)}\n`;
109
+ }
110
+ if (outputFormat === "json" || readPayloadFormat(context.payload) === "json") {
111
+ return `${JSON.stringify(result, null, 2)}\n`;
112
+ }
113
+ return null;
114
+ }