@xenosystem/agent-sdk 0.10.35 → 0.10.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/README.md +1 -1
  2. package/dist/agents/index.cjs +9 -9
  3. package/dist/agents/index.d.cts +4 -1
  4. package/dist/agents/index.d.ts +4 -1
  5. package/dist/agents/index.js +16 -16
  6. package/dist/agents/metafile-cjs.json +1 -1
  7. package/dist/agents/metafile-esm.json +1 -1
  8. package/dist/artifacts/index.cjs +1 -1
  9. package/dist/artifacts/index.js +1 -1
  10. package/dist/artifacts/metafile-cjs.json +1 -1
  11. package/dist/artifacts/metafile-esm.json +1 -1
  12. package/dist/automation/index.cjs +35 -24
  13. package/dist/automation/index.d.cts +194 -12
  14. package/dist/automation/index.d.ts +194 -12
  15. package/dist/automation/index.js +35 -24
  16. package/dist/automation/metafile-cjs.json +1 -1
  17. package/dist/automation/metafile-esm.json +1 -1
  18. package/dist/control-plane/index.cjs +8 -8
  19. package/dist/control-plane/index.js +8 -8
  20. package/dist/control-plane/metafile-cjs.json +1 -1
  21. package/dist/control-plane/metafile-esm.json +1 -1
  22. package/dist/coordination/index.cjs +2 -2
  23. package/dist/coordination/index.js +2 -2
  24. package/dist/coordination/metafile-cjs.json +1 -1
  25. package/dist/coordination/metafile-esm.json +1 -1
  26. package/dist/electron/index.cjs +243 -223
  27. package/dist/electron/index.d.cts +198 -1
  28. package/dist/electron/index.d.ts +198 -1
  29. package/dist/electron/index.js +243 -223
  30. package/dist/electron/metafile-cjs.json +1 -1
  31. package/dist/electron/metafile-esm.json +1 -1
  32. package/dist/hosted/metafile-cjs.json +1 -1
  33. package/dist/hosted/metafile-esm.json +1 -1
  34. package/dist/index.cjs +406 -395
  35. package/dist/index.d.cts +325 -172
  36. package/dist/index.d.ts +325 -172
  37. package/dist/index.js +406 -395
  38. package/dist/intelligence/index.cjs +4 -4
  39. package/dist/intelligence/index.js +4 -4
  40. package/dist/intelligence/metafile-cjs.json +1 -1
  41. package/dist/intelligence/metafile-esm.json +1 -1
  42. package/dist/mcp/index.cjs +20 -20
  43. package/dist/mcp/index.d.cts +146 -0
  44. package/dist/mcp/index.d.ts +146 -0
  45. package/dist/mcp/index.js +17 -17
  46. package/dist/mcp/metafile-cjs.json +1 -1
  47. package/dist/mcp/metafile-esm.json +1 -1
  48. package/dist/metafile-cjs.json +1 -1
  49. package/dist/metafile-esm.json +1 -1
  50. package/dist/providers/index.cjs +10 -10
  51. package/dist/providers/index.d.cts +49 -5
  52. package/dist/providers/index.d.ts +49 -5
  53. package/dist/providers/index.js +10 -10
  54. package/dist/providers/metafile-cjs.json +1 -1
  55. package/dist/providers/metafile-esm.json +1 -1
  56. package/dist/recipes/metafile-cjs.json +1 -1
  57. package/dist/recipes/metafile-esm.json +1 -1
  58. package/dist/research/metafile-cjs.json +1 -1
  59. package/dist/research/metafile-esm.json +1 -1
  60. package/dist/session/index.cjs +24 -24
  61. package/dist/session/index.js +16 -16
  62. package/dist/session/metafile-cjs.json +1 -1
  63. package/dist/session/metafile-esm.json +1 -1
  64. package/dist/sharing/index.cjs +1 -1
  65. package/dist/sharing/index.js +3 -3
  66. package/dist/sharing/metafile-cjs.json +1 -1
  67. package/dist/sharing/metafile-esm.json +1 -1
  68. package/dist/skills/index.d.cts +6 -0
  69. package/dist/skills/index.d.ts +6 -0
  70. package/dist/utils/index.cjs +24 -24
  71. package/dist/utils/index.d.cts +14 -2
  72. package/dist/utils/index.d.ts +14 -2
  73. package/dist/utils/index.js +24 -24
  74. package/dist/utils/metafile-cjs.json +1 -1
  75. package/dist/utils/metafile-esm.json +1 -1
  76. package/ownership/evidence/PROPRIETARY-PTY-1/implementation-record.md +1 -1
  77. package/ownership/ownership-policy.json +14 -3
  78. package/package.json +1 -1
@@ -27,7 +27,7 @@ declare function writeTextFile(filePath: string, content: string, options?: {
27
27
  lineEnding?: LineEnding;
28
28
  preserveLineEndings?: boolean;
29
29
  }): Promise<void>;
30
- declare function detectPreferredLineEnding(baseDir: string): Promise<LineEnding>;
30
+ declare function detectPreferredLineEnding(baseDir: string, workspaceRoot?: string): Promise<LineEnding>;
31
31
  declare function findSimilarFile(filePath: string, boundary?: string): string | null;
32
32
  declare function readIfExists(filePath: string): Promise<string | null>;
33
33
  declare function existsSync(filePath: string): boolean;
@@ -59,6 +59,7 @@ declare function getConfigDir(): string;
59
59
  declare function getProjectConfigDir(cwd: string): string;
60
60
  declare function getShellName(): string;
61
61
  declare function isGitRepo(cwd: string): boolean;
62
+ declare function isGitRepoAsync(cwd: string): Promise<boolean>;
62
63
  declare function validateRequired(params: Record<string, unknown>, required: string[]): string | null;
63
64
  declare function getString(params: Record<string, unknown>, key: string, defaultValue?: string): string;
64
65
  declare function getNumber(params: Record<string, unknown>, key: string, defaultValue?: number): number;
@@ -312,4 +313,15 @@ interface XenoAsciiControlCharacterPolicy {
312
313
  allowLineBreaks?: boolean;
313
314
  }
314
315
  declare function hasDisallowedAsciiControlCharacter(value: string, policy?: XenoAsciiControlCharacterPolicy): boolean;
315
- export { ApiTransientError, type ApiTransientErrorClassification, HOME_DIR, IS_LINUX, IS_MAC, IS_WINDOWS, type LineEnding, LogLevel, OS_VERSION, PLATFORM, type ParsedDocument, type RetryErrorContext, type RetryOptions, type TextEncoding, type TextFileContents, type TokenAccountingAdapter, type TokenAccountingResult, type TokenAccountingSource, type TokenEstimator, type XenoAsciiControlCharacterPolicy, type XenoRequestContext, accountTextTokens, appendDurableLine, appendLine, benchmarkLeakError, buildToolResultBlock, buildToolResultText, calculateCost, commandMentionsBenchmarkLeak, conservativeTokenAccountingAdapter, copyTextToClipboard, createSafeRegex, debug, decodeTextBuffer, deleteDir, deleteFile, detectLineEnding, detectPreferredLineEnding, detectTextEncoding, encodeTextBuffer, ensureDir, error, estimateTokens, estimateTokensForModel, existsSync, filterBenchmarkLeakPaths, findSimilarFile, fitsInBudget, formatCost, getAgentHome, getBenchmarkReferenceOverwriteHint, getBoolean, getConfigDir, getLogLevel, getNumber, getProjectConfigDir, getRetryErrorContext, getShellName, getString, getToolResultTransportContent, hasDir, hasDisallowedAsciiControlCharacter, hasFile, hasFrontmatter, hasMixedLineEndings, hasNonTextToolResultContent, hasTransientStatusMention, info, isBenchmarkLeakPath, isBenchmarkMode, isGitRepo, isPathSafe, isRetryableError, listDirs, listFiles, normalizeLineEndings, normalizeXenoRequestContext, parseDocument, parseJsonLines, pathIdentityKey, readFileSafe, readIfExists, readTextFile, remainingBudget, renameReplacingWithRetry, safeJsonParse, safeJsonStringify, safeRegexTest, safeResolvePath, setLogLevel, stringifyDocument, toTransportAssistantBlocks, toolAssistantContentToText, toolResultContentToText, truncateToTokens, validateRegexPattern, validateRequired, warn, withRetry, writeAtomic, writeTextFile, xenoRequestContextHeaders };
316
+ type DirectEndpointProfile = "public-https" | "local-network";
317
+ interface DirectEndpointPolicy {
318
+ profile?: DirectEndpointProfile;
319
+ allowedHosts?: string[];
320
+ resolveHostname?: (hostname: string) => Promise<string[]>;
321
+ }
322
+ interface PinnedEndpointFetchOptions {
323
+ policy?: DirectEndpointPolicy;
324
+ authorizeAddress?: (address: string, url: URL) => boolean;
325
+ }
326
+ declare function fetchPinnedEndpoint(url: string | URL, init: RequestInit, options?: PinnedEndpointFetchOptions): Promise<Response>;
327
+ export { ApiTransientError, type ApiTransientErrorClassification, HOME_DIR, IS_LINUX, IS_MAC, IS_WINDOWS, type LineEnding, LogLevel, OS_VERSION, PLATFORM, type ParsedDocument, type PinnedEndpointFetchOptions, type RetryErrorContext, type RetryOptions, type TextEncoding, type TextFileContents, type TokenAccountingAdapter, type TokenAccountingResult, type TokenAccountingSource, type TokenEstimator, type XenoAsciiControlCharacterPolicy, type XenoRequestContext, accountTextTokens, appendDurableLine, appendLine, benchmarkLeakError, buildToolResultBlock, buildToolResultText, calculateCost, commandMentionsBenchmarkLeak, conservativeTokenAccountingAdapter, copyTextToClipboard, createSafeRegex, debug, decodeTextBuffer, deleteDir, deleteFile, detectLineEnding, detectPreferredLineEnding, detectTextEncoding, encodeTextBuffer, ensureDir, error, estimateTokens, estimateTokensForModel, existsSync, fetchPinnedEndpoint, filterBenchmarkLeakPaths, findSimilarFile, fitsInBudget, formatCost, getAgentHome, getBenchmarkReferenceOverwriteHint, getBoolean, getConfigDir, getLogLevel, getNumber, getProjectConfigDir, getRetryErrorContext, getShellName, getString, getToolResultTransportContent, hasDir, hasDisallowedAsciiControlCharacter, hasFile, hasFrontmatter, hasMixedLineEndings, hasNonTextToolResultContent, hasTransientStatusMention, info, isBenchmarkLeakPath, isBenchmarkMode, isGitRepo, isGitRepoAsync, isPathSafe, isRetryableError, listDirs, listFiles, normalizeLineEndings, normalizeXenoRequestContext, parseDocument, parseJsonLines, pathIdentityKey, readFileSafe, readIfExists, readTextFile, remainingBudget, renameReplacingWithRetry, safeJsonParse, safeJsonStringify, safeRegexTest, safeResolvePath, setLogLevel, stringifyDocument, toTransportAssistantBlocks, toolAssistantContentToText, toolResultContentToText, truncateToTokens, validateRegexPattern, validateRequired, warn, withRetry, writeAtomic, writeTextFile, xenoRequestContextHeaders };
@@ -1,25 +1,25 @@
1
- import{readdirSync as $,readFileSync as K}from"node:fs";import{existsSync as C,statSync as N}from"node:fs";import*as u from"node:fs/promises";import*as a from"node:path";function Yt(t){try{return C(t)&&N(t).isFile()}catch{return!1}}function Ut(t){try{return C(t)&&N(t).isDirectory()}catch{return!1}}function Gt(t,e=""){try{return K(t,"utf-8")}catch{return e}}async function A(t){await u.mkdir(t,{recursive:!0})}async function Z(t,e){let n=a.dirname(t);await A(n);let r=Math.random().toString(36).substring(2,15),o=`${t}.tmp.${process.pid}.${r}`;try{await u.writeFile(o,e),await tt(o,t)}finally{try{await u.unlink(o)}catch{}}}var Q=new Set(["EACCES","EBUSY","EPERM"]),V=[10,20,40,80,160,320,640];async function tt(t,e){for(let n=0;;n+=1)try{await u.rename(t,e);return}catch(r){let o=r.code,i=V[n];if(process.platform!=="win32"||!o||!Q.has(o)||i===void 0)throw r;await new Promise(s=>setTimeout(s,i))}}async function Kt(t,e){let n=a.dirname(t);await A(n),await u.appendFile(t,e+`
2
- `,"utf-8")}async function Zt(t,e){let n=a.dirname(t);await A(n);let r=await u.open(t,"a");try{await r.writeFile(e+`
3
- `,"utf-8"),await r.sync()}finally{await r.close()}}function et(t){return t.length>=3&&t[0]===239&&t[1]===187&&t[2]===191?"utf8-bom":t.length>=2&&t[0]===255&&t[1]===254?"utf16le":t.length>=2&&t[0]===254&&t[1]===255?"utf16be":"utf8"}function O(t){let e=Buffer.from(t);for(let n=0;n+1<e.length;n+=2){let r=e[n];e[n]=e[n+1],e[n+1]=r}return e}function nt(t,e){switch(e){case"utf8-bom":return t.subarray(3).toString("utf8");case"utf16le":return t.subarray(2).toString("utf16le");case"utf16be":return O(t.subarray(2)).toString("utf16le");default:return t.toString("utf8")}}function rt(t,e){switch(e){case"utf8-bom":return Buffer.concat([Buffer.from([239,187,191]),Buffer.from(t,"utf8")]);case"utf16le":return Buffer.concat([Buffer.from([255,254]),Buffer.from(t,"utf16le")]);case"utf16be":return Buffer.concat([Buffer.from([254,255]),O(Buffer.from(t,"utf16le"))]);default:return Buffer.from(t,"utf8")}}function ot(t){return t.includes(`\r
4
- `)?"CRLF":"LF"}function it(t,e){let n=t.replace(/\r\n/g,`
5
- `);return e==="CRLF"?n.replace(/\n/g,`\r
6
- `):n}function Qt(t){return t.includes(`\r
7
- `)?/(^|[^\r])\n/.test(t):!1}async function st(t){let e=await u.readFile(t),n=et(e),r=nt(e,n);return{content:r,encoding:n,lineEnding:ot(r),sizeBytes:e.length}}async function Vt(t,e,n){let r=n?.preserveLineEndings?e:it(e,n?.lineEnding??"LF");await Z(t,rt(r,n?.encoding??"utf8"))}async function te(t){let e=new Set,n=a.resolve(t);for(;!e.has(n);){e.add(n);try{let o=$(n,{withFileTypes:!0}).filter(i=>i.isFile()).map(i=>i.name).sort();for(let i of o){if(i.startsWith("."))continue;let s=a.extname(i).toLowerCase();if([".ts",".tsx",".js",".jsx",".json",".md",".txt",".yaml",".yml",".css",".html",".xml",".sh",".ps1"].includes(s))try{let f=a.join(n,i),c=await st(f);if(c.content.length>0)return c.lineEnding}catch{}}}catch{}let r=a.dirname(n);if(r===n)break;n=r}return"LF"}function at(t,e,n){let r=[],o=[{dir:t,depth:0}],i=new Set;for(;o.length>0&&r.length<n;){let s=o.shift();if(!i.has(s.dir)){i.add(s.dir);try{let f=$(s.dir,{withFileTypes:!0});for(let c of f){let l=a.join(s.dir,c.name);if(c.isFile()){if(r.push(l),r.length>=n)break;continue}c.isDirectory()&&s.depth<e&&!c.name.startsWith(".")&&c.name!=="node_modules"&&o.push({dir:l,depth:s.depth+1})}}catch{}}}return r}function v(t,e){let n=a.relative(t,e);return n===""||!n.startsWith("..")&&!a.isAbsolute(n)}function ee(t,e){try{let n=a.dirname(t),r=a.basename(t,a.extname(t)).toLowerCase(),o=a.basename(t).toLowerCase(),i=[n,a.dirname(n)],s=e!==void 0&&v(e,t)?e:void 0,f=i.flatMap(l=>at(l,2,500)).filter(l=>s===void 0||v(s,l)),c=null;for(let l of f){let x=a.basename(l).toLowerCase(),y=a.basename(l,a.extname(l)).toLowerCase(),m=null;if(x===o?m=0:y===r?m=1:(x.includes(r)||r.includes(y))&&(m=2),m===null)continue;let G=a.relative(n,l).split(a.sep).length,S=m+G*.01;(!c||S<c.score)&&(c={filePath:l,score:S})}return c?.filePath??null}catch{}return null}async function ne(t){try{return await u.readFile(t,"utf-8")}catch(e){if(e.code==="ENOENT")return null;throw e}}function re(t){return C(t)}async function oe(t,e){try{let r=(await u.readdir(t,{withFileTypes:!0})).filter(o=>o.isFile()).map(o=>a.join(t,o.name));return e&&(r=r.filter(o=>e.test(a.basename(o)))),r}catch(n){if(n.code==="ENOENT")return[];throw n}}async function ie(t){try{return(await u.readdir(t,{withFileTypes:!0})).filter(n=>n.isDirectory()).map(n=>a.join(t,n.name))}catch(e){if(e.code==="ENOENT")return[];throw e}}async function se(t){try{await u.unlink(t)}catch(e){if(e.code!=="ENOENT")throw e}}async function ae(t){try{await u.rm(t,{recursive:!0,force:!0})}catch(e){if(e.code!=="ENOENT")throw e}}function ce(t,e){try{return JSON.parse(t)}catch{return e}}function le(t,e="{}"){try{return JSON.stringify(t)}catch{return e}}function fe(t){let e=[];for(let n of t.split(`
8
- `)){let r=n.trim();if(r)try{e.push(JSON.parse(r))}catch{}}return e}function pe(t){let e=ut(t);return{frontmatter:e.frontmatter,content:e.content.trim()}}function ge(t,e){let n=Object.fromEntries(Object.entries(t).filter(([r,o])=>o!==void 0));return["---",I(n),"---","",e].join(`
9
- `)}function me(t){return t.trimStart().startsWith("---")}function ut(t){let e=t.replace(/^\uFEFF/,"");if(!e.startsWith("---"))return{frontmatter:{},content:t};let n=e.search(/\r?\n/);if(n<0||e.slice(0,n).trim()!=="---")return{frontmatter:{},content:t};let r=e.slice(n+(e[n]==="\r"?2:1)),o=r.match(/(?:^|\r?\n)---[ \t]*(?:\r?\n|$)/);if(!o||o.index===void 0)throw new Error("YAML frontmatter is not closed.");let i=r.slice(0,o.index),s=o[0],f=o.index+s.length;return{frontmatter:B(i),content:r.slice(f)}}function B(t){let e={},n=t.split(/\r?\n/);for(let r=0;r<n.length;r+=1){let o=n[r];if(!o.trim()||o.trimStart().startsWith("#"))continue;if(/^\s/.test(o))throw new Error(`Unexpected indentation at line ${r+1}.`);let i=lt(o,r+1);if(i.key==="<<")throw new Error("YAML merge keys are not supported.");if(i.value!==""){e[i.key]=P(i.value,r+1);continue}let s=ct(n,r+1);e[i.key]=s.value,r=s.nextIndex-1}return e}function ct(t,e){let n=[],r=e;for(;r<t.length;r+=1){let i=t[r];if(!i.trim()){n.push(i);continue}if(!/^\s/.test(i))break;n.push(i.replace(/^ {2}/,""))}let o=n.filter(i=>i.trim()&&!i.trimStart().startsWith("#"));return o.length===0?{value:{},nextIndex:r}:o.every(i=>i.trimStart().startsWith("- "))?{value:o.map((i,s)=>P(i.trimStart().slice(2),e+s+1)),nextIndex:r}:{value:B(n.join(`
10
- `)),nextIndex:r}}function lt(t,e){let n=t.indexOf(":");if(n<=0)throw new Error(`Invalid YAML line ${e}.`);let r=t.slice(0,n).trim(),o=t.slice(n+1).trim();if(!r)throw new Error(`Invalid YAML key at line ${e}.`);return{key:r,value:o}}function P(t,e){if(t==="")return"";if(t==="[]")return[];if(t==="{}")return{};if(t==="true")return!0;if(t==="false")return!1;if(t==="null"||t==="~")return null;if(/^-?\d+(?:\.\d+)?$/.test(t))return Number(t);if(t.startsWith('"'))return L(t,e);if(t.startsWith("'")){if(!t.endsWith("'"))throw new Error(`Unclosed quoted scalar at line ${e}.`);return t.slice(1,-1).replace(/''/g,"'")}if(t.startsWith("[")||t.startsWith("{"))return L(t,e);if(t.includes("[")||t.includes("]")||t.includes("{")||t.includes("}"))throw new Error(`Unsupported YAML scalar at line ${e}.`);return t}function L(t,e){try{return JSON.parse(t)}catch{throw new Error(`Invalid YAML scalar at line ${e}.`)}}function I(t,e=""){return Object.entries(t).map(([n,r])=>ft(n,r,e)).join(`
11
- `)}function ft(t,e,n){return Array.isArray(e)?`${n}${t}: ${JSON.stringify(e)}`:e&&typeof e=="object"?`${n}${t}:
12
- ${I(e,`${n} `)}`:`${n}${t}: ${JSON.stringify(e)}`}import*as d from"path";function dt(t,e){let n=d.resolve(t),r=d.resolve(t,e);return r===n?!0:n===d.parse(n).root?r.startsWith(n):r.startsWith(n+d.sep)}function xe(t,e){if(d.isAbsolute(e))return d.resolve(e);if(!dt(t,e))throw new Error(`PathSecurity: Path traversal attempt detected: ${e}`);return d.resolve(t,e)}function ye(t,e=process.platform){let n=d.resolve(t);return e==="win32"?n.toLowerCase():n}import{homedir as k,platform as pt,release as gt}from"node:os";import{execSync as mt}from"node:child_process";import{resolve as h}from"node:path";var M=pt(),ht=M==="win32",Te=M==="darwin",Ce=M==="linux",Ae=gt(),ke=k();function Me(){let t=process.env.XENO_AGENT_HOME?.trim();return t?h(t):h(k(),".xeno-agent")}function _e(){let t=process.env.XENO_CONFIG_DIR?.trim();return t?h(t):h(k(),".xeno-code")}function Se(t){return h(t,".xeno-code")}function ve(){return ht?"powershell":process.env.SHELL?.split("/").pop()??"bash"}function $e(t){try{return mt("git rev-parse --is-inside-work-tree",{cwd:t,stdio:"ignore"}),!0}catch{return!1}}function Oe(t,e){for(let n of e)if(t[n]===void 0||t[n]===null||t[n]==="")return`Missing required parameter: ${n}`;return null}function Le(t,e,n){let r=t[e];if(r==null){if(n!==void 0)return n;throw new Error(`Missing required parameter: ${e}`)}if(typeof r!="string")throw new Error(`Parameter ${e} must be a string, got ${typeof r}`);return r}function Be(t,e,n){let r=t[e];if(r==null){if(n!==void 0)return n;throw new Error(`Missing required parameter: ${e}`)}if(typeof r!="number")throw new Error(`Parameter ${e} must be a number, got ${typeof r}`);if(isNaN(r))throw new Error(`Parameter ${e} is NaN`);return r}function Pe(t,e,n){let r=t[e];if(r==null){if(n!==void 0)return n;throw new Error(`Missing required parameter: ${e}`)}if(typeof r!="boolean")throw new Error(`Parameter ${e} must be a boolean, got ${typeof r}`);return r}function xt(t){if(t.length>5e3)return"Pattern too long (max 5000 characters)";let n=[/(\.\*){3,}/,/(\+\+|\*\*)/,/(.*\+.*\+.*\+)/];for(let r of n)if(r.test(t))return"Pattern contains potentially unsafe constructs that could cause excessive backtracking";return null}function Ie(t,e,n=5e3){let r=xt(t);if(r)throw new Error(r);try{return new RegExp(t,e)}catch(o){let i=o instanceof Error?o.message:String(o);throw new Error(`Invalid regex pattern: ${i}`)}}function De(t,e,n=1e3){if(e.length>1e5)throw new Error(`Input too large for safe regex test (${e.length} chars, max 100000)`);return t.test(e)}var yt=(i=>(i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.SILENT=4]="SILENT",i))(yt||{}),g=1;function je(t){g=t}function We(){return g}function p(){return new Date().toISOString()}function qe(t,e){g<=0&&(e!==void 0?process.stderr.write(`[${p()}] DEBUG: ${t} ${b(e)}
13
- `):process.stderr.write(`[${p()}] DEBUG: ${t}
14
- `))}function Xe(t,e){g<=1&&(e!==void 0?process.stderr.write(`[${p()}] INFO: ${t} ${b(e)}
15
- `):process.stderr.write(`[${p()}] INFO: ${t}
16
- `))}function ze(t,e){g<=2&&(e!==void 0?process.stderr.write(`[${p()}] WARN: ${t} ${b(e)}
17
- `):process.stderr.write(`[${p()}] WARN: ${t}
18
- `))}function He(t,e){g<=3&&(e!==void 0?process.stderr.write(`[${p()}] ERROR: ${t} ${b(e)}
19
- `):process.stderr.write(`[${p()}] ERROR: ${t}
20
- `))}function b(t){if(t==null)return"";if(t instanceof Error)return t.message;if(typeof t=="string")return t;try{return JSON.stringify(t)}catch{return String(t)}}var bt=/^[A-Za-z0-9:._*-]{1,64}$/,wt=/^[A-Za-z0-9_-][A-Za-z0-9 _-]{0,30}[A-Za-z0-9_-]$/,Et=/^[0-9][0-9A-Za-z.+-]{0,40}$/;function Ye(t){if(!t||typeof t!="object")throw new TypeError("requestContext must be an object");let e=Object.keys(t).filter(r=>r!=="surface"&&r!=="client");if(e.length>0)throw new TypeError(`requestContext does not accept: ${e.join(", ")}`);if(typeof t.surface!="string"||!bt.test(t.surface))throw new TypeError("requestContext.surface must match /^[A-Za-z0-9:._*-]{1,64}$/");if(t.client===void 0)return Object.freeze({surface:t.surface});let n=t.client;if(!n||typeof n!="object"||Object.keys(n).some(r=>r!=="name"&&r!=="version"))throw new TypeError("requestContext.client must be { name, version }");if(typeof n.name!="string"||!wt.test(n.name))throw new TypeError("requestContext.client.name must be 2-32 characters of letters, digits, space, _ or -");if(typeof n.version!="string"||!Et.test(n.version))throw new TypeError("requestContext.client.version must start with a digit, e.g. 1.2.3");return Object.freeze({surface:t.surface,client:Object.freeze({name:n.name,version:n.version})})}function Ue(t){return t?{"X-Xeno-Surface":t.surface,...t.client?{"X-Xeno-Client":`${t.client.name}/${t.client.version}`}:{}}:{}}var R=class extends Error{statusCode;body;retryAfterMs;requestId;cfRay;constructor(e,n={}){super(e,n.cause!==void 0?{cause:n.cause}:void 0),this.name="ApiTransientError",this.statusCode=n.statusCode,this.retryAfterMs=n.retryAfterMs,this.requestId=n.requestId,this.cfRay=n.cfRay;for(let r of["code","category","retryable","providerCode","remedy"])n[r]!==void 0&&Object.defineProperty(this,r,{value:n[r],enumerable:!0,configurable:!0,writable:!1})}},w={maxRetries:3,baseDelayMs:1e3,maxDelayMs:3e4,jitterMs:300};function E(t,e){let n=process.env[t],r=n?Number.parseInt(n,10):Number.NaN;return!Number.isFinite(r)||r<0?e:r}function Rt(t={}){let e=Math.max(0,t.maxRetries??E("XENO_API_MAX_RETRIES",w.maxRetries)),n=Math.max(50,t.baseDelayMs??E("XENO_API_BASE_DELAY_MS",w.baseDelayMs)),r=Math.max(n,t.maxDelayMs??E("XENO_API_MAX_DELAY_MS",w.maxDelayMs)),o=Math.max(0,t.jitterMs??E("XENO_API_RETRY_JITTER_MS",w.jitterMs));return{maxRetries:e,baseDelayMs:n,maxDelayMs:r,jitterMs:o}}function Tt(t,e,n){if(e.retryAfterMs&&e.retryAfterMs>0)return Math.min(e.retryAfterMs,n.maxDelayMs);let r=Math.min(n.baseDelayMs*Math.pow(2,t),n.maxDelayMs),o=Math.floor(Math.random()*n.jitterMs);return Math.min(r+o,n.maxDelayMs)}function D(t){let e=t.toLowerCase();return e.includes("rate limit")||e.includes("too many requests")||e.includes("429")}function Ct(t){let e=t.toLowerCase();return e.includes("network")||e.includes("timeout")||e.includes("fetch failed")||e.includes("socket hang up")||e.includes("econnreset")||e.includes("eai_again")||e.includes("enotfound")||e.includes("econnrefused")||e.includes("tls")||e.includes("temporarily unavailable")}function F(t){if(t instanceof R)return{statusCode:t.statusCode,retryAfterMs:t.retryAfterMs,requestId:t.requestId,cfRay:t.cfRay};if(!(t instanceof Error))return{};let e=t;if(e.statusCode!==void 0||e.retryAfterMs!==void 0||e.requestId!==void 0||e.cfRay!==void 0)return{statusCode:e.statusCode,retryAfterMs:e.retryAfterMs,requestId:e.requestId,cfRay:e.cfRay};let n=t.message.toLowerCase();return D(n)?{statusCode:429}:{}}var _="408|425|429|500|502|503|504";function At(t){let e=new RegExp(`(?:\\bstatus(?:[ _-]?code)?\\b\\s*[=:]?\\s*|\\bhttp\\b\\s*|\\bapi\\b\\s*|\\bcode\\b\\s*[=:]\\s*|\\berror\\b\\s*)(?:${_})\\b`,"i"),n=new RegExp(`\\b(?:${_})\\s+(?:internal|bad\\s+gateway|service\\s+unavailable|gateway\\s+time|request\\s+time|too\\s+early|too\\s+many)`,"i"),r=new RegExp(`^\\s*(?:${_})\\b`);return e.test(t)||n.test(t)||r.test(t)}function kt(t){if(t&&typeof t=="object"&&"retryable"in t)return t.retryable===!0;if(t instanceof R){let{statusCode:e}=F(t);if(e)return e===429||e>=500||e===408||e===409||e===425}if(t instanceof Error){let e=t.name?.toLowerCase()??"";return e==="aborterror"||e==="agentinterruptederror"||t.message.toLowerCase().includes("aborted")||t.message.toLowerCase().includes("interrupted")?!1:At(t.message)?!0:D(t.message)||Ct(t.message.toLowerCase())}return!1}function Mt(t){if(t.onAbort)return t.onAbort();let e=new Error("The operation was aborted");return e.name="AbortError",e}async function Ke(t,e={}){let n=Rt(e),r;for(let o=0;o<=n.maxRetries;o++)try{if(e.signal?.aborted)throw Mt(e);return e.onBeforeAttempt?.(o),await t()}catch(i){if(r=i,!(e.shouldRetry?e.shouldRetry(i,o):kt(i))||o===n.maxRetries)throw i;let f=F(i),c=Tt(o,f,n),l=e.getDelayMs?.(i,o,c),x=typeof l=="number"&&l>=0?l:c;await new Promise(y=>setTimeout(y,x))}throw r}var _t=(t,e)=>{if(!t)return 0;let n=e.toLowerCase(),r=n.includes("claude")?3.5:n.includes("gemini")?3.8:(/(^|[/_-])(gpt|o\d)/.test(n),4),o=[...t].filter(s=>s.codePointAt(0)>127).length,i=Math.ceil(t.length/r);return Math.max(1,i+Math.ceil(o*.35))},St=Object.freeze({id:"xeno-conservative-v1",source:"estimated",countText:_t,countImage:({detail:t})=>t==="high"?2e3:t==="low"?512:1200,safetyMarginRatio:t=>{let e=t.toLowerCase();return e.includes("claude")?.12:e.includes("gemini")?.14:/(^|[/_-])(gpt|o\d)/.test(e)?.1:.18}});function Qe(t,e,n=St){return{tokens:Math.max(0,Math.ceil(n.countText(t,e))),source:n.source,adapterId:n.id}}function vt(t){return t?Math.ceil(t.length/4):0}function Ve(t,e){if(!t||e<=0)return"";let n=e*4;if(t.length<=n)return t;let r=t.slice(0,n),o=r.lastIndexOf(" ");return o>n*.8&&(r=r.slice(0,o)),r+"..."}function tn(t,e){return vt(t)<=e}function en(t,e){return Math.max(0,e-t)}var $t={"claude-opus-4-6-thinking":{input:15,output:75},"claude-opus-4-6":{input:15,output:75},"claude-opus-4-5-thinking":{input:15,output:75},"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-4-5-thinking":{input:3,output:15},"claude-sonnet-4-5":{input:3,output:15},"gemini-2.5-flash":{input:.15,output:.6},"gemini-2.5-flash-lite":{input:.075,output:.3},"gemini-3-flash":{input:.15,output:.6},"gemini-3-pro-high":{input:1.25,output:5},"gpt-5":{input:5,output:15},"gpt-5-codex":{input:5,output:15},"gpt-5.1":{input:5,output:15},"gpt-5.1-codex":{input:5,output:15},"gpt-5.2":{input:5,output:15},"gpt-5.2-codex":{input:5,output:15},"kimi-k2":{input:.6,output:2.4},"kimi-k2-thinking":{input:.6,output:2.4},"kimi-k2.5":{input:.6,output:2.4}};function rn(t,e,n){let r=$t[t];return r?e/1e6*r.input+n/1e6*r.output:0}function on(t){return t<=0?"$0.00":t<.001?"<$0.001":t<.01?`$${t.toFixed(4)}`:t<1?`$${t.toFixed(3)}`:`$${t.toFixed(2)}`}import{spawnSync as Nt}from"node:child_process";function un(t){let e=process.platform==="win32"?[{command:"clip.exe",args:[]}]:process.platform==="darwin"?[{command:"pbcopy",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}],n=null;for(let r of e)try{let o=Nt(r.command,r.args,{input:t,encoding:"utf8"});if(o.error){n=o.error.message;continue}if(o.status===0)return;n=o.stderr||o.stdout||`exit ${o.status}`}catch(o){n=o instanceof Error?o.message:String(o)}throw new Error(`Clipboard copy failed${n?`: ${n}`:""}`)}function W(t){return t.replace(/\\/g,"/").toLowerCase()}var Ot=["golden","solution","answer","expected"],Lt=["expected","golden","reference","answer","answers"],Bt=new Set([";","&&","||","|"]);function q(t){return W(t).replace(/^\.\/+/,"").split("/").map(e=>e.trim()).filter(e=>e.length>0)}function Pt(t){return Ot.some(e=>t.includes(e))}function j(t){return Lt.some(e=>t.includes(e))}function X(t){return t.split("::",1)[0]?.split("?",1)[0]?.split("#",1)[0]??t}function T(t){let e=t.trim().replace(/^[({]+/,"").replace(/[),;]+$/,"");return(e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'"))&&(e=e.slice(1,-1)),e}function It(t){return t.match(/"[^"]*"|'[^']*'|&&|\|\||[;|]|[^\s;|&]+/g)?.map(T).filter(e=>e.length>0)??[]}function z(t){let e=q(t),n=X(e.at(-1)??"");return j(n)||e.some(r=>j(r))}function H(t){let e=W(T(t));return!e||e==="/dev/null"||e.startsWith("/tmp/")||e.startsWith("tmp/")||e.startsWith("/var/tmp/")||e.startsWith("var/tmp/")?!1:e.startsWith("/app/")||e.startsWith("./")?!0:!e.startsWith("/")}function Dt(t){return/[\\/]/.test(t)||/\.[A-Za-z0-9]{1,8}$/.test(t)}function Ft(t){let e=It(t);for(let n=0;n<e.length;n+=1){let r=e[n]?.toLowerCase();if(r!=="cp"&&r!=="mv"&&r!=="rsync"&&r!=="install")continue;let o=[];for(let s=n+1;s<e.length;s+=1){let f=e[s];if(!f||Bt.has(f))break;f!=="--"&&(f.startsWith("-")||o.push(f))}if(o.length<2)continue;let i=o.at(-1);if(H(i)){for(let s of o.slice(0,-1))if(Dt(s)&&z(s))return{sourcePath:s,destinationPath:i,operation:r}}}return null}function jt(t){let e=[/\bcat\s+(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))\s*>\s*(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))/i,/\bdd\b[\s\S]*?\bif=(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))[\s\S]*?\bof=(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))/i];for(let n of e){let r=t.match(n);if(!r)continue;let o=T(r[1]??r[2]??r[3]??""),i=T(r[4]??r[5]??r[6]??"");if(!(!o||!i)&&z(o)&&H(i))return{sourcePath:o,destinationPath:i,operation:n.source.startsWith("\\bdd")?"dd":"redirect"}}return null}function J(){return process.env.XENO_BENCHMARK_MODE?.trim().toLowerCase()==="terminal-bench"}function Y(t){let e=q(t);if(e.includes("solution")||e.includes("xeno-audit")||e.includes(".xeno")&&e.includes("audit"))return!0;let n=X(e.at(-1)??"");return e.includes("tests")&&Pt(n)}function ln(t){return J()?t.filter(e=>!Y(e)):t}function fn(t){return`Benchmark safety: access to verifier answer or benchmark trace artifacts is blocked (${t}). Use task inputs and verifier logic, not golden, solution, or agent audit files.`}function dn(t){return t.split(/[\s"'`;|&]+/).map(e=>e.trim()).filter(e=>e.length>0&&/[\\/]/.test(e)).some(e=>Y(e))}function pn(t){if(!J())return null;let e=Ft(t)??jt(t);return e?["[xeno guidance]",`Benchmark safety blocked ${e.operation} from reference-like source ${e.sourcePath} to protected destination ${e.destinationPath}.`,"Do not copy expected, golden, reference, or answer files over task inputs or submission artifacts to make validation pass.","If a previous check polluted an input, restore/regenerate the original source input, then rerun the actual script or program under test."].join(`
21
- `):null}function Wt(t){return/^data:([^;,]+)[;,]/i.exec(t.trim())?.[1]}function qt(t){let e=[];for(let n of t){if(n.type==="text"){e.push(n.text);continue}if(n.type==="image_url"){e.push(`[image ${Wt(n.image_url.url)??"unknown"}]`);continue}let r=n.text??n.data;if(r&&r.trim().length>0){e.push(r);continue}let o=n.uri??n.mimeType??"resource";e.push(`[resource ${o}]`)}return e.join(`
1
+ import{readdirSync as q,readFileSync as xe}from"node:fs";import{existsSync as M,statSync as V}from"node:fs";import*as f from"node:fs/promises";import*as d from"node:path";function Dt(e){try{return M(e)&&V(e).isFile()}catch{return!1}}function Bt(e){try{return M(e)&&V(e).isDirectory()}catch{return!1}}function Xt(e,t=""){try{return xe(e,"utf-8")}catch{return t}}async function $(e){await f.mkdir(e,{recursive:!0})}async function Te(e,t){let r=d.dirname(e);await $(r);let n=Math.random().toString(36).substring(2,15),o=`${e}.tmp.${process.pid}.${n}`;try{await f.writeFile(o,t),await Ae(o,e)}finally{try{await f.unlink(o)}catch{}}}var _e=new Set(["EACCES","EBUSY","EPERM"]),ve=[10,20,40,80,160,320,640];async function Ae(e,t){for(let r=0;;r+=1)try{await f.rename(e,t);return}catch(n){let o=n.code,i=ve[r];if(process.platform!=="win32"||!o||!_e.has(o)||i===void 0)throw n;await new Promise(s=>setTimeout(s,i))}}async function Ft(e,t){let r=d.dirname(e);await $(r),await f.appendFile(e,t+`
2
+ `,"utf-8")}async function zt(e,t){let r=d.dirname(e);await $(r);let n=await f.open(e,"a");try{await n.writeFile(t+`
3
+ `,"utf-8"),await n.sync()}finally{await n.close()}}function Pe(e){return e.length>=3&&e[0]===239&&e[1]===187&&e[2]===191?"utf8-bom":e.length>=2&&e[0]===255&&e[1]===254?"utf16le":e.length>=2&&e[0]===254&&e[1]===255?"utf16be":"utf8"}function j(e){let t=Buffer.from(e);for(let r=0;r+1<t.length;r+=2){let n=t[r];t[r]=t[r+1],t[r+1]=n}return t}function ke(e,t){switch(t){case"utf8-bom":return e.subarray(3).toString("utf8");case"utf16le":return e.subarray(2).toString("utf16le");case"utf16be":return j(e.subarray(2)).toString("utf16le");default:return e.toString("utf8")}}function Ce(e,t){switch(t){case"utf8-bom":return Buffer.concat([Buffer.from([239,187,191]),Buffer.from(e,"utf8")]);case"utf16le":return Buffer.concat([Buffer.from([255,254]),Buffer.from(e,"utf16le")]);case"utf16be":return Buffer.concat([Buffer.from([254,255]),j(Buffer.from(e,"utf16le"))]);default:return Buffer.from(e,"utf8")}}function Se(e){return e.includes(`\r
4
+ `)?"CRLF":"LF"}function Ie(e,t){let r=e.replace(/\r\n/g,`
5
+ `);return t==="CRLF"?r.replace(/\n/g,`\r
6
+ `):r}function Ht(e){return e.includes(`\r
7
+ `)?/(^|[^\r])\n/.test(e):!1}async function Oe(e){let t=await f.readFile(e),r=Pe(t),n=ke(t,r);return{content:n,encoding:r,lineEnding:Se(n),sizeBytes:t.length}}async function Ut(e,t,r){let n=r?.preserveLineEndings?t:Ie(t,r?.lineEnding??"LF");await Te(e,Ce(n,r?.encoding??"utf8"))}async function qt(e,t){let r=new Set,n=d.resolve(e),o=t===void 0?void 0:d.resolve(t);if(o!==void 0){let i=d.relative(o,n);if(d.isAbsolute(i)||i===".."||i.startsWith(`..${d.sep}`))return"LF"}for(;!r.has(n);){r.add(n);try{let s=q(n,{withFileTypes:!0}).filter(a=>a.isFile()).map(a=>a.name).sort();for(let a of s){if(a.startsWith("."))continue;let c=d.extname(a).toLowerCase();if([".ts",".tsx",".js",".jsx",".json",".md",".txt",".yaml",".yml",".css",".html",".xml",".sh",".ps1"].includes(c))try{let l=d.join(n,a),p=await Oe(l);if(p.content.length>0)return p.lineEnding}catch{}}}catch{}if(o!==void 0&&d.relative(o,n)==="")break;let i=d.dirname(n);if(i===n)break;n=i}return"LF"}function Me(e,t,r){let n=[],o=[{dir:e,depth:0}],i=new Set;for(;o.length>0&&n.length<r;){let s=o.shift();if(!i.has(s.dir)){i.add(s.dir);try{let a=q(s.dir,{withFileTypes:!0});for(let c of a){let l=d.join(s.dir,c.name);if(c.isFile()){if(n.push(l),n.length>=r)break;continue}c.isDirectory()&&s.depth<t&&!c.name.startsWith(".")&&c.name!=="node_modules"&&o.push({dir:l,depth:s.depth+1})}}catch{}}}return n}function U(e,t){let r=d.relative(e,t);return r===""||!r.startsWith("..")&&!d.isAbsolute(r)}function Vt(e,t){try{let r=d.dirname(e),n=d.basename(e,d.extname(e)).toLowerCase(),o=d.basename(e).toLowerCase(),i=[r,d.dirname(r)],s=t!==void 0&&U(t,e)?t:void 0,a=i.flatMap(l=>Me(l,2,500)).filter(l=>s===void 0||U(s,l)),c=null;for(let l of a){let p=d.basename(l).toLowerCase(),u=d.basename(l,d.extname(l)).toLowerCase(),g=null;if(p===o?g=0:u===n?g=1:(p.includes(n)||n.includes(u))&&(g=2),g===null)continue;let R=d.relative(r,l).split(d.sep).length,h=g+R*.01;(!c||h<c.score)&&(c={filePath:l,score:h})}return c?.filePath??null}catch{}return null}async function jt(e){try{return await f.readFile(e,"utf-8")}catch(t){if(t.code==="ENOENT")return null;throw t}}function Wt(e){return M(e)}async function Kt(e,t){try{let n=(await f.readdir(e,{withFileTypes:!0})).filter(o=>o.isFile()).map(o=>d.join(e,o.name));return t&&(n=n.filter(o=>t.test(d.basename(o)))),n}catch(r){if(r.code==="ENOENT")return[];throw r}}async function Gt(e){try{return(await f.readdir(e,{withFileTypes:!0})).filter(r=>r.isDirectory()).map(r=>d.join(e,r.name))}catch(t){if(t.code==="ENOENT")return[];throw t}}async function Yt(e){try{await f.unlink(e)}catch(t){if(t.code!=="ENOENT")throw t}}async function Zt(e){try{await f.rm(e,{recursive:!0,force:!0})}catch(t){if(t.code!=="ENOENT")throw t}}function Qt(e,t){try{return JSON.parse(e)}catch{return t}}function er(e,t="{}"){try{return JSON.stringify(e)}catch{return t}}function tr(e){let t=[];for(let r of e.split(`
8
+ `)){let n=r.trim();if(n)try{t.push(JSON.parse(n))}catch{}}return t}function nr(e){let t=$e(e);return{frontmatter:t.frontmatter,content:t.content.trim()}}function or(e,t){let r=Object.fromEntries(Object.entries(e).filter(([n,o])=>o!==void 0));return["---",Y(r),"---","",t].join(`
9
+ `)}function ir(e){return e.trimStart().startsWith("---")}function $e(e){let t=e.replace(/^\uFEFF/,"");if(!t.startsWith("---"))return{frontmatter:{},content:e};let r=t.search(/\r?\n/);if(r<0||t.slice(0,r).trim()!=="---")return{frontmatter:{},content:e};let n=t.slice(r+(t[r]==="\r"?2:1)),o=n.match(/(?:^|\r?\n)---[ \t]*(?:\r?\n|$)/);if(!o||o.index===void 0)throw new Error("YAML frontmatter is not closed.");let i=n.slice(0,o.index),s=o[0],a=o.index+s.length;return{frontmatter:K(i),content:n.slice(a)}}function K(e){let t={},r=e.split(/\r?\n/);for(let n=0;n<r.length;n+=1){let o=r[n];if(!o.trim()||o.trimStart().startsWith("#"))continue;if(/^\s/.test(o))throw new Error(`Unexpected indentation at line ${n+1}.`);let i=Le(o,n+1);if(i.key==="<<")throw new Error("YAML merge keys are not supported.");if(i.value!==""){t[i.key]=G(i.value,n+1);continue}let s=Ne(r,n+1);t[i.key]=s.value,n=s.nextIndex-1}return t}function Ne(e,t){let r=[],n=t;for(;n<e.length;n+=1){let i=e[n];if(!i.trim()){r.push(i);continue}if(!/^\s/.test(i))break;r.push(i.replace(/^ {2}/,""))}let o=r.filter(i=>i.trim()&&!i.trimStart().startsWith("#"));return o.length===0?{value:{},nextIndex:n}:o.every(i=>i.trimStart().startsWith("- "))?{value:o.map((i,s)=>G(i.trimStart().slice(2),t+s+1)),nextIndex:n}:{value:K(r.join(`
10
+ `)),nextIndex:n}}function Le(e,t){let r=e.indexOf(":");if(r<=0)throw new Error(`Invalid YAML line ${t}.`);let n=e.slice(0,r).trim(),o=e.slice(r+1).trim();if(!n)throw new Error(`Invalid YAML key at line ${t}.`);return{key:n,value:o}}function G(e,t){if(e==="")return"";if(e==="[]")return[];if(e==="{}")return{};if(e==="true")return!0;if(e==="false")return!1;if(e==="null"||e==="~")return null;if(/^-?\d+(?:\.\d+)?$/.test(e))return Number(e);if(e.startsWith('"'))return W(e,t);if(e.startsWith("'")){if(!e.endsWith("'"))throw new Error(`Unclosed quoted scalar at line ${t}.`);return e.slice(1,-1).replace(/''/g,"'")}if(e.startsWith("[")||e.startsWith("{"))return W(e,t);if(e.includes("[")||e.includes("]")||e.includes("{")||e.includes("}"))throw new Error(`Unsupported YAML scalar at line ${t}.`);return e}function W(e,t){try{return JSON.parse(e)}catch{throw new Error(`Invalid YAML scalar at line ${t}.`)}}function Y(e,t=""){return Object.entries(e).map(([r,n])=>De(r,n,t)).join(`
11
+ `)}function De(e,t,r){return Array.isArray(t)?`${r}${e}: ${JSON.stringify(t)}`:t&&typeof t=="object"?`${r}${e}:
12
+ ${Y(t,`${r} `)}`:`${r}${e}: ${JSON.stringify(t)}`}import*as y from"path";function Be(e,t){let r=y.resolve(e),n=y.resolve(e,t);return n===r?!0:r===y.parse(r).root?n.startsWith(r):n.startsWith(r+y.sep)}function ar(e,t){if(y.isAbsolute(t))return y.resolve(t);if(!Be(e,t))throw new Error(`PathSecurity: Path traversal attempt detected: ${t}`);return y.resolve(e,t)}function cr(e,t=process.platform){let r=y.resolve(e);return t==="win32"?r.toLowerCase():r}import{homedir as B,platform as je,release as We}from"node:os";import{execFileSync as Ke,spawn as Ge,spawnSync as Ye}from"node:child_process";import{statSync as Ze}from"node:fs";import{delimiter as Je,join as Qe,resolve as x}from"node:path";import{spawn as Xe,spawnSync as lr}from"node:child_process";var Fe=5e3,Z=128;function ze(e,t,r){let n={tool:e,timeoutMs:r};return t.timedOut?{...n,terminated:!1,reason:"timeout",exitCode:null,detail:`${e} did not finish within ${r}ms`}:t.error!==void 0?{...n,terminated:!1,reason:"spawn-error",exitCode:null,detail:t.error}:t.status===0?{...n,terminated:!0,reason:"terminated",exitCode:0}:e==="taskkill"&&t.status===Z?{...n,terminated:!0,reason:"not-running",exitCode:Z}:{...n,terminated:!1,reason:"failed",exitCode:t.status,detail:`${e} exited with code ${t.status??"unknown"}`}}var He=(e,t,r)=>new Promise(n=>{let o=!1,i={},s=c=>{o||(o=!0,i.timer&&clearTimeout(i.timer),n(c))},a;try{a=Xe(e,[...t],{stdio:"ignore",windowsHide:!0})}catch(c){s({status:null,timedOut:!1,error:c instanceof Error?c.message:String(c)});return}i.timer=setTimeout(()=>{try{a.kill("SIGKILL")}catch{}s({status:null,timedOut:!0})},r),i.timer.unref?.(),a.once("error",c=>{s({status:null,timedOut:!1,error:c.code??c.message})}),a.once("close",c=>{s(c===null?{status:null,timedOut:!1,error:"no exit status"}:{status:c,timedOut:!1})})});function J(e){return typeof e=="number"&&Number.isFinite(e)&&e>0?Math.floor(e):Fe}function Ue(e,t){return{terminated:!1,reason:"failed",tool:e,exitCode:null,timeoutMs:t,detail:"pid is not a positive integer"}}function qe(e){return["/PID",String(e),"/T","/F"]}async function Q(e,t={}){let r=J(t.timeoutMs);return!Number.isSafeInteger(e)||e<=0?Ue("taskkill",r):Ve("taskkill","taskkill.exe",qe(e),{timeoutMs:r,run:t.run})}async function Ve(e,t,r,n={}){let o=J(n.timeoutMs),i;try{i=await(n.run??He)(t,r,o)}catch(s){i={status:null,timedOut:!1,error:s instanceof Error?s.message:String(s)}}return ze(e,i,o)}var X=je(),v=X==="win32",Er=X==="darwin",br=X==="linux",wr=We(),Rr=B();function xr(){let e=process.env.XENO_AGENT_HOME?.trim();return e?x(e):x(B(),".xeno-agent")}function Tr(){let e=process.env.XENO_CONFIG_DIR?.trim();return e?x(e):x(B(),".xeno-code")}function _r(e){return x(e,".xeno-code")}function vr(){return v?"powershell":process.env.SHELL?.split("/").pop()??"bash"}var L=5e3,D=4096,N=["rev-parse","--is-inside-work-tree"];function ee(){if(!v)return{file:"git",args:N};let e=(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";").map(t=>t.toLowerCase()).filter(t=>[".exe",".com",".cmd",".bat"].includes(t));for(let t of(process.env.PATH??"").split(Je).filter(Boolean)){let r=t.replace(/^"(.*)"$/,"$1");for(let n of e){let o=x(r,`git${n}`);try{if(!Ze(o).isFile())continue}catch{continue}if(n!==".cmd"&&n!==".bat")return{file:o,args:N};if(/["%!\r\n\0]/.test(o))throw new Error("Git wrapper path cannot be represented safely");let i=process.env.SystemRoot??process.env.WINDIR;if(!i)throw new Error("Windows command interpreter is unavailable");return{file:Qe(i,"System32","cmd.exe"),args:["/d","/s","/c",`""${o}" rev-parse --is-inside-work-tree"`],windowsVerbatimArguments:!0}}}return{file:"git",args:N}}function Ar(e){try{let t=ee();if(t.windowsVerbatimArguments){let r=Ye(t.file,t.args,{cwd:e,encoding:"utf8",windowsHide:!0,windowsVerbatimArguments:!0,timeout:L,maxBuffer:D,stdio:["ignore","pipe","ignore"]});return!r.error&&r.status===0&&r.stdout.trim()==="true"}return Ke(t.file,t.args,{cwd:e,encoding:"utf8",windowsHide:!0,timeout:L,maxBuffer:D,stdio:["ignore","pipe","ignore"]}).trim()==="true"}catch{return!1}}function Pr(e){return new Promise(t=>{let r,n=!1,o={},i=0,s=[],a=l=>{n||(n=!0,o.timer&&clearTimeout(o.timer),r?.stdout?.destroy(),r?.unref(),t(l))},c=()=>{if(r.exitCode===null&&r.signalCode===null)if(v&&r.pid)Q(r.pid);else if(!v&&r.pid)try{process.kill(-r.pid,"SIGKILL")}catch{try{r.kill("SIGKILL")}catch{}}else try{r.kill("SIGKILL")}catch{}a(!1)};try{let l=ee();r=Ge(l.file,l.args,{cwd:e,windowsHide:!0,detached:!v,windowsVerbatimArguments:l.windowsVerbatimArguments,stdio:["ignore","pipe","ignore"]})}catch{a(!1);return}o.timer=setTimeout(c,L),r.stdout?.on("data",l=>{if(!n){if(i+=l.byteLength,i>D){c();return}s.push(Buffer.from(l))}}),r.once("error",()=>a(!1)),r.once("close",l=>a(l===0&&Buffer.concat(s).toString("utf8").trim()==="true"))})}function Cr(e,t){for(let r of t)if(e[r]===void 0||e[r]===null||e[r]==="")return`Missing required parameter: ${r}`;return null}function Sr(e,t,r){let n=e[t];if(n==null){if(r!==void 0)return r;throw new Error(`Missing required parameter: ${t}`)}if(typeof n!="string")throw new Error(`Parameter ${t} must be a string, got ${typeof n}`);return n}function Ir(e,t,r){let n=e[t];if(n==null){if(r!==void 0)return r;throw new Error(`Missing required parameter: ${t}`)}if(typeof n!="number")throw new Error(`Parameter ${t} must be a number, got ${typeof n}`);if(isNaN(n))throw new Error(`Parameter ${t} is NaN`);return n}function Or(e,t,r){let n=e[t];if(n==null){if(r!==void 0)return r;throw new Error(`Missing required parameter: ${t}`)}if(typeof n!="boolean")throw new Error(`Parameter ${t} must be a boolean, got ${typeof n}`);return n}function et(e){if(e.length>5e3)return"Pattern too long (max 5000 characters)";let r=[/(\.\*){3,}/,/(\+\+|\*\*)/,/(.*\+.*\+.*\+)/];for(let n of r)if(n.test(e))return"Pattern contains potentially unsafe constructs that could cause excessive backtracking";return null}function Mr(e,t,r=5e3){let n=et(e);if(n)throw new Error(n);try{return new RegExp(e,t)}catch(o){let i=o instanceof Error?o.message:String(o);throw new Error(`Invalid regex pattern: ${i}`)}}function $r(e,t,r=1e3){if(t.length>1e5)throw new Error(`Input too large for safe regex test (${t.length} chars, max 100000)`);return e.test(t)}var tt=(i=>(i[i.DEBUG=0]="DEBUG",i[i.INFO=1]="INFO",i[i.WARN=2]="WARN",i[i.ERROR=3]="ERROR",i[i.SILENT=4]="SILENT",i))(tt||{}),T=1;function Lr(e){T=e}function Dr(){return T}function b(){return new Date().toISOString()}function Br(e,t){T<=0&&(t!==void 0?process.stderr.write(`[${b()}] DEBUG: ${e} ${A(t)}
13
+ `):process.stderr.write(`[${b()}] DEBUG: ${e}
14
+ `))}function Xr(e,t){T<=1&&(t!==void 0?process.stderr.write(`[${b()}] INFO: ${e} ${A(t)}
15
+ `):process.stderr.write(`[${b()}] INFO: ${e}
16
+ `))}function Fr(e,t){T<=2&&(t!==void 0?process.stderr.write(`[${b()}] WARN: ${e} ${A(t)}
17
+ `):process.stderr.write(`[${b()}] WARN: ${e}
18
+ `))}function zr(e,t){T<=3&&(t!==void 0?process.stderr.write(`[${b()}] ERROR: ${e} ${A(t)}
19
+ `):process.stderr.write(`[${b()}] ERROR: ${e}
20
+ `))}function A(e){if(e==null)return"";if(e instanceof Error)return e.message;if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}var rt=/^[A-Za-z0-9:._*-]{1,64}$/,nt=/^[A-Za-z0-9_-][A-Za-z0-9 _-]{0,30}[A-Za-z0-9_-]$/,ot=/^[0-9][0-9A-Za-z.+-]{0,40}$/;function Ur(e){if(!e||typeof e!="object")throw new TypeError("requestContext must be an object");let t=Object.keys(e).filter(n=>n!=="surface"&&n!=="client");if(t.length>0)throw new TypeError(`requestContext does not accept: ${t.join(", ")}`);if(typeof e.surface!="string"||!rt.test(e.surface))throw new TypeError("requestContext.surface must match /^[A-Za-z0-9:._*-]{1,64}$/");if(e.client===void 0)return Object.freeze({surface:e.surface});let r=e.client;if(!r||typeof r!="object"||Object.keys(r).some(n=>n!=="name"&&n!=="version"))throw new TypeError("requestContext.client must be { name, version }");if(typeof r.name!="string"||!nt.test(r.name))throw new TypeError("requestContext.client.name must be 2-32 characters of letters, digits, space, _ or -");if(typeof r.version!="string"||!ot.test(r.version))throw new TypeError("requestContext.client.version must start with a digit, e.g. 1.2.3");return Object.freeze({surface:e.surface,client:Object.freeze({name:r.name,version:r.version})})}function qr(e){return e?{"X-Xeno-Surface":e.surface,...e.client?{"X-Xeno-Client":`${e.client.name}/${e.client.version}`}:{}}:{}}var C=class extends Error{statusCode;body;retryAfterMs;requestId;cfRay;constructor(t,r={}){super(t,r.cause!==void 0?{cause:r.cause}:void 0),this.name="ApiTransientError",this.statusCode=r.statusCode,this.retryAfterMs=r.retryAfterMs,this.requestId=r.requestId,this.cfRay=r.cfRay;for(let n of["code","category","retryable","providerCode","remedy"])r[n]!==void 0&&Object.defineProperty(this,n,{value:r[n],enumerable:!0,configurable:!0,writable:!1})}},P={maxRetries:3,baseDelayMs:1e3,maxDelayMs:3e4,jitterMs:300};function k(e,t){let r=process.env[e],n=r?Number.parseInt(r,10):Number.NaN;return!Number.isFinite(n)||n<0?t:n}function it(e={}){let t=Math.max(0,e.maxRetries??k("XENO_API_MAX_RETRIES",P.maxRetries)),r=Math.max(50,e.baseDelayMs??k("XENO_API_BASE_DELAY_MS",P.baseDelayMs)),n=Math.max(r,e.maxDelayMs??k("XENO_API_MAX_DELAY_MS",P.maxDelayMs)),o=Math.max(0,e.jitterMs??k("XENO_API_RETRY_JITTER_MS",P.jitterMs));return{maxRetries:t,baseDelayMs:r,maxDelayMs:n,jitterMs:o}}function st(e,t,r){if(t.retryAfterMs&&t.retryAfterMs>0)return Math.min(t.retryAfterMs,r.maxDelayMs);let n=Math.min(r.baseDelayMs*Math.pow(2,e),r.maxDelayMs),o=Math.floor(Math.random()*r.jitterMs);return Math.min(n+o,r.maxDelayMs)}function te(e){let t=e.toLowerCase();return t.includes("rate limit")||t.includes("too many requests")||t.includes("429")}function at(e){let t=e.toLowerCase();return t.includes("network")||t.includes("timeout")||t.includes("fetch failed")||t.includes("socket hang up")||t.includes("econnreset")||t.includes("eai_again")||t.includes("enotfound")||t.includes("econnrefused")||t.includes("tls")||t.includes("temporarily unavailable")}function re(e){if(e instanceof C)return{statusCode:e.statusCode,retryAfterMs:e.retryAfterMs,requestId:e.requestId,cfRay:e.cfRay};if(!(e instanceof Error))return{};let t=e;if(t.statusCode!==void 0||t.retryAfterMs!==void 0||t.requestId!==void 0||t.cfRay!==void 0)return{statusCode:t.statusCode,retryAfterMs:t.retryAfterMs,requestId:t.requestId,cfRay:t.cfRay};let r=e.message.toLowerCase();return te(r)?{statusCode:429}:{}}var F="408|425|429|500|502|503|504";function ct(e){let t=new RegExp(`(?:\\bstatus(?:[ _-]?code)?\\b\\s*[=:]?\\s*|\\bhttp\\b\\s*|\\bapi\\b\\s*|\\bcode\\b\\s*[=:]\\s*|\\berror\\b\\s*)(?:${F})\\b`,"i"),r=new RegExp(`\\b(?:${F})\\s+(?:internal|bad\\s+gateway|service\\s+unavailable|gateway\\s+time|request\\s+time|too\\s+early|too\\s+many)`,"i"),n=new RegExp(`^\\s*(?:${F})\\b`);return t.test(e)||r.test(e)||n.test(e)}function ut(e){if(e&&typeof e=="object"&&"retryable"in e)return e.retryable===!0;if(e instanceof C){let{statusCode:t}=re(e);if(t)return t===429||t>=500||t===408||t===409||t===425}if(e instanceof Error){let t=e.name?.toLowerCase()??"";return t==="aborterror"||t==="agentinterruptederror"||e.message.toLowerCase().includes("aborted")||e.message.toLowerCase().includes("interrupted")?!1:ct(e.message)?!0:te(e.message)||at(e.message.toLowerCase())}return!1}function dt(e){if(e.onAbort)return e.onAbort();let t=new Error("The operation was aborted");return t.name="AbortError",t}async function jr(e,t={}){let r=it(t),n;for(let o=0;o<=r.maxRetries;o++)try{if(t.signal?.aborted)throw dt(t);return t.onBeforeAttempt?.(o),await e()}catch(i){if(n=i,!(t.shouldRetry?t.shouldRetry(i,o):ut(i))||o===r.maxRetries)throw i;let a=re(i),c=st(o,a,r),l=t.getDelayMs?.(i,o,c),p=typeof l=="number"&&l>=0?l:c;await new Promise(u=>setTimeout(u,p))}throw n}var lt=(e,t)=>{if(!e)return 0;let r=t.toLowerCase(),n=r.includes("claude")?3.5:r.includes("gemini")?3.8:(/(^|[/_-])(gpt|o\d)/.test(r),4),o=[...e].filter(s=>s.codePointAt(0)>127).length,i=Math.ceil(e.length/n);return Math.max(1,i+Math.ceil(o*.35))},ft=Object.freeze({id:"xeno-conservative-v1",source:"estimated",countText:lt,countImage:({detail:e})=>e==="high"?2e3:e==="low"?512:1200,safetyMarginRatio:e=>{let t=e.toLowerCase();return t.includes("claude")?.12:t.includes("gemini")?.14:/(^|[/_-])(gpt|o\d)/.test(t)?.1:.18}});function Kr(e,t,r=ft){return{tokens:Math.max(0,Math.ceil(r.countText(e,t))),source:r.source,adapterId:r.id}}function pt(e){return e?Math.ceil(e.length/4):0}function Gr(e,t){if(!e||t<=0)return"";let r=t*4;if(e.length<=r)return e;let n=e.slice(0,r),o=n.lastIndexOf(" ");return o>r*.8&&(n=n.slice(0,o)),n+"..."}function Yr(e,t){return pt(e)<=t}function Zr(e,t){return Math.max(0,t-e)}var mt={"claude-opus-4-6-thinking":{input:15,output:75},"claude-opus-4-6":{input:15,output:75},"claude-opus-4-5-thinking":{input:15,output:75},"claude-sonnet-4-6":{input:3,output:15},"claude-sonnet-4-5-thinking":{input:3,output:15},"claude-sonnet-4-5":{input:3,output:15},"gemini-2.5-flash":{input:.15,output:.6},"gemini-2.5-flash-lite":{input:.075,output:.3},"gemini-3-flash":{input:.15,output:.6},"gemini-3-pro-high":{input:1.25,output:5},"gpt-5":{input:5,output:15},"gpt-5-codex":{input:5,output:15},"gpt-5.1":{input:5,output:15},"gpt-5.1-codex":{input:5,output:15},"gpt-5.2":{input:5,output:15},"gpt-5.2-codex":{input:5,output:15},"kimi-k2":{input:.6,output:2.4},"kimi-k2-thinking":{input:.6,output:2.4},"kimi-k2.5":{input:.6,output:2.4}};function Qr(e,t,r){let n=mt[e];return n?t/1e6*n.input+r/1e6*n.output:0}function en(e){return e<=0?"$0.00":e<.001?"<$0.001":e<.01?`$${e.toFixed(4)}`:e<1?`$${e.toFixed(3)}`:`$${e.toFixed(2)}`}import{spawnSync as gt}from"node:child_process";function nn(e){let t=process.platform==="win32"?[{command:"clip.exe",args:[]}]:process.platform==="darwin"?[{command:"pbcopy",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}],r=null;for(let n of t)try{let o=gt(n.command,n.args,{input:e,encoding:"utf8"});if(o.error){r=o.error.message;continue}if(o.status===0)return;r=o.stderr||o.stdout||`exit ${o.status}`}catch(o){r=o instanceof Error?o.message:String(o)}throw new Error(`Clipboard copy failed${r?`: ${r}`:""}`)}function oe(e){return e.replace(/\\/g,"/").toLowerCase()}var yt=["golden","solution","answer","expected"],ht=["expected","golden","reference","answer","answers"],Et=new Set([";","&&","||","|"]);function ie(e){return oe(e).replace(/^\.\/+/,"").split("/").map(t=>t.trim()).filter(t=>t.length>0)}function bt(e){return yt.some(t=>e.includes(t))}function ne(e){return ht.some(t=>e.includes(t))}function se(e){return e.split("::",1)[0]?.split("?",1)[0]?.split("#",1)[0]??e}function S(e){let t=e.trim().replace(/^[({]+/,"").replace(/[),;]+$/,"");return(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))&&(t=t.slice(1,-1)),t}function wt(e){return e.match(/"[^"]*"|'[^']*'|&&|\|\||[;|]|[^\s;|&]+/g)?.map(S).filter(t=>t.length>0)??[]}function ae(e){let t=ie(e),r=se(t.at(-1)??"");return ne(r)||t.some(n=>ne(n))}function ce(e){let t=oe(S(e));return!t||t==="/dev/null"||t.startsWith("/tmp/")||t.startsWith("tmp/")||t.startsWith("/var/tmp/")||t.startsWith("var/tmp/")?!1:t.startsWith("/app/")||t.startsWith("./")?!0:!t.startsWith("/")}function Rt(e){return/[\\/]/.test(e)||/\.[A-Za-z0-9]{1,8}$/.test(e)}function xt(e){let t=wt(e);for(let r=0;r<t.length;r+=1){let n=t[r]?.toLowerCase();if(n!=="cp"&&n!=="mv"&&n!=="rsync"&&n!=="install")continue;let o=[];for(let s=r+1;s<t.length;s+=1){let a=t[s];if(!a||Et.has(a))break;a!=="--"&&(a.startsWith("-")||o.push(a))}if(o.length<2)continue;let i=o.at(-1);if(ce(i)){for(let s of o.slice(0,-1))if(Rt(s)&&ae(s))return{sourcePath:s,destinationPath:i,operation:n}}}return null}function Tt(e){let t=[/\bcat\s+(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))\s*>\s*(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))/i,/\bdd\b[\s\S]*?\bif=(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))[\s\S]*?\bof=(?:"([^"]+)"|'([^']+)'|([^\s;&|]+))/i];for(let r of t){let n=e.match(r);if(!n)continue;let o=S(n[1]??n[2]??n[3]??""),i=S(n[4]??n[5]??n[6]??"");if(!(!o||!i)&&ae(o)&&ce(i))return{sourcePath:o,destinationPath:i,operation:r.source.startsWith("\\bdd")?"dd":"redirect"}}return null}function ue(){return process.env.XENO_BENCHMARK_MODE?.trim().toLowerCase()==="terminal-bench"}function de(e){let t=ie(e);if(t.includes("solution")||t.includes("xeno-audit")||t.includes(".xeno")&&t.includes("audit"))return!0;let r=se(t.at(-1)??"");return t.includes("tests")&&bt(r)}function sn(e){return ue()?e.filter(t=>!de(t)):e}function an(e){return`Benchmark safety: access to verifier answer or benchmark trace artifacts is blocked (${e}). Use task inputs and verifier logic, not golden, solution, or agent audit files.`}function cn(e){return e.split(/[\s"'`;|&]+/).map(t=>t.trim()).filter(t=>t.length>0&&/[\\/]/.test(t)).some(t=>de(t))}function un(e){if(!ue())return null;let t=xt(e)??Tt(e);return t?["[xeno guidance]",`Benchmark safety blocked ${t.operation} from reference-like source ${t.sourcePath} to protected destination ${t.destinationPath}.`,"Do not copy expected, golden, reference, or answer files over task inputs or submission artifacts to make validation pass.","If a previous check polluted an input, restore/regenerate the original source input, then rerun the actual script or program under test."].join(`
21
+ `):null}function _t(e){return/^data:([^;,]+)[;,]/i.exec(e.trim())?.[1]}function vt(e){let t=[];for(let r of e){if(r.type==="text"){t.push(r.text);continue}if(r.type==="image_url"){t.push(`[image ${_t(r.image_url.url)??"unknown"}]`);continue}let n=r.text??r.data;if(n&&n.trim().length>0){t.push(n);continue}let o=r.uri??r.mimeType??"resource";t.push(`[resource ${o}]`)}return t.join(`
22
22
 
23
- `).trim()}function U(t){let e=t.trim();return e.length>0?[{type:"text",text:e}]:[]}function mn(t){return typeof t=="string"?t:qt(t)}function Xt(t){if(t.success)return t.output;let e=[`Error: ${t.error??"Tool execution failed"}`];return t.output.trim().length>0&&e.push(t.output),e.join(`
24
- `)}function hn(t){let e=t.assistant_content&&t.assistant_content.length>0?t.assistant_content:typeof t.content=="string"?U(t.content):t.content,n=t.assistant_only_content??[],r=zt(t),o=[...e,...n,...r?[r]:[]];return o.length>0?o:t.content}function zt(t){let e=t.operation;if(!e)return null;let n=t.evidence??e.evidence??[],r=n.filter(i=>i.status==="verified").length,o=n.filter(i=>i.status==="failed").length;return{type:"text",text:["[xeno_operation]",`operation_id: ${e.operationId}`,`state: ${e.state}`,`terminal: ${e.terminal?"yes":"no"}`,`completion_policy: ${e.completionPolicy}`,e.taskId?`task_id: ${e.taskId}`:null,e.completionReason?`completion_reason: ${e.completionReason}`:null,`evidence: ${r} verified, ${o} failed`,t.retryable===void 0?null:`retryable: ${t.retryable?"yes":"no"}`,"[/xeno_operation]"].filter(i=>!!i).join(`
25
- `)}}function xn(t){return Array.isArray(t)&&t.some(e=>e.type!=="text")}function yn(t){return typeof t=="string"?U(t):t}function bn(t,e){return{type:"tool_result",tool_use_id:t,content:Xt(e),...e.assistantContent&&e.assistantContent.length>0?{assistant_content:e.assistantContent}:{},...e.assistantOnlyContent&&e.assistantOnlyContent.length>0?{assistant_only_content:e.assistantOnlyContent}:{},is_error:!e.success,...e.operation?{operation:e.operation}:{},...e.evidence&&e.evidence.length>0?{evidence:e.evidence}:{},...e.webContext?{web_context:e.webContext}:{},...e.retryable!==void 0?{retryable:e.retryable}:{}}}function En(t,e={}){for(let n of t){let r=n.codePointAt(0);if(r===127)return!0;if(!(r>31)&&!(r===9&&e.allowTab===!0)&&!((r===10||r===13)&&e.allowLineBreaks===!0))return!0}return!1}export{R as ApiTransientError,ke as HOME_DIR,Ce as IS_LINUX,Te as IS_MAC,ht as IS_WINDOWS,yt as LogLevel,Ae as OS_VERSION,M as PLATFORM,Qe as accountTextTokens,Zt as appendDurableLine,Kt as appendLine,fn as benchmarkLeakError,bn as buildToolResultBlock,Xt as buildToolResultText,rn as calculateCost,dn as commandMentionsBenchmarkLeak,St as conservativeTokenAccountingAdapter,un as copyTextToClipboard,Ie as createSafeRegex,qe as debug,nt as decodeTextBuffer,ae as deleteDir,se as deleteFile,ot as detectLineEnding,te as detectPreferredLineEnding,et as detectTextEncoding,rt as encodeTextBuffer,A as ensureDir,He as error,vt as estimateTokens,_t as estimateTokensForModel,re as existsSync,ln as filterBenchmarkLeakPaths,ee as findSimilarFile,tn as fitsInBudget,on as formatCost,Me as getAgentHome,pn as getBenchmarkReferenceOverwriteHint,Pe as getBoolean,_e as getConfigDir,We as getLogLevel,Be as getNumber,Se as getProjectConfigDir,F as getRetryErrorContext,ve as getShellName,Le as getString,hn as getToolResultTransportContent,Ut as hasDir,En as hasDisallowedAsciiControlCharacter,Yt as hasFile,me as hasFrontmatter,Qt as hasMixedLineEndings,xn as hasNonTextToolResultContent,At as hasTransientStatusMention,Xe as info,Y as isBenchmarkLeakPath,J as isBenchmarkMode,$e as isGitRepo,dt as isPathSafe,kt as isRetryableError,ie as listDirs,oe as listFiles,it as normalizeLineEndings,Ye as normalizeXenoRequestContext,pe as parseDocument,fe as parseJsonLines,ye as pathIdentityKey,Gt as readFileSafe,ne as readIfExists,st as readTextFile,en as remainingBudget,tt as renameReplacingWithRetry,ce as safeJsonParse,le as safeJsonStringify,De as safeRegexTest,xe as safeResolvePath,je as setLogLevel,ge as stringifyDocument,yn as toTransportAssistantBlocks,qt as toolAssistantContentToText,mn as toolResultContentToText,Ve as truncateToTokens,xt as validateRegexPattern,Oe as validateRequired,ze as warn,Ke as withRetry,Z as writeAtomic,Vt as writeTextFile,Ue as xenoRequestContextHeaders};
23
+ `).trim()}function le(e){let t=e.trim();return t.length>0?[{type:"text",text:t}]:[]}function ln(e){return typeof e=="string"?e:vt(e)}function At(e){if(e.success)return e.output;let t=[`Error: ${e.error??"Tool execution failed"}`];return e.output.trim().length>0&&t.push(e.output),t.join(`
24
+ `)}function fn(e){let t=e.assistant_content&&e.assistant_content.length>0?e.assistant_content:typeof e.content=="string"?le(e.content):e.content,r=e.assistant_only_content??[],n=Pt(e),o=[...t,...r,...n?[n]:[]];return o.length>0?o:e.content}function Pt(e){let t=e.operation;if(!t)return null;let r=e.evidence??t.evidence??[],n=r.filter(i=>i.status==="verified").length,o=r.filter(i=>i.status==="failed").length;return{type:"text",text:["[xeno_operation]",`operation_id: ${t.operationId}`,`state: ${t.state}`,`terminal: ${t.terminal?"yes":"no"}`,`completion_policy: ${t.completionPolicy}`,t.taskId?`task_id: ${t.taskId}`:null,t.completionReason?`completion_reason: ${t.completionReason}`:null,`evidence: ${n} verified, ${o} failed`,e.retryable===void 0?null:`retryable: ${e.retryable?"yes":"no"}`,"[/xeno_operation]"].filter(i=>!!i).join(`
25
+ `)}}function pn(e){return Array.isArray(e)&&e.some(t=>t.type!=="text")}function mn(e){return typeof e=="string"?le(e):e}function gn(e,t){return{type:"tool_result",tool_use_id:e,content:At(t),...t.assistantContent&&t.assistantContent.length>0?{assistant_content:t.assistantContent}:{},...t.assistantOnlyContent&&t.assistantOnlyContent.length>0?{assistant_only_content:t.assistantOnlyContent}:{},is_error:!t.success,...t.operation?{operation:t.operation}:{},...t.evidence&&t.evidence.length>0?{evidence:t.evidence}:{},...t.webContext?{web_context:t.webContext}:{},...t.retryable!==void 0?{retryable:t.retryable}:{}}}function hn(e,t={}){for(let r of e){let n=r.codePointAt(0);if(n===127)return!0;if(!(n>31)&&!(n===9&&t.allowTab===!0)&&!((n===10||n===13)&&t.allowLineBreaks===!0))return!0}return!1}import{lookup as Ct}from"node:dns/promises";import{isIP as O}from"node:net";var E="[redacted]";var kt=[[/-----BEGIN [A-Z ]*PRIVATE KEY-----[\s\S]*?(?:-----END [A-Z ]*PRIVATE KEY-----|$)/g,"[redacted:private-key]"],[/((?:^|[\s{,;"'(\[])["']?(?:cookie|set-cookie)["']?\s*[:=]\s*["']?)(?!\[redacted)[^\s"',;]+(?:;\s*[^\s"',;=]+=[^\s"',;]*)*/gi,`$1${E}`],[/((?:^|[\s{,;"'(\[])["']?(?:authorization|proxy-authorization|x-api-key|x-goog-api-key|x-xeno-api-key|api[-_]?key|apikey|dpop)["']?\s*[:=]\s*["']?)(?:(?:Bearer|Basic|Token|DPoP)\s+)?(?!\[redacted)[^\s"',;]+/gi,`$1${E}`],[/\b(Bearer|Basic|Token|DPoP)\s+[A-Za-z0-9._~+/=-]{6,}/gi,`$1 ${E}`],[/\b(?:sk-(?:ant-|proj-)?[A-Za-z0-9_-]{16,}|xeno-[A-Za-z0-9]{24,}|xrun_[A-Za-z0-9_-]{8,}|AIza[0-9A-Za-z_-]{30,}|gh[pousr]_[A-Za-z0-9_]{20,}|github_pat_[A-Za-z0-9_]{20,}|npm_[A-Za-z0-9]{30,}|xox[baprs]-[A-Za-z0-9-]{16,}|AKIA[0-9A-Z]{16})\b/g,E],[/\beyJ[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}\.[A-Za-z0-9_-]{6,}/g,E],[/([?&#;](?:access_token|refresh_token|id_token|token|key|api[_-]?key|secret|client_secret|password|signature|sig)=)[^&#\s"'<>]+/gi,`$1${E}`],[/(\b[a-z][a-z0-9+.-]*:\/\/)[^/\s:@"']+:[^/\s@"']+@/gi,`$1${E}@`]];function fe(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function _(e,t=[]){if(!e)return e;let r=e,n=[...new Set([...t].filter(o=>typeof o=="string"&&o.length>=12))].sort((o,i)=>i.length-o.length);for(let o of n){r=r.replace(new RegExp(`(?<![A-Za-z0-9_-])${fe(o)}(?![A-Za-z0-9_-])`,"g"),E);let i=encodeURIComponent(o);i!==o&&(r=r.replace(new RegExp(`(?<![A-Za-z0-9_-])${fe(i)}(?![A-Za-z0-9_-])`,"g"),E))}for(let[o,i]of kt)o.lastIndex=0,r=r.replace(o,i);return r}function z(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0,enumerable:!1})}catch{}}function H(e,t=[],r=0){if(!(e instanceof Error)||r>6)return e;let n=[...t],o=_(e.message,n);if(o!==e.message&&z(e,"message",o),typeof e.stack=="string"){let s=_(e.stack,n);s!==e.stack&&z(e,"stack",s)}let i=e.cause;if(i instanceof Error)H(i,n,r+1);else if(i!=null){let s;try{s=typeof i=="string"?i:JSON.stringify(i)??String(i)}catch{s=String(i)}let a=_(s,n);a!==s&&z(e,"cause",a)}for(let s of Object.keys(e)){let a=e[s];if(typeof a=="string"){let c=_(a,n);if(c!==a)try{e[s]=c}catch{}}}return e}var I=class extends Error{category;code;retryable;providerId;statusCode;retryAfterMs;requestId;providerCode;remedy;constructor(t,r){super(_(t),r.cause!==void 0?{cause:r.cause}:void 0),this.name="ProviderError",this.category=r.category,this.code=r.code,this.retryable=r.retryable??!1,this.providerId=r.providerId,this.statusCode=r.statusCode,this.retryAfterMs=r.retryAfterMs,this.requestId=r.requestId,r.providerCode!==void 0&&(this.providerCode=r.providerCode),r.remedy!==void 0&&(this.remedy=r.remedy),H(this)}};var ge=new Set(["metadata.google.internal","metadata.azure.internal","instance-data.ec2.internal"]);function m(e){return new I(`Provider endpoint rejected: ${e}`,{category:"endpoint_policy",code:"PROVIDER_ENDPOINT_REJECTED"})}function St(e){let t=e.split(".");if(t.length!==4)return null;let r=t.map(n=>Number(n));return r.every(n=>Number.isInteger(n)&&n>=0&&n<=255)?r:null}function pe(e){let t=St(e);if(!t)return"public";let[r,n]=t;return r===0?"unspecified":r===127?"loopback":r===169&&n===254?"link-local":r===10||r===172&&n>=16&&n<=31||r===192&&n===168?"private":"public"}function w(e){let t=e.toLowerCase().replace(/^\[|\]$/g,"").split("%")[0];O(t)===6&&(t=new URL(`http://[${t}]`).hostname.slice(1,-1));let r=/^::ffff:([0-9a-f]{1,4}):([0-9a-f]{1,4})$/.exec(t);if(r){let n=Number.parseInt(r[1],16),o=Number.parseInt(r[2],16);return`${n>>8}.${n&255}.${o>>8}.${o&255}`}return t}function ye(e){let t=w(e);return O(t)===4?pe(t):t==="::"||t==="::0"?"unspecified":t==="::1"?"loopback":t.startsWith("::ffff:")?pe(t.slice(7)):/^f[cd]/.test(t)?"private":/^fe[89ab]/.test(t)?"link-local":"public"}function me(e){return e==="example"||e.endsWith(".example")||e==="test"||e.endsWith(".test")||e==="invalid"||e.endsWith(".invalid")}function It(e){return e==="localhost"||e.endsWith(".localhost")}function he(e,t={}){let r;try{r=new URL(e)}catch{throw m("the URL is invalid")}if(r.username||r.password)throw m("embedded credentials are forbidden");if(r.hash||r.search)throw m("base URLs cannot contain a query or fragment");if(!r.hostname||r.hostname.includes("%"))throw m("the hostname is empty or ambiguous");if(ge.has(r.hostname.toLowerCase()))throw m("cloud metadata destinations are forbidden");if(r.protocol!=="https:"&&r.protocol!=="http:")throw m(`scheme ${r.protocol} is unsupported`);let n=t.profile??"public-https";if(r.protocol==="http:"&&n!=="local-network")throw m("plain HTTP requires the explicit local-network profile");let o=r.hostname.replace(/^\[|\]$/g,""),i=O(o)?ye(o):null;if(i==="link-local"||i==="unspecified")throw m(`${i} destinations are forbidden`);if(n==="public-https"&&(i==="private"||i==="loopback"||It(r.hostname)))throw m("private and loopback destinations require the local-network profile");if(n==="local-network"&&r.protocol==="http:"&&i==="public"&&!t.allowedHosts?.includes(r.hostname))throw m("local-network HTTP must resolve to loopback or a private address");return r}async function Ee(e,t={}){let r=e.hostname.toLowerCase().replace(/^\[|\]$/g,"");if(ge.has(r))throw m("cloud metadata destinations are forbidden");let n=new Set((t.allowedHosts??[]).map(s=>s.toLowerCase())),o=O(r)?[r]:me(r)?[]:t.resolveHostname?await t.resolveHostname(r):(await Ct(r,{all:!0,verbatim:!0})).map(s=>s.address);if(!o.length&&!me(r))throw m("DNS resolution returned no addresses");let i=t.profile??"public-https";for(let s of o){let a=ye(s);if(a==="link-local"||a==="unspecified")throw m(`DNS resolved to a forbidden ${a} address`);if(i==="public-https"&&a!=="public"&&!n.has(r))throw m(`DNS resolved public endpoint to ${a} address ${s}`);if(i==="local-network"&&e.protocol==="http:"&&a==="public"&&!n.has(r))throw m(`local-network HTTP resolved to public address ${s}`)}return o}import{request as Ot}from"node:http";import{request as Mt}from"node:https";import{isIP as be}from"node:net";import{once as $t}from"node:events";function we(e,t,r){return{dispatch(n,o){let i,s=!1,a=u=>{s||(s=!0,i?.destroy(),o.onError(u))},c=t[0];if(!c||!be(c)||new URL(n.origin).origin!==e.origin)return queueMicrotask(()=>a(new Error("Provider connection has no authorized pinned address"))),!0;let l=n.headers??{},p=(e.protocol==="https:"?Mt:Ot)(new URL(n.path,e.origin),{method:n.method,headers:l,agent:!1,rejectUnauthorized:!0,lookup:(u,g,R)=>{let h={address:c,family:be(c)};typeof g=="object"&&g.all?R(null,[h]):R(null,c,h.family)}},u=>{i=u;let g=u.rawHeaders.map(h=>Buffer.from(h)),R=()=>u.resume();o.onHeaders(u.statusCode??500,g,R,u.statusMessage??"")===!1&&u.pause(),u.on("data",h=>{o.onData(h)||u.pause()}),u.on("end",()=>{s||(s=!0,o.onComplete(u.rawTrailers.map(h=>Buffer.from(h))))}),u.on("error",a),u.on("aborted",()=>a(new Error("Provider response was interrupted")))});return p.on("socket",u=>{u.once("connect",()=>{if(!u.remoteAddress||w(u.remoteAddress)!==w(c)){p.destroy(new Error("Provider socket did not connect to its authorized address"));return}e.protocol==="http:"&&r?.()}),e.protocol==="https:"&&u.once("secureConnect",()=>{u.authorized&&u.remoteAddress&&w(u.remoteAddress)===w(c)&&r?.()})}),p.on("error",a),o.onConnect(u=>p.destroy(u??new Error("Provider request aborted"))),(async()=>{try{let u=n.body;if(typeof u=="string"||u instanceof Uint8Array)p.end(u);else{if(u)for await(let g of u){if(p.destroyed)return;p.write(g)||await $t(p,"drain")}p.end()}}catch(u){p.destroy(u instanceof Error?u:new Error("Provider request body failed"))}})(),!0}}}async function Hn(e,t,r={}){let n=new URL(e.toString()),o=new URL(n);o.search="",o.hash="",he(o.toString(),r.policy),t.signal?.throwIfAborted();let i=await Re(Ee(o,r.policy),t.signal);if(!i.length)throw new Error("Pinned endpoint resolution returned no addresses.");if(r.authorizeAddress&&i.some(c=>r.authorizeAddress(w(c),new URL(n))!==!0))throw new Error("Pinned endpoint resolved outside the authorized address scope.");t.signal?.throwIfAborted();let s=fetch(n,{...t,redirect:"manual",credentials:"omit",dispatcher:we(n,i)});s.then(c=>{t.signal?.aborted&&c.body?.cancel().catch(()=>{})},()=>{});let a=await Re(s,t.signal);if(a.redirected)throw await a.body?.cancel(),new Error("Pinned endpoint transport followed a redirect without authorization.");return a}async function Re(e,t){if(!t)return e;let r,n=new Promise((o,i)=>{r=()=>i(t.reason??new Error("Pinned endpoint read cancelled.")),t.addEventListener("abort",r,{once:!0}),t.aborted&&r()});try{return await Promise.race([e,n])}finally{t.removeEventListener("abort",r)}}export{C as ApiTransientError,Rr as HOME_DIR,br as IS_LINUX,Er as IS_MAC,v as IS_WINDOWS,tt as LogLevel,wr as OS_VERSION,X as PLATFORM,Kr as accountTextTokens,zt as appendDurableLine,Ft as appendLine,an as benchmarkLeakError,gn as buildToolResultBlock,At as buildToolResultText,Qr as calculateCost,cn as commandMentionsBenchmarkLeak,ft as conservativeTokenAccountingAdapter,nn as copyTextToClipboard,Mr as createSafeRegex,Br as debug,ke as decodeTextBuffer,Zt as deleteDir,Yt as deleteFile,Se as detectLineEnding,qt as detectPreferredLineEnding,Pe as detectTextEncoding,Ce as encodeTextBuffer,$ as ensureDir,zr as error,pt as estimateTokens,lt as estimateTokensForModel,Wt as existsSync,Hn as fetchPinnedEndpoint,sn as filterBenchmarkLeakPaths,Vt as findSimilarFile,Yr as fitsInBudget,en as formatCost,xr as getAgentHome,un as getBenchmarkReferenceOverwriteHint,Or as getBoolean,Tr as getConfigDir,Dr as getLogLevel,Ir as getNumber,_r as getProjectConfigDir,re as getRetryErrorContext,vr as getShellName,Sr as getString,fn as getToolResultTransportContent,Bt as hasDir,hn as hasDisallowedAsciiControlCharacter,Dt as hasFile,ir as hasFrontmatter,Ht as hasMixedLineEndings,pn as hasNonTextToolResultContent,ct as hasTransientStatusMention,Xr as info,de as isBenchmarkLeakPath,ue as isBenchmarkMode,Ar as isGitRepo,Pr as isGitRepoAsync,Be as isPathSafe,ut as isRetryableError,Gt as listDirs,Kt as listFiles,Ie as normalizeLineEndings,Ur as normalizeXenoRequestContext,nr as parseDocument,tr as parseJsonLines,cr as pathIdentityKey,Xt as readFileSafe,jt as readIfExists,Oe as readTextFile,Zr as remainingBudget,Ae as renameReplacingWithRetry,Qt as safeJsonParse,er as safeJsonStringify,$r as safeRegexTest,ar as safeResolvePath,Lr as setLogLevel,or as stringifyDocument,mn as toTransportAssistantBlocks,vt as toolAssistantContentToText,ln as toolResultContentToText,Gr as truncateToTokens,et as validateRegexPattern,Cr as validateRequired,Fr as warn,jr as withRetry,Te as writeAtomic,Ut as writeTextFile,qr as xenoRequestContextHeaders};
@@ -1 +1 @@
1
- {"inputs":{"src/utils/fs.ts":{"bytes":13355,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":1762,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/validation.ts":{"bytes":5336,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/utils/request-context.ts":{"bytes":3679,"imports":[],"format":"esm"},"src/utils/retry.ts":{"bytes":13190,"imports":[],"format":"esm"},"src/utils/tokens.ts":{"bytes":3207,"imports":[],"format":"esm"},"src/utils/cost.ts":{"bytes":1826,"imports":[],"format":"esm"},"src/utils/clipboard.ts":{"bytes":1156,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/benchmark-safety.ts":{"bytes":6542,"imports":[],"format":"esm"},"src/utils/tool-result-content.ts":{"bytes":4820,"imports":[],"format":"esm"},"src/utils/text-security.ts":{"bytes":809,"imports":[],"format":"esm"},"src/utils/index.ts":{"bytes":1491,"imports":[{"path":"src/utils/fs.ts","kind":"import-statement","original":"./fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"./json.js"},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"./yaml.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"./path-security.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"./platform.js"},{"path":"src/utils/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"./logger.js"},{"path":"src/utils/request-context.ts","kind":"import-statement","original":"./request-context.js"},{"path":"src/utils/retry.ts","kind":"import-statement","original":"./retry.js"},{"path":"src/utils/tokens.ts","kind":"import-statement","original":"./tokens.js"},{"path":"src/utils/cost.ts","kind":"import-statement","original":"./cost.js"},{"path":"src/utils/clipboard.ts","kind":"import-statement","original":"./clipboard.js"},{"path":"src/utils/benchmark-safety.ts","kind":"import-statement","original":"./benchmark-safety.js"},{"path":"src/utils/tool-result-content.ts","kind":"import-statement","original":"./tool-result-content.js"},{"path":"src/utils/text-security.ts","kind":"import-statement","original":"./text-security.js"}],"format":"esm"}},"outputs":{"dist/utils/index.cjs":{"imports":[{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/utils/index.ts","inputs":{"src/utils/index.ts":{"bytesInOutput":2096},"src/utils/fs.ts":{"bytesInOutput":4727},"src/utils/json.ts":{"bytesInOutput":239},"src/utils/yaml.ts":{"bytesInOutput":2639},"src/utils/path-security.ts":{"bytesInOutput":403},"src/utils/platform.ts":{"bytesInOutput":687},"src/utils/validation.ts":{"bytesInOutput":1425},"src/utils/logger.ts":{"bytesInOutput":915},"src/utils/request-context.ts":{"bytesInOutput":1241},"src/utils/retry.ts":{"bytesInOutput":3396},"src/utils/tokens.ts":{"bytesInOutput":904},"src/utils/cost.ts":{"bytesInOutput":933},"src/utils/clipboard.ts":{"bytesInOutput":604},"src/utils/benchmark-safety.ts":{"bytesInOutput":3108},"src/utils/tool-result-content.ts":{"bytesInOutput":2118},"src/utils/text-security.ts":{"bytesInOutput":180}},"bytes":27668}}}
1
+ {"inputs":{"src/utils/fs.ts":{"bytes":13746,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":1762,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/process-tree-kill.ts":{"bytes":9124,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/platform.ts":{"bytes":9633,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"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},{"path":"src/runtime/process-tree-kill.ts","kind":"import-statement","original":"../runtime/process-tree-kill.js"}],"format":"esm"},"src/utils/validation.ts":{"bytes":5336,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/utils/request-context.ts":{"bytes":3679,"imports":[],"format":"esm"},"src/utils/retry.ts":{"bytes":13190,"imports":[],"format":"esm"},"src/utils/tokens.ts":{"bytes":3207,"imports":[],"format":"esm"},"src/utils/cost.ts":{"bytes":1826,"imports":[],"format":"esm"},"src/utils/clipboard.ts":{"bytes":1156,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/benchmark-safety.ts":{"bytes":6542,"imports":[],"format":"esm"},"src/utils/tool-result-content.ts":{"bytes":4820,"imports":[],"format":"esm"},"src/utils/text-security.ts":{"bytes":809,"imports":[],"format":"esm"},"src/observability/telemetry.ts":{"bytes":7271,"imports":[{"path":"node:perf_hooks","kind":"import-statement","external":true}],"format":"esm"},"src/observability/index.ts":{"bytes":32,"imports":[{"path":"src/observability/telemetry.ts","kind":"import-statement","original":"./telemetry.js"}],"format":"esm"},"src/utils/context-overflow-phrases.ts":{"bytes":2266,"imports":[],"format":"esm"},"src/providers/provider-error-redaction.ts":{"bytes":9369,"imports":[],"format":"esm"},"src/providers/provider-errors.ts":{"bytes":19820,"imports":[{"path":"src/observability/index.ts","kind":"import-statement","original":"../observability/index.js"},{"path":"src/utils/context-overflow-phrases.ts","kind":"import-statement","original":"../utils/context-overflow-phrases.js"},{"path":"src/providers/provider-error-redaction.ts","kind":"import-statement","original":"./provider-error-redaction.js"}],"format":"esm"},"src/providers/endpoint-policy.ts":{"bytes":6439,"imports":[{"path":"node:dns/promises","kind":"import-statement","external":true},{"path":"node:net","kind":"import-statement","external":true},{"path":"src/providers/provider-errors.ts","kind":"import-statement","original":"./provider-errors.js"}],"format":"esm"},"src/providers/pinned-provider-dispatcher.ts":{"bytes":4419,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"node:https","kind":"import-statement","external":true},{"path":"node:net","kind":"import-statement","external":true},{"path":"node:events","kind":"import-statement","external":true},{"path":"src/providers/endpoint-policy.ts","kind":"import-statement","original":"./endpoint-policy.js"}],"format":"esm"},"src/utils/pinned-fetch.ts":{"bytes":2516,"imports":[{"path":"src/providers/endpoint-policy.ts","kind":"import-statement","original":"../providers/endpoint-policy.js"},{"path":"src/providers/pinned-provider-dispatcher.ts","kind":"import-statement","original":"../providers/pinned-provider-dispatcher.js"}],"format":"esm"},"src/utils/index.ts":{"bytes":1526,"imports":[{"path":"src/utils/fs.ts","kind":"import-statement","original":"./fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"./json.js"},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"./yaml.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"./path-security.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"./platform.js"},{"path":"src/utils/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"./logger.js"},{"path":"src/utils/request-context.ts","kind":"import-statement","original":"./request-context.js"},{"path":"src/utils/retry.ts","kind":"import-statement","original":"./retry.js"},{"path":"src/utils/tokens.ts","kind":"import-statement","original":"./tokens.js"},{"path":"src/utils/cost.ts","kind":"import-statement","original":"./cost.js"},{"path":"src/utils/clipboard.ts","kind":"import-statement","original":"./clipboard.js"},{"path":"src/utils/benchmark-safety.ts","kind":"import-statement","original":"./benchmark-safety.js"},{"path":"src/utils/tool-result-content.ts","kind":"import-statement","original":"./tool-result-content.js"},{"path":"src/utils/text-security.ts","kind":"import-statement","original":"./text-security.js"},{"path":"src/utils/pinned-fetch.ts","kind":"import-statement","original":"./pinned-fetch.js"}],"format":"esm"}},"outputs":{"dist/utils/index.cjs":{"imports":[{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:fs/promises","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"node:os","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:fs","kind":"require-call","external":true},{"path":"node:path","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:child_process","kind":"require-call","external":true},{"path":"node:dns/promises","kind":"require-call","external":true},{"path":"node:net","kind":"require-call","external":true},{"path":"node:http","kind":"require-call","external":true},{"path":"node:https","kind":"require-call","external":true},{"path":"node:net","kind":"require-call","external":true},{"path":"node:events","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/utils/index.ts","inputs":{"src/utils/index.ts":{"bytesInOutput":2154},"src/utils/fs.ts":{"bytesInOutput":4926},"src/utils/json.ts":{"bytesInOutput":239},"src/utils/yaml.ts":{"bytesInOutput":2651},"src/utils/path-security.ts":{"bytesInOutput":405},"src/utils/platform.ts":{"bytesInOutput":2666},"src/runtime/process-tree-kill.ts":{"bytesInOutput":1696},"src/utils/validation.ts":{"bytesInOutput":1425},"src/utils/logger.ts":{"bytesInOutput":915},"src/utils/request-context.ts":{"bytesInOutput":1241},"src/utils/retry.ts":{"bytesInOutput":3396},"src/utils/tokens.ts":{"bytesInOutput":904},"src/utils/cost.ts":{"bytesInOutput":933},"src/utils/clipboard.ts":{"bytesInOutput":604},"src/utils/benchmark-safety.ts":{"bytesInOutput":3108},"src/utils/tool-result-content.ts":{"bytesInOutput":2118},"src/utils/text-security.ts":{"bytesInOutput":180},"src/providers/endpoint-policy.ts":{"bytesInOutput":3297},"src/observability/index.ts":{"bytesInOutput":0},"src/providers/provider-error-redaction.ts":{"bytesInOutput":2155},"src/providers/provider-errors.ts":{"bytesInOutput":513},"src/providers/pinned-provider-dispatcher.ts":{"bytesInOutput":1669},"src/utils/pinned-fetch.ts":{"bytesInOutput":1027}},"bytes":40310}}}
@@ -1 +1 @@
1
- {"inputs":{"src/utils/fs.ts":{"bytes":13355,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":1762,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/platform.ts":{"bytes":5600,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/validation.ts":{"bytes":5336,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/utils/request-context.ts":{"bytes":3679,"imports":[],"format":"esm"},"src/utils/retry.ts":{"bytes":13190,"imports":[],"format":"esm"},"src/utils/tokens.ts":{"bytes":3207,"imports":[],"format":"esm"},"src/utils/cost.ts":{"bytes":1826,"imports":[],"format":"esm"},"src/utils/clipboard.ts":{"bytes":1156,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/benchmark-safety.ts":{"bytes":6542,"imports":[],"format":"esm"},"src/utils/tool-result-content.ts":{"bytes":4820,"imports":[],"format":"esm"},"src/utils/text-security.ts":{"bytes":809,"imports":[],"format":"esm"},"src/utils/index.ts":{"bytes":1491,"imports":[{"path":"src/utils/fs.ts","kind":"import-statement","original":"./fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"./json.js"},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"./yaml.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"./path-security.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"./platform.js"},{"path":"src/utils/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"./logger.js"},{"path":"src/utils/request-context.ts","kind":"import-statement","original":"./request-context.js"},{"path":"src/utils/retry.ts","kind":"import-statement","original":"./retry.js"},{"path":"src/utils/tokens.ts","kind":"import-statement","original":"./tokens.js"},{"path":"src/utils/cost.ts","kind":"import-statement","original":"./cost.js"},{"path":"src/utils/clipboard.ts","kind":"import-statement","original":"./clipboard.js"},{"path":"src/utils/benchmark-safety.ts","kind":"import-statement","original":"./benchmark-safety.js"},{"path":"src/utils/tool-result-content.ts","kind":"import-statement","original":"./tool-result-content.js"},{"path":"src/utils/text-security.ts","kind":"import-statement","original":"./text-security.js"}],"format":"esm"}},"outputs":{"dist/utils/index.js":{"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true}],"exports":["ApiTransientError","HOME_DIR","IS_LINUX","IS_MAC","IS_WINDOWS","LogLevel","OS_VERSION","PLATFORM","accountTextTokens","appendDurableLine","appendLine","benchmarkLeakError","buildToolResultBlock","buildToolResultText","calculateCost","commandMentionsBenchmarkLeak","conservativeTokenAccountingAdapter","copyTextToClipboard","createSafeRegex","debug","decodeTextBuffer","deleteDir","deleteFile","detectLineEnding","detectPreferredLineEnding","detectTextEncoding","encodeTextBuffer","ensureDir","error","estimateTokens","estimateTokensForModel","existsSync","filterBenchmarkLeakPaths","findSimilarFile","fitsInBudget","formatCost","getAgentHome","getBenchmarkReferenceOverwriteHint","getBoolean","getConfigDir","getLogLevel","getNumber","getProjectConfigDir","getRetryErrorContext","getShellName","getString","getToolResultTransportContent","hasDir","hasDisallowedAsciiControlCharacter","hasFile","hasFrontmatter","hasMixedLineEndings","hasNonTextToolResultContent","hasTransientStatusMention","info","isBenchmarkLeakPath","isBenchmarkMode","isGitRepo","isPathSafe","isRetryableError","listDirs","listFiles","normalizeLineEndings","normalizeXenoRequestContext","parseDocument","parseJsonLines","pathIdentityKey","readFileSafe","readIfExists","readTextFile","remainingBudget","renameReplacingWithRetry","safeJsonParse","safeJsonStringify","safeRegexTest","safeResolvePath","setLogLevel","stringifyDocument","toTransportAssistantBlocks","toolAssistantContentToText","toolResultContentToText","truncateToTokens","validateRegexPattern","validateRequired","warn","withRetry","writeAtomic","writeTextFile","xenoRequestContextHeaders"],"entryPoint":"src/utils/index.ts","inputs":{"src/utils/fs.ts":{"bytesInOutput":4680},"src/utils/index.ts":{"bytesInOutput":0},"src/utils/json.ts":{"bytesInOutput":239},"src/utils/yaml.ts":{"bytesInOutput":2639},"src/utils/path-security.ts":{"bytesInOutput":401},"src/utils/platform.ts":{"bytesInOutput":630},"src/utils/validation.ts":{"bytesInOutput":1425},"src/utils/logger.ts":{"bytesInOutput":915},"src/utils/request-context.ts":{"bytesInOutput":1241},"src/utils/retry.ts":{"bytesInOutput":3393},"src/utils/tokens.ts":{"bytesInOutput":904},"src/utils/cost.ts":{"bytesInOutput":933},"src/utils/clipboard.ts":{"bytesInOutput":601},"src/utils/benchmark-safety.ts":{"bytesInOutput":3090},"src/utils/tool-result-content.ts":{"bytesInOutput":2115},"src/utils/text-security.ts":{"bytesInOutput":180}},"bytes":25370}}}
1
+ {"inputs":{"src/utils/fs.ts":{"bytes":13746,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/utils/json.ts":{"bytes":804,"imports":[],"format":"esm"},"src/utils/yaml.ts":{"bytes":5506,"imports":[],"format":"esm"},"src/utils/path-security.ts":{"bytes":1762,"imports":[{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"src/runtime/process-tree-kill.ts":{"bytes":9124,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/platform.ts":{"bytes":9633,"imports":[{"path":"node:os","kind":"import-statement","external":true},{"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},{"path":"src/runtime/process-tree-kill.ts","kind":"import-statement","original":"../runtime/process-tree-kill.js"}],"format":"esm"},"src/utils/validation.ts":{"bytes":5336,"imports":[],"format":"esm"},"src/utils/logger.ts":{"bytes":3719,"imports":[],"format":"esm"},"src/utils/request-context.ts":{"bytes":3679,"imports":[],"format":"esm"},"src/utils/retry.ts":{"bytes":13190,"imports":[],"format":"esm"},"src/utils/tokens.ts":{"bytes":3207,"imports":[],"format":"esm"},"src/utils/cost.ts":{"bytes":1826,"imports":[],"format":"esm"},"src/utils/clipboard.ts":{"bytes":1156,"imports":[{"path":"node:child_process","kind":"import-statement","external":true}],"format":"esm"},"src/utils/benchmark-safety.ts":{"bytes":6542,"imports":[],"format":"esm"},"src/utils/tool-result-content.ts":{"bytes":4820,"imports":[],"format":"esm"},"src/utils/text-security.ts":{"bytes":809,"imports":[],"format":"esm"},"src/observability/telemetry.ts":{"bytes":7271,"imports":[{"path":"node:perf_hooks","kind":"import-statement","external":true}],"format":"esm"},"src/observability/index.ts":{"bytes":32,"imports":[{"path":"src/observability/telemetry.ts","kind":"import-statement","original":"./telemetry.js"}],"format":"esm"},"src/utils/context-overflow-phrases.ts":{"bytes":2266,"imports":[],"format":"esm"},"src/providers/provider-error-redaction.ts":{"bytes":9369,"imports":[],"format":"esm"},"src/providers/provider-errors.ts":{"bytes":19820,"imports":[{"path":"src/observability/index.ts","kind":"import-statement","original":"../observability/index.js"},{"path":"src/utils/context-overflow-phrases.ts","kind":"import-statement","original":"../utils/context-overflow-phrases.js"},{"path":"src/providers/provider-error-redaction.ts","kind":"import-statement","original":"./provider-error-redaction.js"}],"format":"esm"},"src/providers/endpoint-policy.ts":{"bytes":6439,"imports":[{"path":"node:dns/promises","kind":"import-statement","external":true},{"path":"node:net","kind":"import-statement","external":true},{"path":"src/providers/provider-errors.ts","kind":"import-statement","original":"./provider-errors.js"}],"format":"esm"},"src/providers/pinned-provider-dispatcher.ts":{"bytes":4419,"imports":[{"path":"node:http","kind":"import-statement","external":true},{"path":"node:https","kind":"import-statement","external":true},{"path":"node:net","kind":"import-statement","external":true},{"path":"node:events","kind":"import-statement","external":true},{"path":"src/providers/endpoint-policy.ts","kind":"import-statement","original":"./endpoint-policy.js"}],"format":"esm"},"src/utils/pinned-fetch.ts":{"bytes":2516,"imports":[{"path":"src/providers/endpoint-policy.ts","kind":"import-statement","original":"../providers/endpoint-policy.js"},{"path":"src/providers/pinned-provider-dispatcher.ts","kind":"import-statement","original":"../providers/pinned-provider-dispatcher.js"}],"format":"esm"},"src/utils/index.ts":{"bytes":1526,"imports":[{"path":"src/utils/fs.ts","kind":"import-statement","original":"./fs.js"},{"path":"src/utils/json.ts","kind":"import-statement","original":"./json.js"},{"path":"src/utils/yaml.ts","kind":"import-statement","original":"./yaml.js"},{"path":"src/utils/path-security.ts","kind":"import-statement","original":"./path-security.js"},{"path":"src/utils/platform.ts","kind":"import-statement","original":"./platform.js"},{"path":"src/utils/validation.ts","kind":"import-statement","original":"./validation.js"},{"path":"src/utils/logger.ts","kind":"import-statement","original":"./logger.js"},{"path":"src/utils/request-context.ts","kind":"import-statement","original":"./request-context.js"},{"path":"src/utils/retry.ts","kind":"import-statement","original":"./retry.js"},{"path":"src/utils/tokens.ts","kind":"import-statement","original":"./tokens.js"},{"path":"src/utils/cost.ts","kind":"import-statement","original":"./cost.js"},{"path":"src/utils/clipboard.ts","kind":"import-statement","original":"./clipboard.js"},{"path":"src/utils/benchmark-safety.ts","kind":"import-statement","original":"./benchmark-safety.js"},{"path":"src/utils/tool-result-content.ts","kind":"import-statement","original":"./tool-result-content.js"},{"path":"src/utils/text-security.ts","kind":"import-statement","original":"./text-security.js"},{"path":"src/utils/pinned-fetch.ts","kind":"import-statement","original":"./pinned-fetch.js"}],"format":"esm"}},"outputs":{"dist/utils/index.js":{"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:fs/promises","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"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},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:dns/promises","kind":"import-statement","external":true},{"path":"node:net","kind":"import-statement","external":true},{"path":"node:http","kind":"import-statement","external":true},{"path":"node:https","kind":"import-statement","external":true},{"path":"node:net","kind":"import-statement","external":true},{"path":"node:events","kind":"import-statement","external":true}],"exports":["ApiTransientError","HOME_DIR","IS_LINUX","IS_MAC","IS_WINDOWS","LogLevel","OS_VERSION","PLATFORM","accountTextTokens","appendDurableLine","appendLine","benchmarkLeakError","buildToolResultBlock","buildToolResultText","calculateCost","commandMentionsBenchmarkLeak","conservativeTokenAccountingAdapter","copyTextToClipboard","createSafeRegex","debug","decodeTextBuffer","deleteDir","deleteFile","detectLineEnding","detectPreferredLineEnding","detectTextEncoding","encodeTextBuffer","ensureDir","error","estimateTokens","estimateTokensForModel","existsSync","fetchPinnedEndpoint","filterBenchmarkLeakPaths","findSimilarFile","fitsInBudget","formatCost","getAgentHome","getBenchmarkReferenceOverwriteHint","getBoolean","getConfigDir","getLogLevel","getNumber","getProjectConfigDir","getRetryErrorContext","getShellName","getString","getToolResultTransportContent","hasDir","hasDisallowedAsciiControlCharacter","hasFile","hasFrontmatter","hasMixedLineEndings","hasNonTextToolResultContent","hasTransientStatusMention","info","isBenchmarkLeakPath","isBenchmarkMode","isGitRepo","isGitRepoAsync","isPathSafe","isRetryableError","listDirs","listFiles","normalizeLineEndings","normalizeXenoRequestContext","parseDocument","parseJsonLines","pathIdentityKey","readFileSafe","readIfExists","readTextFile","remainingBudget","renameReplacingWithRetry","safeJsonParse","safeJsonStringify","safeRegexTest","safeResolvePath","setLogLevel","stringifyDocument","toTransportAssistantBlocks","toolAssistantContentToText","toolResultContentToText","truncateToTokens","validateRegexPattern","validateRequired","warn","withRetry","writeAtomic","writeTextFile","xenoRequestContextHeaders"],"entryPoint":"src/utils/index.ts","inputs":{"src/utils/fs.ts":{"bytesInOutput":4870},"src/utils/index.ts":{"bytesInOutput":0},"src/utils/json.ts":{"bytesInOutput":239},"src/utils/yaml.ts":{"bytesInOutput":2639},"src/utils/path-security.ts":{"bytesInOutput":401},"src/utils/platform.ts":{"bytesInOutput":2607},"src/runtime/process-tree-kill.ts":{"bytesInOutput":1708},"src/utils/validation.ts":{"bytesInOutput":1425},"src/utils/logger.ts":{"bytesInOutput":915},"src/utils/request-context.ts":{"bytesInOutput":1241},"src/utils/retry.ts":{"bytesInOutput":3399},"src/utils/tokens.ts":{"bytesInOutput":904},"src/utils/cost.ts":{"bytesInOutput":933},"src/utils/clipboard.ts":{"bytesInOutput":601},"src/utils/benchmark-safety.ts":{"bytesInOutput":3114},"src/utils/tool-result-content.ts":{"bytesInOutput":2118},"src/utils/text-security.ts":{"bytesInOutput":180},"src/providers/endpoint-policy.ts":{"bytesInOutput":3270},"src/observability/index.ts":{"bytesInOutput":0},"src/providers/provider-error-redaction.ts":{"bytesInOutput":2155},"src/providers/provider-errors.ts":{"bytesInOutput":513},"src/providers/pinned-provider-dispatcher.ts":{"bytesInOutput":1672},"src/utils/pinned-fetch.ts":{"bytesInOutput":1027}},"bytes":37965}}}
@@ -69,7 +69,7 @@
69
69
  - Security/resource-limit tests: finite native event queue, bounded early buffer, hash mismatch rejection, malformed manifest rejection, installed unsigned artifact rejection, and isolated Linux AddressSanitizer/UndefinedBehaviorSanitizer smoke plus stress execution.
70
70
  - Cross-platform results: Windows x64, Linux x64, and Linux arm64 local/container pass; Windows arm64 and macOS x64/arm64 matrix runs pending.
71
71
  - Performance comparison: 25 rapid real-PTY cycles pass with native active-state count returning to zero. The current Windows MSVC artifact measures startup p50/p95 35.31/359.15 ms and approximately 2.6 MB/s observed output; the Linux x64 baseline measures p50/p95 14.76/17.55 ms and approximately 32.6 MB/s. Linux arm64 under emulation measures p50/p95 556.17/612.07 ms and approximately 1.64 MB/s. The dependency-free benchmark enforces conservative CI limits of 2,000 ms p95 and 1 MiB/s; a product-approved comparative release envelope remains pending.
72
- - Bundle/native/SBOM evidence: artifact audit records Xeno-owned Windows x64 SHA-256 `91d9a464823091603d784cbc3a570b8a0e514576eeb4b8fb2aabcdcbb64bccad` from source SHA-256 `9f6f6248f35f2f6b767b153f66670d5ed8f95cb7d6242c77c652efe5cca2d038`, Linux x64 SHA-256 `a93757b552cb9236fe33773228072df270659d6a015a92fb96d21a9d22c5f2cb`, and Linux arm64 SHA-256 `07f660ac0c32ac7a2900f3abdfa12550f603880f02a1763a12a63064fe802006`; both Linux artifacts derive from source SHA-256 `6ba69e62cf0c0765546afa19f1820c1cc7f64f452802718c20b4a117d6c8f9c6`. The Windows PE imports only `KERNEL32.dll`; two local native rebuilds are byte-identical. Clean Debian candidates execute Linux x64 and Linux arm64 self-contained payloads. The exact cross-built Windows x64 payload (`21386d53c04116f4904da186c873089aac4db57c02281da2c14f615a50a9b616`) executes on Windows with a byte-matching extracted addon and healthy ConPTY diagnostics. The Linux arm64 payload SHA-256 is `92a8583433aec8415c1405b56ad5afe39f7560c216eac4e46684fb03041e6346`. Paired release verification correctly stops at the strict unsigned-native gate; see `docs/compliance/linux-package-candidate.md` and `docs/compliance/linux-arm64-package-candidate.md`. Clean signed-install smoke remains pending.
72
+ - Bundle/native/SBOM evidence: artifact audit records Xeno-owned Windows x64 SHA-256 `91d9a464823091603d784cbc3a570b8a0e514576eeb4b8fb2aabcdcbb64bccad` from source SHA-256 `9f6f6248f35f2f6b767b153f66670d5ed8f95cb7d6242c77c652efe5cca2d038`, Linux x64 SHA-256 `a93757b552cb9236fe33773228072df270659d6a015a92fb96d21a9d22c5f2cb`, and Linux arm64 SHA-256 `07f660ac0c32ac7a2900f3abdfa12550f603880f02a1763a12a63064fe802006`; both Linux artifacts derive from source SHA-256 `6ba69e62cf0c0765546afa19f1820c1cc7f64f452802718c20b4a117d6c8f9c6`. The Windows PE imports only `KERNEL32.dll`; two local native rebuilds are byte-identical. Clean Debian candidates execute Linux x64 and Linux arm64 self-contained payloads. The exact cross-built Windows x64 payload (`21386d53c04116f4904da186c873089aac4db57c02281da2c14f615a50a9b616`) executes on Windows with a byte-matching extracted addon and healthy ConPTY diagnostics. The Linux arm64 payload SHA-256 is `92a8583433aec8415c1405b56ad5afe39f7560c216eac4e46684fb03041e6346`. Paired release verification correctly stops at the strict unsigned-native gate; see `docs/compliance/memos/linux-package-candidate.md` and `docs/compliance/memos/linux-arm64-package-candidate.md`. Clean signed-install smoke remains pending.
73
73
 
74
74
  ## Open legal or provenance questions
75
75
 
@@ -2,7 +2,7 @@
2
2
  "$schema": "./ownership-policy.schema.json",
3
3
  "schemaVersion": 1,
4
4
  "policyId": "xeno-agent-proprietary-v1",
5
- "policyRevision": 13,
5
+ "policyRevision": 14,
6
6
  "canonicalLocation": "xeno-agent-sdk/ownership/ownership-policy.json",
7
7
  "mirrorLocations": [
8
8
  "xeno-agent-cli/apps/xeno-agent-cli/ownership/ownership-policy.json"
@@ -22,7 +22,7 @@
22
22
  "sourceRoots": [
23
23
  "src"
24
24
  ],
25
- "reportDirectory": "docs/compliance"
25
+ "reportDirectory": "docs/compliance/memos"
26
26
  },
27
27
  "cli": {
28
28
  "label": "@xenosystem/agent-cli",
@@ -37,7 +37,7 @@
37
37
  "additionalOwnedSourceRoots": [
38
38
  "../xeno-agent-sdk/src"
39
39
  ],
40
- "reportDirectory": "docs/compliance"
40
+ "reportDirectory": "docs/compliance/memos"
41
41
  }
42
42
  },
43
43
  "runtimeComponents": [
@@ -101,6 +101,17 @@
101
101
  "replacement": "standalone-runtime-network-boundary",
102
102
  "expiresAtMilestone": "PROPRIETARY-RUNTIME-1",
103
103
  "allowedThrough": "P2"
104
+ },
105
+ {
106
+ "name": "zod",
107
+ "classification": "external-runtime",
108
+ "license": "MIT",
109
+ "usedBy": [
110
+ "cli"
111
+ ],
112
+ "replacement": "xeno-owned-account-schema-boundary",
113
+ "expiresAtMilestone": "PROPRIETARY-RUNTIME-1",
114
+ "allowedThrough": "P2"
104
115
  }
105
116
  ],
106
117
  "builtinComponents": [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xenosystem/agent-sdk",
3
- "version": "0.10.35",
3
+ "version": "0.10.37",
4
4
  "description": "XENO Agent SDK built from the same engine as XENO CODE",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",