@unbrained/pm-cli 2026.11.6 → 2026.11.8

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 (474) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/CHANGELOG.md +82 -48
  3. package/dist/cli/expected-revisions.js +1 -1
  4. package/dist/cli/extension-command-help.js +4 -3
  5. package/dist/cli/help-json-payload.js +1 -1
  6. package/dist/cli/main.js +1 -1
  7. package/dist/cli/register-annotations.js +1 -1
  8. package/dist/cli/register-list-query.js +5 -5
  9. package/dist/cli/runtime/annotation-option-retry.js +2 -0
  10. package/dist/cli/runtime/close-fields-retry.js +2 -0
  11. package/dist/cli/runtime/invocation-options.js +1 -1
  12. package/dist/cli-bundle/bundle-manifest.json +1 -1
  13. package/dist/cli-bundle/chunks/chunk-3A5DJZCC.js +116 -0
  14. package/dist/cli-bundle/chunks/chunk-4BMPGUTG.js +9 -0
  15. package/dist/cli-bundle/chunks/{chunk-D7KYPRK4.js → chunk-7GC6WIDR.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-DAX3AOFI.js → chunk-7V6I6X4G.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-OH6WQ7VT.js → chunk-AFZS6WFV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-PE3ASURT.js → chunk-C4MQFWCM.js} +2 -2
  19. package/dist/cli-bundle/chunks/chunk-CP43BHX3.js +31 -0
  20. package/dist/cli-bundle/chunks/{chunk-S4LPZ4TN.js → chunk-DOHZKPPC.js} +7 -7
  21. package/dist/cli-bundle/chunks/{chunk-LS3GI3H4.js → chunk-HESIRIVX.js} +2 -2
  22. package/dist/cli-bundle/chunks/chunk-JAE5MWLX.js +2 -0
  23. package/dist/cli-bundle/chunks/{chunk-335BZ75D.js → chunk-L5BU5FYN.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-LI2HP5OX.js +3 -0
  25. package/dist/cli-bundle/chunks/chunk-LLTRUVKK.js +6 -0
  26. package/dist/cli-bundle/chunks/{chunk-X3URBPMV.js → chunk-MKW5LGVQ.js} +66 -62
  27. package/dist/cli-bundle/chunks/chunk-NH7QX2M2.js +8 -0
  28. package/dist/cli-bundle/chunks/{chunk-HRFGFIYU.js → chunk-NKO42JMT.js} +2 -2
  29. package/dist/cli-bundle/chunks/{chunk-7DEKAXVA.js → chunk-PE6CZ3PE.js} +2 -2
  30. package/dist/cli-bundle/chunks/chunk-RC6SSFOF.js +2 -0
  31. package/dist/cli-bundle/chunks/{chunk-TSQCUBUX.js → chunk-S4IZIMAO.js} +2 -2
  32. package/dist/cli-bundle/chunks/{chunk-UEGXWXUZ.js → chunk-XBUZENP4.js} +2 -2
  33. package/dist/cli-bundle/chunks/chunk-YGUUJHSR.js +2 -0
  34. package/dist/cli-bundle/chunks/chunk-YUTFMHSG.js +122 -0
  35. package/dist/cli-bundle/chunks/{chunk-SLC5UWCM.js → chunk-Z3LWNF7C.js} +2 -2
  36. package/dist/cli-bundle/chunks/item-revision-TUGZYYXX.js +2 -0
  37. package/dist/cli-bundle/chunks/item-transaction-2RRBAQN3.js +2 -0
  38. package/dist/cli-bundle/chunks/{mutation-admission-INMM3HHG.js → mutation-admission-FJ3D66PV.js} +2 -2
  39. package/dist/cli-bundle/chunks/{register-list-query-5Y5JKWU5.js → register-list-query-GXP77CX7.js} +11 -11
  40. package/dist/cli-bundle/chunks/register-mutation-XJ2DROUM.js +20 -0
  41. package/dist/cli-bundle/chunks/{register-operations-WJHZJFK2.js → register-operations-O5LERXM7.js} +2 -2
  42. package/dist/cli-bundle/chunks/{register-setup-RRFOS7IT.js → register-setup-4VOTYLL2.js} +2 -2
  43. package/dist/cli-bundle/chunks/{stage-E3MMV4TV.js → stage-ZDJL3FGL.js} +2 -2
  44. package/dist/cli-bundle/focused-chunks/chunk-2A3QZELL.js +26 -0
  45. package/dist/cli-bundle/focused-chunks/{chunk-MC7IE7D7.js → chunk-3HFENALW.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/chunk-4UOXVFJZ.js +2 -0
  47. package/dist/cli-bundle/focused-chunks/{chunk-7KK66ISG.js → chunk-5YPX3QKU.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-CPMSL4HS.js → chunk-6U5HP6L3.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/chunk-DIEBSC76.js +3 -0
  50. package/dist/cli-bundle/focused-chunks/{chunk-WSOAASCY.js → chunk-I4YUZW3J.js} +8 -8
  51. package/dist/cli-bundle/focused-chunks/chunk-KBRSA4OK.js +44 -0
  52. package/dist/cli-bundle/focused-chunks/{chunk-AHWJPZSJ.js → chunk-KNF2QTEZ.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/chunk-LTPT5TE7.js +24 -0
  54. package/dist/cli-bundle/focused-chunks/chunk-O7K3X4LH.js +2 -0
  55. package/dist/cli-bundle/focused-chunks/chunk-P4EHEH4C.js +2 -0
  56. package/dist/cli-bundle/focused-chunks/chunk-P6TG33FV.js +82 -0
  57. package/dist/cli-bundle/focused-chunks/chunk-PL6EO4GJ.js +2 -0
  58. package/dist/cli-bundle/focused-chunks/chunk-PSLDGAEY.js +12 -0
  59. package/dist/cli-bundle/focused-chunks/chunk-SZ2BKK3M.js +2 -0
  60. package/dist/cli-bundle/focused-chunks/chunk-TSHRBPTI.js +2 -0
  61. package/dist/cli-bundle/focused-chunks/chunk-ULTSMJYF.js +91 -0
  62. package/dist/cli-bundle/focused-chunks/chunk-UNNLBJRI.js +2 -0
  63. package/dist/cli-bundle/focused-chunks/chunk-UUVRYIKA.js +2 -0
  64. package/dist/cli-bundle/focused-chunks/{chunk-F62XGAAY.js → chunk-WPXMPGTY.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/chunk-Z2QWZRSL.js +26 -0
  66. package/dist/cli-bundle/focused-chunks/item-revision-XNSRDTFB.js +2 -0
  67. package/dist/cli-bundle/focused-chunks/item-transaction-Q2Z7DDCR.js +2 -0
  68. package/dist/cli-bundle/focused-chunks/mutation-admission-QWC6MLTZ.js +2 -0
  69. package/dist/cli-bundle/focused-chunks/stage-NKH5SKSZ.js +2 -0
  70. package/dist/cli-bundle/main.js +27 -26
  71. package/dist/cli-bundle/sdk-authoring.js +1 -1
  72. package/dist/cli-bundle/sdk-contracts.js +4 -4
  73. package/dist/cli-bundle/sdk-core.js +1 -1
  74. package/dist/cli-bundle/sdk-governance.js +1 -1
  75. package/dist/cli-bundle/sdk-graph.js +1 -1
  76. package/dist/cli-bundle/sdk-merge.js +57 -57
  77. package/dist/cli-bundle/sdk-query.js +1 -1
  78. package/dist/cli-bundle/sdk-runtime.js +1 -1
  79. package/dist/cli-bundle/sdk-testing.js +1 -1
  80. package/dist/cli-bundle/sdk.js +12 -12
  81. package/dist/core/extensions/flag-definition-validation.js +1 -1
  82. package/dist/core/extensions/reserved-host-flags.js +1 -1
  83. package/dist/core/history/history-stream-policy.d.ts +12 -3
  84. package/dist/core/history/history-stream-policy.js +1 -1
  85. package/dist/core/history/projection.d.ts +7 -2
  86. package/dist/core/history/projection.js +1 -1
  87. package/dist/core/item/item-format.d.ts +5 -1
  88. package/dist/core/item/item-format.js +2 -2
  89. package/dist/core/lock/lock.d.ts +1 -1
  90. package/dist/core/lock/lock.js +1 -1
  91. package/dist/core/output/output.d.ts +10 -1
  92. package/dist/core/output/output.js +7 -7
  93. package/dist/core/search/providers.d.ts +3 -2
  94. package/dist/core/search/providers.js +1 -1
  95. package/dist/core/search/vector-stores.d.ts +3 -2
  96. package/dist/core/search/vector-stores.js +1 -1
  97. package/dist/core/sentry/instrument.d.ts +2 -1
  98. package/dist/core/sentry/instrument.js +1 -1
  99. package/dist/core/store/item-mutation-precondition.d.ts +58 -0
  100. package/dist/core/store/item-mutation-precondition.js +1 -1
  101. package/dist/mcp/tool-definitions.js +1 -1
  102. package/dist/sdk/annotations.d.ts +44 -1
  103. package/dist/sdk/annotations.js +1 -1
  104. package/dist/sdk/authoring.d.ts +6 -0
  105. package/dist/sdk/authoring.js +1 -1
  106. package/dist/sdk/cli-contracts/flag-contracts.d.ts +15 -0
  107. package/dist/sdk/cli-contracts/flag-contracts.js +1 -1
  108. package/dist/sdk/cli-contracts/flag-lexicon-contracts.js +1 -1
  109. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -0
  110. package/dist/sdk/cli-contracts/runtime-contracts.js +1 -1
  111. package/dist/sdk/cli-contracts/tool-parameter-tables.js +1 -1
  112. package/dist/sdk/cli-contracts/tool-schema.js +1 -1
  113. package/dist/sdk/command-line.d.ts +7 -2
  114. package/dist/sdk/command-line.js +1 -1
  115. package/dist/sdk/comments.d.ts +4 -2
  116. package/dist/sdk/comments.js +1 -1
  117. package/dist/sdk/completion/bash.js +1 -1
  118. package/dist/sdk/completion/fish.js +2 -1
  119. package/dist/sdk/completion/zsh.js +4 -1
  120. package/dist/sdk/context-intent-contracts.d.ts +5 -1
  121. package/dist/sdk/context-intent-contracts.js +1 -1
  122. package/dist/sdk/contracts.d.ts +3 -0
  123. package/dist/sdk/contracts.js +1 -1
  124. package/dist/sdk/core.d.ts +14 -0
  125. package/dist/sdk/core.js +1 -1
  126. package/dist/sdk/corpus-shape.d.ts +2 -2
  127. package/dist/sdk/corpus-shape.js +1 -1
  128. package/dist/sdk/define.d.ts +14 -8
  129. package/dist/sdk/define.js +1 -1
  130. package/dist/sdk/extension/command-options.d.ts +123 -0
  131. package/dist/sdk/extension/command-options.js +2 -0
  132. package/dist/sdk/extension-contracts.d.ts +1 -2
  133. package/dist/sdk/extension-contracts.js +1 -1
  134. package/dist/sdk/generated/generated-error-code-catalog-part-1.js +1 -1
  135. package/dist/sdk/generated/generated-error-code-catalog-part-2.js +1 -1
  136. package/dist/sdk/governance.d.ts +8 -0
  137. package/dist/sdk/governance.js +1 -1
  138. package/dist/sdk/graph.d.ts +5 -0
  139. package/dist/sdk/graph.js +1 -1
  140. package/dist/sdk/index.d.ts +61 -1
  141. package/dist/sdk/index.js +1 -1
  142. package/dist/sdk/learnings.d.ts +4 -2
  143. package/dist/sdk/learnings.js +1 -1
  144. package/dist/sdk/lifecycle/close.js +1 -1
  145. package/dist/sdk/lifecycle/item-revision.d.ts +15 -4
  146. package/dist/sdk/lifecycle/item-revision.js +1 -1
  147. package/dist/sdk/lifecycle/restore.d.ts +1 -1
  148. package/dist/sdk/merge.d.ts +3 -0
  149. package/dist/sdk/merge.js +1 -1
  150. package/dist/sdk/notes.d.ts +4 -2
  151. package/dist/sdk/notes.js +1 -1
  152. package/dist/sdk/output/list-envelope.d.ts +18 -7
  153. package/dist/sdk/output/list-envelope.js +1 -1
  154. package/dist/sdk/output-projection.js +1 -1
  155. package/dist/sdk/public-surface.json +1 -1
  156. package/dist/sdk/query/get.d.ts +16 -6
  157. package/dist/sdk/query/get.js +1 -1
  158. package/dist/sdk/query/list.d.ts +5 -1
  159. package/dist/sdk/query/list.js +1 -1
  160. package/dist/sdk/query/search/response.js +1 -1
  161. package/dist/sdk/query/search/semantic.d.ts +11 -3
  162. package/dist/sdk/query/search/semantic.js +1 -1
  163. package/dist/sdk/query/search-rendering.d.ts +9 -3
  164. package/dist/sdk/query/search-rendering.js +1 -1
  165. package/dist/sdk/query.d.ts +11 -0
  166. package/dist/sdk/query.js +1 -1
  167. package/dist/sdk/read-output/continuation.d.ts +8 -0
  168. package/dist/sdk/read-output/continuation.js +1 -1
  169. package/dist/sdk/read-output/options.d.ts +1 -1
  170. package/dist/sdk/read-output/options.js +1 -1
  171. package/dist/sdk/read-output/surfaces.js +1 -1
  172. package/dist/sdk/read-output/tail-retention.d.ts +34 -0
  173. package/dist/sdk/read-output/tail-retention.js +2 -0
  174. package/dist/sdk/read-output-budget.d.ts +14 -2
  175. package/dist/sdk/read-output-budget.js +1 -1
  176. package/dist/sdk/read-output-contracts.d.ts +20 -4
  177. package/dist/sdk/read-output-contracts.js +1 -1
  178. package/dist/sdk/read-output-rows.d.ts +7 -3
  179. package/dist/sdk/read-output-rows.js +1 -1
  180. package/dist/sdk/runtime-input.js +1 -1
  181. package/dist/sdk/runtime.d.ts +26 -3
  182. package/dist/sdk/runtime.js +1 -1
  183. package/dist/sdk/test/execution.d.ts +29 -2
  184. package/dist/sdk/test/execution.js +1 -1
  185. package/dist/sdk/testing.d.ts +14 -1
  186. package/dist/sdk/testing.js +1 -1
  187. package/dist/sdk/traceability/source-traceability.d.ts +4 -1
  188. package/dist/sdk/traceability/source-traceability.js +1 -1
  189. package/dist/sdk/workspace-recipe.d.ts +2 -2
  190. package/dist/sdk/workspace-recipe.js +1 -1
  191. package/docs/ARCHITECTURE.md +2 -1
  192. package/docs/CLOSE_EVIDENCE_RECOVERY.md +36 -2
  193. package/docs/COMMANDS.md +14 -2
  194. package/docs/DIAGNOSTIC_OUTPUT_CONTRACTS.md +1 -1
  195. package/docs/EXTENSIONS.md +1 -1
  196. package/docs/GET_READ_EVIDENCE.md +24 -3
  197. package/docs/MCP_OPTION_CONFORMANCE.md +13 -0
  198. package/docs/README.md +1 -1
  199. package/docs/READ_OUTPUT_CONTRACTS.md +78 -0
  200. package/docs/RELEASING.md +17 -0
  201. package/docs/SDK.md +124 -9
  202. package/docs/SDK_CONTEXT_INTEGRITY.md +2 -0
  203. package/docs/agent-task-token-baseline.json +1 -1
  204. package/docs/generated/FLAG_LEXICON_BUDGETS.md +6 -6
  205. package/marketplace.json +1 -1
  206. package/package.json +2 -1
  207. package/packages/pm-beads/package.json +1 -1
  208. package/packages/pm-calendar/package.json +1 -1
  209. package/packages/pm-command-kit/package.json +1 -1
  210. package/packages/pm-digital-twin/package.json +1 -1
  211. package/packages/pm-governance-audit/package.json +1 -1
  212. package/packages/pm-guide-shell/package.json +1 -1
  213. package/packages/pm-kanban/package.json +1 -1
  214. package/packages/pm-lifecycle-hooks/package.json +1 -1
  215. package/packages/pm-linked-test-adapters/package.json +1 -1
  216. package/packages/pm-search-advanced/package.json +1 -1
  217. package/packages/pm-templates/package.json +1 -1
  218. package/packages/pm-todos/package.json +1 -1
  219. package/packages/pm-vcs/package.json +1 -1
  220. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  221. package/plugins/pm-claude/package.json +1 -1
  222. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  223. package/plugins/pm-codex/package.json +1 -1
  224. package/plugins/pm-codex/plugin.json +1 -1
  225. package/runtime-dependencies.json +1 -1
  226. package/dist/cli/after-command-context-usage.d.ts +0 -21
  227. package/dist/cli/argv-utils.d.ts +0 -12
  228. package/dist/cli/bootstrap-args.d.ts +0 -6
  229. package/dist/cli/bundle-integrity.d.ts +0 -49
  230. package/dist/cli/command-namespaces.d.ts +0 -9
  231. package/dist/cli/commander-usage.d.ts +0 -73
  232. package/dist/cli/commands/annotations/comments.d.ts +0 -2
  233. package/dist/cli/commands/annotations/docs.d.ts +0 -6
  234. package/dist/cli/commands/annotations/files.d.ts +0 -6
  235. package/dist/cli/commands/annotations/learnings.d.ts +0 -2
  236. package/dist/cli/commands/annotations/notes.d.ts +0 -2
  237. package/dist/cli/commands/extension/describe.d.ts +0 -2
  238. package/dist/cli/commands/extension/extension.d.ts +0 -6
  239. package/dist/cli/commands/extension/scaffold.d.ts +0 -2
  240. package/dist/cli/commands/extension/shared.d.ts +0 -2
  241. package/dist/cli/commands/governance/gc.d.ts +0 -6
  242. package/dist/cli/commands/governance/health.d.ts +0 -6
  243. package/dist/cli/commands/governance/telemetry.d.ts +0 -6
  244. package/dist/cli/commands/governance/validate.d.ts +0 -9
  245. package/dist/cli/commands/history/activity.d.ts +0 -6
  246. package/dist/cli/commands/history/history-compact.d.ts +0 -7
  247. package/dist/cli/commands/history/history-redact.d.ts +0 -8
  248. package/dist/cli/commands/history/history-repair.d.ts +0 -7
  249. package/dist/cli/commands/history/history.d.ts +0 -2
  250. package/dist/cli/commands/history/restore.d.ts +0 -6
  251. package/dist/cli/commands/lifecycle/append.d.ts +0 -6
  252. package/dist/cli/commands/lifecycle/claim.d.ts +0 -2
  253. package/dist/cli/commands/lifecycle/close-many.d.ts +0 -2
  254. package/dist/cli/commands/lifecycle/close.d.ts +0 -6
  255. package/dist/cli/commands/lifecycle/copy.d.ts +0 -6
  256. package/dist/cli/commands/lifecycle/create.d.ts +0 -10
  257. package/dist/cli/commands/lifecycle/delete.d.ts +0 -6
  258. package/dist/cli/commands/lifecycle/focus.d.ts +0 -6
  259. package/dist/cli/commands/lifecycle/plan.d.ts +0 -9
  260. package/dist/cli/commands/lifecycle/update-many.d.ts +0 -6
  261. package/dist/cli/commands/lifecycle/update.d.ts +0 -10
  262. package/dist/cli/commands/query/aggregate.d.ts +0 -2
  263. package/dist/cli/commands/query/context.d.ts +0 -6
  264. package/dist/cli/commands/query/deps.d.ts +0 -6
  265. package/dist/cli/commands/query/duplicates.d.ts +0 -6
  266. package/dist/cli/commands/query/eval.d.ts +0 -6
  267. package/dist/cli/commands/query/get.d.ts +0 -6
  268. package/dist/cli/commands/query/graph.d.ts +0 -7
  269. package/dist/cli/commands/query/list.d.ts +0 -6
  270. package/dist/cli/commands/query/next.d.ts +0 -6
  271. package/dist/cli/commands/query/search.d.ts +0 -6
  272. package/dist/cli/commands/query/stats.d.ts +0 -6
  273. package/dist/cli/commands/test/test-all.d.ts +0 -6
  274. package/dist/cli/commands/test/test-runs.d.ts +0 -6
  275. package/dist/cli/commands/test/test.d.ts +0 -6
  276. package/dist/cli/commands/workspace/config.d.ts +0 -6
  277. package/dist/cli/commands/workspace/contracts.d.ts +0 -2
  278. package/dist/cli/commands/workspace/init.d.ts +0 -6
  279. package/dist/cli/commands/workspace/merge.d.ts +0 -8
  280. package/dist/cli/commands/workspace/profile.d.ts +0 -6
  281. package/dist/cli/commands/workspace/schema.d.ts +0 -7
  282. package/dist/cli/commands/workspace/upgrade.d.ts +0 -2
  283. package/dist/cli/context-intent-invocation.d.ts +0 -2
  284. package/dist/cli/description-stdin.d.ts +0 -2
  285. package/dist/cli/error-guidance.d.ts +0 -276
  286. package/dist/cli/expected-revisions.d.ts +0 -55
  287. package/dist/cli/extension-command-help.d.ts +0 -137
  288. package/dist/cli/extension-command-options.d.ts +0 -37
  289. package/dist/cli/extension-command-options.js +0 -2
  290. package/dist/cli/extension-recovery.d.ts +0 -31
  291. package/dist/cli/help-content.d.ts +0 -57
  292. package/dist/cli/help-json-payload.d.ts +0 -83
  293. package/dist/cli/invocation-profile.d.ts +0 -26
  294. package/dist/cli/main.d.ts +0 -263
  295. package/dist/cli/migration-gates.d.ts +0 -55
  296. package/dist/cli/option-values.d.ts +0 -3
  297. package/dist/cli/preflight-warnings.d.ts +0 -11
  298. package/dist/cli/register-annotations.d.ts +0 -11
  299. package/dist/cli/register-assurance.d.ts +0 -8
  300. package/dist/cli/register-files-lookup.d.ts +0 -9
  301. package/dist/cli/register-history-activity.d.ts +0 -8
  302. package/dist/cli/register-history-author.d.ts +0 -8
  303. package/dist/cli/register-history-maintenance.d.ts +0 -9
  304. package/dist/cli/register-list-query.d.ts +0 -27
  305. package/dist/cli/register-mutation-options.d.ts +0 -10
  306. package/dist/cli/register-mutation.d.ts +0 -16
  307. package/dist/cli/register-operations.d.ts +0 -85
  308. package/dist/cli/register-setup.d.ts +0 -16
  309. package/dist/cli/register-structured-mutation.d.ts +0 -15
  310. package/dist/cli/registration-helpers.d.ts +0 -2
  311. package/dist/cli/runtime/activation.d.ts +0 -51
  312. package/dist/cli/runtime/field-route-retry.d.ts +0 -15
  313. package/dist/cli/runtime/invocation-options.d.ts +0 -43
  314. package/dist/cli/runtime/projection-retry.d.ts +0 -9
  315. package/dist/cli/runtime/selection.d.ts +0 -35
  316. package/dist/cli/runtime/telemetry-outcome.d.ts +0 -20
  317. package/dist/cli/runtime-compatibility-boundary.d.ts +0 -17
  318. package/dist/cli/schema/registration.d.ts +0 -4
  319. package/dist/cli/schema-registration-helpers.d.ts +0 -24
  320. package/dist/cli/search-refresh.d.ts +0 -2
  321. package/dist/cli/stats-analytics-json.d.ts +0 -9
  322. package/dist/cli/telemetry-flush.d.ts +0 -2
  323. package/dist/cli-bundle/chunks/chunk-5GWEY4P6.js +0 -122
  324. package/dist/cli-bundle/chunks/chunk-6VRX2CM7.js +0 -2
  325. package/dist/cli-bundle/chunks/chunk-7ZRCYESH.js +0 -116
  326. package/dist/cli-bundle/chunks/chunk-AUEKTX7V.js +0 -6
  327. package/dist/cli-bundle/chunks/chunk-FRNMQM45.js +0 -2
  328. package/dist/cli-bundle/chunks/chunk-HNGLDMSZ.js +0 -9
  329. package/dist/cli-bundle/chunks/chunk-QNWUIPBO.js +0 -31
  330. package/dist/cli-bundle/chunks/chunk-WC4M2H6R.js +0 -8
  331. package/dist/cli-bundle/chunks/chunk-YKXATU2G.js +0 -3
  332. package/dist/cli-bundle/chunks/item-revision-OJJVPQY7.js +0 -2
  333. package/dist/cli-bundle/chunks/item-transaction-TBKEATN6.js +0 -2
  334. package/dist/cli-bundle/chunks/register-mutation-MDSUU3G7.js +0 -20
  335. package/dist/cli-bundle/focused-chunks/chunk-2KTJY7BV.js +0 -44
  336. package/dist/cli-bundle/focused-chunks/chunk-4PW5XWVI.js +0 -2
  337. package/dist/cli-bundle/focused-chunks/chunk-C6P6HPCX.js +0 -2
  338. package/dist/cli-bundle/focused-chunks/chunk-CZM75DE3.js +0 -2
  339. package/dist/cli-bundle/focused-chunks/chunk-D2TBEBNW.js +0 -3
  340. package/dist/cli-bundle/focused-chunks/chunk-E56OXRYH.js +0 -2
  341. package/dist/cli-bundle/focused-chunks/chunk-G4QP365K.js +0 -2
  342. package/dist/cli-bundle/focused-chunks/chunk-G5PJCR7R.js +0 -2
  343. package/dist/cli-bundle/focused-chunks/chunk-GS3JC5UU.js +0 -23
  344. package/dist/cli-bundle/focused-chunks/chunk-LW64TINU.js +0 -3
  345. package/dist/cli-bundle/focused-chunks/chunk-M6V7UMWL.js +0 -26
  346. package/dist/cli-bundle/focused-chunks/chunk-MG7C3JUY.js +0 -2
  347. package/dist/cli-bundle/focused-chunks/chunk-MK4HV4JO.js +0 -2
  348. package/dist/cli-bundle/focused-chunks/chunk-O7EI33NP.js +0 -91
  349. package/dist/cli-bundle/focused-chunks/chunk-RFTJZ5VB.js +0 -2
  350. package/dist/cli-bundle/focused-chunks/chunk-SNOXXRSJ.js +0 -2
  351. package/dist/cli-bundle/focused-chunks/chunk-UPJUTP2V.js +0 -12
  352. package/dist/cli-bundle/focused-chunks/chunk-VWWTIX5L.js +0 -3
  353. package/dist/cli-bundle/focused-chunks/chunk-XHOBYCVE.js +0 -26
  354. package/dist/cli-bundle/focused-chunks/chunk-YMGB2O4E.js +0 -81
  355. package/dist/cli-bundle/focused-chunks/item-revision-CTDO4H3I.js +0 -2
  356. package/dist/cli-bundle/focused-chunks/item-transaction-H2XACBOP.js +0 -2
  357. package/dist/cli-bundle/focused-chunks/mutation-admission-4WM7TNHZ.js +0 -2
  358. package/dist/cli-bundle/focused-chunks/stage-WV7QXR4C.js +0 -2
  359. package/dist/cli.d.ts +0 -13
  360. package/dist/core/checkpoint/checkpoint-gc.d.ts +0 -61
  361. package/dist/core/checkpoint/mutation-context.d.ts +0 -10
  362. package/dist/core/diagnostics/remediation.d.ts +0 -52
  363. package/dist/core/extensions/activation-transaction.d.ts +0 -22
  364. package/dist/core/extensions/command-visibility-tier.d.ts +0 -8
  365. package/dist/core/extensions/exporter-output-contract.d.ts +0 -12
  366. package/dist/core/extensions/extension-candidate.d.ts +0 -26
  367. package/dist/core/extensions/extension-runtime-helpers.d.ts +0 -16
  368. package/dist/core/extensions/module-graph-snapshot.d.ts +0 -19
  369. package/dist/core/extensions/preflight-ownership.d.ts +0 -5
  370. package/dist/core/extensions/read-output-contract.d.ts +0 -5
  371. package/dist/core/extensions/reserved-host-flags.d.ts +0 -18
  372. package/dist/core/extensions/service-ownership.d.ts +0 -8
  373. package/dist/core/extensions/version-diagnostics.d.ts +0 -2
  374. package/dist/core/fs/atomic-create.d.ts +0 -7
  375. package/dist/core/fs/index.d.ts +0 -6
  376. package/dist/core/fs/path-utils.d.ts +0 -2
  377. package/dist/core/history/drift-cache.d.ts +0 -4
  378. package/dist/core/history/drift-scan.d.ts +0 -51
  379. package/dist/core/history/index.d.ts +0 -6
  380. package/dist/core/history/tombstone.d.ts +0 -3
  381. package/dist/core/history/version-address.d.ts +0 -13
  382. package/dist/core/item/index.d.ts +0 -9
  383. package/dist/core/item/item-type-definition.d.ts +0 -51
  384. package/dist/core/item/toon-decode.d.ts +0 -25
  385. package/dist/core/lock/index.d.ts +0 -6
  386. package/dist/core/lock/lock-confinement.d.ts +0 -55
  387. package/dist/core/lock/lock-gc.d.ts +0 -93
  388. package/dist/core/output/mutation-projection.d.ts +0 -13
  389. package/dist/core/output/query-summary.d.ts +0 -30
  390. package/dist/core/search/staleness.d.ts +0 -23
  391. package/dist/core/sentry/sensitive-assignments.d.ts +0 -9
  392. package/dist/core/shared/conflict-markers.d.ts +0 -18
  393. package/dist/core/shared/index.d.ts +0 -9
  394. package/dist/core/shared/memo.d.ts +0 -7
  395. package/dist/core/store/index.d.ts +0 -9
  396. package/dist/core/store/settings-concurrency.d.ts +0 -7
  397. package/dist/core/telemetry/read-sampling.d.ts +0 -8
  398. package/dist/core/test/item-test-run-tracking.d.ts +0 -12
  399. package/dist/core/validate/estimate-defaults.d.ts +0 -21
  400. package/dist/core/validate/linked-artifact-reference.d.ts +0 -20
  401. package/dist/mcp/http-server.d.ts +0 -60
  402. package/dist/mcp/legacy-adapter.d.ts +0 -59
  403. package/dist/mcp/runtime-capabilities.d.ts +0 -57
  404. package/dist/mcp/server.d.ts +0 -101
  405. package/dist/sdk/cli-contracts/bootstrap-command-scanner.d.ts +0 -23
  406. package/dist/sdk/cli-contracts/registration-helpers.d.ts +0 -123
  407. package/dist/sdk/cli-contracts/schemas/assurance-definition.d.ts +0 -796
  408. package/dist/sdk/cli-contracts/string-lists.d.ts +0 -9
  409. package/dist/sdk/cli-contracts/tool-parameter-tables.d.ts +0 -35
  410. package/dist/sdk/context/usage-egress.d.ts +0 -9
  411. package/dist/sdk/dependencies/context-budget-recovery.d.ts +0 -21
  412. package/dist/sdk/dependency-flag-validation.d.ts +0 -32
  413. package/dist/sdk/extension/author-manifest.d.ts +0 -22
  414. package/dist/sdk/extension/bundled-catalog.d.ts +0 -35
  415. package/dist/sdk/extension/concurrency.d.ts +0 -7
  416. package/dist/sdk/extension/copy-scope.d.ts +0 -2
  417. package/dist/sdk/extension/custom-field-collisions.d.ts +0 -6
  418. package/dist/sdk/extension/install-receipts.d.ts +0 -7
  419. package/dist/sdk/extension/install-snapshot.d.ts +0 -34
  420. package/dist/sdk/extension/managed-update-status.d.ts +0 -3
  421. package/dist/sdk/extension/runtime-summary.d.ts +0 -9
  422. package/dist/sdk/extension/scaffold.d.ts +0 -38
  423. package/dist/sdk/generated/error-code-catalog-rows.d.ts +0 -39
  424. package/dist/sdk/generated/generated-error-code-catalog-part-1.d.ts +0 -8
  425. package/dist/sdk/generated/generated-error-code-catalog-part-2.d.ts +0 -8
  426. package/dist/sdk/governance/assurance-limits.d.ts +0 -7
  427. package/dist/sdk/governance/defect-recurrence-signals.d.ts +0 -10
  428. package/dist/sdk/governance/health-merge-evidence.d.ts +0 -23
  429. package/dist/sdk/governance/tracked-runtime-cache.d.ts +0 -24
  430. package/dist/sdk/governance/validate-history-drift.d.ts +0 -7
  431. package/dist/sdk/history/attestation-scan.d.ts +0 -16
  432. package/dist/sdk/history-mcp.d.ts +0 -17
  433. package/dist/sdk/lifecycle/checkpoint-rollback.d.ts +0 -15
  434. package/dist/sdk/lifecycle/core-field-recovery.d.ts +0 -33
  435. package/dist/sdk/lifecycle/core-item-fields.d.ts +0 -6
  436. package/dist/sdk/lifecycle/event-validation-messages.d.ts +0 -6
  437. package/dist/sdk/lifecycle/hierarchy-mutation-lock.d.ts +0 -15
  438. package/dist/sdk/lifecycle/legacy-none-tokens.d.ts +0 -71
  439. package/dist/sdk/lifecycle/mcp-actions.d.ts +0 -24
  440. package/dist/sdk/lifecycle/metadata-normalizers.d.ts +0 -8
  441. package/dist/sdk/lifecycle/mutation-facet-contracts.d.ts +0 -6
  442. package/dist/sdk/lifecycle/mutation-option-validation.d.ts +0 -2
  443. package/dist/sdk/lifecycle/recurrence-parsers.d.ts +0 -34
  444. package/dist/sdk/lifecycle/release-handoff.d.ts +0 -12
  445. package/dist/sdk/lifecycle/repeatable-metadata-parsers.d.ts +0 -18
  446. package/dist/sdk/lifecycle/repeated-terminal-state.d.ts +0 -45
  447. package/dist/sdk/merge/abandoned-receipts.d.ts +0 -15
  448. package/dist/sdk/merge/history-scalar-rebase.d.ts +0 -9
  449. package/dist/sdk/merge/ignored-artifacts.d.ts +0 -13
  450. package/dist/sdk/merge/indexed-receipt-blobs.d.ts +0 -4
  451. package/dist/sdk/merge/receipt-file-boundary.d.ts +0 -23
  452. package/dist/sdk/merge/settlement-hook.d.ts +0 -12
  453. package/dist/sdk/merge/stage.d.ts +0 -13
  454. package/dist/sdk/merge/worktree-config.d.ts +0 -11
  455. package/dist/sdk/query/light-metadata.d.ts +0 -3
  456. package/dist/sdk/query/window-pagination.d.ts +0 -20
  457. package/dist/sdk/read-output/extension.d.ts +0 -7
  458. package/dist/sdk/read-output/provenance.d.ts +0 -20
  459. package/dist/sdk/read-output/surfaces.d.ts +0 -27
  460. package/dist/sdk/runtime/actions.d.ts +0 -4
  461. package/dist/sdk/runtime/mutation-admission.d.ts +0 -2
  462. package/dist/sdk/runtime/mutation-value-validation.d.ts +0 -16
  463. package/dist/sdk/runtime/schema.d.ts +0 -4
  464. package/dist/sdk/runtime-action-aliases.d.ts +0 -7
  465. package/dist/sdk/runtime-extended-actions.d.ts +0 -27
  466. package/dist/sdk/runtime-stats-options.d.ts +0 -9
  467. package/dist/sdk/test/command-args.d.ts +0 -4
  468. package/dist/sdk/test/command-resolution.d.ts +0 -5
  469. package/dist/sdk/test/entry.d.ts +0 -18
  470. package/dist/sdk/test/execution-receipts.d.ts +0 -34
  471. package/dist/sdk/test/receipt-index-snapshot.d.ts +0 -2
  472. package/dist/sdk/test/workspace-snapshot.d.ts +0 -11
  473. package/dist/sdk/traceability/runtime-files-lookup.d.ts +0 -8
  474. package/docs/generated/REFUSAL_CLOSURE_CENSUS.md +0 -472
@@ -1,276 +0,0 @@
1
- import { type PmCliErrorDetails,type PmCliErrorDetailsOmission } from "../sdk/errors.js";
2
- import { type PmCliErrorContext,type PmCliErrorRecoveryPayload } from "../sdk/runtime-primitives.js";
3
- import { type PmDiagnosticOutputReceipt,type PmProjectedDiagnostic } from "../sdk/cli-contracts/agent-output-contracts.js";
4
- interface GuidanceMessage {
5
- sideEffects?:PmCliErrorContext["side_effects"];
6
- changed?:false;
7
- policyViolations?:PmCliErrorContext["policy_violations"];
8
- policyViolationCount?:number;
9
- itemId?:string;
10
- transactionOperation?:PmCliErrorContext["transaction_operation"];
11
- /** Bounded tracker-relative preview refusal coordinate. */
12
- previewStorage?:PmCliErrorContext["preview_storage"];
13
- tombstone?:PmCliErrorContext["tombstone"];
14
- /** Lease a refused lock_lost commit held. */
15
- lease?:PmCliErrorContext["lease"];
16
- /** Lock generation observed at a refused lock_lost commit. */
17
- currentOwner?:PmCliErrorContext["current_owner"];
18
- /** Principal holding the item behind an already_claimed_by refusal. */
19
- claimedBy?:string;
20
- /** When that holder took the item; null when history was silent. */
21
- claimedAt?:string | null;
22
- /** Whether the holder arrived through a claim or an assignment. */
23
- claimSource?:PmCliErrorContext["claim_source"];
24
- /** Revision a refused compare-and-set write expected. */
25
- expectedRevision?:PmCliErrorContext["expected_revision"];
26
- /** Revision a refused compare-and-set write found. */
27
- currentRevision?:PmCliErrorContext["current_revision"];
28
- code:string;
29
- type:string;
30
- title:string;
31
- happened:string;
32
- required:string;
33
- why?:string;
34
- examples?:string[];
35
- nextSteps?:string[];
36
- verificationErrors?:string[];
37
- flag?:string;
38
- value?:string;
39
- unmatchedSelectors?:NonNullable<PmCliErrorContext["unmatched_selectors"]>;
40
- availableDependencies?:NonNullable<PmCliErrorContext["available_dependencies"]>;
41
- recovery?:PmCliErrorRecoveryPayload;
42
- /** Producer-owned diagnostics admitted within the declared ceiling. */
43
- details?:PmCliErrorDetails;
44
- /** Receipt replacing producer diagnostics that could not be rendered. */
45
- detailsOmitted?:PmCliErrorDetailsOmission;
46
- }
47
- /** Compact refusal identity embedded in every structured error envelope. */
48
- export interface PmRefusalEnvelope {
49
- /** Command, flag, or missing operand that rejected the invocation. */
50
- surface:string;
51
- /** Supplied scalar rejected by a closed domain, when available. */
52
- rejected_value?:string;
53
- /** Complete legal domain advertised by the refusal, when applicable. */
54
- legal_domain?:string[];
55
- /** Required metadata paths from the displayed policy violations. */
56
- missing_fields?:string[];
57
- /** Policy identity, rule, rationale and missing fields, capped at three policies. */
58
- policies?:PmCliErrorContext["policy_violations"];
59
- /** Total violated policies, including any omitted from policies. */
60
- policy_violation_count?:number;
61
- /** Process exit code paired with the refusal. */
62
- exit_code:number;
63
- }
64
- /** Structured preflight advisories retained alongside a machine-readable outcome. */
65
- export interface PreflightWarningDiagnostics {
66
- /** Stable advisory codes emitted before command execution. */
67
- warnings?:string[];
68
- /** Additional actionable guidance that accompanies an advisory code. */
69
- warning_details?:Array<{
70
- /** Stable code identifying the advisory. */
71
- code:string;
72
- /** Human-readable remediation retained for this code. */
73
- message:string;
74
- }>;
75
- }
76
- /** Structured refusal fields shared by the JSON envelope and the error classification. */
77
- export interface StructuredRefusalDiagnostics {
78
- /** Completed durable writes, with paths relative to the selected tracker. */
79
- side_effects?:PmCliErrorContext["side_effects"];
80
- /** Verified admission refusal before any mutation. */
81
- changed?:false;
82
- /** Ordered mutation that failed semantic preview validation. */
83
- transaction_operation?:PmCliErrorContext["transaction_operation"];
84
- /** Bounded tracker-relative preview refusal coordinate. */
85
- preview_storage?:PmCliErrorContext["preview_storage"];
86
- /** Exact item identity attached to a storage diagnostic. */
87
- item_id?:string;
88
- /** Verified retained deletion and its recoverable version. */
89
- tombstone?:PmCliErrorContext["tombstone"];
90
- /** Lease a refused lock_lost commit held. */
91
- lease?:PmCliErrorContext["lease"];
92
- /** Lock generation observed at a refused lock_lost commit, or null when none exists. */
93
- current_owner?:PmCliErrorContext["current_owner"];
94
- /** Principal holding the item behind an already_claimed_by refusal. */
95
- claimed_by?:string;
96
- /** When that holder took the item, or null when history was silent. */
97
- claimed_at?:string | null;
98
- /** Whether the holder arrived through an explicit claim or a metadata assignment. */
99
- claim_source?:PmCliErrorContext["claim_source"];
100
- /** Revision a refused compare-and-set write expected, or null when it required absence. */
101
- expected_revision?:PmCliErrorContext["expected_revision"];
102
- /** Revision a refused compare-and-set write found, or null when the target was absent. */
103
- current_revision?:PmCliErrorContext["current_revision"];
104
- /** Schema type that determines the shape and validation rules for this value. */
105
- type:string;
106
- /** Value that configures or reports code for this contract. */
107
- code:string;
108
- /** Value that configures or reports title for this contract. */
109
- title:string;
110
- /** Value that configures or reports detail for this contract. */
111
- detail:string;
112
- /** Value that configures or reports required for this contract. */
113
- required:string;
114
- }
115
- /** Documents the json error envelope payload exchanged by command, SDK, and package integrations. */
116
- export interface JsonErrorEnvelope extends PreflightWarningDiagnostics,StructuredRefusalDiagnostics {
117
- /** Value that configures or reports exit code for this contract. */
118
- exit_code:number;
119
- /** Value that configures or reports why for this contract. */
120
- why?:string;
121
- /** Value that configures or reports examples for this contract. */
122
- examples?:string[];
123
- /** Value that configures or reports next steps for this contract. */
124
- next_steps?:string[];
125
- /** Exact integrity verifier findings that caused the operation to refuse. */
126
- verification_errors?:string[];
127
- /** CLI flag whose supplied value violated a shared mutation grammar. */
128
- flag?:string;
129
- /** Supplied scalar value that violated a shared mutation grammar. */
130
- value?:string;
131
- /** Dependency selectors that matched no stored edge. */
132
- unmatched_selectors?:NonNullable<PmCliErrorContext["unmatched_selectors"]>;
133
- /** Compact stored dependency identities available when a removal failed. */
134
- available_dependencies?:NonNullable<PmCliErrorContext["available_dependencies"]>;
135
- /** Value that configures or reports recovery for this contract. */
136
- recovery?:PmCliErrorRecoveryPayload;
137
- /** Producer-owned structured diagnostics, rendered whole within their byte ceiling (GH-1631). */
138
- details?:PmCliErrorDetails;
139
- /** Receipt that replaces producer diagnostics the host could not render. */
140
- details_omitted?:PmCliErrorDetailsOmission;
141
- /** Stable compact identity of the failing surface and legal recovery domain. */
142
- refusal:PmRefusalEnvelope;
143
- /** Binding output-budget receipt for this diagnostic. */
144
- diagnostic_output?:PmDiagnosticOutputReceipt;
145
- }
146
- /** Error envelope after deterministic budget projection. */
147
- export type ProjectedJsonErrorEnvelope = PmProjectedDiagnostic<JsonErrorEnvelope>;
148
- /**
149
- * Compact an error envelope to fields that change the caller's next action:
150
- * the duplicated title, generic `required`/`why`/examples and the invocation
151
- * echo go; code-specific rationale, examples, recovery and typed holder
152
- * evidence stay (GH-1610).
153
- */
154
- export declare function projectLeanErrorEnvelope(envelope:ProjectedJsonErrorEnvelope):ProjectedJsonErrorEnvelope;
155
- /** Documents the error classification payload exchanged by command, SDK, and package integrations. */
156
- export interface ErrorClassification extends StructuredRefusalDiagnostics {
157
- /** Value that configures or reports why for this contract. */
158
- why?:string;
159
- /** Value that configures or reports examples for this contract. */
160
- examples?:string[];
161
- /** Value that configures or reports next steps for this contract. */
162
- next_steps?:string[];
163
- /** Exact integrity verifier findings that caused the operation to refuse. */
164
- verification_errors?:string[];
165
- /** CLI flag whose supplied value violated a shared mutation grammar. */
166
- flag?:string;
167
- /** Supplied scalar value that violated a shared mutation grammar. */
168
- value?:string;
169
- /** Dependency selectors that matched no stored edge. */
170
- unmatched_selectors?:NonNullable<PmCliErrorContext["unmatched_selectors"]>;
171
- /** Compact stored dependency identities available when a removal failed. */
172
- available_dependencies?:NonNullable<PmCliErrorContext["available_dependencies"]>;
173
- /** Value that configures or reports recovery for this contract. */
174
- recovery?:PmCliErrorRecoveryPayload;
175
- }
176
- /** Documents the commander guidance context payload exchanged by command, SDK, and package integrations. */
177
- export interface CommanderGuidanceContext {
178
- /** Value that configures or reports unknown command examples for this contract. */
179
- unknownCommandExamples?:string[];
180
- /** Value that configures or reports unknown command next steps for this contract. */
181
- unknownCommandNextSteps?:string[];
182
- /** Value that configures or reports attempted command for this contract. */
183
- attemptedCommand?:string;
184
- /** Value that configures or reports normalized invocation args for this contract. */
185
- normalizedInvocationArgs?:string[];
186
- /** Value that configures or reports provided option flags for this contract. */
187
- providedOptionFlags?:string[];
188
- /** Value that configures or reports unknown option suggestions for this contract. */
189
- unknownOptionSuggestions?:string[];
190
- /** Value that configures or reports unknown option other commands for this contract. */
191
- unknownOptionOtherCommands?:string[];
192
- /** Complete number of commands accepting the unknown option. */
193
- unknownOptionOtherCommandsTotal?:number;
194
- /** Whether the structured command candidates reached their own ceiling. */
195
- unknownOptionOtherCommandsTruncated?:boolean;
196
- /** Declared lexicon membership of the rejected option spelling. */
197
- unknownOptionScope?:PmCliErrorRecoveryPayload["option_scope"];
198
- /** Command family whose positional subcommand was split into invalid tokens. */
199
- unknownSubcommandPath?:string;
200
- /** Rejected positional subcommand token or token sequence. */
201
- unknownSubcommandToken?:string;
202
- /** Complete declared subcommand vocabulary for the command family. */
203
- unknownSubcommandAllowedValues?:string[];
204
- /** Value that configures or reports suggested retry command for this contract. */
205
- suggestedRetryCommand?:string;
206
- /** Tokenized inspection retry that preserves a refusal without executing the guessed operation. */
207
- suggestedRetryArgs?:string[];
208
- /** Existing item id verified against the selected tracker for collection recovery. */
209
- verifiedCollectionItemId?:string;
210
- /** Installed extensions whose activation failed for this invocation. */
211
- failedExtensions?:Array<{
212
- name:string;
213
- }>;
214
- }
215
- interface PackageCommandHint {
216
- /** Published package name shown to the user (e.g. @unbrained/pm-guide-shell). */
217
- packageName:string;
218
- /** Exact CLI command that installs the bundled package by its install alias. */
219
- installCommand:string;
220
- }
221
- declare function resolveKnownPackageCommandHint(commandToken:string):PackageCommandHint | undefined;
222
- declare function renderList(title:string,entries:string[]):string[];
223
- /** Whitelist valid recovery fields before exposing them in public CLI diagnostics. */
224
- declare function normalizeRecoveryPayload(payload:PmCliErrorRecoveryPayload | undefined):PmCliErrorRecoveryPayload | undefined;
225
- /** Presentation controls for text refusals. */
226
- export interface RenderGuidanceOptions {
227
- /** Omit constant boilerplate and the invocation echo; keep code-specific recovery (GH-1610). */
228
- lean?:boolean;
229
- }
230
- /** Implements render guidance message for the public runtime surface of this module. */
231
- export declare function renderGuidanceMessage(message:GuidanceMessage,options?:RenderGuidanceOptions):string;
232
- /** Project guidance into JSON, preserving no-write evidence only when explicitly verified. */
233
- declare function guidanceToJsonEnvelope(message:GuidanceMessage,exitCode:number):JsonErrorEnvelope;
234
- /** Classify guidance with the same optional refusal evidence as the JSON envelope. */
235
- declare function guidanceToClassification(message:GuidanceMessage):ErrorClassification;
236
- declare function dedupeStrings(values:string[]):string[];
237
- declare function buildFallbackTitleFromMessage(message:string):string | undefined;
238
- /** Merge SDK error evidence with CLI fallback guidance without discarding typed recovery or policy diagnostics. */
239
- /** Merge typed SDK context into guidance without inferring mutation outcomes. */
240
- declare function applyPmCliErrorContext(guidance:GuidanceMessage,rawMessage:string,context:PmCliErrorContext | undefined):GuidanceMessage;
241
- declare function commandExampleForRequiredOption(commandName:string | undefined,optionFlag:string,allowedTypes:string):string[];
242
- declare function buildCommanderRecoveryPayload(context:CommanderGuidanceContext | undefined,overrides?:Partial<PmCliErrorRecoveryPayload>):PmCliErrorRecoveryPayload | undefined;
243
- declare function appendIfMissing(entries:string[],value:string | undefined):string[];
244
- /** Synthesize a copy-pasteable retry for the unquoted linked-test value shape `pm test <id> --add command npm test -- parser` by re-joining the shell-split value tokens into the documented quoted `key=value` form. Only fires when the item id already precedes the flag (so trailing tokens unambiguously belong to the value) and the token after `--add`/`--remove` is an entry-identity key. */
245
- export declare function buildLinkedTestQuotedRetryCommand(argv:string[] | undefined):string | undefined;
246
- /** Render concise initialization recovery or the bounded diagnostic for other failures. */
247
- export declare function formatPmCliErrorForDisplay(rawMessage:string,context?:PmCliErrorContext,options?:RenderGuidanceOptions):string;
248
- /** Implements classify pm cli error for the public runtime surface of this module. */
249
- export declare function classifyPmCliError(rawMessage:string,context?:PmCliErrorContext):ErrorClassification;
250
- /** Implements format pm cli error for json for the public runtime surface of this module. */
251
- export declare function formatPmCliErrorForJson(rawMessage:string,exitCode:number,context?:PmCliErrorContext):ProjectedJsonErrorEnvelope;
252
- /** Implements format commander error for display for the public runtime surface of this module. */
253
- export declare function formatCommanderErrorForDisplay(rawMessage:string,commandName:string | undefined,allowedTypes:string,context?:CommanderGuidanceContext,options?:RenderGuidanceOptions):string;
254
- /** Implements classify commander error for the public runtime surface of this module. */
255
- export declare function classifyCommanderError(rawMessage:string,commandName:string | undefined,allowedTypes:string,context?:CommanderGuidanceContext):ErrorClassification;
256
- /** Implements format commander error for json for the public runtime surface of this module. */
257
- export declare function formatCommanderErrorForJson(rawMessage:string,commandName:string | undefined,allowedTypes:string,exitCode:number,context?:CommanderGuidanceContext):ProjectedJsonErrorEnvelope;
258
- /** Implements format unknown error for json for the public runtime surface of this module. */
259
- export declare function formatUnknownErrorForJson(rawMessage:string,exitCode:number):ProjectedJsonErrorEnvelope;
260
- /** Implements classify unknown error for the public runtime surface of this module. */
261
- export declare function classifyUnknownError(rawMessage:string):ErrorClassification;
262
- /** Public contract for test only, shared by SDK and presentation-layer consumers. */
263
- export declare const _testOnly:{
264
- applyPmCliErrorContext:typeof applyPmCliErrorContext;
265
- appendIfMissing:typeof appendIfMissing;
266
- buildCommanderRecoveryPayload:typeof buildCommanderRecoveryPayload;
267
- buildFallbackTitleFromMessage:typeof buildFallbackTitleFromMessage;
268
- commandExampleForRequiredOption:typeof commandExampleForRequiredOption;
269
- dedupeStrings:typeof dedupeStrings;
270
- guidanceToClassification:typeof guidanceToClassification;
271
- guidanceToJsonEnvelope:typeof guidanceToJsonEnvelope;
272
- normalizeRecoveryPayload:typeof normalizeRecoveryPayload;
273
- renderList:typeof renderList;
274
- resolveKnownPackageCommandHint:typeof resolveKnownPackageCommandHint;
275
- };
276
- export {};
@@ -1,55 +0,0 @@
1
- import type { Command } from "commander";
2
- import { type ItemRevisionScope } from "../sdk/lifecycle/item-revision.js";
3
- /** One view of the invocation an extension parser or preflight override produced. */
4
- export interface InvocationStage {
5
- /** Command positionals as this stage sees them. */
6
- args:readonly string[];
7
- /** Tracker path option as this stage sees it (undefined for the default tracker). */
8
- path:string | undefined;
9
- }
10
- /**
11
- * Whether extension overrides rewrote the invocation's tracker or arguments.
12
- * Final dispatch, the injected extension SDK client and the preAction hook do
13
- * not all see the same rewritten view, so a guard cannot prove which item a
14
- * rewritten invocation writes.
15
- */
16
- export declare function invocationRewritten(initial:InvocationStage,stages:readonly InvocationStage[]):boolean;
17
- /**
18
- * Bind `--expect-hash` tokens to canonical item ids before the command runs.
19
- * Tokens without an enclosing invocation scope (a command dispatched outside
20
- * {@link parseWithInvocationRevisionScope}) are refused rather than dropped.
21
- */
22
- export declare function bindInvocationExpectedRevisions(params:{
23
- command:Command;
24
- commandPath:string;
25
- commandArgs:readonly string[];
26
- expectHash:readonly string[] | undefined;
27
- pmRoot:string;
28
- /** Parsed command options, consulted for modes the guard cannot cover. */
29
- commandOptions?:Record<string,unknown>;
30
- /** Whether an extension parser or preflight override rewrote the tracker or arguments. */
31
- rewritten?:boolean;
32
- }):Promise<void>;
33
- /**
34
- * Refuse when a final-dispatch parser pass rewrites a guarded invocation. Commander
35
- * dispatch reruns extension parsers after preAction bound the guard to the typed
36
- * view, so each pass must keep that view's tracker and arguments, and the options
37
- * it dispatches with must stay admissible (no `--background` added late).
38
- */
39
- export declare function assertGuardedDispatchUnchanged(input:InvocationStage,output:InvocationStage,options:Record<string,unknown>):void;
40
- /**
41
- * Inventory commands dispatch without lifecycle hooks and never write items, so a
42
- * guard on them is validated and refused instead of silently dropped.
43
- */
44
- export declare function refuseInventoryExpectHash(commandPath:string,expectHash:readonly string[] | undefined):void;
45
- /** Warn about each expectation whose item no locked write reached. */
46
- export declare function reportInvocationRevisionScope(scope:ItemRevisionScope):void;
47
- /** Attach bounded change evidence to a revision refusal raised by this invocation. */
48
- export declare function enrichInvocationRevisionError(scope:ItemRevisionScope,error:unknown):Promise<unknown>;
49
- /**
50
- * Run one invocation's parse inside a fresh expected-revision scope: `run`
51
- * receives a wrapper for the innermost parse call, so the scope sits inside any
52
- * caller-owned async contexts. Refusals gain change evidence; a successful
53
- * parse reports expectations no write reached.
54
- */
55
- export declare function parseWithInvocationRevisionScope(run:(parse:<T>(operation:() => Promise<T>) => Promise<T>) => Promise<unknown>):Promise<void>;
@@ -1,137 +0,0 @@
1
- /**
2
- * @module cli/extension-command-help
3
- *
4
- * Provides CLI runtime support for Extension Command Help.
5
- */
6
- import { Command } from "commander";
7
- import { type FlagDefinition,type RegisteredExtensionCommandDefinition,type RegisteredExtensionFlagDefinitions } from "../sdk/runtime-primitives.js";
8
- import type { PmCommandCapabilityFamily,PmCommandVisibilityTier } from "../sdk/agent-capability-contracts.js";
9
- /** Documents the extension command argument help descriptor payload exchanged by command, SDK, and package integrations. */
10
- export interface ExtensionCommandArgumentHelpDescriptor {
11
- /** Value that configures or reports name for this contract. */
12
- name:string;
13
- /** Value that configures or reports required for this contract. */
14
- required:boolean;
15
- /** Value that configures or reports variadic for this contract. */
16
- variadic:boolean;
17
- /** Value that configures or reports description for this contract. */
18
- description?:string;
19
- }
20
- /** Documents the extension command help descriptor payload exchanged by command, SDK, and package integrations. */
21
- export interface ExtensionCommandHelpDescriptor {
22
- /** Value that configures or reports command for this contract. */
23
- command:string;
24
- /** Value that configures or reports action for this contract. */
25
- action:string;
26
- /** Value that configures or reports description for this contract. */
27
- description?:string;
28
- /** Value that configures or reports intent for this contract. */
29
- intent?:string;
30
- /** Value that configures or reports examples for this contract. */
31
- examples:string[];
32
- /** Value that configures or reports failure hints for this contract. */
33
- failure_hints:string[];
34
- /** Value that configures or reports arguments for this contract. */
35
- arguments:ExtensionCommandArgumentHelpDescriptor[];
36
- /** Value that configures or reports flags for this contract. */
37
- flags:FlagDefinition[];
38
- /** Minimum agent surface tier declared by the package. */
39
- tier:PmCommandVisibilityTier;
40
- /** Capability family declared by the package. */
41
- family:PmCommandCapabilityFamily;
42
- /** Value that configures or reports source for this contract. */
43
- source?:{
44
- layer:"global" | "project";
45
- name:string;
46
- package?:string;
47
- version?:string;
48
- };
49
- }
50
- /** Documents the help option summary payload exchanged by command, SDK, and package integrations. */
51
- export interface HelpOptionSummary {
52
- /** Value that configures or reports flags for this contract. */
53
- flags:string;
54
- /** Value that configures or reports long for this contract. */
55
- long:string | null;
56
- /** Value that configures or reports short for this contract. */
57
- short:string | null;
58
- /** Value that configures or reports description for this contract. */
59
- description:string;
60
- /** Value that configures or reports takes value for this contract. */
61
- takes_value:boolean;
62
- /** Value that configures or reports value required for this contract. */
63
- value_required:boolean;
64
- /** Value that configures or reports value name for this contract. */
65
- value_name:string | null;
66
- /** Value that configures or reports variadic for this contract. */
67
- variadic:boolean;
68
- /** Value that configures or reports required for this contract. */
69
- required:boolean;
70
- /** Value that configures or reports aliases for this contract. */
71
- aliases:string[];
72
- /** Value that configures or reports alias for for this contract. */
73
- alias_for:string | null;
74
- /** Fallback value used when callers do not provide an override. */
75
- default_value?:unknown;
76
- }
77
- /** Implements normalize extension command path for the public runtime surface of this module. */
78
- export declare function normalizeExtensionCommandPath(commandPath:string):string;
79
- /** Build verified flattened-alias mappings within one extension and layer. */
80
- export declare function buildCanonicalExtensionAliases(handlers:ReadonlyArray<{
81
- command:string;
82
- layer:"project" | "global";
83
- name:string;
84
- }>,definitions:ReadonlyArray<{
85
- command:string;
86
- layer:"project" | "global";
87
- name:string;
88
- }>):Map<string,string>;
89
- /** Resolve whether a registered extension flag consumes a value. */
90
- export declare function extensionFlagTakesValueForInvocation(invocationArgv:string[],commandName:string | undefined,normalizedMissing:string | undefined,descriptors:ReadonlyMap<string,ExtensionCommandHelpDescriptor>):boolean | undefined;
91
- /** Canonical value-arity contract shared by extension invocation recovery, Commander parsing, and structured help. */
92
- export declare function resolveExtensionFlagArity(definition:Readonly<FlagDefinition>):{
93
- takesValue:boolean;
94
- valueName:string | null;
95
- };
96
- /** Implements collect dynamic extension flag help by command for the public runtime surface of this module. */
97
- export declare function collectDynamicExtensionFlagHelpByCommand(registrations:RegisteredExtensionFlagDefinitions[]):Map<string,string>;
98
- /** Implements collect extension command help descriptors for the public runtime surface of this module. */
99
- export declare function collectExtensionCommandHelpDescriptors(commandHandlers:string[],commandDefinitions:RegisteredExtensionCommandDefinition[],flagRegistrations:RegisteredExtensionFlagDefinitions[],canonicalAliases?:ReadonlyMap<string,string>):Map<string,ExtensionCommandHelpDescriptor>;
100
- /** Implements apply dynamic extension arguments for the public runtime surface of this module. */
101
- export declare function applyDynamicExtensionArguments(command:Command,descriptor:ExtensionCommandHelpDescriptor):void;
102
- /** Implements apply dynamic extension flag options for the public runtime surface of this module. */
103
- export declare function applyDynamicExtensionFlagOptions(command:Command,definitions:FlagDefinition[]):void;
104
- /**
105
- * Builds the "Extension-provided flags" help block for only the definitions that
106
- * are NOT already rendered as real commander options on {@link command}. After
107
- * {@link applyDynamicExtensionFlagOptions} registers extension flags as first
108
- * class options, repeating them verbatim in an after-text block duplicated every
109
- * flag in `--help` output; this filters those already-listed flags out so the
110
- * block is emitted only when it carries flags the Options section does not.
111
- */
112
- export declare function buildResidualDynamicExtensionFlagHelp(command:Command,definitions:FlagDefinition[]):string | null;
113
- /** Implements build dynamic extension help option summaries for the public runtime surface of this module. */
114
- export declare function buildDynamicExtensionHelpOptionSummaries(descriptor:ExtensionCommandHelpDescriptor | undefined):HelpOptionSummary[];
115
- /** Implements merge help option summaries for the public runtime surface of this module. */
116
- export declare function mergeHelpOptionSummaries(base:HelpOptionSummary[],extension:HelpOptionSummary[]):HelpOptionSummary[];
117
- /** Implements build dynamic extension command metadata help for the public runtime surface of this module. */
118
- export declare function buildDynamicExtensionCommandMetadataHelp(descriptor:ExtensionCommandHelpDescriptor):string | null;
119
- /** Implements command aliases for the public runtime surface of this module. */
120
- export declare function commandAliases(command:Command):string[];
121
- /** Implements find direct child command for the public runtime surface of this module. */
122
- export declare function findDirectChildCommand(parent:Command,name:string):Command | null;
123
- /** Implements find command by path for the public runtime surface of this module. */
124
- export declare function findCommandByPath(root:Command,pathParts:string[]):Command | null;
125
- /** Implements ensure command path for the public runtime surface of this module. */
126
- export declare function ensureCommandPath(root:Command,pathParts:string[]):Command | null;
127
- /** Locate core leaves that a path would replace or extend; existing groups can host unique extension leaves. */
128
- export declare function findExtensionCommandPathCollision(root:Command,pathParts:string[]):{
129
- core_path:string;
130
- extension_path:string;
131
- } | null;
132
- /** Build an ownership-rich warning when an extension alias would shadow or graft beneath a core command. */
133
- export declare function buildExtensionCommandCollisionWarning(root:Command,commandPath:string,aliases:ReadonlyMap<string,string>,descriptor:ExtensionCommandHelpDescriptor | undefined,hasHandler?:boolean):string | null;
134
- /** Collect deterministic extension command paths while reporting and excluding aliases that collide with core ownership. */
135
- export declare function collectSafeExtensionCommandPaths(root:Command,commandHandlers:readonly string[],descriptors:ReadonlyMap<string,ExtensionCommandHelpDescriptor>,aliases:ReadonlyMap<string,string>,onCollision:(warning:string) => void):string[];
136
- /** Record and surface one extension collision with stable recovery guidance. */
137
- export declare function reportExtensionCommandCollision(activationWarnings:string[],report:(message:string) => void,warning:string):void;
@@ -1,37 +0,0 @@
1
- /** Flag metadata consumed by loose-option parsing across core and extension commands. */
2
- export interface LooseCommandFlagDefinition {
3
- /** Canonical long option token. */
4
- long?:string;
5
- /** Optional short option token. */
6
- short?:string;
7
- /** Backward-compatible aliases emitted by core command contracts. */
8
- aliases?:string[];
9
- /** Canonical runtime value kind. */
10
- value_type?:string;
11
- /** Backward-compatible runtime value kind alias. */
12
- type?:string;
13
- /** Whether the option can be supplied to the command. */
14
- enabled?:boolean;
15
- /** Whether callers must provide the option. */
16
- required?:boolean;
17
- /** Whether repeated or comma-delimited values accumulate. */
18
- list?:boolean;
19
- /** Whether repeated occurrences accumulate without splitting commas. */
20
- repeatable?:boolean;
21
- /** Value used when callers omit the option. */
22
- default?:unknown;
23
- /** `strict` refuses malformed number/boolean tokens before dispatch; `coerce` (default) forwards them. */
24
- value_validation?:string;
25
- }
26
- /** Implements collect loose command option keys for definitions for the public runtime surface of this module. */
27
- export declare function collectLooseCommandOptionKeysForDefinitions(definitions:ReadonlyArray<LooseCommandFlagDefinition>):Set<string>;
28
- /** Implements validate loose command options with flag definitions for the public runtime surface of this module. */
29
- export declare function validateLooseCommandOptionsWithFlagDefinitions(options:Record<string,unknown>,definitions:ReadonlyArray<LooseCommandFlagDefinition>,commandPath:string):void;
30
- /** Implements coerce loose command options with flag definitions for the public runtime surface of this module. */
31
- export declare function coerceLooseCommandOptionsWithFlagDefinitions(options:Record<string,unknown>,definitions:ReadonlyArray<LooseCommandFlagDefinition>,occurrenceSource?:Record<string,unknown>,commandPath?:string):Record<string,unknown>;
32
- /** Implements parse loose command options for the public runtime surface of this module. */
33
- export declare function parseLooseCommandOptions(args:string[]):Record<string,unknown>;
34
- /** Returns the positional operands in `args`, skipping option tokens and the values they consume (`--flag value`, `--flag=value`, `-f value`, and boolean flags). Tokens after a bare `--` separator are all positional. Used to count genuinely unexpected positionals for extension commands that declare no arguments without miscounting leaked/undeclared option tokens as operands. */
35
- export declare function collectLoosePositionalArgs(args:string[]):string[];
36
- /** Implements strip loose command option tokens for the public runtime surface of this module. */
37
- export declare function stripLooseCommandOptionTokens(args:string[],definitions:ReadonlyArray<LooseCommandFlagDefinition>):string[];
@@ -1,2 +0,0 @@
1
- (function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="c6ed71d0-b878-575e-b990-356afdc45688")}catch{}})();import{describeFlagScalarValueFailure,resolveExtensionFlagValueContract,resolveExtensionLongFlagName,EXIT_CODE,PmCliError,flattenFlagListValue,resolveFlagValueKind}from"../sdk/runtime-primitives.js";const UNSAFE_LOOSE_OPTION_KEYS=new Set(["__proto__","prototype","constructor"]),LOOSE_OPTION_OCCURRENCES=Symbol("looseOptionOccurrences");function toLooseOptionKey(rawKey){return rawKey.trim().toLowerCase().replaceAll(/-([a-z0-9])/g,(_match,group)=>group.toUpperCase())}function setLooseOptionValue(options,key,value){const existing=options[key];if(existing===void 0){options[key]=value;return}if(Array.isArray(existing)){existing.push(value),options[key]=existing;return}options[key]=[existing,value]}function parseLooseOptionToken(args,index){const token=args[index];if(!token.startsWith("-")||token==="-"||token==="--")return null;if(!token.startsWith("--")){const equalsIndex2=token.indexOf("=");if(equalsIndex2>=0)return{consumed:1,key:token.slice(1,equalsIndex2).trim(),value:token.slice(equalsIndex2+1),attached:!0};const key2=token.slice(1).trim(),next2=args[index+1];return typeof next2=="string"&&!next2.startsWith("-")?{consumed:2,key:key2,value:next2}:{consumed:1,key:key2,value:!0}}const equalsIndex=token.indexOf("=");if(equalsIndex>=0)return{consumed:1,key:token.slice(2,equalsIndex).trim(),value:token.slice(equalsIndex+1),attached:!0};if(token.startsWith("--no-"))return{consumed:1,key:token.slice(5).trim(),value:!1};const key=token.slice(2).trim(),next=args[index+1];return typeof next=="string"&&!next.startsWith("-")?{consumed:2,key,value:next}:{consumed:1,key,value:!0}}function isUnsafeLooseOptionKey(key){return UNSAFE_LOOSE_OPTION_KEYS.has(key)}function resolveLooseOptionCoercionKind(definition){const raw=(typeof definition.value_type=="string"?definition.value_type:void 0)??(typeof definition.type=="string"?definition.type:void 0);return resolveFlagValueKind(raw)}function collectLooseOptionKeys(definition){const keys=[],long=resolveExtensionLongFlagName(definition.long)??"",short=typeof definition.short=="string"?definition.short.trim():"";if(long.startsWith("--")){const normalized=toLooseOptionKey(long.slice(2));normalized.length>0&&!isUnsafeLooseOptionKey(normalized)&&keys.push(normalized)}if(short.startsWith("-")&&!short.startsWith("--")){const normalized=toLooseOptionKey(short.slice(1));normalized.length>0&&!isUnsafeLooseOptionKey(normalized)&&keys.push(normalized)}return[...new Set(keys)]}function collectLooseCommandOptionKeysForDefinitions(definitions){const keys=new Set;for(const definition of definitions)for(const key of collectLooseOptionKeys(definition))keys.add(key);return keys}function resolveCanonicalLooseOptionKey(definition){const long=resolveExtensionLongFlagName(definition.long)??"";if(long.startsWith("--")){const normalized=toLooseOptionKey(long.slice(2));if(normalized.length>0&&!isUnsafeLooseOptionKey(normalized))return normalized}return collectLooseOptionKeys(definition)[0]??null}function formatLooseOptionLabel(definition){const long=typeof definition.long=="string"?definition.long.trim():"";if(long.startsWith("--")&&long.length>2)return long;const short=typeof definition.short=="string"?definition.short.trim():"";return short.startsWith("-")&&!short.startsWith("--")&&short.length>1?short:null}function validateLooseCommandOptionsWithFlagDefinitions(options,definitions,commandPath){if(definitions.length===0)return;const allowed=new Set,disabled=new Map,required=[],labels=[];for(const definition of definitions){const keys=collectLooseOptionKeys(definition),normalizedLabel=formatLooseOptionLabel(definition);normalizedLabel!==null&&labels.push(normalizedLabel);for(const key of keys)allowed.add(key),definition.enabled===!1&&disabled.set(key,normalizedLabel);definition.required===!0&&definition.enabled!==!1&&keys.length>0&&required.push({keys,label:normalizedLabel})}for(const key of Object.keys(options)){if(!allowed.has(key)){const expected=labels.length>0?` Expected one of: ${[...new Set(labels)].join(", ")}.`:"";throw new PmCliError(`Unknown option '--${key}' for extension command '${commandPath}'.${expected}`,EXIT_CODE.USAGE)}const disabledLabel=disabled.get(key);if(disabledLabel)throw new PmCliError(`Option '${disabledLabel}' is disabled for extension command '${commandPath}'.`,EXIT_CODE.USAGE)}for(const entry of required)if(!entry.keys.some(key=>Object.hasOwn(options,key)))throw new PmCliError(`Missing required option '${entry.label}' for extension command '${commandPath}'.`,EXIT_CODE.USAGE)}function coerceLooseStringOptionValue(value){return typeof value=="string"||value==null?value:String(value)}function coerceLooseNumberOptionValue(value){if(typeof value=="number")return value;if(typeof value=="string"&&value.trim().length>0){const parsed=Number(value);return Number.isFinite(parsed)?parsed:value}return value}function coerceLooseBooleanOptionValue(value){if(typeof value=="boolean")return value;if(typeof value=="string"){const normalized=value.trim().toLowerCase();if(normalized==="true"||normalized==="1")return!0;if(normalized==="false"||normalized==="0")return!1}return value}const LOOSE_OPTION_VALUE_COERCERS={string:coerceLooseStringOptionValue,number:coerceLooseNumberOptionValue,boolean:coerceLooseBooleanOptionValue};function coerceLooseOptionValue(value,kind){return Array.isArray(value)?value.map(entry=>coerceLooseOptionValue(entry,kind)):LOOSE_OPTION_VALUE_COERCERS[kind](value)}function normalizeAccumulatedFlagValue(value,kind,preserveOccurrenceCommas){const entries=preserveOccurrenceCommas?(Array.isArray(value)?value.flat(1/0):[value]).filter(entry=>entry!=null&&entry!==""):flattenFlagListValue(value);return kind?entries.map(entry=>coerceLooseOptionValue(entry,kind)):entries}function applyFlagDefault(defaultValue,kind,isListFlag,preserveOccurrenceCommas){return isListFlag?normalizeAccumulatedFlagValue(defaultValue,kind,preserveOccurrenceCommas):kind?coerceLooseOptionValue(defaultValue,kind):defaultValue}function readOrderedLooseListValues(occurrenceSource,optionKeys,fallback){const occurrences=occurrenceSource[LOOSE_OPTION_OCCURRENCES];if(!occurrences||occurrences.length===0)return fallback;const acceptedKeys=new Set(optionKeys);return occurrences.filter(occurrence=>acceptedKeys.has(occurrence.key)).map(occurrence=>occurrence.value)}function isBooleanSwitchDefinition(definition){return resolveExtensionFlagValueContract(definition).value_arity==="none"}function refuseStrictScalarValue(definition,kind,entry,expected,commandPath){const label=formatLooseOptionLabel(definition),scope=commandPath?` for extension command '${commandPath}'`:"",received=entry===!0?"no value":JSON.stringify(entry);throw new PmCliError(`Option '${label}'${scope} expects ${expected}; received ${received}.`,EXIT_CODE.USAGE,{code:"extension_flag_value_invalid",required:`Pass ${label} ${kind==="number"?"<number>":"<true|false|1|0>"}.`,why:`The flag declares value_type ${kind} with value_validation strict, so a malformed token is refused before the extension handler runs.`,nextSteps:[`Re-run with a valid ${kind} value for ${label}.`,`Run pm ${commandPath??"<command>"} --help to review the declared flag contract.`]})}function isStrictTypedDefinition(definition,kind){return definition.value_validation==="strict"&&kind!=="string"}function readLooseOccurrences(occurrenceSource,optionKeys){const occurrences=occurrenceSource[LOOSE_OPTION_OCCURRENCES];if(!occurrences)return[];const acceptedKeys=new Set(optionKeys);return occurrences.filter(occurrence=>acceptedKeys.has(occurrence.key))}function refuseMalformedAttachedSwitchValues(definition,optionKeys,occurrenceSource,commandPath){if(isBooleanSwitchDefinition(definition))for(const occurrence of readLooseOccurrences(occurrenceSource,optionKeys)){if(occurrence.attached!==!0)continue;const values=definition.list===!0&&definition.repeatable!==!0?flattenFlagListValue(occurrence.value):[occurrence.value];for(const value of values){const failure=describeFlagScalarValueFailure(coerceLooseOptionValue(value,"boolean"),"boolean");failure!==null&&refuseStrictScalarValue(definition,"boolean",value,failure.expected,commandPath)}}}function refuseEmptyStrictListEntries(definition,kind,rawValue,preserveOccurrenceCommas,commandPath){const occurrences=Array.isArray(rawValue)?rawValue.flat(1/0):[rawValue],entries=preserveOccurrenceCommas?occurrences:occurrences.flatMap(entry=>typeof entry=="string"?entry.split(","):[entry]);for(const entry of entries)if(typeof entry=="string"&&entry.trim().length===0){const failure=describeFlagScalarValueFailure(entry,kind);refuseStrictScalarValue(definition,kind,entry,failure.expected,commandPath)}}function validateStrictScalarOptionValue(definition,value,kind,commandPath){if(!isStrictTypedDefinition(definition,kind))return value;const isSwitch=kind==="boolean"&&isBooleanSwitchDefinition(definition),normalizeEntry=entry=>{const failure=describeFlagScalarValueFailure(entry,kind);return failure===null?entry:isSwitch&&typeof entry=="string"?!0:refuseStrictScalarValue(definition,kind,entry,failure.expected,commandPath)};return Array.isArray(value)?value.map(normalizeEntry):normalizeEntry(value)}function mergeAliasOptionKeys(coerced,canonical,optionKeys,isListFlag){for(const key of optionKeys)if(!(key===canonical||!Object.hasOwn(coerced,key))){if(Object.hasOwn(coerced,canonical)){if(isListFlag){const canonicalValue=coerced[canonical],aliasValue=coerced[key];coerced[canonical]=[...Array.isArray(canonicalValue)?canonicalValue:[canonicalValue],...Array.isArray(aliasValue)?aliasValue:[aliasValue]].filter(value=>value!=null)}delete coerced[key];continue}coerced[canonical]=coerced[key],delete coerced[key]}}function coerceLooseCommandOptionsWithFlagDefinitions(options,definitions,occurrenceSource=options,commandPath){if(definitions.length===0)return options;const coerced=Object.create(null);for(const[key,value]of Object.entries(options))coerced[key]=value;for(const definition of definitions){const canonical=resolveCanonicalLooseOptionKey(definition);canonical&&coerceDefinedLooseOption(coerced,definition,canonical,occurrenceSource,commandPath)}return coerced}function coerceDefinedLooseOption(coerced,definition,canonical,occurrenceSource,commandPath){const isListFlag=definition.list===!0,optionKeys=collectLooseOptionKeys(definition),kind=resolveLooseOptionCoercionKind(definition);kind&&!isListFlag&&refuseMalformedScalarAliasValues(coerced,definition,canonical,optionKeys,kind,commandPath),mergeAliasOptionKeys(coerced,canonical,optionKeys,isListFlag);const preserveOccurrenceCommas=definition.repeatable===!0;if(!Object.hasOwn(coerced,canonical)){definition.default!==void 0&&(coerced[canonical]=applyFlagDefault(definition.default,kind,isListFlag,preserveOccurrenceCommas));return}if(kind==="boolean"&&isStrictTypedDefinition(definition,kind)&&refuseMalformedAttachedSwitchValues(definition,optionKeys,occurrenceSource,commandPath),isListFlag){coerced[canonical]=coerceAccumulatedLooseOption(definition,optionKeys,occurrenceSource,coerced[canonical],kind,preserveOccurrenceCommas,commandPath);return}kind&&(coerced[canonical]=validateStrictScalarOptionValue(definition,coerceLooseOptionValue(coerced[canonical],kind),kind,commandPath))}function refuseMalformedScalarAliasValues(coerced,definition,canonical,optionKeys,kind,commandPath){for(const key of optionKeys)key!==canonical&&Object.hasOwn(coerced,key)&&validateStrictScalarOptionValue(definition,coerceLooseOptionValue(coerced[key],kind),kind,commandPath)}function coerceAccumulatedLooseOption(definition,optionKeys,occurrenceSource,current,kind,preserveOccurrenceCommas,commandPath){const ordered=readOrderedLooseListValues(occurrenceSource,optionKeys,current);kind&&isStrictTypedDefinition(definition,kind)&&refuseEmptyStrictListEntries(definition,kind,ordered,preserveOccurrenceCommas,commandPath);const normalized=normalizeAccumulatedFlagValue(ordered,kind,preserveOccurrenceCommas);return kind?validateStrictScalarOptionValue(definition,normalized,kind,commandPath):normalized}function parseLooseCommandOptions(args){const options=Object.create(null),occurrences=[];Object.defineProperty(options,LOOSE_OPTION_OCCURRENCES,{value:occurrences});let index=0;for(;index<args.length;){const parsed=parseLooseOptionToken(args,index);if(!parsed){index+=1;continue}const normalizedKey=toLooseOptionKey(parsed.key);if(normalizedKey.length===0||isUnsafeLooseOptionKey(normalizedKey)){index+=parsed.consumed;continue}setLooseOptionValue(options,normalizedKey,parsed.value),occurrences.push({...parsed,key:normalizedKey}),index+=parsed.consumed}return options}function collectLoosePositionalArgs(args){const positionals=[];let index=0;for(;index<args.length;){if(args[index]==="--"){positionals.push(...args.slice(index+1));break}const parsed=parseLooseOptionToken(args,index);if(parsed){index+=Math.max(1,parsed.consumed);continue}positionals.push(args[index]),index+=1}return positionals}function stripLooseCommandOptionTokens(args,definitions){if(definitions.length===0)return[...args];const knownKeys=new Set,booleanKeys=new Set;for(const definition of definitions){const valueKind=resolveLooseOptionCoercionKind(definition);for(const key of collectLooseOptionKeys(definition))knownKeys.add(key),valueKind==="boolean"&&booleanKeys.add(key)}if(knownKeys.size===0)return[...args];const stripped=[];let index=0;for(;index<args.length;){if(args[index]==="--"){stripped.push(...args.slice(index+1));break}const parsed=parseLooseOptionToken(args,index);if(parsed){const normalizedKey=toLooseOptionKey(parsed.key);if(knownKeys.has(normalizedKey)){const token=args[index],consumed=booleanKeys.has(normalizedKey)&&!token.includes("=")?1:parsed.consumed;index+=consumed;continue}}stripped.push(args[index]),index+=1}return stripped}export{coerceLooseCommandOptionsWithFlagDefinitions,collectLooseCommandOptionKeysForDefinitions,collectLoosePositionalArgs,parseLooseCommandOptions,stripLooseCommandOptionTokens,validateLooseCommandOptionsWithFlagDefinitions};
2
- //# sourceMappingURL=extension-command-options.js.map
@@ -1,31 +0,0 @@
1
- import { activateExtensions,loadExtensions,readSettings,resolveImplicitPmRoot } from "../sdk/runtime-primitives.js";
2
- /** Extension failure safe to append to unknown-command output. */
3
- export interface ExtensionRecoveryFailure {
4
- /** Extension resolution layer that failed. */
5
- layer:string;
6
- /** Installed extension identity. */
7
- name:string;
8
- /** Actionable loader or activation error. */
9
- error:string;
10
- /** Command paths declared statically for this extension. */
11
- declared_commands?:string[];
12
- /** Whether the failed extension declares the attempted command path. */
13
- declared_command_match?:boolean;
14
- /** Bounded commands that repair or diagnose the failed installation. */
15
- recovery_commands?:string[];
16
- }
17
- /** Injectable recovery dependencies used to exercise loader failure boundaries. */
18
- export interface ExtensionRecoveryDependencies {
19
- /** Reads active tracker settings. */
20
- readSettings:typeof readSettings;
21
- /** Loads installed extension modules. */
22
- loadExtensions:typeof loadExtensions;
23
- /** Activates loaded extension modules. */
24
- activateExtensions:typeof activateExtensions;
25
- /** Resolves the ordinary cwd tracker independently from an explicit CLI path. */
26
- resolveImplicitPmRoot:typeof resolveImplicitPmRoot;
27
- }
28
- /** Reload extensions and return bounded load plus activation failures. */
29
- export declare function loadExtensionRecoveryFailures(pmRoot:string,overrides?:Partial<ExtensionRecoveryDependencies>,attemptedCommandPaths?:readonly string[]):Promise<ExtensionRecoveryFailure[]>;
30
- /** Loads recovery details only for unknown-command failures. */
31
- export declare function loadUnknownCommandRecoveryFailures(classificationCode:string,pmRoot:string,overrides?:Partial<ExtensionRecoveryDependencies>,attemptedCommandPaths?:readonly string[]):Promise<ExtensionRecoveryFailure[]>;
@@ -1,57 +0,0 @@
1
- /**
2
- * @module cli/help-content
3
- *
4
- * Provides CLI runtime support for Help Content.
5
- */
6
- import { Command } from "commander";
7
- import { type PmCommandVisibilityTier } from "../sdk/agent-capability-contracts.js";
8
- /** Attach a package command's declared tier to its Commander presentation node. */
9
- export declare function setPmCommandHelpVisibilityTier(command:Command,tier:PmCommandVisibilityTier):void;
10
- /** Read presentation metadata attached to a package-created Commander node. */
11
- export declare function getPmCommandHelpVisibilityTier(command:Command):PmCommandVisibilityTier | undefined;
12
- /** Documents the help bundle payload exchanged by command, SDK, and package integrations. */
13
- export interface HelpBundle {
14
- /** Value that configures or reports why for this contract. */
15
- why:string;
16
- /** Value that configures or reports examples for this contract. */
17
- examples:string[];
18
- /** Value that configures or reports tips for this contract. */
19
- tips?:string[];
20
- }
21
- /** Documents the help narrative payload exchanged by command, SDK, and package integrations. */
22
- export interface HelpNarrative {
23
- /** Value that configures or reports intent for this contract. */
24
- intent:string;
25
- /** Value that configures or reports examples for this contract. */
26
- examples:string[];
27
- /** Value that configures or reports tips for this contract. */
28
- tips:string[];
29
- /** Strategy used to control detail behavior. */
30
- detail_mode:HelpDetailMode;
31
- }
32
- /** Restricts help detail mode values accepted by command, SDK, and storage contracts. */
33
- export type HelpDetailMode = "compact" | "detailed";
34
- /** Implements first example or empty for the public runtime surface of this module. */
35
- export declare function firstExampleOrEmpty(examples:string[]):string[];
36
- declare function renderCompactHelpBundle(bundle:HelpBundle):string;
37
- declare function renderDetailedHelpBundle(bundle:HelpBundle):string;
38
- /** Implements normalize help command path for the public runtime surface of this module. */
39
- export declare function normalizeHelpCommandPath(commandPath:string):string;
40
- /** Implements resolve help detail mode for the public runtime surface of this module. */
41
- export declare function resolveHelpDetailMode(argv:string[]):HelpDetailMode;
42
- /** Whether an invocation requests the complete public command discovery tier. */
43
- export declare function isFullHelpDiscovery(argv:readonly string[]):boolean;
44
- /** Public contract for root help bundle, shared by SDK and presentation-layer consumers. */
45
- export declare const ROOT_HELP_BUNDLE:HelpBundle;
46
- /** Implements resolve help bundle for path for the public runtime surface of this module. */
47
- export declare function resolveHelpBundleForPath(commandPath:string | undefined):HelpBundle;
48
- /** Implements resolve help narrative for the public runtime surface of this module. */
49
- export declare function resolveHelpNarrative(commandPath:string | undefined,detailMode:HelpDetailMode):HelpNarrative;
50
- /** Implements attach rich help text for the public runtime surface of this module. */
51
- export declare function attachRichHelpText(program:Command,argv?:string[]):void;
52
- /** Public contract for test only, shared by SDK and presentation-layer consumers. */
53
- export declare const _testOnly:{
54
- renderCompactHelpBundle:typeof renderCompactHelpBundle;
55
- renderDetailedHelpBundle:typeof renderDetailedHelpBundle;
56
- };
57
- export {};