@xenosystem/agent-sdk 0.9.38 → 0.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/artifacts/browser.cjs +1 -1
- package/dist/artifacts/browser.d.cts +2 -2
- package/dist/artifacts/browser.d.ts +2 -2
- package/dist/artifacts/browser.js +1 -1
- package/dist/artifacts/{diff-artifact-CmhmeSu5.d.cts → diff-artifact--7QTtOxh.d.cts} +2 -1
- package/dist/artifacts/{diff-artifact-CmhmeSu5.d.ts → diff-artifact--7QTtOxh.d.ts} +2 -1
- package/dist/artifacts/index.cjs +10 -9
- package/dist/artifacts/index.d.cts +94 -3
- package/dist/artifacts/index.d.ts +94 -3
- package/dist/artifacts/index.js +10 -9
- package/dist/artifacts/metafile-cjs.json +1 -1
- package/dist/artifacts/metafile-esm.json +1 -1
- package/dist/automation/index.cjs +2 -2
- package/dist/automation/index.d.cts +2 -1
- package/dist/automation/index.d.ts +2 -1
- package/dist/automation/index.js +2 -2
- package/dist/automation/metafile-cjs.json +1 -1
- package/dist/automation/metafile-esm.json +1 -1
- package/dist/control-plane/index.cjs +8 -7
- package/dist/control-plane/index.d.cts +185 -1
- package/dist/control-plane/index.d.ts +185 -1
- package/dist/control-plane/index.js +8 -7
- package/dist/control-plane/metafile-cjs.json +1 -1
- package/dist/control-plane/metafile-esm.json +1 -1
- package/dist/coordination/index.cjs +2 -2
- package/dist/coordination/index.d.cts +85 -2
- package/dist/coordination/index.d.ts +85 -2
- package/dist/coordination/index.js +2 -2
- package/dist/coordination/metafile-cjs.json +1 -1
- package/dist/coordination/metafile-esm.json +1 -1
- package/dist/electron/index.cjs +183 -176
- package/dist/electron/index.d.cts +7 -1
- package/dist/electron/index.d.ts +7 -1
- package/dist/electron/index.js +183 -176
- package/dist/electron/metafile-cjs.json +1 -1
- package/dist/electron/metafile-esm.json +1 -1
- package/dist/index.cjs +348 -341
- package/dist/index.d.cts +461 -5
- package/dist/index.d.ts +461 -5
- package/dist/index.js +348 -341
- package/dist/metafile-cjs.json +1 -1
- package/dist/metafile-esm.json +1 -1
- package/dist/oracle/index.cjs +1 -1
- package/dist/oracle/index.d.cts +2 -1
- package/dist/oracle/index.d.ts +2 -1
- package/dist/oracle/index.js +1 -1
- package/dist/oracle/metafile-cjs.json +1 -1
- package/dist/oracle/metafile-esm.json +1 -1
- package/dist/recipes/index.cjs +2 -2
- package/dist/recipes/index.js +2 -2
- package/dist/recipes/metafile-cjs.json +1 -1
- package/dist/recipes/metafile-esm.json +1 -1
- package/dist/research/index.cjs +3 -3
- package/dist/research/index.d.cts +2 -1
- package/dist/research/index.d.ts +2 -1
- package/dist/research/index.js +3 -3
- package/dist/research/metafile-cjs.json +1 -1
- package/dist/research/metafile-esm.json +1 -1
- package/dist/session/index.cjs +15 -15
- package/dist/session/index.d.cts +7 -1
- package/dist/session/index.d.ts +7 -1
- package/dist/session/index.js +9 -9
- package/dist/session/metafile-cjs.json +1 -1
- package/dist/session/metafile-esm.json +1 -1
- package/dist/ui/index.cjs +3 -3
- package/dist/ui/index.js +2 -2
- package/dist/ui/metafile-cjs.json +1 -1
- package/dist/ui/metafile-esm.json +1 -1
- package/ownership/audit.mjs +6 -0
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var y=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var r in t)y(e,r,{get:t[r],enumerable:!0})},k=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of v(t))!D.call(e,o)&&o!==r&&y(e,o,{get:()=>t[o],enumerable:!(i=S(t,o))||i.enumerable});return e};var x=e=>k(y({},"__esModule",{value:!0}),e);var K={};R(K,{XENO_ARTIFACT_ACTOR_KINDS:()=>$,XENO_ARTIFACT_SCHEMA_VERSION:()=>G,XENO_ARTIFACT_SENSITIVITIES:()=>O,XENO_ARTIFACT_STATES:()=>T,XENO_BUILTIN_ARTIFACT_KINDS:()=>N,XENO_EVIDENCE_EDGE_TYPES:()=>C,XENO_EVIDENCE_GRAPH_SCHEMA_VERSION:()=>U,XENO_EVIDENCE_NODE_TYPES:()=>L,XenoBrowserDiffError:()=>m,xenoArtifactToDiffDocument:()=>q});module.exports=x(K);var G=1,U=1,N=["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"],T=["draft","pending_review","approved","rejected","superseded","archived"],O=["public","internal","confidential","restricted"],$=["agent","tool","user","system","integration"],L=["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"],C=["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"];var V=new Set(["working-tree","staged","turn","commit","preview"]),F=new Set(["added","modified","deleted","renamed","copied","binary"]),P=new Set(["context","addition","deletion","no-newline"]),A=16*1024*1024,l=5e3,I=1e5,h=1e6;function q(e){if(!e||typeof e!="object")throw new TypeError("Artifact is required");if(e.kind!=="diff"&&e.kind!=="patch")throw new TypeError("Artifact is not a diff or patch");let t=e.content?.storage;if(!t||t.type!=="inline"||typeof t.text!="string")throw new TypeError("Diff artifact content is not available inline");if(b(t.text)>A)throw new m(`Diff artifact exceeds ${A} bytes`);let r;try{r=JSON.parse(t.text)}catch{throw new m("Diff artifact JSON is malformed")}if(!X(r))throw new m("Diff artifact document is invalid");let i=H(r);return structuredClone(i)}var m=class extends Error{code="XENO_DIFF_INVALID";constructor(t){super(t),this.name="XenoBrowserDiffError"}};function H(e){e.schemaVersion!==1&&n("schemaVersion must be 1"),(typeof e.mode!="string"||!V.has(e.mode))&&n("mode is invalid"),typeof e.rawDiff!="string"&&n("rawDiff is required"),b(e.rawDiff)>A&&n(`rawDiff exceeds ${A} bytes`),(!Array.isArray(e.files)||e.files.length>l)&&n(`files must contain at most ${l} entries`);let t=e.files.map((a,f)=>M(a,f)),r=t.reduce((a,f)=>a+f.hunks.length,0),i=t.reduce((a,f)=>a+f.hunks.reduce((w,_)=>w+_.lines.length,0),0);r>I&&n(`diff exceeds ${I} hunks`),i>h&&n(`diff exceeds ${h} lines`);let o=g(e.additions,"additions"),p=g(e.deletions,"deletions"),c=t.reduce((a,f)=>a+f.additions,0),s=t.reduce((a,f)=>a+f.deletions,0);return(o!==c||p!==s)&&n("diff totals do not match file totals"),{schemaVersion:1,mode:e.mode,...d(e.repositoryId)?{repositoryId:d(e.repositoryId)}:{},...d(e.baseRef)?{baseRef:d(e.baseRef)}:{},...d(e.headRef)?{headRef:d(e.headRef)}:{},files:t,additions:o,deletions:p,rawDiff:e.rawDiff}}function M(e,t){X(e)||n(`files[${t}] is invalid`);let r=E(e.displayPath,`files[${t}].displayPath`,8192);(typeof e.status!="string"||!F.has(e.status))&&n(`files[${t}].status is invalid`),typeof e.binary!="boolean"&&n(`files[${t}].binary must be boolean`),(!Array.isArray(e.headerLines)||e.headerLines.some(c=>typeof c!="string"))&&n(`files[${t}].headerLines is invalid`),Array.isArray(e.hunks)||n(`files[${t}].hunks is invalid`);let i=e.hunks.map((c,s)=>j(c,t,s)),o=g(e.additions,`files[${t}].additions`),p=g(e.deletions,`files[${t}].deletions`);return(o!==i.reduce((c,s)=>c+s.additions,0)||p!==i.reduce((c,s)=>c+s.deletions,0))&&n(`files[${t}] totals do not match hunks`),{...d(e.oldPath)?{oldPath:d(e.oldPath)}:{},...d(e.newPath)?{newPath:d(e.newPath)}:{},displayPath:r,status:e.status,additions:o,deletions:p,binary:e.binary,headerLines:[...e.headerLines],hunks:i}}function j(e,t,r){X(e)||n(`files[${t}].hunks[${r}] is invalid`);let i=`files[${t}].hunks[${r}]`;Array.isArray(e.lines)||n(`${i}.lines is invalid`);let o=e.lines.map((s,a)=>J(s,`${i}.lines[${a}]`)),p=g(e.additions,`${i}.additions`),c=g(e.deletions,`${i}.deletions`);return(p!==o.filter(s=>s.kind==="addition").length||c!==o.filter(s=>s.kind==="deletion").length)&&n(`${i} totals do not match lines`),{hunkId:E(e.hunkId,`${i}.hunkId`,512),header:E(e.header,`${i}.header`,8192),...d(e.section)?{section:d(e.section)}:{},oldStart:u(e.oldStart,`${i}.oldStart`),oldLines:g(e.oldLines,`${i}.oldLines`),newStart:u(e.newStart,`${i}.newStart`),newLines:g(e.newLines,`${i}.newLines`),additions:p,deletions:c,lines:o}}function J(e,t){return X(e)||n(`${t} is invalid`),(typeof e.kind!="string"||!P.has(e.kind))&&n(`${t}.kind is invalid`),typeof e.text!="string"&&n(`${t}.text is required`),{kind:e.kind,text:e.text,...e.oldLine!==void 0?{oldLine:u(e.oldLine,`${t}.oldLine`)}:{},...e.newLine!==void 0?{newLine:u(e.newLine,`${t}.newLine`)}:{}}}function X(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function E(e,t,r){return(typeof e!="string"||e.length===0||e.length>r||e.includes("\0"))&&n(`${t} is invalid`),e}function d(e){return typeof e=="string"&&e.length>0&&e.length<=8192&&!e.includes("\0")?e:void 0}function g(e,t){return(!Number.isSafeInteger(e)||e<0)&&n(`${t} must be a non-negative integer`),e}function u(e,t){return(!Number.isSafeInteger(e)||e<1)&&n(`${t} must be a positive integer`),e}function b(e){return new TextEncoder().encode(e).byteLength}function n(e){throw new m(e)}0&&(module.exports={XENO_ARTIFACT_ACTOR_KINDS,XENO_ARTIFACT_SCHEMA_VERSION,XENO_ARTIFACT_SENSITIVITIES,XENO_ARTIFACT_STATES,XENO_BUILTIN_ARTIFACT_KINDS,XENO_EVIDENCE_EDGE_TYPES,XENO_EVIDENCE_GRAPH_SCHEMA_VERSION,XENO_EVIDENCE_NODE_TYPES,XenoBrowserDiffError,xenoArtifactToDiffDocument});
|
|
1
|
+
"use strict";var y=Object.defineProperty;var S=Object.getOwnPropertyDescriptor;var v=Object.getOwnPropertyNames;var D=Object.prototype.hasOwnProperty;var R=(e,t)=>{for(var r in t)y(e,r,{get:t[r],enumerable:!0})},k=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of v(t))!D.call(e,o)&&o!==r&&y(e,o,{get:()=>t[o],enumerable:!(i=S(t,o))||i.enumerable});return e};var x=e=>k(y({},"__esModule",{value:!0}),e);var K={};R(K,{XENO_ARTIFACT_ACTOR_KINDS:()=>$,XENO_ARTIFACT_SCHEMA_VERSION:()=>G,XENO_ARTIFACT_SENSITIVITIES:()=>O,XENO_ARTIFACT_STATES:()=>T,XENO_BUILTIN_ARTIFACT_KINDS:()=>N,XENO_EVIDENCE_EDGE_TYPES:()=>C,XENO_EVIDENCE_GRAPH_SCHEMA_VERSION:()=>U,XENO_EVIDENCE_NODE_TYPES:()=>L,XenoBrowserDiffError:()=>m,xenoArtifactToDiffDocument:()=>q});module.exports=x(K);var G=1,U=1,N=["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","page"],T=["draft","pending_review","approved","rejected","superseded","archived"],O=["public","internal","confidential","restricted"],$=["agent","tool","user","system","integration"],L=["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"],C=["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"];var V=new Set(["working-tree","staged","turn","commit","preview"]),F=new Set(["added","modified","deleted","renamed","copied","binary"]),P=new Set(["context","addition","deletion","no-newline"]),A=16*1024*1024,l=5e3,I=1e5,h=1e6;function q(e){if(!e||typeof e!="object")throw new TypeError("Artifact is required");if(e.kind!=="diff"&&e.kind!=="patch")throw new TypeError("Artifact is not a diff or patch");let t=e.content?.storage;if(!t||t.type!=="inline"||typeof t.text!="string")throw new TypeError("Diff artifact content is not available inline");if(b(t.text)>A)throw new m(`Diff artifact exceeds ${A} bytes`);let r;try{r=JSON.parse(t.text)}catch{throw new m("Diff artifact JSON is malformed")}if(!X(r))throw new m("Diff artifact document is invalid");let i=H(r);return structuredClone(i)}var m=class extends Error{code="XENO_DIFF_INVALID";constructor(t){super(t),this.name="XenoBrowserDiffError"}};function H(e){e.schemaVersion!==1&&n("schemaVersion must be 1"),(typeof e.mode!="string"||!V.has(e.mode))&&n("mode is invalid"),typeof e.rawDiff!="string"&&n("rawDiff is required"),b(e.rawDiff)>A&&n(`rawDiff exceeds ${A} bytes`),(!Array.isArray(e.files)||e.files.length>l)&&n(`files must contain at most ${l} entries`);let t=e.files.map((a,f)=>M(a,f)),r=t.reduce((a,f)=>a+f.hunks.length,0),i=t.reduce((a,f)=>a+f.hunks.reduce((w,_)=>w+_.lines.length,0),0);r>I&&n(`diff exceeds ${I} hunks`),i>h&&n(`diff exceeds ${h} lines`);let o=g(e.additions,"additions"),p=g(e.deletions,"deletions"),c=t.reduce((a,f)=>a+f.additions,0),s=t.reduce((a,f)=>a+f.deletions,0);return(o!==c||p!==s)&&n("diff totals do not match file totals"),{schemaVersion:1,mode:e.mode,...d(e.repositoryId)?{repositoryId:d(e.repositoryId)}:{},...d(e.baseRef)?{baseRef:d(e.baseRef)}:{},...d(e.headRef)?{headRef:d(e.headRef)}:{},files:t,additions:o,deletions:p,rawDiff:e.rawDiff}}function M(e,t){X(e)||n(`files[${t}] is invalid`);let r=E(e.displayPath,`files[${t}].displayPath`,8192);(typeof e.status!="string"||!F.has(e.status))&&n(`files[${t}].status is invalid`),typeof e.binary!="boolean"&&n(`files[${t}].binary must be boolean`),(!Array.isArray(e.headerLines)||e.headerLines.some(c=>typeof c!="string"))&&n(`files[${t}].headerLines is invalid`),Array.isArray(e.hunks)||n(`files[${t}].hunks is invalid`);let i=e.hunks.map((c,s)=>j(c,t,s)),o=g(e.additions,`files[${t}].additions`),p=g(e.deletions,`files[${t}].deletions`);return(o!==i.reduce((c,s)=>c+s.additions,0)||p!==i.reduce((c,s)=>c+s.deletions,0))&&n(`files[${t}] totals do not match hunks`),{...d(e.oldPath)?{oldPath:d(e.oldPath)}:{},...d(e.newPath)?{newPath:d(e.newPath)}:{},displayPath:r,status:e.status,additions:o,deletions:p,binary:e.binary,headerLines:[...e.headerLines],hunks:i}}function j(e,t,r){X(e)||n(`files[${t}].hunks[${r}] is invalid`);let i=`files[${t}].hunks[${r}]`;Array.isArray(e.lines)||n(`${i}.lines is invalid`);let o=e.lines.map((s,a)=>J(s,`${i}.lines[${a}]`)),p=g(e.additions,`${i}.additions`),c=g(e.deletions,`${i}.deletions`);return(p!==o.filter(s=>s.kind==="addition").length||c!==o.filter(s=>s.kind==="deletion").length)&&n(`${i} totals do not match lines`),{hunkId:E(e.hunkId,`${i}.hunkId`,512),header:E(e.header,`${i}.header`,8192),...d(e.section)?{section:d(e.section)}:{},oldStart:u(e.oldStart,`${i}.oldStart`),oldLines:g(e.oldLines,`${i}.oldLines`),newStart:u(e.newStart,`${i}.newStart`),newLines:g(e.newLines,`${i}.newLines`),additions:p,deletions:c,lines:o}}function J(e,t){return X(e)||n(`${t} is invalid`),(typeof e.kind!="string"||!P.has(e.kind))&&n(`${t}.kind is invalid`),typeof e.text!="string"&&n(`${t}.text is required`),{kind:e.kind,text:e.text,...e.oldLine!==void 0?{oldLine:u(e.oldLine,`${t}.oldLine`)}:{},...e.newLine!==void 0?{newLine:u(e.newLine,`${t}.newLine`)}:{}}}function X(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function E(e,t,r){return(typeof e!="string"||e.length===0||e.length>r||e.includes("\0"))&&n(`${t} is invalid`),e}function d(e){return typeof e=="string"&&e.length>0&&e.length<=8192&&!e.includes("\0")?e:void 0}function g(e,t){return(!Number.isSafeInteger(e)||e<0)&&n(`${t} must be a non-negative integer`),e}function u(e,t){return(!Number.isSafeInteger(e)||e<1)&&n(`${t} must be a positive integer`),e}function b(e){return new TextEncoder().encode(e).byteLength}function n(e){throw new m(e)}0&&(module.exports={XENO_ARTIFACT_ACTOR_KINDS,XENO_ARTIFACT_SCHEMA_VERSION,XENO_ARTIFACT_SENSITIVITIES,XENO_ARTIFACT_STATES,XENO_BUILTIN_ARTIFACT_KINDS,XENO_EVIDENCE_EDGE_TYPES,XENO_EVIDENCE_GRAPH_SCHEMA_VERSION,XENO_EVIDENCE_NODE_TYPES,XenoBrowserDiffError,xenoArtifactToDiffDocument});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as XenoArtifactEnvelope, a as XenoDiffDocument } from "./diff-artifact
|
|
2
|
-
export { b as XENO_ARTIFACT_ACTOR_KINDS, c as XENO_ARTIFACT_SCHEMA_VERSION, d as XENO_ARTIFACT_SENSITIVITIES, e as XENO_ARTIFACT_STATES, f as XENO_BUILTIN_ARTIFACT_KINDS, g as XENO_EVIDENCE_EDGE_TYPES, h as XENO_EVIDENCE_GRAPH_SCHEMA_VERSION, i as XENO_EVIDENCE_NODE_TYPES, j as XenoArtifactActor, k as XenoArtifactActorKind, l as XenoArtifactAnchor, m as XenoArtifactContent, n as XenoArtifactIdentity, o as XenoArtifactKind, p as XenoArtifactLifecycleEvent, q as XenoArtifactListQuery, r as XenoArtifactProvenance, s as XenoArtifactRecord, t as XenoArtifactRelationship, u as XenoArtifactRetention, v as XenoArtifactReviewDecision, w as XenoArtifactReviewEvent, x as XenoArtifactReviewEventInput, y as XenoArtifactReviewSummary, z as XenoArtifactSensitivity, A as XenoArtifactState, B as XenoArtifactStorageReference, C as XenoContentHash, D as XenoDiffFile, E as XenoDiffFileStatus, F as XenoDiffHunk, G as XenoDiffLine, H as XenoDiffLineKind, I as XenoDiffMode, J as XenoEvidenceEdge, K as XenoEvidenceEdgeType, L as XenoEvidenceGraph, M as XenoEvidenceNode, N as XenoEvidenceNodeType, O as XenoEvidenceReference, P as XenoJsonObject, Q as XenoJsonPrimitive, R as XenoJsonValue } from "./diff-artifact
|
|
1
|
+
import { X as XenoArtifactEnvelope, a as XenoDiffDocument } from "./diff-artifact--7QTtOxh.cjs";
|
|
2
|
+
export { b as XENO_ARTIFACT_ACTOR_KINDS, c as XENO_ARTIFACT_SCHEMA_VERSION, d as XENO_ARTIFACT_SENSITIVITIES, e as XENO_ARTIFACT_STATES, f as XENO_BUILTIN_ARTIFACT_KINDS, g as XENO_EVIDENCE_EDGE_TYPES, h as XENO_EVIDENCE_GRAPH_SCHEMA_VERSION, i as XENO_EVIDENCE_NODE_TYPES, j as XenoArtifactActor, k as XenoArtifactActorKind, l as XenoArtifactAnchor, m as XenoArtifactContent, n as XenoArtifactIdentity, o as XenoArtifactKind, p as XenoArtifactLifecycleEvent, q as XenoArtifactListQuery, r as XenoArtifactProvenance, s as XenoArtifactRecord, t as XenoArtifactRelationship, u as XenoArtifactRetention, v as XenoArtifactReviewDecision, w as XenoArtifactReviewEvent, x as XenoArtifactReviewEventInput, y as XenoArtifactReviewSummary, z as XenoArtifactSensitivity, A as XenoArtifactState, B as XenoArtifactStorageReference, C as XenoContentHash, D as XenoDiffFile, E as XenoDiffFileStatus, F as XenoDiffHunk, G as XenoDiffLine, H as XenoDiffLineKind, I as XenoDiffMode, J as XenoEvidenceEdge, K as XenoEvidenceEdgeType, L as XenoEvidenceGraph, M as XenoEvidenceNode, N as XenoEvidenceNodeType, O as XenoEvidenceReference, P as XenoJsonObject, Q as XenoJsonPrimitive, R as XenoJsonValue } from "./diff-artifact--7QTtOxh.cjs";
|
|
3
3
|
declare function xenoArtifactToDiffDocument(artifact: XenoArtifactEnvelope): XenoDiffDocument;
|
|
4
4
|
declare class XenoBrowserDiffError extends Error {
|
|
5
5
|
readonly code = "XENO_DIFF_INVALID";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { X as XenoArtifactEnvelope, a as XenoDiffDocument } from "./diff-artifact
|
|
2
|
-
export { b as XENO_ARTIFACT_ACTOR_KINDS, c as XENO_ARTIFACT_SCHEMA_VERSION, d as XENO_ARTIFACT_SENSITIVITIES, e as XENO_ARTIFACT_STATES, f as XENO_BUILTIN_ARTIFACT_KINDS, g as XENO_EVIDENCE_EDGE_TYPES, h as XENO_EVIDENCE_GRAPH_SCHEMA_VERSION, i as XENO_EVIDENCE_NODE_TYPES, j as XenoArtifactActor, k as XenoArtifactActorKind, l as XenoArtifactAnchor, m as XenoArtifactContent, n as XenoArtifactIdentity, o as XenoArtifactKind, p as XenoArtifactLifecycleEvent, q as XenoArtifactListQuery, r as XenoArtifactProvenance, s as XenoArtifactRecord, t as XenoArtifactRelationship, u as XenoArtifactRetention, v as XenoArtifactReviewDecision, w as XenoArtifactReviewEvent, x as XenoArtifactReviewEventInput, y as XenoArtifactReviewSummary, z as XenoArtifactSensitivity, A as XenoArtifactState, B as XenoArtifactStorageReference, C as XenoContentHash, D as XenoDiffFile, E as XenoDiffFileStatus, F as XenoDiffHunk, G as XenoDiffLine, H as XenoDiffLineKind, I as XenoDiffMode, J as XenoEvidenceEdge, K as XenoEvidenceEdgeType, L as XenoEvidenceGraph, M as XenoEvidenceNode, N as XenoEvidenceNodeType, O as XenoEvidenceReference, P as XenoJsonObject, Q as XenoJsonPrimitive, R as XenoJsonValue } from "./diff-artifact
|
|
1
|
+
import { X as XenoArtifactEnvelope, a as XenoDiffDocument } from "./diff-artifact--7QTtOxh.js";
|
|
2
|
+
export { b as XENO_ARTIFACT_ACTOR_KINDS, c as XENO_ARTIFACT_SCHEMA_VERSION, d as XENO_ARTIFACT_SENSITIVITIES, e as XENO_ARTIFACT_STATES, f as XENO_BUILTIN_ARTIFACT_KINDS, g as XENO_EVIDENCE_EDGE_TYPES, h as XENO_EVIDENCE_GRAPH_SCHEMA_VERSION, i as XENO_EVIDENCE_NODE_TYPES, j as XenoArtifactActor, k as XenoArtifactActorKind, l as XenoArtifactAnchor, m as XenoArtifactContent, n as XenoArtifactIdentity, o as XenoArtifactKind, p as XenoArtifactLifecycleEvent, q as XenoArtifactListQuery, r as XenoArtifactProvenance, s as XenoArtifactRecord, t as XenoArtifactRelationship, u as XenoArtifactRetention, v as XenoArtifactReviewDecision, w as XenoArtifactReviewEvent, x as XenoArtifactReviewEventInput, y as XenoArtifactReviewSummary, z as XenoArtifactSensitivity, A as XenoArtifactState, B as XenoArtifactStorageReference, C as XenoContentHash, D as XenoDiffFile, E as XenoDiffFileStatus, F as XenoDiffHunk, G as XenoDiffLine, H as XenoDiffLineKind, I as XenoDiffMode, J as XenoEvidenceEdge, K as XenoEvidenceEdgeType, L as XenoEvidenceGraph, M as XenoEvidenceNode, N as XenoEvidenceNodeType, O as XenoEvidenceReference, P as XenoJsonObject, Q as XenoJsonPrimitive, R as XenoJsonValue } from "./diff-artifact--7QTtOxh.js";
|
|
3
3
|
declare function xenoArtifactToDiffDocument(artifact: XenoArtifactEnvelope): XenoDiffDocument;
|
|
4
4
|
declare class XenoBrowserDiffError extends Error {
|
|
5
5
|
readonly code = "XENO_DIFF_INVALID";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var N=1,T=1,O=["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"],$=["draft","pending_review","approved","rejected","superseded","archived"],L=["public","internal","confidential","restricted"],C=["agent","tool","user","system","integration"],V=["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"],F=["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"];var _=new Set(["working-tree","staged","turn","commit","preview"]),S=new Set(["added","modified","deleted","renamed","copied","binary"]),v=new Set(["context","addition","deletion","no-newline"]),A=16*1024*1024,E=5e3,l=1e5,I=1e6;function q(e){if(!e||typeof e!="object")throw new TypeError("Artifact is required");if(e.kind!=="diff"&&e.kind!=="patch")throw new TypeError("Artifact is not a diff or patch");let t=e.content?.storage;if(!t||t.type!=="inline"||typeof t.text!="string")throw new TypeError("Diff artifact content is not available inline");if(h(t.text)>A)throw new m(`Diff artifact exceeds ${A} bytes`);let o;try{o=JSON.parse(t.text)}catch{throw new m("Diff artifact JSON is malformed")}if(!X(o))throw new m("Diff artifact document is invalid");let i=D(o);return structuredClone(i)}var m=class extends Error{code="XENO_DIFF_INVALID";constructor(t){super(t),this.name="XenoBrowserDiffError"}};function D(e){e.schemaVersion!==1&&n("schemaVersion must be 1"),(typeof e.mode!="string"||!_.has(e.mode))&&n("mode is invalid"),typeof e.rawDiff!="string"&&n("rawDiff is required"),h(e.rawDiff)>A&&n(`rawDiff exceeds ${A} bytes`),(!Array.isArray(e.files)||e.files.length>E)&&n(`files must contain at most ${E} entries`);let t=e.files.map((d,f)=>R(d,f)),o=t.reduce((d,f)=>d+f.hunks.length,0),i=t.reduce((d,f)=>d+f.hunks.reduce((b,w)=>b+w.lines.length,0),0);o>l&&n(`diff exceeds ${l} hunks`),i>I&&n(`diff exceeds ${I} lines`);let a=g(e.additions,"additions"),p=g(e.deletions,"deletions"),s=t.reduce((d,f)=>d+f.additions,0),r=t.reduce((d,f)=>d+f.deletions,0);return(a!==s||p!==r)&&n("diff totals do not match file totals"),{schemaVersion:1,mode:e.mode,...c(e.repositoryId)?{repositoryId:c(e.repositoryId)}:{},...c(e.baseRef)?{baseRef:c(e.baseRef)}:{},...c(e.headRef)?{headRef:c(e.headRef)}:{},files:t,additions:a,deletions:p,rawDiff:e.rawDiff}}function R(e,t){X(e)||n(`files[${t}] is invalid`);let o=y(e.displayPath,`files[${t}].displayPath`,8192);(typeof e.status!="string"||!S.has(e.status))&&n(`files[${t}].status is invalid`),typeof e.binary!="boolean"&&n(`files[${t}].binary must be boolean`),(!Array.isArray(e.headerLines)||e.headerLines.some(s=>typeof s!="string"))&&n(`files[${t}].headerLines is invalid`),Array.isArray(e.hunks)||n(`files[${t}].hunks is invalid`);let i=e.hunks.map((s,r)=>k(s,t,r)),a=g(e.additions,`files[${t}].additions`),p=g(e.deletions,`files[${t}].deletions`);return(a!==i.reduce((s,r)=>s+r.additions,0)||p!==i.reduce((s,r)=>s+r.deletions,0))&&n(`files[${t}] totals do not match hunks`),{...c(e.oldPath)?{oldPath:c(e.oldPath)}:{},...c(e.newPath)?{newPath:c(e.newPath)}:{},displayPath:o,status:e.status,additions:a,deletions:p,binary:e.binary,headerLines:[...e.headerLines],hunks:i}}function k(e,t,o){X(e)||n(`files[${t}].hunks[${o}] is invalid`);let i=`files[${t}].hunks[${o}]`;Array.isArray(e.lines)||n(`${i}.lines is invalid`);let a=e.lines.map((r,d)=>x(r,`${i}.lines[${d}]`)),p=g(e.additions,`${i}.additions`),s=g(e.deletions,`${i}.deletions`);return(p!==a.filter(r=>r.kind==="addition").length||s!==a.filter(r=>r.kind==="deletion").length)&&n(`${i} totals do not match lines`),{hunkId:y(e.hunkId,`${i}.hunkId`,512),header:y(e.header,`${i}.header`,8192),...c(e.section)?{section:c(e.section)}:{},oldStart:u(e.oldStart,`${i}.oldStart`),oldLines:g(e.oldLines,`${i}.oldLines`),newStart:u(e.newStart,`${i}.newStart`),newLines:g(e.newLines,`${i}.newLines`),additions:p,deletions:s,lines:a}}function x(e,t){return X(e)||n(`${t} is invalid`),(typeof e.kind!="string"||!v.has(e.kind))&&n(`${t}.kind is invalid`),typeof e.text!="string"&&n(`${t}.text is required`),{kind:e.kind,text:e.text,...e.oldLine!==void 0?{oldLine:u(e.oldLine,`${t}.oldLine`)}:{},...e.newLine!==void 0?{newLine:u(e.newLine,`${t}.newLine`)}:{}}}function X(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function y(e,t,o){return(typeof e!="string"||e.length===0||e.length>o||e.includes("\0"))&&n(`${t} is invalid`),e}function c(e){return typeof e=="string"&&e.length>0&&e.length<=8192&&!e.includes("\0")?e:void 0}function g(e,t){return(!Number.isSafeInteger(e)||e<0)&&n(`${t} must be a non-negative integer`),e}function u(e,t){return(!Number.isSafeInteger(e)||e<1)&&n(`${t} must be a positive integer`),e}function h(e){return new TextEncoder().encode(e).byteLength}function n(e){throw new m(e)}export{C as XENO_ARTIFACT_ACTOR_KINDS,N as XENO_ARTIFACT_SCHEMA_VERSION,L as XENO_ARTIFACT_SENSITIVITIES,$ as XENO_ARTIFACT_STATES,O as XENO_BUILTIN_ARTIFACT_KINDS,F as XENO_EVIDENCE_EDGE_TYPES,T as XENO_EVIDENCE_GRAPH_SCHEMA_VERSION,V as XENO_EVIDENCE_NODE_TYPES,m as XenoBrowserDiffError,q as xenoArtifactToDiffDocument};
|
|
1
|
+
var N=1,T=1,O=["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","page"],$=["draft","pending_review","approved","rejected","superseded","archived"],L=["public","internal","confidential","restricted"],C=["agent","tool","user","system","integration"],V=["requirement","design-decision","risk","task","agent","run","tool-call","edit","commit","test-case","test-run","finding","approval","artifact","release","claim"],F=["decomposes","depends_on","implements","changes","tests","verifies","finds","fixes","reviews","approves","rejects","supersedes","derived_from","produced_by","supports_claim","contradicts_claim","released_as"];var _=new Set(["working-tree","staged","turn","commit","preview"]),S=new Set(["added","modified","deleted","renamed","copied","binary"]),v=new Set(["context","addition","deletion","no-newline"]),A=16*1024*1024,E=5e3,l=1e5,I=1e6;function q(e){if(!e||typeof e!="object")throw new TypeError("Artifact is required");if(e.kind!=="diff"&&e.kind!=="patch")throw new TypeError("Artifact is not a diff or patch");let t=e.content?.storage;if(!t||t.type!=="inline"||typeof t.text!="string")throw new TypeError("Diff artifact content is not available inline");if(h(t.text)>A)throw new m(`Diff artifact exceeds ${A} bytes`);let o;try{o=JSON.parse(t.text)}catch{throw new m("Diff artifact JSON is malformed")}if(!X(o))throw new m("Diff artifact document is invalid");let i=D(o);return structuredClone(i)}var m=class extends Error{code="XENO_DIFF_INVALID";constructor(t){super(t),this.name="XenoBrowserDiffError"}};function D(e){e.schemaVersion!==1&&n("schemaVersion must be 1"),(typeof e.mode!="string"||!_.has(e.mode))&&n("mode is invalid"),typeof e.rawDiff!="string"&&n("rawDiff is required"),h(e.rawDiff)>A&&n(`rawDiff exceeds ${A} bytes`),(!Array.isArray(e.files)||e.files.length>E)&&n(`files must contain at most ${E} entries`);let t=e.files.map((d,f)=>R(d,f)),o=t.reduce((d,f)=>d+f.hunks.length,0),i=t.reduce((d,f)=>d+f.hunks.reduce((b,w)=>b+w.lines.length,0),0);o>l&&n(`diff exceeds ${l} hunks`),i>I&&n(`diff exceeds ${I} lines`);let a=g(e.additions,"additions"),p=g(e.deletions,"deletions"),s=t.reduce((d,f)=>d+f.additions,0),r=t.reduce((d,f)=>d+f.deletions,0);return(a!==s||p!==r)&&n("diff totals do not match file totals"),{schemaVersion:1,mode:e.mode,...c(e.repositoryId)?{repositoryId:c(e.repositoryId)}:{},...c(e.baseRef)?{baseRef:c(e.baseRef)}:{},...c(e.headRef)?{headRef:c(e.headRef)}:{},files:t,additions:a,deletions:p,rawDiff:e.rawDiff}}function R(e,t){X(e)||n(`files[${t}] is invalid`);let o=y(e.displayPath,`files[${t}].displayPath`,8192);(typeof e.status!="string"||!S.has(e.status))&&n(`files[${t}].status is invalid`),typeof e.binary!="boolean"&&n(`files[${t}].binary must be boolean`),(!Array.isArray(e.headerLines)||e.headerLines.some(s=>typeof s!="string"))&&n(`files[${t}].headerLines is invalid`),Array.isArray(e.hunks)||n(`files[${t}].hunks is invalid`);let i=e.hunks.map((s,r)=>k(s,t,r)),a=g(e.additions,`files[${t}].additions`),p=g(e.deletions,`files[${t}].deletions`);return(a!==i.reduce((s,r)=>s+r.additions,0)||p!==i.reduce((s,r)=>s+r.deletions,0))&&n(`files[${t}] totals do not match hunks`),{...c(e.oldPath)?{oldPath:c(e.oldPath)}:{},...c(e.newPath)?{newPath:c(e.newPath)}:{},displayPath:o,status:e.status,additions:a,deletions:p,binary:e.binary,headerLines:[...e.headerLines],hunks:i}}function k(e,t,o){X(e)||n(`files[${t}].hunks[${o}] is invalid`);let i=`files[${t}].hunks[${o}]`;Array.isArray(e.lines)||n(`${i}.lines is invalid`);let a=e.lines.map((r,d)=>x(r,`${i}.lines[${d}]`)),p=g(e.additions,`${i}.additions`),s=g(e.deletions,`${i}.deletions`);return(p!==a.filter(r=>r.kind==="addition").length||s!==a.filter(r=>r.kind==="deletion").length)&&n(`${i} totals do not match lines`),{hunkId:y(e.hunkId,`${i}.hunkId`,512),header:y(e.header,`${i}.header`,8192),...c(e.section)?{section:c(e.section)}:{},oldStart:u(e.oldStart,`${i}.oldStart`),oldLines:g(e.oldLines,`${i}.oldLines`),newStart:u(e.newStart,`${i}.newStart`),newLines:g(e.newLines,`${i}.newLines`),additions:p,deletions:s,lines:a}}function x(e,t){return X(e)||n(`${t} is invalid`),(typeof e.kind!="string"||!v.has(e.kind))&&n(`${t}.kind is invalid`),typeof e.text!="string"&&n(`${t}.text is required`),{kind:e.kind,text:e.text,...e.oldLine!==void 0?{oldLine:u(e.oldLine,`${t}.oldLine`)}:{},...e.newLine!==void 0?{newLine:u(e.newLine,`${t}.newLine`)}:{}}}function X(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function y(e,t,o){return(typeof e!="string"||e.length===0||e.length>o||e.includes("\0"))&&n(`${t} is invalid`),e}function c(e){return typeof e=="string"&&e.length>0&&e.length<=8192&&!e.includes("\0")?e:void 0}function g(e,t){return(!Number.isSafeInteger(e)||e<0)&&n(`${t} must be a non-negative integer`),e}function u(e,t){return(!Number.isSafeInteger(e)||e<1)&&n(`${t} must be a positive integer`),e}function h(e){return new TextEncoder().encode(e).byteLength}function n(e){throw new m(e)}export{C as XENO_ARTIFACT_ACTOR_KINDS,N as XENO_ARTIFACT_SCHEMA_VERSION,L as XENO_ARTIFACT_SENSITIVITIES,$ as XENO_ARTIFACT_STATES,O as XENO_BUILTIN_ARTIFACT_KINDS,F as XENO_EVIDENCE_EDGE_TYPES,T as XENO_EVIDENCE_GRAPH_SCHEMA_VERSION,V as XENO_EVIDENCE_NODE_TYPES,m as XenoBrowserDiffError,q as xenoArtifactToDiffDocument};
|
|
@@ -25,7 +25,8 @@ declare const XENO_BUILTIN_ARTIFACT_KINDS: readonly [
|
|
|
25
25
|
"release-report",
|
|
26
26
|
"sbom",
|
|
27
27
|
"provenance",
|
|
28
|
-
"attestation"
|
|
28
|
+
"attestation",
|
|
29
|
+
"page"
|
|
29
30
|
];
|
|
30
31
|
type XenoArtifactKind = (typeof XENO_BUILTIN_ARTIFACT_KINDS)[number] | `custom:${string}`;
|
|
31
32
|
declare const XENO_ARTIFACT_STATES: readonly [
|
|
@@ -25,7 +25,8 @@ declare const XENO_BUILTIN_ARTIFACT_KINDS: readonly [
|
|
|
25
25
|
"release-report",
|
|
26
26
|
"sbom",
|
|
27
27
|
"provenance",
|
|
28
|
-
"attestation"
|
|
28
|
+
"attestation",
|
|
29
|
+
"page"
|
|
29
30
|
];
|
|
30
31
|
type XenoArtifactKind = (typeof XENO_BUILTIN_ARTIFACT_KINDS)[number] | `custom:${string}`;
|
|
31
32
|
declare const XENO_ARTIFACT_STATES: readonly [
|