@hachej/boring-sandbox 0.1.74

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.
@@ -0,0 +1,2 @@
1
+
2
+ export { }
package/dist/index.js ADDED
File without changes
@@ -0,0 +1,2 @@
1
+
2
+ export { }
File without changes
@@ -0,0 +1,142 @@
1
+ type ProviderFilesystemCapability = "none" | "readonly" | "readwrite";
2
+ type ProviderNetworkIsolation = "none" | "process" | "container" | "microvm" | "provider";
3
+ type ProviderSourceOfTruth = "sandbox-primary" | "storage-primary";
4
+ type ProviderHardening = "none" | "process" | "container" | "microvm" | "provider";
5
+ type ProviderFilesystemPersistence = "none" | "ephemeral" | "session" | "durable" | "provider";
6
+ type ReportedProviderCapability<T> = T | "unknown";
7
+ interface ProviderRuntimeImage {
8
+ /** Operator-readable image ref, for example registry.example/runtime-node:2026-07. */
9
+ ref: string;
10
+ /** Digest is the execution identity and is required by non-dev image users. */
11
+ digest: string;
12
+ }
13
+ interface ProviderRuntimeSpec {
14
+ image?: ProviderRuntimeImage;
15
+ }
16
+ interface ProviderCapabilities {
17
+ fs: ProviderFilesystemCapability;
18
+ exec: boolean;
19
+ realBash?: ReportedProviderCapability<boolean>;
20
+ realBinaries?: ReportedProviderCapability<boolean>;
21
+ networkIsolation?: ReportedProviderCapability<ProviderNetworkIsolation>;
22
+ watch: boolean;
23
+ search: boolean;
24
+ sourceOfTruth: ProviderSourceOfTruth;
25
+ provisioningSupport: boolean;
26
+ providerContractVersion: string;
27
+ runtimeImage: ReportedProviderCapability<boolean>;
28
+ hardening?: ReportedProviderCapability<ProviderHardening>;
29
+ filesystemPersistence?: ReportedProviderCapability<ProviderFilesystemPersistence>;
30
+ }
31
+ declare const PROVIDER_CAPABILITY_ERROR_CODES: {
32
+ readonly unsupportedRequirement: "SANDBOX_PROVIDER_UNSUPPORTED_REQUIREMENT";
33
+ readonly unsafeFallback: "SANDBOX_PROVIDER_UNSAFE_FALLBACK";
34
+ readonly unknownRequiredCapability: "SANDBOX_PROVIDER_UNKNOWN_REQUIRED_CAPABILITY";
35
+ };
36
+ type ProviderCapabilityErrorCode = (typeof PROVIDER_CAPABILITY_ERROR_CODES)[keyof typeof PROVIDER_CAPABILITY_ERROR_CODES];
37
+
38
+ declare const PROVIDER_CONTRACT_VERSION = "boring-sandbox.provider.v1";
39
+ type SandboxProviderId = "none" | "readonly" | "direct" | "bwrap" | "vercel-sandbox" | "remote-worker";
40
+ type RuntimeModeId = "pure" | "readonly" | "direct" | "local" | "vercel-sandbox" | "remote-worker";
41
+ declare const PROVIDER_CAPABILITIES: {
42
+ readonly none: {
43
+ readonly fs: "none";
44
+ readonly exec: false;
45
+ readonly realBash: false;
46
+ readonly realBinaries: false;
47
+ readonly watch: false;
48
+ readonly search: false;
49
+ readonly sourceOfTruth: "storage-primary";
50
+ readonly provisioningSupport: false;
51
+ readonly providerContractVersion: "boring-sandbox.provider.v1";
52
+ readonly runtimeImage: false;
53
+ readonly hardening: "none";
54
+ readonly filesystemPersistence: "none";
55
+ };
56
+ readonly readonly: {
57
+ readonly fs: "readonly";
58
+ readonly exec: false;
59
+ readonly realBash: false;
60
+ readonly realBinaries: false;
61
+ readonly watch: true;
62
+ readonly search: true;
63
+ readonly sourceOfTruth: "storage-primary";
64
+ readonly provisioningSupport: false;
65
+ readonly providerContractVersion: "boring-sandbox.provider.v1";
66
+ readonly runtimeImage: false;
67
+ readonly hardening: "none";
68
+ readonly filesystemPersistence: "durable";
69
+ };
70
+ readonly direct: {
71
+ readonly fs: "readwrite";
72
+ readonly exec: true;
73
+ readonly realBash: "unknown";
74
+ readonly realBinaries: "unknown";
75
+ readonly networkIsolation: "none";
76
+ readonly watch: true;
77
+ readonly search: true;
78
+ readonly sourceOfTruth: "storage-primary";
79
+ readonly provisioningSupport: true;
80
+ readonly providerContractVersion: "boring-sandbox.provider.v1";
81
+ readonly runtimeImage: false;
82
+ readonly hardening: "none";
83
+ readonly filesystemPersistence: "durable";
84
+ };
85
+ readonly bwrap: {
86
+ readonly fs: "readwrite";
87
+ readonly exec: true;
88
+ readonly realBash: "unknown";
89
+ readonly realBinaries: "unknown";
90
+ readonly networkIsolation: "none";
91
+ readonly watch: true;
92
+ readonly search: true;
93
+ readonly sourceOfTruth: "storage-primary";
94
+ readonly provisioningSupport: true;
95
+ readonly providerContractVersion: "boring-sandbox.provider.v1";
96
+ readonly runtimeImage: false;
97
+ readonly hardening: "process";
98
+ readonly filesystemPersistence: "durable";
99
+ };
100
+ readonly "vercel-sandbox": {
101
+ readonly fs: "readwrite";
102
+ readonly exec: true;
103
+ readonly realBash: true;
104
+ readonly realBinaries: true;
105
+ readonly networkIsolation: "provider";
106
+ readonly watch: true;
107
+ readonly search: true;
108
+ readonly sourceOfTruth: "sandbox-primary";
109
+ readonly provisioningSupport: true;
110
+ readonly providerContractVersion: "boring-sandbox.provider.v1";
111
+ readonly runtimeImage: "unknown";
112
+ readonly hardening: "provider";
113
+ readonly filesystemPersistence: "provider";
114
+ };
115
+ readonly "remote-worker": {
116
+ readonly fs: "readwrite";
117
+ readonly exec: true;
118
+ readonly realBash: "unknown";
119
+ readonly realBinaries: "unknown";
120
+ readonly networkIsolation: "unknown";
121
+ readonly watch: true;
122
+ readonly search: true;
123
+ readonly sourceOfTruth: "sandbox-primary";
124
+ readonly provisioningSupport: false;
125
+ readonly providerContractVersion: "boring-sandbox.provider.v1";
126
+ readonly runtimeImage: "unknown";
127
+ readonly hardening: "unknown";
128
+ readonly filesystemPersistence: "unknown";
129
+ };
130
+ };
131
+ declare const MODE_TO_PROVIDER: {
132
+ readonly pure: "none";
133
+ readonly readonly: "readonly";
134
+ readonly direct: "direct";
135
+ readonly local: "bwrap";
136
+ readonly "vercel-sandbox": "vercel-sandbox";
137
+ readonly "remote-worker": "remote-worker";
138
+ };
139
+ type ProviderCapabilityMatrix = typeof PROVIDER_CAPABILITIES;
140
+ type RuntimeModeProviderMap = typeof MODE_TO_PROVIDER;
141
+
142
+ export { MODE_TO_PROVIDER, PROVIDER_CAPABILITIES, PROVIDER_CAPABILITY_ERROR_CODES, PROVIDER_CONTRACT_VERSION, type ProviderCapabilities, type ProviderCapabilityErrorCode, type ProviderCapabilityMatrix, type ProviderFilesystemCapability, type ProviderFilesystemPersistence, type ProviderHardening, type ProviderNetworkIsolation, type ProviderRuntimeImage, type ProviderRuntimeSpec, type ProviderSourceOfTruth, type ReportedProviderCapability, type RuntimeModeId, type RuntimeModeProviderMap, type SandboxProviderId };
@@ -0,0 +1,113 @@
1
+ // src/shared/capability.ts
2
+ var PROVIDER_CAPABILITY_ERROR_CODES = {
3
+ unsupportedRequirement: "SANDBOX_PROVIDER_UNSUPPORTED_REQUIREMENT",
4
+ unsafeFallback: "SANDBOX_PROVIDER_UNSAFE_FALLBACK",
5
+ unknownRequiredCapability: "SANDBOX_PROVIDER_UNKNOWN_REQUIRED_CAPABILITY"
6
+ };
7
+
8
+ // src/shared/providerMatrix.ts
9
+ var PROVIDER_CONTRACT_VERSION = "boring-sandbox.provider.v1";
10
+ var PROVIDER_CAPABILITIES = {
11
+ none: {
12
+ fs: "none",
13
+ exec: false,
14
+ realBash: false,
15
+ realBinaries: false,
16
+ watch: false,
17
+ search: false,
18
+ sourceOfTruth: "storage-primary",
19
+ provisioningSupport: false,
20
+ providerContractVersion: PROVIDER_CONTRACT_VERSION,
21
+ runtimeImage: false,
22
+ hardening: "none",
23
+ filesystemPersistence: "none"
24
+ },
25
+ readonly: {
26
+ fs: "readonly",
27
+ exec: false,
28
+ realBash: false,
29
+ realBinaries: false,
30
+ watch: true,
31
+ search: true,
32
+ sourceOfTruth: "storage-primary",
33
+ provisioningSupport: false,
34
+ providerContractVersion: PROVIDER_CONTRACT_VERSION,
35
+ runtimeImage: false,
36
+ hardening: "none",
37
+ filesystemPersistence: "durable"
38
+ },
39
+ direct: {
40
+ fs: "readwrite",
41
+ exec: true,
42
+ realBash: "unknown",
43
+ realBinaries: "unknown",
44
+ networkIsolation: "none",
45
+ watch: true,
46
+ search: true,
47
+ sourceOfTruth: "storage-primary",
48
+ provisioningSupport: true,
49
+ providerContractVersion: PROVIDER_CONTRACT_VERSION,
50
+ runtimeImage: false,
51
+ hardening: "none",
52
+ filesystemPersistence: "durable"
53
+ },
54
+ bwrap: {
55
+ fs: "readwrite",
56
+ exec: true,
57
+ realBash: "unknown",
58
+ realBinaries: "unknown",
59
+ networkIsolation: "none",
60
+ watch: true,
61
+ search: true,
62
+ sourceOfTruth: "storage-primary",
63
+ provisioningSupport: true,
64
+ providerContractVersion: PROVIDER_CONTRACT_VERSION,
65
+ runtimeImage: false,
66
+ hardening: "process",
67
+ filesystemPersistence: "durable"
68
+ },
69
+ "vercel-sandbox": {
70
+ fs: "readwrite",
71
+ exec: true,
72
+ realBash: true,
73
+ realBinaries: true,
74
+ networkIsolation: "provider",
75
+ watch: true,
76
+ search: true,
77
+ sourceOfTruth: "sandbox-primary",
78
+ provisioningSupport: true,
79
+ providerContractVersion: PROVIDER_CONTRACT_VERSION,
80
+ runtimeImage: "unknown",
81
+ hardening: "provider",
82
+ filesystemPersistence: "provider"
83
+ },
84
+ "remote-worker": {
85
+ fs: "readwrite",
86
+ exec: true,
87
+ realBash: "unknown",
88
+ realBinaries: "unknown",
89
+ networkIsolation: "unknown",
90
+ watch: true,
91
+ search: true,
92
+ sourceOfTruth: "sandbox-primary",
93
+ provisioningSupport: false,
94
+ providerContractVersion: PROVIDER_CONTRACT_VERSION,
95
+ runtimeImage: "unknown",
96
+ hardening: "unknown",
97
+ filesystemPersistence: "unknown"
98
+ }
99
+ };
100
+ var MODE_TO_PROVIDER = {
101
+ pure: "none",
102
+ readonly: "readonly",
103
+ direct: "direct",
104
+ local: "bwrap",
105
+ "vercel-sandbox": "vercel-sandbox",
106
+ "remote-worker": "remote-worker"
107
+ };
108
+ export {
109
+ MODE_TO_PROVIDER,
110
+ PROVIDER_CAPABILITIES,
111
+ PROVIDER_CAPABILITY_ERROR_CODES,
112
+ PROVIDER_CONTRACT_VERSION
113
+ };
package/package.json ADDED
@@ -0,0 +1,42 @@
1
+ {
2
+ "name": "@hachej/boring-sandbox",
3
+ "version": "0.1.74",
4
+ "type": "module",
5
+ "license": "MIT",
6
+ "description": "Sandbox provider contracts and implementations for Boring runtimes.",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/hachej/boring-ui"
10
+ },
11
+ "homepage": "https://github.com/hachej/boring-ui",
12
+ "files": [
13
+ "dist"
14
+ ],
15
+ "exports": {
16
+ ".": {
17
+ "types": "./dist/index.d.ts",
18
+ "import": "./dist/index.js"
19
+ },
20
+ "./shared": {
21
+ "types": "./dist/shared/index.d.ts",
22
+ "import": "./dist/shared/index.js"
23
+ },
24
+ "./providers": {
25
+ "types": "./dist/providers/index.d.ts",
26
+ "import": "./dist/providers/index.js"
27
+ }
28
+ },
29
+ "scripts": {
30
+ "build": "tsup",
31
+ "typecheck": "tsc --noEmit",
32
+ "check:invariants": "node ./scripts/check-invariants.mjs",
33
+ "lint": "pnpm run typecheck && pnpm run check:invariants",
34
+ "test": "vitest run --passWithNoTests",
35
+ "clean": "rm -rf dist .tsbuildinfo"
36
+ },
37
+ "devDependencies": {
38
+ "tsup": "^8.4.0",
39
+ "typescript": "^6.0.3",
40
+ "vitest": "^4.1.9"
41
+ }
42
+ }