workspai 0.72.1 → 0.73.0

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 (79) hide show
  1. package/dist/analyze-WC2TY5AT.js +1 -0
  2. package/dist/autopilot-release-LJDRECFW.js +1 -0
  3. package/dist/{chunk-I7P6XQJI.js → chunk-2BCECNIW.js} +1 -1
  4. package/dist/{chunk-U3RX7KDY.js → chunk-3GO7BJ5J.js} +1 -1
  5. package/dist/{chunk-QVUVJU56.js → chunk-3SNP6M4M.js} +1 -1
  6. package/dist/chunk-4HQU2GQM.js +1 -0
  7. package/dist/{chunk-T6KHOIEY.js → chunk-4JAURS76.js} +1 -1
  8. package/dist/chunk-7O7P4MRD.js +1 -0
  9. package/dist/{chunk-L5ZD2GD3.js → chunk-AQNU5RXV.js} +1 -1
  10. package/dist/{chunk-TDQ2PRHV.js → chunk-D3N2WFDV.js} +1 -1
  11. package/dist/{chunk-FYIPYGMW.js → chunk-DNKELRK6.js} +1 -1
  12. package/dist/{chunk-T6LCDLJ7.js → chunk-EDDGQ6LM.js} +1 -1
  13. package/dist/{chunk-LLEKVSMX.js → chunk-F6CTGVJA.js} +1 -1
  14. package/dist/{chunk-JPPZDLY3.js → chunk-FRH7AIGY.js} +2 -2
  15. package/dist/{chunk-KVPTZMEV.js → chunk-HAZGSAKP.js} +1 -1
  16. package/dist/{chunk-ISGLADQI.js → chunk-IPZT6WKM.js} +1 -1
  17. package/dist/{chunk-4PDEWMOG.js → chunk-J44PN2FX.js} +1 -1
  18. package/dist/{chunk-4AW5QP5J.js → chunk-K3O3HENC.js} +1 -1
  19. package/dist/{chunk-SS7X2YF5.js → chunk-LDJAUIAG.js} +1 -1
  20. package/dist/{chunk-SATPH22S.js → chunk-LGC4CRUF.js} +1 -1
  21. package/dist/{chunk-IX5Z6EK6.js → chunk-ND5YAC4T.js} +1 -1
  22. package/dist/{chunk-WPZUKU2B.js → chunk-NNQE4DS2.js} +1 -1
  23. package/dist/chunk-NSMRQOWP.js +157 -0
  24. package/dist/{chunk-WMC2H7MJ.js → chunk-OIGI7MP6.js} +1 -1
  25. package/dist/{chunk-S66NO5BX.js → chunk-R5OJD5K2.js} +1 -1
  26. package/dist/{chunk-L4WG3NI7.js → chunk-SO4CGS35.js} +1 -1
  27. package/dist/{chunk-RQKDJVX3.js → chunk-T5NBSCVX.js} +2 -2
  28. package/dist/{chunk-2RF75G5T.js → chunk-TIZCESKY.js} +1 -1
  29. package/dist/{chunk-62YBFWHY.js → chunk-TSYDTKXO.js} +1 -1
  30. package/dist/{chunk-N2PAAQKI.js → chunk-TZK2R6RD.js} +1 -1
  31. package/dist/{chunk-JQINCVK5.js → chunk-UCNIXOTL.js} +1 -1
  32. package/dist/{chunk-5NL53T5C.js → chunk-VBMWFT7Q.js} +1 -1
  33. package/dist/chunk-YYELANJO.js +7 -0
  34. package/dist/{chunk-QYXX6G5O.js → chunk-ZZWGD3X3.js} +1 -1
  35. package/dist/{create-FOPYAWAR.js → create-XYKXS3JB.js} +1 -1
  36. package/dist/{doctor-Z3Z5L67W.js → doctor-LQ7FT6AZ.js} +1 -1
  37. package/dist/{goal-lifecycle-ZH7AQIOX.js → goal-lifecycle-BIX2JVNO.js} +1 -1
  38. package/dist/{goal-pack-OP453Q6U.js → goal-pack-SUWH6K7U.js} +1 -1
  39. package/dist/index.js +22 -22
  40. package/dist/{pipeline-LPZHMO7S.js → pipeline-NSPPWD7U.js} +1 -1
  41. package/dist/{project-agent-entry-QGPM7CU7.js → project-agent-entry-Y3NEHZED.js} +1 -1
  42. package/dist/{project-intelligence-lens-U7PLWYXX.js → project-intelligence-lens-6Q6XSUDJ.js} +1 -1
  43. package/dist/{project-test-coverage-4BGDDBBL.js → project-test-coverage-5PXAHBYQ.js} +1 -1
  44. package/dist/{proof-carrying-change-6LQ6JO5J.js → proof-carrying-change-456TYEDW.js} +1 -1
  45. package/dist/{verified-goal-JIRVX7KO.js → verified-goal-GRH5UOJR.js} +1 -1
  46. package/dist/{workspace-3K2YGPU7.js → workspace-ROUEA3RT.js} +1 -1
  47. package/dist/{workspace-agent-sync-TFQNKRD3.js → workspace-agent-sync-6UYG33EQ.js} +1 -1
  48. package/dist/{workspace-context-ZDXF6S7S.js → workspace-context-H7ZXR6VI.js} +1 -1
  49. package/dist/{workspace-contract-E7GVWM7W.js → workspace-contract-2V2BI6A3.js} +1 -1
  50. package/dist/{workspace-explain-YB66UFAS.js → workspace-explain-IBMTRUSF.js} +1 -1
  51. package/dist/{workspace-foundation-J62BMOQS.js → workspace-foundation-H5B3TTZD.js} +1 -1
  52. package/dist/{workspace-graph-stream-SJUCBPS4.js → workspace-graph-stream-YDEET5LK.js} +1 -1
  53. package/dist/workspace-graph-token-efficiency-XM3LYFUC.js +1 -0
  54. package/dist/{workspace-intelligence-3IAAM3H3.js → workspace-intelligence-DXKQXTTM.js} +1 -1
  55. package/dist/{workspace-intelligence-benchmark-UCGDKMDF.js → workspace-intelligence-benchmark-L46EGZZM.js} +1 -1
  56. package/dist/{workspace-intelligence-runner-OELXKX3D.js → workspace-intelligence-runner-SCB44IXU.js} +1 -1
  57. package/dist/{workspace-knowledge-graph-WNQMNAVL.js → workspace-knowledge-graph-BNEVFEOW.js} +1 -1
  58. package/dist/{workspace-knowledge-graph-query-3GPXGWYN.js → workspace-knowledge-graph-query-GOC365ZR.js} +1 -1
  59. package/dist/workspace-knowledge-graph-snapshot-2NMV7LEJ.js +1 -0
  60. package/dist/{workspace-mcp-serve-X7ZYJA3X.js → workspace-mcp-serve-JLZTTEVG.js} +1 -1
  61. package/dist/{workspace-model-5FA2636K.js → workspace-model-XSNLDUI2.js} +1 -1
  62. package/dist/{workspace-onboarding-CZSQDNKO.js → workspace-onboarding-IRBVZTT4.js} +1 -1
  63. package/dist/{workspace-registry-summary-WKENOFEA.js → workspace-registry-summary-CBZDSG6I.js} +1 -1
  64. package/dist/{workspace-repair-engine-RXHJX4CQ.js → workspace-repair-engine-TDUNQSFJ.js} +1 -1
  65. package/dist/workspace-run-I2W5PIPK.js +1 -0
  66. package/dist/{workspace-verify-37QL2JYE.js → workspace-verify-QTRY7WW3.js} +1 -1
  67. package/dist/{workspace-watch-P5X6TAFK.js → workspace-watch-PDQKYBYQ.js} +1 -1
  68. package/docs/SECURITY.md +16 -59
  69. package/docs/ci-workflows.md +43 -11
  70. package/package.json +2 -2
  71. package/dist/analyze-5ENZTHOT.js +0 -1
  72. package/dist/autopilot-release-QMZSHOLF.js +0 -1
  73. package/dist/chunk-6WOFOOM7.js +0 -7
  74. package/dist/chunk-BVWDG66W.js +0 -1
  75. package/dist/chunk-LLSY6L7E.js +0 -157
  76. package/dist/chunk-X5ZNFXFI.js +0 -1
  77. package/dist/workspace-graph-token-efficiency-BTIS6JXL.js +0 -1
  78. package/dist/workspace-knowledge-graph-snapshot-MTFTCVFF.js +0 -1
  79. package/dist/workspace-run-IDRHBKEB.js +0 -1
@@ -1 +0,0 @@
1
- var ne="workspace-knowledge-search.v1";function m(e){return e.trim().toLowerCase()}var U=new WeakMap;function B(e){let t=U.get(e);if(t)return t;let a=new Map(e.relations.map(o=>[o.id,o])),s=new Map(e.entities.map(o=>[o.id,o])),r=new Map(e.proofs.map(o=>[o.id,o])),i=new Map,l=new Map,p=(o,u)=>{let g=l.get(o)??[];g.push(u),l.set(o,g);};for(let o of e.entities){let u=[o.id,o.label,o.identity.key,...o.kind==="project"&&o.projectId?[o.projectId]:[],...o.identity.aliases];for(let g of new Set(u.map(m))){let y=i.get(g)??[];y.push(o),i.set(g,y);}}for(let o of e.relations)p(o.from,{from:o.from,to:o.to,relationId:o.id,kind:o.kind,direction:"forward",proofIds:o.proofIds}),p(o.to,{from:o.to,to:o.from,relationId:o.id,kind:o.kind,direction:"reverse",proofIds:o.proofIds});for(let o of i.values())o.sort((u,g)=>u.id.localeCompare(g.id));for(let o of l.values())o.sort((u,g)=>u.to.localeCompare(g.to)||u.relationId.localeCompare(g.relationId));let d={entitiesById:s,relationsById:a,entitiesByAlias:i,proofsById:r,adjacency:l};return U.set(e,d),d}function D(e,t,a){let s=B(e),r=s.relationsById.get(t);if(r)return {found:true,targetType:"relation",relation:r};let i=m(t),l=(s.entitiesByAlias.get(i)??[]).filter(p=>!a||p.projectId===a);return l.length===1?{found:true,targetType:"entity",entity:l[0]}:{found:false,query:t,candidates:l.map(p=>p.id).sort()}}function Se(e,t,a){let s=D(e,t,a);if(!s.found)return {query:t,found:false,target:null,proofs:[],candidates:s.candidates};let r=s.targetType==="entity"?s.entity:s.relation,i=new Set(r.proofIds);return {query:t,found:true,target:r,candidates:[],proofs:[...i].map(l=>B(e).proofsById.get(l)).filter(l=>!!l).sort((l,p)=>l.id.localeCompare(p.id))}}function Ee(e,t,a,s){let r=D(e,t,s),i=D(e,a,s);if(!r.found||r.targetType!=="entity"||!i.found||i.targetType!=="entity")return {from:t,to:a,found:false,resolvedFrom:r.found&&r.targetType==="entity"?r.entity.id:null,resolvedTo:i.found&&i.targetType==="entity"?i.entity.id:null,entityPath:[],hops:[],proofs:[]};let l=B(e),p=[r.entity.id],d=new Map,o=new Set(p),u=0;for(;u<p.length&&!o.has(i.entity.id);){let f=p[u++];for(let h of l.adjacency.get(f)??[])o.has(h.to)||(o.add(h.to),d.set(h.to,h),p.push(h.to));}if(!o.has(i.entity.id))return {from:t,to:a,found:false,resolvedFrom:r.entity.id,resolvedTo:i.entity.id,entityPath:[],hops:[],proofs:[]};let g=[],y=i.entity.id;for(;y!==r.entity.id;){let f=d.get(y);if(!f)break;g.push(f),y=f.from;}g.reverse();let I=new Set(g.flatMap(f=>f.proofIds));return {from:t,to:a,found:true,resolvedFrom:r.entity.id,resolvedTo:i.entity.id,entityPath:[r.entity.id,...g.map(f=>f.to)],hops:g,proofs:[...I].map(f=>l.proofsById.get(f)).filter(f=>!!f).sort((f,h)=>f.id.localeCompare(h.id))}}function We(e,t,a){return e.entities.filter(s=>(!t||s.kind===t)&&(!a||s.projectId===a)).sort((s,r)=>s.kind.localeCompare(r.kind)||s.label.localeCompare(r.label))}var k={relations:12,relatedEntities:12,proofs:8,proofIdsPerItem:4,aliasesPerEntity:8,attributeArrayItems:8,attributeStringCharacters:256};function oe(e){let t=[],a=new Set;for(let s=0;s<k.proofIdsPerItem&&t.length<k.proofs;s+=1)for(let r of e){let i=r.proofIds[s];if(!(!i||a.has(i))&&(a.add(i),t.push(i),t.length>=k.proofs))break}return t}function se(e,t,a){let s=e.identity.aliases.slice(0,k.aliasesPerEntity);a.aliases+=e.identity.aliases.length-s.length;let r=Object.fromEntries(Object.entries(e.attributes).map(([l,p])=>{if(Array.isArray(p)){let d=p.slice(0,k.attributeArrayItems);return a.attributeValues+=p.length-d.length,[l,d]}return typeof p=="string"&&p.length>k.attributeStringCharacters?(a.attributeValues+=1,[l,p.slice(0,k.attributeStringCharacters)]):[l,p]})),i=e.proofIds.filter(l=>t.has(l)).slice(0,k.proofIdsPerItem);return a.proofReferences+=e.proofIds.length-i.length,{...e,identity:{...e.identity,aliases:s},attributes:r,proofIds:i}}function ae(e){let t=Object.values(e.attributes).flatMap(a=>Array.isArray(a)?a:[a]);return [e.id,e.kind,e.label,e.projectId??"",e.identity.key,...e.identity.aliases,...t.map(a=>String(a??""))].join(" ").toLowerCase()}var re=new Set(["a","an","and","are","as","at","be","been","being","by","can","check","could","did","do","does","find","for","from","give","had","has","have","how","i","in","into","is","it","its","may","might","of","on","or","our","show","should","that","the","their","them","then","there","these","they","this","those","tell","to","was","we","were","what","when","where","which","who","why","will","with","would","you","your"]),ie=new Map([["authenticate","auth"],["authenticated","auth"],["authentication","auth"],["authorization","auth"],["authorizing","auth"],["config","configuration"],["configs","configuration"],["dependencies","dependency"],["connected","connect"],["connecting","connect"],["connection","connect"],["connections","connect"],["diagnostics","diagnostic"],["reliable","reliability"],["tested","test"],["testing","test"],["tests","test"],["verification","verify"],["verified","verify"],["verifies","verify"],["verifying","verify"]]);function v(e){let t=a=>m(a).replace(/\bc\+\+/gu," cplusplus ").replace(/\bc#/gu," csharp ").split(/[^a-z0-9]+/u).filter(s=>s.length>1||s==="c"||s==="r").map(s=>ie.get(s)??s);return [...new Set([...t(e),...t(e.replace(/([a-z0-9])([A-Z])/g,"$1 $2"))])]}function ce(e){let t=m(e.label),a=m(e.identity.key),s=e.identity.aliases.map(m),r=ae(e);return {entity:e,label:t,identity:a,aliases:s,haystack:r,labelTokens:new Set(v(e.label)),identityTokens:new Set(v(e.identity.key)),aliasTokens:new Set(e.identity.aliases.flatMap(v)),allTokens:new Set(v(r))}}function E(e,t){return e.has(t)||t.length>=3&&[...e].some(a=>a.startsWith(t))}function A(e,t){return E(e.labelTokens,t)||E(e.identityTokens,t)||E(e.aliasTokens,t)||E(e.allTokens,t)}function le(e,t,a,s){let{label:r,identity:i,aliases:l,haystack:p}=e,d=0;(r===t||i===t||l.includes(t))&&(d+=1e4),(r.startsWith(t)||i.startsWith(t))&&(d+=250),p.includes(t)&&(d+=100);let o=0;for(let u of a){let g=s.get(u)??1,y=E(e.labelTokens,u),I=E(e.identityTokens,u),f=E(e.aliasTokens,u),h=A(e,u);h&&(o+=1),r===u?d+=80*g:y&&(d+=36*g),I&&(d+=24*g),f&&(d+=20*g),h&&(d+=10*g);}return a.length>0&&(d+=o/a.length*120),d}function de(e,t){if(["build","compiled","dist","generated","fixture","fixtures","testdata","target","third","vendor","vendored"].some(i=>t.has(i)))return 0;let s=typeof e.attributes.artifact=="string"?e.attributes.artifact:"",r=`${e.label}/${e.identity.key}/${s}`.toLowerCase();return /(?:^|\/)(?:__fixtures__|__testfixtures__|build|compiled|dist|fixture|fixtures|generated|node_modules|target|testdata|third_party|vendor)(?:\/|$)/u.test(r)?5e3:0}function F(e,t){let a=new Set;for(let s of t){let r=e.allTokens.has(s)?s:void 0,i=r===void 0&&s.length>=3?[...e.allTokens].find(p=>p.startsWith(s)&&!a.has(p)):void 0,l=r??i;l&&!a.has(l)&&a.add(l);}return a.size}var pe=new Map([["c","c"],["clojure","clojure"],["cplusplus","cpp"],["cpp","cpp"],["typescript","typescript"],["ts","typescript"],["javascript","javascript"],["js","javascript"],["nodejs","javascript"],["python","python"],["py","python"],["go","go"],["golang","go"],["csharp","csharp"],["ada","ada"],["assembly","assembly"],["asm","assembly"],["cuda","cuda"],["dotnet","csharp"],["dart","dart"],["elixir","elixir"],["fsharp","fsharp"],["fortran","fortran"],["java","java"],["kotlin","kotlin"],["hlsl","hlsl"],["llvmir","llvm-ir"],["mlir","mlir"],["lua","lua"],["php","php"],["r","r"],["ruby","ruby"],["rust","rust"],["tablegen","tablegen"],["scala","scala"],["svelte","svelte"],["swift","swift"],["vue","vue"]]);function ge(e){return new Set(e.map(t=>pe.get(t)).filter(t=>!!t))}function $(e){let t=e.attributes.language;return typeof t=="string"?m(t):null}function he(e){return {project:1e3,service:900,api:900,package:850,endpoint:800,container:700,deployment:700,environment:650,pipeline:600,"test-suite":550,owner:500,decision:450,document:400}[e.kind]??0}var ue=new Set(["language","languages","binding","bindings","bridge","bridges","dependency","dependencies","depends","core","runtime","owner","owners","ownership","maintainer","ci","pipeline","pipelines","workflow","deploy","deployment","infrastructure","container","doc","docs","document","documentation","service","services","api","rpc","schema","schemas","message","protobuf","proto","contract"]),fe=new Set(["app","application","applications","call","calls","code","communicate","communication","connect","define","defined","expose","exposed","handle","handled","implement","implementation","integrate","integration","interact","interaction","project","provide","provided","system","use","used","uses","using"]);function ye(e){return ue.has(e)||fe.has(e)}function we(e,t){let a=t.has("language")||t.has("languages"),s=t.has("binding")||t.has("bindings")||t.has("bridge")||t.has("bridges"),r=t.has("dependency")||t.has("dependencies")||t.has("depends"),i=t.has("core")||t.has("runtime"),l=t.has("owner")||t.has("owners")||t.has("ownership")||t.has("maintainer"),p=t.has("ci")||t.has("pipeline")||t.has("pipelines")||t.has("workflow"),d=t.has("deploy")||t.has("deployment")||t.has("infrastructure")||t.has("container"),o=t.has("doc")||t.has("docs")||t.has("document")||t.has("documentation"),u=t.has("service")||t.has("services")||t.has("api")||t.has("rpc"),g=t.has("schema")||t.has("schemas")||t.has("message")||t.has("protobuf")||t.has("proto")||t.has("contract"),y=typeof e.attributes.mechanism=="string"?m(e.attributes.mechanism):"",I=typeof e.attributes.specification=="string"?m(e.attributes.specification):"",f=m(e.label),h=0;if(a&&e.kind==="language"){let O=typeof e.attributes.fileCount=="number"?e.attributes.fileCount:0;h+=900+Math.min(O,1e4)/10;}return s&&e.kind==="protocol"&&(h+=800),r&&e.kind==="package"&&(h+=650),i&&e.kind==="package"&&/(?:^|[_-])core(?:$|[_-])/u.test(f)&&(h+=700),i&&e.kind==="protocol"&&y.includes("core")&&(h+=300),l&&e.kind==="owner"&&(h+=850),p&&e.kind==="pipeline"&&(h+=800),d&&["deployment","container","environment"].includes(e.kind)&&(h+=775),o&&["document","decision"].includes(e.kind)&&(h+=725),u&&["api","endpoint","service"].includes(e.kind)&&(h+=700),g&&(e.kind==="schema"||(e.kind==="api"||e.kind==="protocol")&&(I.includes("protobuf")||y.includes("protobuf")))&&(h+=750),h}function ke(e){return [e.has("language")||e.has("languages"),e.has("binding")||e.has("bindings")||e.has("bridge")||e.has("bridges"),e.has("dependency")||e.has("dependencies")||e.has("depends"),e.has("core")||e.has("runtime"),e.has("owner")||e.has("ownership")||e.has("maintainer"),e.has("ci")||e.has("pipeline")||e.has("workflow"),e.has("deploy")||e.has("deployment")||e.has("infrastructure"),e.has("doc")||e.has("docs")||e.has("documentation"),e.has("service")||e.has("api")||e.has("rpc"),e.has("schema")||e.has("protobuf")||e.has("proto")||e.has("contract")].filter(Boolean).length>=3}function Te(e,t){let a=m(t.query),s=[...new Set(v(t.query))],r=new Set(v(t.projectId??"")),i=t.projectId?s.filter(n=>!r.has(n)):s,l=!!(t.projectId&&s.length>0&&i.length===0),p=i.filter(n=>!re.has(n)),d=p.length>0?p:i,o=ge(d),u=new Set(d),g=d.filter(n=>!ye(n)),y=ke(u),I=d.length<=1?d.length:Math.min(2,Math.ceil(d.length/3)),f=t.minimumTermMatches===void 0?I:Math.min(I,Math.max(1,Math.trunc(t.minimumTermMatches))),h=Math.max(1,Math.min(Math.trunc(t.limit??12),100)),O=Math.max(0,Math.min(Math.trunc(t.relationsPerEntity??4),20)),G=new Set;if(t.projectId){let n=new Set(e.entities.filter(c=>c.kind==="project"&&(c.projectId===t.projectId||c.label===t.projectId)).map(c=>c.id));for(let c of e.relations)n.has(c.from)&&G.add(c.to),n.has(c.to)&&G.add(c.from);}let P=e.entities.filter(n=>(!t.kind||n.kind===t.kind)&&(!t.projectId||n.projectId===t.projectId||n.projectId===void 0&&G.has(n.id))).map(ce),Y=new Map(d.map(n=>{let c=P.filter(w=>A(w,n)).length;return [n,Math.log((P.length+1)/(c+1))+1]})),X=g.some(n=>P.some(c=>A(c,n))),M=P.map(n=>{let c=F(n,d),w=F(n,g),b=$(n.entity),S=b&&o.has(b)?400:0,_=we(n.entity,u),j=g.length===0||g.some(te=>A(n,te))?_:0;return {entity:n.entity,matchedTerms:c,matchedQualifiers:w,intentScore:j,score:l?he(n.entity):le(n,a,d,Y)+w*300+S+j-de(n.entity,u)}}).filter(n=>{let c=$(n.entity);return (o.size===0||c===null||o.has(c))&&(a.length===0||n.score>0&&(!X||g.length===0||n.matchedQualifiers>0)&&(l||n.matchedTerms>=f||n.intentScore>0&&(y||d.length<=2)))}).sort((n,c)=>c.score-n.score||n.entity.kind.localeCompare(c.entity.kind)||n.entity.label.localeCompare(c.entity.label)),W=(y?(()=>{let n=[],c=[],w=new Map,b=new Set;for(let S of M){let _=w.get(S.entity.kind)??0,j=m(S.entity.label);_<2&&!b.has(j)?(n.push(S),w.set(S.entity.kind,_+1),b.add(j)):c.push(S);}return [...n,...c]})():M).slice(0,h).map(n=>n.entity),R=new Set(W.map(n=>n.id)),L=new Map,H=e.relations.filter(n=>{if(!(R.has(n.from)||R.has(n.to)))return false;let w=R.has(n.from)?n.from:n.to,b=L.get(w)??0;return b>=O?false:(L.set(w,b+1),true)}),K=t.projection==="agent",T=K?H.slice(0,k.relations):H,z=B(e),N=[...new Set(T.flatMap(n=>[n.from,n.to]).filter(n=>!R.has(n)))].map(n=>z.entitiesById.get(n)).filter(n=>!!n).map(({id:n,kind:c,label:w,projectId:b})=>({id:n,kind:c,label:w,...b?{projectId:b}:{}})).sort((n,c)=>n.kind.localeCompare(c.kind)||n.label.localeCompare(c.label)),Q=K?N.slice(0,k.relatedEntities):N,q=new Set([...W.flatMap(n=>n.proofIds),...T.flatMap(n=>n.proofIds)]),Z=K?oe([...W,...T]):[...q],x=new Set(Z),C={entities:M.length-W.length,relations:H.length-T.length,relatedEntities:N.length-Q.length,proofs:q.size-x.size,proofReferences:0,aliases:0,attributeValues:0},V=K?W.map(n=>se(n,x,C)):W,J=K?T.map(n=>{let c=n.proofIds.filter(w=>x.has(w)).slice(0,k.proofIdsPerItem);return C.proofReferences+=n.proofIds.length-c.length,{...n,proofIds:c}}):T,ee=[...x].map(n=>z.proofsById.get(n)).filter(n=>!!n).sort((n,c)=>n.id.localeCompare(c.id));return {schemaVersion:ne,graphSourceHash:e.source.hash,query:t.query,kind:t.kind??null,...t.projectId?{projectId:t.projectId}:{},limit:h,totalMatches:M.length,truncated:M.length>V.length||K&&Object.values(C).some(n=>n>0),entities:V,relatedEntities:Q,relations:J,proofs:ee,...K?{budget:{mode:"agent",limits:{...k},omitted:C}}:{}}}export{ne as a,D as b,Se as c,Ee as d,We as e,Te as f};
@@ -1 +0,0 @@
1
- export{a as WORKSPACE_GRAPH_TOKEN_EFFICIENCY_SCHEMA_VERSION,b as buildWorkspaceGraphTokenEfficiencyReport}from'./chunk-62YBFWHY.js';
@@ -1 +0,0 @@
1
- export{a as readWorkspaceKnowledgeGraphSnapshot}from'./chunk-TDQ2PRHV.js';
@@ -1 +0,0 @@
1
- export{a as resolveWorkspaceRunStageTimeoutMs,b as runWorkspaceStage}from'./chunk-4AW5QP5J.js';export{a as WORKSPACE_RUN_LAST_REPORT_FILENAME}from'./chunk-37SWTS2B.js';