@kodax-ai/kodax 0.7.96-beta.9 → 0.7.96-rc.1

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 (60) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/README.md +12 -1
  3. package/README_CN.md +8 -2
  4. package/dist/chunks/{agent-4LNAAVUB.js → agent-4SHG4ZF3.js} +1 -1
  5. package/dist/chunks/argument-completer-2PP5RVZL.js +2 -0
  6. package/dist/chunks/{chunk-AE5YFXU2.js → chunk-3C6UWDAN.js} +1 -1
  7. package/dist/chunks/{chunk-7QJ4JHJE.js → chunk-5RFHTNGM.js} +49 -44
  8. package/dist/chunks/{chunk-OK4U4SXB.js → chunk-5TAC6EP7.js} +147 -147
  9. package/dist/chunks/{chunk-6HHZ6MJK.js → chunk-6EFXA3RL.js} +1 -1
  10. package/dist/chunks/chunk-GYU7ISNL.js +2 -0
  11. package/dist/chunks/chunk-HHC4AHAR.js +384 -0
  12. package/dist/chunks/{chunk-QP554CFT.js → chunk-I3V25QH4.js} +4 -4
  13. package/dist/chunks/{chunk-JOGZFXHZ.js → chunk-K5FIHIGU.js} +1 -1
  14. package/dist/chunks/{chunk-TWJINGV6.js → chunk-KVL2URPE.js} +1 -1
  15. package/dist/chunks/{chunk-A66CMPHV.js → chunk-N7UOIQZ3.js} +2 -2
  16. package/dist/chunks/{chunk-KSAXT7BU.js → chunk-R5XC57MT.js} +2 -2
  17. package/dist/chunks/chunk-UCXJSGBP.js +2 -0
  18. package/dist/chunks/{chunk-XIADYNRK.js → chunk-YDHLWJ2G.js} +2 -2
  19. package/dist/chunks/{chunk-ESDWXMTG.js → chunk-Z6QJ23NH.js} +157 -157
  20. package/dist/chunks/{construction-bootstrap-6UYNF7TE.js → construction-bootstrap-WRUX7JNC.js} +1 -1
  21. package/dist/chunks/dist-OMC2HWYN.js +2 -0
  22. package/dist/chunks/{host-2X5XUTXO.js → host-VEC4V223.js} +1 -1
  23. package/dist/chunks/{run-manager-6XOSEJOM.js → run-manager-5ASP2QKN.js} +1 -1
  24. package/dist/chunks/{utils-GIXQGDJZ.js → utils-MLWOBEIS.js} +1 -1
  25. package/dist/index.d.ts +8 -8
  26. package/dist/index.js +1 -1
  27. package/dist/kodax_bootstrap.js +1 -1
  28. package/dist/kodax_cli.js +1374 -1369
  29. package/dist/native/win32-x64/kodax-windows-sandbox.exe +0 -0
  30. package/dist/native/win32-x64/kodax-windows-text-transaction.node +0 -0
  31. package/dist/native/win32-x64/manifest.json +2 -2
  32. package/dist/runtime-worker.js +1272 -1267
  33. package/dist/sdk-a2a.d.ts +5 -5
  34. package/dist/sdk-a2a.js +1 -1
  35. package/dist/sdk-coding.d.ts +28 -9
  36. package/dist/sdk-coding.js +1 -1
  37. package/dist/sdk-repl.d.ts +9 -9
  38. package/dist/sdk-repl.js +1 -1
  39. package/dist/sdk-runtime.d.ts +7 -7
  40. package/dist/sdk-runtime.js +1 -1
  41. package/dist/sdk-sandbox.js +1 -1
  42. package/dist/sdk-session.d.ts +3 -3
  43. package/dist/sdk-session.js +1 -1
  44. package/dist/types-chunks/{bash-prefix-extractor.d-sWv2rlSu.d.ts → bash-prefix-extractor.d-BpkX_m32.d.ts} +10 -2
  45. package/dist/types-chunks/{exec-policy.d-BSvfbN6Q.d.ts → exec-policy.d-CUpkRfMQ.d.ts} +1 -1
  46. package/dist/types-chunks/{public-api.d-Cho7knWA.d.ts → public-api.d-DOytsyVd.d.ts} +1 -1
  47. package/dist/types-chunks/{sdk-session-DhuZ4cmv.d.ts → sdk-session-CMR2ywbU.d.ts} +1 -1
  48. package/dist/types-chunks/{shell-command-sets.d-L822XXSh.d.ts → shell-command-sets.d-DItZzPPU.d.ts} +1 -1
  49. package/dist/types-chunks/{trusted-repl-entry-DU1KJTbd.d.ts → trusted-repl-entry-BV_H1O0K.d.ts} +4 -4
  50. package/dist/types-chunks/{types.d-BhU-SIpK.d.ts → types.d-dg7QozSh.d.ts} +1 -1
  51. package/dist/types-chunks/{utils.d-DjOA100v.d.ts → utils.d-qUyeZgIo.d.ts} +3 -3
  52. package/package.json +3 -3
  53. package/public_docs/README.md +2 -2
  54. package/public_docs/configuration/permissions.md +23 -0
  55. package/public_docs/sdk/embedder-guide.md +9 -5
  56. package/dist/chunks/argument-completer-X4GJWD5E.js +0 -2
  57. package/dist/chunks/chunk-A42OYZUE.js +0 -384
  58. package/dist/chunks/chunk-Q4EZLR6T.js +0 -2
  59. package/dist/chunks/chunk-SMIOTGQ2.js +0 -2
  60. package/dist/chunks/dist-4O6MH6AE.js +0 -2
package/CHANGELOG.md CHANGED
@@ -8,6 +8,27 @@ All notable changes to this project will be documented in this file.
8
8
 
9
9
  ---
10
10
 
11
+ ## [0.7.96-rc.1] - 2026-09-12
12
+
13
+ First release candidate of the v0.7.96 line: trusted text authority is
14
+ unified across Runtime Sessions and direct SDK entries, and provider requests
15
+ carry live permission facts. Every beta.9 contract is retained. npm
16
+ publication remains a manual maintainer action.
17
+
18
+ ### Fixed
19
+
20
+ - Unify trusted text authority across Runtime Sessions and direct SDK entries.
21
+ Full Access now reaches native text transactions through `runKodaX`,
22
+ `runManagedTask`, and each `KodaXClient.send`. Auto-approved concrete text
23
+ calls can write their exact external target, including portable `tool_call`
24
+ dispatch, without granting a directory or reusing approval across operations
25
+ or Runs. Explicit denials and native integrity checks remain enforced.
26
+ - Include live host permission facts in direct and managed provider requests,
27
+ including retries, independently of configuration defaults and prompt
28
+ overrides. Runtime permission capability 6 fences older daemon authority.
29
+
30
+ ---
31
+
11
32
  ## [0.7.96-beta.9] - 2026-09-12
12
33
 
13
34
  Ninth beta pre-release of the v0.7.96 line, carrying FEATURE_299 (unified
package/README.md CHANGED
@@ -784,6 +784,17 @@ provider's model, REPL `/compact` clears the UI only after a durable save, and
784
784
  successful reports carry bounded `summaryRequests` plus `commitMs` per
785
785
  physical summary call.
786
786
 
787
+ **v0.7.96-rc.1 release:** First release candidate of the v0.7.96 line.
788
+ Unifies trusted text authority across Runtime Sessions and direct SDK
789
+ entries: Full Access reaches native text transactions through `runKodaX`,
790
+ `runManagedTask`, and each `KodaXClient.send`; auto-approved concrete text
791
+ calls write their exact external target, including portable `tool_call`
792
+ dispatch, without granting a directory or reusing approval across operations
793
+ or Runs; explicit denials and native integrity checks remain enforced.
794
+ Direct and managed provider requests carry live host permission facts,
795
+ refreshed on retries, and runtime permission capability 6 fences older
796
+ daemon authority.
797
+
787
798
  **v0.7.96-beta.9 release:** Ships FEATURE_299 — unified Stop, Full Access
788
799
  and extension execution contracts. Owned Run controls and atomic Session
789
800
  Stop work independently of file locks across direct CLI, SDK, daemon, and
@@ -860,7 +871,7 @@ requests, preserves structured Child Agent Provider failures, honors exact
860
871
  run-scoped credential verification, and omits empty `tools` arrays for strict
861
872
  vLLM gateways (Issues 329-332). npm publication remains a
862
873
  manual maintainer action. See the
863
- [release checklist](docs/release.md#v0796-beta9-release-preparation).
874
+ [release checklist](docs/release.md#v0796-rc1-release-preparation).
864
875
 
865
876
  **v0.7.96-alpha.3 release:** Provider credentials are lazy, scoped,
866
877
  revocable capabilities (ADR-068). The v2 credential broker keeps Provider
package/README_CN.md CHANGED
@@ -296,6 +296,13 @@ SDK 系统代码契约更新,但没有放宽 shell/sandbox 的 fail-closed 边
296
296
  `handleRuntimePermissionRequest()` 管理 SDK 权限 UI,并在 prepared Session 尾部遇到
297
297
  `data_changed` 时通过权威 delta 合并恢复;后台持久化失败会显示为诊断,不再静默丢失。
298
298
 
299
+ **v0.7.96-rc.1 发布**:v0.7.96 线首个发布候选。统一 Runtime Session 与直接
300
+ SDK 入口的可信文本授权:Full Access 通过 `runKodaX`、`runManagedTask` 与每个
301
+ `KodaXClient.send` 覆盖原生文本事务;自动批准的具体文本调用可写入其确切外部
302
+ 目标(包括可移植的 `tool_call` 分发),但不授予目录权限,也不会跨操作或跨 Run
303
+ 复用批准;显式拒绝与原生完整性校验继续生效。直接与托管 provider 请求携带实时
304
+ 宿主权限事实并在重试时刷新,runtime 权限 capability 6 阻止旧 daemon 提供该授权。
305
+
299
306
  **v0.7.96-beta.9 发布**:交付 FEATURE_299——统一 Stop、Full Access 与扩展
300
307
  执行契约。owned Run 控制与原子 Session Stop 不依赖文件锁,跨直接 CLI、SDK、
301
308
  daemon 与 ACP 宿主在单一"受理 vs 确认"Stop 契约下工作。Full Access 直接在
@@ -369,8 +376,7 @@ native 文本权威改在摘要固定的 `manylinux_2_28` 构建器中编译,
369
376
  scope 在 SDK、Agent 摘要、CLI 与 Runtime Worker 请求间共享,保留结构化的 Child Agent Provider
370
377
  失败信息,精确遵循 run-scoped 凭据校验,并为严格 vLLM 网关省略空 `tools` 数组(Issues 329-332)。
371
378
  npm 发布仍由
372
- npm 发布仍由
373
- 维护者手动执行。详见 [v0.7.96-beta.9 发布清单](docs/release.md#v0796-beta9-release-preparation)。
379
+ 维护者手动执行。详见 [v0.7.96-rc.1 发布清单](docs/release.md#v0796-rc1-release-preparation)。
374
380
 
375
381
  **v0.7.96-alpha.3 发布**:Provider 凭据成为惰性、受限、可撤销的能力(ADR-068)。v2
376
382
  credential broker 将 Provider 密钥保留在 OS keychain,按每次 wire call、为单一封闭
@@ -1,2 +1,2 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{Ka as g,Ma as h,a as c,ga as d,ha as e,ia as f,kb as i,lb as j,tb as k}from"./chunk-7QJ4JHJE.js";import"./chunk-JA2DY4EC.js";import"./chunk-ESDWXMTG.js";import"./chunk-5Z7OAIPW.js";import"./chunk-NYKZ6Z2Q.js";import{Ob as a,Pb as b}from"./chunk-P472TI5T.js";import"./chunk-WXBRPZMI.js";import"./chunk-V7ZTP5SV.js";import"./chunk-ONUPGMER.js";export{e as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,f as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,c as emitResilienceDebug,d as estimateProviderPayloadBytes,k as runKodaX,j as saveRequiredSessionSnapshot,i as saveSessionSnapshot,a as validateAndFixToolHistory};
2
+ import{La as g,Na as h,a as c,ha as d,ia as e,ja as f,lb as i,mb as j,ub as k}from"./chunk-5RFHTNGM.js";import"./chunk-JA2DY4EC.js";import"./chunk-Z6QJ23NH.js";import"./chunk-5Z7OAIPW.js";import"./chunk-NYKZ6Z2Q.js";import{Ob as a,Pb as b}from"./chunk-P472TI5T.js";import"./chunk-WXBRPZMI.js";import"./chunk-V7ZTP5SV.js";import"./chunk-ONUPGMER.js";export{e as bucketProviderPayloadSize,g as buildAutoRepoIntelligenceContext,f as checkPromiseSignal,b as cleanupIncompleteToolCalls,h as describeTransientProviderRetry,c as emitResilienceDebug,d as estimateProviderPayloadBytes,k as runKodaX,j as saveRequiredSessionSnapshot,i as saveSessionSnapshot,a as validateAndFixToolHistory};
@@ -0,0 +1,2 @@
1
+ // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
+ import{Ma as a,Na as b}from"./chunk-R5XC57MT.js";import"./chunk-YDHLWJ2G.js";import"./chunk-74UJ5IFX.js";import"./chunk-5TAC6EP7.js";import"./chunk-KVL2URPE.js";import"./chunk-N7UOIQZ3.js";import"./chunk-5RFHTNGM.js";import"./chunk-JA2DY4EC.js";import"./chunk-Z6QJ23NH.js";import"./chunk-5Z7OAIPW.js";import"./chunk-NYKZ6Z2Q.js";import"./chunk-P472TI5T.js";import"./chunk-WXBRPZMI.js";import"./chunk-V7ZTP5SV.js";import"./chunk-ONUPGMER.js";export{a as ArgumentCompleter,b as createArgumentCompleter};
@@ -1,5 +1,5 @@
1
1
  // @kodax-ai/kodax — bundled distribution. See docs/ADR.md ADR-022 + ADR-024.
2
- import{a as hn,b as vn,c as De,d as xn,e as kn,f as En,g as cr,h as Rn,k as en,l as lr,m as ur,n as fr,o as nn,p as wr}from"./chunk-6HHZ6MJK.js";import{Fc as dr,Ka as me,Ya as rr,_a as tr,ab as xe,bb as or,fb as Sn,hb as ke,kb as Oe,ob as ir,pb as sr,rb as ar,v as L}from"./chunk-P472TI5T.js";import{a}from"./chunk-ONUPGMER.js";import{spawn as qe,spawnSync as we}from"node:child_process";import{createHash as Xe,randomInt as jt,randomUUID as B}from"node:crypto";import{once as Ut}from"node:events";import{closeSync as Dn,constants as an,existsSync as qn,fsyncSync as Ft,lstatSync as ae,mkdirSync as qr,openSync as Xr,readFileSync as Ie,readSync as Vt,readdirSync as Jr,realpathSync as K,renameSync as Kt,rmSync as un,statSync as _e,writeFileSync as Hr,writeSync as qt}from"node:fs";import{copyFile as zr,lstat as Xt,mkdir as ne,readFile as Me,realpath as je,rm as H,stat as dn,writeFile as Ue}from"node:fs/promises";import{createRequire as Jt}from"node:module";import{createServer as Ht}from"node:net";import U from"node:os";import l from"node:path";import{lstatSync as vt,readFileSync as xt,readdirSync as pr,realpathSync as kt}from"node:fs";import C from"node:path";import{globSync as Et}from"glob";var Rt=[".ssh",".tsh",".brev",".gnupg",".aws",".azure",".kube",".docker",".config",".npm",".pki",".terraform.d"],At=new Set(["certificatefile","controlpath","globalknownhostsfile","identityagent","identityfile","revokedhostkeys","userknownhostsfile"]);function oe(e){try{return kt.native(e).toLowerCase()}catch(r){return["ENOENT","ENOTDIR"].includes(r.code??"")||L({source:"sandbox:ssh-config",level:"warn",message:`Cannot canonicalize SSH ACL path: ${e}`,detail:r}),C.resolve(e).toLowerCase()}}a(oe,"pathKey");function gr(e,r){return r===e||r.startsWith(e.endsWith(C.sep)?e:`${e}${C.sep}`)}a(gr,"inside");function Wt(e){let r=[],n="",t;for(let o=0;o<e.length;o+=1){let i=e[o];if(i==="#"&&t===void 0)break;if(i===t){t=void 0;continue}if((i==='"'||i==="'")&&t===void 0){t=i;continue}let s=e[o+1];i==="\\"&&s!==void 0&&(['"',"'","\\"].includes(s)||t===void 0&&s===" ")?(n+=s,o+=1):/\s/.test(i)&&t===void 0?(n&&r.push(n),n=""):n+=i}return n&&r.push(n),r}a(Wt,"sshWords");function Ct(e,r,n){if(e.toLowerCase()==="none")return;if(["~","%d","${HOME}"].includes(e))return r;let t=e.replace(/^(?:~|%d|\$\{HOME\})[/\\]/,`${r}${C.sep}`);return C.isAbsolute(t)?C.resolve(t):n===void 0?void 0:C.resolve(n,t)}a(Ct,"sshPath");function An(e,r,n,t,o=0){let i=oe(e);if(t.has(i))return;if(o>=32){L({source:"sandbox:ssh-config",level:"warn",message:`SSH Include depth limit reached; dependencies beyond this config were not inspected: ${e}`});return}t.add(i);let s;try{s=xt(e,"utf8")}catch(d){if(d.code==="ENOENT")return;L({source:"sandbox:ssh-config",level:"warn",message:`Cannot inspect SSH configuration dependencies: ${e}`,detail:d});return}for(let d of s.split(/\r?\n/)){let c=Wt(d.replace(/^(\s*[^\s=]+)\s*=\s*/,"$1 ")),u=c.shift()?.toLowerCase();if(u!==void 0)for(let f of c){let p=Ct(f,r,u==="include"?C.join(r,".ssh"):void 0);if(p!==void 0)if(u==="include")for(let g of Et(p.replace(/\\/g,"/"),{nodir:!0}))n.push(g),An(g,r,n,t,o+1);else At.has(u)&&n.push(p)}}}a(An,"visitSshConfig");function de(e){let r=[];An(C.join(e,".ssh","config"),e,r,new Set);let n=oe(e),t=Rt.map(o=>C.join(e,o));for(let o of r){let i=C.relative(n,oe(o));i&&!i.startsWith(`..${C.sep}`)&&i!==".."&&!C.isAbsolute(i)&&t.push(C.join(e,i.split(C.sep)[0]))}return[...new Set(t.map(o=>C.resolve(o)))]}a(de,"windowsSandboxAclExclusions");function mr(e){let r=[];An(C.join(e,".ssh","config"),e,r,new Set);let n=[C.join(e,".ssh")];for(;n.length>0;){let t=n.pop();r.push(t);let o;try{if(vt(t).isSymbolicLink())continue;o=pr(t,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")continue;throw i}for(let i of o){if(i.isSymbolicLink())continue;let s=C.join(t,i.name);r.push(s),i.isDirectory()&&n.push(s)}}return[...new Set(r.filter(t=>gr(oe(e),oe(t))))]}a(mr,"windowsSandboxSshCleanupRoots");function Ee(e,r,n){let t=oe(r),o=n.flatMap(s=>[C.resolve(s).toLowerCase(),oe(s)]),i=e.flatMap(s=>oe(s)===t?pr(r,{withFileTypes:!0}).filter(d=>!d.isSymbolicLink()).map(d=>C.join(r,d.name)):[s]);return[...new Set(i)].filter(s=>![C.resolve(s).toLowerCase(),oe(s)].some(c=>o.some(u=>gr(u,c))))}a(Ee,"windowsSandboxAclRoots");import{fileURLToPath as _r,pathToFileURL as Yr}from"node:url";import{realpathSync as Pt,statSync as Nt}from"node:fs";import _t from"node:path";function Wn(e){let r=e.code;return r==="ENOENT"||r==="ENOTDIR"}a(Wn,"isMissingGitTrustPath");function br(e,r,n){try{let t=r(e).replaceAll("\\","/").replace(/\/+$/,"");return t===""?void 0:/^[A-Za-z]:$/.test(t)?`${t}/`:t}catch(t){if(n(t))return;throw t}}a(br,"normalizeGitSafeDirectoryRootImplementation");function Tt(e){return br(e,Pt,Wn)}a(Tt,"normalizeGitSafeDirectoryRoot");function Sr(e,r,n,t){try{let i=r(n.join(e,".git"));if(i.isDirectory()||i.isFile())return!0}catch(i){if(!t(i))throw i}if(!(n.basename(e).toLowerCase()===".git"||/[/\\]\.git[/\\]modules[/\\]/i.test(e)))return!1;try{return r(n.join(e,"HEAD")).isFile()}catch(i){if(t(i))return!1;throw i}}a(Sr,"isRepoBearingGitReadRootImplementation");function It(e){return Sr(e,Nt,_t,Wn)}a(It,"isRepoBearingGitReadRoot");function hr(e,r,n,t,o){let i=[];typeof e=="string"&&e!==""&&i.push(e);for(let c of n??[])o(c)&&i.push(c);i.push(...r??[]);let s=[],d=new Set;for(let c of i){if(s.length>=8)break;let u=t(c);if(u===void 0)continue;let f=u.toLowerCase();d.has(f)||(d.add(f),s.push(u))}return s}a(hr,"windowsGitTrustRootsImplementation");function vr(e,r,n){return hr(e,r,n,Tt,It)}a(vr,"windowsGitTrustRoots");function xr(e){if(e==="git_config_count")return"count";if(/^git_config_key_\d+$/.test(e))return"key";if(/^git_config_value_\d+$/.test(e))return"value"}a(xr,"gitConfigEnvKind");function Ot(e,r,n,t,o){let i=new Map,s=[],d,c=!1;for(let u=0;u<r;u+=1){if(e[u]!=="--env"||u+1>=r)continue;let f=e[u+1],p=f.indexOf("="),g=(p<0?f:f.slice(0,p)).toLowerCase(),w=n(g);if(w===void 0)continue;c=!0,s.push(u);let m=p<0?"":f.slice(p+1);if(w==="count"){let W=Number.parseInt(m,10);(d!==void 0||!Number.isSafeInteger(W)||W<0||String(W)!==m)&&t(),d=W;continue}let S=Number.parseInt(g.slice(`git_config_${w}_`.length),10),h=i.get(S)??{};(!Number.isSafeInteger(S)||S<0||h[w]!==void 0)&&t(),h[w]=m,i.set(S,h)}return o(i,s,d,c,t)}a(Ot,"parseGitConfigEnvironmentImplementation");function rn(){throw new Error("ASRT GIT_CONFIG environment has an unexpected shape.")}a(rn,"throwUnexpectedGitConfigShape");function kr(e,r,n,t,o){!t||n!==void 0&&e.size===n&&[...e].every(([d,c])=>d<n&&c.key!==void 0&&c.value!==void 0)||o();let s=[...e].map(([d,c])=>({slot:d,key:c.key,value:c.value}));return{argumentIndices:r,pairs:s,sawAny:t}}a(kr,"finishParsedGitConfigEnvironment");function Er(e,r){let n=[];for(let o of e)n.push({key:"safe.directory",value:o},{key:"safe.directory",value:`${o}/*`});n.push(...r);let t=n.flatMap((o,i)=>[`GIT_CONFIG_KEY_${i}=${o.key}`,`GIT_CONFIG_VALUE_${i}=${o.value}`]);return t.push(`GIT_CONFIG_COUNT=${n.length}`),t}a(Er,"gitSafeDirectoryAssignments");function yr(e,r){let n=[],t=new Set;for(let[o,i]of Object.entries(e)){if(i===void 0)continue;if(o===""||o.includes("=")||o.includes("\0")||i.includes("\0"))throw new Error(`Invalid ${r} environment entry.`);let s=o.toUpperCase();if(t.has(s))throw new Error(`Ambiguous ${r} environment variable: ${o}.`);t.add(s),n.push([o,i])}return n}a(yr,"validatedEnvironmentEntries");function Dt(e,r){let n=new Map,t=[],o,i=!1;for(let[u,f]of Object.entries(e)){let p=u.toLowerCase(),g=xr(p);if(g===void 0){t.push([u,f]);continue}if(i=!0,g==="count"){let S=Number.parseInt(f,10);(o!==void 0||!Number.isSafeInteger(S)||S<0||String(S)!==f)&&rn(),o=S;continue}let w=Number.parseInt(p.slice(`git_config_${g}_`.length),10),m=n.get(w)??{};(!Number.isSafeInteger(w)||w<0||m[g]!==void 0)&&rn(),m[g]=f,n.set(w,m)}let d=kr(n,[],o,i,rn).pairs.filter(u=>u.key.toLowerCase()!=="safe.directory").sort((u,f)=>u.slot-f.slot),c=Object.fromEntries(t);for(let u of Er(r,d)){let f=u.indexOf("=");c[u.slice(0,f)]=u.slice(f+1)}return c}a(Dt,"rewriteWindowsGitSafeDirectoryEnvironment");function Rr(e,r,n){let t=yr(e,"ASRT-controlled"),o=yr(r,"Windows target"),i=new Map;for(let s of t)i.set(s[0].toUpperCase(),s);for(let s of o){let d=s[0].toUpperCase();i.has(d)&&d!=="PATH"&&d!=="PATHEXT"||i.set(d,s)}return Dt(Object.fromEntries(i.values()),n)}a(Rr,"mergeWindowsSandboxTargetEnvironment");function Lt(e,r,n,t){let o=new Set(n.argumentIndices),i=[],s=!1;for(let d=0;d<e.length;d+=1)if(o.has(d)){if(!s){for(let c of t)i.push("--env",c);s=!0}d+=1}else i.push(e[d]);return n.sawAny||i.splice(r,0,...t.flatMap(d=>["--env",d])),i}a(Lt,"replaceGitConfigEnvironment");function Bt(e,r,n,t,o){let i=e.lastIndexOf("--");if(i<0)throw new Error("ASRT Windows wrapper omitted its child separator.");let s=n(e,i),d=s.pairs.filter(u=>u.key.toLowerCase()!=="safe.directory").sort((u,f)=>u.slot-f.slot),c=t(r,d);return o(e,i,s,c)}a(Bt,"rewriteWindowsGitSafeDirectoryArgvImplementation");function Ar(){return String.raw`
2
+ import{a as hn,b as vn,c as De,d as xn,e as kn,f as En,g as cr,h as Rn,k as en,l as lr,m as ur,n as fr,o as nn,p as wr}from"./chunk-6EFXA3RL.js";import{Fc as dr,Ka as me,Ya as rr,_a as tr,ab as xe,bb as or,fb as Sn,hb as ke,kb as Oe,ob as ir,pb as sr,rb as ar,v as L}from"./chunk-P472TI5T.js";import{a}from"./chunk-ONUPGMER.js";import{spawn as qe,spawnSync as we}from"node:child_process";import{createHash as Xe,randomInt as jt,randomUUID as B}from"node:crypto";import{once as Ut}from"node:events";import{closeSync as Dn,constants as an,existsSync as qn,fsyncSync as Ft,lstatSync as ae,mkdirSync as qr,openSync as Xr,readFileSync as Ie,readSync as Vt,readdirSync as Jr,realpathSync as K,renameSync as Kt,rmSync as un,statSync as _e,writeFileSync as Hr,writeSync as qt}from"node:fs";import{copyFile as zr,lstat as Xt,mkdir as ne,readFile as Me,realpath as je,rm as H,stat as dn,writeFile as Ue}from"node:fs/promises";import{createRequire as Jt}from"node:module";import{createServer as Ht}from"node:net";import U from"node:os";import l from"node:path";import{lstatSync as vt,readFileSync as xt,readdirSync as pr,realpathSync as kt}from"node:fs";import C from"node:path";import{globSync as Et}from"glob";var Rt=[".ssh",".tsh",".brev",".gnupg",".aws",".azure",".kube",".docker",".config",".npm",".pki",".terraform.d"],At=new Set(["certificatefile","controlpath","globalknownhostsfile","identityagent","identityfile","revokedhostkeys","userknownhostsfile"]);function oe(e){try{return kt.native(e).toLowerCase()}catch(r){return["ENOENT","ENOTDIR"].includes(r.code??"")||L({source:"sandbox:ssh-config",level:"warn",message:`Cannot canonicalize SSH ACL path: ${e}`,detail:r}),C.resolve(e).toLowerCase()}}a(oe,"pathKey");function gr(e,r){return r===e||r.startsWith(e.endsWith(C.sep)?e:`${e}${C.sep}`)}a(gr,"inside");function Wt(e){let r=[],n="",t;for(let o=0;o<e.length;o+=1){let i=e[o];if(i==="#"&&t===void 0)break;if(i===t){t=void 0;continue}if((i==='"'||i==="'")&&t===void 0){t=i;continue}let s=e[o+1];i==="\\"&&s!==void 0&&(['"',"'","\\"].includes(s)||t===void 0&&s===" ")?(n+=s,o+=1):/\s/.test(i)&&t===void 0?(n&&r.push(n),n=""):n+=i}return n&&r.push(n),r}a(Wt,"sshWords");function Ct(e,r,n){if(e.toLowerCase()==="none")return;if(["~","%d","${HOME}"].includes(e))return r;let t=e.replace(/^(?:~|%d|\$\{HOME\})[/\\]/,`${r}${C.sep}`);return C.isAbsolute(t)?C.resolve(t):n===void 0?void 0:C.resolve(n,t)}a(Ct,"sshPath");function An(e,r,n,t,o=0){let i=oe(e);if(t.has(i))return;if(o>=32){L({source:"sandbox:ssh-config",level:"warn",message:`SSH Include depth limit reached; dependencies beyond this config were not inspected: ${e}`});return}t.add(i);let s;try{s=xt(e,"utf8")}catch(d){if(d.code==="ENOENT")return;L({source:"sandbox:ssh-config",level:"warn",message:`Cannot inspect SSH configuration dependencies: ${e}`,detail:d});return}for(let d of s.split(/\r?\n/)){let c=Wt(d.replace(/^(\s*[^\s=]+)\s*=\s*/,"$1 ")),u=c.shift()?.toLowerCase();if(u!==void 0)for(let f of c){let p=Ct(f,r,u==="include"?C.join(r,".ssh"):void 0);if(p!==void 0)if(u==="include")for(let g of Et(p.replace(/\\/g,"/"),{nodir:!0}))n.push(g),An(g,r,n,t,o+1);else At.has(u)&&n.push(p)}}}a(An,"visitSshConfig");function de(e){let r=[];An(C.join(e,".ssh","config"),e,r,new Set);let n=oe(e),t=Rt.map(o=>C.join(e,o));for(let o of r){let i=C.relative(n,oe(o));i&&!i.startsWith(`..${C.sep}`)&&i!==".."&&!C.isAbsolute(i)&&t.push(C.join(e,i.split(C.sep)[0]))}return[...new Set(t.map(o=>C.resolve(o)))]}a(de,"windowsSandboxAclExclusions");function mr(e){let r=[];An(C.join(e,".ssh","config"),e,r,new Set);let n=[C.join(e,".ssh")];for(;n.length>0;){let t=n.pop();r.push(t);let o;try{if(vt(t).isSymbolicLink())continue;o=pr(t,{withFileTypes:!0})}catch(i){if(i.code==="ENOENT")continue;throw i}for(let i of o){if(i.isSymbolicLink())continue;let s=C.join(t,i.name);r.push(s),i.isDirectory()&&n.push(s)}}return[...new Set(r.filter(t=>gr(oe(e),oe(t))))]}a(mr,"windowsSandboxSshCleanupRoots");function Ee(e,r,n){let t=oe(r),o=n.flatMap(s=>[C.resolve(s).toLowerCase(),oe(s)]),i=e.flatMap(s=>oe(s)===t?pr(r,{withFileTypes:!0}).filter(d=>!d.isSymbolicLink()).map(d=>C.join(r,d.name)):[s]);return[...new Set(i)].filter(s=>![C.resolve(s).toLowerCase(),oe(s)].some(c=>o.some(u=>gr(u,c))))}a(Ee,"windowsSandboxAclRoots");import{fileURLToPath as _r,pathToFileURL as Yr}from"node:url";import{realpathSync as Pt,statSync as Nt}from"node:fs";import _t from"node:path";function Wn(e){let r=e.code;return r==="ENOENT"||r==="ENOTDIR"}a(Wn,"isMissingGitTrustPath");function br(e,r,n){try{let t=r(e).replaceAll("\\","/").replace(/\/+$/,"");return t===""?void 0:/^[A-Za-z]:$/.test(t)?`${t}/`:t}catch(t){if(n(t))return;throw t}}a(br,"normalizeGitSafeDirectoryRootImplementation");function Tt(e){return br(e,Pt,Wn)}a(Tt,"normalizeGitSafeDirectoryRoot");function Sr(e,r,n,t){try{let i=r(n.join(e,".git"));if(i.isDirectory()||i.isFile())return!0}catch(i){if(!t(i))throw i}if(!(n.basename(e).toLowerCase()===".git"||/[/\\]\.git[/\\]modules[/\\]/i.test(e)))return!1;try{return r(n.join(e,"HEAD")).isFile()}catch(i){if(t(i))return!1;throw i}}a(Sr,"isRepoBearingGitReadRootImplementation");function It(e){return Sr(e,Nt,_t,Wn)}a(It,"isRepoBearingGitReadRoot");function hr(e,r,n,t,o){let i=[];typeof e=="string"&&e!==""&&i.push(e);for(let c of n??[])o(c)&&i.push(c);i.push(...r??[]);let s=[],d=new Set;for(let c of i){if(s.length>=8)break;let u=t(c);if(u===void 0)continue;let f=u.toLowerCase();d.has(f)||(d.add(f),s.push(u))}return s}a(hr,"windowsGitTrustRootsImplementation");function vr(e,r,n){return hr(e,r,n,Tt,It)}a(vr,"windowsGitTrustRoots");function xr(e){if(e==="git_config_count")return"count";if(/^git_config_key_\d+$/.test(e))return"key";if(/^git_config_value_\d+$/.test(e))return"value"}a(xr,"gitConfigEnvKind");function Ot(e,r,n,t,o){let i=new Map,s=[],d,c=!1;for(let u=0;u<r;u+=1){if(e[u]!=="--env"||u+1>=r)continue;let f=e[u+1],p=f.indexOf("="),g=(p<0?f:f.slice(0,p)).toLowerCase(),w=n(g);if(w===void 0)continue;c=!0,s.push(u);let m=p<0?"":f.slice(p+1);if(w==="count"){let W=Number.parseInt(m,10);(d!==void 0||!Number.isSafeInteger(W)||W<0||String(W)!==m)&&t(),d=W;continue}let S=Number.parseInt(g.slice(`git_config_${w}_`.length),10),h=i.get(S)??{};(!Number.isSafeInteger(S)||S<0||h[w]!==void 0)&&t(),h[w]=m,i.set(S,h)}return o(i,s,d,c,t)}a(Ot,"parseGitConfigEnvironmentImplementation");function rn(){throw new Error("ASRT GIT_CONFIG environment has an unexpected shape.")}a(rn,"throwUnexpectedGitConfigShape");function kr(e,r,n,t,o){!t||n!==void 0&&e.size===n&&[...e].every(([d,c])=>d<n&&c.key!==void 0&&c.value!==void 0)||o();let s=[...e].map(([d,c])=>({slot:d,key:c.key,value:c.value}));return{argumentIndices:r,pairs:s,sawAny:t}}a(kr,"finishParsedGitConfigEnvironment");function Er(e,r){let n=[];for(let o of e)n.push({key:"safe.directory",value:o},{key:"safe.directory",value:`${o}/*`});n.push(...r);let t=n.flatMap((o,i)=>[`GIT_CONFIG_KEY_${i}=${o.key}`,`GIT_CONFIG_VALUE_${i}=${o.value}`]);return t.push(`GIT_CONFIG_COUNT=${n.length}`),t}a(Er,"gitSafeDirectoryAssignments");function yr(e,r){let n=[],t=new Set;for(let[o,i]of Object.entries(e)){if(i===void 0)continue;if(o===""||o.includes("=")||o.includes("\0")||i.includes("\0"))throw new Error(`Invalid ${r} environment entry.`);let s=o.toUpperCase();if(t.has(s))throw new Error(`Ambiguous ${r} environment variable: ${o}.`);t.add(s),n.push([o,i])}return n}a(yr,"validatedEnvironmentEntries");function Dt(e,r){let n=new Map,t=[],o,i=!1;for(let[u,f]of Object.entries(e)){let p=u.toLowerCase(),g=xr(p);if(g===void 0){t.push([u,f]);continue}if(i=!0,g==="count"){let S=Number.parseInt(f,10);(o!==void 0||!Number.isSafeInteger(S)||S<0||String(S)!==f)&&rn(),o=S;continue}let w=Number.parseInt(p.slice(`git_config_${g}_`.length),10),m=n.get(w)??{};(!Number.isSafeInteger(w)||w<0||m[g]!==void 0)&&rn(),m[g]=f,n.set(w,m)}let d=kr(n,[],o,i,rn).pairs.filter(u=>u.key.toLowerCase()!=="safe.directory").sort((u,f)=>u.slot-f.slot),c=Object.fromEntries(t);for(let u of Er(r,d)){let f=u.indexOf("=");c[u.slice(0,f)]=u.slice(f+1)}return c}a(Dt,"rewriteWindowsGitSafeDirectoryEnvironment");function Rr(e,r,n){let t=yr(e,"ASRT-controlled"),o=yr(r,"Windows target"),i=new Map;for(let s of t)i.set(s[0].toUpperCase(),s);for(let s of o){let d=s[0].toUpperCase();i.has(d)&&d!=="PATH"&&d!=="PATHEXT"||i.set(d,s)}return Dt(Object.fromEntries(i.values()),n)}a(Rr,"mergeWindowsSandboxTargetEnvironment");function Lt(e,r,n,t){let o=new Set(n.argumentIndices),i=[],s=!1;for(let d=0;d<e.length;d+=1)if(o.has(d)){if(!s){for(let c of t)i.push("--env",c);s=!0}d+=1}else i.push(e[d]);return n.sawAny||i.splice(r,0,...t.flatMap(d=>["--env",d])),i}a(Lt,"replaceGitConfigEnvironment");function Bt(e,r,n,t,o){let i=e.lastIndexOf("--");if(i<0)throw new Error("ASRT Windows wrapper omitted its child separator.");let s=n(e,i),d=s.pairs.filter(u=>u.key.toLowerCase()!=="safe.directory").sort((u,f)=>u.slot-f.slot),c=t(r,d);return o(e,i,s,c)}a(Bt,"rewriteWindowsGitSafeDirectoryArgvImplementation");function Ar(){return String.raw`
3
3
  const isMissingGitTrustPath = ${Wn.toString()};
4
4
  const normalizeGitSafeDirectoryRootImplementation = ${br.toString()};
5
5
  const normalizeGitSafeDirectoryRoot = (root) => (