@xenosystem/agent-sdk 0.9.11 → 0.9.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 (102) hide show
  1. package/LICENSE +15 -15
  2. package/README.md +511 -511
  3. package/dist/agents/index.cjs +5 -5
  4. package/dist/agents/index.js +15 -15
  5. package/dist/agents/metafile-cjs.json +1 -1
  6. package/dist/agents/metafile-esm.json +1 -1
  7. package/dist/artifacts/index.cjs +1 -1
  8. package/dist/artifacts/index.js +1 -1
  9. package/dist/artifacts/metafile-cjs.json +1 -1
  10. package/dist/artifacts/metafile-esm.json +1 -1
  11. package/dist/automation/index.d.cts +1 -0
  12. package/dist/automation/index.d.ts +1 -0
  13. package/dist/automation/metafile-cjs.json +1 -1
  14. package/dist/automation/metafile-esm.json +1 -1
  15. package/dist/control-plane/index.cjs +1 -1
  16. package/dist/control-plane/index.js +1 -1
  17. package/dist/control-plane/metafile-cjs.json +1 -1
  18. package/dist/control-plane/metafile-esm.json +1 -1
  19. package/dist/control-room/metafile-cjs.json +1 -1
  20. package/dist/control-room/metafile-esm.json +1 -1
  21. package/dist/electron/index.cjs +107 -107
  22. package/dist/electron/index.d.cts +8 -0
  23. package/dist/electron/index.d.ts +8 -0
  24. package/dist/electron/index.js +103 -103
  25. package/dist/electron/metafile-cjs.json +1 -1
  26. package/dist/electron/metafile-esm.json +1 -1
  27. package/dist/governance/index.cjs +18 -18
  28. package/dist/governance/index.d.cts +1 -0
  29. package/dist/governance/index.d.ts +1 -0
  30. package/dist/governance/index.js +18 -18
  31. package/dist/governance/metafile-cjs.json +1 -1
  32. package/dist/governance/metafile-esm.json +1 -1
  33. package/dist/hooks/metafile-cjs.json +1 -1
  34. package/dist/hooks/metafile-esm.json +1 -1
  35. package/dist/hosted/index.cjs +1 -1
  36. package/dist/hosted/index.js +1 -1
  37. package/dist/hosted/metafile-cjs.json +1 -1
  38. package/dist/hosted/metafile-esm.json +1 -1
  39. package/dist/index.cjs +347 -329
  40. package/dist/index.d.cts +113 -2
  41. package/dist/index.d.ts +113 -2
  42. package/dist/index.js +329 -311
  43. package/dist/intelligence/metafile-cjs.json +1 -1
  44. package/dist/intelligence/metafile-esm.json +1 -1
  45. package/dist/mcp/index.d.cts +1 -0
  46. package/dist/mcp/index.d.ts +1 -0
  47. package/dist/mcp/metafile-cjs.json +1 -1
  48. package/dist/mcp/metafile-esm.json +1 -1
  49. package/dist/metafile-cjs.json +1 -1
  50. package/dist/metafile-esm.json +1 -1
  51. package/dist/oracle/metafile-cjs.json +1 -1
  52. package/dist/oracle/metafile-esm.json +1 -1
  53. package/dist/providers/metafile-cjs.json +1 -1
  54. package/dist/providers/metafile-esm.json +1 -1
  55. package/dist/recipes/metafile-cjs.json +1 -1
  56. package/dist/recipes/metafile-esm.json +1 -1
  57. package/dist/research/metafile-cjs.json +1 -1
  58. package/dist/research/metafile-esm.json +1 -1
  59. package/dist/session/index.cjs +2 -2
  60. package/dist/session/index.d.cts +8 -0
  61. package/dist/session/index.d.ts +8 -0
  62. package/dist/session/index.js +2 -2
  63. package/dist/session/metafile-cjs.json +1 -1
  64. package/dist/session/metafile-esm.json +1 -1
  65. package/dist/sharing/metafile-cjs.json +1 -1
  66. package/dist/sharing/metafile-esm.json +1 -1
  67. package/dist/skills/index.d.cts +1 -0
  68. package/dist/skills/index.d.ts +1 -0
  69. package/dist/skills/metafile-cjs.json +1 -1
  70. package/dist/skills/metafile-esm.json +1 -1
  71. package/dist/soul/metafile-cjs.json +1 -1
  72. package/dist/soul/metafile-esm.json +1 -1
  73. package/dist/terminal/metafile-cjs.json +1 -1
  74. package/dist/terminal/metafile-esm.json +1 -1
  75. package/dist/ui/index.d.cts +1 -0
  76. package/dist/ui/index.d.ts +1 -0
  77. package/dist/ui/metafile-cjs.json +1 -1
  78. package/dist/ui/metafile-esm.json +1 -1
  79. package/dist/utils/index.d.cts +1 -0
  80. package/dist/utils/index.d.ts +1 -0
  81. package/dist/utils/metafile-cjs.json +1 -1
  82. package/dist/utils/metafile-esm.json +1 -1
  83. package/native/mxc/LICENSE.microsoft-mxc-sdk.md +20 -20
  84. package/native/mxc/README.md +25 -25
  85. package/native/mxc/package.json +58 -58
  86. package/ownership/CLEAN_ROOM_CONTRIBUTOR_GUIDE.md +63 -63
  87. package/ownership/evidence/PROPRIETARY-COMMAND-1/implementation-record.md +77 -77
  88. package/ownership/evidence/PROPRIETARY-COMMAND-1/provenance-review.md +51 -51
  89. package/ownership/evidence/PROPRIETARY-MEDIA-1/implementation-record.md +131 -131
  90. package/ownership/evidence/PROPRIETARY-MEDIA-1/provenance-review.md +50 -50
  91. package/ownership/evidence/PROPRIETARY-PTY-1/implementation-record.md +86 -86
  92. package/ownership/evidence/PROPRIETARY-PTY-1/provenance-review.md +52 -52
  93. package/ownership/evidence/PROPRIETARY-RUNTIME-1/implementation-record.md +68 -68
  94. package/ownership/evidence/PROPRIETARY-RUNTIME-1/provenance-review.md +32 -32
  95. package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/implementation-record.md +53 -53
  96. package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/provenance-review.md +32 -32
  97. package/ownership/evidence/PROPRIETARY-UI-1/implementation-record.md +96 -96
  98. package/ownership/evidence/PROPRIETARY-UI-1/provenance-review.md +46 -46
  99. package/ownership/ownership-policy.schema.json +192 -192
  100. package/ownership/templates/clean-room-implementation-record.md +70 -70
  101. package/ownership/templates/provenance-review.md +51 -51
  102. package/package.json +1 -1
@@ -1,5 +1,5 @@
1
1
  var h=1,oe=1,He=["plan","requirements","design","task-graph","patch","diff","file","document","diagram","screenshot","recording","browser-snapshot","test-report","review-report","security-report","performance-report","release-report","sbom","provenance","attestation"],je=["draft","pending_review","approved","rejected","superseded","archived"],qe=["public","internal","confidential","restricted"],Je=["agent","tool","user","system","integration"],se=["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"],ae=["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"];import{Buffer as Be}from"node:buffer";import{createHash as zt}from"node:crypto";function _(e){return{algorithm:"sha256",value:zt("sha256").update(e).digest("hex")}}function S(e){return JSON.stringify(Ee(e,new Set))}function T(e){return _(S(e))}function Ee(e,t){if(e===null||typeof e!="object"){if(typeof e=="number"&&!Number.isFinite(e))throw new TypeError("Artifact JSON cannot contain non-finite numbers");return e}if(t.has(e))throw new TypeError("Artifact JSON cannot contain cycles");if(t.add(e),Array.isArray(e)){let i=e.map(o=>Ee(o,t));return t.delete(e),i}let n={};for(let i of Object.keys(e).sort((o,r)=>o.localeCompare(r))){let o=e[i];if(o===void 0)throw new TypeError(`Artifact JSON property ${i} is undefined`);n[i]=Ee(o,t)}return t.delete(e),n}var Kt=/^[a-z0-9][a-z0-9._/-]{0,127}$/,Re="custom:";function $(e,t=Re){return e.startsWith(t)?Kt.test(e.slice(t.length)):!1}var M=class extends Error{code="ARTIFACT_INVALID";issues;constructor(t,n){super(t),this.name="XenoArtifactValidationError",this.issues=n.map(i=>({...i}))}},Xe=class extends Error{constructor(n,i){super(`Artifact state cannot transition from ${n} to ${i}`);this.fromState=n;this.toState=i;this.name="XenoArtifactStateTransitionError"}fromState;toState;code="ARTIFACT_STATE_TRANSITION_INVALID"},Gt={draft:["pending_review","superseded","archived"],pending_review:["approved","rejected","superseded","archived"],approved:["superseded","archived"],rejected:["superseded","archived"],superseded:["archived"],archived:[]},Yt="[\\u0000-\\u001f\\u007f]",Zt=new RegExp(Yt),Ue=/^[a-f0-9]{64}$/,Qt=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,en=new Set(je),tn=new Set(qe),nn=new Set(Je),rn=new Set(He),on=new Set(se),sn=new Set(ae);function p(e,t,n,i){e.push({path:t,code:n,message:i})}function l(e,t,n,i=1024){return typeof e!="string"||e.trim().length===0?(p(n,t,"required_string","Value must be a non-empty string"),!1):(e.length>i&&p(n,t,"string_too_long",`Value must not exceed ${i} characters`),Zt.test(e)&&p(n,t,"control_character","Value must not contain control characters"),!0)}function B(e,t,n){e!==void 0&&(!Number.isFinite(Date.parse(e))||!e.includes("T"))&&p(n,t,"invalid_timestamp","Value must be an ISO 8601 timestamp")}function O(e,t,n,i){typeof e=="string"&&e.startsWith(t)&&($(e,t)||p(i,n,"invalid_custom_name",`Custom name after ${t} is invalid`))}function We(e,t,n){if(!e||typeof e!="object"){p(n,t,"missing_actor","Actor is required");return}l(e.kind,`${t}.kind`,n,64),nn.has(e.kind)||p(n,`${t}.kind`,"unknown_actor_kind","Actor kind is not supported"),l(e.id,`${t}.id`,n,512),e?.displayName!==void 0&&l(e.displayName,`${t}.displayName`,n,512),e?.profileFingerprint!==void 0&&!/^[a-f0-9]{64}$/.test(e.profileFingerprint)&&p(n,`${t}.profileFingerprint`,"invalid_fingerprint","Profile fingerprint must be 64 lowercase hexadecimal characters")}function Se(e,t,n){if(!e||typeof e!="object"){p(n,t,"invalid_anchor","Anchor must be an object");return}switch(e.kind){case"file":l(e.path,`${t}.path`,n,4096);break;case"source-line":l(e.path,`${t}.path`,n,4096),(!Number.isInteger(e.startLine)||e.startLine<1)&&p(n,`${t}.startLine`,"invalid_line","startLine must be a positive integer"),e.endLine!==void 0&&(!Number.isInteger(e.endLine)||e.endLine<e.startLine)&&p(n,`${t}.endLine`,"invalid_line_range","endLine must be greater than or equal to startLine");break;case"diff-hunk":l(e.path,`${t}.path`,n,4096),l(e.hunkId,`${t}.hunkId`,n,512);break;case"symbol":l(e.path,`${t}.path`,n,4096),l(e.symbol,`${t}.symbol`,n,1024);break;case"dom-node":l(e.pageId,`${t}.pageId`,n,512),!e.selector&&!e.accessibilityId&&!e.snapshotArtifactId&&p(n,t,"missing_dom_locator","DOM anchors require a selector, accessibility ID, or snapshot artifact ID");break;case"timeline":l(e.recordingArtifactId,`${t}.recordingArtifactId`,n,512),(!Number.isFinite(e.startMs)||e.startMs<0)&&p(n,`${t}.startMs`,"invalid_time","startMs must be a non-negative finite number"),e.endMs!==void 0&&(!Number.isFinite(e.endMs)||e.endMs<e.startMs)&&p(n,`${t}.endMs`,"invalid_time_range","endMs must be greater than or equal to startMs");break;case"region":l(e.mediaArtifactId,`${t}.mediaArtifactId`,n,512),[e.x,e.y,e.width,e.height].every(Number.isFinite)?(e.width<=0||e.height<=0)&&p(n,t,"invalid_region_size","Region width and height must be positive"):p(n,t,"invalid_region","Region coordinates must be finite numbers");break;case"artifact":l(e.artifactId,`${t}.artifactId`,n,512);break;default:typeof e.kind!="string"||!e.kind.startsWith("custom:")?p(n,`${t}.kind`,"unknown_anchor","Anchor kind is not supported"):O(e.kind,"custom:",`${t}.kind`,n)}}function U(e,t,n,i){if(!(e===null||typeof e=="string"||typeof e=="boolean")){if(typeof e=="number"){Number.isFinite(e)||p(n,t,"non_finite_number","JSON numbers must be finite");return}if(typeof e!="object"){p(n,t,"non_json_value","Value must be JSON-serializable");return}if(i.has(e)){p(n,t,"cyclic_value","Value must not contain cycles");return}if(i.add(e),Array.isArray(e))e.forEach((o,r)=>U(o,`${t}[${r}]`,n,i));else for(let[o,r]of Object.entries(e))r===void 0?p(n,`${t}.${o}`,"undefined_value","Undefined is not valid JSON"):U(r,`${t}.${o}`,n,i);i.delete(e)}}function an(e){let t=[];if(!e||typeof e!="object")return[{path:"$",code:"invalid_artifact",message:"Artifact must be an object"}];if(e.schemaVersion!==1&&p(t,"schemaVersion","unsupported_schema",`schemaVersion must be ${1}`),l(e.artifactId,"artifactId",t,512),(!Number.isInteger(e.revision)||e.revision<1)&&p(t,"revision","invalid_revision","revision must be a positive integer"),l(e.kind,"kind",t,160),typeof e.kind=="string"&&!rn.has(e.kind)&&!e.kind.startsWith("custom:")&&p(t,"kind","unknown_artifact_kind","Artifact kind is not supported"),O(e.kind,"custom:","kind",t),l(e.title,"title",t,1024),e.description!==void 0&&l(e.description,"description",t,32768),l(e.state,"state",t,64),en.has(e.state)||p(t,"state","unknown_state","Artifact state is not supported"),l(e.createdAt,"createdAt",t,128),B(e.createdAt,"createdAt",t),B(e.updatedAt,"updatedAt",t),e.updatedAt&&Number.isFinite(Date.parse(e.createdAt))&&Date.parse(e.updatedAt)<Date.parse(e.createdAt)&&p(t,"updatedAt","timestamp_order","updatedAt must not precede createdAt"),l(e.mediaType,"mediaType",t,255),l(e.sensitivity,"sensitivity",t,64),tn.has(e.sensitivity)||p(t,"sensitivity","unknown_sensitivity","Sensitivity is not supported"),e.identity)for(let[i,o]of Object.entries(e.identity))o!==void 0&&l(o,`identity.${i}`,t,512);if(!e.content||typeof e.content!="object")p(t,"content","missing_content","content descriptor is required");else{!e.content.hash||typeof e.content.hash!="object"?p(t,"content.hash","missing_hash","content hash is required"):(l(e.content.hash.algorithm,"content.hash.algorithm",t,128),O(e.content.hash.algorithm,"custom:","content.hash.algorithm",t),typeof e.content.hash.algorithm=="string"&&e.content.hash.algorithm!=="sha256"&&!e.content.hash.algorithm.startsWith("custom:")&&p(t,"content.hash.algorithm","unknown_hash_algorithm","Hash algorithm is not supported"),l(e.content.hash.value,"content.hash.value",t,512),e.content.hash.algorithm==="sha256"&&!Ue.test(e.content.hash.value)&&p(t,"content.hash.value","invalid_sha256","SHA-256 hash must be 64 lowercase hexadecimal characters")),(!Number.isSafeInteger(e.content.sizeBytes)||e.content.sizeBytes<0)&&p(t,"content.sizeBytes","invalid_size","sizeBytes must be a non-negative safe integer");let i=e.content.storage;if(!i||typeof i!="object")p(t,"content.storage","missing_storage","storage reference is required");else if(i.type==="inline")if(i.text===void 0==(i.base64===void 0))p(t,"content.storage","invalid_inline_storage","Inline storage requires exactly one of text or base64");else{let o;i.text!==void 0?o=Be.from(i.text,"utf8"):i.base64!==void 0&&(Qt.test(i.base64)?o=Be.from(i.base64,"base64"):p(t,"content.storage.base64","invalid_base64","Inline base64 content is malformed")),o&&e.content.sizeBytes!==o.byteLength&&p(t,"content.sizeBytes","content_size_mismatch","sizeBytes does not match inline content"),o&&e.content.hash.algorithm==="sha256"&&_(o).value!==e.content.hash.value&&p(t,"content.hash.value","content_hash_mismatch","Hash does not match inline content")}else i.type==="file"?l(i.path,"content.storage.path",t,4096):i.type==="blob"?l(i.uri,"content.storage.uri",t,8192):i.type==="git"?(l(i.commit,"content.storage.commit",t,512),l(i.path,"content.storage.path",t,4096)):i.type==="url"?(l(i.url,"content.storage.url",t,8192),B(i.expiresAt,"content.storage.expiresAt",t)):i.type==="external"?(l(i.provider,"content.storage.provider",t,255),l(i.locator,"content.storage.locator",t,8192)):p(t,"content.storage.type","unknown_storage","Storage type is not supported");e.content.encoding!==void 0&&(typeof e.content.encoding!="string"||e.content.encoding!=="utf8"&&e.content.encoding!=="base64"&&e.content.encoding!=="binary"&&!e.content.encoding.startsWith("custom:"))&&p(t,"content.encoding","unknown_encoding","Content encoding is not supported"),O(e.content.encoding,"custom:","content.encoding",t)}!e.provenance||typeof e.provenance!="object"?p(t,"provenance","missing_provenance","provenance is required"):(We(e.provenance.producer,"provenance.producer",t),e.provenance.capabilityLeaseIds?.forEach((i,o)=>l(i,`provenance.capabilityLeaseIds[${o}]`,t,512)),e.provenance.sourceArtifactIds?.forEach((i,o)=>l(i,`provenance.sourceArtifactIds[${o}]`,t,512)),e.provenance.attributes&&U(e.provenance.attributes,"provenance.attributes",t,new Set));let n=new Set;return e.relationships?.forEach((i,o)=>{let r=`relationships[${o}]`;l(i.relation,`${r}.relation`,t,160),typeof i.relation=="string"&&!sn.has(i.relation)&&!i.relation.startsWith("custom:")&&p(t,`${r}.relation`,"unknown_relationship","Relationship type is not supported"),O(i.relation,"custom:",`${r}.relation`,t),l(i.target?.type,`${r}.target.type`,t,160),typeof i.target?.type=="string"&&!on.has(i.target.type)&&!i.target.type.startsWith("custom:")&&p(t,`${r}.target.type`,"unknown_reference_type","Evidence reference type is not supported"),O(i.target?.type,"custom:",`${r}.target.type`,t),l(i.target?.id,`${r}.target.id`,t,512);let a=`${i.relation}:${i.target?.type}:${i.target?.id}:${i.target?.revision??""}`;n.has(a)&&p(t,r,"duplicate_relationship","Duplicate relationship"),n.add(a),i.attributes&&U(i.attributes,`${r}.attributes`,t,new Set)}),e.anchors?.forEach((i,o)=>Se(i,`anchors[${o}]`,t)),e.revision===1&&e.predecessorRevision!==void 0&&p(t,"predecessorRevision","unexpected_predecessor","First revision cannot have a predecessor"),e.revision>1&&(!Number.isInteger(e.predecessorRevision)||(e.predecessorRevision??0)>=e.revision)&&p(t,"predecessorRevision","invalid_predecessor","Later revisions require an earlier predecessor revision"),B(e.retention?.retainUntil,"retention.retainUntil",t),e.retention?.legalHold!==void 0&&typeof e.retention.legalHold!="boolean"&&p(t,"retention.legalHold","invalid_boolean","legalHold must be a boolean"),e.extensions&&U(e.extensions,"extensions",t,new Set),t}function w(e){let t=an(e);if(t.length>0)throw new M("XENO artifact validation failed",t)}function cn(e,t){return Gt[e].includes(t)}function ce(e,t){if(!cn(e,t))throw new Xe(e,t)}function be(e,t){let n=[];return e.schemaVersion!==1&&p(n,"schemaVersion","unsupported_schema",`schemaVersion must be ${1}`),l(e.eventId,"eventId",n,512),l(e.artifactId,"artifactId",n,512),(!Number.isInteger(e.artifactRevision)||e.artifactRevision<1)&&p(n,"artifactRevision","invalid_revision","artifactRevision must be a positive integer"),(!Number.isInteger(e.sequence)||e.sequence<1)&&p(n,"sequence","invalid_sequence","sequence must be a positive integer"),l(e.recordedAt,"recordedAt",n,128),B(e.recordedAt,"recordedAt",n),We(e.actor,"actor",n),!e.artifactHash||typeof e.artifactHash!="object"?p(n,"artifactHash","missing_hash","Artifact hash is required"):(l(e.artifactHash.algorithm,"artifactHash.algorithm",n,128),O(e.artifactHash.algorithm,"custom:","artifactHash.algorithm",n),l(e.artifactHash.value,"artifactHash.value",n,512),e.artifactHash.algorithm==="sha256"&&!Ue.test(e.artifactHash.value)&&p(n,"artifactHash.value","invalid_sha256","SHA-256 hash must be 64 lowercase hexadecimal characters"),typeof e.artifactHash.algorithm=="string"&&e.artifactHash.algorithm!=="sha256"&&!e.artifactHash.algorithm.startsWith("custom:")&&p(n,"artifactHash.algorithm","unknown_hash_algorithm","Hash algorithm is not supported")),["review-requested","comment-added","comment-resolved","comment-reopened","decision-recorded","review-withdrawn"].includes(e.type)||p(n,"type","unknown_review_event","Review event type is not supported"),e.type==="comment-added"?(l(e.commentId,"commentId",n,512),l(e.body,"body",n,65536),e.anchor&&Se(e.anchor,"anchor",n)):e.type==="comment-resolved"||e.type==="comment-reopened"?l(e.commentId,"commentId",n,512):e.type==="decision-recorded"&&(["approved","rejected","changes_requested"].includes(e.decision)||p(n,"decision","unknown_review_decision","Review decision is not supported"),e.scope&&Se(e.scope,"scope",n)),t&&(e.artifactId!==t.artifactId&&p(n,"artifactId","artifact_mismatch","Review event targets a different artifact"),e.artifactRevision!==t.revision&&p(n,"artifactRevision","revision_mismatch","Review event targets a different revision"),e.artifactHash&&(e.artifactHash.algorithm!==t.content.hash.algorithm||e.artifactHash.value!==t.content.hash.value)&&p(n,"artifactHash","hash_mismatch","Review event hash does not match the artifact revision")),n}function _e(e){let t="not_requested",n,i,o,r=0,a=new Set,c=new Set;for(let s of[...e].sort((d,f)=>d.sequence-f.sequence))o=s.recordedAt,s.type==="review-requested"?t="pending":s.type==="review-withdrawn"?t="withdrawn":s.type==="comment-added"?(a.add(s.commentId),c.delete(s.commentId),t==="not_requested"&&(t="pending")):s.type==="comment-resolved"?c.add(s.commentId):s.type==="comment-reopened"?c.delete(s.commentId):s.type==="decision-recorded"&&(s.scope?r+=1:(n=s.decision,i=s.eventId,t=s.decision));return{status:t,totalComments:a.size,unresolvedComments:[...a].filter(s=>!c.has(s)).length,...n?{latestDecision:n}:{},...i?{latestDecisionEventId:i}:{},...r>0?{scopedDecisionCount:r}:{},...o?{lastReviewedAt:o}:{}}}var Te=class extends Error{code="EVIDENCE_GRAPH_INVALID";issues;constructor(t){super("XENO evidence graph validation failed"),this.name="XenoEvidenceGraphValidationError",this.issues=t.map(n=>({...n}))}},dn=new Set(["depends_on","decomposes","supersedes"]),fn=new Set(se),pn=new Set(ae);function A(e,t,n,i){e.push({path:t,code:n,message:i})}function W(e){return e.includes("T")&&Number.isFinite(Date.parse(e))}function ze(e,t){return e.startsWith(Re)?$(e):t.has(e)}function un(e){let t=[];if(!e||typeof e!="object")return[{path:"$",code:"invalid_graph",message:"Evidence graph must be an object"}];e.schemaVersion!==1&&A(t,"schemaVersion","unsupported_schema",`schemaVersion must be ${1}`),(typeof e.graphId!="string"||e.graphId.trim().length===0)&&A(t,"graphId","required_string","graphId must be a non-empty string"),(!Number.isInteger(e.version)||e.version<1)&&A(t,"version","invalid_version","version must be a positive integer"),W(e.createdAt)||A(t,"createdAt","invalid_timestamp","createdAt must be an ISO 8601 timestamp"),W(e.updatedAt)||A(t,"updatedAt","invalid_timestamp","updatedAt must be an ISO 8601 timestamp"),W(e.createdAt)&&W(e.updatedAt)&&Date.parse(e.updatedAt)<Date.parse(e.createdAt)&&A(t,"updatedAt","timestamp_order","updatedAt must not precede createdAt");let n=new Map;Array.isArray(e.nodes)||A(t,"nodes","invalid_nodes","nodes must be an array"),(Array.isArray(e.nodes)?e.nodes:[]).forEach((f,g)=>{let I=`nodes[${g}]`;typeof f.id!="string"||f.id.trim().length===0?A(t,`${I}.id`,"required_string","Node ID must be a non-empty string"):n.has(f.id)?A(t,`${I}.id`,"duplicate_node",`Node ID ${f.id} is duplicated`):n.set(f.id,f),(typeof f.type!="string"||!ze(f.type,fn))&&A(t,`${I}.type`,"invalid_node_type","Node type is invalid"),f.artifactRevision!==void 0&&(!Number.isInteger(f.artifactRevision)||f.artifactRevision<1)&&A(t,`${I}.artifactRevision`,"invalid_revision","artifactRevision must be a positive integer")});let i=new Set,o=new Set;Array.isArray(e.edges)||A(t,"edges","invalid_edges","edges must be an array"),(Array.isArray(e.edges)?e.edges:[]).forEach((f,g)=>{let I=`edges[${g}]`;typeof f.id!="string"||f.id.trim().length===0?A(t,`${I}.id`,"required_string","Edge ID must be a non-empty string"):i.has(f.id)&&A(t,`${I}.id`,"duplicate_edge",`Edge ID ${f.id} is duplicated`),i.add(f.id),(typeof f.type!="string"||!ze(f.type,pn))&&A(t,`${I}.type`,"invalid_edge_type","Edge type is invalid");let V=`${f.type}:${f.from}:${f.to}`;o.has(V)&&A(t,I,"duplicate_edge_identity","Equivalent evidence edge is duplicated"),o.add(V),n.has(f.from)||A(t,`${I}.from`,"dangling_reference",`Source node ${f.from} does not exist`),n.has(f.to)||A(t,`${I}.to`,"dangling_reference",`Target node ${f.to} does not exist`),f.from===f.to&&A(t,I,"self_edge","Evidence edges cannot point to the same node"),W(f.createdAt)||A(t,`${I}.createdAt`,"invalid_timestamp","createdAt must be an ISO 8601 timestamp")});let r=(Array.isArray(e.edges)?e.edges:[]).filter(f=>dn.has(f.type)),a=new Map;for(let f of r){let g=a.get(f.from)??[];g.push(f.to),a.set(f.from,g)}let c=new Set,s=new Set,d=f=>{if(c.has(f))return!0;if(s.has(f))return!1;c.add(f);for(let g of a.get(f)??[])if(d(g))return!0;return c.delete(f),s.add(f),!1};for(let f of n.keys())if(d(f)){A(t,"edges","cyclic_graph","Dependency, decomposition, and supersession edges must be acyclic");break}return t}function z(e){let t=un(e);if(t.length>0)throw new Te(t)}var Ke=class{now;graph;constructor(t){if("schemaVersion"in t)z(t),this.now=()=>new Date().toISOString(),this.graph=de(t);else{this.now=t.now??(()=>new Date().toISOString());let n=this.now();this.graph={schemaVersion:1,graphId:t.graphId,version:1,createdAt:n,updatedAt:n,nodes:[],edges:[]},z(this.graph)}}addNode(t){let n=de(this.graph);return n.nodes.push(Ge(t)),this.touch(n),z(n),this.graph=n,this}addEdge(t){let n=de(this.graph);return n.edges.push(Ye(t)),this.touch(n),z(n),this.graph=n,this}build(){return z(this.graph),de(this.graph)}touch(t){t.version+=1,t.updatedAt=this.now()}};function Ge(e){return{...e,...e.attributes?{attributes:structuredClone(e.attributes)}:{}}}function Ye(e){return{...e,...e.producer?{producer:{...e.producer}}:{},...e.attributes?{attributes:structuredClone(e.attributes)}:{}}}function de(e){return{...e,nodes:e.nodes.map(Ge),edges:e.edges.map(Ye)}}var u=class extends Error{constructor(n,i,o,r){super(i,r);this.code=n;this.detail=o;this.name="XenoArtifactRepositoryError"}code;detail},G=class{records=new Map;currentRevisions=new Map;now;idFactory;eventIds=new Set;idCounter=0;constructor(t={}){this.now=t.now??(()=>new Date().toISOString()),this.idFactory=t.idFactory??(n=>(this.idCounter+=1,`${n}_${Date.now().toString(36)}_${this.idCounter.toString(36)}`)),t.initialState&&this.hydrate(t.initialState)}exportState(){let t=[...this.records.values()].flatMap(n=>[...n.values()]).sort(Ze).map(n=>({artifact:K(n.artifact),recordVersion:n.recordVersion,lifecycleEvents:structuredClone(n.lifecycleEvents),reviewEvents:structuredClone(n.reviewEvents)}));return{schemaVersion:1,records:t}}async create(t){if(w(t),this.assertInitialState(t),t.revision!==1)throw new u("ARTIFACT_REVISION_INVALID","A new artifact must begin at revision 1",{artifactId:t.artifactId,revision:t.revision});if(this.records.has(t.artifactId))throw new u("ARTIFACT_ALREADY_EXISTS",`Artifact ${t.artifactId} already exists`,{artifactId:t.artifactId});let n=K(t),i=this.createLifecycleEvent({artifact:n,sequence:1,actor:n.provenance.producer,fromState:null,toState:n.state,reason:"artifact-created"}),o={artifact:n,recordVersion:1,lifecycleEvents:[i],reviewEvents:[]};return this.records.set(n.artifactId,new Map([[n.revision,o]])),this.currentRevisions.set(n.artifactId,n.revision),D(o)}async createRevision(t,n={}){w(t),this.assertInitialState(t);let i=this.getMutable(t.artifactId);this.assertVersion(i,n.expectedRecordVersion);let o=i.artifact.revision+1;if(t.revision!==o||t.predecessorRevision!==i.artifact.revision)throw new u("ARTIFACT_REVISION_INVALID",`Revision ${t.revision} does not follow current revision ${i.artifact.revision}`,{artifactId:t.artifactId,currentRevision:i.artifact.revision,requestedRevision:t.revision});if(mn(t,i.artifact))throw new u("ARTIFACT_CONTENT_UNCHANGED","A new artifact revision must have a different content hash",{artifactId:t.artifactId,revision:t.revision});if(i.artifact.state==="archived")throw new u("ARTIFACT_REVISION_INVALID","Archived artifacts cannot receive new revisions",{artifactId:t.artifactId,revision:i.artifact.revision});if(i.artifact.state!=="superseded"){ce(i.artifact.state,"superseded");let s=this.now(),d=this.createLifecycleEvent({artifact:i.artifact,sequence:i.lifecycleEvents.length+1,actor:n.actor??t.provenance.producer,fromState:i.artifact.state,toState:"superseded",reason:n.reason??`superseded-by-revision-${t.revision}`,recordedAt:s});i.artifact.state="superseded",i.artifact.updatedAt=s,i.lifecycleEvents.push(d),i.recordVersion+=1}let r=K(t),a=this.createLifecycleEvent({artifact:r,sequence:1,actor:n.actor??r.provenance.producer,fromState:null,toState:r.state,reason:n.reason??`revision-created-from-${i.artifact.revision}`}),c={artifact:r,recordVersion:1,lifecycleEvents:[a],reviewEvents:[]};return this.records.get(r.artifactId)?.set(r.revision,c),this.currentRevisions.set(r.artifactId,r.revision),D(c)}async get(t,n){let i=this.records.get(t);if(!i)return;let o=n??this.currentRevisions.get(t);if(o===void 0)return;let r=i.get(o);return r?D(r):void 0}async require(t,n){let i=await this.get(t,n);if(!i)throw new u("ARTIFACT_NOT_FOUND",`Artifact ${t}${n===void 0?"":` revision ${n}`} was not found`,{artifactId:t,...n===void 0?{}:{revision:n}});return i}async list(t={}){let n=[];for(let[i,o]of this.records)if(!(t.artifactIds&&!t.artifactIds.includes(i)))if(t.includeSuperseded)n.push(...o.values());else{let r=this.currentRevisions.get(i);if(r!==void 0){let a=o.get(r);a&&n.push(a)}}return n.filter(i=>vn(i.artifact,t)).sort(Ze).map(D)}async listRevisions(t){let n=this.records.get(t);return n?[...n.values()].sort((i,o)=>i.artifact.revision-o.artifact.revision).map(D):[]}async transition(t){let n=this.getMutable(t.artifactId,t.revision);if(this.assertVersion(n,t.expectedRecordVersion),ce(n.artifact.state,t.toState),t.toState==="approved"||t.toState==="rejected"){let a=t.reviewEventId?n.reviewEvents.find(s=>s.eventId===t.reviewEventId&&s.type==="decision-recorded"):void 0,c=_e(n.reviewEvents);if(!a||a.decision!==t.toState||c.latestDecisionEventId!==a.eventId)throw new u("ARTIFACT_REVIEW_DECISION_REQUIRED",`Transition to ${t.toState} requires a matching decision event`,{artifactId:t.artifactId,revision:n.artifact.revision});if(t.toState==="approved"&&c.unresolvedComments>0)throw new u("ARTIFACT_UNRESOLVED_COMMENTS",`Artifact has ${c.unresolvedComments} unresolved review comment(s)`,{artifactId:t.artifactId,revision:n.artifact.revision,unresolvedComments:c.unresolvedComments})}let i=this.now(),o=n.artifact.state,r=this.createLifecycleEvent({artifact:n.artifact,sequence:n.lifecycleEvents.length+1,actor:t.actor,fromState:o,toState:t.toState,reason:t.reason,reviewEventId:t.reviewEventId,recordedAt:i});return n.artifact.state=t.toState,n.artifact.updatedAt=i,n.lifecycleEvents.push(r),n.recordVersion+=1,D(n)}async appendReviewEvent(t){let n=t.event,i=this.getMutable(n.artifactId,n.artifactRevision);if(this.assertVersion(i,t.expectedRecordVersion),i.artifact.state==="archived"||i.artifact.state==="superseded")throw new u("ARTIFACT_REVIEW_INVALID",`Cannot append review events to a ${i.artifact.state} artifact revision`,{artifactId:n.artifactId,revision:n.artifactRevision});if(this.assertReviewCommentState(i,n),(n.type==="review-requested"||n.type==="review-withdrawn"||n.type==="decision-recorded")&&i.artifact.state!=="pending_review")throw new u("ARTIFACT_REVIEW_INVALID",`${n.type} requires an artifact in pending_review state`,{artifactId:n.artifactId,revision:n.artifactRevision});let o={...structuredClone(n),schemaVersion:1,eventId:this.nextEventId("review_event"),sequence:i.reviewEvents.length+1,recordedAt:this.now()},r=be(o,i.artifact);if(r.length>0)throw new M("XENO artifact review event validation failed",r);return i.reviewEvents.push(o),i.recordVersion+=1,D(i)}getMutable(t,n){let i=this.records.get(t),o=n??this.currentRevisions.get(t),r=o===void 0?void 0:i?.get(o);if(!r)throw new u("ARTIFACT_NOT_FOUND",`Artifact ${t}${n===void 0?"":` revision ${n}`} was not found`,{artifactId:t,...n===void 0?{}:{revision:n}});return r}assertVersion(t,n){if(n!==void 0&&n!==t.recordVersion)throw new u("ARTIFACT_CONFLICT",`Expected record version ${n}, found ${t.recordVersion}`,{artifactId:t.artifact.artifactId,revision:t.artifact.revision,expectedRecordVersion:n,actualRecordVersion:t.recordVersion})}assertInitialState(t){if(t.state!=="draft"&&t.state!=="pending_review")throw new u("ARTIFACT_REVISION_INVALID","New artifact revisions must begin in draft or pending_review state",{artifactId:t.artifactId,revision:t.revision})}assertReviewCommentState(t,n){if(n.type==="comment-added"){if(t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===n.commentId))throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${n.commentId} already exists`);if(n.parentCommentId&&!t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===n.parentCommentId))throw new u("ARTIFACT_REVIEW_INVALID",`Parent comment ${n.parentCommentId} does not exist`);return}if(n.type!=="comment-resolved"&&n.type!=="comment-reopened")return;if(!t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===n.commentId))throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${n.commentId} does not exist`);let o=hn(t.reviewEvents,n.commentId);if(n.type==="comment-resolved"&&o.resolved)throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${n.commentId} is already resolved`);if(n.type==="comment-reopened"&&!o.resolved)throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${n.commentId} is not resolved`)}createLifecycleEvent(t){return{schemaVersion:1,eventId:this.nextEventId("artifact_event"),artifactId:t.artifact.artifactId,revision:t.artifact.revision,sequence:t.sequence,recordedAt:t.recordedAt??this.now(),actor:{...t.actor},fromState:t.fromState,toState:t.toState,...t.reason?{reason:t.reason}:{},...t.reviewEventId?{reviewEventId:t.reviewEventId}:{}}}nextEventId(t){let n=this.idFactory(t);if(typeof n!="string"||n.trim().length===0||this.eventIds.has(n))throw new u("ARTIFACT_CONFLICT",`Event ID factory produced an invalid or duplicate ${t} ID`);return this.eventIds.add(n),n}hydrate(t){if(t.schemaVersion!==1||!Array.isArray(t.records))throw new u("ARTIFACT_REVISION_INVALID","Artifact repository state has an unsupported schema or record collection");let n=[...t.records].sort((i,o)=>i.artifact.artifactId.localeCompare(o.artifact.artifactId)||i.artifact.revision-o.artifact.revision);for(let i of n){let o=ln(i,this.eventIds),r=this.records.get(o.artifact.artifactId);if(r||(r=new Map,this.records.set(o.artifact.artifactId,r)),r.has(o.artifact.revision))throw new u("ARTIFACT_REVISION_INVALID",`Duplicate persisted revision ${o.artifact.artifactId}:${o.artifact.revision}`);r.set(o.artifact.revision,o),this.currentRevisions.set(o.artifact.artifactId,o.artifact.revision)}for(let[i,o]of this.records){let r=[...o.values()].sort((a,c)=>a.artifact.revision-c.artifact.revision);for(let a=0;a<r.length;a+=1){let c=r[a],s=a+1;if(c.artifact.revision!==s)throw new u("ARTIFACT_REVISION_INVALID",`Persisted artifact ${i} is missing revision ${s}`);if(a===0&&c.artifact.predecessorRevision!==void 0)throw new u("ARTIFACT_REVISION_INVALID",`Initial revision for ${i} cannot declare a predecessor`);if(a>0&&c.artifact.predecessorRevision!==s-1)throw new u("ARTIFACT_REVISION_INVALID",`Persisted revision ${i}:${s} has an invalid predecessor`);if(a<r.length-1&&c.artifact.state!=="superseded")throw new u("ARTIFACT_REVISION_INVALID",`Non-current revision ${i}:${s} must be superseded`)}}}};function ln(e,t){if(w(e.artifact),!Number.isInteger(e.recordVersion)||e.recordVersion<1)throw new u("ARTIFACT_REVISION_INVALID","Persisted artifact recordVersion must be a positive integer",{artifactId:e.artifact.artifactId,revision:e.artifact.revision});if(!Array.isArray(e.lifecycleEvents)||e.lifecycleEvents.length===0||!Array.isArray(e.reviewEvents))throw new u("ARTIFACT_REVISION_INVALID","Persisted artifact records require lifecycle and review event arrays",{artifactId:e.artifact.artifactId,revision:e.artifact.revision});let n=e.lifecycleEvents.length+e.reviewEvents.length;if(e.recordVersion!==n)throw new u("ARTIFACT_REVISION_INVALID",`Persisted record version ${e.recordVersion} does not match ${n} mutations`,{artifactId:e.artifact.artifactId,revision:e.artifact.revision});let i=null;for(let r=0;r<e.lifecycleEvents.length;r+=1){let a=e.lifecycleEvents[r];if(a.schemaVersion!==1||a.artifactId!==e.artifact.artifactId||a.revision!==e.artifact.revision||a.sequence!==r+1||a.fromState!==i||typeof a.eventId!="string"||a.eventId.length===0||t.has(a.eventId)||!Number.isFinite(Date.parse(a.recordedAt)))throw new u("ARTIFACT_REVISION_INVALID",`Persisted lifecycle event ${r+1} is invalid`,{artifactId:e.artifact.artifactId,revision:e.artifact.revision});if(i===null){if(a.toState!=="draft"&&a.toState!=="pending_review")throw new u("ARTIFACT_REVISION_INVALID","A persisted artifact must begin in draft or pending_review state",{artifactId:e.artifact.artifactId,revision:e.artifact.revision})}else ce(i,a.toState);t.add(a.eventId),i=a.toState}if(i!==e.artifact.state)throw new u("ARTIFACT_REVISION_INVALID","Persisted artifact state does not match its lifecycle tail",{artifactId:e.artifact.artifactId,revision:e.artifact.revision});let o=new Map;for(let r=0;r<e.reviewEvents.length;r+=1){let a=e.reviewEvents[r];if(a.sequence!==r+1||t.has(a.eventId))throw new u("ARTIFACT_REVIEW_INVALID",`Persisted review event ${r+1} has an invalid sequence or duplicate ID`,{artifactId:e.artifact.artifactId,revision:e.artifact.revision});let c=be(a,e.artifact);if(c.length>0)throw new M("Persisted XENO artifact review event validation failed",c);if(a.type==="comment-added"){if(o.has(a.commentId)||a.parentCommentId!==void 0&&!o.has(a.parentCommentId))throw new u("ARTIFACT_REVIEW_INVALID",`Persisted comment ${a.commentId} has an invalid identity or parent`);o.set(a.commentId,!1)}else if(a.type==="comment-resolved"||a.type==="comment-reopened"){let s=o.get(a.commentId);if(s===void 0||a.type==="comment-resolved"&&s||a.type==="comment-reopened"&&!s)throw new u("ARTIFACT_REVIEW_INVALID",`Persisted comment transition for ${a.commentId} is invalid`);o.set(a.commentId,a.type==="comment-resolved")}t.add(a.eventId)}return{artifact:K(e.artifact),recordVersion:e.recordVersion,lifecycleEvents:structuredClone(e.lifecycleEvents),reviewEvents:structuredClone(e.reviewEvents)}}function mn(e,t){return e.content.hash.algorithm===t.content.hash.algorithm&&e.content.hash.value===t.content.hash.value}function vn(e,t){return!(t.kinds&&!t.kinds.includes(e.kind)||t.states&&!t.states.includes(e.state)||t.runId&&e.identity?.runId!==t.runId||t.sessionId&&e.identity?.sessionId!==t.sessionId||t.turnId&&e.identity?.turnId!==t.turnId||t.taskId&&e.identity?.taskId!==t.taskId||t.workspaceId&&e.identity?.workspaceId!==t.workspaceId||t.repositoryId&&e.identity?.repositoryId!==t.repositoryId||t.producerId&&e.provenance.producer.id!==t.producerId||t.sensitivity&&!t.sensitivity.includes(e.sensitivity))}function Ze(e,t){return e.artifact.createdAt.localeCompare(t.artifact.createdAt)||e.artifact.artifactId.localeCompare(t.artifact.artifactId)||e.artifact.revision-t.artifact.revision}function hn(e,t){let n=!1;for(let i of e)(i.type==="comment-resolved"||i.type==="comment-reopened")&&i.commentId===t&&(n=i.type==="comment-resolved");return{resolved:n}}function K(e){return structuredClone(e)}function D(e){return{artifact:K(e.artifact),recordVersion:e.recordVersion,etag:`${e.artifact.artifactId}:${e.artifact.revision}:${e.recordVersion}`,lifecycleEvents:structuredClone(e.lifecycleEvents),reviewEvents:structuredClone(e.reviewEvents),reviewSummary:_e(e.reviewEvents)}}import{randomUUID as ft}from"node:crypto";import{mkdir as pt,open as ot,readFile as bn,rename as _n,stat as ut,unlink as Tn}from"node:fs/promises";import{basename as st,dirname as at,join as kn,resolve as xn}from"node:path";import{mkdirSync as gn,readFileSync as An,rmSync as et,writeFileSync as yn}from"node:fs";import{hostname as tt}from"node:os";import{dirname as In}from"node:path";function wn(){return new Date().toISOString()}function En(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function nt(e){try{return JSON.parse(An(e,"utf8"))}catch{return null}}function Rn(e){if(!e||e<=0)return!1;try{return process.kill(e,0),!0}catch{return!1}}function Xn(e){return e.hostname!==tt()?!0:Rn(e.pid)}function Qe(e,t){gn(In(e),{recursive:!0}),yn(e,JSON.stringify(t,null,2)+`
2
- `,{encoding:"utf8",flag:"wx"})}function Sn(e,t){let n=nt(e);n?.pid!==t.pid||n.hostname!==t.hostname||et(e,{force:!0})}function it(e,t,n){let i=wn(),o={schemaVersion:1,name:t,pid:process.pid,hostname:tt(),processStartedAt:En(),version:n,acquiredAt:i,updatedAt:i};try{Qe(e,o)}catch(r){if(r.code!=="EEXIST")throw r;let c=nt(e);if(c&&Xn(c))throw new Error(`${t} is already locked by PID ${c.pid} on ${c.hostname}.`);et(e,{force:!0}),Qe(e,o)}return{record:o,release:()=>{Sn(e,o)}}}var rt="0.9.10";var lt=1,Cn="repository.v1.json",Nn=5e3,Vn=20,Pn=64*1024*1024,ct=class{directory;snapshotPath;backupPath;lockPath;now;lockTimeoutMs;lockRetryMs;maxSnapshotBytes;onRecovery;mutationTail=Promise.resolve();constructor(t){if(!t||typeof t.directory!="string"||t.directory.trim().length===0)throw new TypeError("Artifact repository directory is required");let n=t.snapshotFileName??Cn;if(st(n)!==n||!/^[A-Za-z0-9_.-]+$/.test(n))throw new TypeError("Artifact snapshot filename must be a safe basename");this.directory=xn(t.directory),this.snapshotPath=kn(this.directory,n),this.backupPath=`${this.snapshotPath}.bak`,this.lockPath=`${this.snapshotPath}.lock`,this.now=t.now??(()=>new Date().toISOString()),this.lockTimeoutMs=ke(t.lockTimeoutMs,Nn,100,6e4,"lockTimeoutMs"),this.lockRetryMs=ke(t.lockRetryMs,Vn,1,1e3,"lockRetryMs"),this.maxSnapshotBytes=ke(t.maxSnapshotBytes,Pn,1024,1024*1024*1024,"maxSnapshotBytes"),this.onRecovery=t.onRecovery}async create(t){return this.mutate(n=>n.create(t))}async createRevision(t,n){return this.mutate(i=>i.createRevision(t,n))}async get(t,n){return(await this.load()).repository.get(t,n)}async require(t,n){return(await this.load()).repository.require(t,n)}async list(t){return(await this.load()).repository.list(t)}async listRevisions(t){return(await this.load()).repository.listRevisions(t)}async transition(t){return this.mutate(n=>n.transition(t))}async appendReviewEvent(t){return this.mutate(n=>n.appendReviewEvent(t))}async inspectSnapshot(){return this.readSnapshot(this.snapshotPath,!0)}async mutate(t){return this.enqueueMutation(async()=>{let n=await this.acquireLock();try{let i=await this.load(),o=await t(i.repository);return await this.persist(i),o}finally{n.release()}})}async enqueueMutation(t){let n=this.mutationTail.then(t,t);return this.mutationTail=n.then(()=>{},()=>{}),n}async acquireLock(){let t=Date.now(),n;for(;Date.now()-t<=this.lockTimeoutMs;)try{return it(this.lockPath,`artifact-repository:${st(this.snapshotPath)}`,rt)}catch(i){if(!(i instanceof Error)||!/already locked by PID/.test(i.message))throw i;n=i,await Ln(this.lockRetryMs)}throw new u("ARTIFACT_PERSISTENCE_LOCKED",`Artifact repository remained locked for ${this.lockTimeoutMs}ms`,{snapshotPath:this.snapshotPath},{cause:n})}async load(){let t,n,i=!1;try{n=await this.readSnapshot(this.snapshotPath,!1)}catch(r){t=fe(r)}if(!n&&(t||await Fn(this.backupPath)))try{let r=await this.readSnapshot(this.backupPath,!0);r&&(this.onRecovery?.({snapshotPath:this.snapshotPath,backupPath:this.backupPath,reason:t?.message??"primary snapshot missing"}),n=r,i=!0)}catch(r){throw t?new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository primary and backup snapshots are unreadable",{snapshotPath:this.snapshotPath,backupPath:this.backupPath},{cause:new AggregateError([t,fe(r)])}):r}if(!n&&t)throw t;let o=n?.state??{schemaVersion:1,records:[]};return{repository:new G({now:this.now,idFactory:r=>`${r}_${ft()}`,initialState:o}),generation:n?.generation??0,createdAt:n?.createdAt??this.now(),hasSnapshot:n!==void 0,recoveredFromBackup:i,...n?{sourceSnapshot:n}:{}}}async persist(t){let n=this.now(),o={...{schemaVersion:lt,generation:t.generation,createdAt:t.createdAt,updatedAt:n,state:t.repository.exportState()},generation:t.generation+1},r=On(o),a=`${JSON.stringify(r,null,2)}
2
+ `,{encoding:"utf8",flag:"wx"})}function Sn(e,t){let n=nt(e);n?.pid!==t.pid||n.hostname!==t.hostname||et(e,{force:!0})}function it(e,t,n){let i=wn(),o={schemaVersion:1,name:t,pid:process.pid,hostname:tt(),processStartedAt:En(),version:n,acquiredAt:i,updatedAt:i};try{Qe(e,o)}catch(r){if(r.code!=="EEXIST")throw r;let c=nt(e);if(c&&Xn(c))throw new Error(`${t} is already locked by PID ${c.pid} on ${c.hostname}.`);et(e,{force:!0}),Qe(e,o)}return{record:o,release:()=>{Sn(e,o)}}}var rt="0.9.14";var lt=1,Cn="repository.v1.json",Nn=5e3,Vn=20,Pn=64*1024*1024,ct=class{directory;snapshotPath;backupPath;lockPath;now;lockTimeoutMs;lockRetryMs;maxSnapshotBytes;onRecovery;mutationTail=Promise.resolve();constructor(t){if(!t||typeof t.directory!="string"||t.directory.trim().length===0)throw new TypeError("Artifact repository directory is required");let n=t.snapshotFileName??Cn;if(st(n)!==n||!/^[A-Za-z0-9_.-]+$/.test(n))throw new TypeError("Artifact snapshot filename must be a safe basename");this.directory=xn(t.directory),this.snapshotPath=kn(this.directory,n),this.backupPath=`${this.snapshotPath}.bak`,this.lockPath=`${this.snapshotPath}.lock`,this.now=t.now??(()=>new Date().toISOString()),this.lockTimeoutMs=ke(t.lockTimeoutMs,Nn,100,6e4,"lockTimeoutMs"),this.lockRetryMs=ke(t.lockRetryMs,Vn,1,1e3,"lockRetryMs"),this.maxSnapshotBytes=ke(t.maxSnapshotBytes,Pn,1024,1024*1024*1024,"maxSnapshotBytes"),this.onRecovery=t.onRecovery}async create(t){return this.mutate(n=>n.create(t))}async createRevision(t,n){return this.mutate(i=>i.createRevision(t,n))}async get(t,n){return(await this.load()).repository.get(t,n)}async require(t,n){return(await this.load()).repository.require(t,n)}async list(t){return(await this.load()).repository.list(t)}async listRevisions(t){return(await this.load()).repository.listRevisions(t)}async transition(t){return this.mutate(n=>n.transition(t))}async appendReviewEvent(t){return this.mutate(n=>n.appendReviewEvent(t))}async inspectSnapshot(){return this.readSnapshot(this.snapshotPath,!0)}async mutate(t){return this.enqueueMutation(async()=>{let n=await this.acquireLock();try{let i=await this.load(),o=await t(i.repository);return await this.persist(i),o}finally{n.release()}})}async enqueueMutation(t){let n=this.mutationTail.then(t,t);return this.mutationTail=n.then(()=>{},()=>{}),n}async acquireLock(){let t=Date.now(),n;for(;Date.now()-t<=this.lockTimeoutMs;)try{return it(this.lockPath,`artifact-repository:${st(this.snapshotPath)}`,rt)}catch(i){if(!(i instanceof Error)||!/already locked by PID/.test(i.message))throw i;n=i,await Ln(this.lockRetryMs)}throw new u("ARTIFACT_PERSISTENCE_LOCKED",`Artifact repository remained locked for ${this.lockTimeoutMs}ms`,{snapshotPath:this.snapshotPath},{cause:n})}async load(){let t,n,i=!1;try{n=await this.readSnapshot(this.snapshotPath,!1)}catch(r){t=fe(r)}if(!n&&(t||await Fn(this.backupPath)))try{let r=await this.readSnapshot(this.backupPath,!0);r&&(this.onRecovery?.({snapshotPath:this.snapshotPath,backupPath:this.backupPath,reason:t?.message??"primary snapshot missing"}),n=r,i=!0)}catch(r){throw t?new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository primary and backup snapshots are unreadable",{snapshotPath:this.snapshotPath,backupPath:this.backupPath},{cause:new AggregateError([t,fe(r)])}):r}if(!n&&t)throw t;let o=n?.state??{schemaVersion:1,records:[]};return{repository:new G({now:this.now,idFactory:r=>`${r}_${ft()}`,initialState:o}),generation:n?.generation??0,createdAt:n?.createdAt??this.now(),hasSnapshot:n!==void 0,recoveredFromBackup:i,...n?{sourceSnapshot:n}:{}}}async persist(t){let n=this.now(),o={...{schemaVersion:lt,generation:t.generation,createdAt:t.createdAt,updatedAt:n,state:t.repository.exportState()},generation:t.generation+1},r=On(o),a=`${JSON.stringify(r,null,2)}
3
3
  `;if(Buffer.byteLength(a,"utf8")>this.maxSnapshotBytes)throw new u("ARTIFACT_PERSISTENCE_IO",`Artifact repository snapshot exceeds ${this.maxSnapshotBytes} bytes`,{snapshotPath:this.snapshotPath,maxSnapshotBytes:this.maxSnapshotBytes});await pt(this.directory,{recursive:!0,mode:448}),t.hasSnapshot&&!t.recoveredFromBackup&&t.sourceSnapshot&&await dt(this.backupPath,`${JSON.stringify(t.sourceSnapshot,null,2)}
4
4
  `),await dt(this.snapshotPath,a)}async readSnapshot(t,n){let i;try{i=await ut(t)}catch(o){if(!n&&Ce(o,"ENOENT")||n&&Ce(o,"ENOENT"))return;throw Ne("Unable to inspect artifact repository snapshot",t,o)}if(!i.isFile()||i.size>this.maxSnapshotBytes)throw new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository snapshot is not a bounded regular file",{snapshotPath:t,sizeBytes:i.size,maxSnapshotBytes:this.maxSnapshotBytes});try{let o=await bn(t);if(o.byteLength>this.maxSnapshotBytes)throw new Error("snapshot grew beyond the configured size limit while reading");return $n(JSON.parse(o.toString("utf8")),t)}catch(o){throw o instanceof u?o:Ne("Unable to parse artifact repository snapshot",t,o,!0)}}};function $n(e,t){if(!xe(e)||e.schemaVersion!==lt||!Number.isInteger(e.generation)||e.generation<0||typeof e.createdAt!="string"||!Number.isFinite(Date.parse(e.createdAt))||typeof e.updatedAt!="string"||!Number.isFinite(Date.parse(e.updatedAt))||!xe(e.state)||e.state.schemaVersion!==1||!Array.isArray(e.state.records)||!xe(e.checksum)||e.checksum.algorithm!=="sha256"||typeof e.checksum.value!="string")throw new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository snapshot envelope is invalid",{snapshotPath:t});let n=e,i=Dn(n),o=mt(i);if(n.checksum.value!==o)throw new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository snapshot checksum does not match its payload",{snapshotPath:t});return new G({initialState:n.state}),structuredClone(n)}function On(e){return{...structuredClone(e),checksum:{algorithm:"sha256",value:mt(e)}}}function Dn(e){return{schemaVersion:e.schemaVersion,generation:e.generation,createdAt:e.createdAt,updatedAt:e.updatedAt,state:e.state}}function mt(e){return _(JSON.stringify(e)).value}async function dt(e,t){await pt(at(e),{recursive:!0,mode:448});let n=`${e}.tmp.${process.pid}.${ft()}`,i;try{i=await ot(n,"wx",384),await i.writeFile(t,{encoding:"utf8"}),await i.sync(),await i.close(),i=void 0,await _n(n,e);try{let o=await ot(at(e),"r");try{await o.sync()}finally{await o.close()}}catch{}}finally{i&&await i.close().catch(()=>{}),await Tn(n).catch(()=>{})}}function ke(e,t,n,i,o){if(e===void 0)return t;if(!Number.isInteger(e)||e<n||e>i)throw new TypeError(`${o} must be an integer between ${n} and ${i}`);return e}function xe(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function Ce(e,t){return e instanceof Error&&e.code===t}async function Fn(e){try{return(await ut(e)).isFile()}catch(t){if(Ce(t,"ENOENT"))return!1;throw Ne("Unable to inspect artifact repository backup",e,t)}}function fe(e){return e instanceof Error?e:new Error(String(e))}function Ne(e,t,n,i=!1){return new u(i?"ARTIFACT_PERSISTENCE_CORRUPT":"ARTIFACT_PERSISTENCE_IO",`${e}: ${fe(n).message}`,{snapshotPath:t},{cause:fe(n)})}function Ln(e){return new Promise(t=>setTimeout(t,e))}import{Buffer as At}from"node:buffer";var Mn=16*1024*1024,Hn=5e3,jn=1e5,qn=1e6,Jn=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?:\s?(.*))?$/,X=class extends Error{constructor(n,i){super(i===void 0?n:`${n} at diff line ${i}`);this.line=i;this.name="XenoDiffParseError"}line;code="XENO_DIFF_INVALID"};function yt(e,t={}){if(typeof e!="string")throw new TypeError("Unified diff must be a string");let n=pe(t.maxBytes,Mn,1024,256*1024*1024,"maxBytes"),i=pe(t.maxFiles,Hn,1,1e5,"maxFiles"),o=pe(t.maxHunks,jn,1,1e6,"maxHunks"),r=pe(t.maxLines,qn,1,5e6,"maxLines");if(At.byteLength(e,"utf8")>n)throw new X(`Unified diff exceeds ${n} bytes`);let a=e.replace(/\r\n/g,`
5
5
  `).replace(/\r/g,`
@@ -1 +1 @@
1
- {"inputs":{"src/artifacts/types.ts":{"bytes":11627,"imports":[],"format":"esm"},"src/artifacts/browser-diff.ts":{"bytes":8954,"imports":[],"format":"esm"},"src/artifacts/browser.ts":{"bytes":243,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/browser-diff.ts","kind":"import-statement","original":"./browser-diff.js"}],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1530,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25780,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":9003,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":30001,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2591,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":37,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16811,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/diff-artifact.ts":{"bytes":18491,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/artifacts/review-service.ts":{"bytes":8903,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"}],"format":"esm"},"src/artifacts/spec-lifecycle.ts":{"bytes":31787,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/multi-agent-review.ts":{"bytes":31322,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/legacy-adapters.ts":{"bytes":11181,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"}],"format":"esm"},"src/artifacts/index.ts":{"bytes":396,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/evidence-graph.ts","kind":"import-statement","original":"./evidence-graph.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"./file-repository.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/spec-lifecycle.ts","kind":"import-statement","original":"./spec-lifecycle.js"},{"path":"src/artifacts/multi-agent-review.ts","kind":"import-statement","original":"./multi-agent-review.js"},{"path":"src/artifacts/legacy-adapters.ts","kind":"import-statement","original":"./legacy-adapters.js"}],"format":"esm"}},"outputs":{"dist/artifacts/browser.cjs":{"imports":[],"exports":[],"entryPoint":"src/artifacts/browser.ts","inputs":{"src/artifacts/browser.ts":{"bytesInOutput":361},"src/artifacts/types.ts":{"bytesInOutput":820},"src/artifacts/browser-diff.ts":{"bytesInOutput":4291}},"bytes":6185},"dist/artifacts/index.cjs":{"imports":[{"path":"node:buffer","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:buffer","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:buffer","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/artifacts/index.ts","inputs":{"src/artifacts/index.ts":{"bytesInOutput":2267},"src/artifacts/types.ts":{"bytesInOutput":826},"src/artifacts/validation.ts":{"bytesInOutput":13371},"src/artifacts/hash.ts":{"bytesInOutput":721},"src/utils/custom-names.ts":{"bytesInOutput":124},"src/artifacts/evidence-graph.ts":{"bytesInOutput":4301},"src/artifacts/repository.ts":{"bytesInOutput":13747},"src/artifacts/file-repository.ts":{"bytesInOutput":6758},"src/control-plane/lock.ts":{"bytesInOutput":1067},"src/version.ts":{"bytesInOutput":16},"src/artifacts/diff-artifact.ts":{"bytesInOutput":7846},"src/artifacts/review-service.ts":{"bytesInOutput":3921},"src/artifacts/spec-lifecycle.ts":{"bytesInOutput":14029},"src/artifacts/multi-agent-review.ts":{"bytesInOutput":14125},"src/artifacts/legacy-adapters.ts":{"bytesInOutput":5009}},"bytes":90377}}}
1
+ {"inputs":{"src/artifacts/types.ts":{"bytes":11224,"imports":[],"format":"esm"},"src/artifacts/browser-diff.ts":{"bytes":8767,"imports":[],"format":"esm"},"src/artifacts/browser.ts":{"bytes":232,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/browser-diff.ts","kind":"import-statement","original":"./browser-diff.js"}],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":8778,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":37,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16334,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/diff-artifact.ts":{"bytes":17998,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/artifacts/review-service.ts":{"bytes":8672,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"}],"format":"esm"},"src/artifacts/spec-lifecycle.ts":{"bytes":31007,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/multi-agent-review.ts":{"bytes":30649,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/legacy-adapters.ts":{"bytes":10908,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"}],"format":"esm"},"src/artifacts/index.ts":{"bytes":385,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/evidence-graph.ts","kind":"import-statement","original":"./evidence-graph.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"./file-repository.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/spec-lifecycle.ts","kind":"import-statement","original":"./spec-lifecycle.js"},{"path":"src/artifacts/multi-agent-review.ts","kind":"import-statement","original":"./multi-agent-review.js"},{"path":"src/artifacts/legacy-adapters.ts","kind":"import-statement","original":"./legacy-adapters.js"}],"format":"esm"}},"outputs":{"dist/artifacts/browser.cjs":{"imports":[],"exports":[],"entryPoint":"src/artifacts/browser.ts","inputs":{"src/artifacts/browser.ts":{"bytesInOutput":361},"src/artifacts/types.ts":{"bytesInOutput":820},"src/artifacts/browser-diff.ts":{"bytesInOutput":4291}},"bytes":6185},"dist/artifacts/index.cjs":{"imports":[{"path":"node:buffer","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:buffer","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:buffer","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/artifacts/index.ts","inputs":{"src/artifacts/index.ts":{"bytesInOutput":2267},"src/artifacts/types.ts":{"bytesInOutput":826},"src/artifacts/validation.ts":{"bytesInOutput":13371},"src/artifacts/hash.ts":{"bytesInOutput":721},"src/utils/custom-names.ts":{"bytesInOutput":124},"src/artifacts/evidence-graph.ts":{"bytesInOutput":4301},"src/artifacts/repository.ts":{"bytesInOutput":13747},"src/artifacts/file-repository.ts":{"bytesInOutput":6758},"src/control-plane/lock.ts":{"bytesInOutput":1067},"src/version.ts":{"bytesInOutput":16},"src/artifacts/diff-artifact.ts":{"bytesInOutput":7846},"src/artifacts/review-service.ts":{"bytesInOutput":3921},"src/artifacts/spec-lifecycle.ts":{"bytesInOutput":14029},"src/artifacts/multi-agent-review.ts":{"bytesInOutput":14125},"src/artifacts/legacy-adapters.ts":{"bytesInOutput":5009}},"bytes":90377}}}
@@ -1 +1 @@
1
- {"inputs":{"src/artifacts/types.ts":{"bytes":11627,"imports":[],"format":"esm"},"src/artifacts/browser-diff.ts":{"bytes":8954,"imports":[],"format":"esm"},"src/artifacts/browser.ts":{"bytes":243,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/browser-diff.ts","kind":"import-statement","original":"./browser-diff.js"}],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1530,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25780,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":9003,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":30001,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2591,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":37,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16811,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/diff-artifact.ts":{"bytes":18491,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/artifacts/review-service.ts":{"bytes":8903,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"}],"format":"esm"},"src/artifacts/spec-lifecycle.ts":{"bytes":31787,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/multi-agent-review.ts":{"bytes":31322,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/legacy-adapters.ts":{"bytes":11181,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"}],"format":"esm"},"src/artifacts/index.ts":{"bytes":396,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/evidence-graph.ts","kind":"import-statement","original":"./evidence-graph.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"./file-repository.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/spec-lifecycle.ts","kind":"import-statement","original":"./spec-lifecycle.js"},{"path":"src/artifacts/multi-agent-review.ts","kind":"import-statement","original":"./multi-agent-review.js"},{"path":"src/artifacts/legacy-adapters.ts","kind":"import-statement","original":"./legacy-adapters.js"}],"format":"esm"}},"outputs":{"dist/artifacts/browser.js":{"imports":[],"exports":["XENO_ARTIFACT_ACTOR_KINDS","XENO_ARTIFACT_SCHEMA_VERSION","XENO_ARTIFACT_SENSITIVITIES","XENO_ARTIFACT_STATES","XENO_BUILTIN_ARTIFACT_KINDS","XENO_EVIDENCE_EDGE_TYPES","XENO_EVIDENCE_GRAPH_SCHEMA_VERSION","XENO_EVIDENCE_NODE_TYPES","XenoBrowserDiffError","xenoArtifactToDiffDocument"],"entryPoint":"src/artifacts/browser.ts","inputs":{"src/artifacts/types.ts":{"bytesInOutput":820},"src/artifacts/browser.ts":{"bytesInOutput":0},"src/artifacts/browser-diff.ts":{"bytesInOutput":4291}},"bytes":5435},"dist/artifacts/index.js":{"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:buffer","kind":"import-statement","external":true}],"exports":["FileXenoArtifactRepository","InMemoryXenoArtifactRepository","XENO_ARTIFACT_ACTOR_KINDS","XENO_ARTIFACT_FILE_REPOSITORY_SCHEMA_VERSION","XENO_ARTIFACT_SCHEMA_VERSION","XENO_ARTIFACT_SENSITIVITIES","XENO_ARTIFACT_STATES","XENO_BUILTIN_ARTIFACT_KINDS","XENO_EVIDENCE_EDGE_TYPES","XENO_EVIDENCE_GRAPH_SCHEMA_VERSION","XENO_EVIDENCE_NODE_TYPES","XENO_REVIEW_DIMENSIONS","XENO_REVIEW_EVIDENCE_KINDS","XENO_REVIEW_REPORT_SCHEMA_VERSION","XENO_SPEC_EXECUTION_SCHEMA_VERSION","XENO_SPEC_SCHEMA_VERSION","XenoArtifactRepositoryError","XenoArtifactReviewService","XenoArtifactStateTransitionError","XenoArtifactValidationError","XenoDiffParseError","XenoEvidenceGraphBuilder","XenoEvidenceGraphValidationError","XenoMultiAgentReviewCoordinator","XenoReviewValidationError","XenoSpecLifecycleService","XenoSpecValidationError","assertValidXenoArtifact","assertValidXenoEvidenceGraph","assertValidXenoReviewPack","assertValidXenoReviewReport","assertValidXenoReviewTarget","assertValidXenoSpecDocument","assertValidXenoSpecExecution","assertXenoArtifactStateTransition","buildXenoArtifactReviewAnchor","canTransitionXenoArtifactState","canonicalizeArtifactJson","defaultXenoReviewPack","detectXenoSpecDrift","legacyAgentArtifactToXenoArtifact","normalizeRepositoryRelativePath","parseUnifiedDiff","sha256ArtifactBytes","sha256ArtifactJson","summarizeXenoArtifactReview","toolEvidenceToXenoArtifact","turnDiffSummaryToXenoArtifact","unifiedDiffToXenoArtifact","validateXenoArtifact","validateXenoArtifactReviewEvent","validateXenoEvidenceGraph","validateXenoSpecDocument","xenoArtifactToDiffDocument","xenoArtifactToLegacyAgentArtifact","xenoArtifactToReviewReport","xenoArtifactToSpecDocument","xenoArtifactToSpecExecution","xenoArtifactToToolEvidence","xenoArtifactToTurnDiffSummary","xenoReviewReportToArtifact","xenoReviewReportToGitHubComments","xenoSpecArtifactIds","xenoSpecExecutionToArtifact","xenoSpecToArtifactBundle"],"entryPoint":"src/artifacts/index.ts","inputs":{"src/artifacts/types.ts":{"bytesInOutput":827},"src/artifacts/index.ts":{"bytesInOutput":0},"src/artifacts/validation.ts":{"bytesInOutput":13354},"src/artifacts/hash.ts":{"bytesInOutput":718},"src/utils/custom-names.ts":{"bytesInOutput":124},"src/artifacts/evidence-graph.ts":{"bytesInOutput":4296},"src/artifacts/repository.ts":{"bytesInOutput":13741},"src/artifacts/file-repository.ts":{"bytesInOutput":6731},"src/control-plane/lock.ts":{"bytesInOutput":1054},"src/version.ts":{"bytesInOutput":16},"src/artifacts/diff-artifact.ts":{"bytesInOutput":7840},"src/artifacts/review-service.ts":{"bytesInOutput":3918},"src/artifacts/spec-lifecycle.ts":{"bytesInOutput":14026},"src/artifacts/multi-agent-review.ts":{"bytesInOutput":14122},"src/artifacts/legacy-adapters.ts":{"bytesInOutput":4989}},"bytes":87928}}}
1
+ {"inputs":{"src/artifacts/types.ts":{"bytes":11224,"imports":[],"format":"esm"},"src/artifacts/browser-diff.ts":{"bytes":8767,"imports":[],"format":"esm"},"src/artifacts/browser.ts":{"bytes":232,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/browser-diff.ts","kind":"import-statement","original":"./browser-diff.js"}],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":8778,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/version.ts":{"bytes":37,"imports":[],"format":"esm"},"src/artifacts/file-repository.ts":{"bytes":16334,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"../control-plane/lock.js"},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/diff-artifact.ts":{"bytes":17998,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/artifacts/review-service.ts":{"bytes":8672,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"}],"format":"esm"},"src/artifacts/spec-lifecycle.ts":{"bytes":31007,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/multi-agent-review.ts":{"bytes":30649,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"}],"format":"esm"},"src/artifacts/legacy-adapters.ts":{"bytes":10908,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"}],"format":"esm"},"src/artifacts/index.ts":{"bytes":385,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/evidence-graph.ts","kind":"import-statement","original":"./evidence-graph.js"},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"./repository.js"},{"path":"src/artifacts/file-repository.ts","kind":"import-statement","original":"./file-repository.js"},{"path":"src/artifacts/diff-artifact.ts","kind":"import-statement","original":"./diff-artifact.js"},{"path":"src/artifacts/review-service.ts","kind":"import-statement","original":"./review-service.js"},{"path":"src/artifacts/spec-lifecycle.ts","kind":"import-statement","original":"./spec-lifecycle.js"},{"path":"src/artifacts/multi-agent-review.ts","kind":"import-statement","original":"./multi-agent-review.js"},{"path":"src/artifacts/legacy-adapters.ts","kind":"import-statement","original":"./legacy-adapters.js"}],"format":"esm"}},"outputs":{"dist/artifacts/browser.js":{"imports":[],"exports":["XENO_ARTIFACT_ACTOR_KINDS","XENO_ARTIFACT_SCHEMA_VERSION","XENO_ARTIFACT_SENSITIVITIES","XENO_ARTIFACT_STATES","XENO_BUILTIN_ARTIFACT_KINDS","XENO_EVIDENCE_EDGE_TYPES","XENO_EVIDENCE_GRAPH_SCHEMA_VERSION","XENO_EVIDENCE_NODE_TYPES","XenoBrowserDiffError","xenoArtifactToDiffDocument"],"entryPoint":"src/artifacts/browser.ts","inputs":{"src/artifacts/types.ts":{"bytesInOutput":820},"src/artifacts/browser.ts":{"bytesInOutput":0},"src/artifacts/browser-diff.ts":{"bytesInOutput":4291}},"bytes":5435},"dist/artifacts/index.js":{"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:buffer","kind":"import-statement","external":true}],"exports":["FileXenoArtifactRepository","InMemoryXenoArtifactRepository","XENO_ARTIFACT_ACTOR_KINDS","XENO_ARTIFACT_FILE_REPOSITORY_SCHEMA_VERSION","XENO_ARTIFACT_SCHEMA_VERSION","XENO_ARTIFACT_SENSITIVITIES","XENO_ARTIFACT_STATES","XENO_BUILTIN_ARTIFACT_KINDS","XENO_EVIDENCE_EDGE_TYPES","XENO_EVIDENCE_GRAPH_SCHEMA_VERSION","XENO_EVIDENCE_NODE_TYPES","XENO_REVIEW_DIMENSIONS","XENO_REVIEW_EVIDENCE_KINDS","XENO_REVIEW_REPORT_SCHEMA_VERSION","XENO_SPEC_EXECUTION_SCHEMA_VERSION","XENO_SPEC_SCHEMA_VERSION","XenoArtifactRepositoryError","XenoArtifactReviewService","XenoArtifactStateTransitionError","XenoArtifactValidationError","XenoDiffParseError","XenoEvidenceGraphBuilder","XenoEvidenceGraphValidationError","XenoMultiAgentReviewCoordinator","XenoReviewValidationError","XenoSpecLifecycleService","XenoSpecValidationError","assertValidXenoArtifact","assertValidXenoEvidenceGraph","assertValidXenoReviewPack","assertValidXenoReviewReport","assertValidXenoReviewTarget","assertValidXenoSpecDocument","assertValidXenoSpecExecution","assertXenoArtifactStateTransition","buildXenoArtifactReviewAnchor","canTransitionXenoArtifactState","canonicalizeArtifactJson","defaultXenoReviewPack","detectXenoSpecDrift","legacyAgentArtifactToXenoArtifact","normalizeRepositoryRelativePath","parseUnifiedDiff","sha256ArtifactBytes","sha256ArtifactJson","summarizeXenoArtifactReview","toolEvidenceToXenoArtifact","turnDiffSummaryToXenoArtifact","unifiedDiffToXenoArtifact","validateXenoArtifact","validateXenoArtifactReviewEvent","validateXenoEvidenceGraph","validateXenoSpecDocument","xenoArtifactToDiffDocument","xenoArtifactToLegacyAgentArtifact","xenoArtifactToReviewReport","xenoArtifactToSpecDocument","xenoArtifactToSpecExecution","xenoArtifactToToolEvidence","xenoArtifactToTurnDiffSummary","xenoReviewReportToArtifact","xenoReviewReportToGitHubComments","xenoSpecArtifactIds","xenoSpecExecutionToArtifact","xenoSpecToArtifactBundle"],"entryPoint":"src/artifacts/index.ts","inputs":{"src/artifacts/types.ts":{"bytesInOutput":827},"src/artifacts/index.ts":{"bytesInOutput":0},"src/artifacts/validation.ts":{"bytesInOutput":13354},"src/artifacts/hash.ts":{"bytesInOutput":718},"src/utils/custom-names.ts":{"bytesInOutput":124},"src/artifacts/evidence-graph.ts":{"bytesInOutput":4296},"src/artifacts/repository.ts":{"bytesInOutput":13741},"src/artifacts/file-repository.ts":{"bytesInOutput":6731},"src/control-plane/lock.ts":{"bytesInOutput":1054},"src/version.ts":{"bytesInOutput":16},"src/artifacts/diff-artifact.ts":{"bytesInOutput":7840},"src/artifacts/review-service.ts":{"bytesInOutput":3918},"src/artifacts/spec-lifecycle.ts":{"bytesInOutput":14026},"src/artifacts/multi-agent-review.ts":{"bytesInOutput":14122},"src/artifacts/legacy-adapters.ts":{"bytesInOutput":4989}},"bytes":87928}}}
@@ -463,6 +463,7 @@ interface ToolOperationSnapshot {
463
463
  promotable: boolean;
464
464
  processId?: string;
465
465
  taskId?: string;
466
+ displayName?: string;
466
467
  pid?: number;
467
468
  commandFingerprint?: string;
468
469
  outputPath?: string;
@@ -463,6 +463,7 @@ interface ToolOperationSnapshot {
463
463
  promotable: boolean;
464
464
  processId?: string;
465
465
  taskId?: string;
466
+ displayName?: string;
466
467
  pid?: number;
467
468
  commandFingerprint?: string;
468
469
  outputPath?: string;
@@ -1 +1 @@
1
- {"inputs":{"src/automation/types.ts":{"bytes":7477,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3492,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":894,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5686,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/media/xeno-deflate.ts":{"bytes":20551,"imports":[],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":51182,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/media/xeno-deflate.ts","kind":"import-statement","original":"../media/xeno-deflate.js"}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5859,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13628,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1239,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28957,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17793,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":25096,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15973,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11627,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1530,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25780,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":30001,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8825,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":14618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4428,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":9084,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19655,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":291,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/index.ts":{"bytesInOutput":737},"src/automation/types.ts":{"bytesInOutput":8},"src/automation/operations.ts":{"bytesInOutput":1638},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":3310},"src/media/xeno-deflate.ts":{"bytesInOutput":1061},"src/security/windows-process-containment.ts":{"bytesInOutput":45908},"src/security/containment-certification.ts":{"bytesInOutput":442},"src/security/mxc-containment.ts":{"bytesInOutput":709},"src/security/process-containment.ts":{"bytesInOutput":999},"src/automation/policy.ts":{"bytesInOutput":7870},"src/automation/evidence.ts":{"bytesInOutput":4445},"src/artifacts/types.ts":{"bytesInOutput":818},"src/artifacts/hash.ts":{"bytesInOutput":129},"src/artifacts/validation.ts":{"bytesInOutput":146},"src/artifacts/repository.ts":{"bytesInOutput":137},"src/automation/executor.ts":{"bytesInOutput":6081},"src/automation/conformance.ts":{"bytesInOutput":2191},"src/automation/http-adapter.ts":{"bytesInOutput":4320},"src/automation/tool-pack.ts":{"bytesInOutput":10033}},"bytes":92152}}}
1
+ {"inputs":{"src/automation/types.ts":{"bytes":7223,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3367,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":866,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5541,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/media/xeno-deflate.ts":{"bytes":20035,"imports":[],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":50179,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/media/xeno-deflate.ts","kind":"import-statement","original":"../media/xeno-deflate.js"}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5665,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13312,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28272,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17308,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":24510,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15653,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11224,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":14249,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4331,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":8862,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19206,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":282,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/index.ts":{"bytesInOutput":737},"src/automation/types.ts":{"bytesInOutput":8},"src/automation/operations.ts":{"bytesInOutput":1638},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":3310},"src/media/xeno-deflate.ts":{"bytesInOutput":1061},"src/security/windows-process-containment.ts":{"bytesInOutput":45908},"src/security/containment-certification.ts":{"bytesInOutput":442},"src/security/mxc-containment.ts":{"bytesInOutput":709},"src/security/process-containment.ts":{"bytesInOutput":999},"src/automation/policy.ts":{"bytesInOutput":7870},"src/automation/evidence.ts":{"bytesInOutput":4445},"src/artifacts/types.ts":{"bytesInOutput":818},"src/artifacts/hash.ts":{"bytesInOutput":129},"src/artifacts/validation.ts":{"bytesInOutput":146},"src/artifacts/repository.ts":{"bytesInOutput":137},"src/automation/executor.ts":{"bytesInOutput":6081},"src/automation/conformance.ts":{"bytesInOutput":2191},"src/automation/http-adapter.ts":{"bytesInOutput":4320},"src/automation/tool-pack.ts":{"bytesInOutput":10033}},"bytes":92152}}}
@@ -1 +1 @@
1
- {"inputs":{"src/automation/types.ts":{"bytes":7477,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3492,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":894,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5686,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/media/xeno-deflate.ts":{"bytes":20551,"imports":[],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":51182,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/media/xeno-deflate.ts","kind":"import-statement","original":"../media/xeno-deflate.js"}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5859,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13628,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1239,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28957,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17793,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":25096,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15973,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11627,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1530,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25780,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":30001,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8825,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":14618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4428,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":9084,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19655,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":291,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":["XENO_AUTOMATION_OPERATIONS","XENO_AUTOMATION_PROTOCOL_VERSION","XenoAutomationError","XenoGovernedAutomationExecutor","XenoLoopbackAutomationAdapter","assertRequiredXenoAutomationEvidence","assertValidXenoAutomationAdapterManifest","assertValidXenoAutomationRequest","assertXenoAutomationAdapterConformant","assertXenoAutomationAuthority","buildXenoAutomationCapabilityUse","createXenoAutomationConformanceReport","createXenoGovernedAutomationTools","describeXenoAutomationOperation","isXenoAutomationOperation","materializeXenoAutomationEvidence","persistXenoAutomationEvidence","resolveXenoAutomationEvidencePolicy"],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/types.ts":{"bytesInOutput":8},"src/automation/index.ts":{"bytesInOutput":0},"src/automation/operations.ts":{"bytesInOutput":1638},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":3308},"src/media/xeno-deflate.ts":{"bytesInOutput":1061},"src/security/windows-process-containment.ts":{"bytesInOutput":45908},"src/security/containment-certification.ts":{"bytesInOutput":442},"src/security/mxc-containment.ts":{"bytesInOutput":709},"src/security/process-containment.ts":{"bytesInOutput":999},"src/automation/policy.ts":{"bytesInOutput":7873},"src/automation/evidence.ts":{"bytesInOutput":4442},"src/artifacts/types.ts":{"bytesInOutput":818},"src/artifacts/hash.ts":{"bytesInOutput":126},"src/artifacts/validation.ts":{"bytesInOutput":146},"src/artifacts/repository.ts":{"bytesInOutput":137},"src/automation/executor.ts":{"bytesInOutput":6074},"src/automation/conformance.ts":{"bytesInOutput":2191},"src/automation/http-adapter.ts":{"bytesInOutput":4316},"src/automation/tool-pack.ts":{"bytesInOutput":10028}},"bytes":91043}}}
1
+ {"inputs":{"src/automation/types.ts":{"bytes":7223,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3367,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":866,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5541,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/media/xeno-deflate.ts":{"bytes":20035,"imports":[],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":50179,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/media/xeno-deflate.ts","kind":"import-statement","original":"../media/xeno-deflate.js"}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5665,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13312,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1195,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28272,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17308,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":24510,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15653,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":11224,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/utils/custom-names.ts":{"bytes":2210,"imports":[],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25271,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/utils/custom-names.ts","kind":"import-statement","original":"../utils/custom-names.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":29289,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":14249,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4331,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":8862,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19206,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":282,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":["XENO_AUTOMATION_OPERATIONS","XENO_AUTOMATION_PROTOCOL_VERSION","XenoAutomationError","XenoGovernedAutomationExecutor","XenoLoopbackAutomationAdapter","assertRequiredXenoAutomationEvidence","assertValidXenoAutomationAdapterManifest","assertValidXenoAutomationRequest","assertXenoAutomationAdapterConformant","assertXenoAutomationAuthority","buildXenoAutomationCapabilityUse","createXenoAutomationConformanceReport","createXenoGovernedAutomationTools","describeXenoAutomationOperation","isXenoAutomationOperation","materializeXenoAutomationEvidence","persistXenoAutomationEvidence","resolveXenoAutomationEvidencePolicy"],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/types.ts":{"bytesInOutput":8},"src/automation/index.ts":{"bytesInOutput":0},"src/automation/operations.ts":{"bytesInOutput":1638},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":3308},"src/media/xeno-deflate.ts":{"bytesInOutput":1061},"src/security/windows-process-containment.ts":{"bytesInOutput":45908},"src/security/containment-certification.ts":{"bytesInOutput":442},"src/security/mxc-containment.ts":{"bytesInOutput":709},"src/security/process-containment.ts":{"bytesInOutput":999},"src/automation/policy.ts":{"bytesInOutput":7873},"src/automation/evidence.ts":{"bytesInOutput":4442},"src/artifacts/types.ts":{"bytesInOutput":818},"src/artifacts/hash.ts":{"bytesInOutput":126},"src/artifacts/validation.ts":{"bytesInOutput":146},"src/artifacts/repository.ts":{"bytesInOutput":137},"src/automation/executor.ts":{"bytesInOutput":6074},"src/automation/conformance.ts":{"bytesInOutput":2191},"src/automation/http-adapter.ts":{"bytesInOutput":4316},"src/automation/tool-pack.ts":{"bytesInOutput":10028}},"bytes":91043}}}
@@ -1,4 +1,4 @@
1
- "use strict";var L=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var ve=Object.prototype.hasOwnProperty;var ke=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},Ae=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of we(e))!ve.call(n,o)&&o!==t&&L(n,o,{get:()=>e[o],enumerable:!(r=Re(e,o))||r.enumerable});return n};var ye=n=>Ae(L({},"__esModule",{value:!0}),n);var Je={};ke(Je,{AGENT_DAEMON_PROTOCOL_VERSION:()=>S,AgentDaemonClient:()=>G,AgentDaemonServer:()=>B,AgentEventStore:()=>P,AgentRunController:()=>z,AgentRunStore:()=>T,MonitorManager:()=>K,MonitorStopTool:()=>ee,MonitorTool:()=>Y,OtelExporter:()=>re,UsageAccumulator:()=>N,UsageLedger:()=>te,WorkflowPlanner:()=>E,WorkflowRuntime:()=>Z,WorkflowStore:()=>M,acquireControlPlaneLock:()=>I,createAgentRunId:()=>pe,getAgentRunDir:()=>Le,getAgentRunStoreDir:()=>$e});module.exports=ye(Je);var le=require("node:crypto"),d=require("node:fs"),u=require("node:path");var x="0.9.10";var h=require("node:fs"),F=require("node:os"),se=require("node:path");function Se(){return new Date().toISOString()}function Ee(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function ie(n){try{return JSON.parse((0,h.readFileSync)(n,"utf8"))}catch{return null}}function De(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function xe(n){return n.hostname!==(0,F.hostname)()?!0:De(n.pid)}function oe(n,e){(0,h.mkdirSync)((0,se.dirname)(n),{recursive:!0}),(0,h.writeFileSync)(n,JSON.stringify(e,null,2)+`
1
+ "use strict";var L=Object.defineProperty;var Re=Object.getOwnPropertyDescriptor;var we=Object.getOwnPropertyNames;var ve=Object.prototype.hasOwnProperty;var ke=(n,e)=>{for(var t in e)L(n,t,{get:e[t],enumerable:!0})},Ae=(n,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of we(e))!ve.call(n,o)&&o!==t&&L(n,o,{get:()=>e[o],enumerable:!(r=Re(e,o))||r.enumerable});return n};var ye=n=>Ae(L({},"__esModule",{value:!0}),n);var Je={};ke(Je,{AGENT_DAEMON_PROTOCOL_VERSION:()=>S,AgentDaemonClient:()=>G,AgentDaemonServer:()=>B,AgentEventStore:()=>P,AgentRunController:()=>z,AgentRunStore:()=>T,MonitorManager:()=>K,MonitorStopTool:()=>ee,MonitorTool:()=>Y,OtelExporter:()=>re,UsageAccumulator:()=>N,UsageLedger:()=>te,WorkflowPlanner:()=>E,WorkflowRuntime:()=>Z,WorkflowStore:()=>M,acquireControlPlaneLock:()=>I,createAgentRunId:()=>pe,getAgentRunDir:()=>Le,getAgentRunStoreDir:()=>$e});module.exports=ye(Je);var le=require("node:crypto"),d=require("node:fs"),u=require("node:path");var x="0.9.14";var h=require("node:fs"),F=require("node:os"),se=require("node:path");function Se(){return new Date().toISOString()}function Ee(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function ie(n){try{return JSON.parse((0,h.readFileSync)(n,"utf8"))}catch{return null}}function De(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function xe(n){return n.hostname!==(0,F.hostname)()?!0:De(n.pid)}function oe(n,e){(0,h.mkdirSync)((0,se.dirname)(n),{recursive:!0}),(0,h.writeFileSync)(n,JSON.stringify(e,null,2)+`
2
2
  `,{encoding:"utf8",flag:"wx"})}function Ie(n,e){let t=ie(n);t?.pid!==e.pid||t.hostname!==e.hostname||(0,h.rmSync)(n,{force:!0})}function I(n,e,t){let r=Se(),o={schemaVersion:1,name:e,pid:process.pid,hostname:(0,F.hostname)(),processStartedAt:Ee(),version:t,acquiredAt:r,updatedAt:r};try{oe(n,o)}catch(i){if(i.code!=="EEXIST")throw i;let a=ie(n);if(a&&xe(a))throw new Error(`${e} is already locked by PID ${a.pid} on ${a.hostname}.`);(0,h.rmSync)(n,{force:!0}),oe(n,o)}return{record:o,release:()=>{Ie(n,o)}}}var de=require("node:crypto"),R=require("node:fs"),A=require("node:path");function ae(n){return(0,A.basename)(n).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function ue(n){return(0,R.existsSync)(n)?(0,R.readFileSync)(n,"utf8").split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(e=>e!==null):[]}var P=class{constructor(e){this.runsDir=e;(0,R.mkdirSync)(this.runsDir,{recursive:!0})}runsDir;pathFor(e){return(0,A.join)(this.runsDir,ae(e),"events.jsonl")}append(e,t,r={},o=new Date().toISOString()){let i=this.pathFor(e);(0,R.mkdirSync)((0,A.dirname)(i),{recursive:!0});let s=I(`${i}.lock`,`events:${ae(e)}`,x);try{let a=ue(i).reduce((W,m,b)=>Math.max(W,m.sequence??b),-1)+1,f={schemaVersion:1,eventId:`event_${(0,de.randomUUID)()}`,sequence:a,runId:e,type:t,timestamp:o,payload:r};return(0,R.appendFileSync)(i,`${JSON.stringify(f)}
3
3
  `,"utf8"),f}finally{s.release()}}read(e){return ue(this.pathFor(e))}tail(e,t=100){let r=Math.max(0,Math.min(1e4,Math.trunc(t)));return r===0?[]:this.read(e).slice(-r)}};var k=require("node:os");var j=require("node:path"),Ze=(0,k.platform)();var Ke=(0,k.release)(),Ye=(0,k.homedir)();function y(){let n=process.env.XENO_AGENT_HOME?.trim();return n?(0,j.resolve)(n):(0,j.resolve)((0,k.homedir)(),".xeno-agent")}var Pe=1,Te=(0,u.join)(y(),"daemon"),H=(0,u.join)(Te,"runs");function p(){return new Date().toISOString()}function be(n=new Date){return n.toISOString().replace(/[^0-9]/g,"").slice(0,14)}function J(n){return n.replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,80)}function q(n){return(0,u.resolve)(n)}function C(n){return q(n).toLowerCase()}function ce(n,e){let t=C(n),r=C(e);return t===r||t.startsWith(`${r}\\`)||t.startsWith(`${r}/`)}function Oe(n,e){return!!(C(n.cwd)===C(e)||n.git?.root&&ce(e,n.git.root)||n.git?.worktree&&ce(e,n.git.worktree))}function Ce(n){return J(Buffer.from(q(n)).toString("base64url"))}function _e(){return{input:0,output:0,total:0}}function O(n){try{return JSON.parse((0,d.readFileSync)(n,"utf8"))}catch{return null}}function Ue(n){return n instanceof Error&&/\balready locked by PID\b/.test(n.message)}function Me(n,e){(0,d.mkdirSync)((0,u.dirname)(n),{recursive:!0});let t=`${n}.${process.pid}.${Date.now()}.tmp`;(0,d.writeFileSync)(t,JSON.stringify(e,null,2)+`
4
4
  `,"utf8"),(0,d.renameSync)(t,n)}function Ne(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function Ve(n){return n==="completed"||n==="failed"||n==="cancelled"||n==="interrupted"}function We(n,e){return n.pinned!==e.pinned?n.pinned?-1:1:Date.parse(e.updatedAt)-Date.parse(n.updatedAt)}function $e(){return H}function Le(n){return(0,u.join)(H,n)}function pe(n=new Date){return`run_${be(n)}_${(0,le.randomUUID)().slice(0,8)}`}var T=class{constructor(e=H){this.runsDir=e;(0,d.mkdirSync)(this.runsDir,{recursive:!0}),this.eventStore=new P(this.runsDir)}runsDir;eventStore;create(e){let t=pe(),r=(0,u.join)(this.runsDir,t);(0,d.mkdirSync)(r,{recursive:!0});let o=p(),i=(0,u.join)(r,"events.jsonl"),s={schemaVersion:Pe,runId:t,sessionId:t,rootRunId:t,cwd:q(e.cwd),workspaceId:Ce(e.cwd),prompt:e.prompt,...e.title?{title:e.title}:{},status:"starting",model:e.model,...e.effort?{effort:e.effort}:{},...e.agent?{agent:e.agent}:{},...e.git?{git:e.git}:{},permissionMode:e.permissionMode,...e.cliVersion?{createdByCliVersion:e.cliVersion}:{},createdBySdkVersion:e.sdkVersion??x,createdAt:o,updatedAt:o,lastActivityAt:o,pinned:!!e.pinned,attachedClients:0,...e.cliVersion?{cliVersion:e.cliVersion}:{},...e.sdkVersion?{sdkVersion:e.sdkVersion}:{},stdoutPath:(0,u.join)(r,"stdout.log"),stderrPath:(0,u.join)(r,"stderr.log"),eventsPath:i,usage:_e(),children:[],tags:[]};return(0,d.writeFileSync)(s.stdoutPath,"","utf8"),(0,d.writeFileSync)(s.stderrPath,"","utf8"),(0,d.writeFileSync)(s.eventsPath,"","utf8"),this.write(s),this.appendEvent(t,"run_created",{cwd:s.cwd,model:s.model,...s.agent?{agent:s.agent}:{},...s.git?{git:s.git}:{},permissionMode:s.permissionMode,pinned:s.pinned}),s}get(e){let t=O(this.recordPath(e));return t?this.refreshRecordStatus(t):null}list(e={}){if(!(0,d.existsSync)(this.runsDir))return[];let t=(0,d.readdirSync)(this.runsDir,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>{try{return this.get(r.name)}catch(o){if(Ue(o))return O(this.recordPath(r.name));throw o}}).filter(r=>r!==null).filter(r=>e.all||!e.cwd||Oe(r,e.cwd)).filter(r=>!e.status||e.status.includes(r.status)).sort(We);return typeof e.limit=="number"&&e.limit>0?t.slice(0,e.limit):t}markSpawned(e,t,r){return this.update(e,o=>({...o,status:"running",workerPid:t,...r?{workerVersion:r}:{},startedAt:o.startedAt??p(),lastActivityAt:p()}))}markStarted(e,t){return this.update(e,r=>({...r,status:"running",workerPid:t.pid,...t.workerVersion?{workerVersion:t.workerVersion}:{},...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{},startedAt:r.startedAt??p(),lastActivityAt:p()}))}markCompleted(e,t){return this.update(e,r=>({...r,status:t.status,...t.statusReason?{statusReason:t.statusReason}:{},exitCode:t.exitCode??null,usage:t.usage??r.usage,endedAt:p(),lastActivityAt:p()}))}markCancelled(e,t){return this.update(e,r=>({...r,status:"cancelled",statusReason:t,endedAt:p(),lastActivityAt:p()}))}markPaused(e,t="Paused by user."){let r=this.update(e,o=>({...o,status:"paused",statusReason:t,lastActivityAt:p()}));return r&&this.appendEvent(e,"run_paused",{reason:t}),r}markResumed(e,t="Resumed by user."){let r=this.update(e,o=>{let i={...o,status:"running",statusReason:t,lastActivityAt:p()};return delete i.endedAt,delete i.exitCode,i});return r&&this.appendEvent(e,"run_resumed",{reason:t}),r}setPinned(e,t){let r=this.update(e,o=>({...o,pinned:t,lastActivityAt:p()}));return r&&this.appendEvent(e,t?"run_pinned":"run_unpinned",{pinned:t}),r}appendEvent(e,t,r={}){let o=O(this.recordPath(e)),i=this.eventStore.append(e,t,r);o&&this.update(e,s=>({...s,lastActivityAt:i.timestamp}))}readEvents(e){return this.get(e)?this.eventStore.read(e):[]}delete(e){(0,d.rmSync)((0,u.join)(this.runsDir,e),{recursive:!0,force:!0})}refreshRecordStatus(e){if(Ve(e.status))return e;if(e.workerPid&&!Ne(e.workerPid)){let t={...e,status:"failed",statusReason:"Worker process is no longer running and did not record a terminal status.",endedAt:e.endedAt??p(),updatedAt:p()};return this.write(t),t}return e}update(e,t){let r=O(this.recordPath(e));if(!r)return null;let o=t(r);return o.updatedAt=p(),this.write(o),o}write(e){let t=I((0,u.join)(this.runDir(e.runId),"run.lock"),`run:${e.runId}`,x);try{Me(this.recordPath(e.runId),e)}finally{t.release()}}recordPath(e){return(0,u.join)(this.runsDir,J((0,u.basename)(e)),"run.json")}runDir(e){return(0,u.join)(this.runsDir,J((0,u.basename)(e)))}};function ge(n){return n==="completed"||n==="failed"||n==="cancelled"||n==="interrupted"}var z=class{constructor(e={}){this.options=e;this.store=e.store??new T}options;store;create(e){return this.store.create(e)}async start(e){let t=this.create(e);if(!this.options.spawn)return t;try{let r=await this.options.spawn(t),o=this.store.markSpawned(t.runId,r.pid,r.workerVersion);if(!o)throw new Error(`Run disappeared during spawn: ${t.runId}`);return this.store.appendEvent(t.runId,"run_started",{pid:r.pid}),o}catch(r){let o=r instanceof Error?r.message:String(r);throw this.store.markCompleted(t.runId,{status:"failed",statusReason:o,exitCode:null}),this.store.appendEvent(t.runId,"run_start_failed",{reason:o}),r}}get(e){return this.store.get(e)}list(e={}){return this.store.list(e)}events(e,t){let r=this.store.readEvents(e);return t===void 0?r:r.slice(-Math.max(0,Math.trunc(t)))}async stop(e,t="Stopped by user."){let r=this.store.get(e);if(!r||ge(r.status))return r;await this.options.stop?.(r,t);let o=this.store.markCancelled(e,t);return o&&this.store.appendEvent(e,"run_cancelled",{reason:t}),o}async pause(e,t="Paused by user."){let r=this.store.get(e);return!r||ge(r.status)||r.status==="paused"?r:(await this.options.pause?.(r,t),this.store.markPaused(e,t))}async resume(e,t="Resumed by user."){let r=this.store.get(e);return!r||r.status!=="paused"?r:(await this.options.resume?.(r,t),this.store.markResumed(e,t))}complete(e,t,r={}){let o=this.store.markCompleted(e,{status:t,...r.reason?{statusReason:r.reason}:{},...r.exitCode!==void 0?{exitCode:r.exitCode}:{},...r.usage?{usage:r.usage}:{}});return o&&this.store.appendEvent(e,`run_${t}`,{...r.reason?{reason:r.reason}:{}}),o}};var _=require("node:crypto"),S=1;function Fe(n,e){if(!n)return!1;let t=Buffer.from(n),r=Buffer.from(e);return t.length===r.length&&(0,_.timingSafeEqual)(t,r)}var B=class{constructor(e={}){this.options=e}options;handlers=new Map;register(e,t){let r=e.trim();if(!r)throw new Error("Daemon method name cannot be empty.");if(this.handlers.has(r))throw new Error(`Daemon method already registered: ${r}`);return this.handlers.set(r,t),this}registerController(e){return this.register("runs.start",t=>e.start(t)).register("runs.get",t=>e.get(t.runId)).register("runs.list",t=>e.list(t??{})).register("runs.events",t=>{let r=t;return e.events(r.runId,r.limit)}).register("runs.stop",t=>{let r=t;return e.stop(r.runId,r.reason)}).register("runs.pause",t=>{let r=t;return e.pause(r.runId,r.reason)}).register("runs.resume",t=>{let r=t;return e.resume(r.runId,r.reason)})}async handle(e){if(e.protocolVersion!==S)return this.error(e.id,"PROTOCOL_MISMATCH",`Unsupported protocol version: ${e.protocolVersion}`);if(this.options.authToken&&!Fe(e.authToken,this.options.authToken))return this.error(e.id,"UNAUTHORIZED","Daemon authentication failed.");let t=this.handlers.get(e.method);if(!t)return this.error(e.id,"METHOD_NOT_FOUND",`Unknown daemon method: ${e.method}`);try{return{protocolVersion:S,id:e.id,result:await t(e.params,e)}}catch(r){return this.error(e.id,"INTERNAL_ERROR",r instanceof Error?r.message:String(r))}}error(e,t,r){return{protocolVersion:S,id:e,error:{code:t,message:r}}}},G=class{constructor(e,t={}){this.transport=e;this.options=t}transport;options;async request(e,t){let r={protocolVersion:S,id:`request_${(0,_.randomUUID)()}`,method:e,params:t,...this.options.authToken?{authToken:this.options.authToken}:{}},o=await this.transport(r);if(o.protocolVersion!==S||o.id!==r.id)throw new Error("Invalid daemon response identity.");if("error"in o){let i=new Error(o.error.message);throw i.code=o.error.code,i}return o.result}};var X=require("node:crypto"),c=require("node:fs"),g=require("node:path");function U(n){return(0,g.basename)(n).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function Q(n){try{return JSON.parse((0,c.readFileSync)(n,"utf8"))}catch{return null}}function me(n,e){(0,c.mkdirSync)((0,g.dirname)(n),{recursive:!0});let t=`${n}.${process.pid}.${Date.now()}.tmp`;(0,c.writeFileSync)(t,`${JSON.stringify(e,null,2)}
@@ -1,4 +1,4 @@
1
- import{randomUUID as Pe}from"node:crypto";import{existsSync as Te,mkdirSync as O,readFileSync as be,readdirSync as Oe,renameSync as Ce,rmSync as _e,writeFileSync as E}from"node:fs";import{basename as G,dirname as Ue,join as l,resolve as Me}from"node:path";var R="0.9.10";import{mkdirSync as ce,readFileSync as le,rmSync as L,writeFileSync as pe}from"node:fs";import{hostname as F}from"node:os";import{dirname as ge}from"node:path";function me(){return new Date().toISOString()}function fe(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function j(n){try{return JSON.parse(le(n,"utf8"))}catch{return null}}function he(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function Re(n){return n.hostname!==F()?!0:he(n.pid)}function $(n,e){ce(ge(n),{recursive:!0}),pe(n,JSON.stringify(e,null,2)+`
1
+ import{randomUUID as Pe}from"node:crypto";import{existsSync as Te,mkdirSync as O,readFileSync as be,readdirSync as Oe,renameSync as Ce,rmSync as _e,writeFileSync as E}from"node:fs";import{basename as G,dirname as Ue,join as l,resolve as Me}from"node:path";var R="0.9.14";import{mkdirSync as ce,readFileSync as le,rmSync as L,writeFileSync as pe}from"node:fs";import{hostname as F}from"node:os";import{dirname as ge}from"node:path";function me(){return new Date().toISOString()}function fe(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function j(n){try{return JSON.parse(le(n,"utf8"))}catch{return null}}function he(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function Re(n){return n.hostname!==F()?!0:he(n.pid)}function $(n,e){ce(ge(n),{recursive:!0}),pe(n,JSON.stringify(e,null,2)+`
2
2
  `,{encoding:"utf8",flag:"wx"})}function we(n,e){let t=j(n);t?.pid!==e.pid||t.hostname!==e.hostname||L(n,{force:!0})}function A(n,e,t){let r=me(),o={schemaVersion:1,name:e,pid:process.pid,hostname:F(),processStartedAt:fe(),version:t,acquiredAt:r,updatedAt:r};try{$(n,o)}catch(i){if(i.code!=="EEXIST")throw i;let a=j(n);if(a&&Re(a))throw new Error(`${e} is already locked by PID ${a.pid} on ${a.hostname}.`);L(n,{force:!0}),$(n,o)}return{record:o,release:()=>{we(n,o)}}}import{randomUUID as ve}from"node:crypto";import{appendFileSync as ke,existsSync as Ae,mkdirSync as J,readFileSync as ye}from"node:fs";import{basename as Se,dirname as Ee,join as De}from"node:path";function H(n){return Se(n).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function q(n){return Ae(n)?ye(n,"utf8").split(/\r?\n/).map(e=>e.trim()).filter(Boolean).map(e=>{try{return JSON.parse(e)}catch{return null}}).filter(e=>e!==null):[]}var y=class{constructor(e){this.runsDir=e;J(this.runsDir,{recursive:!0})}runsDir;pathFor(e){return De(this.runsDir,H(e),"events.jsonl")}append(e,t,r={},o=new Date().toISOString()){let i=this.pathFor(e);J(Ee(i),{recursive:!0});let s=A(`${i}.lock`,`events:${H(e)}`,R);try{let a=q(i).reduce((T,c,k)=>Math.max(T,c.sequence??k),-1)+1,p={schemaVersion:1,eventId:`event_${ve()}`,sequence:a,runId:e,type:t,timestamp:o,payload:r};return ke(i,`${JSON.stringify(p)}
3
3
  `,"utf8"),p}finally{s.release()}}read(e){return q(this.pathFor(e))}tail(e,t=100){let r=Math.max(0,Math.min(1e4,Math.trunc(t)));return r===0?[]:this.read(e).slice(-r)}};import{homedir as B,platform as xe,release as Ie}from"node:os";import{resolve as z}from"node:path";var xt=xe();var It=Ie(),Pt=B();function f(){let n=process.env.XENO_AGENT_HOME?.trim();return n?z(n):z(B(),".xeno-agent")}var Ne=1,Ve=l(f(),"daemon"),_=l(Ve,"runs");function d(){return new Date().toISOString()}function We(n=new Date){return n.toISOString().replace(/[^0-9]/g,"").slice(0,14)}function C(n){return n.replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,80)}function U(n){return Me(n)}function D(n){return U(n).toLowerCase()}function Q(n,e){let t=D(n),r=D(e);return t===r||t.startsWith(`${r}\\`)||t.startsWith(`${r}/`)}function $e(n,e){return!!(D(n.cwd)===D(e)||n.git?.root&&Q(e,n.git.root)||n.git?.worktree&&Q(e,n.git.worktree))}function Le(n){return C(Buffer.from(U(n)).toString("base64url"))}function Fe(){return{input:0,output:0,total:0}}function S(n){try{return JSON.parse(be(n,"utf8"))}catch{return null}}function je(n){return n instanceof Error&&/\balready locked by PID\b/.test(n.message)}function Je(n,e){O(Ue(n),{recursive:!0});let t=`${n}.${process.pid}.${Date.now()}.tmp`;E(t,JSON.stringify(e,null,2)+`
4
4
  `,"utf8"),Ce(t,n)}function He(n){if(!n||n<=0)return!1;try{return process.kill(n,0),!0}catch{return!1}}function qe(n){return n==="completed"||n==="failed"||n==="cancelled"||n==="interrupted"}function ze(n,e){return n.pinned!==e.pinned?n.pinned?-1:1:Date.parse(e.updatedAt)-Date.parse(n.updatedAt)}function Vt(){return _}function Wt(n){return l(_,n)}function Be(n=new Date){return`run_${We(n)}_${Pe().slice(0,8)}`}var x=class{constructor(e=_){this.runsDir=e;O(this.runsDir,{recursive:!0}),this.eventStore=new y(this.runsDir)}runsDir;eventStore;create(e){let t=Be(),r=l(this.runsDir,t);O(r,{recursive:!0});let o=d(),i=l(r,"events.jsonl"),s={schemaVersion:Ne,runId:t,sessionId:t,rootRunId:t,cwd:U(e.cwd),workspaceId:Le(e.cwd),prompt:e.prompt,...e.title?{title:e.title}:{},status:"starting",model:e.model,...e.effort?{effort:e.effort}:{},...e.agent?{agent:e.agent}:{},...e.git?{git:e.git}:{},permissionMode:e.permissionMode,...e.cliVersion?{createdByCliVersion:e.cliVersion}:{},createdBySdkVersion:e.sdkVersion??R,createdAt:o,updatedAt:o,lastActivityAt:o,pinned:!!e.pinned,attachedClients:0,...e.cliVersion?{cliVersion:e.cliVersion}:{},...e.sdkVersion?{sdkVersion:e.sdkVersion}:{},stdoutPath:l(r,"stdout.log"),stderrPath:l(r,"stderr.log"),eventsPath:i,usage:Fe(),children:[],tags:[]};return E(s.stdoutPath,"","utf8"),E(s.stderrPath,"","utf8"),E(s.eventsPath,"","utf8"),this.write(s),this.appendEvent(t,"run_created",{cwd:s.cwd,model:s.model,...s.agent?{agent:s.agent}:{},...s.git?{git:s.git}:{},permissionMode:s.permissionMode,pinned:s.pinned}),s}get(e){let t=S(this.recordPath(e));return t?this.refreshRecordStatus(t):null}list(e={}){if(!Te(this.runsDir))return[];let t=Oe(this.runsDir,{withFileTypes:!0}).filter(r=>r.isDirectory()).map(r=>{try{return this.get(r.name)}catch(o){if(je(o))return S(this.recordPath(r.name));throw o}}).filter(r=>r!==null).filter(r=>e.all||!e.cwd||$e(r,e.cwd)).filter(r=>!e.status||e.status.includes(r.status)).sort(ze);return typeof e.limit=="number"&&e.limit>0?t.slice(0,e.limit):t}markSpawned(e,t,r){return this.update(e,o=>({...o,status:"running",workerPid:t,...r?{workerVersion:r}:{},startedAt:o.startedAt??d(),lastActivityAt:d()}))}markStarted(e,t){return this.update(e,r=>({...r,status:"running",workerPid:t.pid,...t.workerVersion?{workerVersion:t.workerVersion}:{},...t.model?{model:t.model}:{},...t.effort?{effort:t.effort}:{},startedAt:r.startedAt??d(),lastActivityAt:d()}))}markCompleted(e,t){return this.update(e,r=>({...r,status:t.status,...t.statusReason?{statusReason:t.statusReason}:{},exitCode:t.exitCode??null,usage:t.usage??r.usage,endedAt:d(),lastActivityAt:d()}))}markCancelled(e,t){return this.update(e,r=>({...r,status:"cancelled",statusReason:t,endedAt:d(),lastActivityAt:d()}))}markPaused(e,t="Paused by user."){let r=this.update(e,o=>({...o,status:"paused",statusReason:t,lastActivityAt:d()}));return r&&this.appendEvent(e,"run_paused",{reason:t}),r}markResumed(e,t="Resumed by user."){let r=this.update(e,o=>{let i={...o,status:"running",statusReason:t,lastActivityAt:d()};return delete i.endedAt,delete i.exitCode,i});return r&&this.appendEvent(e,"run_resumed",{reason:t}),r}setPinned(e,t){let r=this.update(e,o=>({...o,pinned:t,lastActivityAt:d()}));return r&&this.appendEvent(e,t?"run_pinned":"run_unpinned",{pinned:t}),r}appendEvent(e,t,r={}){let o=S(this.recordPath(e)),i=this.eventStore.append(e,t,r);o&&this.update(e,s=>({...s,lastActivityAt:i.timestamp}))}readEvents(e){return this.get(e)?this.eventStore.read(e):[]}delete(e){_e(l(this.runsDir,e),{recursive:!0,force:!0})}refreshRecordStatus(e){if(qe(e.status))return e;if(e.workerPid&&!He(e.workerPid)){let t={...e,status:"failed",statusReason:"Worker process is no longer running and did not record a terminal status.",endedAt:e.endedAt??d(),updatedAt:d()};return this.write(t),t}return e}update(e,t){let r=S(this.recordPath(e));if(!r)return null;let o=t(r);return o.updatedAt=d(),this.write(o),o}write(e){let t=A(l(this.runDir(e.runId),"run.lock"),`run:${e.runId}`,R);try{Je(this.recordPath(e.runId),e)}finally{t.release()}}recordPath(e){return l(this.runsDir,C(G(e)),"run.json")}runDir(e){return l(this.runsDir,C(G(e)))}};function X(n){return n==="completed"||n==="failed"||n==="cancelled"||n==="interrupted"}var Z=class{constructor(e={}){this.options=e;this.store=e.store??new x}options;store;create(e){return this.store.create(e)}async start(e){let t=this.create(e);if(!this.options.spawn)return t;try{let r=await this.options.spawn(t),o=this.store.markSpawned(t.runId,r.pid,r.workerVersion);if(!o)throw new Error(`Run disappeared during spawn: ${t.runId}`);return this.store.appendEvent(t.runId,"run_started",{pid:r.pid}),o}catch(r){let o=r instanceof Error?r.message:String(r);throw this.store.markCompleted(t.runId,{status:"failed",statusReason:o,exitCode:null}),this.store.appendEvent(t.runId,"run_start_failed",{reason:o}),r}}get(e){return this.store.get(e)}list(e={}){return this.store.list(e)}events(e,t){let r=this.store.readEvents(e);return t===void 0?r:r.slice(-Math.max(0,Math.trunc(t)))}async stop(e,t="Stopped by user."){let r=this.store.get(e);if(!r||X(r.status))return r;await this.options.stop?.(r,t);let o=this.store.markCancelled(e,t);return o&&this.store.appendEvent(e,"run_cancelled",{reason:t}),o}async pause(e,t="Paused by user."){let r=this.store.get(e);return!r||X(r.status)||r.status==="paused"?r:(await this.options.pause?.(r,t),this.store.markPaused(e,t))}async resume(e,t="Resumed by user."){let r=this.store.get(e);return!r||r.status!=="paused"?r:(await this.options.resume?.(r,t),this.store.markResumed(e,t))}complete(e,t,r={}){let o=this.store.markCompleted(e,{status:t,...r.reason?{statusReason:r.reason}:{},...r.exitCode!==void 0?{exitCode:r.exitCode}:{},...r.usage?{usage:r.usage}:{}});return o&&this.store.appendEvent(e,`run_${t}`,{...r.reason?{reason:r.reason}:{}}),o}};import{randomUUID as Ge,timingSafeEqual as Qe}from"node:crypto";var w=1;function Xe(n,e){if(!n)return!1;let t=Buffer.from(n),r=Buffer.from(e);return t.length===r.length&&Qe(t,r)}var K=class{constructor(e={}){this.options=e}options;handlers=new Map;register(e,t){let r=e.trim();if(!r)throw new Error("Daemon method name cannot be empty.");if(this.handlers.has(r))throw new Error(`Daemon method already registered: ${r}`);return this.handlers.set(r,t),this}registerController(e){return this.register("runs.start",t=>e.start(t)).register("runs.get",t=>e.get(t.runId)).register("runs.list",t=>e.list(t??{})).register("runs.events",t=>{let r=t;return e.events(r.runId,r.limit)}).register("runs.stop",t=>{let r=t;return e.stop(r.runId,r.reason)}).register("runs.pause",t=>{let r=t;return e.pause(r.runId,r.reason)}).register("runs.resume",t=>{let r=t;return e.resume(r.runId,r.reason)})}async handle(e){if(e.protocolVersion!==w)return this.error(e.id,"PROTOCOL_MISMATCH",`Unsupported protocol version: ${e.protocolVersion}`);if(this.options.authToken&&!Xe(e.authToken,this.options.authToken))return this.error(e.id,"UNAUTHORIZED","Daemon authentication failed.");let t=this.handlers.get(e.method);if(!t)return this.error(e.id,"METHOD_NOT_FOUND",`Unknown daemon method: ${e.method}`);try{return{protocolVersion:w,id:e.id,result:await t(e.params,e)}}catch(r){return this.error(e.id,"INTERNAL_ERROR",r instanceof Error?r.message:String(r))}}error(e,t,r){return{protocolVersion:w,id:e,error:{code:t,message:r}}}},Y=class{constructor(e,t={}){this.transport=e;this.options=t}transport;options;async request(e,t){let r={protocolVersion:w,id:`request_${Ge()}`,method:e,params:t,...this.options.authToken?{authToken:this.options.authToken}:{}},o=await this.transport(r);if(o.protocolVersion!==w||o.id!==r.id)throw new Error("Invalid daemon response identity.");if("error"in o){let i=new Error(o.error.message);throw i.code=o.error.code,i}return o.result}};import{randomUUID as ee}from"node:crypto";import{appendFileSync as Ze,existsSync as Ke,mkdirSync as P,readFileSync as ne,readdirSync as Ye,renameSync as et,writeFileSync as tt}from"node:fs";import{basename as rt,dirname as oe,join as g}from"node:path";function I(n){return rt(n).replace(/[^A-Za-z0-9_.-]/g,"_").slice(0,96)}function M(n){try{return JSON.parse(ne(n,"utf8"))}catch{return null}}function te(n,e){P(oe(n),{recursive:!0});let t=`${n}.${process.pid}.${Date.now()}.tmp`;tt(t,`${JSON.stringify(e,null,2)}
@@ -1 +1 @@
1
- {"inputs":{"src/control-plane/types.ts":{"bytes":2578,"imports":[],"format":"esm"},"src/version.ts":{"bytes":37,"imports":[],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2591,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/event-store.ts":{"bytes":2379,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"}],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/run-store.ts":{"bytes":11948,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/control-plane/event-store.ts","kind":"import-statement","original":"./event-store.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/controller.ts":{"bytes":4220,"imports":[{"path":"src/control-plane/run-store.ts","kind":"import-statement","original":"./run-store.js"}],"format":"esm"},"src/control-plane/daemon.ts":{"bytes":5047,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/workflow.ts":{"bytes":10381,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/monitor.ts":{"bytes":4128,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/usage.ts":{"bytes":5156,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/index.ts":{"bytes":281,"imports":[{"path":"src/control-plane/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/control-plane/run-store.ts","kind":"import-statement","original":"./run-store.js"},{"path":"src/control-plane/event-store.ts","kind":"import-statement","original":"./event-store.js"},{"path":"src/control-plane/controller.ts","kind":"import-statement","original":"./controller.js"},{"path":"src/control-plane/daemon.ts","kind":"import-statement","original":"./daemon.js"},{"path":"src/control-plane/workflow.ts","kind":"import-statement","original":"./workflow.js"},{"path":"src/control-plane/monitor.ts","kind":"import-statement","original":"./monitor.js"},{"path":"src/control-plane/usage.ts","kind":"import-statement","original":"./usage.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"}],"format":"esm"}},"outputs":{"dist/control-plane/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/control-plane/index.ts","inputs":{"src/control-plane/index.ts":{"bytesInOutput":483},"src/control-plane/run-store.ts":{"bytesInOutput":5446},"src/version.ts":{"bytesInOutput":15},"src/control-plane/lock.ts":{"bytesInOutput":1063},"src/control-plane/event-store.ts":{"bytesInOutput":1057},"src/utils/platform.ts":{"bytesInOutput":240},"src/control-plane/controller.ts":{"bytesInOutput":1689},"src/control-plane/daemon.ts":{"bytesInOutput":1935},"src/control-plane/workflow.ts":{"bytesInOutput":4800},"src/control-plane/monitor.ts":{"bytesInOutput":1817},"src/control-plane/usage.ts":{"bytesInOutput":2183}},"bytes":21508}}}
1
+ {"inputs":{"src/control-plane/types.ts":{"bytes":2465,"imports":[],"format":"esm"},"src/version.ts":{"bytes":37,"imports":[],"format":"esm"},"src/control-plane/lock.ts":{"bytes":2496,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/event-store.ts":{"bytes":2302,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"}],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/run-store.ts":{"bytes":11578,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/version.ts","kind":"import-statement","original":"../version.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"},{"path":"src/control-plane/event-store.ts","kind":"import-statement","original":"./event-store.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/controller.ts":{"bytes":4113,"imports":[{"path":"src/control-plane/run-store.ts","kind":"import-statement","original":"./run-store.js"}],"format":"esm"},"src/control-plane/daemon.ts":{"bytes":4922,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/workflow.ts":{"bytes":10111,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/monitor.ts":{"bytes":4008,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/control-plane/usage.ts":{"bytes":5009,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/utils/platform.ts","kind":"import-statement","original":"../utils/platform.js"}],"format":"esm"},"src/control-plane/index.ts":{"bytes":272,"imports":[{"path":"src/control-plane/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/control-plane/run-store.ts","kind":"import-statement","original":"./run-store.js"},{"path":"src/control-plane/event-store.ts","kind":"import-statement","original":"./event-store.js"},{"path":"src/control-plane/controller.ts","kind":"import-statement","original":"./controller.js"},{"path":"src/control-plane/daemon.ts","kind":"import-statement","original":"./daemon.js"},{"path":"src/control-plane/workflow.ts","kind":"import-statement","original":"./workflow.js"},{"path":"src/control-plane/monitor.ts","kind":"import-statement","original":"./monitor.js"},{"path":"src/control-plane/usage.ts","kind":"import-statement","original":"./usage.js"},{"path":"src/control-plane/lock.ts","kind":"import-statement","original":"./lock.js"}],"format":"esm"}},"outputs":{"dist/control-plane/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/control-plane/index.ts","inputs":{"src/control-plane/index.ts":{"bytesInOutput":483},"src/control-plane/run-store.ts":{"bytesInOutput":5446},"src/version.ts":{"bytesInOutput":15},"src/control-plane/lock.ts":{"bytesInOutput":1063},"src/control-plane/event-store.ts":{"bytesInOutput":1057},"src/utils/platform.ts":{"bytesInOutput":240},"src/control-plane/controller.ts":{"bytesInOutput":1689},"src/control-plane/daemon.ts":{"bytesInOutput":1935},"src/control-plane/workflow.ts":{"bytesInOutput":4800},"src/control-plane/monitor.ts":{"bytesInOutput":1817},"src/control-plane/usage.ts":{"bytesInOutput":2183}},"bytes":21508}}}