@secure-exec/core 0.2.1 → 0.3.0-rc.2

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 (248) hide show
  1. package/README.md +5 -5
  2. package/dist/binary.d.ts +4 -0
  3. package/dist/binary.js +25 -0
  4. package/dist/bytes.d.ts +2 -0
  5. package/dist/bytes.js +6 -0
  6. package/dist/callbacks.d.ts +41 -0
  7. package/dist/callbacks.js +94 -0
  8. package/dist/cargo.d.ts +2 -0
  9. package/dist/cargo.js +142 -0
  10. package/dist/correlation.d.ts +10 -0
  11. package/dist/correlation.js +49 -0
  12. package/dist/descriptors.d.ts +34 -0
  13. package/dist/descriptors.js +37 -0
  14. package/dist/event-buffer.d.ts +90 -0
  15. package/dist/event-buffer.js +313 -0
  16. package/dist/ext.d.ts +7 -0
  17. package/dist/ext.js +13 -0
  18. package/dist/filesystem.d.ts +41 -0
  19. package/dist/filesystem.js +70 -0
  20. package/dist/frame-payload-codec.d.ts +8 -0
  21. package/dist/frame-payload-codec.js +14 -0
  22. package/dist/frame-rpc.d.ts +38 -0
  23. package/dist/frame-rpc.js +73 -0
  24. package/dist/frame-stream.d.ts +27 -0
  25. package/dist/frame-stream.js +99 -0
  26. package/dist/framing.d.ts +7 -0
  27. package/dist/framing.js +22 -0
  28. package/dist/generated/AcpLimitsConfig.d.ts +4 -0
  29. package/dist/generated/AcpLimitsConfig.js +2 -0
  30. package/dist/generated/CreateVmConfig.d.ts +19 -0
  31. package/dist/generated/FsPermissionRule.d.ts +6 -0
  32. package/dist/generated/FsPermissionRuleSet.d.ts +6 -0
  33. package/dist/generated/FsPermissionRuleSet.js +1 -0
  34. package/dist/generated/FsPermissionScope.d.ts +3 -0
  35. package/dist/generated/FsPermissionScope.js +1 -0
  36. package/dist/generated/HttpLimitsConfig.d.ts +3 -0
  37. package/dist/generated/HttpLimitsConfig.js +2 -0
  38. package/dist/generated/JsModuleResolution.d.ts +1 -0
  39. package/dist/generated/JsModuleResolution.js +2 -0
  40. package/dist/generated/JsRuntimeConfig.d.ts +26 -0
  41. package/dist/generated/JsRuntimeConfig.js +1 -0
  42. package/dist/generated/JsRuntimeLimitsConfig.d.ts +7 -0
  43. package/dist/generated/JsRuntimeLimitsConfig.js +2 -0
  44. package/dist/generated/JsRuntimePlatform.d.ts +1 -0
  45. package/dist/generated/JsRuntimePlatform.js +2 -0
  46. package/dist/generated/MountPluginDescriptor.d.ts +4 -0
  47. package/dist/generated/MountPluginDescriptor.js +2 -0
  48. package/dist/generated/NativeRootFilesystemConfig.d.ts +5 -0
  49. package/dist/generated/NativeRootFilesystemConfig.js +1 -0
  50. package/dist/generated/PatternPermissionRule.d.ts +6 -0
  51. package/dist/generated/PatternPermissionRule.js +1 -0
  52. package/dist/generated/PatternPermissionRuleSet.d.ts +6 -0
  53. package/dist/generated/PatternPermissionRuleSet.js +1 -0
  54. package/dist/generated/PatternPermissionScope.d.ts +3 -0
  55. package/dist/generated/PatternPermissionScope.js +1 -0
  56. package/dist/generated/PermissionMode.d.ts +1 -0
  57. package/dist/generated/PermissionMode.js +2 -0
  58. package/dist/generated/PermissionsPolicy.d.ts +10 -0
  59. package/dist/generated/PermissionsPolicy.js +1 -0
  60. package/dist/generated/PluginLimitsConfig.d.ts +4 -0
  61. package/dist/generated/PluginLimitsConfig.js +2 -0
  62. package/dist/generated/PythonLimitsConfig.d.ts +5 -0
  63. package/dist/generated/PythonLimitsConfig.js +2 -0
  64. package/dist/generated/ResourceLimitsConfig.d.ts +22 -0
  65. package/dist/generated/ResourceLimitsConfig.js +2 -0
  66. package/dist/generated/RootFilesystemConfig.d.ts +9 -0
  67. package/dist/generated/RootFilesystemConfig.js +1 -0
  68. package/dist/generated/RootFilesystemEntry.d.ts +13 -0
  69. package/dist/generated/RootFilesystemEntry.js +1 -0
  70. package/dist/generated/RootFilesystemEntryEncoding.d.ts +1 -0
  71. package/dist/generated/RootFilesystemEntryEncoding.js +2 -0
  72. package/dist/generated/RootFilesystemEntryKind.d.ts +1 -0
  73. package/dist/generated/RootFilesystemEntryKind.js +2 -0
  74. package/dist/generated/RootFilesystemLowerDescriptor.d.ts +7 -0
  75. package/dist/generated/RootFilesystemLowerDescriptor.js +1 -0
  76. package/dist/generated/RootFilesystemMode.d.ts +1 -0
  77. package/dist/generated/RootFilesystemMode.js +2 -0
  78. package/dist/generated/ToolLimitsConfig.d.ts +10 -0
  79. package/dist/generated/ToolLimitsConfig.js +2 -0
  80. package/dist/generated/VmDnsConfig.d.ts +6 -0
  81. package/dist/generated/VmDnsConfig.js +2 -0
  82. package/dist/generated/VmLimitsConfig.d.ts +18 -0
  83. package/dist/generated/VmLimitsConfig.js +1 -0
  84. package/dist/generated/VmListenPolicyConfig.d.ts +5 -0
  85. package/dist/generated/VmListenPolicyConfig.js +2 -0
  86. package/dist/generated/WasmLimitsConfig.d.ts +5 -0
  87. package/dist/generated/WasmLimitsConfig.js +2 -0
  88. package/dist/generated-protocol.d.ts +1037 -0
  89. package/dist/generated-protocol.js +2887 -0
  90. package/dist/index.d.ts +24 -62
  91. package/dist/index.js +24 -53
  92. package/dist/json.d.ts +2 -0
  93. package/dist/json.js +20 -0
  94. package/dist/kernel-proxy.d.ts +149 -0
  95. package/dist/kernel-proxy.js +1733 -0
  96. package/dist/native-client.d.ts +41 -0
  97. package/dist/native-client.js +124 -0
  98. package/dist/node-runtime.d.ts +490 -0
  99. package/dist/node-runtime.js +585 -0
  100. package/dist/numbers.d.ts +1 -0
  101. package/dist/numbers.js +8 -0
  102. package/dist/ownership.d.ts +18 -0
  103. package/dist/ownership.js +77 -0
  104. package/dist/permissions.d.ts +29 -0
  105. package/dist/permissions.js +68 -0
  106. package/dist/process.d.ts +35 -0
  107. package/dist/process.js +125 -0
  108. package/dist/protocol-client.d.ts +46 -0
  109. package/dist/protocol-client.js +180 -0
  110. package/dist/protocol-frames.d.ts +68 -0
  111. package/dist/protocol-frames.js +139 -0
  112. package/dist/protocol-maps.d.ts +28 -0
  113. package/dist/protocol-maps.js +217 -0
  114. package/dist/protocol-schema.d.ts +10 -0
  115. package/dist/protocol-schema.js +11 -0
  116. package/dist/request-payloads.d.ts +137 -0
  117. package/dist/request-payloads.js +210 -0
  118. package/dist/response-payloads.d.ts +107 -0
  119. package/dist/response-payloads.js +161 -0
  120. package/dist/sidecar-client.d.ts +242 -0
  121. package/dist/sidecar-client.js +797 -0
  122. package/dist/state.d.ts +40 -0
  123. package/dist/state.js +44 -0
  124. package/dist/test-runtime.d.ts +526 -0
  125. package/dist/test-runtime.js +2119 -0
  126. package/dist/vm-config.d.ts +31 -0
  127. package/dist/vm-config.js +1 -0
  128. package/fixtures/alpine-defaults.json +520 -0
  129. package/fixtures/base-filesystem.json +528 -0
  130. package/package.json +193 -115
  131. package/LICENSE +0 -191
  132. package/dist/bridge-setup.d.ts +0 -6
  133. package/dist/bridge-setup.js +0 -9
  134. package/dist/esm-compiler.d.ts +0 -18
  135. package/dist/esm-compiler.js +0 -72
  136. package/dist/fs-helpers.d.ts +0 -23
  137. package/dist/fs-helpers.js +0 -41
  138. package/dist/generated/isolate-runtime.d.ts +0 -19
  139. package/dist/generated/isolate-runtime.js +0 -21
  140. package/dist/generated/polyfills.d.ts +0 -82
  141. package/dist/generated/polyfills.js +0 -82
  142. package/dist/isolate-runtime/apply-custom-global-policy.js +0 -53
  143. package/dist/isolate-runtime/apply-timing-mitigation-freeze.js +0 -130
  144. package/dist/isolate-runtime/apply-timing-mitigation-off.js +0 -14
  145. package/dist/isolate-runtime/bridge-attach.js +0 -29
  146. package/dist/isolate-runtime/bridge-initial-globals.js +0 -385
  147. package/dist/isolate-runtime/eval-script-result.js +0 -8
  148. package/dist/isolate-runtime/global-exposure-helpers.js +0 -36
  149. package/dist/isolate-runtime/init-commonjs-module-globals.js +0 -28
  150. package/dist/isolate-runtime/override-process-cwd.js +0 -8
  151. package/dist/isolate-runtime/override-process-env.js +0 -8
  152. package/dist/isolate-runtime/require-setup.js +0 -4153
  153. package/dist/isolate-runtime/set-commonjs-file-globals.js +0 -36
  154. package/dist/isolate-runtime/set-stdin-data.js +0 -10
  155. package/dist/isolate-runtime/setup-dynamic-import.js +0 -123
  156. package/dist/isolate-runtime/setup-fs-facade.js +0 -87
  157. package/dist/kernel/command-registry.d.ts +0 -44
  158. package/dist/kernel/command-registry.js +0 -114
  159. package/dist/kernel/device-backend.d.ts +0 -14
  160. package/dist/kernel/device-backend.js +0 -251
  161. package/dist/kernel/device-layer.d.ts +0 -12
  162. package/dist/kernel/device-layer.js +0 -271
  163. package/dist/kernel/dns-cache.d.ts +0 -29
  164. package/dist/kernel/dns-cache.js +0 -52
  165. package/dist/kernel/fd-table.d.ts +0 -84
  166. package/dist/kernel/fd-table.js +0 -278
  167. package/dist/kernel/file-lock.d.ts +0 -34
  168. package/dist/kernel/file-lock.js +0 -122
  169. package/dist/kernel/host-adapter.d.ts +0 -50
  170. package/dist/kernel/host-adapter.js +0 -8
  171. package/dist/kernel/index.d.ts +0 -36
  172. package/dist/kernel/index.js +0 -34
  173. package/dist/kernel/kernel.d.ts +0 -9
  174. package/dist/kernel/kernel.js +0 -1415
  175. package/dist/kernel/mount-table.d.ts +0 -75
  176. package/dist/kernel/mount-table.js +0 -353
  177. package/dist/kernel/permissions.d.ts +0 -36
  178. package/dist/kernel/permissions.js +0 -150
  179. package/dist/kernel/pipe-manager.d.ts +0 -64
  180. package/dist/kernel/pipe-manager.js +0 -267
  181. package/dist/kernel/proc-backend.d.ts +0 -30
  182. package/dist/kernel/proc-backend.js +0 -428
  183. package/dist/kernel/proc-layer.d.ts +0 -11
  184. package/dist/kernel/proc-layer.js +0 -507
  185. package/dist/kernel/process-table.d.ts +0 -126
  186. package/dist/kernel/process-table.js +0 -651
  187. package/dist/kernel/pty.d.ts +0 -109
  188. package/dist/kernel/pty.js +0 -552
  189. package/dist/kernel/socket-table.d.ts +0 -312
  190. package/dist/kernel/socket-table.js +0 -1188
  191. package/dist/kernel/timer-table.d.ts +0 -54
  192. package/dist/kernel/timer-table.js +0 -108
  193. package/dist/kernel/types.d.ts +0 -541
  194. package/dist/kernel/types.js +0 -98
  195. package/dist/kernel/user.d.ts +0 -29
  196. package/dist/kernel/user.js +0 -35
  197. package/dist/kernel/vfs.d.ts +0 -82
  198. package/dist/kernel/vfs.js +0 -25
  199. package/dist/kernel/wait.d.ts +0 -45
  200. package/dist/kernel/wait.js +0 -112
  201. package/dist/kernel/wstatus.d.ts +0 -21
  202. package/dist/kernel/wstatus.js +0 -33
  203. package/dist/module-resolver.d.ts +0 -29
  204. package/dist/module-resolver.js +0 -314
  205. package/dist/package-bundler.d.ts +0 -41
  206. package/dist/package-bundler.js +0 -497
  207. package/dist/runtime-driver.d.ts +0 -66
  208. package/dist/shared/api-types.d.ts +0 -83
  209. package/dist/shared/bridge-contract.d.ts +0 -772
  210. package/dist/shared/bridge-contract.js +0 -169
  211. package/dist/shared/console-formatter.d.ts +0 -22
  212. package/dist/shared/console-formatter.js +0 -161
  213. package/dist/shared/constants.d.ts +0 -3
  214. package/dist/shared/constants.js +0 -3
  215. package/dist/shared/errors.d.ts +0 -16
  216. package/dist/shared/errors.js +0 -21
  217. package/dist/shared/esm-utils.d.ts +0 -28
  218. package/dist/shared/esm-utils.js +0 -97
  219. package/dist/shared/global-exposure.d.ts +0 -38
  220. package/dist/shared/global-exposure.js +0 -876
  221. package/dist/shared/in-memory-fs.d.ts +0 -16
  222. package/dist/shared/in-memory-fs.js +0 -115
  223. package/dist/shared/permissions.d.ts +0 -36
  224. package/dist/shared/permissions.js +0 -314
  225. package/dist/shared/require-setup.d.ts +0 -6
  226. package/dist/shared/require-setup.js +0 -9
  227. package/dist/test/block-store-conformance.d.ts +0 -34
  228. package/dist/test/block-store-conformance.js +0 -251
  229. package/dist/test/metadata-store-conformance.d.ts +0 -37
  230. package/dist/test/metadata-store-conformance.js +0 -646
  231. package/dist/test/vfs-conformance.d.ts +0 -65
  232. package/dist/test/vfs-conformance.js +0 -842
  233. package/dist/types.d.ts +0 -98
  234. package/dist/types.js +0 -6
  235. package/dist/vfs/chunked-vfs.d.ts +0 -66
  236. package/dist/vfs/chunked-vfs.js +0 -1290
  237. package/dist/vfs/host-block-store.d.ts +0 -19
  238. package/dist/vfs/host-block-store.js +0 -97
  239. package/dist/vfs/memory-block-store.d.ts +0 -16
  240. package/dist/vfs/memory-block-store.js +0 -45
  241. package/dist/vfs/memory-metadata.d.ts +0 -75
  242. package/dist/vfs/memory-metadata.js +0 -528
  243. package/dist/vfs/sqlite-metadata.d.ts +0 -91
  244. package/dist/vfs/sqlite-metadata.js +0 -582
  245. package/dist/vfs/types.d.ts +0 -210
  246. package/dist/vfs/types.js +0 -8
  247. /package/dist/{runtime-driver.js → generated/CreateVmConfig.js} +0 -0
  248. /package/dist/{shared/api-types.js → generated/FsPermissionRule.js} +0 -0
@@ -0,0 +1,99 @@
1
+ import { encodeLengthPrefixedPayload, tryDecodeLengthPrefixedPayload, } from "./framing.js";
2
+ export class StdioFrameTransport {
3
+ stdin;
4
+ stdout;
5
+ encodeFrame;
6
+ decodeFrame;
7
+ frameListeners = new Set();
8
+ errorListeners = new Set();
9
+ endListeners = new Set();
10
+ stdoutBuffer = Buffer.alloc(0);
11
+ constructor(options) {
12
+ this.stdin = options.stdin;
13
+ this.stdout = options.stdout;
14
+ this.encodeFrame = options.encodeFrame;
15
+ this.decodeFrame = options.decodeFrame;
16
+ this.stdout.on("data", this.handleData);
17
+ this.stdout.on("end", this.handleEnd);
18
+ this.stdout.on("error", this.handleError);
19
+ }
20
+ onFrame(handler) {
21
+ this.frameListeners.add(handler);
22
+ return () => {
23
+ this.frameListeners.delete(handler);
24
+ };
25
+ }
26
+ onError(handler) {
27
+ this.errorListeners.add(handler);
28
+ return () => {
29
+ this.errorListeners.delete(handler);
30
+ };
31
+ }
32
+ onEnd(handler) {
33
+ this.endListeners.add(handler);
34
+ return () => {
35
+ this.endListeners.delete(handler);
36
+ };
37
+ }
38
+ async writeFrame(frame) {
39
+ const payload = this.encodeFrame(frame);
40
+ const encoded = encodeLengthPrefixedPayload(payload);
41
+ await new Promise((resolve, reject) => {
42
+ this.stdin.write(encoded, (error) => {
43
+ if (error) {
44
+ reject(error);
45
+ return;
46
+ }
47
+ resolve();
48
+ });
49
+ });
50
+ }
51
+ dispose() {
52
+ this.stdout.off("data", this.handleData);
53
+ this.stdout.off("end", this.handleEnd);
54
+ this.stdout.off("error", this.handleError);
55
+ this.frameListeners.clear();
56
+ this.errorListeners.clear();
57
+ this.endListeners.clear();
58
+ }
59
+ handleData = (chunk) => {
60
+ const bytes = typeof chunk === "string"
61
+ ? Buffer.from(chunk)
62
+ : Buffer.isBuffer(chunk)
63
+ ? chunk
64
+ : Buffer.from(chunk);
65
+ this.stdoutBuffer = Buffer.concat([this.stdoutBuffer, bytes]);
66
+ this.drainFrames();
67
+ };
68
+ handleEnd = () => {
69
+ for (const listener of this.endListeners) {
70
+ listener();
71
+ }
72
+ };
73
+ handleError = (error) => {
74
+ const normalized = error instanceof Error ? error : new Error(String(error));
75
+ for (const listener of this.errorListeners) {
76
+ listener(normalized);
77
+ }
78
+ };
79
+ drainFrames() {
80
+ for (;;) {
81
+ const decoded = tryDecodeLengthPrefixedPayload(this.stdoutBuffer);
82
+ if (!decoded) {
83
+ return;
84
+ }
85
+ this.stdoutBuffer = decoded.remaining;
86
+ let frame;
87
+ try {
88
+ frame = this.decodeFrame(decoded.payload);
89
+ }
90
+ catch (error) {
91
+ this.handleError(error);
92
+ continue;
93
+ }
94
+ for (const listener of this.frameListeners) {
95
+ listener(frame);
96
+ }
97
+ }
98
+ }
99
+ }
@@ -0,0 +1,7 @@
1
+ export declare const LENGTH_PREFIX_BYTES = 4;
2
+ export interface LengthPrefixedPayload {
3
+ payload: Buffer;
4
+ remaining: Buffer;
5
+ }
6
+ export declare function encodeLengthPrefixedPayload(payload: Uint8Array): Buffer;
7
+ export declare function tryDecodeLengthPrefixedPayload(buffer: Uint8Array): LengthPrefixedPayload | null;
@@ -0,0 +1,22 @@
1
+ export const LENGTH_PREFIX_BYTES = 4;
2
+ export function encodeLengthPrefixedPayload(payload) {
3
+ const encoded = Buffer.allocUnsafe(LENGTH_PREFIX_BYTES + payload.length);
4
+ encoded.writeUInt32BE(payload.length, 0);
5
+ encoded.set(payload, LENGTH_PREFIX_BYTES);
6
+ return encoded;
7
+ }
8
+ export function tryDecodeLengthPrefixedPayload(buffer) {
9
+ const source = Buffer.isBuffer(buffer) ? buffer : Buffer.from(buffer);
10
+ if (source.length < LENGTH_PREFIX_BYTES) {
11
+ return null;
12
+ }
13
+ const declaredLength = source.readUInt32BE(0);
14
+ const frameEnd = LENGTH_PREFIX_BYTES + declaredLength;
15
+ if (source.length < frameEnd) {
16
+ return null;
17
+ }
18
+ return {
19
+ payload: source.subarray(LENGTH_PREFIX_BYTES, frameEnd),
20
+ remaining: source.subarray(frameEnd),
21
+ };
22
+ }
@@ -0,0 +1,4 @@
1
+ export type AcpLimitsConfig = {
2
+ maxReadLineBytes?: number;
3
+ stdoutBufferByteLimit?: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { JsRuntimeConfig } from "./JsRuntimeConfig.js";
2
+ import type { NativeRootFilesystemConfig } from "./NativeRootFilesystemConfig.js";
3
+ import type { PermissionsPolicy } from "./PermissionsPolicy.js";
4
+ import type { RootFilesystemConfig } from "./RootFilesystemConfig.js";
5
+ import type { VmDnsConfig } from "./VmDnsConfig.js";
6
+ import type { VmLimitsConfig } from "./VmLimitsConfig.js";
7
+ import type { VmListenPolicyConfig } from "./VmListenPolicyConfig.js";
8
+ export type CreateVmConfig = {
9
+ cwd?: string;
10
+ env: Record<string, string>;
11
+ rootFilesystem: RootFilesystemConfig;
12
+ permissions?: PermissionsPolicy;
13
+ limits?: VmLimitsConfig;
14
+ dns?: VmDnsConfig;
15
+ nativeRoot?: NativeRootFilesystemConfig;
16
+ listen?: VmListenPolicyConfig;
17
+ loopbackExemptPorts: Array<number>;
18
+ jsRuntime?: JsRuntimeConfig;
19
+ };
@@ -0,0 +1,6 @@
1
+ import type { PermissionMode } from "./PermissionMode.js";
2
+ export type FsPermissionRule = {
3
+ mode: PermissionMode;
4
+ operations: Array<string>;
5
+ paths: Array<string>;
6
+ };
@@ -0,0 +1,6 @@
1
+ import type { FsPermissionRule } from "./FsPermissionRule.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type FsPermissionRuleSet = {
4
+ default?: PermissionMode;
5
+ rules: Array<FsPermissionRule>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { FsPermissionRuleSet } from "./FsPermissionRuleSet.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type FsPermissionScope = PermissionMode | FsPermissionRuleSet;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export type HttpLimitsConfig = {
2
+ maxFetchResponseBytes?: number;
3
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type JsModuleResolution = "node" | "relative" | "none";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,26 @@
1
+ import type { JsModuleResolution } from "./JsModuleResolution.js";
2
+ import type { JsRuntimePlatform } from "./JsRuntimePlatform.js";
3
+ /**
4
+ * Guest JavaScript host-environment configuration.
5
+ *
6
+ * Selects which globals/builtins/module-resolution surface guest JS sees,
7
+ * modeled on esbuild's `platform`. Omitting this preserves full Node.js
8
+ * emulation (`platform = node`).
9
+ */
10
+ export type JsRuntimeConfig = {
11
+ /**
12
+ * Which host environment to emulate for guest JS. Default `node`.
13
+ */
14
+ platform: JsRuntimePlatform;
15
+ /**
16
+ * How bare import specifiers resolve. Independent of `platform`.
17
+ * Default `node`.
18
+ */
19
+ moduleResolution: JsModuleResolution;
20
+ /**
21
+ * Node builtin-module allow-list. Only valid when `platform = node`.
22
+ * `None` => engine default allow-list. `Some([])` => deny all builtins.
23
+ * `Some([..])` => exactly those.
24
+ */
25
+ allowedBuiltins?: Array<string>;
26
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export type JsRuntimeLimitsConfig = {
2
+ v8HeapLimitMb?: number;
3
+ capturedOutputLimitBytes?: number;
4
+ stdinBufferLimitBytes?: number;
5
+ eventPayloadLimitBytes?: number;
6
+ v8IpcMaxFrameBytes?: number;
7
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type JsRuntimePlatform = "node" | "browser" | "neutral" | "bare";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,4 @@
1
+ export type MountPluginDescriptor = {
2
+ id: string;
3
+ config: import("../descriptors.js").MountConfigJsonValue;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ import type { MountPluginDescriptor } from "./MountPluginDescriptor.js";
2
+ export type NativeRootFilesystemConfig = {
3
+ plugin: MountPluginDescriptor;
4
+ readOnly: boolean;
5
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { PermissionMode } from "./PermissionMode.js";
2
+ export type PatternPermissionRule = {
3
+ mode: PermissionMode;
4
+ operations: Array<string>;
5
+ patterns: Array<string>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,6 @@
1
+ import type { PatternPermissionRule } from "./PatternPermissionRule.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type PatternPermissionRuleSet = {
4
+ default?: PermissionMode;
5
+ rules: Array<PatternPermissionRule>;
6
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ import type { PatternPermissionRuleSet } from "./PatternPermissionRuleSet.js";
2
+ import type { PermissionMode } from "./PermissionMode.js";
3
+ export type PatternPermissionScope = PermissionMode | PatternPermissionRuleSet;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type PermissionMode = "allow" | "ask" | "deny";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ import type { FsPermissionScope } from "./FsPermissionScope.js";
2
+ import type { PatternPermissionScope } from "./PatternPermissionScope.js";
3
+ export type PermissionsPolicy = {
4
+ fs?: FsPermissionScope;
5
+ network?: PatternPermissionScope;
6
+ childProcess?: PatternPermissionScope;
7
+ process?: PatternPermissionScope;
8
+ env?: PatternPermissionScope;
9
+ tool?: PatternPermissionScope;
10
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export type PluginLimitsConfig = {
2
+ maxPersistedManifestBytes?: number;
3
+ maxPersistedManifestFileBytes?: number;
4
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ export type PythonLimitsConfig = {
2
+ outputBufferMaxBytes?: number;
3
+ executionTimeoutMs?: number;
4
+ vfsRpcTimeoutMs?: number;
5
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,22 @@
1
+ export type ResourceLimitsConfig = {
2
+ cpuCount?: number;
3
+ maxProcesses?: number;
4
+ maxOpenFds?: number;
5
+ maxPipes?: number;
6
+ maxPtys?: number;
7
+ maxSockets?: number;
8
+ maxConnections?: number;
9
+ maxSocketBufferedBytes?: number;
10
+ maxSocketDatagramQueueLen?: number;
11
+ maxFilesystemBytes?: number;
12
+ maxInodeCount?: number;
13
+ maxBlockingReadMs?: number;
14
+ maxPreadBytes?: number;
15
+ maxFdWriteBytes?: number;
16
+ maxProcessArgvBytes?: number;
17
+ maxProcessEnvBytes?: number;
18
+ maxReaddirEntries?: number;
19
+ maxWasmFuel?: number;
20
+ maxWasmMemoryBytes?: number;
21
+ maxWasmStackBytes?: number;
22
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { RootFilesystemEntry } from "./RootFilesystemEntry.js";
2
+ import type { RootFilesystemLowerDescriptor } from "./RootFilesystemLowerDescriptor.js";
3
+ import type { RootFilesystemMode } from "./RootFilesystemMode.js";
4
+ export type RootFilesystemConfig = {
5
+ mode: RootFilesystemMode;
6
+ disableDefaultBaseLayer: boolean;
7
+ lowers: Array<RootFilesystemLowerDescriptor>;
8
+ bootstrapEntries: Array<RootFilesystemEntry>;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,13 @@
1
+ import type { RootFilesystemEntryEncoding } from "./RootFilesystemEntryEncoding.js";
2
+ import type { RootFilesystemEntryKind } from "./RootFilesystemEntryKind.js";
3
+ export type RootFilesystemEntry = {
4
+ path: string;
5
+ kind: RootFilesystemEntryKind;
6
+ mode?: number;
7
+ uid?: number;
8
+ gid?: number;
9
+ content?: string;
10
+ encoding?: RootFilesystemEntryEncoding;
11
+ target?: string;
12
+ executable: boolean;
13
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type RootFilesystemEntryEncoding = "utf8" | "base64";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1 @@
1
+ export type RootFilesystemEntryKind = "file" | "directory" | "symlink";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { RootFilesystemEntry } from "./RootFilesystemEntry.js";
2
+ export type RootFilesystemLowerDescriptor = {
3
+ "kind": "snapshot";
4
+ entries: Array<RootFilesystemEntry>;
5
+ } | {
6
+ "kind": "bundledBaseFilesystem";
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export type RootFilesystemMode = "ephemeral" | "read-only";
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,10 @@
1
+ export type ToolLimitsConfig = {
2
+ defaultToolTimeoutMs?: number;
3
+ maxToolTimeoutMs?: number;
4
+ maxRegisteredToolkits?: number;
5
+ maxRegisteredToolsPerVm?: number;
6
+ maxToolsPerToolkit?: number;
7
+ maxToolSchemaBytes?: number;
8
+ maxToolExamplesPerTool?: number;
9
+ maxToolExampleInputBytes?: number;
10
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,6 @@
1
+ export type VmDnsConfig = {
2
+ nameServers: Array<string>;
3
+ overrides: {
4
+ [key in string]?: Array<string>;
5
+ };
6
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,18 @@
1
+ import type { AcpLimitsConfig } from "./AcpLimitsConfig.js";
2
+ import type { HttpLimitsConfig } from "./HttpLimitsConfig.js";
3
+ import type { JsRuntimeLimitsConfig } from "./JsRuntimeLimitsConfig.js";
4
+ import type { PluginLimitsConfig } from "./PluginLimitsConfig.js";
5
+ import type { PythonLimitsConfig } from "./PythonLimitsConfig.js";
6
+ import type { ResourceLimitsConfig } from "./ResourceLimitsConfig.js";
7
+ import type { ToolLimitsConfig } from "./ToolLimitsConfig.js";
8
+ import type { WasmLimitsConfig } from "./WasmLimitsConfig.js";
9
+ export type VmLimitsConfig = {
10
+ resources?: ResourceLimitsConfig;
11
+ http?: HttpLimitsConfig;
12
+ tools?: ToolLimitsConfig;
13
+ plugins?: PluginLimitsConfig;
14
+ acp?: AcpLimitsConfig;
15
+ jsRuntime?: JsRuntimeLimitsConfig;
16
+ python?: PythonLimitsConfig;
17
+ wasm?: WasmLimitsConfig;
18
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,5 @@
1
+ export type VmListenPolicyConfig = {
2
+ portMin?: number;
3
+ portMax?: number;
4
+ allowPrivileged?: boolean;
5
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};
@@ -0,0 +1,5 @@
1
+ export type WasmLimitsConfig = {
2
+ maxModuleFileBytes?: number;
3
+ capturedOutputLimitBytes?: number;
4
+ syncReadLimitBytes?: number;
5
+ };
@@ -0,0 +1,2 @@
1
+ // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
2
+ export {};