@unbrained/pm-cli 2026.11.26 → 2026.11.27

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 (112) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/dist/cli-bundle/bundle-manifest.json +1 -1
  3. package/dist/cli-bundle/chunks/{chunk-LNZKNVMT.js → chunk-5CMR4R5V.js} +2 -2
  4. package/dist/cli-bundle/chunks/{chunk-7F3UFYZA.js → chunk-5M7UTO2G.js} +2 -2
  5. package/dist/cli-bundle/chunks/{chunk-B2GM6KOM.js → chunk-63AVXDZS.js} +2 -2
  6. package/dist/cli-bundle/chunks/{chunk-NDS4MXZX.js → chunk-66TNCHHG.js} +2 -2
  7. package/dist/cli-bundle/chunks/{chunk-5AAIRHNE.js → chunk-6NJ3BONB.js} +2 -2
  8. package/dist/cli-bundle/chunks/{chunk-HTGN24XM.js → chunk-AVHRMUXJ.js} +2 -2
  9. package/dist/cli-bundle/chunks/{chunk-KCRRTJ4X.js → chunk-HTT52JL3.js} +37 -37
  10. package/dist/cli-bundle/chunks/{chunk-GQXK4KKH.js → chunk-J25DZRYJ.js} +2 -2
  11. package/dist/cli-bundle/chunks/{chunk-QMM46SJM.js → chunk-J6TFG34A.js} +2 -2
  12. package/dist/cli-bundle/chunks/{chunk-IGW3RVJC.js → chunk-JX475QVU.js} +2 -2
  13. package/dist/cli-bundle/chunks/{chunk-MNFCJNQA.js → chunk-KP75JTTO.js} +2 -2
  14. package/dist/cli-bundle/chunks/{chunk-T3GJPXIZ.js → chunk-KS47NGMQ.js} +2 -2
  15. package/dist/cli-bundle/chunks/{chunk-PQSEEVOA.js → chunk-O23KTJL6.js} +5 -5
  16. package/dist/cli-bundle/chunks/{chunk-KES4VHU4.js → chunk-OFX2VA5Z.js} +2 -2
  17. package/dist/cli-bundle/chunks/{chunk-HOLQZ56F.js → chunk-QVDEZBSV.js} +2 -2
  18. package/dist/cli-bundle/chunks/{chunk-BITDGTAX.js → chunk-SIRZ4VMT.js} +2 -2
  19. package/dist/cli-bundle/chunks/{chunk-XRCE4QNL.js → chunk-VC4BJIA7.js} +2 -2
  20. package/dist/cli-bundle/chunks/{chunk-FWBR3OW7.js → chunk-W7SPEGSP.js} +2 -2
  21. package/dist/cli-bundle/chunks/chunk-WY7467RY.js +3 -0
  22. package/dist/cli-bundle/chunks/{chunk-5FY2VHRF.js → chunk-X6TE47CS.js} +2 -2
  23. package/dist/cli-bundle/chunks/{chunk-5BPDT7G2.js → chunk-XB6QEVUK.js} +2 -2
  24. package/dist/cli-bundle/chunks/chunk-XYX4CXFR.js +2 -0
  25. package/dist/cli-bundle/chunks/{chunk-ZDL45VTB.js → chunk-Y5U7QCNX.js} +2 -2
  26. package/dist/cli-bundle/chunks/{chunk-CBBKXTJG.js → chunk-YGK6SA7P.js} +2 -2
  27. package/dist/cli-bundle/chunks/{chunk-DYL2N3OC.js → chunk-ZGV4ZXDS.js} +2 -2
  28. package/dist/cli-bundle/chunks/{chunk-WZOJSHJT.js → chunk-ZILIHDDY.js} +41 -41
  29. package/dist/cli-bundle/chunks/{field-option-collisions-CGRJEAPQ.js → field-option-collisions-UL6BIPAK.js} +2 -2
  30. package/dist/cli-bundle/chunks/{item-revision-FGDR5NSF.js → item-revision-WNUDY5DM.js} +2 -2
  31. package/dist/cli-bundle/chunks/item-transaction-ER3OWOPV.js +2 -0
  32. package/dist/cli-bundle/chunks/{mutation-actor-HGG47KXV.js → mutation-actor-SFYTD2ZB.js} +2 -2
  33. package/dist/cli-bundle/chunks/{mutation-admission-LLHIRY6O.js → mutation-admission-AVOOT3KH.js} +2 -2
  34. package/dist/cli-bundle/chunks/{register-list-query-EKSCZWEZ.js → register-list-query-Q7UW2EPV.js} +2 -2
  35. package/dist/cli-bundle/chunks/{register-mutation-ZIAOKKUJ.js → register-mutation-YNW7E3T4.js} +2 -2
  36. package/dist/cli-bundle/chunks/{register-operations-ECVBZ5FM.js → register-operations-DAUTQCIO.js} +2 -2
  37. package/dist/cli-bundle/chunks/{register-setup-3QYD5H4H.js → register-setup-VSURGF7V.js} +2 -2
  38. package/dist/cli-bundle/chunks/{stage-RSCSUYEJ.js → stage-N5GDBS5A.js} +2 -2
  39. package/dist/cli-bundle/focused-chunks/{chunk-AAB3ZR7Z.js → chunk-24W63UPP.js} +2 -2
  40. package/dist/cli-bundle/focused-chunks/{chunk-AVLB4L7M.js → chunk-2XGHBYDA.js} +5 -5
  41. package/dist/cli-bundle/focused-chunks/{chunk-JUG3BAZZ.js → chunk-3QRMY6KF.js} +2 -2
  42. package/dist/cli-bundle/focused-chunks/{chunk-RDELKGLS.js → chunk-4HLZOOZI.js} +2 -2
  43. package/dist/cli-bundle/focused-chunks/chunk-52PHSTGP.js +27 -0
  44. package/dist/cli-bundle/focused-chunks/{chunk-QNWNUQSJ.js → chunk-7FKGIJEB.js} +2 -2
  45. package/dist/cli-bundle/focused-chunks/{chunk-QSRXF6XS.js → chunk-7GZMOLQY.js} +2 -2
  46. package/dist/cli-bundle/focused-chunks/{chunk-GQBWI4KA.js → chunk-AL47ODFZ.js} +2 -2
  47. package/dist/cli-bundle/focused-chunks/{chunk-KEZ4VXYD.js → chunk-AN4NFFLL.js} +2 -2
  48. package/dist/cli-bundle/focused-chunks/{chunk-FW5Q26HA.js → chunk-B2HJI6KA.js} +2 -2
  49. package/dist/cli-bundle/focused-chunks/{chunk-YNRW2FWB.js → chunk-C2HW7BSE.js} +2 -2
  50. package/dist/cli-bundle/focused-chunks/{chunk-IWEGGRRD.js → chunk-GISZWMBS.js} +2 -2
  51. package/dist/cli-bundle/focused-chunks/{chunk-3GQRWIT5.js → chunk-GUAT4OAC.js} +2 -2
  52. package/dist/cli-bundle/focused-chunks/{chunk-3BR5NWQI.js → chunk-H4JBS477.js} +2 -2
  53. package/dist/cli-bundle/focused-chunks/{chunk-NSFS3VWP.js → chunk-HGJ4MILN.js} +37 -37
  54. package/dist/cli-bundle/focused-chunks/{chunk-NXUFVQ33.js → chunk-HSWL6L2O.js} +2 -2
  55. package/dist/cli-bundle/focused-chunks/{chunk-RMJKVQYE.js → chunk-I4GY7HAP.js} +2 -2
  56. package/dist/cli-bundle/focused-chunks/{chunk-UA2JNKMY.js → chunk-KMG4O2IU.js} +2 -2
  57. package/dist/cli-bundle/focused-chunks/{chunk-YSZZSV6M.js → chunk-N7ZAMULP.js} +2 -2
  58. package/dist/cli-bundle/focused-chunks/{chunk-TNVLDU7Z.js → chunk-REORRDPH.js} +2 -2
  59. package/dist/cli-bundle/focused-chunks/{chunk-WHHFPATO.js → chunk-SXWUKNTY.js} +2 -2
  60. package/dist/cli-bundle/focused-chunks/{chunk-FQWKESMI.js → chunk-UGQ2EXTU.js} +2 -2
  61. package/dist/cli-bundle/focused-chunks/chunk-YPOATPTX.js +3 -0
  62. package/dist/cli-bundle/focused-chunks/{chunk-VV2QF5IE.js → chunk-ZZYJS74B.js} +2 -2
  63. package/dist/cli-bundle/focused-chunks/{field-option-collisions-WV6GPYYP.js → field-option-collisions-BP7ILGQK.js} +2 -2
  64. package/dist/cli-bundle/focused-chunks/{item-revision-RPTXN7WW.js → item-revision-NOHVIOQQ.js} +2 -2
  65. package/dist/cli-bundle/focused-chunks/{item-transaction-A6MVNPT7.js → item-transaction-O26COBOJ.js} +2 -2
  66. package/dist/cli-bundle/focused-chunks/{mutation-actor-6ZVW6OME.js → mutation-actor-HVJV5S76.js} +2 -2
  67. package/dist/cli-bundle/focused-chunks/{mutation-admission-2DA4CINP.js → mutation-admission-JRICEVYN.js} +2 -2
  68. package/dist/cli-bundle/focused-chunks/{stage-RG3PKST7.js → stage-NSX6ASBZ.js} +2 -2
  69. package/dist/cli-bundle/main.js +2 -2
  70. package/dist/cli-bundle/sdk-authoring.js +1 -1
  71. package/dist/cli-bundle/sdk-contracts.js +1 -1
  72. package/dist/cli-bundle/sdk-core.js +1 -1
  73. package/dist/cli-bundle/sdk-governance.js +1 -1
  74. package/dist/cli-bundle/sdk-graph.js +1 -1
  75. package/dist/cli-bundle/sdk-merge.js +51 -51
  76. package/dist/cli-bundle/sdk-query.js +1 -1
  77. package/dist/cli-bundle/sdk-runtime.js +1 -1
  78. package/dist/cli-bundle/sdk-testing.js +1 -1
  79. package/dist/cli-bundle/sdk.js +1 -1
  80. package/dist/core/extensions/index.js +1 -1
  81. package/dist/core/shared/command-line.d.ts +2 -2
  82. package/dist/core/shared/command-line.js +1 -1
  83. package/dist/core/shared/secret-rules.js +5 -5
  84. package/docs/CONFIGURATION.md +1 -1
  85. package/docs/MUTATION_INTEGRITY.md +47 -0
  86. package/docs/SDK.md +3 -1
  87. package/marketplace.json +1 -1
  88. package/package.json +1 -1
  89. package/packages/pm-beads/package.json +1 -1
  90. package/packages/pm-calendar/package.json +1 -1
  91. package/packages/pm-command-kit/package.json +1 -1
  92. package/packages/pm-digital-twin/package.json +1 -1
  93. package/packages/pm-governance-audit/package.json +1 -1
  94. package/packages/pm-guide-shell/package.json +1 -1
  95. package/packages/pm-kanban/package.json +1 -1
  96. package/packages/pm-lifecycle-hooks/package.json +1 -1
  97. package/packages/pm-linked-test-adapters/package.json +1 -1
  98. package/packages/pm-search-advanced/package.json +1 -1
  99. package/packages/pm-templates/package.json +1 -1
  100. package/packages/pm-todos/package.json +1 -1
  101. package/packages/pm-vcs/package.json +1 -1
  102. package/plugins/pm-claude/.claude-plugin/plugin.json +1 -1
  103. package/plugins/pm-claude/package.json +1 -1
  104. package/plugins/pm-codex/.codex-plugin/plugin.json +1 -1
  105. package/plugins/pm-codex/package.json +1 -1
  106. package/plugins/pm-codex/plugin.json +1 -1
  107. package/runtime-dependencies.json +1 -1
  108. package/dist/cli-bundle/chunks/chunk-DUJSME77.js +0 -3
  109. package/dist/cli-bundle/chunks/chunk-RFK3ERYX.js +0 -2
  110. package/dist/cli-bundle/chunks/item-transaction-C3KAMEYO.js +0 -2
  111. package/dist/cli-bundle/focused-chunks/chunk-R6QFPHWW.js +0 -3
  112. package/dist/cli-bundle/focused-chunks/chunk-RFJ3MEFP.js +0 -27
@@ -1,2 +1,2 @@
1
- import{a as Ze,b as Qe,c as Ee,e as Ce}from"./focused-chunks/chunk-NXUFVQ33.js";import{A as ue,B as ye,C as we,D as Re,E as be,F as ke,G as Ae,H as _e,I as Ge,J as Se,K as xe,a as Xe,b as Ye,c as er,d as rr,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as re,m as te,n as ne,o as ie,p as ae,q as oe,r as se,s as pe,t as ce,u as he,v as de,w as le,x as fe,y as ge,z as me}from"./focused-chunks/chunk-JUG3BAZZ.js";import{d as $,e as H,f as M,g as N,h as P,i as v,j as B,k as z,l as W,m as j,n as F,p as A,q as U,r as L,s as V,t as K,u as tr,v as nr}from"./focused-chunks/chunk-YNRW2FWB.js";import{a as We,b as je,c as Fe,d as Ue,e as Le,f as Ve,g as Ke,h as qe,i as Je}from"./focused-chunks/chunk-3BR5NWQI.js";import"./focused-chunks/chunk-BKPUUW5O.js";import"./focused-chunks/chunk-VV2QF5IE.js";import"./focused-chunks/chunk-WHHFPATO.js";import{a as ze}from"./focused-chunks/chunk-BWOVFE5B.js";import"./focused-chunks/chunk-X6CXWWNB.js";import{o as He,p as k,q as x,r as Me,s as Ne,t as Pe,u as ve,v as f,va as O,w as Be}from"./focused-chunks/chunk-NSFS3VWP.js";import{c as R}from"./focused-chunks/chunk-R6QFPHWW.js";import"./focused-chunks/chunk-OCKKIECS.js";import"./focused-chunks/chunk-NGFDPEP7.js";import{createHash as Te}from"node:crypto";var _=1;function g(e){e?.throwIfAborted()}function d(e,r){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${r} must be non-empty`);return e.trim()}function m(e,r,t={}){let n=Date.parse(t.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),s=e.edges(),a=r.list();return Object.freeze({version:_,fingerprint:Te("sha256").update(R({nodes:i,edges:s,kinds:a})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:s,kinds:a})}function Ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Ie(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==_)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 r=new k([]);for(let i of e.kinds)r.register(i);let t=new f(e.nodes,e.edges,r),n=m(t,r,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:r,graph:t}}async function h(e,r){d(e.name,"adapter name");let t=d(r.workspace,"workspace");g(r.signal);let n=await e.read({...r,workspace:t});return g(r.signal),n===null?null:y(n)}async function b(e,r){let t=d(r.workspace,"workspace"),n=y(r.snapshot).snapshot,i=await h(e,{workspace:t,signal:r.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:t,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(r.signal),await e.replace({workspace:t,signal:r.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await h(e,{workspace:t,signal:r.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:t,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function De(e,r={}){let t=e.map(y),n=new Map;for(let a of t)for(let o of a.snapshot.kinds){let c=n.get(o.kind);if(c&&R(c)!==R(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new k([...n.values()].sort((a,o)=>a.kind.localeCompare(o.kind))),s=new f(new Set(t.flatMap(a=>[...a.snapshot.nodes])),t.flatMap(a=>[...a.snapshot.edges]),i);return m(s,i,r)}var u=class{name;#e=new Map;constructor(r="memory"){this.name=d(r,"adapter name")}async read(r){g(r.signal);let t=this.#e.get(d(r.workspace,"workspace"));return t?structuredClone(t):null}async replace(r){g(r.signal);let t=d(r.workspace,"workspace"),n=this.#e.get(t);if(r.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==r.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${t}`);this.#e.set(t,structuredClone(y(r.snapshot).snapshot))}async clear(r){g(r.signal);let t=d(r.workspace,"workspace"),n=this.#e.get(t);if(r.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==r.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${t}`);this.#e.delete(t)}};function E(e,r){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${r} must be a positive integer`);return e}function Oe(e){let r=E(e.nodeCount,"nodeCount"),t=E(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(),s=(e.idPrefix??"node").trim();if(!i||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let a=n==="disconnected"?0:Math.floor((r-1)/t);return{node_count:r,edge_count:a,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<r;o+=1)yield`${s}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=t;o<r;o+=t)yield{source:`${s}-${n==="star"?0:o-t}`,target:`${s}-${o}`,kind:i}}}}}function l(e,r){if(!e)throw new Error(`Relationship graph adapter conformance: ${r}`)}async function C(e,r={}){let t=r.workspace?.trim()||"pm-graph-conformance",n=x(),i=m(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),s=m(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"}),a=[];l(await h(e,{workspace:t})===null,"workspace must start empty"),a.push({name:"empty-read",passed:!0});let o=await b(e,{workspace:t,snapshot:i});l(o.disposition==="written","first sync must write"),a.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:t})).nodes.push("mutated-reader-copy"),l((await h(e,{workspace:t}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),a.push({name:"read-isolation",passed:!0}),l((await b(e,{workspace:t,snapshot:i})).disposition==="current","identical sync must be idempotent"),a.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:t,snapshot:s,expected_fingerprint:i.fingerprint}),l((await h(e,{workspace:t}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),a.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:t,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return l(w,"stale compare-and-swap must fail"),a.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:t,expected_fingerprint:s.fingerprint}),l(await h(e,{workspace:t})===null,"clear must remove the workspace"),a.push({name:"clear",passed:!0})),{adapter:e.name,workspace:t,cases:Object.freeze(a),clear_supported:e.clear!==void 0}}function $e(e){return C(new u,e?{workspace:e}:{})}import{createHash as T}from"node:crypto";function I(e,r){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${r} must be non-empty`);return e.trim()}function Dr(e,r){let t=I(r.migrationId,"migrationId"),n=I(r.author,"author"),i=Date.parse(r.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(i).toISOString(),a=A(e,void 0,r.registry),o=a.graph.nodes(),c=a.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([t,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:${t}:${S}`,relationshipId:`migration:${t}:${S}`,action:"add",edge:p,author:n,timestamp:s,reason:`Backfill ${t} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:t,nodes:o,events:c})).digest("hex"),D=new Set([...r.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!D.has(p.eventId));return Object.freeze({migration_id:t,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:a.duplicateRows.length,dangling_reference_count:a.dangling.active.length+a.dangling.legacy_terminal.length})}export{je as ACTIONABILITY_ORDERING_KINDS,He as BUILTIN_RELATIONSHIP_KINDS,tr as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,ze as GRAPH_QUERY_DEFAULTS,O as GRAPH_SUBCOMMAND_VALUES,u as MemoryRelationshipGraphAdapter,_ as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ze as RelationshipEventLog,Qe as RelationshipEventStore,f as RelationshipGraph,k as RelationshipKindRegistry,L as WorkspaceGraphCache,Ye as analyzeGraphImpact,M as analyzeHierarchyIntegrity,er as analyzeKnowledgeGraph,Xe as analyzeRelationshipExecution,ae as analyzeRelationshipSchedule,A as assembleWorkspaceRelationshipGraph,v as assertHierarchyMutationAllowed,$e as assertMemoryRelationshipGraphAdapterConformance,Ce as assertNonHierarchyCardinalityMutationAllowed,ve as assertRelationshipEdgeAllowed,C as assertRelationshipGraphAdapterConformance,de as auditWorkspaceRelationshipGraph,nr as buildRelationshipContext,Me as canonicalizeRelationshipKind,Re as clearDurableGraphCache,Fe as collectBlockedByIds,Le as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Ke as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,he as collectDuplicateRelationshipEdgeGroups,H as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ee as collectNewOrderingCycleWarnings,se as collectOrderingCycles,W as collectOrderingStorageContradictions,rr as compareRelationshipSnapshots,Je as computeActionabilityReport,ne as computeRelationshipCentrality,te as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,m as createRelationshipGraphSnapshot,x as createRelationshipKindRegistry,Be as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,le as diffRelationshipAuditSnapshots,me as durableGraphCachePath,be as durableGraphCacheStatus,X as enumerateRelationshipPaths,De as federateRelationshipGraphSnapshots,re as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,N as formatHierarchyRelation,pe as formatOrderingStorageContradiction,ue as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Ue as indexBlockedByIds,P as indexHierarchyRelations,Pe as isOrderingRelationshipKind,Ae as loadGraphAuditBaseline,h as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Dr as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,Ne as resolveCanonicalRelationshipKind,Ve as resolveItemBlockers,We as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,xe as runGraph,_e as saveGraphAuditBaseline,qe as selectActionableEntries,ke as shouldPersistDurableGraphCache,b as syncRelationshipGraphAdapter,V as workspaceGraphCache};
1
+ import{a as Ze,b as Qe,c as Ee,e as Ce}from"./focused-chunks/chunk-HSWL6L2O.js";import{A as ue,B as ye,C as we,D as Re,E as be,F as ke,G as Ae,H as _e,I as Ge,J as Se,K as xe,a as Xe,b as Ye,c as er,d as rr,e as q,f as J,g as Z,h as Q,i as X,j as Y,k as ee,l as re,m as te,n as ne,o as ie,p as ae,q as oe,r as se,s as pe,t as ce,u as he,v as de,w as le,x as fe,y as ge,z as me}from"./focused-chunks/chunk-3QRMY6KF.js";import{d as $,e as H,f as M,g as N,h as P,i as v,j as B,k as z,l as W,m as j,n as F,p as A,q as U,r as L,s as V,t as K,u as tr,v as nr}from"./focused-chunks/chunk-C2HW7BSE.js";import{a as We,b as je,c as Fe,d as Ue,e as Le,f as Ve,g as Ke,h as qe,i as Je}from"./focused-chunks/chunk-H4JBS477.js";import"./focused-chunks/chunk-BKPUUW5O.js";import"./focused-chunks/chunk-ZZYJS74B.js";import"./focused-chunks/chunk-SXWUKNTY.js";import{a as ze}from"./focused-chunks/chunk-BWOVFE5B.js";import"./focused-chunks/chunk-X6CXWWNB.js";import{o as He,p as k,q as x,r as Me,s as Ne,t as Pe,u as ve,v as f,va as O,w as Be}from"./focused-chunks/chunk-HGJ4MILN.js";import{c as R}from"./focused-chunks/chunk-YPOATPTX.js";import"./focused-chunks/chunk-OCKKIECS.js";import"./focused-chunks/chunk-NGFDPEP7.js";import{createHash as Te}from"node:crypto";var _=1;function g(e){e?.throwIfAborted()}function d(e,r){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship graph ${r} must be non-empty`);return e.trim()}function m(e,r,t={}){let n=Date.parse(t.createdAt??new Date().toISOString());if(!Number.isFinite(n))throw new TypeError("Relationship graph createdAt must be a valid timestamp");let i=e.nodes(),s=e.edges(),a=r.list();return Object.freeze({version:_,fingerprint:Te("sha256").update(R({nodes:i,edges:s,kinds:a})).digest("hex"),created_at:new Date(n).toISOString(),nodes:i,edges:s,kinds:a})}function Ie(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function y(e){if(!Ie(e))throw new TypeError("Relationship graph snapshot must be an object");if(e.version!==_)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 r=new k([]);for(let i of e.kinds)r.register(i);let t=new f(e.nodes,e.edges,r),n=m(t,r,{createdAt:e.created_at});if(n.fingerprint!==e.fingerprint)throw new TypeError("Relationship graph snapshot fingerprint mismatch");return{snapshot:n,registry:r,graph:t}}async function h(e,r){d(e.name,"adapter name");let t=d(r.workspace,"workspace");g(r.signal);let n=await e.read({...r,workspace:t});return g(r.signal),n===null?null:y(n)}async function b(e,r){let t=d(r.workspace,"workspace"),n=y(r.snapshot).snapshot,i=await h(e,{workspace:t,signal:r.signal});if(i?.snapshot.fingerprint===n.fingerprint)return{adapter:e.name,workspace:t,disposition:"current",fingerprint:n.fingerprint,previous_fingerprint:i.snapshot.fingerprint,node_count:n.nodes.length,edge_count:n.edges.length};if(g(r.signal),await e.replace({workspace:t,signal:r.signal,snapshot:n,expected_fingerprint:i?.snapshot.fingerprint??null}),(await h(e,{workspace:t,signal:r.signal}))?.snapshot.fingerprint!==n.fingerprint)throw new Error(`Relationship graph adapter "${e.name}" did not expose the replaced snapshot`);return{adapter:e.name,workspace:t,disposition:"written",fingerprint:n.fingerprint,...i?{previous_fingerprint:i.snapshot.fingerprint}:{},node_count:n.nodes.length,edge_count:n.edges.length}}function De(e,r={}){let t=e.map(y),n=new Map;for(let a of t)for(let o of a.snapshot.kinds){let c=n.get(o.kind);if(c&&R(c)!==R(o))throw new TypeError(`Conflicting federated relationship kind: ${o.kind}`);n.set(o.kind,o)}let i=new k([...n.values()].sort((a,o)=>a.kind.localeCompare(o.kind))),s=new f(new Set(t.flatMap(a=>[...a.snapshot.nodes])),t.flatMap(a=>[...a.snapshot.edges]),i);return m(s,i,r)}var u=class{name;#e=new Map;constructor(r="memory"){this.name=d(r,"adapter name")}async read(r){g(r.signal);let t=this.#e.get(d(r.workspace,"workspace"));return t?structuredClone(t):null}async replace(r){g(r.signal);let t=d(r.workspace,"workspace"),n=this.#e.get(t);if(r.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==r.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${t}`);this.#e.set(t,structuredClone(y(r.snapshot).snapshot))}async clear(r){g(r.signal);let t=d(r.workspace,"workspace"),n=this.#e.get(t);if(r.expected_fingerprint!==void 0&&(n?.fingerprint??null)!==r.expected_fingerprint)throw new Error(`Relationship graph adapter conflict for ${t}`);this.#e.delete(t)}};function E(e,r){if(!Number.isInteger(e)||e<1)throw new TypeError(`Relationship graph ${r} must be a positive integer`);return e}function Oe(e){let r=E(e.nodeCount,"nodeCount"),t=E(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(),s=(e.idPrefix??"node").trim();if(!i||!s)throw new TypeError("Relationship graph kind and idPrefix must be non-empty");let a=n==="disconnected"?0:Math.floor((r-1)/t);return{node_count:r,edge_count:a,edge_basis:"fixture_generated",nodes:{*[Symbol.iterator](){for(let o=0;o<r;o+=1)yield`${s}-${o}`}},edges:{*[Symbol.iterator](){if(n!=="disconnected")for(let o=t;o<r;o+=t)yield{source:`${s}-${n==="star"?0:o-t}`,target:`${s}-${o}`,kind:i}}}}}function l(e,r){if(!e)throw new Error(`Relationship graph adapter conformance: ${r}`)}async function C(e,r={}){let t=r.workspace?.trim()||"pm-graph-conformance",n=x(),i=m(new f(["a","b"],[{source:"a",target:"b",kind:"related"}],n),n,{createdAt:"2026-01-01T00:00:00.000Z"}),s=m(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"}),a=[];l(await h(e,{workspace:t})===null,"workspace must start empty"),a.push({name:"empty-read",passed:!0});let o=await b(e,{workspace:t,snapshot:i});l(o.disposition==="written","first sync must write"),a.push({name:"atomic-replace",passed:!0}),(await e.read({workspace:t})).nodes.push("mutated-reader-copy"),l((await h(e,{workspace:t}))?.snapshot.nodes.length===2,"reads must not mutate stored state"),a.push({name:"read-isolation",passed:!0}),l((await b(e,{workspace:t,snapshot:i})).disposition==="current","identical sync must be idempotent"),a.push({name:"idempotent-sync",passed:!0}),await e.replace({workspace:t,snapshot:s,expected_fingerprint:i.fingerprint}),l((await h(e,{workspace:t}))?.snapshot.fingerprint===s.fingerprint,"replacement must become visible"),a.push({name:"replacement-visibility",passed:!0});let w=!1;try{await e.replace({workspace:t,snapshot:i,expected_fingerprint:i.fingerprint})}catch{w=!0}return l(w,"stale compare-and-swap must fail"),a.push({name:"stale-cas",passed:!0}),e.clear&&(await e.clear({workspace:t,expected_fingerprint:s.fingerprint}),l(await h(e,{workspace:t})===null,"clear must remove the workspace"),a.push({name:"clear",passed:!0})),{adapter:e.name,workspace:t,cases:Object.freeze(a),clear_supported:e.clear!==void 0}}function $e(e){return C(new u,e?{workspace:e}:{})}import{createHash as T}from"node:crypto";function I(e,r){if(typeof e!="string"||e.trim().length===0)throw new TypeError(`Relationship backfill ${r} must be non-empty`);return e.trim()}function Dr(e,r){let t=I(r.migrationId,"migrationId"),n=I(r.author,"author"),i=Date.parse(r.timestamp);if(!Number.isFinite(i))throw new TypeError("Relationship backfill timestamp must be valid");let s=new Date(i).toISOString(),a=A(e,void 0,r.registry),o=a.graph.nodes(),c=a.graph.edges().map(p=>{let S=T("sha256").update(JSON.stringify([t,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:${t}:${S}`,relationshipId:`migration:${t}:${S}`,action:"add",edge:p,author:n,timestamp:s,reason:`Backfill ${t} from legacy item metadata`})}),w=T("sha256").update(JSON.stringify({migrationId:t,nodes:o,events:c})).digest("hex"),D=new Set([...r.existingEventIds??[]].filter(p=>typeof p=="string").map(p=>p.trim()).filter(Boolean)),G=c.filter(p=>!D.has(p.eventId));return Object.freeze({migration_id:t,fingerprint:w,nodes:o,events:Object.freeze(G),edge_count:c.length,skipped_existing_count:c.length-G.length,duplicate_dependency_rows:a.duplicateRows.length,dangling_reference_count:a.dangling.active.length+a.dangling.legacy_terminal.length})}export{je as ACTIONABILITY_ORDERING_KINDS,He as BUILTIN_RELATIONSHIP_KINDS,tr as DEFAULT_RELATIONSHIP_CONTEXT_TOKEN_BUDGET,ge as GRAPH_DURABLE_CACHE_MIN_ITEMS,fe as GRAPH_DURABLE_CACHE_VERSION,ze as GRAPH_QUERY_DEFAULTS,O as GRAPH_SUBCOMMAND_VALUES,u as MemoryRelationshipGraphAdapter,_ as RELATIONSHIP_GRAPH_SNAPSHOT_VERSION,Ze as RelationshipEventLog,Qe as RelationshipEventStore,f as RelationshipGraph,k as RelationshipKindRegistry,L as WorkspaceGraphCache,Ye as analyzeGraphImpact,M as analyzeHierarchyIntegrity,er as analyzeKnowledgeGraph,Xe as analyzeRelationshipExecution,ae as analyzeRelationshipSchedule,A as assembleWorkspaceRelationshipGraph,v as assertHierarchyMutationAllowed,$e as assertMemoryRelationshipGraphAdapterConformance,Ce as assertNonHierarchyCardinalityMutationAllowed,ve as assertRelationshipEdgeAllowed,C as assertRelationshipGraphAdapterConformance,de as auditWorkspaceRelationshipGraph,nr as buildRelationshipContext,Me as canonicalizeRelationshipKind,Re as clearDurableGraphCache,Fe as collectBlockedByIds,Le as collectBlockedByIdsFromCorpus,j as collectDanglingDependencyReferences,Ke as collectDependencyBlockedIds,z as collectDuplicateDependencyRows,he as collectDuplicateRelationshipEdgeGroups,H as collectHierarchyRelations,F as collectMissingDependencyTargetIds,Ee as collectNewOrderingCycleWarnings,se as collectOrderingCycles,W as collectOrderingStorageContradictions,rr as compareRelationshipSnapshots,Je as computeActionabilityReport,ne as computeRelationshipCentrality,te as computeRelationshipDominators,U as computeWorkspaceGraphFingerprint,Oe as createRelationshipGraphScaleFixture,m as createRelationshipGraphSnapshot,x as createRelationshipKindRegistry,Be as dependencyToRelationship,oe as deriveRelationshipDeadlines,ee as detectRelationshipCommunities,le as diffRelationshipAuditSnapshots,me as durableGraphCachePath,be as durableGraphCacheStatus,X as enumerateRelationshipPaths,De as federateRelationshipGraphSnapshots,re as findRedundantRelationshipEdges,ie as findRelationshipCutStructure,Y as forEachMatchedRelationshipEdge,ce as formatDuplicateEdgeGroup,N as formatHierarchyRelation,pe as formatOrderingStorageContradiction,ue as graphAuditBaselinePath,q as hierarchyAncestors,J as hierarchyDescendants,Ue as indexBlockedByIds,P as indexHierarchyRelations,Pe as isOrderingRelationshipKind,Ae as loadGraphAuditBaseline,h as loadRelationshipGraphAdapter,B as normalizeDependencyGraphTarget,ye as openDurableGraphCache,Z as orderingPredecessors,Q as orderingSuccessors,Se as parseGraphSubcommand,y as parseRelationshipGraphSnapshot,we as persistDurableGraphResult,Dr as planRelationshipEventBackfill,Ge as planRelationshipRemediation,K as resetWorkspaceGraphCache,Ne as resolveCanonicalRelationshipKind,Ve as resolveItemBlockers,We as resolveItemExecutionRole,$ as resolveWorkspaceRelationshipKindRegistry,xe as runGraph,_e as saveGraphAuditBaseline,qe as selectActionableEntries,ke as shouldPersistDurableGraphCache,b as syncRelationshipGraphAdapter,V as workspaceGraphCache};
2
2
  //# sourceMappingURL=sdk-graph.js.map