@unbrained/pm-cli 2026.9.22 → 2026.9.25

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 (107) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/AGENTS.md +6 -20
  3. package/CHANGELOG.md +43 -0
  4. package/dist/cli/error-guidance.d.ts +9 -0
  5. package/dist/cli/error-guidance.js +1 -1
  6. package/dist/cli/help-content.js +1 -1
  7. package/dist/cli-bundle/bundle-manifest.json +144 -144
  8. package/dist/cli-bundle/chunks/{chunk-BJBBOUYQ.js → chunk-25KTCTBL.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-UDNYAMCM.js → chunk-3IB4THWX.js} +2 -2
  10. package/dist/cli-bundle/chunks/{chunk-3OFFMS2N.js → chunk-445ARBKY.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-SBTT42A4.js → chunk-5AP67ZXH.js} +3 -3
  12. package/dist/cli-bundle/chunks/{chunk-JSW33Q6R.js → chunk-COFQCKF4.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-4XOV7Q5R.js → chunk-CZ3VJJEA.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-ZSPZJOMK.js → chunk-GAU55CWI.js} +28 -28
  15. package/dist/cli-bundle/chunks/{chunk-ML42DLI3.js → chunk-GOWZEBTH.js} +2 -2
  16. package/dist/cli-bundle/chunks/{chunk-CM57QHVK.js → chunk-JDHWZYZU.js} +73 -73
  17. package/dist/cli-bundle/chunks/{chunk-GFTN5OS4.js → chunk-P7ZSJOWH.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-AVWHZUNC.js → chunk-YABJDOOX.js} +63 -62
  19. package/dist/cli-bundle/chunks/{chunk-D2OV2UBV.js → chunk-YDIGMRLZ.js} +2 -2
  20. package/dist/cli-bundle/chunks/{register-list-query-VOS5CBX4.js → register-list-query-IZ7ZVTDE.js} +2 -2
  21. package/dist/cli-bundle/chunks/{register-mutation-LWZH6UFJ.js → register-mutation-IPAZTFDZ.js} +2 -2
  22. package/dist/cli-bundle/chunks/{register-operations-YJK4DNFZ.js → register-operations-APN33LNI.js} +2 -2
  23. package/dist/cli-bundle/chunks/{register-setup-Q3CYF67Q.js → register-setup-HPHIKG5U.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-CASXNCNQ.js → chunk-ABA3KRPY.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-XR5EBU3B.js → chunk-HQPTDJLF.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/{chunk-PRMQTT7X.js → chunk-IXNNMP2R.js} +2 -2
  27. package/dist/cli-bundle/focused-chunks/chunk-KRIHJH5U.js +75 -0
  28. package/dist/cli-bundle/focused-chunks/{chunk-QFEDRPPI.js → chunk-MK5AKKHK.js} +2 -2
  29. package/dist/cli-bundle/focused-chunks/{chunk-LH24XUPJ.js → chunk-NRHTXBTI.js} +2 -2
  30. package/dist/cli-bundle/focused-chunks/{chunk-URH727T5.js → chunk-NVVB2HJC.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/{chunk-TSI73EEM.js → chunk-O7MIBEMK.js} +2 -2
  32. package/dist/cli-bundle/focused-chunks/{chunk-V2NARGRH.js → chunk-OY3VHCTX.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/{chunk-UT7VS4X2.js → chunk-PMPFLA6X.js} +2 -2
  34. package/dist/cli-bundle/focused-chunks/{chunk-FKYUTTFL.js → chunk-Q355NPLH.js} +28 -28
  35. package/dist/cli-bundle/focused-chunks/{chunk-JCD5YESL.js → chunk-TLF6N56J.js} +2 -2
  36. package/dist/cli-bundle/focused-chunks/{chunk-MXESHALQ.js → chunk-UIFVIE5F.js} +2 -2
  37. package/dist/cli-bundle/focused-chunks/{chunk-IOL25GKH.js → chunk-V2X37U6J.js} +2 -2
  38. package/dist/cli-bundle/focused-chunks/{chunk-AO5FR7PN.js → chunk-XKH2FC5D.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-UAU4DJSR.js → chunk-Y2M4QLAA.js} +2 -2
  40. package/dist/cli-bundle/main.js +22 -22
  41. package/dist/cli-bundle/sdk-authoring.js +1 -1
  42. package/dist/cli-bundle/sdk-contracts.js +1 -1
  43. package/dist/cli-bundle/sdk-core.js +30 -45
  44. package/dist/cli-bundle/sdk-governance.js +1 -1
  45. package/dist/cli-bundle/sdk-graph.js +1 -1
  46. package/dist/cli-bundle/sdk-merge.js +58 -42
  47. package/dist/cli-bundle/sdk-query.js +1 -1
  48. package/dist/cli-bundle/sdk-runtime.js +1 -1
  49. package/dist/cli-bundle/sdk-testing.js +1 -1
  50. package/dist/cli-bundle/sdk.js +9 -10
  51. package/dist/core/policy/workflow-policy-store.js +1 -1
  52. package/dist/core/shared/errors.d.ts +13 -0
  53. package/dist/core/shared/errors.js +1 -1
  54. package/dist/sdk/cli-contracts/commander-types.d.ts +11 -11
  55. package/dist/sdk/cli-contracts/commander-types.js +1 -1
  56. package/dist/sdk/completion/bash.js +1 -1
  57. package/dist/sdk/governance/health.d.ts +1 -1
  58. package/dist/sdk/governance/health.js +1 -1
  59. package/dist/sdk/init-agent-guidance.d.ts +2 -1
  60. package/dist/sdk/init-agent-guidance.js +2 -2
  61. package/dist/sdk/merge/install.js +2 -2
  62. package/dist/sdk/merge/worktree-config.d.ts +9 -0
  63. package/dist/sdk/merge/worktree-config.js +2 -0
  64. package/dist/sdk/pagination.js +1 -1
  65. package/dist/sdk/public-surface.json +1 -1
  66. package/docs/AGENT_RECOVERY_AND_GUIDANCE.md +49 -0
  67. package/docs/CHATGPT_CODEX_PLUGIN_IMPLEMENTATION.md +2 -0
  68. package/docs/CLAUDE_CODE_PLUGIN.md +18 -7
  69. package/docs/CODEX_PLUGIN.md +5 -12
  70. package/docs/DEFECT_RECURRENCE.md +8 -1
  71. package/docs/DEPENDENCY_KIND_CONTRACT.md +27 -0
  72. package/docs/MERGE_SAFETY.md +28 -5
  73. package/docs/QUALITY_EVIDENCE.md +70 -0
  74. package/docs/README.md +1 -0
  75. package/docs/RELEASE_RELIABILITY.md +70 -0
  76. package/docs/RELEASING.md +4 -0
  77. package/docs/TESTING.md +25 -0
  78. package/docs/VALIDATION_PORTABILITY.md +20 -11
  79. package/marketplace.json +2 -2
  80. package/package.json +12 -6
  81. package/packages/pm-beads/package.json +1 -1
  82. package/packages/pm-calendar/package.json +1 -1
  83. package/packages/pm-command-kit/package.json +1 -1
  84. package/packages/pm-digital-twin/package.json +1 -1
  85. package/packages/pm-governance-audit/package.json +1 -1
  86. package/packages/pm-guide-shell/package.json +1 -1
  87. package/packages/pm-kanban/package.json +1 -1
  88. package/packages/pm-lifecycle-hooks/package.json +1 -1
  89. package/packages/pm-linked-test-adapters/package.json +1 -1
  90. package/packages/pm-search-advanced/package.json +1 -1
  91. package/packages/pm-templates/package.json +1 -1
  92. package/packages/pm-todos/package.json +1 -1
  93. package/packages/pm-vcs/package.json +1 -1
  94. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  95. package/plugins/pm-claude/README.md +6 -5
  96. package/plugins/pm-claude/hooks/hooks.json +1 -1
  97. package/plugins/pm-claude/hooks/session-start.mjs +9 -6
  98. package/plugins/pm-claude/package.json +9 -0
  99. package/plugins/pm-claude/scripts/plugin-runtime.mjs +84 -0
  100. package/plugins/pm-claude/scripts/pm-mcp-server.mjs +39 -96
  101. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  102. package/plugins/pm-codex/.mcp.json +0 -3
  103. package/plugins/pm-codex/README.md +1 -1
  104. package/plugins/pm-codex/package.json +9 -0
  105. package/plugins/pm-codex/scripts/plugin-runtime.mjs +84 -0
  106. package/plugins/pm-codex/scripts/pm-mcp-server.mjs +38 -99
  107. package/dist/cli-bundle/focused-chunks/chunk-QYN77MQP.js +0 -59
@@ -0,0 +1,2 @@
1
+ !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="725f175b-c548-5700-8e85-ea0b5dce3747")}catch(e2){}})();import{execFile}from"node:child_process";import path from"node:path";import{promisify}from"node:util";const execFileAsync=promisify(execFile);function gitWorkspaceEnvironment(){const env={...process.env};for(const key of["GIT_DIR","GIT_WORK_TREE","GIT_COMMON_DIR","GIT_INDEX_FILE","GIT_OBJECT_DIRECTORY","GIT_ALTERNATE_OBJECT_DIRECTORIES","GIT_NAMESPACE","GIT_CEILING_DIRECTORIES","GIT_DISCOVERY_ACROSS_FILESYSTEM"]){delete env[key]}return env}async function readLocalGitConfig(cwd,key){try{const type=key==="core.bare"||key==="extensions.worktreeConfig"?["--type=bool"]:[];return(await execFileAsync("git",["config","--local",...type,"--get",key],{cwd,env:gitWorkspaceEnvironment(),timeout:1e4})).stdout.trim()}catch(error){if(typeof error==="object"&&error!==null&&"code"in error&&error.code===1)return void 0;throw error}}async function resolveMergeDriverConfigScope(workspaceRoot){if(await readLocalGitConfig(workspaceRoot,"extensions.worktreeConfig")==="true")return"--worktree";const{stdout}=await execFileAsync("git",["rev-parse","--path-format=absolute","--git-dir","--git-common-dir"],{cwd:workspaceRoot,env:gitWorkspaceEnvironment(),timeout:1e4});const[gitDir,commonDir]=stdout.trim().split(/\r?\n/);if(gitDir===commonDir)return"--local";const mainConfig=path.join(commonDir,"config.worktree");for(const key of["core.bare","core.worktree"]){const value=await readLocalGitConfig(workspaceRoot,key);if(value===void 0||key==="core.bare"&&value!=="true")continue;await execFileAsync("git",["config","--file",mainConfig,key,value],{cwd:workspaceRoot,env:gitWorkspaceEnvironment(),timeout:1e4});await execFileAsync("git",["config","--local","--unset-all",key],{cwd:workspaceRoot,env:gitWorkspaceEnvironment(),timeout:1e4})}for(const driver of["pm-item-toon","pm-item-markdown","pm-history","pm-relationship","pm-json"]){for(const field of["name","driver"]){const key=`merge.${driver}.${field}`;const value=await readLocalGitConfig(workspaceRoot,key);if(value!==void 0)await execFileAsync("git",["config","--file",mainConfig,key,value],{cwd:workspaceRoot,env:gitWorkspaceEnvironment(),timeout:1e4})}}await execFileAsync("git",["config","--local","extensions.worktreeConfig","true"],{cwd:workspaceRoot,env:gitWorkspaceEnvironment(),timeout:1e4});return"--worktree"}export{gitWorkspaceEnvironment,resolveMergeDriverConfigScope};
2
+ //# sourceMappingURL=worktree-config.js.map
@@ -1,2 +1,2 @@
1
- !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="15037266-75b7-5f8d-9565-e7848e720a49")}catch(e2){}})();import{createHash}from"node:crypto";import{PmCliError}from"../core/shared/errors.js";import{EXIT_CODE}from"../core/shared/constants.js";import{stableStringify}from"../core/shared/serialization.js";const QUERY_CURSOR_VERSION=1;const MAX_CURSOR_LENGTH=4096;const BASE64URL_PATTERN=/^[A-Za-z0-9_-]+$/;function optionKeyForFlag(flag){return flag.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(_,character)=>character.toUpperCase())}function selectCursorSemanticOptions(options,contracts){const presentationKeys=new Set;for(const contract of contracts){if(contract.cursor_semantics==="presentation"){presentationKeys.add(optionKeyForFlag(contract.flag));for(const alias of contract.aliases??[]){presentationKeys.add(optionKeyForFlag(alias))}}}return Object.fromEntries(Object.entries(options).filter(([key])=>!presentationKeys.has(key)))}function createQueryFingerprint(command,contract){return createHash("sha256").update(command).update("\0").update(stableStringify(contract)).digest("hex").slice(0,24)}function encodeQueryCursor(fingerprint,afterId,afterIndex,snapshot){return Buffer.from(JSON.stringify({version:QUERY_CURSOR_VERSION,fingerprint,after_id:afterId,...afterIndex===void 0?{}:{after_index:afterIndex},...snapshot===void 0?{}:{snapshot}})).toString("base64url")}function invalidCursor(message){return new PmCliError(message,EXIT_CODE.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function isQueryCursorEnvelope(value){if(typeof value!=="object"||value===null||Array.isArray(value)){return false}const envelope=value;return envelope.version===QUERY_CURSOR_VERSION&&typeof envelope.fingerprint==="string"&&typeof envelope.after_id==="string"&&envelope.after_id.length>0&&(envelope.after_index===void 0||Number.isSafeInteger(envelope.after_index)&&envelope.after_index>=0)&&(envelope.snapshot===void 0||typeof envelope.snapshot==="string"&&envelope.snapshot.length>0)}function decodeQueryCursorEnvelope(cursor){if(typeof cursor!=="string"){throw invalidCursor("Query cursor is malformed.")}const normalized=cursor.trim();if(normalized.length===0||normalized.length>MAX_CURSOR_LENGTH||!BASE64URL_PATTERN.test(normalized)){throw invalidCursor("Query cursor is malformed.")}let parsed;try{parsed=JSON.parse(Buffer.from(normalized,"base64url").toString("utf8"))}catch{throw invalidCursor("Query cursor is malformed.")}if(!isQueryCursorEnvelope(parsed)){throw invalidCursor("Query cursor version or payload is unsupported.")}return parsed}function decodeQueryCursorState(cursor,expectedFingerprint){const envelope=decodeQueryCursorEnvelope(cursor);if(envelope.fingerprint!==expectedFingerprint){throw invalidCursor(`Query cursor does not match the current filters, sort, or query (${envelope.fingerprint} != ${expectedFingerprint}).`)}return{after_id:envelope.after_id,...envelope.after_index===void 0?{}:{after_index:envelope.after_index},...envelope.snapshot===void 0?{}:{snapshot:envelope.snapshot}}}function decodeQueryCursor(cursor,expectedFingerprint){return decodeQueryCursorState(cursor,expectedFingerprint).after_id}function resolveQueryCursorStart(rows,cursor,fingerprint,readId){if(cursor===void 0){return 0}const state=decodeQueryCursorState(cursor,fingerprint);const index=rows.findIndex(row=>readId(row)===state.after_id);if(index<0){if(state.after_index!==void 0){return Math.min(state.after_index,rows.length)}throw invalidCursor(`Query cursor item ${state.after_id} is no longer present in this result set.`)}return index+1}function paginateQueryRows(rows,options){if(options.cursor!==void 0&&decodeQueryCursorState(options.cursor,options.fingerprint).snapshot!==options.snapshot)throw invalidCursor("Query cursor does not match the requested snapshot.");const pageStart=resolveQueryCursorStart(rows,options.cursor,options.fingerprint,options.readId);const pageRows=rows.slice(pageStart,pageStart+options.limit);const hasMore=pageRows.length>0&&pageStart+pageRows.length<rows.length;const lastRow=pageRows.at(-1);return{rows:pageRows,has_more:hasMore,...hasMore&&lastRow!==void 0?{next_cursor:encodeQueryCursor(options.fingerprint,options.readId(lastRow),pageStart+pageRows.length-1,options.snapshot)}:{}}}const QUERY_CURSOR_CONTRACT=Object.freeze({version:QUERY_CURSOR_VERSION,max_length:MAX_CURSOR_LENGTH});export{QUERY_CURSOR_CONTRACT,createQueryFingerprint,decodeQueryCursor,decodeQueryCursorEnvelope,decodeQueryCursorState,encodeQueryCursor,paginateQueryRows,resolveQueryCursorStart,selectCursorSemanticOptions};
1
+ !(function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="4b085328-0791-58f5-872a-f796f9087ab4")}catch(e2){}})();import{createHash}from"node:crypto";import{PmCliError}from"../core/shared/errors.js";import{EXIT_CODE}from"../core/shared/constants.js";import{stableStringify}from"../core/shared/serialization.js";const QUERY_CURSOR_VERSION=1;const MAX_CURSOR_LENGTH=4096;const BASE64URL_PATTERN=/^[A-Za-z0-9_-]+$/;function optionKeyForFlag(flag){return flag.replace(/^--/u,"").replace(/[-_]([a-z0-9])/gu,(_,character)=>character.toUpperCase())}function selectCursorSemanticOptions(options,contracts){const presentationKeys=new Set;for(const contract of contracts){if(contract.cursor_semantics==="presentation"){presentationKeys.add(optionKeyForFlag(contract.flag));for(const alias of contract.aliases??[]){presentationKeys.add(optionKeyForFlag(alias))}}}return Object.fromEntries(Object.entries(options).filter(([key])=>!presentationKeys.has(key)))}function createQueryFingerprint(command,contract){return createHash("sha256").update(command).update("\0").update(stableStringify(contract)).digest("hex").slice(0,24)}function encodeQueryCursor(fingerprint,afterId,afterIndex,snapshot){return Buffer.from(JSON.stringify({version:QUERY_CURSOR_VERSION,fingerprint,after_id:afterId,...afterIndex===void 0?{}:{after_index:afterIndex},...snapshot===void 0?{}:{snapshot}})).toString("base64url")}function invalidCursor(message){return new PmCliError(message,EXIT_CODE.USAGE,{code:"invalid_query_cursor",nextSteps:["Repeat the original query without --after to obtain a fresh cursor."]})}function isQueryCursorEnvelope(value){if(typeof value!=="object"||value===null||Array.isArray(value)){return false}const envelope=value;return envelope.version===QUERY_CURSOR_VERSION&&typeof envelope.fingerprint==="string"&&typeof envelope.after_id==="string"&&envelope.after_id.length>0&&(envelope.after_index===void 0||Number.isSafeInteger(envelope.after_index)&&envelope.after_index>=0)&&(envelope.snapshot===void 0||typeof envelope.snapshot==="string"&&envelope.snapshot.length>0)}function decodeQueryCursorEnvelope(cursor){if(typeof cursor!=="string"){throw invalidCursor("Query cursor is malformed.")}const normalized=cursor.trim();if(normalized.length===0||normalized.length>MAX_CURSOR_LENGTH||!BASE64URL_PATTERN.test(normalized)){throw invalidCursor("Query cursor is malformed.")}let parsed;try{parsed=JSON.parse(Buffer.from(normalized,"base64url").toString("utf8"))}catch{throw invalidCursor("Query cursor is malformed.")}if(!isQueryCursorEnvelope(parsed)){throw invalidCursor("Query cursor version or payload is unsupported.")}return parsed}function decodeQueryCursorState(cursor,expectedFingerprint){const envelope=decodeQueryCursorEnvelope(cursor);if(envelope.fingerprint!==expectedFingerprint){throw invalidCursor(`Query cursor does not match the current filters, sort, or query (${envelope.fingerprint} != ${expectedFingerprint}).`)}return{after_id:envelope.after_id,...envelope.after_index===void 0?{}:{after_index:envelope.after_index},...envelope.snapshot===void 0?{}:{snapshot:envelope.snapshot}}}function decodeQueryCursor(cursor,expectedFingerprint){return decodeQueryCursorState(cursor,expectedFingerprint).after_id}function resolveQueryCursorStart(rows,cursor,fingerprint,readId){if(cursor===void 0){return 0}const state=decodeQueryCursorState(cursor,fingerprint);const index=rows.findIndex(row=>readId(row)===state.after_id);if(index<0){if(state.after_index!==void 0){return Math.min(state.after_index,rows.length)}throw invalidCursor(`Query cursor item ${state.after_id} is no longer present in this result set.`)}return index+1}function paginateQueryRows(rows,options){if(options.cursor!==void 0&&decodeQueryCursorState(options.cursor,options.fingerprint).snapshot!==options.snapshot)throw invalidCursor("Query cursor does not match the requested snapshot.");const pageStart=resolveQueryCursorStart(rows,options.cursor,options.fingerprint,options.readId);const pageRows=rows.slice(pageStart,pageStart+options.limit);const hasMore=pageRows.length>0&&pageStart+pageRows.length<rows.length;const lastRow=pageRows.at(-1);return{rows:pageRows,has_more:hasMore,...hasMore&&lastRow!==void 0?{next_cursor:encodeQueryCursor(options.fingerprint,options.readId(lastRow),pageStart+pageRows.length-1,options.snapshot)}:{}}}const QUERY_CURSOR_CONTRACT=Object.freeze({version:QUERY_CURSOR_VERSION,max_length:MAX_CURSOR_LENGTH});export{QUERY_CURSOR_CONTRACT,createQueryFingerprint,decodeQueryCursor,decodeQueryCursorEnvelope,decodeQueryCursorState,encodeQueryCursor,paginateQueryRows,resolveQueryCursorStart,selectCursorSemanticOptions};
2
2
  //# sourceMappingURL=pagination.js.map