@@ -6,30 +6,25 @@ import type { LocalKernelDatabase } from "./database.js";
66import {
77 isBuiltinFirewallHardEgressHelper ,
88 runBuiltinFirewallHardEgressHelper ,
9- type BuiltinFirewallCommand ,
10- type BuiltinFirewallPlatform ,
11- type SandboxWorkerIdentitySnapshot ,
129} from "./hard-egress-firewall.js" ;
1310import { resolveNetworkPolicyProxyRef } from "./network-policy.js" ;
11+ import type {
12+ DockerSandboxPolicy ,
13+ HardEgressEnforcementSnapshot ,
14+ SandboxBackendKind ,
15+ SandboxIsolationProfileId ,
16+ SandboxPolicySnapshot ,
17+ SandboxWorkerIdentitySnapshot ,
18+ } from "./sandbox-contracts.js" ;
1419import type { SandboxAllocationRecord } from "./types.js" ;
1520
16- export type SandboxBackendKind =
17- | "local/no_isolation"
18- | "docker"
19- | "bwrap"
20- | "minijail"
21- | "ssh"
22- | "openshell"
23- | "vm"
24- | "other" ;
25-
26- export type SandboxIsolationProfileId =
27- | "trusted_local"
28- | "web_brokered"
29- | "readonly_workspace"
30- | "rw_workspace"
31- | "code_execution"
32- | "plugin_untrusted" ;
21+ export type {
22+ DockerSandboxPolicy ,
23+ HardEgressEnforcementSnapshot ,
24+ SandboxBackendKind ,
25+ SandboxIsolationProfileId ,
26+ SandboxPolicySnapshot ,
27+ } from "./sandbox-contracts.js" ;
3328
3429export type SandboxAllocationRequest = {
3530 taskId : string ;
@@ -60,52 +55,6 @@ export type SandboxCommandRequest = {
6055 maxOutputBytes ?: number ;
6156} ;
6257
63- export type DockerSandboxPolicy = {
64- networkMode : "none" | "bridge" ;
65- proxyServer ?: string ;
66- memoryMb ?: number ;
67- pidsLimit ?: number ;
68- readOnlyRoot ?: boolean ;
69- tmpfs ?: string [ ] ;
70- } ;
71-
72- export type SandboxPolicySnapshot = {
73- trustZoneId : string ;
74- backend : SandboxBackendKind ;
75- isolationProfile ?: SandboxIsolationProfileId ;
76- filesystemPolicy ?: unknown ;
77- maxProcesses ?: number ;
78- maxMemoryMb ?: number ;
79- maxRuntimeSeconds ?: number ;
80- networkPolicy ?: {
81- id : string ;
82- defaultAction : "allow" | "deny" ;
83- allowPrivateNetwork : boolean ;
84- allowedHosts ?: string [ ] ;
85- deniedCidrs ?: string [ ] ;
86- proxyRef ?: string ;
87- } ;
88- docker ?: DockerSandboxPolicy ;
89- } ;
90-
91- export type HardEgressEnforcementSnapshot = {
92- helper : string ;
93- enforcementId : string ;
94- boundary : "host_firewall" | "egress_proxy" | "vm_firewall" | "platform_enforcer" ;
95- description ?: string ;
96- firewall ?: {
97- platform : BuiltinFirewallPlatform | string ;
98- scope : string ;
99- allowedCidrs ?: string [ ] ;
100- proxyDelegatedHosts ?: string [ ] ;
101- protocolCoverage ?: string ;
102- releaseCommands ?: BuiltinFirewallCommand [ ] ;
103- applied ?: boolean ;
104- limitations ?: string [ ] ;
105- } ;
106- workerIdentity ?: SandboxWorkerIdentitySnapshot ;
107- } ;
108-
10958export type SandboxCommandResult = {
11059 allocationId : string ;
11160 exitCode : number | null ;
0 commit comments