@unbrained/pm-cli 2026.8.13 → 2026.8.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. package/.claude-plugin/marketplace.json +2 -2
  2. package/CHANGELOG.md +141 -112
  3. package/dist/cli/main.js +39 -3
  4. package/dist/cli-bundle/bundle-manifest.json +144 -176
  5. package/dist/cli-bundle/chunks/{chunk-DEDU3DG7.js → chunk-BBOFSVAK.js} +66 -65
  6. package/dist/cli-bundle/chunks/chunk-BFALV3YP.js +5 -0
  7. package/dist/cli-bundle/chunks/{chunk-Q47C67TQ.js → chunk-FIW4P64F.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-QGTUPEU5.js → chunk-G5JUB66K.js} +41 -41
  9. package/dist/cli-bundle/chunks/{chunk-3ZMOWAFM.js → chunk-SBRKH6OR.js} +2 -2
  10. package/dist/cli-bundle/chunks/chunk-TMJ7URWS.js +13 -0
  11. package/dist/cli-bundle/chunks/{chunk-F7FJYGK3.js → chunk-TXMEUUUY.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-YLBAPY22.js → chunk-XAVMOK6B.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-TF3TPKPR.js → chunk-YAMTJL6Y.js} +33 -33
  14. package/dist/cli-bundle/chunks/{chunk-IMGIN7R6.js → chunk-YSVSMJ2B.js} +2 -2
  15. package/dist/cli-bundle/chunks/{register-list-query-4HIZ7EA3.js → register-list-query-T3EHHNNV.js} +2 -2
  16. package/dist/cli-bundle/chunks/{register-mutation-W64FZ5HN.js → register-mutation-E27WCLSZ.js} +2 -2
  17. package/dist/cli-bundle/chunks/{register-operations-C44ET7R5.js → register-operations-4R6I7CPY.js} +2 -2
  18. package/dist/cli-bundle/chunks/{register-setup-634MFRXU.js → register-setup-3YXZ444E.js} +2 -2
  19. package/dist/cli-bundle/focused-chunks/{chunk-OOYYKQWX.js → chunk-4DQ2YERC.js} +2 -2
  20. package/dist/cli-bundle/focused-chunks/chunk-F43TT2QQ.js +8 -0
  21. package/dist/cli-bundle/focused-chunks/{chunk-2RI2FESN.js → chunk-K7RWWOAG.js} +2 -2
  22. package/dist/cli-bundle/focused-chunks/chunk-KFSZ3BP6.js +16 -0
  23. package/dist/cli-bundle/focused-chunks/{chunk-3DJSGWVB.js → chunk-KSEDUWVZ.js} +2 -2
  24. package/dist/cli-bundle/focused-chunks/{chunk-NFHFZH2Z.js → chunk-KYUQGTSB.js} +2 -2
  25. package/dist/cli-bundle/focused-chunks/{chunk-IIS2FRKL.js → chunk-LZ4MV3RH.js} +2 -2
  26. package/dist/cli-bundle/focused-chunks/chunk-PGXJQLCT.js +155 -0
  27. package/dist/cli-bundle/focused-chunks/{chunk-E3AVJ655.js → chunk-PPFGQDSI.js} +2 -2
  28. package/dist/cli-bundle/focused-chunks/chunk-Q4YY3XNF.js +2 -0
  29. package/dist/cli-bundle/focused-chunks/chunk-QK753U3U.js +46 -0
  30. package/dist/cli-bundle/focused-chunks/{chunk-QDZUABWL.js → chunk-QUMB2J27.js} +2 -2
  31. package/dist/cli-bundle/focused-chunks/chunk-SM7MTG27.js +2 -0
  32. package/dist/cli-bundle/focused-chunks/{chunk-I75MANL7.js → chunk-WCVE2NIG.js} +2 -2
  33. package/dist/cli-bundle/focused-chunks/chunk-XDNAW5OI.js +18 -0
  34. package/dist/cli-bundle/focused-chunks/{chunk-2JP7W7GO.js → chunk-YOOI3UZX.js} +2 -2
  35. package/dist/cli-bundle/focused-chunks/chunk-ZM6TZVHC.js +2 -0
  36. package/dist/cli-bundle/main.js +13 -13
  37. package/dist/cli-bundle/sdk-authoring.js +1 -1
  38. package/dist/cli-bundle/sdk-contracts.js +1 -1
  39. package/dist/cli-bundle/sdk-core.js +44 -41
  40. package/dist/cli-bundle/sdk-governance.js +1 -1
  41. package/dist/cli-bundle/sdk-graph.js +1 -1
  42. package/dist/cli-bundle/sdk-merge.js +109 -1
  43. package/dist/cli-bundle/sdk-query.js +1 -1
  44. package/dist/cli-bundle/sdk-runtime.js +1 -1
  45. package/dist/cli-bundle/sdk-testing.js +1 -1
  46. package/dist/cli-bundle/sdk.js +2 -2
  47. package/dist/core/history/drift-scan.d.ts +6 -0
  48. package/dist/core/history/drift-scan.js +74 -50
  49. package/dist/core/history/workspace-history.d.ts +59 -0
  50. package/dist/core/history/workspace-history.js +197 -10
  51. package/dist/core/output/output.js +12 -4
  52. package/dist/sdk/cli-contracts/runtime-contracts.d.ts +6 -1
  53. package/dist/sdk/cli-contracts/runtime-contracts.js +155 -60
  54. package/dist/sdk/cli-program.js +3 -3
  55. package/dist/sdk/context-relevance.js +12 -4
  56. package/dist/sdk/governance/assurance.js +4 -4
  57. package/dist/sdk/governance/health.js +15 -3
  58. package/dist/sdk/governance/validate-history-drift.d.ts +7 -0
  59. package/dist/sdk/governance/validate-history-drift.js +68 -0
  60. package/dist/sdk/governance/validate.js +4 -46
  61. package/dist/sdk/graph/assembly.d.ts +23 -0
  62. package/dist/sdk/graph/assembly.js +54 -2
  63. package/dist/sdk/graph/durable-cache.js +50 -20
  64. package/dist/sdk/graph/governance-contracts.d.ts +1 -1
  65. package/dist/sdk/graph/governance-contracts.js +4 -2
  66. package/dist/sdk/graph/governance.d.ts +21 -1
  67. package/dist/sdk/graph/governance.js +94 -32
  68. package/dist/sdk/graph/index.d.ts +2 -2
  69. package/dist/sdk/graph/index.js +4 -4
  70. package/dist/sdk/graph/mutation-advisory.js +15 -7
  71. package/dist/sdk/graph/remediation.js +12 -2
  72. package/dist/sdk/history-read.d.ts +8 -0
  73. package/dist/sdk/history-read.js +2 -2
  74. package/dist/sdk/index.d.ts +1 -1
  75. package/dist/sdk/index.js +3 -3
  76. package/dist/sdk/query/history.js +20 -3
  77. package/dist/sdk/read-output-budget.d.ts +2 -0
  78. package/dist/sdk/read-output-budget.js +12 -5
  79. package/dist/sdk/read-output-contracts.d.ts +61 -5
  80. package/dist/sdk/read-output-contracts.js +210 -28
  81. package/dist/sdk/read-output-rows.d.ts +11 -0
  82. package/dist/sdk/read-output-rows.js +47 -2
  83. package/dist/sdk/runtime-primitives.d.ts +1 -1
  84. package/dist/sdk/runtime-primitives.js +3 -3
  85. package/dist/sdk/runtime.js +5 -3
  86. package/docs/ASSURANCE.md +10 -1
  87. package/docs/COMMANDS.md +31 -2
  88. package/docs/READ_OUTPUT_CONTRACTS.md +44 -8
  89. package/docs/RELATIONSHIP_GRAPH.md +20 -5
  90. package/docs/SDK.md +12 -5
  91. package/docs/SDK_CONTEXT_INTEGRITY.md +32 -1
  92. package/docs/TESTING.md +23 -1
  93. package/docs/performance/sdk-entrypoint-import-costs.md +20 -13
  94. package/marketplace.json +2 -2
  95. package/package.json +6 -6
  96. package/packages/pm-beads/extensions/beads/index.ts +1 -0
  97. package/packages/pm-beads/package.json +1 -1
  98. package/packages/pm-calendar/extensions/calendar/index.ts +1 -0
  99. package/packages/pm-calendar/package.json +1 -1
  100. package/packages/pm-command-kit/package.json +1 -1
  101. package/packages/pm-digital-twin/extensions/digital-twin/index.ts +7 -0
  102. package/packages/pm-digital-twin/package.json +1 -1
  103. package/packages/pm-governance-audit/extensions/governance-audit/index.ts +4 -0
  104. package/packages/pm-governance-audit/package.json +1 -1
  105. package/packages/pm-guide-shell/extensions/guide-shell/index.ts +5 -0
  106. package/packages/pm-guide-shell/package.json +1 -1
  107. package/packages/pm-kanban/package.json +1 -1
  108. package/packages/pm-lifecycle-hooks/package.json +1 -1
  109. package/packages/pm-linked-test-adapters/extensions/linked-test-adapters/index.ts +6 -0
  110. package/packages/pm-linked-test-adapters/package.json +1 -1
  111. package/packages/pm-search-advanced/extensions/search-advanced/index.ts +2 -0
  112. package/packages/pm-search-advanced/package.json +1 -1
  113. package/packages/pm-templates/extensions/templates/index.ts +4 -0
  114. package/packages/pm-templates/package.json +1 -1
  115. package/packages/pm-todos/extensions/todos/index.ts +2 -0
  116. package/packages/pm-todos/package.json +1 -1
  117. package/packages/pm-vcs/extensions/vcs/index.ts +7 -0
  118. package/packages/pm-vcs/package.json +1 -1
  119. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  120. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  121. package/scripts/bundle-cli.mjs +17 -4
  122. package/sdk/public-surface.json +209 -29
  123. package/dist/cli-bundle/chunks/chunk-DL5M5J3V.js +0 -13
  124. package/dist/cli-bundle/chunks/chunk-HIUZVCMN.js +0 -5
  125. package/dist/cli-bundle/focused-chunks/chunk-27N23W6M.js +0 -31
  126. package/dist/cli-bundle/focused-chunks/chunk-3BNVU6LC.js +0 -8
  127. package/dist/cli-bundle/focused-chunks/chunk-6MLIRBLV.js +0 -5
  128. package/dist/cli-bundle/focused-chunks/chunk-6XYLENDV.js +0 -155
  129. package/dist/cli-bundle/focused-chunks/chunk-CP4K4WFS.js +0 -2
  130. package/dist/cli-bundle/focused-chunks/chunk-EBTNSFYE.js +0 -2
  131. package/dist/cli-bundle/focused-chunks/chunk-HC2OL2H2.js +0 -2
  132. package/dist/cli-bundle/focused-chunks/chunk-OGC4XSBC.js +0 -17
  133. package/dist/cli-bundle/focused-chunks/chunk-PKPOZXLL.js +0 -2
  134. package/dist/cli-bundle/focused-chunks/chunk-QQX5TDFT.js +0 -16
  135. package/dist/cli-bundle/focused-chunks/chunk-TEZIXMTH.js +0 -2
  136. package/dist/cli-bundle/focused-chunks/chunk-WEH6NSL6.js +0 -18
@@ -1,2 +1,2 @@
1
- import{t as E,u as R,v as U,w as r,x as J,y as f}from"./focused-chunks/chunk-27N23W6M.js";import"./focused-chunks/chunk-OOYYKQWX.js";import{$ as j,A as I,Aa as A,B as _,C as T,D as k,E as v,x as w,y as h,ya as q,z as D,za as z}from"./focused-chunks/chunk-OGC4XSBC.js";import"./focused-chunks/chunk-I75MANL7.js";import"./focused-chunks/chunk-NFHFZH2Z.js";import"./focused-chunks/chunk-HC2OL2H2.js";import{b as B,c as C,d as F,e as G,f as H}from"./focused-chunks/chunk-TEZIXMTH.js";import{ga as n,ha as d,ia as p,ja as x,ka as m,la as s,na as a,oa as i,pa as l,qa as u,ra as b,sa as g,ta as y,ua as c}from"./focused-chunks/chunk-WEH6NSL6.js";import"./focused-chunks/chunk-E3AVJ655.js";import"./focused-chunks/chunk-QDZUABWL.js";import"./focused-chunks/chunk-6XYLENDV.js";import"./focused-chunks/chunk-2RI2FESN.js";import"./focused-chunks/chunk-EBTNSFYE.js";import"./focused-chunks/chunk-CP4K4WFS.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="8e8c2de1-7bff-57c6-8e71-9c27e9e76eaa")}catch{}})();export{w as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,n as PM_MUTATION_ACTION_CONTRACTS,U as _testOnlyHealthCommand,C as _testOnlySimilarity,z as _testOnlyValidateCommand,v as acknowledgeUnknownAuthorHistoryEvents,k as acknowledgeUnknownAuthorHistoryEventsFromTransport,h as classifyHistoryAuthorEvent,p as evaluateMutationGuard,H as evaluateSimilarityGovernance,G as findDuplicateClusters,F as findSimilarItems,s as getMutationActionContract,D as inspectHistoryAuthorStream,y as inspectStaleInProgressItems,x as isMutationAction,a as jaccardSimilarity,m as listMutationActions,i as normalizeSimilarityText,T as parseUnknownAuthorHistoryEventCoordinates,u as prepareSimilarityText,q as projectValidateCounts,_ as resolveUnknownAuthorAcknowledgmentSelector,J as runGc,R as runHealth,f as runReindex,r as runUpgrade,A as runValidate,I as scanHistoryAuthorAttribution,d as scanMutationSecrets,E as scanProvenanceResolverHealth,c as scanStaleInProgressItems,j as scanStorageIntegrity,b as scoreItemSimilarity,g as scorePreparedItemSimilarity,B as similarityAdvisoryWarnings,l as tokenizeSimilarityText};
1
+ import{A as I,B as _,C as T,D as k,E as v,Ia as q,Ja as z,Ka as A,La as r,Ma as J,Na as f,aa as E,ha as R,ia as U,ja as j,x as w,y as h,z as D}from"./focused-chunks/chunk-QK753U3U.js";import"./focused-chunks/chunk-4DQ2YERC.js";import"./focused-chunks/chunk-WCVE2NIG.js";import"./focused-chunks/chunk-KYUQGTSB.js";import"./focused-chunks/chunk-SM7MTG27.js";import{Ea as B,Fa as C,Ga as F,Ha as G,Ia as H,ga as n,ha as d,ia as p,ja as x,ka as m,la as s,na as a,oa as i,pa as l,qa as u,ra as b,sa as g,ta as y,ua as c}from"./focused-chunks/chunk-XDNAW5OI.js";import"./focused-chunks/chunk-PPFGQDSI.js";import"./focused-chunks/chunk-QUMB2J27.js";import"./focused-chunks/chunk-PGXJQLCT.js";import"./focused-chunks/chunk-K7RWWOAG.js";import"./focused-chunks/chunk-ZM6TZVHC.js";import"./focused-chunks/chunk-Q4YY3XNF.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="8e8c2de1-7bff-57c6-8e71-9c27e9e76eaa")}catch{}})();export{w as HISTORY_AUTHOR_ATTRIBUTION_BASELINE,n as PM_MUTATION_ACTION_CONTRACTS,U as _testOnlyHealthCommand,C as _testOnlySimilarity,z as _testOnlyValidateCommand,v as acknowledgeUnknownAuthorHistoryEvents,k as acknowledgeUnknownAuthorHistoryEventsFromTransport,h as classifyHistoryAuthorEvent,p as evaluateMutationGuard,H as evaluateSimilarityGovernance,G as findDuplicateClusters,F as findSimilarItems,s as getMutationActionContract,D as inspectHistoryAuthorStream,y as inspectStaleInProgressItems,x as isMutationAction,a as jaccardSimilarity,m as listMutationActions,i as normalizeSimilarityText,T as parseUnknownAuthorHistoryEventCoordinates,u as prepareSimilarityText,q as projectValidateCounts,_ as resolveUnknownAuthorAcknowledgmentSelector,J as runGc,R as runHealth,f as runReindex,r as runUpgrade,A as runValidate,I as scanHistoryAuthorAttribution,d as scanMutationSecrets,E as scanProvenanceResolverHealth,c as scanStaleInProgressItems,j as scanStorageIntegrity,b as scoreItemSimilarity,g as scorePreparedItemSimilarity,B as similarityAdvisoryWarnings,l as tokenizeSimilarityText};
2
2
  //# sourceMappingURL=sdk-governance.js.map
@@ -1,2 +1,2 @@
1
- import{A as re,B as ne,C as ie,D as se,E as oe,F as ae,G as pe,H as de,I as ce,J as le,K as he,L as fe,M as ge,N as ue,O as me,P as ye,Q as we,R as be,a as Ce,b as $e,c as Oe,d as Pe,e as Ne,f as Me,g as H,h as B,i as W,j,k as ve,m as z,n as F,o as U,p as L,q as V,r as K,s as q,t as J,u as Z,v as Q,w as X,x as Y,y as ee,z as te}from"./focused-chunks/chunk-3BNVU6LC.js";import{d as O,e as P,f as N,g as M,h as v,i as k}from"./focused-chunks/chunk-HC2OL2H2.js";import{a as He,b as Be,c as We,d as je,e as ze,f as Fe,g as Ue}from"./focused-chunks/chunk-2JP7W7GO.js";import"./focused-chunks/chunk-6XYLENDV.js";import{ba as Ee,ca as _,da as S,ea as Se,fa as xe,ga as Ie,ha as De,ia as f,ja as Te}from"./focused-chunks/chunk-2RI2FESN.js";import"./focused-chunks/chunk-EBTNSFYE.js";import{aa as b,la as $}from"./focused-chunks/chunk-CP4K4WFS.js";import{createHash as Re}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4586a8b2-07c8-53d4-9c5d-ca557ee07977")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:Re("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function _e(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!_e(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function c(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await c(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await c(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function ke(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let d=n.get(o.kind);if(d&&b(d)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="423d6e5d-93e5-5f29-93e0-11ddca9c3156")}catch{}})();function x(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Ae(e){let t=x(e.nodeCount,"nodeCount"),r=x(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function I(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=S(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await c(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await c(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await c(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await c(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function Ge(e){return I(new m,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="2c3df51e-6b10-5da6-8340-126465d9c434")}catch{}})();import{createHash as D}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="54a3448c-719c-5404-a9b9-c3072a2fdce2")}catch{}})();function T(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function gt(e,t){let r=T(t.migrationId,"migrationId"),n=T(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),d=s.graph.edges().map(p=>{let E=D("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${E}`,relationshipId:`migration:${r}:${E}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=D("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:d})).digest("hex"),C=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=d.filter(p=>!C.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:d.length,skipped_existing_count:d.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b6d6f773-8336-5e0e-8dfb-d5729caa18d9")}catch{}})();export{He as ACTIONABILITY_ORDERING_KINDS,Ee as BUILTIN_RELATIONSHIP_KINDS,oe as GRAPH_DURABLE_CACHE_MIN_ITEMS,se as GRAPH_DURABLE_CACHE_VERSION,$ as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ce as RelationshipEventLog,$e as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,B as WorkspaceGraphCache,Pe as analyzeGraphImpact,Ne as analyzeKnowledgeGraph,Oe as analyzeRelationshipExecution,Y as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,Ge as assertMemoryRelationshipGraphAdapterConformance,De as assertRelationshipEdgeAllowed,I as assertRelationshipGraphAdapterConformance,ne as auditWorkspaceRelationshipGraph,ve as buildRelationshipContext,Se as canonicalizeRelationshipKind,le as clearDurableGraphCache,Be as collectBlockedByIds,je as collectBlockedByIdsFromCorpus,M as collectDanglingDependencyReferences,Fe as collectDependencyBlockedIds,N as collectDuplicateDependencyRows,re as collectDuplicateRelationshipEdgeGroups,v as collectMissingDependencyTargetIds,be as collectNewOrderingCycleWarnings,ee as collectOrderingCycles,Me as compareRelationshipSnapshots,Ue as computeActionabilityReport,Q as computeRelationshipCentrality,Z as computeRelationshipDominators,H as computeWorkspaceGraphFingerprint,Ae as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,S as createRelationshipKindRegistry,Te as dependencyToRelationship,q as detectRelationshipCommunities,ie as diffRelationshipAuditSnapshots,ae as durableGraphCachePath,he as durableGraphCacheStatus,V as enumerateRelationshipPaths,ke as federateRelationshipGraphSnapshots,J as findRedundantRelationshipEdges,X as findRelationshipCutStructure,K as forEachMatchedRelationshipEdge,te as formatDuplicateEdgeGroup,pe as graphAuditBaselinePath,z as hierarchyAncestors,F as hierarchyDescendants,We as indexBlockedByIds,Ie as isOrderingRelationshipKind,ge as loadGraphAuditBaseline,c as loadRelationshipGraphAdapter,O as normalizeDependencyGraphTarget,de as openDurableGraphCache,U as orderingPredecessors,L as orderingSuccessors,ye as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,ce as persistDurableGraphResult,gt as planRelationshipEventBackfill,me as planRelationshipRemediation,j as resetWorkspaceGraphCache,xe as resolveCanonicalRelationshipKind,ze as resolveItemBlockers,P as resolveWorkspaceRelationshipKindRegistry,we as runGraph,ue as saveGraphAuditBaseline,fe as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,W as workspaceGraphCache};
1
+ import{A as ne,B as ie,C as se,D as oe,E as ae,F as pe,G as de,H as ce,I as le,J as he,K as fe,L as ge,M as ue,N as me,O as ye,P as we,Q as be,R as Re,S as _e,a as $e,b as Pe,c as Ne,d as Me,e as ve,f as He,g as B,h as W,i as j,j as z,k as Be,m as F,n as U,o as L,p as V,q as K,r as q,s as J,t as Z,u as Q,v as X,w as Y,x as ee,y as te,z as re}from"./focused-chunks/chunk-F43TT2QQ.js";import{d as $,e as P,f as N,g as M,h as v,i as H,j as k}from"./focused-chunks/chunk-SM7MTG27.js";import{a as We,b as je,c as ze,d as Fe,e as Ue,f as Le,g as Ve}from"./focused-chunks/chunk-YOOI3UZX.js";import"./focused-chunks/chunk-PGXJQLCT.js";import{ba as xe,ca as _,da as E,ea as Ie,fa as De,ga as Te,ha as Ce,ia as f,ja as Oe}from"./focused-chunks/chunk-K7RWWOAG.js";import"./focused-chunks/chunk-ZM6TZVHC.js";import{aa as b,la as O}from"./focused-chunks/chunk-Q4YY3XNF.js";import{createHash as ke}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="4586a8b2-07c8-53d4-9c5d-ca557ee07977")}catch{}})();var A=1;function g(e){e?.throwIfAborted()}function l(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${t} must be non-empty`);return e.trim()}function u(e,t,r={}){let n=Date.parse(r.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),a=e.edges(),s=t.list();return Object.freeze({version:A,fingerprint:ke("sha256").update(b({nodes:i,edges:a,kinds:s})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:a,kinds:s})}function Ae(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Ae(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==A)throw new TypeError(`Unsupported relationship graph snapshot version: ${String(e.version)}`);if(!Array.isArray(e.nodes)||e.nodes.some(i=>typeof i!="string"))throw new TypeError("Relationship graph snapshot nodes must be strings");if(!Array.isArray(e.edges)||!Array.isArray(e.kinds))throw new TypeError("Relationship graph snapshot edges and kinds must be arrays");if(typeof e.created_at!="string"||!Number.isFinite(Date.parse(e.created_at)))throw new TypeError("Relationship graph snapshot created_at must be valid");if(typeof e.fingerprint!="string")throw new TypeError("Relationship graph snapshot fingerprint must be a string");let t=new _([]);for(let i of e.kinds)t.register(i);let r=new f(e.nodes,e.edges,t),n=u(r,t,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:t,graph:r}}async function c(e,t){l(e.name,"adapter name");let r=l(t.workspace,"workspace");g(t.signal);let n=await e.read({...t,workspace:r});return g(t.signal),n===null?null:y(n)}async function R(e,t){let r=l(t.workspace,"workspace"),n=y(t.snapshot).snapshot,i=await c(e,{workspace:r,signal:t.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:r,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(t.signal),await e.replace({workspace:r,signal:t.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await c(e,{workspace:r,signal:t.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:r,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function Ge(e,t={}){let r=e.map(y),n=new Map;for(let s of r)for(let o of s.snapshot.kinds){let d=n.get(o.kind);if(d&&b(d)!==b(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new _([...n.values()].sort((s,o)=>s.kind.localeCompare(o.kind))),a=new f(new Set(r.flatMap(s=>[...s.snapshot.nodes])),r.flatMap(s=>[...s.snapshot.edges]),i);return u(a,i,t)}var m=class{name;#e=new Map;constructor(t="memory"){this.name=l(t,"adapter name")}async read(t){g(t.signal);let r=this.#e.get(l(t.workspace,"workspace"));return r?structuredClone(r):null}async replace(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.set(r,structuredClone(y(t.snapshot).snapshot))}async clear(t){g(t.signal);let r=l(t.workspace,"workspace"),n=this.#e.get(r);if(t.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==t.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${r}`);this.#e.delete(r)}};(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="423d6e5d-93e5-5f29-93e0-11ddca9c3156")}catch{}})();function x(e,t){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${t} must be a positive integer`);return e}function Se(e){let t=x(e.nodeCount,"nodeCount"),r=x(e.edgeStride??1,"edgeStride"),n=e.topology??"chain";if(!["chain","star","disconnected"].includes(n))throw new TypeError(`Unsupported relationship graph topology: ${n}`);let i=(e.kind??"related").trim(),a=(e.idPrefix??"node").trim();if(!i||!a)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let s=n==="disconnected"?0:Math.floor((t-1)/r);return{node_count:t,edge_count:s,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<t;o+=1)yield`${a}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=r;o<t;o+=r)yield{source:`${a}-${n==="star"?0:o-r}`,target:`${a}-${o}`,kind:i}}}}}function h(e,t){if(!e)throw new Error(`Relationship graph adapter conformance: ${t}`)}async function I(e,t={}){let r=t.workspace?.trim()||"pm-graph-conformance",n=E(),i=u(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),a=u(new f(["a","b","c"],[{source:"a",target:"b",kind:"related"},{source:"b",target:"c",kind:"blocked_by"}],n),n,{createdAt:"2026-01-02T00:00:00.000Z"}),s=[];h(await c(e,{workspace:r})===null,"workspace must start empty"),s.push({name:"empty-read",passed:!0});let o=await R(e,{workspace:r,snapshot:i});h(o.disposition==="written","first sync must write"),s.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:r})).nodes.push("mutated-reader-copy"),h((await c(e,{workspace:r}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),s.push({name:"read-isolation",passed:!0}),h((await R(e,{workspace:r,snapshot:i})).disposition==="current","identical sync must be idempotent"),s.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:r,snapshot:a,expected_fingerprint:i.fingerprint}),h((await c(e,{workspace:r}))?.snapshot.fingerprint===a.fingerprint,"replacement must become visible"),s.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:r,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return h(w,"stale compare-and-swap must fail"),s.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:r,expected_fingerprint:a.fingerprint}),h(await c(e,{workspace:r})===null,"clear must remove the workspace"),s.push({name:"clear",passed:!0})),{adapter:e.name,workspace:r,cases:Object.freeze(s),clear_supported:e.clear!==void 0}}function Ee(e){return I(new m,e?{workspace:e}:{})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b5509c6e-1431-5316-a563-16681ced4f33")}catch{}})();import{createHash as D}from"node:crypto";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="54a3448c-719c-5404-a9b9-c3072a2fdce2")}catch{}})();function T(e,t){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${t} must be non-empty`);return e.trim()}function mt(e,t){let r=T(t.migrationId,"migrationId"),n=T(t.author,"author"),i=Date.parse(t.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let a=new Date(i).toISOString(),s=k(e,void 0,t.registry),o=s.graph.nodes(),d=s.graph.edges().map(p=>{let S=D("sha256").update(JSON.stringify([r,p.kind,p.source,p.target,p.createdAt??null,p.author??null,p.payload??null])).digest("hex").slice(0,24);return Object.freeze({eventId:`backfill:${r}:${S}`,relationshipId:`migration:${r}:${S}`,action:"add",edge:p,author:n,timestamp:a,reason:`Backfill ${r} from legacy item metadata`})}),w=D("sha256").update(JSON.stringify({migrationId:r,nodes:o,events:d})).digest("hex"),C=new Set([...t.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=d.filter(p=>!C.has(p.eventId));return Object.freeze({migration_id:r,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:d.length,skipped_existing_count:d.length-G.length,duplicate_dependency_rows:s.duplicateRows.length,dangling_reference_count:s.dangling.active.length+s.dangling.legacy_terminal.length})}(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="b6d6f773-8336-5e0e-8dfb-d5729caa18d9")}catch{}})();export{We as ACTIONABILITY_ORDERING_KINDS,xe as BUILTIN_RELATIONSHIP_KINDS,pe as GRAPH_DURABLE_CACHE_MIN_ITEMS,ae as GRAPH_DURABLE_CACHE_VERSION,O as GRAPH_SUBCOMMAND_VALUES,m as MemoryRelationshipGraphAdapter,A as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,$e as RelationshipEventLog,Pe as RelationshipEventStore,f as RelationshipGraph,_ as RelationshipKindRegistry,W as WorkspaceGraphCache,Me as analyzeGraphImpact,ve as analyzeKnowledgeGraph,Ne as analyzeRelationshipExecution,ee as analyzeRelationshipSchedule,k as assembleWorkspaceRelationshipGraph,Ee as assertMemoryRelationshipGraphAdapterConformance,Ce as assertRelationshipEdgeAllowed,I as assertRelationshipGraphAdapterConformance,se as auditWorkspaceRelationshipGraph,Be as buildRelationshipContext,Ie as canonicalizeRelationshipKind,fe as clearDurableGraphCache,je as collectBlockedByIds,Fe as collectBlockedByIdsFromCorpus,v as collectDanglingDependencyReferences,Le as collectDependencyBlockedIds,N as collectDuplicateDependencyRows,ie as collectDuplicateRelationshipEdgeGroups,H as collectMissingDependencyTargetIds,_e as collectNewOrderingCycleWarnings,te as collectOrderingCycles,M as collectOrderingStorageContradictions,He as compareRelationshipSnapshots,Ve as computeActionabilityReport,X as computeRelationshipCentrality,Q as computeRelationshipDominators,B as computeWorkspaceGraphFingerprint,Se as createRelationshipGraphScaleFixture,u as createRelationshipGraphSnapshot,E as createRelationshipKindRegistry,Oe as dependencyToRelationship,J as detectRelationshipCommunities,oe as diffRelationshipAuditSnapshots,de as durableGraphCachePath,ge as durableGraphCacheStatus,K as enumerateRelationshipPaths,Ge as federateRelationshipGraphSnapshots,Z as findRedundantRelationshipEdges,Y as findRelationshipCutStructure,q as forEachMatchedRelationshipEdge,ne as formatDuplicateEdgeGroup,re as formatOrderingStorageContradiction,ce as graphAuditBaselinePath,F as hierarchyAncestors,U as hierarchyDescendants,ze as indexBlockedByIds,Te as isOrderingRelationshipKind,me as loadGraphAuditBaseline,c as loadRelationshipGraphAdapter,$ as normalizeDependencyGraphTarget,le as openDurableGraphCache,L as orderingPredecessors,V as orderingSuccessors,be as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,he as persistDurableGraphResult,mt as planRelationshipEventBackfill,we as planRelationshipRemediation,z as resetWorkspaceGraphCache,De as resolveCanonicalRelationshipKind,Ue as resolveItemBlockers,P as resolveWorkspaceRelationshipKindRegistry,Re as runGraph,ye as saveGraphAuditBaseline,ue as shouldPersistDurableGraphCache,R as syncRelationshipGraphAdapter,j as workspaceGraphCache};
2
2
  //# sourceMappingURL=sdk-graph.js.map