@xenosystem/agent-sdk 0.8.13 → 0.9.8
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.
- package/LICENSE +15 -15
- package/README.md +511 -511
- package/dist/agents/metafile-cjs.json +1 -1
- package/dist/agents/metafile-esm.json +1 -1
- package/dist/artifacts/index.cjs +1 -1
- package/dist/artifacts/index.js +1 -1
- package/dist/artifacts/metafile-cjs.json +1 -1
- package/dist/artifacts/metafile-esm.json +1 -1
- package/dist/automation/metafile-cjs.json +1 -1
- package/dist/automation/metafile-esm.json +1 -1
- package/dist/control-plane/index.cjs +1 -1
- package/dist/control-plane/index.js +1 -1
- package/dist/control-plane/metafile-cjs.json +1 -1
- package/dist/control-plane/metafile-esm.json +1 -1
- package/dist/control-room/metafile-cjs.json +1 -1
- package/dist/control-room/metafile-esm.json +1 -1
- package/dist/electron/index.cjs +140 -138
- package/dist/electron/index.js +139 -137
- package/dist/electron/metafile-cjs.json +1 -1
- package/dist/electron/metafile-esm.json +1 -1
- package/dist/governance/metafile-cjs.json +1 -1
- package/dist/governance/metafile-esm.json +1 -1
- package/dist/hooks/metafile-cjs.json +1 -1
- package/dist/hooks/metafile-esm.json +1 -1
- package/dist/hosted/metafile-cjs.json +1 -1
- package/dist/hosted/metafile-esm.json +1 -1
- package/dist/index.cjs +322 -320
- package/dist/index.d.cts +14 -2
- package/dist/index.d.ts +14 -2
- package/dist/index.js +322 -320
- package/dist/intelligence/metafile-cjs.json +1 -1
- package/dist/intelligence/metafile-esm.json +1 -1
- package/dist/mcp/metafile-cjs.json +1 -1
- package/dist/mcp/metafile-esm.json +1 -1
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/oracle/metafile-cjs.json +1 -1
- package/dist/oracle/metafile-esm.json +1 -1
- package/dist/providers/metafile-cjs.json +1 -1
- package/dist/providers/metafile-esm.json +1 -1
- package/dist/recipes/metafile-cjs.json +1 -1
- package/dist/recipes/metafile-esm.json +1 -1
- package/dist/research/metafile-cjs.json +1 -1
- package/dist/research/metafile-esm.json +1 -1
- package/dist/session/index.cjs +1 -1
- package/dist/session/index.js +1 -1
- package/dist/session/metafile-cjs.json +1 -1
- package/dist/session/metafile-esm.json +1 -1
- package/dist/sharing/metafile-cjs.json +1 -1
- package/dist/sharing/metafile-esm.json +1 -1
- package/dist/skills/metafile-cjs.json +1 -1
- package/dist/skills/metafile-esm.json +1 -1
- package/dist/soul/metafile-cjs.json +1 -1
- package/dist/soul/metafile-esm.json +1 -1
- package/dist/terminal/metafile-cjs.json +1 -1
- package/dist/terminal/metafile-esm.json +1 -1
- package/dist/ui/metafile-cjs.json +1 -1
- package/dist/ui/metafile-esm.json +1 -1
- package/dist/utils/metafile-cjs.json +1 -1
- package/dist/utils/metafile-esm.json +1 -1
- package/native/mxc/LICENSE.microsoft-mxc-sdk.md +20 -20
- package/native/mxc/README.md +25 -25
- package/native/mxc/bin/arm64/lxc-exec +0 -0
- package/native/mxc/bin/arm64/mxc-exec-mac +0 -0
- package/native/mxc/bin/x64/lxc-exec +0 -0
- package/native/mxc/package.json +58 -58
- package/ownership/CLEAN_ROOM_CONTRIBUTOR_GUIDE.md +63 -63
- package/ownership/audit.mjs +727 -727
- package/ownership/evidence/PROPRIETARY-COMMAND-1/implementation-record.md +77 -77
- package/ownership/evidence/PROPRIETARY-COMMAND-1/provenance-review.md +51 -51
- package/ownership/evidence/PROPRIETARY-MEDIA-1/implementation-record.md +131 -131
- package/ownership/evidence/PROPRIETARY-MEDIA-1/provenance-review.md +50 -50
- package/ownership/evidence/PROPRIETARY-PTY-1/implementation-record.md +86 -86
- package/ownership/evidence/PROPRIETARY-PTY-1/provenance-review.md +52 -52
- package/ownership/evidence/PROPRIETARY-RUNTIME-1/implementation-record.md +68 -68
- package/ownership/evidence/PROPRIETARY-RUNTIME-1/provenance-review.md +32 -32
- package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/implementation-record.md +53 -53
- package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/provenance-review.md +32 -32
- package/ownership/evidence/PROPRIETARY-UI-1/implementation-record.md +96 -96
- package/ownership/evidence/PROPRIETARY-UI-1/provenance-review.md +46 -46
- package/ownership/ownership-policy.json +1 -1
- package/ownership/ownership-policy.schema.json +192 -192
- package/ownership/templates/clean-room-implementation-record.md +70 -70
- package/ownership/templates/provenance-review.md +51 -51
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/utils/yaml.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/agents/definitions.ts":{"bytes":20613,"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/utils/yaml.ts","kind":"import-statement","original":"../utils/yaml.js"}],"format":"esm"},"src/agents/profiles.ts":{"bytes":32456,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"}],"format":"esm"},"src/agents/index.ts":{"bytes":65,"imports":[{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"},{"path":"src/agents/profiles.ts","kind":"import-statement","original":"./profiles.js"}],"format":"esm"}},"outputs":{"dist/agents/index.cjs":{"imports":[{"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}],"exports":[],"entryPoint":"src/agents/index.ts","inputs":{"src/agents/index.ts":{"bytesInOutput":784},"src/agents/definitions.ts":{"bytesInOutput":8917},"src/utils/yaml.ts":{"bytesInOutput":2217},"src/agents/profiles.ts":{"bytesInOutput":15500}},"bytes":28467}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/utils/yaml.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/agents/definitions.ts":{"bytes":20613,"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/utils/yaml.ts","kind":"import-statement","original":"../utils/yaml.js"}],"format":"esm"},"src/agents/profiles.ts":{"bytes":32456,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"}],"format":"esm"},"src/agents/index.ts":{"bytes":65,"imports":[{"path":"src/agents/definitions.ts","kind":"import-statement","original":"./definitions.js"},{"path":"src/agents/profiles.ts","kind":"import-statement","original":"./profiles.js"}],"format":"esm"}},"outputs":{"dist/agents/index.js":{"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":"node:crypto","kind":"import-statement","external":true}],"exports":["AgentDefinitionLoader","AgentDefinitionResolver","AgentProfileValidationError","XENO_AGENT_PROFILE_SCHEMA_VERSION","agentDefinitionFromProfile","agentProfileFromDefinition","compileAgentProfile","createAgentDefinitionFile","createAgentDefinitionPromptSection","getProjectAgentDefinitionDirs","getProjectAgentDefinitionsDir","getUserAgentDefinitionsDir","isValidAgentDefinitionName","listBuiltInAgentProfiles","renderAgentDefinition","renderAgentDefinitions","resolveAgentDefinition","resolveAgentProfile","resolveAgentToolPolicy","resolveBuiltInAgentProfile","scanAgentDefinitions","toAgentDefinitionMetadata","validateAgentDefinition"],"entryPoint":"src/agents/index.ts","inputs":{"src/agents/definitions.ts":{"bytesInOutput":8875},"src/utils/yaml.ts":{"bytesInOutput":2217},"src/agents/index.ts":{"bytesInOutput":0},"src/agents/profiles.ts":{"bytesInOutput":15489}},"bytes":27311}}}
|
package/dist/artifacts/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";var _e=Object.defineProperty;var Gt=Object.getOwnPropertyDescriptor;var Kt=Object.getOwnPropertyNames;var Yt=Object.prototype.hasOwnProperty;var Zt=(e,t)=>{for(var i in t)_e(e,i,{get:t[i],enumerable:!0})},Qt=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Kt(t))!Yt.call(e,o)&&o!==i&&_e(e,o,{get:()=>t[o],enumerable:!(n=Gt(t,o))||n.enumerable});return e};var ei=e=>Qt(_e({},"__esModule",{value:!0}),e);var In={};Zt(In,{FileXenoArtifactRepository:()=>Pe,InMemoryXenoArtifactRepository:()=>J,XENO_ARTIFACT_FILE_REPOSITORY_SCHEMA_VERSION:()=>Le,XENO_ARTIFACT_SCHEMA_VERSION:()=>h,XENO_EVIDENCE_GRAPH_SCHEMA_VERSION:()=>pe,XENO_REVIEW_REPORT_SCHEMA_VERSION:()=>Ye,XENO_SPEC_EXECUTION_SCHEMA_VERSION:()=>oe,XENO_SPEC_SCHEMA_VERSION:()=>z,XenoArtifactRepositoryError:()=>u,XenoArtifactReviewService:()=>B,XenoArtifactStateTransitionError:()=>ue,XenoArtifactValidationError:()=>L,XenoDiffParseError:()=>E,XenoEvidenceGraphBuilder:()=>Ce,XenoEvidenceGraphValidationError:()=>he,XenoMultiAgentReviewCoordinator:()=>Ke,XenoReviewValidationError:()=>R,XenoSpecLifecycleService:()=>Be,XenoSpecValidationError:()=>w,assertValidXenoArtifact:()=>I,assertValidXenoEvidenceGraph:()=>q,assertValidXenoReviewPack:()=>Ze,assertValidXenoReviewReport:()=>ae,assertValidXenoReviewTarget:()=>Qe,assertValidXenoSpecDocument:()=>Xe,assertValidXenoSpecExecution:()=>Ge,assertXenoArtifactStateTransition:()=>ee,buildXenoArtifactReviewAnchor:()=>Je,canTransitionXenoArtifactState:()=>pt,canonicalizeArtifactJson:()=>b,defaultXenoReviewPack:()=>Yi,detectXenoSpecDrift:()=>Bi,legacyAgentArtifactToXenoArtifact:()=>fn,normalizeRepositoryRelativePath:()=>Tt,parseUnifiedDiff:()=>He,sha256ArtifactBytes:()=>k,sha256ArtifactJson:()=>x,summarizeXenoArtifactReview:()=>me,toolEvidenceToXenoArtifact:()=>un,turnDiffSummaryToXenoArtifact:()=>mn,unifiedDiffToXenoArtifact:()=>je,validateXenoArtifact:()=>ft,validateXenoArtifactReviewEvent:()=>le,validateXenoEvidenceGraph:()=>lt,validateXenoSpecDocument:()=>Nt,xenoArtifactToDiffDocument:()=>qe,xenoArtifactToLegacyAgentArtifact:()=>pn,xenoArtifactToReviewReport:()=>Qi,xenoArtifactToSpecDocument:()=>ze,xenoArtifactToSpecExecution:()=>$t,xenoArtifactToToolEvidence:()=>ln,xenoArtifactToTurnDiffSummary:()=>vn,xenoReviewReportToArtifact:()=>Zi,xenoReviewReportToGitHubComments:()=>en,xenoSpecArtifactIds:()=>U,xenoSpecExecutionToArtifact:()=>We,xenoSpecToArtifactBundle:()=>Ue});module.exports=ei(In);var h=1,pe=1;var xe=require("node:buffer");var at=require("node:crypto");function k(e){return{algorithm:"sha256",value:(0,at.createHash)("sha256").update(e).digest("hex")}}function b(e){return JSON.stringify(ke(e,new Set))}function x(e){return k(b(e))}function ke(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 n=e.map(o=>ke(o,t));return t.delete(e),n}let i={};for(let n of Object.keys(e).sort((o,r)=>o.localeCompare(r))){let o=e[n];if(o===void 0)throw new TypeError(`Artifact JSON property ${n} is undefined`);i[n]=ke(o,t)}return t.delete(e),i}var L=class extends Error{code="ARTIFACT_INVALID";issues;constructor(t,i){super(t),this.name="XenoArtifactValidationError",this.issues=i.map(n=>({...n}))}},ue=class extends Error{constructor(i,n){super(`Artifact state cannot transition from ${i} to ${n}`);this.fromState=i;this.toState=n;this.name="XenoArtifactStateTransitionError"}fromState;toState;code="ARTIFACT_STATE_TRANSITION_INVALID"},ti={draft:["pending_review","superseded","archived"],pending_review:["approved","rejected","superseded","archived"],approved:["superseded","archived"],rejected:["superseded","archived"],superseded:["archived"],archived:[]},ii=/^[a-z0-9][a-z0-9._/-]{0,127}$/,ni="[\\u0000-\\u001f\\u007f]",ri=new RegExp(ni),ct=/^[a-f0-9]{64}$/,oi=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,si=new Set(["draft","pending_review","approved","rejected","superseded","archived"]),ai=new Set(["public","internal","confidential","restricted"]),ci=new Set(["agent","tool","user","system","integration"]),di=new Set(["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"]),fi=new Set(["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"]),pi=new Set(["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"]);function p(e,t,i,n){e.push({path:t,code:i,message:n})}function l(e,t,i,n=1024){return typeof e!="string"||e.trim().length===0?(p(i,t,"required_string","Value must be a non-empty string"),!1):(e.length>n&&p(i,t,"string_too_long",`Value must not exceed ${n} characters`),ri.test(e)&&p(i,t,"control_character","Value must not contain control characters"),!0)}function Z(e,t,i){e!==void 0&&(!Number.isFinite(Date.parse(e))||!e.includes("T"))&&p(i,t,"invalid_timestamp","Value must be an ISO 8601 timestamp")}function F(e,t,i,n){if(typeof e!="string"||!e.startsWith(t))return;let o=e.slice(t.length);ii.test(o)||p(n,i,"invalid_custom_name",`Custom name after ${t} is invalid`)}function dt(e,t,i){if(!e||typeof e!="object"){p(i,t,"missing_actor","Actor is required");return}l(e.kind,`${t}.kind`,i,64),ci.has(e.kind)||p(i,`${t}.kind`,"unknown_actor_kind","Actor kind is not supported"),l(e.id,`${t}.id`,i,512),e?.displayName!==void 0&&l(e.displayName,`${t}.displayName`,i,512),e?.profileFingerprint!==void 0&&!/^[a-f0-9]{64}$/.test(e.profileFingerprint)&&p(i,`${t}.profileFingerprint`,"invalid_fingerprint","Profile fingerprint must be 64 lowercase hexadecimal characters")}function Te(e,t,i){if(!e||typeof e!="object"){p(i,t,"invalid_anchor","Anchor must be an object");return}switch(e.kind){case"file":l(e.path,`${t}.path`,i,4096);break;case"source-line":l(e.path,`${t}.path`,i,4096),(!Number.isInteger(e.startLine)||e.startLine<1)&&p(i,`${t}.startLine`,"invalid_line","startLine must be a positive integer"),e.endLine!==void 0&&(!Number.isInteger(e.endLine)||e.endLine<e.startLine)&&p(i,`${t}.endLine`,"invalid_line_range","endLine must be greater than or equal to startLine");break;case"diff-hunk":l(e.path,`${t}.path`,i,4096),l(e.hunkId,`${t}.hunkId`,i,512);break;case"symbol":l(e.path,`${t}.path`,i,4096),l(e.symbol,`${t}.symbol`,i,1024);break;case"dom-node":l(e.pageId,`${t}.pageId`,i,512),!e.selector&&!e.accessibilityId&&!e.snapshotArtifactId&&p(i,t,"missing_dom_locator","DOM anchors require a selector, accessibility ID, or snapshot artifact ID");break;case"timeline":l(e.recordingArtifactId,`${t}.recordingArtifactId`,i,512),(!Number.isFinite(e.startMs)||e.startMs<0)&&p(i,`${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(i,`${t}.endMs`,"invalid_time_range","endMs must be greater than or equal to startMs");break;case"region":l(e.mediaArtifactId,`${t}.mediaArtifactId`,i,512),[e.x,e.y,e.width,e.height].every(Number.isFinite)?(e.width<=0||e.height<=0)&&p(i,t,"invalid_region_size","Region width and height must be positive"):p(i,t,"invalid_region","Region coordinates must be finite numbers");break;case"artifact":l(e.artifactId,`${t}.artifactId`,i,512);break;default:typeof e.kind!="string"||!e.kind.startsWith("custom:")?p(i,`${t}.kind`,"unknown_anchor","Anchor kind is not supported"):F(e.kind,"custom:",`${t}.kind`,i)}}function Q(e,t,i,n){if(!(e===null||typeof e=="string"||typeof e=="boolean")){if(typeof e=="number"){Number.isFinite(e)||p(i,t,"non_finite_number","JSON numbers must be finite");return}if(typeof e!="object"){p(i,t,"non_json_value","Value must be JSON-serializable");return}if(n.has(e)){p(i,t,"cyclic_value","Value must not contain cycles");return}if(n.add(e),Array.isArray(e))e.forEach((o,r)=>Q(o,`${t}[${r}]`,i,n));else for(let[o,r]of Object.entries(e))r===void 0?p(i,`${t}.${o}`,"undefined_value","Undefined is not valid JSON"):Q(r,`${t}.${o}`,i,n);n.delete(e)}}function ft(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"&&!di.has(e.kind)&&!e.kind.startsWith("custom:")&&p(t,"kind","unknown_artifact_kind","Artifact kind is not supported"),F(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),si.has(e.state)||p(t,"state","unknown_state","Artifact state is not supported"),l(e.createdAt,"createdAt",t,128),Z(e.createdAt,"createdAt",t),Z(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),ai.has(e.sensitivity)||p(t,"sensitivity","unknown_sensitivity","Sensitivity is not supported"),e.identity)for(let[n,o]of Object.entries(e.identity))o!==void 0&&l(o,`identity.${n}`,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),F(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"&&!ct.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 n=e.content.storage;if(!n||typeof n!="object")p(t,"content.storage","missing_storage","storage reference is required");else if(n.type==="inline")if(n.text===void 0==(n.base64===void 0))p(t,"content.storage","invalid_inline_storage","Inline storage requires exactly one of text or base64");else{let o;n.text!==void 0?o=xe.Buffer.from(n.text,"utf8"):n.base64!==void 0&&(oi.test(n.base64)?o=xe.Buffer.from(n.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"&&k(o).value!==e.content.hash.value&&p(t,"content.hash.value","content_hash_mismatch","Hash does not match inline content")}else n.type==="file"?l(n.path,"content.storage.path",t,4096):n.type==="blob"?l(n.uri,"content.storage.uri",t,8192):n.type==="git"?(l(n.commit,"content.storage.commit",t,512),l(n.path,"content.storage.path",t,4096)):n.type==="url"?(l(n.url,"content.storage.url",t,8192),Z(n.expiresAt,"content.storage.expiresAt",t)):n.type==="external"?(l(n.provider,"content.storage.provider",t,255),l(n.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"),F(e.content.encoding,"custom:","content.encoding",t)}!e.provenance||typeof e.provenance!="object"?p(t,"provenance","missing_provenance","provenance is required"):(dt(e.provenance.producer,"provenance.producer",t),e.provenance.capabilityLeaseIds?.forEach((n,o)=>l(n,`provenance.capabilityLeaseIds[${o}]`,t,512)),e.provenance.sourceArtifactIds?.forEach((n,o)=>l(n,`provenance.sourceArtifactIds[${o}]`,t,512)),e.provenance.attributes&&Q(e.provenance.attributes,"provenance.attributes",t,new Set));let i=new Set;return e.relationships?.forEach((n,o)=>{let r=`relationships[${o}]`;l(n.relation,`${r}.relation`,t,160),typeof n.relation=="string"&&!pi.has(n.relation)&&!n.relation.startsWith("custom:")&&p(t,`${r}.relation`,"unknown_relationship","Relationship type is not supported"),F(n.relation,"custom:",`${r}.relation`,t),l(n.target?.type,`${r}.target.type`,t,160),typeof n.target?.type=="string"&&!fi.has(n.target.type)&&!n.target.type.startsWith("custom:")&&p(t,`${r}.target.type`,"unknown_reference_type","Evidence reference type is not supported"),F(n.target?.type,"custom:",`${r}.target.type`,t),l(n.target?.id,`${r}.target.id`,t,512);let a=`${n.relation}:${n.target?.type}:${n.target?.id}:${n.target?.revision??""}`;i.has(a)&&p(t,r,"duplicate_relationship","Duplicate relationship"),i.add(a),n.attributes&&Q(n.attributes,`${r}.attributes`,t,new Set)}),e.anchors?.forEach((n,o)=>Te(n,`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"),Z(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&&Q(e.extensions,"extensions",t,new Set),t}function I(e){let t=ft(e);if(t.length>0)throw new L("XENO artifact validation failed",t)}function pt(e,t){return ti[e].includes(t)}function ee(e,t){if(!pt(e,t))throw new ue(e,t)}function le(e,t){let i=[];return e.schemaVersion!==1&&p(i,"schemaVersion","unsupported_schema",`schemaVersion must be ${1}`),l(e.eventId,"eventId",i,512),l(e.artifactId,"artifactId",i,512),(!Number.isInteger(e.artifactRevision)||e.artifactRevision<1)&&p(i,"artifactRevision","invalid_revision","artifactRevision must be a positive integer"),(!Number.isInteger(e.sequence)||e.sequence<1)&&p(i,"sequence","invalid_sequence","sequence must be a positive integer"),l(e.recordedAt,"recordedAt",i,128),Z(e.recordedAt,"recordedAt",i),dt(e.actor,"actor",i),!e.artifactHash||typeof e.artifactHash!="object"?p(i,"artifactHash","missing_hash","Artifact hash is required"):(l(e.artifactHash.algorithm,"artifactHash.algorithm",i,128),F(e.artifactHash.algorithm,"custom:","artifactHash.algorithm",i),l(e.artifactHash.value,"artifactHash.value",i,512),e.artifactHash.algorithm==="sha256"&&!ct.test(e.artifactHash.value)&&p(i,"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(i,"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(i,"type","unknown_review_event","Review event type is not supported"),e.type==="comment-added"?(l(e.commentId,"commentId",i,512),l(e.body,"body",i,65536),e.anchor&&Te(e.anchor,"anchor",i)):e.type==="comment-resolved"||e.type==="comment-reopened"?l(e.commentId,"commentId",i,512):e.type==="decision-recorded"&&(["approved","rejected","changes_requested"].includes(e.decision)||p(i,"decision","unknown_review_decision","Review decision is not supported"),e.scope&&Te(e.scope,"scope",i)),t&&(e.artifactId!==t.artifactId&&p(i,"artifactId","artifact_mismatch","Review event targets a different artifact"),e.artifactRevision!==t.revision&&p(i,"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(i,"artifactHash","hash_mismatch","Review event hash does not match the artifact revision")),i}function me(e){let t="not_requested",i,n,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:(i=s.decision,n=s.eventId,t=s.decision));return{status:t,totalComments:a.size,unresolvedComments:[...a].filter(s=>!c.has(s)).length,...i?{latestDecision:i}:{},...n?{latestDecisionEventId:n}:{},...r>0?{scopedDecisionCount:r}:{},...o?{lastReviewedAt:o}:{}}}var he=class extends Error{code="EVIDENCE_GRAPH_INVALID";issues;constructor(t){super("XENO evidence graph validation failed"),this.name="XenoEvidenceGraphValidationError",this.issues=t.map(i=>({...i}))}},ui=new Set(["depends_on","decomposes","supersedes"]),li=/^[a-z0-9][a-z0-9._/-]{0,127}$/,mi=new Set(["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"]),vi=new Set(["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"]);function y(e,t,i,n){e.push({path:t,code:i,message:n})}function te(e){return e.includes("T")&&Number.isFinite(Date.parse(e))}function ut(e,t){return e.startsWith("custom:")?li.test(e.slice(7)):t.has(e)}function lt(e){let t=[];if(!e||typeof e!="object")return[{path:"$",code:"invalid_graph",message:"Evidence graph must be an object"}];e.schemaVersion!==1&&y(t,"schemaVersion","unsupported_schema",`schemaVersion must be ${1}`),(typeof e.graphId!="string"||e.graphId.trim().length===0)&&y(t,"graphId","required_string","graphId must be a non-empty string"),(!Number.isInteger(e.version)||e.version<1)&&y(t,"version","invalid_version","version must be a positive integer"),te(e.createdAt)||y(t,"createdAt","invalid_timestamp","createdAt must be an ISO 8601 timestamp"),te(e.updatedAt)||y(t,"updatedAt","invalid_timestamp","updatedAt must be an ISO 8601 timestamp"),te(e.createdAt)&&te(e.updatedAt)&&Date.parse(e.updatedAt)<Date.parse(e.createdAt)&&y(t,"updatedAt","timestamp_order","updatedAt must not precede createdAt");let i=new Map;Array.isArray(e.nodes)||y(t,"nodes","invalid_nodes","nodes must be an array"),(Array.isArray(e.nodes)?e.nodes:[]).forEach((f,g)=>{let X=`nodes[${g}]`;typeof f.id!="string"||f.id.trim().length===0?y(t,`${X}.id`,"required_string","Node ID must be a non-empty string"):i.has(f.id)?y(t,`${X}.id`,"duplicate_node",`Node ID ${f.id} is duplicated`):i.set(f.id,f),(typeof f.type!="string"||!ut(f.type,mi))&&y(t,`${X}.type`,"invalid_node_type","Node type is invalid"),f.artifactRevision!==void 0&&(!Number.isInteger(f.artifactRevision)||f.artifactRevision<1)&&y(t,`${X}.artifactRevision`,"invalid_revision","artifactRevision must be a positive integer")});let n=new Set,o=new Set;Array.isArray(e.edges)||y(t,"edges","invalid_edges","edges must be an array"),(Array.isArray(e.edges)?e.edges:[]).forEach((f,g)=>{let X=`edges[${g}]`;typeof f.id!="string"||f.id.trim().length===0?y(t,`${X}.id`,"required_string","Edge ID must be a non-empty string"):n.has(f.id)&&y(t,`${X}.id`,"duplicate_edge",`Edge ID ${f.id} is duplicated`),n.add(f.id),(typeof f.type!="string"||!ut(f.type,vi))&&y(t,`${X}.type`,"invalid_edge_type","Edge type is invalid");let D=`${f.type}:${f.from}:${f.to}`;o.has(D)&&y(t,X,"duplicate_edge_identity","Equivalent evidence edge is duplicated"),o.add(D),i.has(f.from)||y(t,`${X}.from`,"dangling_reference",`Source node ${f.from} does not exist`),i.has(f.to)||y(t,`${X}.to`,"dangling_reference",`Target node ${f.to} does not exist`),f.from===f.to&&y(t,X,"self_edge","Evidence edges cannot point to the same node"),te(f.createdAt)||y(t,`${X}.createdAt`,"invalid_timestamp","createdAt must be an ISO 8601 timestamp")});let r=(Array.isArray(e.edges)?e.edges:[]).filter(f=>ui.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 i.keys())if(d(f)){y(t,"edges","cyclic_graph","Dependency, decomposition, and supersession edges must be acyclic");break}return t}function q(e){let t=lt(e);if(t.length>0)throw new he(t)}var Ce=class{now;graph;constructor(t){if("schemaVersion"in t)q(t),this.now=()=>new Date().toISOString(),this.graph=ve(t);else{this.now=t.now??(()=>new Date().toISOString());let i=this.now();this.graph={schemaVersion:1,graphId:t.graphId,version:1,createdAt:i,updatedAt:i,nodes:[],edges:[]},q(this.graph)}}addNode(t){let i=ve(this.graph);return i.nodes.push(mt(t)),this.touch(i),q(i),this.graph=i,this}addEdge(t){let i=ve(this.graph);return i.edges.push(vt(t)),this.touch(i),q(i),this.graph=i,this}build(){return q(this.graph),ve(this.graph)}touch(t){t.version+=1,t.updatedAt=this.now()}};function mt(e){return{...e,...e.attributes?{attributes:structuredClone(e.attributes)}:{}}}function vt(e){return{...e,...e.producer?{producer:{...e.producer}}:{},...e.attributes?{attributes:structuredClone(e.attributes)}:{}}}function ve(e){return{...e,nodes:e.nodes.map(mt),edges:e.edges.map(vt)}}var u=class extends Error{constructor(i,n,o,r){super(n,r);this.code=i;this.detail=o;this.name="XenoArtifactRepositoryError"}code;detail},J=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??(i=>(this.idCounter+=1,`${i}_${Date.now().toString(36)}_${this.idCounter.toString(36)}`)),t.initialState&&this.hydrate(t.initialState)}exportState(){let t=[...this.records.values()].flatMap(i=>[...i.values()]).sort(ht).map(i=>({artifact:ie(i.artifact),recordVersion:i.recordVersion,lifecycleEvents:structuredClone(i.lifecycleEvents),reviewEvents:structuredClone(i.reviewEvents)}));return{schemaVersion:1,records:t}}async create(t){if(I(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 i=ie(t),n=this.createLifecycleEvent({artifact:i,sequence:1,actor:i.provenance.producer,fromState:null,toState:i.state,reason:"artifact-created"}),o={artifact:i,recordVersion:1,lifecycleEvents:[n],reviewEvents:[]};return this.records.set(i.artifactId,new Map([[i.revision,o]])),this.currentRevisions.set(i.artifactId,i.revision),M(o)}async createRevision(t,i={}){I(t),this.assertInitialState(t);let n=this.getMutable(t.artifactId);this.assertVersion(n,i.expectedRecordVersion);let o=n.artifact.revision+1;if(t.revision!==o||t.predecessorRevision!==n.artifact.revision)throw new u("ARTIFACT_REVISION_INVALID",`Revision ${t.revision} does not follow current revision ${n.artifact.revision}`,{artifactId:t.artifactId,currentRevision:n.artifact.revision,requestedRevision:t.revision});if(gi(t,n.artifact))throw new u("ARTIFACT_CONTENT_UNCHANGED","A new artifact revision must have a different content hash",{artifactId:t.artifactId,revision:t.revision});if(n.artifact.state==="archived")throw new u("ARTIFACT_REVISION_INVALID","Archived artifacts cannot receive new revisions",{artifactId:t.artifactId,revision:n.artifact.revision});if(n.artifact.state!=="superseded"){ee(n.artifact.state,"superseded");let s=this.now(),d=this.createLifecycleEvent({artifact:n.artifact,sequence:n.lifecycleEvents.length+1,actor:i.actor??t.provenance.producer,fromState:n.artifact.state,toState:"superseded",reason:i.reason??`superseded-by-revision-${t.revision}`,recordedAt:s});n.artifact.state="superseded",n.artifact.updatedAt=s,n.lifecycleEvents.push(d),n.recordVersion+=1}let r=ie(t),a=this.createLifecycleEvent({artifact:r,sequence:1,actor:i.actor??r.provenance.producer,fromState:null,toState:r.state,reason:i.reason??`revision-created-from-${n.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),M(c)}async get(t,i){let n=this.records.get(t);if(!n)return;let o=i??this.currentRevisions.get(t);if(o===void 0)return;let r=n.get(o);return r?M(r):void 0}async require(t,i){let n=await this.get(t,i);if(!n)throw new u("ARTIFACT_NOT_FOUND",`Artifact ${t}${i===void 0?"":` revision ${i}`} was not found`,{artifactId:t,...i===void 0?{}:{revision:i}});return n}async list(t={}){let i=[];for(let[n,o]of this.records)if(!(t.artifactIds&&!t.artifactIds.includes(n)))if(t.includeSuperseded)i.push(...o.values());else{let r=this.currentRevisions.get(n);if(r!==void 0){let a=o.get(r);a&&i.push(a)}}return i.filter(n=>yi(n.artifact,t)).sort(ht).map(M)}async listRevisions(t){let i=this.records.get(t);return i?[...i.values()].sort((n,o)=>n.artifact.revision-o.artifact.revision).map(M):[]}async transition(t){let i=this.getMutable(t.artifactId,t.revision);if(this.assertVersion(i,t.expectedRecordVersion),ee(i.artifact.state,t.toState),t.toState==="approved"||t.toState==="rejected"){let a=t.reviewEventId?i.reviewEvents.find(s=>s.eventId===t.reviewEventId&&s.type==="decision-recorded"):void 0,c=me(i.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:i.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:i.artifact.revision,unresolvedComments:c.unresolvedComments})}let n=this.now(),o=i.artifact.state,r=this.createLifecycleEvent({artifact:i.artifact,sequence:i.lifecycleEvents.length+1,actor:t.actor,fromState:o,toState:t.toState,reason:t.reason,reviewEventId:t.reviewEventId,recordedAt:n});return i.artifact.state=t.toState,i.artifact.updatedAt=n,i.lifecycleEvents.push(r),i.recordVersion+=1,M(i)}async appendReviewEvent(t){let i=t.event,n=this.getMutable(i.artifactId,i.artifactRevision);if(this.assertVersion(n,t.expectedRecordVersion),n.artifact.state==="archived"||n.artifact.state==="superseded")throw new u("ARTIFACT_REVIEW_INVALID",`Cannot append review events to a ${n.artifact.state} artifact revision`,{artifactId:i.artifactId,revision:i.artifactRevision});if(this.assertReviewCommentState(n,i),(i.type==="review-requested"||i.type==="review-withdrawn"||i.type==="decision-recorded")&&n.artifact.state!=="pending_review")throw new u("ARTIFACT_REVIEW_INVALID",`${i.type} requires an artifact in pending_review state`,{artifactId:i.artifactId,revision:i.artifactRevision});let o={...structuredClone(i),schemaVersion:1,eventId:this.nextEventId("review_event"),sequence:n.reviewEvents.length+1,recordedAt:this.now()},r=le(o,n.artifact);if(r.length>0)throw new L("XENO artifact review event validation failed",r);return n.reviewEvents.push(o),n.recordVersion+=1,M(n)}getMutable(t,i){let n=this.records.get(t),o=i??this.currentRevisions.get(t),r=o===void 0?void 0:n?.get(o);if(!r)throw new u("ARTIFACT_NOT_FOUND",`Artifact ${t}${i===void 0?"":` revision ${i}`} was not found`,{artifactId:t,...i===void 0?{}:{revision:i}});return r}assertVersion(t,i){if(i!==void 0&&i!==t.recordVersion)throw new u("ARTIFACT_CONFLICT",`Expected record version ${i}, found ${t.recordVersion}`,{artifactId:t.artifact.artifactId,revision:t.artifact.revision,expectedRecordVersion:i,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,i){if(i.type==="comment-added"){if(t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===i.commentId))throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.commentId} already exists`);if(i.parentCommentId&&!t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===i.parentCommentId))throw new u("ARTIFACT_REVIEW_INVALID",`Parent comment ${i.parentCommentId} does not exist`);return}if(i.type!=="comment-resolved"&&i.type!=="comment-reopened")return;if(!t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===i.commentId))throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.commentId} does not exist`);let o=Ai(t.reviewEvents,i.commentId);if(i.type==="comment-resolved"&&o.resolved)throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.commentId} is already resolved`);if(i.type==="comment-reopened"&&!o.resolved)throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.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 i=this.idFactory(t);if(typeof i!="string"||i.trim().length===0||this.eventIds.has(i))throw new u("ARTIFACT_CONFLICT",`Event ID factory produced an invalid or duplicate ${t} ID`);return this.eventIds.add(i),i}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 i=[...t.records].sort((n,o)=>n.artifact.artifactId.localeCompare(o.artifact.artifactId)||n.artifact.revision-o.artifact.revision);for(let n of i){let o=hi(n,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[n,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 ${n} is missing revision ${s}`);if(a===0&&c.artifact.predecessorRevision!==void 0)throw new u("ARTIFACT_REVISION_INVALID",`Initial revision for ${n} cannot declare a predecessor`);if(a>0&&c.artifact.predecessorRevision!==s-1)throw new u("ARTIFACT_REVISION_INVALID",`Persisted revision ${n}:${s} has an invalid predecessor`);if(a<r.length-1&&c.artifact.state!=="superseded")throw new u("ARTIFACT_REVISION_INVALID",`Non-current revision ${n}:${s} must be superseded`)}}}};function hi(e,t){if(I(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 i=e.lifecycleEvents.length+e.reviewEvents.length;if(e.recordVersion!==i)throw new u("ARTIFACT_REVISION_INVALID",`Persisted record version ${e.recordVersion} does not match ${i} mutations`,{artifactId:e.artifact.artifactId,revision:e.artifact.revision});let n=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!==n||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(n===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 ee(n,a.toState);t.add(a.eventId),n=a.toState}if(n!==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=le(a,e.artifact);if(c.length>0)throw new L("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:ie(e.artifact),recordVersion:e.recordVersion,lifecycleEvents:structuredClone(e.lifecycleEvents),reviewEvents:structuredClone(e.reviewEvents)}}function gi(e,t){return e.content.hash.algorithm===t.content.hash.algorithm&&e.content.hash.value===t.content.hash.value}function yi(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 ht(e,t){return e.artifact.createdAt.localeCompare(t.artifact.createdAt)||e.artifact.artifactId.localeCompare(t.artifact.artifactId)||e.artifact.revision-t.artifact.revision}function Ai(e,t){let i=!1;for(let n of e)(n.type==="comment-resolved"||n.type==="comment-reopened")&&n.commentId===t&&(i=n.type==="comment-resolved");return{resolved:i}}function ie(e){return structuredClone(e)}function M(e){return{artifact:ie(e.artifact),recordVersion:e.recordVersion,etag:`${e.artifact.artifactId}:${e.artifact.revision}:${e.recordVersion}`,lifecycleEvents:structuredClone(e.lifecycleEvents),reviewEvents:structuredClone(e.reviewEvents),reviewSummary:me(e.reviewEvents)}}var Fe=require("node:crypto"),S=require("node:fs/promises"),N=require("node:path");var $=require("node:fs"),Ne=require("node:os"),yt=require("node:path");function Ii(){return new Date().toISOString()}function wi(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function At(e){try{return JSON.parse((0,$.readFileSync)(e,"utf8"))}catch{return null}}function Ri(e){if(!e||e<=0)return!1;try{return process.kill(e,0),!0}catch{return!1}}function Xi(e){return e.hostname!==(0,Ne.hostname)()?!0:Ri(e.pid)}function gt(e,t){(0,$.mkdirSync)((0,yt.dirname)(e),{recursive:!0}),(0,$.writeFileSync)(e,JSON.stringify(t,null,2)+`
|
|
2
|
-
`,{encoding:"utf8",flag:"wx"})}function Ei(e,t){let i=At(e);i?.pid!==t.pid||i.hostname!==t.hostname||(0,$.rmSync)(e,{force:!0})}function It(e,t,i){let n=Ii(),o={schemaVersion:1,name:t,pid:process.pid,hostname:(0,Ne.hostname)(),processStartedAt:wi(),version:i,acquiredAt:n,updatedAt:n};try{gt(e,o)}catch(r){if(r.code!=="EEXIST")throw r;let c=At(e);if(c&&Xi(c))throw new Error(`${t} is already locked by PID ${c.pid} on ${c.hostname}.`);(0,$.rmSync)(e,{force:!0}),gt(e,o)}return{record:o,release:()=>{Ei(e,o)}}}var wt="0.8
|
|
2
|
+
`,{encoding:"utf8",flag:"wx"})}function Ei(e,t){let i=At(e);i?.pid!==t.pid||i.hostname!==t.hostname||(0,$.rmSync)(e,{force:!0})}function It(e,t,i){let n=Ii(),o={schemaVersion:1,name:t,pid:process.pid,hostname:(0,Ne.hostname)(),processStartedAt:wi(),version:i,acquiredAt:n,updatedAt:n};try{gt(e,o)}catch(r){if(r.code!=="EEXIST")throw r;let c=At(e);if(c&&Xi(c))throw new Error(`${t} is already locked by PID ${c.pid} on ${c.hostname}.`);(0,$.rmSync)(e,{force:!0}),gt(e,o)}return{record:o,release:()=>{Ei(e,o)}}}var wt="0.9.8";var Le=1,bi="repository.v1.json",Si=5e3,_i=20,ki=64*1024*1024,Pe=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 i=t.snapshotFileName??bi;if((0,N.basename)(i)!==i||!/^[A-Za-z0-9_.-]+$/.test(i))throw new TypeError("Artifact snapshot filename must be a safe basename");this.directory=(0,N.resolve)(t.directory),this.snapshotPath=(0,N.join)(this.directory,i),this.backupPath=`${this.snapshotPath}.bak`,this.lockPath=`${this.snapshotPath}.lock`,this.now=t.now??(()=>new Date().toISOString()),this.lockTimeoutMs=$e(t.lockTimeoutMs,Si,100,6e4,"lockTimeoutMs"),this.lockRetryMs=$e(t.lockRetryMs,_i,1,1e3,"lockRetryMs"),this.maxSnapshotBytes=$e(t.maxSnapshotBytes,ki,1024,1024*1024*1024,"maxSnapshotBytes"),this.onRecovery=t.onRecovery}async create(t){return this.mutate(i=>i.create(t))}async createRevision(t,i){return this.mutate(n=>n.createRevision(t,i))}async get(t,i){return(await this.load()).repository.get(t,i)}async require(t,i){return(await this.load()).repository.require(t,i)}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(i=>i.transition(t))}async appendReviewEvent(t){return this.mutate(i=>i.appendReviewEvent(t))}async inspectSnapshot(){return this.readSnapshot(this.snapshotPath,!0)}async mutate(t){return this.enqueueMutation(async()=>{let i=await this.acquireLock();try{let n=await this.load(),o=await t(n.repository);return await this.persist(n),o}finally{i.release()}})}async enqueueMutation(t){let i=this.mutationTail.then(t,t);return this.mutationTail=i.then(()=>{},()=>{}),i}async acquireLock(){let t=Date.now(),i;for(;Date.now()-t<=this.lockTimeoutMs;)try{return It(this.lockPath,`artifact-repository:${(0,N.basename)(this.snapshotPath)}`,wt)}catch(n){if(!(n instanceof Error)||!/already locked by PID/.test(n.message))throw n;i=n,await $i(this.lockRetryMs)}throw new u("ARTIFACT_PERSISTENCE_LOCKED",`Artifact repository remained locked for ${this.lockTimeoutMs}ms`,{snapshotPath:this.snapshotPath},{cause:i})}async load(){let t,i,n=!1;try{i=await this.readSnapshot(this.snapshotPath,!1)}catch(r){t=ge(r)}if(!i&&(t||await Ni(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"}),i=r,n=!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,ge(r)])}):r}if(!i&&t)throw t;let o=i?.state??{schemaVersion:1,records:[]};return{repository:new J({now:this.now,idFactory:r=>`${r}_${(0,Fe.randomUUID)()}`,initialState:o}),generation:i?.generation??0,createdAt:i?.createdAt??this.now(),hasSnapshot:i!==void 0,recoveredFromBackup:n,...i?{sourceSnapshot:i}:{}}}async persist(t){let i=this.now(),o={...{schemaVersion:Le,generation:t.generation,createdAt:t.createdAt,updatedAt:i,state:t.repository.exportState()},generation:t.generation+1},r=Ti(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(0,S.mkdir)(this.directory,{recursive:!0,mode:448}),t.hasSnapshot&&!t.recoveredFromBackup&&t.sourceSnapshot&&await Rt(this.backupPath,`${JSON.stringify(t.sourceSnapshot,null,2)}
|
|
4
4
|
`),await Rt(this.snapshotPath,a)}async readSnapshot(t,i){let n;try{n=await(0,S.stat)(t)}catch(o){if(!i&&De(o,"ENOENT")||i&&De(o,"ENOENT"))return;throw Oe("Unable to inspect artifact repository snapshot",t,o)}if(!n.isFile()||n.size>this.maxSnapshotBytes)throw new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository snapshot is not a bounded regular file",{snapshotPath:t,sizeBytes:n.size,maxSnapshotBytes:this.maxSnapshotBytes});try{let o=await(0,S.readFile)(t);if(o.byteLength>this.maxSnapshotBytes)throw new Error("snapshot grew beyond the configured size limit while reading");return xi(JSON.parse(o.toString("utf8")),t)}catch(o){throw o instanceof u?o:Oe("Unable to parse artifact repository snapshot",t,o,!0)}}};function xi(e,t){if(!Ve(e)||e.schemaVersion!==Le||!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))||!Ve(e.state)||e.state.schemaVersion!==1||!Array.isArray(e.state.records)||!Ve(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 i=e,n=Ci(i),o=Xt(n);if(i.checksum.value!==o)throw new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository snapshot checksum does not match its payload",{snapshotPath:t});return new J({initialState:i.state}),structuredClone(i)}function Ti(e){return{...structuredClone(e),checksum:{algorithm:"sha256",value:Xt(e)}}}function Ci(e){return{schemaVersion:e.schemaVersion,generation:e.generation,createdAt:e.createdAt,updatedAt:e.updatedAt,state:e.state}}function Xt(e){return k(JSON.stringify(e)).value}async function Rt(e,t){await(0,S.mkdir)((0,N.dirname)(e),{recursive:!0,mode:448});let i=`${e}.tmp.${process.pid}.${(0,Fe.randomUUID)()}`,n;try{n=await(0,S.open)(i,"wx",384),await n.writeFile(t,{encoding:"utf8"}),await n.sync(),await n.close(),n=void 0,await(0,S.rename)(i,e);try{let o=await(0,S.open)((0,N.dirname)(e),"r");try{await o.sync()}finally{await o.close()}}catch{}}finally{n&&await n.close().catch(()=>{}),await(0,S.unlink)(i).catch(()=>{})}}function $e(e,t,i,n,o){if(e===void 0)return t;if(!Number.isInteger(e)||e<i||e>n)throw new TypeError(`${o} must be an integer between ${i} and ${n}`);return e}function Ve(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function De(e,t){return e instanceof Error&&e.code===t}async function Ni(e){try{return(await(0,S.stat)(e)).isFile()}catch(t){if(De(t,"ENOENT"))return!1;throw Oe("Unable to inspect artifact repository backup",e,t)}}function ge(e){return e instanceof Error?e:new Error(String(e))}function Oe(e,t,i,n=!1){return new u(n?"ARTIFACT_PERSISTENCE_CORRUPT":"ARTIFACT_PERSISTENCE_IO",`${e}: ${ge(i).message}`,{snapshotPath:t},{cause:ge(i)})}function $i(e){return new Promise(t=>setTimeout(t,e))}var Me=require("node:buffer");var Vi=16*1024*1024,Pi=5e3,Di=1e5,Oi=1e6,Fi=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?:\s?(.*))?$/,E=class extends Error{constructor(i,n){super(n===void 0?i:`${i} at diff line ${n}`);this.line=n;this.name="XenoDiffParseError"}line;code="XENO_DIFF_INVALID"};function He(e,t={}){if(typeof e!="string")throw new TypeError("Unified diff must be a string");let i=ye(t.maxBytes,Vi,1024,256*1024*1024,"maxBytes"),n=ye(t.maxFiles,Pi,1,1e5,"maxFiles"),o=ye(t.maxHunks,Di,1,1e6,"maxHunks"),r=ye(t.maxLines,Oi,1,5e6,"maxLines");if(Me.Buffer.byteLength(e,"utf8")>i)throw new E(`Unified diff exceeds ${i} bytes`);let a=e.replace(/\r\n/g,`
|
|
5
5
|
`).replace(/\r/g,`
|
package/dist/artifacts/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
var h=1,re=1;import{Buffer as Oe}from"node:buffer";import{createHash as Mt}from"node:crypto";function _(e){return{algorithm:"sha256",value:Mt("sha256").update(e).digest("hex")}}function b(e){return JSON.stringify(Ae(e,new Set))}function k(e){return _(b(e))}function Ae(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 n=e.map(o=>Ae(o,t));return t.delete(e),n}let i={};for(let n of Object.keys(e).sort((o,r)=>o.localeCompare(r))){let o=e[n];if(o===void 0)throw new TypeError(`Artifact JSON property ${n} is undefined`);i[n]=Ae(o,t)}return t.delete(e),i}var L=class extends Error{code="ARTIFACT_INVALID";issues;constructor(t,i){super(t),this.name="XenoArtifactValidationError",this.issues=i.map(n=>({...n}))}},Ie=class extends Error{constructor(i,n){super(`Artifact state cannot transition from ${i} to ${n}`);this.fromState=i;this.toState=n;this.name="XenoArtifactStateTransitionError"}fromState;toState;code="ARTIFACT_STATE_TRANSITION_INVALID"},Ht={draft:["pending_review","superseded","archived"],pending_review:["approved","rejected","superseded","archived"],approved:["superseded","archived"],rejected:["superseded","archived"],superseded:["archived"],archived:[]},jt=/^[a-z0-9][a-z0-9._/-]{0,127}$/,qt="[\\u0000-\\u001f\\u007f]",Jt=new RegExp(qt),Fe=/^[a-f0-9]{64}$/,Bt=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/,Ut=new Set(["draft","pending_review","approved","rejected","superseded","archived"]),zt=new Set(["public","internal","confidential","restricted"]),Wt=new Set(["agent","tool","user","system","integration"]),Gt=new Set(["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"]),Kt=new Set(["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"]),Yt=new Set(["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"]);function p(e,t,i,n){e.push({path:t,code:i,message:n})}function l(e,t,i,n=1024){return typeof e!="string"||e.trim().length===0?(p(i,t,"required_string","Value must be a non-empty string"),!1):(e.length>n&&p(i,t,"string_too_long",`Value must not exceed ${n} characters`),Jt.test(e)&&p(i,t,"control_character","Value must not contain control characters"),!0)}function J(e,t,i){e!==void 0&&(!Number.isFinite(Date.parse(e))||!e.includes("T"))&&p(i,t,"invalid_timestamp","Value must be an ISO 8601 timestamp")}function P(e,t,i,n){if(typeof e!="string"||!e.startsWith(t))return;let o=e.slice(t.length);jt.test(o)||p(n,i,"invalid_custom_name",`Custom name after ${t} is invalid`)}function Le(e,t,i){if(!e||typeof e!="object"){p(i,t,"missing_actor","Actor is required");return}l(e.kind,`${t}.kind`,i,64),Wt.has(e.kind)||p(i,`${t}.kind`,"unknown_actor_kind","Actor kind is not supported"),l(e.id,`${t}.id`,i,512),e?.displayName!==void 0&&l(e.displayName,`${t}.displayName`,i,512),e?.profileFingerprint!==void 0&&!/^[a-f0-9]{64}$/.test(e.profileFingerprint)&&p(i,`${t}.profileFingerprint`,"invalid_fingerprint","Profile fingerprint must be 64 lowercase hexadecimal characters")}function we(e,t,i){if(!e||typeof e!="object"){p(i,t,"invalid_anchor","Anchor must be an object");return}switch(e.kind){case"file":l(e.path,`${t}.path`,i,4096);break;case"source-line":l(e.path,`${t}.path`,i,4096),(!Number.isInteger(e.startLine)||e.startLine<1)&&p(i,`${t}.startLine`,"invalid_line","startLine must be a positive integer"),e.endLine!==void 0&&(!Number.isInteger(e.endLine)||e.endLine<e.startLine)&&p(i,`${t}.endLine`,"invalid_line_range","endLine must be greater than or equal to startLine");break;case"diff-hunk":l(e.path,`${t}.path`,i,4096),l(e.hunkId,`${t}.hunkId`,i,512);break;case"symbol":l(e.path,`${t}.path`,i,4096),l(e.symbol,`${t}.symbol`,i,1024);break;case"dom-node":l(e.pageId,`${t}.pageId`,i,512),!e.selector&&!e.accessibilityId&&!e.snapshotArtifactId&&p(i,t,"missing_dom_locator","DOM anchors require a selector, accessibility ID, or snapshot artifact ID");break;case"timeline":l(e.recordingArtifactId,`${t}.recordingArtifactId`,i,512),(!Number.isFinite(e.startMs)||e.startMs<0)&&p(i,`${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(i,`${t}.endMs`,"invalid_time_range","endMs must be greater than or equal to startMs");break;case"region":l(e.mediaArtifactId,`${t}.mediaArtifactId`,i,512),[e.x,e.y,e.width,e.height].every(Number.isFinite)?(e.width<=0||e.height<=0)&&p(i,t,"invalid_region_size","Region width and height must be positive"):p(i,t,"invalid_region","Region coordinates must be finite numbers");break;case"artifact":l(e.artifactId,`${t}.artifactId`,i,512);break;default:typeof e.kind!="string"||!e.kind.startsWith("custom:")?p(i,`${t}.kind`,"unknown_anchor","Anchor kind is not supported"):P(e.kind,"custom:",`${t}.kind`,i)}}function B(e,t,i,n){if(!(e===null||typeof e=="string"||typeof e=="boolean")){if(typeof e=="number"){Number.isFinite(e)||p(i,t,"non_finite_number","JSON numbers must be finite");return}if(typeof e!="object"){p(i,t,"non_json_value","Value must be JSON-serializable");return}if(n.has(e)){p(i,t,"cyclic_value","Value must not contain cycles");return}if(n.add(e),Array.isArray(e))e.forEach((o,r)=>B(o,`${t}[${r}]`,i,n));else for(let[o,r]of Object.entries(e))r===void 0?p(i,`${t}.${o}`,"undefined_value","Undefined is not valid JSON"):B(r,`${t}.${o}`,i,n);n.delete(e)}}function Zt(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"&&!Gt.has(e.kind)&&!e.kind.startsWith("custom:")&&p(t,"kind","unknown_artifact_kind","Artifact kind is not supported"),P(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),Ut.has(e.state)||p(t,"state","unknown_state","Artifact state is not supported"),l(e.createdAt,"createdAt",t,128),J(e.createdAt,"createdAt",t),J(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),zt.has(e.sensitivity)||p(t,"sensitivity","unknown_sensitivity","Sensitivity is not supported"),e.identity)for(let[n,o]of Object.entries(e.identity))o!==void 0&&l(o,`identity.${n}`,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),P(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"&&!Fe.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 n=e.content.storage;if(!n||typeof n!="object")p(t,"content.storage","missing_storage","storage reference is required");else if(n.type==="inline")if(n.text===void 0==(n.base64===void 0))p(t,"content.storage","invalid_inline_storage","Inline storage requires exactly one of text or base64");else{let o;n.text!==void 0?o=Oe.from(n.text,"utf8"):n.base64!==void 0&&(Bt.test(n.base64)?o=Oe.from(n.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 n.type==="file"?l(n.path,"content.storage.path",t,4096):n.type==="blob"?l(n.uri,"content.storage.uri",t,8192):n.type==="git"?(l(n.commit,"content.storage.commit",t,512),l(n.path,"content.storage.path",t,4096)):n.type==="url"?(l(n.url,"content.storage.url",t,8192),J(n.expiresAt,"content.storage.expiresAt",t)):n.type==="external"?(l(n.provider,"content.storage.provider",t,255),l(n.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"),P(e.content.encoding,"custom:","content.encoding",t)}!e.provenance||typeof e.provenance!="object"?p(t,"provenance","missing_provenance","provenance is required"):(Le(e.provenance.producer,"provenance.producer",t),e.provenance.capabilityLeaseIds?.forEach((n,o)=>l(n,`provenance.capabilityLeaseIds[${o}]`,t,512)),e.provenance.sourceArtifactIds?.forEach((n,o)=>l(n,`provenance.sourceArtifactIds[${o}]`,t,512)),e.provenance.attributes&&B(e.provenance.attributes,"provenance.attributes",t,new Set));let i=new Set;return e.relationships?.forEach((n,o)=>{let r=`relationships[${o}]`;l(n.relation,`${r}.relation`,t,160),typeof n.relation=="string"&&!Yt.has(n.relation)&&!n.relation.startsWith("custom:")&&p(t,`${r}.relation`,"unknown_relationship","Relationship type is not supported"),P(n.relation,"custom:",`${r}.relation`,t),l(n.target?.type,`${r}.target.type`,t,160),typeof n.target?.type=="string"&&!Kt.has(n.target.type)&&!n.target.type.startsWith("custom:")&&p(t,`${r}.target.type`,"unknown_reference_type","Evidence reference type is not supported"),P(n.target?.type,"custom:",`${r}.target.type`,t),l(n.target?.id,`${r}.target.id`,t,512);let a=`${n.relation}:${n.target?.type}:${n.target?.id}:${n.target?.revision??""}`;i.has(a)&&p(t,r,"duplicate_relationship","Duplicate relationship"),i.add(a),n.attributes&&B(n.attributes,`${r}.attributes`,t,new Set)}),e.anchors?.forEach((n,o)=>we(n,`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"),J(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&&B(e.extensions,"extensions",t,new Set),t}function w(e){let t=Zt(e);if(t.length>0)throw new L("XENO artifact validation failed",t)}function Qt(e,t){return Ht[e].includes(t)}function oe(e,t){if(!Qt(e,t))throw new Ie(e,t)}function Re(e,t){let i=[];return e.schemaVersion!==1&&p(i,"schemaVersion","unsupported_schema",`schemaVersion must be ${1}`),l(e.eventId,"eventId",i,512),l(e.artifactId,"artifactId",i,512),(!Number.isInteger(e.artifactRevision)||e.artifactRevision<1)&&p(i,"artifactRevision","invalid_revision","artifactRevision must be a positive integer"),(!Number.isInteger(e.sequence)||e.sequence<1)&&p(i,"sequence","invalid_sequence","sequence must be a positive integer"),l(e.recordedAt,"recordedAt",i,128),J(e.recordedAt,"recordedAt",i),Le(e.actor,"actor",i),!e.artifactHash||typeof e.artifactHash!="object"?p(i,"artifactHash","missing_hash","Artifact hash is required"):(l(e.artifactHash.algorithm,"artifactHash.algorithm",i,128),P(e.artifactHash.algorithm,"custom:","artifactHash.algorithm",i),l(e.artifactHash.value,"artifactHash.value",i,512),e.artifactHash.algorithm==="sha256"&&!Fe.test(e.artifactHash.value)&&p(i,"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(i,"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(i,"type","unknown_review_event","Review event type is not supported"),e.type==="comment-added"?(l(e.commentId,"commentId",i,512),l(e.body,"body",i,65536),e.anchor&&we(e.anchor,"anchor",i)):e.type==="comment-resolved"||e.type==="comment-reopened"?l(e.commentId,"commentId",i,512):e.type==="decision-recorded"&&(["approved","rejected","changes_requested"].includes(e.decision)||p(i,"decision","unknown_review_decision","Review decision is not supported"),e.scope&&we(e.scope,"scope",i)),t&&(e.artifactId!==t.artifactId&&p(i,"artifactId","artifact_mismatch","Review event targets a different artifact"),e.artifactRevision!==t.revision&&p(i,"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(i,"artifactHash","hash_mismatch","Review event hash does not match the artifact revision")),i}function Xe(e){let t="not_requested",i,n,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:(i=s.decision,n=s.eventId,t=s.decision));return{status:t,totalComments:a.size,unresolvedComments:[...a].filter(s=>!c.has(s)).length,...i?{latestDecision:i}:{},...n?{latestDecisionEventId:n}:{},...r>0?{scopedDecisionCount:r}:{},...o?{lastReviewedAt:o}:{}}}var Ee=class extends Error{code="EVIDENCE_GRAPH_INVALID";issues;constructor(t){super("XENO evidence graph validation failed"),this.name="XenoEvidenceGraphValidationError",this.issues=t.map(i=>({...i}))}},ei=new Set(["depends_on","decomposes","supersedes"]),ti=/^[a-z0-9][a-z0-9._/-]{0,127}$/,ii=new Set(["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"]),ni=new Set(["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"]);function y(e,t,i,n){e.push({path:t,code:i,message:n})}function U(e){return e.includes("T")&&Number.isFinite(Date.parse(e))}function Me(e,t){return e.startsWith("custom:")?ti.test(e.slice(7)):t.has(e)}function ri(e){let t=[];if(!e||typeof e!="object")return[{path:"$",code:"invalid_graph",message:"Evidence graph must be an object"}];e.schemaVersion!==1&&y(t,"schemaVersion","unsupported_schema",`schemaVersion must be ${1}`),(typeof e.graphId!="string"||e.graphId.trim().length===0)&&y(t,"graphId","required_string","graphId must be a non-empty string"),(!Number.isInteger(e.version)||e.version<1)&&y(t,"version","invalid_version","version must be a positive integer"),U(e.createdAt)||y(t,"createdAt","invalid_timestamp","createdAt must be an ISO 8601 timestamp"),U(e.updatedAt)||y(t,"updatedAt","invalid_timestamp","updatedAt must be an ISO 8601 timestamp"),U(e.createdAt)&&U(e.updatedAt)&&Date.parse(e.updatedAt)<Date.parse(e.createdAt)&&y(t,"updatedAt","timestamp_order","updatedAt must not precede createdAt");let i=new Map;Array.isArray(e.nodes)||y(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?y(t,`${I}.id`,"required_string","Node ID must be a non-empty string"):i.has(f.id)?y(t,`${I}.id`,"duplicate_node",`Node ID ${f.id} is duplicated`):i.set(f.id,f),(typeof f.type!="string"||!Me(f.type,ii))&&y(t,`${I}.type`,"invalid_node_type","Node type is invalid"),f.artifactRevision!==void 0&&(!Number.isInteger(f.artifactRevision)||f.artifactRevision<1)&&y(t,`${I}.artifactRevision`,"invalid_revision","artifactRevision must be a positive integer")});let n=new Set,o=new Set;Array.isArray(e.edges)||y(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?y(t,`${I}.id`,"required_string","Edge ID must be a non-empty string"):n.has(f.id)&&y(t,`${I}.id`,"duplicate_edge",`Edge ID ${f.id} is duplicated`),n.add(f.id),(typeof f.type!="string"||!Me(f.type,ni))&&y(t,`${I}.type`,"invalid_edge_type","Edge type is invalid");let $=`${f.type}:${f.from}:${f.to}`;o.has($)&&y(t,I,"duplicate_edge_identity","Equivalent evidence edge is duplicated"),o.add($),i.has(f.from)||y(t,`${I}.from`,"dangling_reference",`Source node ${f.from} does not exist`),i.has(f.to)||y(t,`${I}.to`,"dangling_reference",`Target node ${f.to} does not exist`),f.from===f.to&&y(t,I,"self_edge","Evidence edges cannot point to the same node"),U(f.createdAt)||y(t,`${I}.createdAt`,"invalid_timestamp","createdAt must be an ISO 8601 timestamp")});let r=(Array.isArray(e.edges)?e.edges:[]).filter(f=>ei.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 i.keys())if(d(f)){y(t,"edges","cyclic_graph","Dependency, decomposition, and supersession edges must be acyclic");break}return t}function z(e){let t=ri(e);if(t.length>0)throw new Ee(t)}var He=class{now;graph;constructor(t){if("schemaVersion"in t)z(t),this.now=()=>new Date().toISOString(),this.graph=se(t);else{this.now=t.now??(()=>new Date().toISOString());let i=this.now();this.graph={schemaVersion:1,graphId:t.graphId,version:1,createdAt:i,updatedAt:i,nodes:[],edges:[]},z(this.graph)}}addNode(t){let i=se(this.graph);return i.nodes.push(je(t)),this.touch(i),z(i),this.graph=i,this}addEdge(t){let i=se(this.graph);return i.edges.push(qe(t)),this.touch(i),z(i),this.graph=i,this}build(){return z(this.graph),se(this.graph)}touch(t){t.version+=1,t.updatedAt=this.now()}};function je(e){return{...e,...e.attributes?{attributes:structuredClone(e.attributes)}:{}}}function qe(e){return{...e,...e.producer?{producer:{...e.producer}}:{},...e.attributes?{attributes:structuredClone(e.attributes)}:{}}}function se(e){return{...e,nodes:e.nodes.map(je),edges:e.edges.map(qe)}}var u=class extends Error{constructor(i,n,o,r){super(n,r);this.code=i;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??(i=>(this.idCounter+=1,`${i}_${Date.now().toString(36)}_${this.idCounter.toString(36)}`)),t.initialState&&this.hydrate(t.initialState)}exportState(){let t=[...this.records.values()].flatMap(i=>[...i.values()]).sort(Je).map(i=>({artifact:W(i.artifact),recordVersion:i.recordVersion,lifecycleEvents:structuredClone(i.lifecycleEvents),reviewEvents:structuredClone(i.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 i=W(t),n=this.createLifecycleEvent({artifact:i,sequence:1,actor:i.provenance.producer,fromState:null,toState:i.state,reason:"artifact-created"}),o={artifact:i,recordVersion:1,lifecycleEvents:[n],reviewEvents:[]};return this.records.set(i.artifactId,new Map([[i.revision,o]])),this.currentRevisions.set(i.artifactId,i.revision),D(o)}async createRevision(t,i={}){w(t),this.assertInitialState(t);let n=this.getMutable(t.artifactId);this.assertVersion(n,i.expectedRecordVersion);let o=n.artifact.revision+1;if(t.revision!==o||t.predecessorRevision!==n.artifact.revision)throw new u("ARTIFACT_REVISION_INVALID",`Revision ${t.revision} does not follow current revision ${n.artifact.revision}`,{artifactId:t.artifactId,currentRevision:n.artifact.revision,requestedRevision:t.revision});if(si(t,n.artifact))throw new u("ARTIFACT_CONTENT_UNCHANGED","A new artifact revision must have a different content hash",{artifactId:t.artifactId,revision:t.revision});if(n.artifact.state==="archived")throw new u("ARTIFACT_REVISION_INVALID","Archived artifacts cannot receive new revisions",{artifactId:t.artifactId,revision:n.artifact.revision});if(n.artifact.state!=="superseded"){oe(n.artifact.state,"superseded");let s=this.now(),d=this.createLifecycleEvent({artifact:n.artifact,sequence:n.lifecycleEvents.length+1,actor:i.actor??t.provenance.producer,fromState:n.artifact.state,toState:"superseded",reason:i.reason??`superseded-by-revision-${t.revision}`,recordedAt:s});n.artifact.state="superseded",n.artifact.updatedAt=s,n.lifecycleEvents.push(d),n.recordVersion+=1}let r=W(t),a=this.createLifecycleEvent({artifact:r,sequence:1,actor:i.actor??r.provenance.producer,fromState:null,toState:r.state,reason:i.reason??`revision-created-from-${n.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,i){let n=this.records.get(t);if(!n)return;let o=i??this.currentRevisions.get(t);if(o===void 0)return;let r=n.get(o);return r?D(r):void 0}async require(t,i){let n=await this.get(t,i);if(!n)throw new u("ARTIFACT_NOT_FOUND",`Artifact ${t}${i===void 0?"":` revision ${i}`} was not found`,{artifactId:t,...i===void 0?{}:{revision:i}});return n}async list(t={}){let i=[];for(let[n,o]of this.records)if(!(t.artifactIds&&!t.artifactIds.includes(n)))if(t.includeSuperseded)i.push(...o.values());else{let r=this.currentRevisions.get(n);if(r!==void 0){let a=o.get(r);a&&i.push(a)}}return i.filter(n=>ai(n.artifact,t)).sort(Je).map(D)}async listRevisions(t){let i=this.records.get(t);return i?[...i.values()].sort((n,o)=>n.artifact.revision-o.artifact.revision).map(D):[]}async transition(t){let i=this.getMutable(t.artifactId,t.revision);if(this.assertVersion(i,t.expectedRecordVersion),oe(i.artifact.state,t.toState),t.toState==="approved"||t.toState==="rejected"){let a=t.reviewEventId?i.reviewEvents.find(s=>s.eventId===t.reviewEventId&&s.type==="decision-recorded"):void 0,c=Xe(i.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:i.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:i.artifact.revision,unresolvedComments:c.unresolvedComments})}let n=this.now(),o=i.artifact.state,r=this.createLifecycleEvent({artifact:i.artifact,sequence:i.lifecycleEvents.length+1,actor:t.actor,fromState:o,toState:t.toState,reason:t.reason,reviewEventId:t.reviewEventId,recordedAt:n});return i.artifact.state=t.toState,i.artifact.updatedAt=n,i.lifecycleEvents.push(r),i.recordVersion+=1,D(i)}async appendReviewEvent(t){let i=t.event,n=this.getMutable(i.artifactId,i.artifactRevision);if(this.assertVersion(n,t.expectedRecordVersion),n.artifact.state==="archived"||n.artifact.state==="superseded")throw new u("ARTIFACT_REVIEW_INVALID",`Cannot append review events to a ${n.artifact.state} artifact revision`,{artifactId:i.artifactId,revision:i.artifactRevision});if(this.assertReviewCommentState(n,i),(i.type==="review-requested"||i.type==="review-withdrawn"||i.type==="decision-recorded")&&n.artifact.state!=="pending_review")throw new u("ARTIFACT_REVIEW_INVALID",`${i.type} requires an artifact in pending_review state`,{artifactId:i.artifactId,revision:i.artifactRevision});let o={...structuredClone(i),schemaVersion:1,eventId:this.nextEventId("review_event"),sequence:n.reviewEvents.length+1,recordedAt:this.now()},r=Re(o,n.artifact);if(r.length>0)throw new L("XENO artifact review event validation failed",r);return n.reviewEvents.push(o),n.recordVersion+=1,D(n)}getMutable(t,i){let n=this.records.get(t),o=i??this.currentRevisions.get(t),r=o===void 0?void 0:n?.get(o);if(!r)throw new u("ARTIFACT_NOT_FOUND",`Artifact ${t}${i===void 0?"":` revision ${i}`} was not found`,{artifactId:t,...i===void 0?{}:{revision:i}});return r}assertVersion(t,i){if(i!==void 0&&i!==t.recordVersion)throw new u("ARTIFACT_CONFLICT",`Expected record version ${i}, found ${t.recordVersion}`,{artifactId:t.artifact.artifactId,revision:t.artifact.revision,expectedRecordVersion:i,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,i){if(i.type==="comment-added"){if(t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===i.commentId))throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.commentId} already exists`);if(i.parentCommentId&&!t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===i.parentCommentId))throw new u("ARTIFACT_REVIEW_INVALID",`Parent comment ${i.parentCommentId} does not exist`);return}if(i.type!=="comment-resolved"&&i.type!=="comment-reopened")return;if(!t.reviewEvents.some(r=>r.type==="comment-added"&&r.commentId===i.commentId))throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.commentId} does not exist`);let o=ci(t.reviewEvents,i.commentId);if(i.type==="comment-resolved"&&o.resolved)throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.commentId} is already resolved`);if(i.type==="comment-reopened"&&!o.resolved)throw new u("ARTIFACT_REVIEW_INVALID",`Comment ${i.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 i=this.idFactory(t);if(typeof i!="string"||i.trim().length===0||this.eventIds.has(i))throw new u("ARTIFACT_CONFLICT",`Event ID factory produced an invalid or duplicate ${t} ID`);return this.eventIds.add(i),i}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 i=[...t.records].sort((n,o)=>n.artifact.artifactId.localeCompare(o.artifact.artifactId)||n.artifact.revision-o.artifact.revision);for(let n of i){let o=oi(n,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[n,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 ${n} is missing revision ${s}`);if(a===0&&c.artifact.predecessorRevision!==void 0)throw new u("ARTIFACT_REVISION_INVALID",`Initial revision for ${n} cannot declare a predecessor`);if(a>0&&c.artifact.predecessorRevision!==s-1)throw new u("ARTIFACT_REVISION_INVALID",`Persisted revision ${n}:${s} has an invalid predecessor`);if(a<r.length-1&&c.artifact.state!=="superseded")throw new u("ARTIFACT_REVISION_INVALID",`Non-current revision ${n}:${s} must be superseded`)}}}};function oi(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 i=e.lifecycleEvents.length+e.reviewEvents.length;if(e.recordVersion!==i)throw new u("ARTIFACT_REVISION_INVALID",`Persisted record version ${e.recordVersion} does not match ${i} mutations`,{artifactId:e.artifact.artifactId,revision:e.artifact.revision});let n=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!==n||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(n===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 oe(n,a.toState);t.add(a.eventId),n=a.toState}if(n!==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=Re(a,e.artifact);if(c.length>0)throw new L("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:W(e.artifact),recordVersion:e.recordVersion,lifecycleEvents:structuredClone(e.lifecycleEvents),reviewEvents:structuredClone(e.reviewEvents)}}function si(e,t){return e.content.hash.algorithm===t.content.hash.algorithm&&e.content.hash.value===t.content.hash.value}function ai(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 Je(e,t){return e.artifact.createdAt.localeCompare(t.artifact.createdAt)||e.artifact.artifactId.localeCompare(t.artifact.artifactId)||e.artifact.revision-t.artifact.revision}function ci(e,t){let i=!1;for(let n of e)(n.type==="comment-resolved"||n.type==="comment-reopened")&&n.commentId===t&&(i=n.type==="comment-resolved");return{resolved:i}}function W(e){return structuredClone(e)}function D(e){return{artifact:W(e.artifact),recordVersion:e.recordVersion,etag:`${e.artifact.artifactId}:${e.artifact.revision}:${e.recordVersion}`,lifecycleEvents:structuredClone(e.lifecycleEvents),reviewEvents:structuredClone(e.reviewEvents),reviewSummary:Xe(e.reviewEvents)}}import{randomUUID as it}from"node:crypto";import{mkdir as nt,open as Ye,readFile as yi,rename as Ai,stat as rt,unlink as Ii}from"node:fs/promises";import{basename as Ze,dirname as Qe,join as wi,resolve as Ri}from"node:path";import{mkdirSync as di,readFileSync as fi,rmSync as Ue,writeFileSync as pi}from"node:fs";import{hostname as ze}from"node:os";import{dirname as ui}from"node:path";function li(){return new Date().toISOString()}function mi(){return new Date(Date.now()-Math.floor(process.uptime()*1e3)).toISOString()}function We(e){try{return JSON.parse(fi(e,"utf8"))}catch{return null}}function vi(e){if(!e||e<=0)return!1;try{return process.kill(e,0),!0}catch{return!1}}function hi(e){return e.hostname!==ze()?!0:vi(e.pid)}function Be(e,t){di(ui(e),{recursive:!0}),pi(e,JSON.stringify(t,null,2)+`
|
|
2
|
-
`,{encoding:"utf8",flag:"wx"})}function gi(e,t){let i=We(e);i?.pid!==t.pid||i.hostname!==t.hostname||Ue(e,{force:!0})}function Ge(e,t,i){let n=li(),o={schemaVersion:1,name:t,pid:process.pid,hostname:ze(),processStartedAt:mi(),version:i,acquiredAt:n,updatedAt:n};try{Be(e,o)}catch(r){if(r.code!=="EEXIST")throw r;let c=We(e);if(c&&hi(c))throw new Error(`${t} is already locked by PID ${c.pid} on ${c.hostname}.`);Ue(e,{force:!0}),Be(e,o)}return{record:o,release:()=>{gi(e,o)}}}var Ke="0.8
|
|
2
|
+
`,{encoding:"utf8",flag:"wx"})}function gi(e,t){let i=We(e);i?.pid!==t.pid||i.hostname!==t.hostname||Ue(e,{force:!0})}function Ge(e,t,i){let n=li(),o={schemaVersion:1,name:t,pid:process.pid,hostname:ze(),processStartedAt:mi(),version:i,acquiredAt:n,updatedAt:n};try{Be(e,o)}catch(r){if(r.code!=="EEXIST")throw r;let c=We(e);if(c&&hi(c))throw new Error(`${t} is already locked by PID ${c.pid} on ${c.hostname}.`);Ue(e,{force:!0}),Be(e,o)}return{record:o,release:()=>{gi(e,o)}}}var Ke="0.9.8";var ot=1,Xi="repository.v1.json",Ei=5e3,bi=20,Si=64*1024*1024,et=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 i=t.snapshotFileName??Xi;if(Ze(i)!==i||!/^[A-Za-z0-9_.-]+$/.test(i))throw new TypeError("Artifact snapshot filename must be a safe basename");this.directory=Ri(t.directory),this.snapshotPath=wi(this.directory,i),this.backupPath=`${this.snapshotPath}.bak`,this.lockPath=`${this.snapshotPath}.lock`,this.now=t.now??(()=>new Date().toISOString()),this.lockTimeoutMs=be(t.lockTimeoutMs,Ei,100,6e4,"lockTimeoutMs"),this.lockRetryMs=be(t.lockRetryMs,bi,1,1e3,"lockRetryMs"),this.maxSnapshotBytes=be(t.maxSnapshotBytes,Si,1024,1024*1024*1024,"maxSnapshotBytes"),this.onRecovery=t.onRecovery}async create(t){return this.mutate(i=>i.create(t))}async createRevision(t,i){return this.mutate(n=>n.createRevision(t,i))}async get(t,i){return(await this.load()).repository.get(t,i)}async require(t,i){return(await this.load()).repository.require(t,i)}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(i=>i.transition(t))}async appendReviewEvent(t){return this.mutate(i=>i.appendReviewEvent(t))}async inspectSnapshot(){return this.readSnapshot(this.snapshotPath,!0)}async mutate(t){return this.enqueueMutation(async()=>{let i=await this.acquireLock();try{let n=await this.load(),o=await t(n.repository);return await this.persist(n),o}finally{i.release()}})}async enqueueMutation(t){let i=this.mutationTail.then(t,t);return this.mutationTail=i.then(()=>{},()=>{}),i}async acquireLock(){let t=Date.now(),i;for(;Date.now()-t<=this.lockTimeoutMs;)try{return Ge(this.lockPath,`artifact-repository:${Ze(this.snapshotPath)}`,Ke)}catch(n){if(!(n instanceof Error)||!/already locked by PID/.test(n.message))throw n;i=n,await Ci(this.lockRetryMs)}throw new u("ARTIFACT_PERSISTENCE_LOCKED",`Artifact repository remained locked for ${this.lockTimeoutMs}ms`,{snapshotPath:this.snapshotPath},{cause:i})}async load(){let t,i,n=!1;try{i=await this.readSnapshot(this.snapshotPath,!1)}catch(r){t=ae(r)}if(!i&&(t||await Ti(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"}),i=r,n=!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,ae(r)])}):r}if(!i&&t)throw t;let o=i?.state??{schemaVersion:1,records:[]};return{repository:new G({now:this.now,idFactory:r=>`${r}_${it()}`,initialState:o}),generation:i?.generation??0,createdAt:i?.createdAt??this.now(),hasSnapshot:i!==void 0,recoveredFromBackup:n,...i?{sourceSnapshot:i}:{}}}async persist(t){let i=this.now(),o={...{schemaVersion:ot,generation:t.generation,createdAt:t.createdAt,updatedAt:i,state:t.repository.exportState()},generation:t.generation+1},r=ki(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 nt(this.directory,{recursive:!0,mode:448}),t.hasSnapshot&&!t.recoveredFromBackup&&t.sourceSnapshot&&await tt(this.backupPath,`${JSON.stringify(t.sourceSnapshot,null,2)}
|
|
4
4
|
`),await tt(this.snapshotPath,a)}async readSnapshot(t,i){let n;try{n=await rt(t)}catch(o){if(!i&&_e(o,"ENOENT")||i&&_e(o,"ENOENT"))return;throw ke("Unable to inspect artifact repository snapshot",t,o)}if(!n.isFile()||n.size>this.maxSnapshotBytes)throw new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository snapshot is not a bounded regular file",{snapshotPath:t,sizeBytes:n.size,maxSnapshotBytes:this.maxSnapshotBytes});try{let o=await yi(t);if(o.byteLength>this.maxSnapshotBytes)throw new Error("snapshot grew beyond the configured size limit while reading");return _i(JSON.parse(o.toString("utf8")),t)}catch(o){throw o instanceof u?o:ke("Unable to parse artifact repository snapshot",t,o,!0)}}};function _i(e,t){if(!Se(e)||e.schemaVersion!==ot||!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))||!Se(e.state)||e.state.schemaVersion!==1||!Array.isArray(e.state.records)||!Se(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 i=e,n=xi(i),o=st(n);if(i.checksum.value!==o)throw new u("ARTIFACT_PERSISTENCE_CORRUPT","Artifact repository snapshot checksum does not match its payload",{snapshotPath:t});return new G({initialState:i.state}),structuredClone(i)}function ki(e){return{...structuredClone(e),checksum:{algorithm:"sha256",value:st(e)}}}function xi(e){return{schemaVersion:e.schemaVersion,generation:e.generation,createdAt:e.createdAt,updatedAt:e.updatedAt,state:e.state}}function st(e){return _(JSON.stringify(e)).value}async function tt(e,t){await nt(Qe(e),{recursive:!0,mode:448});let i=`${e}.tmp.${process.pid}.${it()}`,n;try{n=await Ye(i,"wx",384),await n.writeFile(t,{encoding:"utf8"}),await n.sync(),await n.close(),n=void 0,await Ai(i,e);try{let o=await Ye(Qe(e),"r");try{await o.sync()}finally{await o.close()}}catch{}}finally{n&&await n.close().catch(()=>{}),await Ii(i).catch(()=>{})}}function be(e,t,i,n,o){if(e===void 0)return t;if(!Number.isInteger(e)||e<i||e>n)throw new TypeError(`${o} must be an integer between ${i} and ${n}`);return e}function Se(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function _e(e,t){return e instanceof Error&&e.code===t}async function Ti(e){try{return(await rt(e)).isFile()}catch(t){if(_e(t,"ENOENT"))return!1;throw ke("Unable to inspect artifact repository backup",e,t)}}function ae(e){return e instanceof Error?e:new Error(String(e))}function ke(e,t,i,n=!1){return new u(n?"ARTIFACT_PERSISTENCE_CORRUPT":"ARTIFACT_PERSISTENCE_IO",`${e}: ${ae(i).message}`,{snapshotPath:t},{cause:ae(i)})}function Ci(e){return new Promise(t=>setTimeout(t,e))}import{Buffer as ft}from"node:buffer";var Ni=16*1024*1024,$i=5e3,Vi=1e5,Pi=1e6,Di=/^@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@(?:\s?(.*))?$/,E=class extends Error{constructor(i,n){super(n===void 0?i:`${i} at diff line ${n}`);this.line=n;this.name="XenoDiffParseError"}line;code="XENO_DIFF_INVALID"};function pt(e,t={}){if(typeof e!="string")throw new TypeError("Unified diff must be a string");let i=ce(t.maxBytes,Ni,1024,256*1024*1024,"maxBytes"),n=ce(t.maxFiles,$i,1,1e5,"maxFiles"),o=ce(t.maxHunks,Vi,1,1e6,"maxHunks"),r=ce(t.maxLines,Pi,1,5e6,"maxLines");if(ft.byteLength(e,"utf8")>i)throw new E(`Unified diff exceeds ${i} bytes`);let a=e.replace(/\r\n/g,`
|
|
5
5
|
`).replace(/\r/g,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/artifacts/types.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/artifacts/types.ts":{"bytes":9012,"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/artifacts/validation.ts":{"bytes":25422,"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"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":9069,"imports":[{"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/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":36,"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":30258,"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"}],"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":172},"src/artifacts/types.ts":{"bytesInOutput":12},"src/artifacts/browser-diff.ts":{"bytesInOutput":4291}},"bytes":5035},"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":2009},"src/artifacts/types.ts":{"bytesInOutput":13},"src/artifacts/validation.ts":{"bytesInOutput":14209},"src/artifacts/hash.ts":{"bytesInOutput":721},"src/artifacts/evidence-graph.ts":{"bytesInOutput":4726},"src/artifacts/repository.ts":{"bytesInOutput":13747},"src/artifacts/file-repository.ts":{"bytesInOutput":6758},"src/control-plane/lock.ts":{"bytesInOutput":1067},"src/version.ts":{"bytesInOutput":15},"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":14190},"src/artifacts/legacy-adapters.ts":{"bytesInOutput":5009}},"bytes":90306}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/artifacts/types.ts":{"bytes":
|
|
1
|
+
{"inputs":{"src/artifacts/types.ts":{"bytes":9012,"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/artifacts/validation.ts":{"bytes":25422,"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"}],"format":"esm"},"src/artifacts/evidence-graph.ts":{"bytes":9069,"imports":[{"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/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":36,"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":30258,"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"}],"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_SCHEMA_VERSION","XENO_EVIDENCE_GRAPH_SCHEMA_VERSION","XenoBrowserDiffError","xenoArtifactToDiffDocument"],"entryPoint":"src/artifacts/browser.ts","inputs":{"src/artifacts/types.ts":{"bytesInOutput":12},"src/artifacts/browser.ts":{"bytesInOutput":0},"src/artifacts/browser-diff.ts":{"bytesInOutput":4291}},"bytes":4444},"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_FILE_REPOSITORY_SCHEMA_VERSION","XENO_ARTIFACT_SCHEMA_VERSION","XENO_EVIDENCE_GRAPH_SCHEMA_VERSION","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":13},"src/artifacts/index.ts":{"bytesInOutput":0},"src/artifacts/validation.ts":{"bytesInOutput":14203},"src/artifacts/hash.ts":{"bytesInOutput":718},"src/artifacts/evidence-graph.ts":{"bytesInOutput":4720},"src/artifacts/repository.ts":{"bytesInOutput":13741},"src/artifacts/file-repository.ts":{"bytesInOutput":6731},"src/control-plane/lock.ts":{"bytesInOutput":1054},"src/version.ts":{"bytesInOutput":15},"src/artifacts/diff-artifact.ts":{"bytesInOutput":7840},"src/artifacts/review-service.ts":{"bytesInOutput":3918},"src/artifacts/spec-lifecycle.ts":{"bytesInOutput":14020},"src/artifacts/multi-agent-review.ts":{"bytesInOutput":14187},"src/artifacts/legacy-adapters.ts":{"bytesInOutput":4989}},"bytes":88069}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/automation/types.ts":{"bytes":
|
|
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":22776,"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":9012,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25422,"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"}],"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":18774},"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/hash.ts":{"bytesInOutput":129},"src/artifacts/validation.ts":{"bytesInOutput":52},"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":64106}}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"src/automation/types.ts":{"bytes":
|
|
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":22776,"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":9012,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1489,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25422,"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"}],"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":18774},"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/hash.ts":{"bytesInOutput":126},"src/artifacts/validation.ts":{"bytesInOutput":52},"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":62997}}}
|