@xenosystem/agent-sdk 0.8.12

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 (175) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +511 -0
  3. package/dist/agents/index.cjs +17 -0
  4. package/dist/agents/index.d.cts +244 -0
  5. package/dist/agents/index.d.ts +244 -0
  6. package/dist/agents/index.js +17 -0
  7. package/dist/agents/metafile-cjs.json +1 -0
  8. package/dist/agents/metafile-esm.json +1 -0
  9. package/dist/artifacts/browser.cjs +1 -0
  10. package/dist/artifacts/browser.d.cts +8 -0
  11. package/dist/artifacts/browser.d.ts +8 -0
  12. package/dist/artifacts/browser.js +1 -0
  13. package/dist/artifacts/diff-artifact-C2tQZWcs.d.cts +354 -0
  14. package/dist/artifacts/diff-artifact-C2tQZWcs.d.ts +354 -0
  15. package/dist/artifacts/index.cjs +10 -0
  16. package/dist/artifacts/index.d.cts +588 -0
  17. package/dist/artifacts/index.d.ts +588 -0
  18. package/dist/artifacts/index.js +10 -0
  19. package/dist/artifacts/metafile-cjs.json +1 -0
  20. package/dist/artifacts/metafile-esm.json +1 -0
  21. package/dist/automation/index.cjs +438 -0
  22. package/dist/automation/index.d.cts +878 -0
  23. package/dist/automation/index.d.ts +878 -0
  24. package/dist/automation/index.js +438 -0
  25. package/dist/automation/metafile-cjs.json +1 -0
  26. package/dist/automation/metafile-esm.json +1 -0
  27. package/dist/control-plane/index.cjs +7 -0
  28. package/dist/control-plane/index.d.cts +403 -0
  29. package/dist/control-plane/index.d.ts +403 -0
  30. package/dist/control-plane/index.js +7 -0
  31. package/dist/control-plane/metafile-cjs.json +1 -0
  32. package/dist/control-plane/metafile-esm.json +1 -0
  33. package/dist/control-room/index.cjs +1 -0
  34. package/dist/control-room/index.d.cts +216 -0
  35. package/dist/control-room/index.d.ts +216 -0
  36. package/dist/control-room/index.js +1 -0
  37. package/dist/control-room/metafile-cjs.json +1 -0
  38. package/dist/control-room/metafile-esm.json +1 -0
  39. package/dist/electron/index.cjs +1476 -0
  40. package/dist/electron/index.d.cts +1583 -0
  41. package/dist/electron/index.d.ts +1583 -0
  42. package/dist/electron/index.js +1476 -0
  43. package/dist/electron/metafile-cjs.json +1 -0
  44. package/dist/electron/metafile-esm.json +1 -0
  45. package/dist/governance/index.cjs +33 -0
  46. package/dist/governance/index.d.cts +397 -0
  47. package/dist/governance/index.d.ts +397 -0
  48. package/dist/governance/index.js +33 -0
  49. package/dist/governance/metafile-cjs.json +1 -0
  50. package/dist/governance/metafile-esm.json +1 -0
  51. package/dist/hooks/index.cjs +9 -0
  52. package/dist/hooks/index.d.cts +198 -0
  53. package/dist/hooks/index.d.ts +198 -0
  54. package/dist/hooks/index.js +9 -0
  55. package/dist/hooks/metafile-cjs.json +1 -0
  56. package/dist/hooks/metafile-esm.json +1 -0
  57. package/dist/hosted/index.cjs +1 -0
  58. package/dist/hosted/index.d.cts +490 -0
  59. package/dist/hosted/index.d.ts +490 -0
  60. package/dist/hosted/index.js +1 -0
  61. package/dist/hosted/metafile-cjs.json +1 -0
  62. package/dist/hosted/metafile-esm.json +1 -0
  63. package/dist/index.cjs +2161 -0
  64. package/dist/index.d.cts +12259 -0
  65. package/dist/index.d.ts +12259 -0
  66. package/dist/index.js +2161 -0
  67. package/dist/intelligence/index.cjs +10 -0
  68. package/dist/intelligence/index.d.cts +220 -0
  69. package/dist/intelligence/index.d.ts +220 -0
  70. package/dist/intelligence/index.js +10 -0
  71. package/dist/intelligence/metafile-cjs.json +1 -0
  72. package/dist/intelligence/metafile-esm.json +1 -0
  73. package/dist/mcp/index.cjs +28 -0
  74. package/dist/mcp/index.d.cts +960 -0
  75. package/dist/mcp/index.d.ts +960 -0
  76. package/dist/mcp/index.js +28 -0
  77. package/dist/mcp/metafile-cjs.json +1 -0
  78. package/dist/mcp/metafile-esm.json +1 -0
  79. package/dist/metafile-cjs.json +1 -0
  80. package/dist/metafile-esm.json +1 -0
  81. package/dist/oracle/index.cjs +1 -0
  82. package/dist/oracle/index.d.cts +310 -0
  83. package/dist/oracle/index.d.ts +310 -0
  84. package/dist/oracle/index.js +1 -0
  85. package/dist/oracle/metafile-cjs.json +1 -0
  86. package/dist/oracle/metafile-esm.json +1 -0
  87. package/dist/providers/index.cjs +11 -0
  88. package/dist/providers/index.d.cts +462 -0
  89. package/dist/providers/index.d.ts +462 -0
  90. package/dist/providers/index.js +11 -0
  91. package/dist/providers/metafile-cjs.json +1 -0
  92. package/dist/providers/metafile-esm.json +1 -0
  93. package/dist/recipes/index.cjs +2 -0
  94. package/dist/recipes/index.d.cts +86 -0
  95. package/dist/recipes/index.d.ts +86 -0
  96. package/dist/recipes/index.js +2 -0
  97. package/dist/recipes/metafile-cjs.json +1 -0
  98. package/dist/recipes/metafile-esm.json +1 -0
  99. package/dist/research/index.cjs +3 -0
  100. package/dist/research/index.d.cts +285 -0
  101. package/dist/research/index.d.ts +285 -0
  102. package/dist/research/index.js +3 -0
  103. package/dist/research/metafile-cjs.json +1 -0
  104. package/dist/research/metafile-esm.json +1 -0
  105. package/dist/session/index.cjs +56 -0
  106. package/dist/session/index.d.cts +523 -0
  107. package/dist/session/index.d.ts +523 -0
  108. package/dist/session/index.js +56 -0
  109. package/dist/session/metafile-cjs.json +1 -0
  110. package/dist/session/metafile-esm.json +1 -0
  111. package/dist/sharing/index.cjs +4 -0
  112. package/dist/sharing/index.d.cts +272 -0
  113. package/dist/sharing/index.d.ts +272 -0
  114. package/dist/sharing/index.js +4 -0
  115. package/dist/sharing/metafile-cjs.json +1 -0
  116. package/dist/sharing/metafile-esm.json +1 -0
  117. package/dist/skills/index.cjs +6 -0
  118. package/dist/skills/index.d.cts +277 -0
  119. package/dist/skills/index.d.ts +277 -0
  120. package/dist/skills/index.js +6 -0
  121. package/dist/skills/metafile-cjs.json +1 -0
  122. package/dist/skills/metafile-esm.json +1 -0
  123. package/dist/soul/index.cjs +32 -0
  124. package/dist/soul/index.d.cts +138 -0
  125. package/dist/soul/index.d.ts +138 -0
  126. package/dist/soul/index.js +32 -0
  127. package/dist/soul/metafile-cjs.json +1 -0
  128. package/dist/soul/metafile-esm.json +1 -0
  129. package/dist/terminal/index.cjs +4 -0
  130. package/dist/terminal/index.d.cts +55 -0
  131. package/dist/terminal/index.d.ts +55 -0
  132. package/dist/terminal/index.js +4 -0
  133. package/dist/terminal/metafile-cjs.json +1 -0
  134. package/dist/terminal/metafile-esm.json +1 -0
  135. package/dist/ui/index.cjs +35 -0
  136. package/dist/ui/index.d.cts +298 -0
  137. package/dist/ui/index.d.ts +298 -0
  138. package/dist/ui/index.js +35 -0
  139. package/dist/ui/metafile-cjs.json +1 -0
  140. package/dist/ui/metafile-esm.json +1 -0
  141. package/dist/utils/index.cjs +23 -0
  142. package/dist/utils/index.d.cts +245 -0
  143. package/dist/utils/index.d.ts +245 -0
  144. package/dist/utils/index.js +23 -0
  145. package/dist/utils/metafile-cjs.json +1 -0
  146. package/dist/utils/metafile-esm.json +1 -0
  147. package/native/mxc/LICENSE.microsoft-mxc-sdk.md +21 -0
  148. package/native/mxc/README.md +25 -0
  149. package/native/mxc/bin/arm64/lxc-exec +0 -0
  150. package/native/mxc/bin/arm64/mxc-exec-mac +0 -0
  151. package/native/mxc/bin/arm64/wxc-exec.exe +0 -0
  152. package/native/mxc/bin/arm64/wxc-host-prep.exe +0 -0
  153. package/native/mxc/bin/x64/lxc-exec +0 -0
  154. package/native/mxc/bin/x64/wxc-exec.exe +0 -0
  155. package/native/mxc/bin/x64/wxc-host-prep.exe +0 -0
  156. package/native/mxc/package.json +58 -0
  157. package/ownership/CLEAN_ROOM_CONTRIBUTOR_GUIDE.md +63 -0
  158. package/ownership/audit.mjs +727 -0
  159. package/ownership/evidence/PROPRIETARY-COMMAND-1/implementation-record.md +77 -0
  160. package/ownership/evidence/PROPRIETARY-COMMAND-1/provenance-review.md +51 -0
  161. package/ownership/evidence/PROPRIETARY-MEDIA-1/implementation-record.md +131 -0
  162. package/ownership/evidence/PROPRIETARY-MEDIA-1/provenance-review.md +50 -0
  163. package/ownership/evidence/PROPRIETARY-PTY-1/implementation-record.md +86 -0
  164. package/ownership/evidence/PROPRIETARY-PTY-1/provenance-review.md +52 -0
  165. package/ownership/evidence/PROPRIETARY-RUNTIME-1/implementation-record.md +68 -0
  166. package/ownership/evidence/PROPRIETARY-RUNTIME-1/provenance-review.md +32 -0
  167. package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/implementation-record.md +53 -0
  168. package/ownership/evidence/PROPRIETARY-TOOLCHAIN-1/provenance-review.md +32 -0
  169. package/ownership/evidence/PROPRIETARY-UI-1/implementation-record.md +96 -0
  170. package/ownership/evidence/PROPRIETARY-UI-1/provenance-review.md +46 -0
  171. package/ownership/ownership-policy.json +232 -0
  172. package/ownership/ownership-policy.schema.json +192 -0
  173. package/ownership/templates/clean-room-implementation-record.md +70 -0
  174. package/ownership/templates/provenance-review.md +51 -0
  175. package/package.json +209 -0
@@ -0,0 +1,438 @@
1
+ var T=1;var L=new Set(["browser.navigate","browser.back","browser.forward","browser.reload","browser.wait","browser.snapshot","browser.screenshot","browser.locate","browser.tabs.list","browser.tabs.open","browser.console.read","browser.network.read","browser.storage.read","browser.page-errors.read"]),D=new Set(["browser.click","browser.type","browser.key","browser.select","browser.scroll","browser.tabs.close","browser.upload","browser.download","browser.record.start","browser.record.stop"]),k=new Set(["computer.observe","computer.screenshot","computer.window-state","computer.wait"]),M=new Set(["computer.point","computer.click","computer.double-click","computer.right-click","computer.drag","computer.type","computer.key","computer.scroll","computer.launch"]),U=[...L,...D,...k,...M];function h(e){if(L.has(e))return{operation:e,surface:"browser",effect:"observe",evidence:{before:"disabled",after:e==="browser.wait"||e==="browser.tabs.list"?"optional":"required",recording:"optional"}};if(D.has(e)){let t=e==="browser.record.start"||e==="browser.record.stop";return{operation:e,surface:"browser",effect:"act",evidence:{before:"required",after:"required",recording:e==="browser.record.stop"?"required":"optional"}}}if(k.has(e))return{operation:e,surface:"computer",effect:"observe",evidence:{before:"disabled",after:e==="computer.wait"?"optional":"required",recording:"optional"}};if(M.has(e))return{operation:e,surface:"computer",effect:"act",evidence:{before:"required",after:"required",recording:"optional"}};throw new TypeError(`Unsupported XENO automation operation: ${e}`)}function V(e){return L.has(e)||D.has(e)||k.has(e)||M.has(e)}var a=class extends Error{constructor(r,n,o,i){super(n,i);this.code=r;this.detail=o;this.name="XenoAutomationError"}code;detail};import{createHash as Ce}from"node:crypto";function Te(e,t){let r=0;for(let n=0;n<t;n+=1)r=r<<1|e>>>n&1;return r}function re(e,t=!1){let r=e.reduce((s,u)=>Math.max(s,u),0);if(r===0){if(t)return{tree:null,codes:e.map(()=>({bits:0,length:0}))};throw new Error("DEFLATE Huffman tree has no symbols")}if(r>15||e.some(s=>!Number.isInteger(s)||s<0||s>15))throw new Error("Invalid DEFLATE Huffman code length");let n=new Uint16Array(r+1);for(let s of e)s>0&&(n[s]+=1);let o=1;for(let s=1;s<=r;s+=1)if(o=(o<<1)-n[s],o<0)throw new Error("Oversubscribed DEFLATE Huffman tree");let i=new Uint32Array(r+1),d=0;for(let s=1;s<=r;s+=1)d=d+n[s-1]<<1,i[s]=d;let c=new Array(r+1),l=e.map(()=>({bits:0,length:0}));for(let s=0;s<e.length;s+=1){let u=e[s];if(u===0)continue;let p=i[u]++,v=Te(p,u),f=c[u]??new Map;f.set(v,s),c[u]=f,l[s]={bits:v,length:u}}return{tree:{maxBits:r,byLength:c},codes:l}}function Se(){let e=new Array(288).fill(0);for(let t=0;t<=143;t+=1)e[t]=8;for(let t=144;t<=255;t+=1)e[t]=9;for(let t=256;t<=279;t+=1)e[t]=7;for(let t=280;t<=287;t+=1)e[t]=8;return e}var Pt=re(Se()),Xt=re(new Array(32).fill(5));var Mt=String.raw`
2
+ using System;
3
+ using System.ComponentModel;
4
+ using System.Runtime.InteropServices;
5
+ using System.Text;
6
+
7
+ namespace Xeno.Security
8
+ {
9
+ public static class RestrictedProcessLauncher
10
+ {
11
+ private const UInt32 TOKEN_ASSIGN_PRIMARY = 0x0001;
12
+ private const UInt32 TOKEN_DUPLICATE = 0x0002;
13
+ private const UInt32 TOKEN_QUERY = 0x0008;
14
+ private const UInt32 TOKEN_ADJUST_DEFAULT = 0x0080;
15
+ private const UInt32 TOKEN_ADJUST_SESSIONID = 0x0100;
16
+ private const UInt32 DISABLE_MAX_PRIVILEGE = 0x0001;
17
+ private const UInt32 LUA_TOKEN = 0x0004;
18
+ private const UInt32 SE_GROUP_INTEGRITY = 0x00000020;
19
+ private const UInt32 CREATE_SUSPENDED = 0x00000004;
20
+ private const UInt32 EXTENDED_STARTUPINFO_PRESENT = 0x00080000;
21
+ private const UInt32 CREATE_NO_WINDOW = 0x08000000;
22
+ private const UInt32 STARTF_USESTDHANDLES = 0x00000100;
23
+ private const UInt32 HANDLE_FLAG_INHERIT = 0x00000001;
24
+ private const UInt32 JOB_OBJECT_LIMIT_ACTIVE_PROCESS = 0x00000008;
25
+ private const UInt32 JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION = 0x00000400;
26
+ private const UInt32 JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE = 0x00002000;
27
+ private const Int32 TokenIntegrityLevel = 25;
28
+ private const Int32 JobObjectExtendedLimitInformation = 9;
29
+ private const Int32 PROC_THREAD_ATTRIBUTE_HANDLE_LIST = 0x00020002;
30
+ private const UInt32 INFINITE = 0xFFFFFFFF;
31
+
32
+ [StructLayout(LayoutKind.Sequential)]
33
+ private struct SID_AND_ATTRIBUTES
34
+ {
35
+ public IntPtr Sid;
36
+ public UInt32 Attributes;
37
+ }
38
+
39
+ [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
40
+ private struct STARTUPINFO
41
+ {
42
+ public UInt32 cb;
43
+ public string lpReserved;
44
+ public string lpDesktop;
45
+ public string lpTitle;
46
+ public UInt32 dwX;
47
+ public UInt32 dwY;
48
+ public UInt32 dwXSize;
49
+ public UInt32 dwYSize;
50
+ public UInt32 dwXCountChars;
51
+ public UInt32 dwYCountChars;
52
+ public UInt32 dwFillAttribute;
53
+ public UInt32 dwFlags;
54
+ public UInt16 wShowWindow;
55
+ public UInt16 cbReserved2;
56
+ public IntPtr lpReserved2;
57
+ public IntPtr hStdInput;
58
+ public IntPtr hStdOutput;
59
+ public IntPtr hStdError;
60
+ }
61
+
62
+ [StructLayout(LayoutKind.Sequential)]
63
+ private struct STARTUPINFOEX
64
+ {
65
+ public STARTUPINFO StartupInfo;
66
+ public IntPtr lpAttributeList;
67
+ }
68
+
69
+ [StructLayout(LayoutKind.Sequential)]
70
+ private struct PROCESS_INFORMATION
71
+ {
72
+ public IntPtr hProcess;
73
+ public IntPtr hThread;
74
+ public UInt32 dwProcessId;
75
+ public UInt32 dwThreadId;
76
+ }
77
+
78
+ [StructLayout(LayoutKind.Sequential)]
79
+ private struct JOBOBJECT_BASIC_LIMIT_INFORMATION
80
+ {
81
+ public Int64 PerProcessUserTimeLimit;
82
+ public Int64 PerJobUserTimeLimit;
83
+ public UInt32 LimitFlags;
84
+ public UIntPtr MinimumWorkingSetSize;
85
+ public UIntPtr MaximumWorkingSetSize;
86
+ public UInt32 ActiveProcessLimit;
87
+ public UIntPtr Affinity;
88
+ public UInt32 PriorityClass;
89
+ public UInt32 SchedulingClass;
90
+ }
91
+
92
+ [StructLayout(LayoutKind.Sequential)]
93
+ private struct IO_COUNTERS
94
+ {
95
+ public UInt64 ReadOperationCount;
96
+ public UInt64 WriteOperationCount;
97
+ public UInt64 OtherOperationCount;
98
+ public UInt64 ReadTransferCount;
99
+ public UInt64 WriteTransferCount;
100
+ public UInt64 OtherTransferCount;
101
+ }
102
+
103
+ [StructLayout(LayoutKind.Sequential)]
104
+ private struct JOBOBJECT_EXTENDED_LIMIT_INFORMATION
105
+ {
106
+ public JOBOBJECT_BASIC_LIMIT_INFORMATION BasicLimitInformation;
107
+ public IO_COUNTERS IoInfo;
108
+ public UIntPtr ProcessMemoryLimit;
109
+ public UIntPtr JobMemoryLimit;
110
+ public UIntPtr PeakProcessMemoryUsed;
111
+ public UIntPtr PeakJobMemoryUsed;
112
+ }
113
+
114
+ [DllImport("kernel32.dll")]
115
+ private static extern IntPtr GetCurrentProcess();
116
+
117
+ [DllImport("advapi32.dll", SetLastError = true)]
118
+ private static extern bool OpenProcessToken(
119
+ IntPtr ProcessHandle,
120
+ UInt32 DesiredAccess,
121
+ out IntPtr TokenHandle);
122
+
123
+ [DllImport("advapi32.dll", SetLastError = true)]
124
+ private static extern bool CreateRestrictedToken(
125
+ IntPtr ExistingTokenHandle,
126
+ UInt32 Flags,
127
+ UInt32 DisableSidCount,
128
+ IntPtr SidsToDisable,
129
+ UInt32 DeletePrivilegeCount,
130
+ IntPtr PrivilegesToDelete,
131
+ UInt32 RestrictedSidCount,
132
+ IntPtr SidsToRestrict,
133
+ out IntPtr NewTokenHandle);
134
+
135
+ [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
136
+ private static extern bool ConvertStringSidToSid(string StringSid, out IntPtr Sid);
137
+
138
+ [DllImport("advapi32.dll", SetLastError = true)]
139
+ private static extern bool SetTokenInformation(
140
+ IntPtr TokenHandle,
141
+ Int32 TokenInformationClass,
142
+ ref SID_AND_ATTRIBUTES TokenInformation,
143
+ UInt32 TokenInformationLength);
144
+
145
+ [DllImport("advapi32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
146
+ private static extern bool CreateProcessAsUser(
147
+ IntPtr hToken,
148
+ string lpApplicationName,
149
+ StringBuilder lpCommandLine,
150
+ IntPtr lpProcessAttributes,
151
+ IntPtr lpThreadAttributes,
152
+ bool bInheritHandles,
153
+ UInt32 dwCreationFlags,
154
+ IntPtr lpEnvironment,
155
+ string lpCurrentDirectory,
156
+ ref STARTUPINFOEX lpStartupInfo,
157
+ out PROCESS_INFORMATION lpProcessInformation);
158
+
159
+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
160
+ private static extern bool CreateProcess(
161
+ string lpApplicationName,
162
+ StringBuilder lpCommandLine,
163
+ IntPtr lpProcessAttributes,
164
+ IntPtr lpThreadAttributes,
165
+ bool bInheritHandles,
166
+ UInt32 dwCreationFlags,
167
+ IntPtr lpEnvironment,
168
+ string lpCurrentDirectory,
169
+ ref STARTUPINFOEX lpStartupInfo,
170
+ out PROCESS_INFORMATION lpProcessInformation);
171
+
172
+ [DllImport("kernel32.dll", SetLastError = true, CharSet = CharSet.Unicode)]
173
+ private static extern IntPtr CreateJobObject(IntPtr lpJobAttributes, string lpName);
174
+
175
+ [DllImport("kernel32.dll", SetLastError = true)]
176
+ private static extern bool SetInformationJobObject(
177
+ IntPtr hJob,
178
+ Int32 JobObjectInfoClass,
179
+ IntPtr lpJobObjectInfo,
180
+ UInt32 cbJobObjectInfoLength);
181
+
182
+ [DllImport("kernel32.dll", SetLastError = true)]
183
+ private static extern bool AssignProcessToJobObject(IntPtr hJob, IntPtr hProcess);
184
+
185
+ [DllImport("kernel32.dll", SetLastError = true)]
186
+ private static extern UInt32 ResumeThread(IntPtr hThread);
187
+
188
+ [DllImport("kernel32.dll", SetLastError = true)]
189
+ private static extern UInt32 WaitForSingleObject(IntPtr hHandle, UInt32 dwMilliseconds);
190
+
191
+ [DllImport("kernel32.dll", SetLastError = true)]
192
+ private static extern bool GetExitCodeProcess(IntPtr hProcess, out UInt32 lpExitCode);
193
+
194
+ [DllImport("kernel32.dll", SetLastError = true)]
195
+ private static extern bool TerminateProcess(IntPtr hProcess, UInt32 uExitCode);
196
+
197
+ [DllImport("kernel32.dll", SetLastError = true)]
198
+ private static extern bool CloseHandle(IntPtr hObject);
199
+
200
+ [DllImport("kernel32.dll", SetLastError = true)]
201
+ private static extern IntPtr GetStdHandle(Int32 nStdHandle);
202
+
203
+ [DllImport("kernel32.dll", SetLastError = true)]
204
+ private static extern bool SetHandleInformation(IntPtr hObject, UInt32 dwMask, UInt32 dwFlags);
205
+
206
+ [DllImport("kernel32.dll", SetLastError = true)]
207
+ private static extern bool InitializeProcThreadAttributeList(
208
+ IntPtr lpAttributeList,
209
+ Int32 dwAttributeCount,
210
+ Int32 dwFlags,
211
+ ref IntPtr lpSize);
212
+
213
+ [DllImport("kernel32.dll", SetLastError = true)]
214
+ private static extern bool UpdateProcThreadAttribute(
215
+ IntPtr lpAttributeList,
216
+ UInt32 dwFlags,
217
+ IntPtr attribute,
218
+ IntPtr lpValue,
219
+ IntPtr cbSize,
220
+ IntPtr lpPreviousValue,
221
+ IntPtr lpReturnSize);
222
+
223
+ [DllImport("kernel32.dll")]
224
+ private static extern void DeleteProcThreadAttributeList(IntPtr lpAttributeList);
225
+
226
+ [DllImport("advapi32.dll", SetLastError = true)]
227
+ private static extern UInt32 GetLengthSid(IntPtr pSid);
228
+
229
+ [DllImport("kernel32.dll")]
230
+ private static extern IntPtr LocalFree(IntPtr hMem);
231
+
232
+ private static void ThrowLastError(string operation)
233
+ {
234
+ throw new Win32Exception(Marshal.GetLastWin32Error(), operation);
235
+ }
236
+
237
+ private static void MarkInheritable(IntPtr handle)
238
+ {
239
+ if (handle != IntPtr.Zero && handle != new IntPtr(-1))
240
+ {
241
+ SetHandleInformation(handle, HANDLE_FLAG_INHERIT, HANDLE_FLAG_INHERIT);
242
+ }
243
+ }
244
+
245
+ private static void InitializeHandleAllowlist(ref STARTUPINFOEX startup, out IntPtr handleBuffer)
246
+ {
247
+ IntPtr requiredSize = IntPtr.Zero;
248
+ InitializeProcThreadAttributeList(IntPtr.Zero, 1, 0, ref requiredSize);
249
+ if (requiredSize == IntPtr.Zero)
250
+ ThrowLastError("InitializeProcThreadAttributeList(size)");
251
+ startup.lpAttributeList = Marshal.AllocHGlobal(requiredSize);
252
+ if (!InitializeProcThreadAttributeList(startup.lpAttributeList, 1, 0, ref requiredSize))
253
+ ThrowLastError("InitializeProcThreadAttributeList");
254
+
255
+ handleBuffer = Marshal.AllocHGlobal(IntPtr.Size * 3);
256
+ Marshal.WriteIntPtr(handleBuffer, 0, startup.StartupInfo.hStdInput);
257
+ Marshal.WriteIntPtr(handleBuffer, IntPtr.Size, startup.StartupInfo.hStdOutput);
258
+ Marshal.WriteIntPtr(handleBuffer, IntPtr.Size * 2, startup.StartupInfo.hStdError);
259
+ if (!UpdateProcThreadAttribute(
260
+ startup.lpAttributeList,
261
+ 0,
262
+ new IntPtr(PROC_THREAD_ATTRIBUTE_HANDLE_LIST),
263
+ handleBuffer,
264
+ new IntPtr(IntPtr.Size * 3),
265
+ IntPtr.Zero,
266
+ IntPtr.Zero))
267
+ ThrowLastError("UpdateProcThreadAttribute(HANDLE_LIST)");
268
+ }
269
+
270
+ private static void ApplyLowIntegrity(IntPtr token)
271
+ {
272
+ IntPtr lowSid = IntPtr.Zero;
273
+ try
274
+ {
275
+ if (!ConvertStringSidToSid("S-1-16-4096", out lowSid))
276
+ ThrowLastError("ConvertStringSidToSid(low integrity)");
277
+ var label = new SID_AND_ATTRIBUTES { Sid = lowSid, Attributes = SE_GROUP_INTEGRITY };
278
+ UInt32 size = checked((UInt32)Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES)) + GetLengthSid(lowSid));
279
+ if (!SetTokenInformation(token, TokenIntegrityLevel, ref label, size))
280
+ ThrowLastError("SetTokenInformation(TokenIntegrityLevel)");
281
+ }
282
+ finally
283
+ {
284
+ if (lowSid != IntPtr.Zero) LocalFree(lowSid);
285
+ }
286
+ }
287
+
288
+ private static IntPtr CreateHardenedToken(bool lowIntegrity)
289
+ {
290
+ IntPtr sourceToken = IntPtr.Zero;
291
+ IntPtr restrictedToken = IntPtr.Zero;
292
+ IntPtr adminSid = IntPtr.Zero;
293
+ IntPtr disabledSidBuffer = IntPtr.Zero;
294
+ try
295
+ {
296
+ UInt32 access = TOKEN_ASSIGN_PRIMARY | TOKEN_DUPLICATE | TOKEN_QUERY |
297
+ TOKEN_ADJUST_DEFAULT | TOKEN_ADJUST_SESSIONID;
298
+ if (!OpenProcessToken(GetCurrentProcess(), access, out sourceToken))
299
+ ThrowLastError("OpenProcessToken");
300
+ if (!ConvertStringSidToSid("S-1-5-32-544", out adminSid))
301
+ ThrowLastError("ConvertStringSidToSid(Administrators)");
302
+ var disabledSid = new SID_AND_ATTRIBUTES { Sid = adminSid, Attributes = 0 };
303
+ disabledSidBuffer = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SID_AND_ATTRIBUTES)));
304
+ Marshal.StructureToPtr(disabledSid, disabledSidBuffer, false);
305
+ if (!CreateRestrictedToken(
306
+ sourceToken,
307
+ DISABLE_MAX_PRIVILEGE | LUA_TOKEN,
308
+ 1,
309
+ disabledSidBuffer,
310
+ 0,
311
+ IntPtr.Zero,
312
+ 0,
313
+ IntPtr.Zero,
314
+ out restrictedToken))
315
+ ThrowLastError("CreateRestrictedToken");
316
+ if (lowIntegrity) ApplyLowIntegrity(restrictedToken);
317
+ return restrictedToken;
318
+ }
319
+ finally
320
+ {
321
+ if (disabledSidBuffer != IntPtr.Zero) Marshal.FreeHGlobal(disabledSidBuffer);
322
+ if (adminSid != IntPtr.Zero) LocalFree(adminSid);
323
+ if (sourceToken != IntPtr.Zero) CloseHandle(sourceToken);
324
+ }
325
+ }
326
+
327
+ private static IntPtr CreateKillOnCloseJob()
328
+ {
329
+ IntPtr job = CreateJobObject(IntPtr.Zero, null);
330
+ if (job == IntPtr.Zero) ThrowLastError("CreateJobObject");
331
+ var limits = new JOBOBJECT_EXTENDED_LIMIT_INFORMATION();
332
+ limits.BasicLimitInformation.LimitFlags =
333
+ JOB_OBJECT_LIMIT_ACTIVE_PROCESS |
334
+ JOB_OBJECT_LIMIT_DIE_ON_UNHANDLED_EXCEPTION |
335
+ JOB_OBJECT_LIMIT_KILL_ON_JOB_CLOSE;
336
+ limits.BasicLimitInformation.ActiveProcessLimit = 256;
337
+ Int32 size = Marshal.SizeOf(typeof(JOBOBJECT_EXTENDED_LIMIT_INFORMATION));
338
+ IntPtr buffer = Marshal.AllocHGlobal(size);
339
+ try
340
+ {
341
+ Marshal.StructureToPtr(limits, buffer, false);
342
+ if (!SetInformationJobObject(job, JobObjectExtendedLimitInformation, buffer, checked((UInt32)size)))
343
+ ThrowLastError("SetInformationJobObject");
344
+ return job;
345
+ }
346
+ catch
347
+ {
348
+ CloseHandle(job);
349
+ throw;
350
+ }
351
+ finally
352
+ {
353
+ Marshal.FreeHGlobal(buffer);
354
+ }
355
+ }
356
+
357
+ public static int Run(string command, string workingDirectory, bool lowIntegrity, bool restrictedToken)
358
+ {
359
+ IntPtr token = IntPtr.Zero;
360
+ IntPtr job = IntPtr.Zero;
361
+ IntPtr handleBuffer = IntPtr.Zero;
362
+ PROCESS_INFORMATION processInfo = new PROCESS_INFORMATION();
363
+ var startup = new STARTUPINFOEX();
364
+ try
365
+ {
366
+ if (restrictedToken) token = CreateHardenedToken(lowIntegrity);
367
+ job = CreateKillOnCloseJob();
368
+ string shell = Environment.GetEnvironmentVariable("COMSPEC");
369
+ if (String.IsNullOrWhiteSpace(shell))
370
+ shell = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.System), "cmd.exe");
371
+ startup.StartupInfo.cb = checked((UInt32)Marshal.SizeOf(typeof(STARTUPINFOEX)));
372
+ startup.StartupInfo.dwFlags = STARTF_USESTDHANDLES;
373
+ startup.StartupInfo.hStdInput = GetStdHandle(-10);
374
+ startup.StartupInfo.hStdOutput = GetStdHandle(-11);
375
+ startup.StartupInfo.hStdError = GetStdHandle(-12);
376
+ MarkInheritable(startup.StartupInfo.hStdInput);
377
+ MarkInheritable(startup.StartupInfo.hStdOutput);
378
+ MarkInheritable(startup.StartupInfo.hStdError);
379
+ InitializeHandleAllowlist(ref startup, out handleBuffer);
380
+ var commandLine = new StringBuilder("\"" + shell + "\" /d /s /c \"" + command + "\"");
381
+ bool created = restrictedToken
382
+ ? CreateProcessAsUser(
383
+ token,
384
+ shell,
385
+ commandLine,
386
+ IntPtr.Zero,
387
+ IntPtr.Zero,
388
+ true,
389
+ CREATE_SUSPENDED | CREATE_NO_WINDOW | EXTENDED_STARTUPINFO_PRESENT,
390
+ IntPtr.Zero,
391
+ workingDirectory,
392
+ ref startup,
393
+ out processInfo)
394
+ : CreateProcess(
395
+ shell,
396
+ commandLine,
397
+ IntPtr.Zero,
398
+ IntPtr.Zero,
399
+ true,
400
+ CREATE_SUSPENDED | CREATE_NO_WINDOW | EXTENDED_STARTUPINFO_PRESENT,
401
+ IntPtr.Zero,
402
+ workingDirectory,
403
+ ref startup,
404
+ out processInfo);
405
+ if (!created) ThrowLastError(restrictedToken ? "CreateProcessAsUser" : "CreateProcess");
406
+ if (!AssignProcessToJobObject(job, processInfo.hProcess))
407
+ {
408
+ TerminateProcess(processInfo.hProcess, 126);
409
+ ThrowLastError("AssignProcessToJobObject");
410
+ }
411
+ if (ResumeThread(processInfo.hThread) == UInt32.MaxValue)
412
+ {
413
+ TerminateProcess(processInfo.hProcess, 126);
414
+ ThrowLastError("ResumeThread");
415
+ }
416
+ WaitForSingleObject(processInfo.hProcess, INFINITE);
417
+ UInt32 exitCode;
418
+ if (!GetExitCodeProcess(processInfo.hProcess, out exitCode))
419
+ ThrowLastError("GetExitCodeProcess");
420
+ return unchecked((int)exitCode);
421
+ }
422
+ finally
423
+ {
424
+ if (startup.lpAttributeList != IntPtr.Zero)
425
+ {
426
+ DeleteProcThreadAttributeList(startup.lpAttributeList);
427
+ Marshal.FreeHGlobal(startup.lpAttributeList);
428
+ }
429
+ if (handleBuffer != IntPtr.Zero) Marshal.FreeHGlobal(handleBuffer);
430
+ if (processInfo.hThread != IntPtr.Zero) CloseHandle(processInfo.hThread);
431
+ if (processInfo.hProcess != IntPtr.Zero) CloseHandle(processInfo.hProcess);
432
+ if (job != IntPtr.Zero) CloseHandle(job);
433
+ if (token != IntPtr.Zero) CloseHandle(token);
434
+ }
435
+ }
436
+ }
437
+ }
438
+ `;var $t=512*1024,Bt=744*60*60*1e3,Ft=Object.freeze(["allowedFilesystemRead","allowedFilesystemWrite","outsideFilesystemReadDenied","outsideFilesystemWriteDenied","unlistedFilesystemReadDenied","unlistedFilesystemWriteDenied","symlinkEscapeDenied","networkDefaultDeny","environmentSecretsExcluded","childProcessPolicyInherited","standardCommandLaunch","processTreeCleanup","timeoutEnforced","hostPolicyRecoveryClean","uiRestrictionsEnforced"]);var Gt=10*6e4,qt=Object.freeze({"win32-x64-wxc-exec.exe":"db0a3422be9e1b396cc1b2547c70ff16b27412438a31c10a45abf370cac86ae2","win32-arm64-wxc-exec.exe":"e430d0e4f44f616e91db684f8d825a6dc93e06a1262b8d00bcaac7522a317aab","linux-x64-lxc-exec":"1efe3f817f5ae9ba9f9f2fd59142e79b2dde7a4dd024576b0ddb635fc87edeb5","linux-arm64-lxc-exec":"fdc00ccecf362ae3ddd8ccad93fd7c8b5b1f03c68897ab05ef1c9f1d327ea3fe","darwin-arm64-mxc-exec-mac":"77c07a86f483ed91dd5be290cd77878ac0c56fe113cdb8c764e7e5201c744ad2"}),Kt=Object.freeze({"win32-x64-wxc-host-prep.exe":"531fb3cdb4b0c964908fd71b71d40961417afb399cbab72f92a25e95309a6416","win32-arm64-wxc-host-prep.exe":"3ef702332286a39153fc259310b5021e3de3c191751d7522684f6475f73af5ef"});var ur=Object.freeze({policyEnforcement:!0,restrictedIdentity:!1,lowIntegrity:!1,processTreeControl:!1,filesystemIsolation:!1,networkIsolation:!1,inheritedHandleAllowlist:!1,environmentSanitization:!0}),fr=Object.freeze({policyEnforcement:!0,restrictedIdentity:!0,lowIntegrity:!0,processTreeControl:!0,filesystemIsolation:!1,networkIsolation:!1,inheritedHandleAllowlist:!0,environmentSanitization:!0}),pr=Object.freeze({policyEnforcement:!0,restrictedIdentity:!0,lowIntegrity:!1,processTreeControl:!0,filesystemIsolation:!1,networkIsolation:!1,inheritedHandleAllowlist:!1,environmentSanitization:!0}),mr=Object.freeze({policyEnforcement:!0,restrictedIdentity:!0,lowIntegrity:!1,processTreeControl:!0,filesystemIsolation:!0,networkIsolation:!0,inheritedHandleAllowlist:!0,environmentSanitization:!0}),Ar=Object.freeze({policyEnforcement:!0,restrictedIdentity:!1,lowIntegrity:!1,processTreeControl:!1,filesystemIsolation:!1,networkIsolation:!1,inheritedHandleAllowlist:!1,environmentSanitization:!0});var Re=1,$=class extends Error{constructor(r,n){super(n);this.code=r;this.name="XenoSecureExecutionContractError"}code};function _e(e){let t=[];if(!e||typeof e!="object")return["Contract must be an object"];if(e.schemaVersion!==Re&&t.push("Unsupported schemaVersion"),e.contractId?.trim()||t.push("contractId is required"),(!e.identity?.runId?.trim()||!e.identity?.agentId?.trim())&&t.push("runId and agentId are required"),oe(e.createdAt)||t.push("createdAt must be an ISO 8601 timestamp"),e.expiresAt&&(!oe(e.expiresAt)||Date.parse(e.expiresAt)<=Date.parse(e.createdAt))&&t.push("expiresAt must be later than createdAt"),e.requestedLevel!==e.effectiveLevel&&t.push("requestedLevel and effectiveLevel must match"),e.trustMode==="untrusted"&&e.effectiveLevel!=="contained"&&t.push("Untrusted execution requires contained mode"),e.effectiveLevel==="contained"&&(e.adapter.certified||t.push("Contained mode requires a certified adapter"),e.adapter.certificationArtifactId||t.push("Contained mode requires a certification artifact"),(!e.adapter.capabilities.filesystemIsolation||e.filesystem.enforcement!=="os")&&t.push("Contained mode requires OS filesystem isolation"),(!e.adapter.capabilities.networkIsolation||e.network.enforcement!=="os")&&t.push("Contained mode requires OS network isolation"),e.network.default!=="deny"&&t.push("Contained networking must default deny")),e.network.enforcement==="none"&&!e.network.acknowledgedUnrestricted&&t.push("Unrestricted networking must be explicitly acknowledged"),e.filesystem.writeRoots.length>0&&e.profile.permissionProfile==="read-only"&&t.push("Read-only profiles cannot receive write roots"),(!Array.isArray(e.browser.readAllowedDomains)||!Array.isArray(e.browser.actAllowedDomains))&&t.push("Browser read/action domain policies are required"),(!Array.isArray(e.browser.allowedSchemes)||e.browser.allowedSchemes.some(r=>r!=="http"&&r!=="https"))&&t.push("Browser allowed schemes are invalid"),(!Array.isArray(e.browser.allowedPorts)||e.browser.allowedPorts.some(r=>!Number.isInteger(r)||r<1||r>65535))&&t.push("Browser allowed ports are invalid"),e.secrets.some(r=>!r.secretId.trim())&&t.push("Secret projections require non-empty secret IDs"),new Set(e.secrets.map(r=>r.secretId)).size!==e.secrets.length&&t.push("Secret IDs must be unique"),new Set(e.capabilityLeaseIds).size!==e.capabilityLeaseIds.length&&t.push("Capability lease IDs must be unique"),/^[a-f0-9]{64}$/.test(e.profile.fingerprint)||t.push("Profile fingerprint is invalid"),!/^[a-f0-9]{64}$/.test(e.fingerprint))t.push("Contract fingerprint is invalid");else{let r={...e};delete r.fingerprint,xe(r)!==e.fingerprint&&t.push("Contract fingerprint does not match content")}return t}function ie(e){let t=_e(e);if(t.length>0){let r=t.includes("Contract fingerprint does not match content");throw new $(r?"SECURITY_CONTRACT_FINGERPRINT_MISMATCH":"SECURITY_CONTRACT_INVALID",t.join("; "))}}function xe(e){return Ce("sha256").update(JSON.stringify(B(e))).digest("hex")}function B(e){return Array.isArray(e)?e.map(B):!e||typeof e!="object"?e:Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>[t,B(r)]))}function oe(e){return typeof e=="string"&&e.includes("T")&&Number.isFinite(Date.parse(e))}var Oe=/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/,ae=1048576;function ue(e){(!e||typeof e!="object")&&I("Automation request must be an object"),e.protocolVersion!==1&&I("Unsupported automation protocol version"),E(e.operationId,"operationId"),E(e.idempotencyKey,"idempotencyKey"),E(e.capabilityLeaseId,"capabilityLeaseId"),E(e.governingToolName,"governingToolName"),(!Number.isSafeInteger(e.expectedLeaseVersion)||e.expectedLeaseVersion<1)&&I("expectedLeaseVersion must be a positive safe integer"),me(e.requestedAt)||I("requestedAt must be an ISO 8601 timestamp"),V(e.operation)||I(`Unsupported automation operation: ${e.operation}`),(!e.parameters||typeof e.parameters!="object"||Array.isArray(e.parameters))&&I("parameters must be a JSON object");let t;try{t=Buffer.byteLength(JSON.stringify(e.parameters),"utf8")}catch(r){throw new a("AUTOMATION_REQUEST_INVALID","parameters must be serializable JSON",void 0,{cause:r})}if(t>ae&&I(`parameters exceed ${ae} bytes`),E(e.identity?.runId,"identity.runId"),E(e.identity?.agentId,"identity.agentId"),ie(e.executionContract),Ne(e),!e.executionContract.capabilityLeaseIds.includes(e.capabilityLeaseId))throw new a("AUTOMATION_CONTRACT_INVALID",`Capability lease ${e.capabilityLeaseId} is not bound to the execution contract`);if(e.executionContract.expiresAt&&Date.parse(e.executionContract.expiresAt)<=Date.now())throw new a("AUTOMATION_CONTRACT_EXPIRED","Execution contract has expired")}function R(e){(!e||typeof e!="object")&&m("Adapter manifest must be an object"),e.protocolVersion!==1&&m("Adapter protocol version is unsupported"),C(e.adapterId,"adapterId"),C(e.adapterVersion,"adapterVersion"),C(e.platform,"platform"),C(e.architecture,"architecture"),e.targetBinding!=="atomic-preflight"&&m("Adapter must implement atomic preflight target binding"),(!Array.isArray(e.operations)||e.operations.length===0)&&m("Adapter must declare operations");let t=new Set;for(let r of e.operations)V(r)||m(`Adapter declares unknown operation ${r}`),t.has(r)&&m(`Adapter declares duplicate operation ${r}`),t.add(r);e.certified&&!e.certificationArtifactId&&m("A certified automation adapter requires a certification artifact"),Array.isArray(e.limitations)||m("Adapter limitations must be an array"),e.operations.some(r=>r.startsWith("browser."))&&(!e.policyEnforcement.domain||!e.policyEnforcement.scheme||!e.policyEnforcement.port)&&m("Browser adapters must enforce domain, scheme, and port policy"),e.operations.some(r=>r.startsWith("computer."))&&!e.supports.immediateStop&&m("Computer-use adapters must support immediate stop")}function H(e,t,r){let n=h(e.operation);if(!t.operations.includes(e.operation))throw new a("AUTOMATION_OPERATION_UNSUPPORTED",`Adapter ${t.adapterId} does not support ${e.operation}`);if(n.surface==="browser"){let o=e.executionContract.browser.mode;if(o==="none"||n.effect==="act"&&o!=="act")throw new a("AUTOMATION_POLICY_DENIED",`Execution contract denies ${e.operation}`);if(Pe(e,r,n.effect==="act"),e.operation==="browser.download"&&e.executionContract.browser.downloads==="deny")throw new a("AUTOMATION_POLICY_DENIED","Execution contract denies browser downloads");if(e.operation==="browser.upload"&&e.executionContract.browser.uploads==="deny")throw new a("AUTOMATION_POLICY_DENIED","Execution contract denies browser uploads");if(e.operation.startsWith("browser.record.")&&e.executionContract.browser.recording!=="bounded")throw new a("AUTOMATION_POLICY_DENIED","Execution contract denies browser recording")}else{let o=e.executionContract.computer.mode;if(o==="none"||n.effect==="act"&&o!=="act")throw new a("AUTOMATION_POLICY_DENIED",`Execution contract denies ${e.operation}`);let i=e.executionContract.computer.allowedApplications,d=e.operation==="computer.launch"?Le(e):r.applicationId??e.declaredTarget?.applicationId;if((e.operation==="computer.launch"||i.length>0)&&(!d||!i.includes(d)))throw new a("AUTOMATION_POLICY_DENIED",`Application ${d??"<unknown>"} is not allowed`)}}function fe(e,t){let r=h(e.operation),n=r.surface==="browser"?r.effect==="act"?"browser-act":"browser-read":r.effect==="act"?"computer-act":"computer-observe";return{subject:{runId:e.identity.runId,agentId:e.identity.agentId,...e.identity.turnId?{turnId:e.identity.turnId}:{},toolName:e.governingToolName,operationId:e.operationId},kind:n,operation:e.operation,...se(e,t)?{resource:se(e,t)}:{},...de(t)?{destination:de(t)}:{}}}function se(e,t){return e.declaredTarget?.resource??Xe(t)}function pe(e){let t=h(e.operation).evidence,r=e.evidencePolicy??{},n=F(t.before,r.before),o=F(t.after,r.after),i=F(t.recording,r.recording),d=r.retainUntil;return d&&!me(d)&&I("evidencePolicy.retainUntil must be an ISO 8601 timestamp"),{before:n,after:o,recording:i,sensitivity:r.sensitivity??"confidential",...d?{retainUntil:d}:{},...r.legalHold!==void 0?{legalHold:r.legalHold}:{}}}function Ne(e){let t=e.executionContract.identity,r=["runId","agentId","sessionId","turnId","taskId","workspaceId"];for(let n of r){let o=t[n],i=e.identity[n];if(o!==void 0&&o!==i)throw new a("AUTOMATION_IDENTITY_MISMATCH",`Automation identity ${n} does not match the execution contract`)}}function Pe(e,t,r){let n=t.url??t.origin??e.declaredTarget?.url??e.declaredTarget?.origin;if(!n){if(["browser.tabs.list","browser.wait"].includes(e.operation))return;throw new a("AUTOMATION_PREFLIGHT_INVALID","Browser preflight did not bind an effective URL")}let o;try{o=new URL(n)}catch{throw new a("AUTOMATION_POLICY_DENIED","Browser target URL is invalid")}if(o.username||o.password)throw new a("AUTOMATION_POLICY_DENIED","Browser target URLs cannot contain credentials");let i=o.protocol.replace(/:$/,"");i!=="http"&&i!=="https"&&w(`Browser scheme ${o.protocol} is not supported`);let d=i,c=o.hostname.toLowerCase().replace(/\.$/,""),l=o.port?Number(o.port):d==="https"?443:80,s=e.executionContract.browser,u=De(c);if(le(c,s.deniedDomains)&&w(`Browser domain ${c} is denied`),ce(o,e.executionContract.network.denyDestinations)&&w(`Network policy explicitly denies ${d}://${c}:${l}`),u&&s.allowLoopbackDevelopment)return;s.allowedSchemes.includes(d)||w(`Browser scheme ${o.protocol} is not allowed`),s.allowedPorts.includes(l)||w(`Browser port ${l} is not allowed`);let p=r?s.actAllowedDomains:s.readAllowedDomains;le(c,p)||w(`Browser domain ${c} is outside the ${r?"action":"read"} allowlist`),e.executionContract.network.default==="deny"&&(ce(o,e.executionContract.network.allowDestinations)||w(`Network policy does not allow ${d}://${c}:${l}`))}function ce(e,t){let r=e.protocol.replace(/:$/,""),n=e.hostname.toLowerCase().replace(/\.$/,""),o=e.port?Number(e.port):r==="https"?443:80;return t.some(i=>{let d=i.scheme?.replace(/^custom:/,"");return i.host===n&&(i.port===void 0||i.port===o)&&(d===void 0||d===r)})}function Xe(e){return e.resource??e.tabId??e.pageId??e.deviceId??e.applicationId}function de(e){let t=e.origin??e.url;if(!t)return e.domain;try{return new URL(t).origin}catch{return t}}function Le(e){let t=e.parameters.target,r=t&&typeof t=="object"&&!Array.isArray(t)?t.app_id:void 0,n=e.parameters.applicationId??r??e.declaredTarget?.applicationId;return typeof n=="string"&&n.length>0?n:void 0}function le(e,t){return t.some(r=>{let n=r.toLowerCase();if(n.startsWith(".")){let o=n.slice(1);return e===o||e.endsWith(`.${o}`)}return e===n})}function De(e){return e==="localhost"||e==="127.0.0.1"||e==="[::1]"||e==="::1"}function F(e,t){let r={disabled:0,optional:1,required:2};return!t||r[t]<=r[e]?e:t}function E(e,t){(typeof e!="string"||!Oe.test(e))&&I(`${t} is invalid`)}function C(e,t){(typeof e!="string"||e.trim().length===0||e.length>256)&&m(`${t} is invalid`)}function me(e){return typeof e=="string"&&e.includes("T")&&Number.isFinite(Date.parse(e))}function w(e){throw new a("AUTOMATION_POLICY_DENIED",e)}function I(e){throw new a("AUTOMATION_REQUEST_INVALID",e)}function m(e){throw new a("AUTOMATION_OPERATION_UNSUPPORTED",e)}import{createHash as Ue}from"node:crypto";import{createHash as ke}from"node:crypto";function _(e){return{algorithm:"sha256",value:ke("sha256").update(e).digest("hex")}}var Me="[\\u0000-\\u001f\\u007f]",Xr=new RegExp(Me);var x=class extends Error{constructor(r,n,o,i){super(n,i);this.code=r;this.detail=o;this.name="XenoArtifactRepositoryError"}code;detail};var z=32*1024*1024,Ve=1024*1024*1024,$e=/^[A-Za-z0-9][A-Za-z0-9._:/-]{0,255}$/;function W(e){let r=(e.now??(()=>new Date().toISOString()))(),n=new Set;return e.evidence.map((o,i)=>{if(Fe(o),n.has(o.evidenceId))throw new a("AUTOMATION_EVIDENCE_INVALID",`Duplicate evidence ID ${o.evidenceId}`);n.add(o.evidenceId);let d=Be(o),c=Ue("sha256").update(`${e.request.operationId}\0${o.evidenceId}\0${d.hash.value}`).digest("hex").slice(0,32);return{schemaVersion:1,artifactId:`automation_${c}`,revision:1,kind:o.kind,title:o.title,...o.description?{description:o.description}:{},state:"draft",createdAt:r,mediaType:o.mediaType,sensitivity:o.sensitivity??e.policy.sensitivity,identity:{...e.request.identity},content:d,provenance:{producer:{kind:"tool",id:e.request.governingToolName,displayName:e.manifest.adapterId,profileFingerprint:e.request.executionContract.profile.fingerprint},operationId:e.request.operationId,executionContractFingerprint:e.request.executionContract.fingerprint,capabilityLeaseIds:[e.request.capabilityLeaseId],attributes:{automationProtocolVersion:e.request.protocolVersion,automationOperation:e.request.operation,automationEvidenceId:o.evidenceId,automationEvidencePhase:o.phase,adapterId:e.manifest.adapterId,adapterVersion:e.manifest.adapterVersion,evidenceIndex:i}},...o.anchors?{anchors:structuredClone(o.anchors)}:{},...e.policy.retainUntil||e.policy.legalHold!==void 0?{retention:{...e.policy.retainUntil?{retainUntil:e.policy.retainUntil}:{},...e.policy.legalHold!==void 0?{legalHold:e.policy.legalHold}:{}}}:{},extensions:{...o.extensions??{},xenoAutomation:{phase:o.phase,adapter:e.manifest.adapterId,certifiedAdapter:e.manifest.certified}}}})}async function J(e,t){if(!e)return t.map(n=>structuredClone(n));let r=[];for(let n of t)try{let o=await e.create(n);r.push(o.artifact)}catch(o){if(o instanceof x&&o.code==="ARTIFACT_ALREADY_EXISTS"){let i=await e.require(n.artifactId,n.revision);if(i.artifact.content.hash.value===n.content.hash.value){r.push(i.artifact);continue}}throw new a("AUTOMATION_EVIDENCE_PERSISTENCE_FAILED",`Failed to persist automation evidence ${n.artifactId}`,{artifactId:n.artifactId},{cause:o})}return r}function O(e,t,r){if(t[r]==="required"&&!e.some(n=>n.phase===r))throw new a("AUTOMATION_EVIDENCE_REQUIRED",`Automation operation requires ${r} evidence before it can be trusted`)}function Be(e){if(e.content.type==="text"){let t=Buffer.byteLength(e.content.text,"utf8");return Ae(t),{hash:_(e.content.text),sizeBytes:t,storage:{type:"inline",text:e.content.text},encoding:"utf8",...e.redactedPreview?{redactedPreview:e.redactedPreview}:{}}}if(e.content.type==="base64"){let t=He(e.content.base64);return Ae(t.byteLength),{hash:_(t),sizeBytes:t.byteLength,storage:{type:"inline",base64:e.content.base64},encoding:"base64",...e.redactedPreview?{redactedPreview:e.redactedPreview}:{}}}if(!Number.isSafeInteger(e.content.sizeBytes)||e.content.sizeBytes<0||e.content.sizeBytes>Ve)throw new a("AUTOMATION_EVIDENCE_INVALID","Referenced evidence size is invalid");if(!e.content.hash?.algorithm||!e.content.hash.value)throw new a("AUTOMATION_EVIDENCE_INVALID","Referenced evidence requires a content hash");if(e.content.hash.algorithm==="sha256"&&!/^[a-f0-9]{64}$/.test(e.content.hash.value))throw new a("AUTOMATION_EVIDENCE_INVALID","Referenced evidence SHA-256 is invalid");return{hash:{...e.content.hash},sizeBytes:e.content.sizeBytes,storage:structuredClone(e.content.storage),...e.content.encoding?{encoding:e.content.encoding}:{},...e.redactedPreview?{redactedPreview:e.redactedPreview}:{}}}function Fe(e){(!e||typeof e!="object")&&g("Evidence must be an object"),$e.test(e.evidenceId)||g("Evidence ID is invalid"),["before","action","after","recording","diagnostic"].includes(e.phase)||g("Evidence phase is invalid"),(!e.kind||!e.title?.trim()||e.title.length>512)&&g("Evidence kind and title are required"),/^[\w!#$&^_.+-]+\/[\w!#$&^_.+-]+(?:;.*)?$/.test(e.mediaType)||g("Evidence media type is invalid")}function He(e){(e.length===0||e.length>Math.ceil(z/3)*4+4)&&g("Inline base64 evidence is empty or too large"),(!/^[A-Za-z0-9+/]*={0,2}$/.test(e)||e.length%4!==0)&&g("Inline evidence is not canonical base64");let t=Buffer.from(e,"base64");return t.toString("base64")!==e&&g("Inline evidence is not canonical base64"),t}function Ae(e){e>z&&g(`Inline evidence exceeds ${z} bytes`)}function g(e){throw new a("AUTOMATION_EVIDENCE_INVALID",e)}import{createHash as je}from"node:crypto";var he=3e4,ze=1e3,Ie=class{adapter;leaseAuthority;artifactRepository;now;executions=new Map;active=new Map;constructor(t){this.adapter=t.adapter,this.leaseAuthority=t.leaseAuthority,this.artifactRepository=t.artifactRepository,this.now=t.now??(()=>new Date().toISOString())}execute(t,r){let n=Ke(t),o=this.executions.get(t.operationId);if(o){if(o.fingerprint!==n)throw new a("AUTOMATION_OPERATION_CONFLICT",`Operation ${t.operationId} was already submitted with different authority or parameters`);return o.promise}let i=new AbortController,d=Ye(r,i);this.active.set(t.operationId,i);let c=this.executeFresh(t,i.signal).finally(()=>{d(),this.active.delete(t.operationId)});return this.executions.set(t.operationId,{fingerprint:n,promise:c}),this.trimIdempotencyRecords(),c}async stop(t,r="human-stop"){let n=this.active.get(t);return n?(n.abort(new Error(r)),await this.adapter.stop?.(t,r),!0):!1}async executeFresh(t,r){ue(t),q(r);let n=await this.adapter.manifest();R(n);let o=h(t.operation),i=pe(t),d=this.now(),c=await this.adapter.preflight(t,r);We(c,this.now()),H(t,n,c.observedTarget),q(r);let l=c.evidence??[];O(l,i,"before");let s=await J(this.artifactRepository,W({request:t,manifest:n,policy:i,evidence:l,now:this.now}));if(q(r),Date.parse(c.expiresAt)<=Date.parse(this.now()))throw new a("AUTOMATION_PREFLIGHT_INVALID","Automation preflight expired before authority consumption");let u=fe(t,c.observedTarget),p=await this.leaseAuthority.consume(t.capabilityLeaseId,t.expectedLeaseVersion,u),v={contractFingerprint:t.executionContract.fingerprint,lease:p,capabilityUse:u},f;try{f=await this.adapter.execute(t,c,v,r)}catch(A){return G({request:t,manifest:n,descriptorEffect:o.effect,target:c.observedTarget,lease:p,artifacts:s,startedAt:d,completedAt:this.now(),status:r.aborted?"cancelled":"error",code:r.aborted?"AUTOMATION_CANCELLED":"AUTOMATION_ADAPTER_ERROR",message:r.aborted?"Automation operation was stopped":Ze(A)})}Je(f);let ee=Ge(c.observedTarget,f.observedTarget),N;try{H(t,n,f.observedTarget)}catch(A){N=A instanceof Error?A:new Error(String(A))}let S=f.evidence??[];qe(l,S);let te=[],P;try{O(S,i,"after"),O([...l,...S],i,"recording"),te=await J(this.artifactRepository,W({request:t,manifest:n,policy:i,evidence:S,now:this.now}))}catch(A){P=A instanceof Error?A:new Error(String(A))}let X=[...s,...te];return ee||N?G({request:t,manifest:n,descriptorEffect:o.effect,target:f.observedTarget,lease:p,artifacts:X,startedAt:f.startedAt,completedAt:f.completedAt,status:"error",code:"AUTOMATION_TARGET_CHANGED",message:ee??N.message}):P?G({request:t,manifest:n,descriptorEffect:o.effect,target:f.observedTarget,lease:p,artifacts:X,startedAt:f.startedAt,completedAt:f.completedAt,status:"evidence-incomplete",code:"AUTOMATION_EVIDENCE_INCOMPLETE",message:P.message}):{operationId:t.operationId,status:f.status,effect:o.effect,startedAt:f.startedAt,completedAt:f.completedAt,adapter:ge(n),target:structuredClone(f.observedTarget),...f.data!==void 0?{data:structuredClone(f.data)}:{},artifacts:X,lease:be(p),...f.error?{error:{...f.error}}:{}}}trimIdempotencyRecords(){for(;this.executions.size>ze;){let t=this.executions.keys().next().value;if(!t||this.active.has(t))break;this.executions.delete(t)}}};function We(e,t){if(!e||typeof e!="object"||!e.token?.trim())throw new a("AUTOMATION_PREFLIGHT_INVALID","Adapter returned an invalid preflight token");let r=Date.parse(e.preparedAt),n=Date.parse(e.expiresAt),o=Date.parse(t);if(!Number.isFinite(r)||!Number.isFinite(n)||n<=r||n<=o)throw new a("AUTOMATION_PREFLIGHT_INVALID","Adapter returned an expired or invalid preflight window");if(n-r>he)throw new a("AUTOMATION_PREFLIGHT_INVALID",`Preflight TTL exceeds ${he} ms`);if(!e.observedTarget||typeof e.observedTarget!="object")throw new a("AUTOMATION_PREFLIGHT_INVALID","Adapter did not bind an observed target")}function Je(e){if(!e||typeof e!="object")throw new a("AUTOMATION_REQUEST_INVALID","Adapter returned no result");if(!["ok","denied","cancelled","error"].includes(e.status))throw new a("AUTOMATION_REQUEST_INVALID","Adapter returned an invalid status");if(!Number.isFinite(Date.parse(e.startedAt))||!Number.isFinite(Date.parse(e.completedAt)))throw new a("AUTOMATION_REQUEST_INVALID","Adapter result timestamps are invalid");if(Date.parse(e.completedAt)<Date.parse(e.startedAt))throw new a("AUTOMATION_REQUEST_INVALID","Adapter completion precedes its start");if(!e.observedTarget||typeof e.observedTarget!="object")throw new a("AUTOMATION_REQUEST_INVALID","Adapter result has no observed target")}function Ge(e,t){let r=["tabId","deviceId","displayId"];for(let n of r)if(e[n]!==void 0&&e[n]!==t[n])return`Adapter changed bound ${n} between preflight and execution`}function qe(e,t){let r=new Set(e.map(n=>n.evidenceId));for(let n of t){if(r.has(n.evidenceId))throw new a("AUTOMATION_EVIDENCE_INVALID",`Duplicate evidence ID ${n.evidenceId}`);r.add(n.evidenceId)}}function G(e){return{operationId:e.request.operationId,status:e.status,effect:e.descriptorEffect,startedAt:e.startedAt,completedAt:e.completedAt,adapter:ge(e.manifest),target:structuredClone(e.target),artifacts:e.artifacts,lease:be(e.lease),error:{code:e.code,message:e.message}}}function ge(e){return{adapterId:e.adapterId,adapterVersion:e.adapterVersion,platform:e.platform,architecture:e.architecture}}function be(e){return{leaseId:e.leaseId,version:e.version,state:e.state,useCount:e.useCount}}function Ke(e){return je("sha256").update(JSON.stringify(K(e))).digest("hex")}function K(e){return Array.isArray(e)?e.map(K):!e||typeof e!="object"?e:Object.fromEntries(Object.entries(e).filter(([,t])=>t!==void 0).sort(([t],[r])=>t.localeCompare(r)).map(([t,r])=>[t,K(r)]))}function Ye(e,t){if(!e)return()=>{};let r=()=>t.abort(e.reason);return e.aborted?r():e.addEventListener("abort",r,{once:!0}),()=>e.removeEventListener("abort",r)}function q(e){if(e.aborted)throw new a("AUTOMATION_CANCELLED","Automation operation was stopped before dispatch")}function Ze(e){return e instanceof Error&&e.message.slice(0,1024)||"Automation adapter failed"}function Qe(e,t=()=>new Date().toISOString()){let r=[];et(r,"manifest.valid",()=>R(e));let n=new Set(e.operations);return y(r,n,e.supports.consoleInspection,"browser.console.read","console inspection"),y(r,n,e.supports.networkInspection,"browser.network.read","network inspection"),y(r,n,e.supports.storageInspection,"browser.storage.read","storage inspection"),y(r,n,e.supports.pageErrorInspection,"browser.page-errors.read","page-error inspection"),y(r,n,e.supports.recordings,"browser.record.start","recording start"),y(r,n,e.supports.recordings,"browser.record.stop","recording stop"),n.has("browser.upload")&&b(r,"policy.upload",e.policyEnforcement.upload,"Upload policy is enforced"),n.has("browser.download")&&b(r,"policy.download",e.policyEnforcement.download,"Download policy is enforced"),[...n].some(o=>o.startsWith("browser."))&&(b(r,"policy.redirect",e.policyEnforcement.redirect,"Redirect policy is enforced"),b(r,"control.handback",e.supports.deterministicHandback,"Deterministic hand-back is supported")),[...n].some(o=>o.startsWith("computer."))&&(b(r,"control.stop",e.supports.immediateStop,"Immediate human stop is supported"),b(r,"privacy.redaction",e.supports.sensitiveRegionRedaction,"Sensitive-region redaction is supported")),b(r,"certification.binding",!e.certified||!!e.certificationArtifactId,e.certified?"Certification artifact is bound":"Adapter does not claim certification"),{protocolVersion:1,adapter:{adapterId:e.adapterId,adapterVersion:e.adapterVersion,platform:e.platform,architecture:e.architecture},generatedAt:t(),passed:r.every(o=>o.status==="pass"),checks:r}}function on(e){let r=Qe(e).checks.filter(n=>n.status==="fail");if(r.length>0)throw new a("AUTOMATION_OPERATION_UNSUPPORTED",r.map(n=>`${n.id}: ${n.message}`).join("; "))}function y(e,t,r,n,o){let i=t.has(n);b(e,`capability.${n}`,r===i,r===i?`${o} declaration matches the operation catalog`:`${o} declaration does not match ${n}`)}function et(e,t,r){try{r(),e.push({id:t,status:"pass",message:"Manifest satisfies the protocol contract"})}catch(n){e.push({id:t,status:"fail",message:n instanceof Error?n.message:String(n)})}}function b(e,t,r,n){e.push({id:t,status:r?"pass":"fail",message:n})}var tt=6e4,rt=48*1024*1024,we=class{endpoint;token;timeoutMs;maxResponseBytes;fetchImpl;constructor(t){if(this.endpoint=nt(t.baseUrl),this.token=ot(t.token),this.timeoutMs=Ee(t.timeoutMs??tt,1e3,3e5,"timeoutMs"),this.maxResponseBytes=Ee(t.maxResponseBytes??rt,1024,128*1024*1024,"maxResponseBytes"),this.fetchImpl=t.fetch??globalThis.fetch,typeof this.fetchImpl!="function")throw new a("AUTOMATION_TRANSPORT_ERROR","A Fetch API implementation is required")}manifest(){return this.request("manifest","GET")}preflight(t,r){return this.request("preflight","POST",t,r)}execute(t,r,n,o){return this.request("execute","POST",{request:t,preflight:r,grant:n},o)}async stop(t,r){await this.request("stop","POST",{operationId:t,reason:r.slice(0,512)})}async request(t,r,n,o){let i=new AbortController,d=st(o,i),c=setTimeout(()=>i.abort(new Error("automation transport timeout")),this.timeoutMs);c.unref?.();try{let l=new URL(t,this.endpoint),s=await this.fetchImpl(l,{method:r,redirect:"error",cache:"no-store",credentials:"omit",headers:{authorization:`Bearer ${this.token}`,accept:"application/json",...r==="POST"?{"content-type":"application/json"}:{}},...r==="POST"?{body:JSON.stringify(n??{})}:{},signal:i.signal}),u=await it(s,this.maxResponseBytes);if(!s.ok){let p=at(u);throw new a("AUTOMATION_TRANSPORT_ERROR",`XENO Browser rejected ${t}: ${p.message}`,{status:s.status,route:t,adapterCode:p.code})}if(!Y(u)||u.ok!==!0||!("result"in u))throw new a("AUTOMATION_RESPONSE_INVALID",`XENO Browser returned an invalid ${t} envelope`);return u.result}catch(l){if(l instanceof a)throw l;let s=o?.aborted;throw new a(s?"AUTOMATION_CANCELLED":"AUTOMATION_TRANSPORT_ERROR",s?"Automation transport was stopped":`XENO Browser ${t} transport failed`,{route:t},{cause:l})}finally{clearTimeout(c),d()}}};function nt(e){let t;try{t=new URL(e)}catch(n){throw new a("AUTOMATION_TRANSPORT_ERROR","XENO Browser base URL is invalid",void 0,{cause:n})}if(t.protocol!=="http:"&&t.protocol!=="https:")throw new a("AUTOMATION_TRANSPORT_ERROR","XENO Browser transport requires HTTP(S)");if(t.username||t.password||t.search||t.hash)throw new a("AUTOMATION_TRANSPORT_ERROR","XENO Browser base URL cannot contain credentials, query, or fragment");let r=t.hostname.toLowerCase().replace(/^\[|\]$/g,"").replace(/\.$/,"");if(r!=="localhost"&&r!=="127.0.0.1"&&r!=="::1")throw new a("AUTOMATION_TRANSPORT_ERROR","XENO Browser transport must use a loopback host");if(!t.port)throw new a("AUTOMATION_TRANSPORT_ERROR","XENO Browser transport requires an explicit port");return t.pathname="/v1/automation/",t}function ot(e){if(typeof e!="string"||e.length<32||e.length>512||/\s/.test(e))throw new a("AUTOMATION_TRANSPORT_ERROR","XENO Browser session token is invalid");return e}async function it(e,t){let r=Number(e.headers.get("content-length"));if(Number.isFinite(r)&&r>t)throw new a("AUTOMATION_RESPONSE_INVALID",`XENO Browser response exceeds ${t} bytes`);if(e.headers.get("content-type")?.split(";")[0]?.trim().toLowerCase()!=="application/json")throw new a("AUTOMATION_RESPONSE_INVALID","XENO Browser response is not application/json");if(!e.body)throw new a("AUTOMATION_RESPONSE_INVALID","XENO Browser response body is missing");let o=e.body.getReader(),i=[],d=0;for(;;){let{done:s,value:u}=await o.read();if(s)break;if(d+=u.byteLength,d>t)throw await o.cancel("response too large"),new a("AUTOMATION_RESPONSE_INVALID",`XENO Browser response exceeds ${t} bytes`);i.push(u)}let c=new Uint8Array(d),l=0;for(let s of i)c.set(s,l),l+=s.byteLength;try{return JSON.parse(new TextDecoder("utf-8",{fatal:!0}).decode(c))}catch(s){throw new a("AUTOMATION_RESPONSE_INVALID","XENO Browser response contains invalid JSON",void 0,{cause:s})}}function at(e){return Y(e)&&Y(e.error)?{code:typeof e.error.code=="string"?e.error.code.slice(0,128):"UNKNOWN",message:typeof e.error.message=="string"?e.error.message.slice(0,1024):"request failed"}:{code:"UNKNOWN",message:"request failed"}}function st(e,t){if(!e)return()=>{};let r=()=>t.abort(e.reason);return e.aborted?r():e.addEventListener("abort",r,{once:!0}),()=>e.removeEventListener("abort",r)}function Ee(e,t,r,n){if(!Number.isSafeInteger(e)||e<t||e>r)throw new a("AUTOMATION_TRANSPORT_ERROR",`${n} must be an integer from ${t} to ${r}`);return e}function Y(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}import{createHash as ct,randomUUID as dt}from"node:crypto";var lt=8*1024*1024,ut=4;function un(e){return Tt(e.operations??U).map(r=>ft(r,e.runtime))}function ft(e,t){return{definition:{name:e,description:It(e),input_schema:pt(e)},projectPolicyInput(r){let n=wt(e,r),o=bt(e,r);return{observabilityInput:n,permissionInput:o,permissionPreview:Et(e,r),approvalKey:`xeno-automation:${e}:${St(r)}`,riskLevel:gt(e)}},async execute(r,n){let o=n?.authorization;if(!o||o.toolName!==e)return{success:!1,output:"",error:"Governed automation requires a host-issued authorization receipt",errorCode:"AUTOMATION_AUTHORIZATION_RECEIPT_REQUIRED",retryable:!1};let i=n.operationId??`automation_${dt()}`,d=Q(e,r);n.reportProgress?.({activity:"state",message:`Authorizing ${e}`});try{let c=await t.execute({operation:e,governingToolName:e,operationId:i,idempotencyKey:i,parameters:structuredClone(r),...d?{declaredTarget:d}:{},authorization:o,...n.signal?{signal:n.signal}:{},...n.reportProgress?{reportProgress:n.reportProgress}:{}}),l=c.status==="ok";return{success:l,output:JSON.stringify(yt(c)),...l?{}:{error:c.error?.message??`Governed automation ended with ${c.status}`,errorCode:c.error?.code??`AUTOMATION_${c.status.toUpperCase().replaceAll("-","_")}`},assistantContent:vt(c),evidence:c.artifacts.map(s=>({id:s.artifactId,kind:"artifact",status:c.status==="evidence-incomplete"?"failed":"verified",observedAt:s.updatedAt??s.createdAt,operationId:i,detail:{artifact_kind:s.kind,revision:s.revision,sensitivity:s.sensitivity}})),retryable:c.error?.retryable??!1}}catch(c){let l=n.signal?.aborted===!0;return{success:!1,output:"",error:l?"Governed automation was stopped":Ct(c),errorCode:l?"AUTOMATION_CANCELLED":Rt(c),retryable:!l}}}}}function pt(e){let t=mt(e),r=At(e);return{type:"object",properties:t,...r.length>0?{required:r}:{},...e==="browser.locate"?{oneOf:[{required:["selector"]},{required:["text"]}]}:{},additionalProperties:!1}}function mt(e){let t=(d,c=8192)=>({type:"string",minLength:1,maxLength:c,description:d}),r={type:"number"},n={type:"boolean"},o={type:"object",properties:{x:r,y:r},required:["x","y"],additionalProperties:!1},i={deviceId:t("Target xeno-use device ID.",256),applicationId:t("Expected or launch-target application ID.",512),displayId:t("Target display ID.",256)};switch(e){case"browser.navigate":return{url:t("Destination URL."),waitUntil:{enum:["load","none"]},tabId:t("Expected active tab ID. Hosts with multiple visible tabs should require this.",256)};case"browser.wait":return{until:{enum:["load","ms"]},value:{type:"integer",minimum:0,maximum:6e4}};case"browser.snapshot":return{mode:{enum:["text","html","markdown","a11y"]},tabId:t("Expected active tab ID.",256)};case"browser.screenshot":return{tabId:t("Expected active tab ID.",256)};case"browser.locate":return{selector:t("CSS selector."),text:t("Visible text to locate.")};case"browser.click":return{selector:t("CSS selector returned by browser.snapshot or browser.locate."),tabId:t("Expected active tab ID.",256)};case"browser.type":return{selector:t("CSS selector."),text:{type:"string",maxLength:65536},clear:n,submit:n,tabId:t("Expected active tab ID.",256)};case"browser.key":return{combo:t("Key combo such as Control+a or Enter.",256),tabId:t("Expected active tab ID.",256)};case"browser.select":return{selector:t("CSS selector."),value:t("Option value."),tabId:t("Expected active tab ID.",256)};case"browser.scroll":return{selector:t("Optional CSS selector."),dx:r,dy:r,tabId:t("Expected active tab ID.",256)};case"browser.tabs.open":return{url:t("URL to open in an isolated browser tab.")};case"browser.tabs.close":return{tabId:t("Tab ID to close.",256)};case"browser.console.read":case"browser.network.read":case"browser.page-errors.read":return{limit:{type:"integer",minimum:1,maximum:1e3},clear:n,tabId:t("Expected active tab ID.",256)};case"browser.storage.read":return{tabId:t("Expected active tab ID.",256)};case"browser.upload":return{selector:t("File input or drop-target selector."),backendNodeId:{type:"integer",minimum:1},hostPaths:{type:"array",items:t("Host file path.",32768),minItems:1,maxItems:64},drop:n,tabId:t("Expected active tab ID.",256)};case"browser.download":return{toPath:t("Approved destination path.",32768),trigger:{type:"object",properties:{url:t("Download URL."),selector:t("Download trigger selector.")},oneOf:[{required:["url"]},{required:["selector"]}],additionalProperties:!1},tabId:t("Expected active tab ID.",256)};case"browser.record.start":return{maxDurationMs:{type:"integer",minimum:1e3,maximum:6e4},intervalMs:{type:"integer",minimum:100,maximum:5e3},tabId:t("Expected active tab ID.",256)};case"browser.record.stop":return{tabId:t("Expected active tab ID.",256)};case"computer.observe":case"computer.screenshot":case"computer.window-state":return i;case"computer.point":return{...i,point:o,durationMs:{type:"integer",minimum:0,maximum:6e4}};case"computer.click":return{...i,point:o,button:{enum:["left","right","middle"]},modifiers:ht()};case"computer.double-click":case"computer.right-click":return{...i,point:o};case"computer.drag":return{...i,from:o,to:o,durationMs:{type:"integer",minimum:0,maximum:6e4}};case"computer.type":return{...i,text:{type:"string",maxLength:65536}};case"computer.key":return{...i,combo:t("Key combo such as Control+a or Enter.",256)};case"computer.scroll":return{...i,at:o,delta:o};case"computer.wait":return{...i,milliseconds:{type:"integer",minimum:0,maximum:3e5}};case"computer.launch":return{...i,applicationId:t("Explicitly allowlisted application ID.",512)};case"browser.back":case"browser.forward":case"browser.reload":return{tabId:t("Expected active tab ID.",256)};case"browser.tabs.list":return{}}}function At(e){switch(e){case"browser.navigate":case"browser.tabs.open":return["url"];case"browser.click":return["selector"];case"browser.type":return["selector","text"];case"browser.key":return["combo"];case"browser.select":return["selector","value"];case"browser.upload":return["hostPaths"];case"browser.download":return["toPath","trigger"];case"computer.point":case"computer.click":case"computer.double-click":case"computer.right-click":return["point"];case"computer.drag":return["from","to"];case"computer.type":return["text"];case"computer.key":return["combo"];case"computer.scroll":return["at","delta"];case"computer.launch":return["applicationId"];default:return[]}}function ht(){return{type:"object",properties:{shift:{type:"boolean"},ctrl:{type:"boolean"},alt:{type:"boolean"},meta:{type:"boolean"}},additionalProperties:!1}}function It(e){let t=h(e),r=e.split(".").slice(1).join(" ");return`${t.effect==="act"?"Act on":"Inspect"} the ${t.surface} using governed ${r} automation. The host requires policy approval, an exact capability lease, target-bound preflight, and durable evidence.`}function gt(e){return h(e).effect==="observe"?e==="browser.navigate"||e==="browser.tabs.open"?"medium":"low":["browser.type","browser.upload","browser.download","computer.type","computer.key","computer.launch"].includes(e)?"high":"medium"}function bt(e,t){let r=Q(e,t),n={operation:e};r&&(n.target=r);for(let o of["selector","clear","submit","combo","value","dx","dy","point","from","to","at","delta","milliseconds"])t[o]!==void 0&&(n[o]=structuredClone(t[o]));return typeof t.text=="string"&&(n.text=`[redacted ${t.text.length} characters]`),Array.isArray(t.hostPaths)&&(n.hostPaths=t.hostPaths.map(()=>"[redacted host path]")),typeof t.toPath=="string"&&(n.toPath="[redacted destination path]"),n}function wt(e,t){let r=structuredClone(t);return typeof r.text=="string"&&(r.text=`[redacted ${r.text.length} characters]`),Array.isArray(r.hostPaths)&&(r.hostPaths=r.hostPaths.map(()=>"[redacted host path]")),typeof r.toPath=="string"&&(r.toPath="[redacted destination path]"),ve(r.trigger)&&typeof r.trigger.url=="string"&&(r.trigger={...r.trigger,url:ye(r.trigger.url)}),typeof r.url=="string"&&(r.url=ye(r.url)),{operation:e,...r}}function Et(e,t){let r=Q(e,t),n=r?.url??r?.applicationId??r?.deviceId??r?.tabId??r?.resource??"current target";return`${e} on ${n}`}function Q(e,t){let r={};return typeof t.url=="string"&&(r.url=t.url),typeof t.tabId=="string"&&(r.tabId=t.tabId),typeof t.deviceId=="string"&&(r.deviceId=t.deviceId),typeof t.applicationId=="string"&&(r.applicationId=t.applicationId),typeof t.displayId=="string"&&(r.displayId=t.displayId),(e==="browser.navigate"||e==="browser.tabs.list"||e==="browser.tabs.open")&&(r.resource="browser-tabs"),Object.keys(r).length>0?r:void 0}function yt(e){return{operationId:e.operationId,status:e.status,effect:e.effect,startedAt:e.startedAt,completedAt:e.completedAt,adapter:e.adapter,target:e.target,...e.data!==void 0?{data:e.data}:{},artifacts:e.artifacts.map(t=>({artifactId:t.artifactId,revision:t.revision,kind:t.kind,title:t.title,state:t.state,mediaType:t.mediaType,sensitivity:t.sensitivity,hash:t.content.hash,sizeBytes:t.content.sizeBytes})),lease:e.lease,...e.error?{error:e.error}:{}}}function vt(e){let t=[];for(let r of e.artifacts){if(t.length>=ut||!r.mediaType.startsWith("image/"))continue;let n=r.content.storage;if(n.type!=="inline"||typeof n.base64!="string")continue;let o=Math.floor(n.base64.length*.75);o<=0||o>lt||t.push({type:"image_url",image_url:{url:`data:${r.mediaType};base64,${n.base64}`,detail:"high"}})}return t}function Tt(e){let t=new Set(U),r=new Set;for(let n of e){if(!t.has(n))throw new TypeError(`Unsupported XENO automation operation: ${String(n)}`);r.add(n)}return Array.from(r)}function St(e){return ct("sha256").update(Z(e)).digest("hex")}function Z(e){return Array.isArray(e)?`[${e.map(Z).join(",")}]`:ve(e)?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${Z(e[t])}`).join(",")}}`:JSON.stringify(e)??"null"}function ye(e){try{let t=new URL(e);return`${t.origin}${t.pathname}`}catch{return"[invalid URL]"}}function Ct(e){return e instanceof Error?e.message:String(e)}function Rt(e){return e&&typeof e=="object"&&"code"in e&&typeof e.code=="string"?e.code:"AUTOMATION_EXECUTION_FAILED"}function ve(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}export{U as XENO_AUTOMATION_OPERATIONS,T as XENO_AUTOMATION_PROTOCOL_VERSION,a as XenoAutomationError,Ie as XenoGovernedAutomationExecutor,we as XenoLoopbackAutomationAdapter,O as assertRequiredXenoAutomationEvidence,R as assertValidXenoAutomationAdapterManifest,ue as assertValidXenoAutomationRequest,on as assertXenoAutomationAdapterConformant,H as assertXenoAutomationAuthority,fe as buildXenoAutomationCapabilityUse,Qe as createXenoAutomationConformanceReport,un as createXenoGovernedAutomationTools,h as describeXenoAutomationOperation,V as isXenoAutomationOperation,W as materializeXenoAutomationEvidence,J as persistXenoAutomationEvidence,pe as resolveXenoAutomationEvidencePolicy};
@@ -0,0 +1 @@
1
+ {"inputs":{"src/automation/types.ts":{"bytes":7477,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3492,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":894,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5686,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/media/xeno-deflate.ts":{"bytes":20551,"imports":[],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":23316,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/media/xeno-deflate.ts","kind":"import-statement","original":"../media/xeno-deflate.js"}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5859,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13628,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1239,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28957,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17793,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":25096,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15973,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":9397,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1530,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25931,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":30001,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8825,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":14618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4428,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":9084,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19655,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":291,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.cjs":{"imports":[{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true},{"path":"node:crypto","kind":"require-call","external":true}],"exports":[],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/index.ts":{"bytesInOutput":737},"src/automation/types.ts":{"bytesInOutput":8},"src/automation/operations.ts":{"bytesInOutput":1638},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":3310},"src/media/xeno-deflate.ts":{"bytesInOutput":1061},"src/security/windows-process-containment.ts":{"bytesInOutput":18774},"src/security/containment-certification.ts":{"bytesInOutput":442},"src/security/mxc-containment.ts":{"bytesInOutput":709},"src/security/process-containment.ts":{"bytesInOutput":999},"src/automation/policy.ts":{"bytesInOutput":7870},"src/automation/evidence.ts":{"bytesInOutput":4445},"src/artifacts/hash.ts":{"bytesInOutput":129},"src/artifacts/validation.ts":{"bytesInOutput":52},"src/artifacts/repository.ts":{"bytesInOutput":137},"src/automation/executor.ts":{"bytesInOutput":6081},"src/automation/conformance.ts":{"bytesInOutput":2191},"src/automation/http-adapter.ts":{"bytesInOutput":4320},"src/automation/tool-pack.ts":{"bytesInOutput":10033}},"bytes":64106}}}
@@ -0,0 +1 @@
1
+ {"inputs":{"src/automation/types.ts":{"bytes":7477,"imports":[],"format":"esm"},"src/automation/operations.ts":{"bytes":3492,"imports":[],"format":"esm"},"src/automation/errors.ts":{"bytes":894,"imports":[],"format":"esm"},"src/security/path-policy.ts":{"bytes":5686,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/media/xeno-deflate.ts":{"bytes":20551,"imports":[],"format":"esm"},"src/security/windows-process-containment.ts":{"bytes":23316,"imports":[{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"src/media/xeno-deflate.ts","kind":"import-statement","original":"../media/xeno-deflate.js"}],"format":"esm"},"src/security/linux-process-containment.ts":{"bytes":5859,"imports":[{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/containment-certification.ts":{"bytes":13628,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true}],"format":"esm"},"src/security/environment-policy.ts":{"bytes":1239,"imports":[],"format":"esm"},"src/security/mxc-containment.ts":{"bytes":28957,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:fs","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"node:path","kind":"import-statement","external":true},{"path":"node:child_process","kind":"import-statement","external":true},{"path":"node:url","kind":"import-statement","external":true},{"path":"src/security/environment-policy.ts","kind":"import-statement","original":"./environment-policy.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"}],"format":"esm"},"src/security/process-containment.ts":{"bytes":17793,"imports":[{"path":"src/security/windows-process-containment.ts","kind":"import-statement","original":"./windows-process-containment.js"},{"path":"src/security/linux-process-containment.ts","kind":"import-statement","original":"./linux-process-containment.js"},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/containment-certification.ts","kind":"import-statement","original":"./containment-certification.js"},{"path":"src/security/mxc-containment.ts","kind":"import-statement","original":"./mxc-containment.js"}],"format":"esm"},"src/security/secure-execution-contract.ts":{"bytes":25096,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:os","kind":"import-statement","external":true},{"path":"src/security/path-policy.ts","kind":"import-statement","original":"./path-policy.js"},{"path":"src/security/process-containment.ts","kind":"import-statement","original":"./process-containment.js"}],"format":"esm"},"src/automation/policy.ts":{"bytes":15973,"imports":[{"path":"src/security/secure-execution-contract.ts","kind":"import-statement","original":"../security/secure-execution-contract.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/types.ts":{"bytes":9397,"imports":[],"format":"esm"},"src/artifacts/hash.ts":{"bytes":1530,"imports":[{"path":"node:crypto","kind":"import-statement","external":true}],"format":"esm"},"src/artifacts/validation.ts":{"bytes":25931,"imports":[{"path":"node:buffer","kind":"import-statement","external":true},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"./hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/artifacts/repository.ts":{"bytes":30001,"imports":[{"path":"src/artifacts/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/artifacts/validation.ts","kind":"import-statement","original":"./validation.js"}],"format":"esm"},"src/automation/evidence.ts":{"bytes":8825,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/artifacts/repository.ts","kind":"import-statement","original":"../artifacts/repository.js"},{"path":"src/artifacts/hash.ts","kind":"import-statement","original":"../artifacts/hash.js"},{"path":"src/artifacts/types.ts","kind":"import-statement","original":"../artifacts/types.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/executor.ts":{"bytes":14618,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"}],"format":"esm"},"src/automation/conformance.ts":{"bytes":4428,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"}],"format":"esm"},"src/automation/http-adapter.ts":{"bytes":9084,"imports":[{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"}],"format":"esm"},"src/automation/tool-pack.ts":{"bytes":19655,"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"}],"format":"esm"},"src/automation/index.ts":{"bytes":291,"imports":[{"path":"src/automation/types.ts","kind":"import-statement","original":"./types.js"},{"path":"src/automation/operations.ts","kind":"import-statement","original":"./operations.js"},{"path":"src/automation/errors.ts","kind":"import-statement","original":"./errors.js"},{"path":"src/automation/policy.ts","kind":"import-statement","original":"./policy.js"},{"path":"src/automation/evidence.ts","kind":"import-statement","original":"./evidence.js"},{"path":"src/automation/executor.ts","kind":"import-statement","original":"./executor.js"},{"path":"src/automation/conformance.ts","kind":"import-statement","original":"./conformance.js"},{"path":"src/automation/http-adapter.ts","kind":"import-statement","original":"./http-adapter.js"},{"path":"src/automation/tool-pack.ts","kind":"import-statement","original":"./tool-pack.js"}],"format":"esm"}},"outputs":{"dist/automation/index.js":{"imports":[{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true},{"path":"node:crypto","kind":"import-statement","external":true}],"exports":["XENO_AUTOMATION_OPERATIONS","XENO_AUTOMATION_PROTOCOL_VERSION","XenoAutomationError","XenoGovernedAutomationExecutor","XenoLoopbackAutomationAdapter","assertRequiredXenoAutomationEvidence","assertValidXenoAutomationAdapterManifest","assertValidXenoAutomationRequest","assertXenoAutomationAdapterConformant","assertXenoAutomationAuthority","buildXenoAutomationCapabilityUse","createXenoAutomationConformanceReport","createXenoGovernedAutomationTools","describeXenoAutomationOperation","isXenoAutomationOperation","materializeXenoAutomationEvidence","persistXenoAutomationEvidence","resolveXenoAutomationEvidencePolicy"],"entryPoint":"src/automation/index.ts","inputs":{"src/automation/types.ts":{"bytesInOutput":8},"src/automation/index.ts":{"bytesInOutput":0},"src/automation/operations.ts":{"bytesInOutput":1638},"src/automation/errors.ts":{"bytesInOutput":129},"src/security/secure-execution-contract.ts":{"bytesInOutput":3308},"src/media/xeno-deflate.ts":{"bytesInOutput":1061},"src/security/windows-process-containment.ts":{"bytesInOutput":18774},"src/security/containment-certification.ts":{"bytesInOutput":442},"src/security/mxc-containment.ts":{"bytesInOutput":709},"src/security/process-containment.ts":{"bytesInOutput":999},"src/automation/policy.ts":{"bytesInOutput":7873},"src/automation/evidence.ts":{"bytesInOutput":4442},"src/artifacts/hash.ts":{"bytesInOutput":126},"src/artifacts/validation.ts":{"bytesInOutput":52},"src/artifacts/repository.ts":{"bytesInOutput":137},"src/automation/executor.ts":{"bytesInOutput":6074},"src/automation/conformance.ts":{"bytesInOutput":2191},"src/automation/http-adapter.ts":{"bytesInOutput":4316},"src/automation/tool-pack.ts":{"bytesInOutput":10028}},"bytes":62997}}}