sandcovery 0.1.0 → 0.2.0

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.
package/dist/index.d.mts CHANGED
@@ -1 +1,76 @@
1
- export declare function main(): void;
1
+ import { A as Key, B as ProviderBoardEntry, C as ExecResult, E as FileList, H as ProviderCredentialList, L as PortPreview, N as KeyList, Q as Sandbox, R as Provider, S as ExecRequest, V as ProviderCredential, b as EstimateRequest, d as CreateSandboxRequest, dt as UpdateKeyRequest, f as CreatedKey, ft as Usage, i as ActivityList, it as Snapshot, m as CredentialFields, nt as SandboxStatus, tt as SandboxList, u as CreateKeyRequest, w as FileEntry, x as ExecEvent, y as EstimateList, z as ProviderBoard } from "./types-Dxh7amZB.mjs";
2
+ interface RequestOptions {
3
+ readonly signal?: AbortSignal;
4
+ }
5
+ interface CreateSandboxOptions extends RequestOptions {
6
+ readonly idempotencyKey?: string;
7
+ }
8
+ interface PageQuery {
9
+ readonly cursor?: string;
10
+ readonly limit?: number;
11
+ }
12
+ interface ListSandboxesQuery extends PageQuery {
13
+ readonly status?: SandboxStatus;
14
+ }
15
+ interface UsageQuery {
16
+ readonly api_key_id?: string;
17
+ readonly from: string;
18
+ readonly to: string;
19
+ }
20
+ type FileContent = Blob | Uint8Array | string;
21
+ type SandboxCall<Result> = (sandboxId: string, options?: RequestOptions) => Promise<Result>;
22
+ type FileCall<Result> = (sandboxId: string, path: string, options?: RequestOptions) => Promise<Result>;
23
+ interface SandboxesApi {
24
+ readonly create: (request?: CreateSandboxRequest, options?: CreateSandboxOptions) => Promise<Sandbox>;
25
+ readonly destroy: SandboxCall<Sandbox>;
26
+ readonly downloadFile: FileCall<ReadableStream<Uint8Array>>;
27
+ readonly exec: (sandboxId: string, request: ExecRequest, options?: RequestOptions) => Promise<ExecResult>;
28
+ readonly execStream: (sandboxId: string, request: ExecRequest, options?: RequestOptions) => AsyncGenerator<ExecEvent>;
29
+ readonly get: SandboxCall<Sandbox>;
30
+ readonly list: (query?: ListSandboxesQuery, options?: RequestOptions) => Promise<SandboxList>;
31
+ readonly listFiles: FileCall<FileList>;
32
+ readonly pause: SandboxCall<Sandbox>;
33
+ readonly portPreview: (sandboxId: string, port: number, options?: RequestOptions) => Promise<PortPreview>;
34
+ readonly readFile: FileCall<Uint8Array>;
35
+ readonly resume: SandboxCall<Sandbox>;
36
+ readonly snapshot: SandboxCall<Snapshot>;
37
+ readonly writeFile: (sandboxId: string, path: string, content: FileContent, options?: RequestOptions) => Promise<FileEntry>;
38
+ }
39
+ interface KeysApi {
40
+ readonly create: (request: CreateKeyRequest, options?: RequestOptions) => Promise<CreatedKey>;
41
+ readonly get: (keyId: string, options?: RequestOptions) => Promise<Key>;
42
+ readonly list: (options?: RequestOptions) => Promise<KeyList>;
43
+ readonly revoke: (keyId: string, options?: RequestOptions) => Promise<Key>;
44
+ readonly update: (keyId: string, request: UpdateKeyRequest, options?: RequestOptions) => Promise<Key>;
45
+ }
46
+ interface CredentialsApi {
47
+ readonly delete: (provider: Provider, options?: RequestOptions) => Promise<void>;
48
+ readonly list: (options?: RequestOptions) => Promise<ProviderCredentialList>;
49
+ readonly set: (provider: Provider, fields: CredentialFields, options?: RequestOptions) => Promise<ProviderCredential>;
50
+ }
51
+ interface ActivityApi {
52
+ readonly list: (query?: PageQuery, options?: RequestOptions) => Promise<ActivityList>;
53
+ }
54
+ interface ProvidersApi {
55
+ readonly get: (provider: Provider, options?: RequestOptions) => Promise<ProviderBoardEntry>;
56
+ readonly list: (options?: RequestOptions) => Promise<ProviderBoard>;
57
+ }
58
+ interface UsageApi {
59
+ readonly estimate: (request: EstimateRequest, options?: RequestOptions) => Promise<EstimateList>;
60
+ readonly get: (query: UsageQuery, options?: RequestOptions) => Promise<Usage>;
61
+ }
62
+ export interface SandcoveryOptions {
63
+ readonly apiKey?: string;
64
+ readonly baseUrl?: string | URL;
65
+ readonly fetch?: typeof globalThis.fetch;
66
+ }
67
+ export declare class Sandcovery {
68
+ readonly activity: ActivityApi;
69
+ readonly credentials: CredentialsApi;
70
+ readonly keys: KeysApi;
71
+ readonly providers: ProvidersApi;
72
+ readonly sandboxes: SandboxesApi;
73
+ readonly usage: UsageApi;
74
+ constructor(options?: SandcoveryOptions);
75
+ }
76
+ export {};
package/dist/index.mjs CHANGED
@@ -1,5 +1 @@
1
- // src/index.ts
2
- function main() {
3
- console.log("Hello from sandcovery!");
4
- }
5
- export { main };
1
+ export { t as Sandcovery } from "./src-D3WZodpF.mjs";
@@ -0,0 +1,356 @@
1
+ import { C as isBetween, D as makeFilter, E as isUUID, S as isBase64Url$1, T as isMaxLength, a as Int, c as Literals, d as NonEmptyString, f as NullOr, g as Union, h as Struct, k as optionalKey, l as Natural, m as String$1, n as Boolean, p as Record, s as Literal, t as ArraySchema, u as NonEmptyArray, w as isGreaterThanOrEqualTo, x as is } from "./Schema-C4ay0Aif.mjs";
2
+ // ../sandcovery-contract/src/primitives.ts
3
+ const PROVIDERS = [
4
+ "daytona",
5
+ "depot",
6
+ "e2b",
7
+ "vercel"
8
+ ];
9
+ const SLUG_CHARACTERS = /* @__PURE__ */ new Set("abcdefghijklmnopqrstuvwxyz0123456789-");
10
+ const isSlug = (value) => value !== "" && value.split("").every((character) => SLUG_CHARACTERS.has(character));
11
+ const Provider = String$1.check(makeFilter(isSlug, {
12
+ expected: "a provider name of lowercase letters, digits, and hyphens",
13
+ toJsonSchema: () => ({ minLength: 1 })
14
+ })).annotate({
15
+ description: "A provider name of lowercase letters, digits, and hyphens, such as `daytona` (Daytona), `depot` (Depot), `e2b` (E2B), or `vercel` (Vercel Sandbox). The API adds providers over time, so a client accepts any such name and the API refuses one it does not serve.",
16
+ examples: PROVIDERS,
17
+ identifier: "Provider"
18
+ });
19
+ const Region = NonEmptyString.annotate({
20
+ description: "A coarse region, such as `asia`, `eu`, or `us`. A sandbox runs in a data center of the routed provider inside that region. The API adds regions over time.",
21
+ examples: [
22
+ "asia",
23
+ "eu",
24
+ "us"
25
+ ],
26
+ identifier: "Region"
27
+ });
28
+ const isUtcTimestamp = makeFilter((value) => {
29
+ const at = Date.parse(value);
30
+ return Number.isFinite(at) && new Date(at).toISOString() === value;
31
+ }, {
32
+ expected: "a UTC timestamp such as 2026-11-08T11:20:00.000Z",
33
+ toJsonSchema: () => ({ format: "date-time" })
34
+ });
35
+ const Timestamp = String$1.check(isUtcTimestamp).annotate({ description: "A UTC instant with milliseconds and a `Z` suffix, such as `2026-11-08T11:20:00.000Z`." });
36
+ const MicroUsd = Natural.annotate({ description: "An amount in integer micro-dollars: 1,000,000 is 1 USD." });
37
+ const isUuidV7 = is(String$1.check(isUUID(7)));
38
+ const hasPrefixedUuid = (value, prefix) => value.startsWith(prefix) && isUuidV7(value.slice(prefix.length));
39
+ const prefixedId = (prefix, noun) => String$1.check(makeFilter((value) => hasPrefixedUuid(value, prefix), {
40
+ expected: `${prefix} followed by a UUID v7`,
41
+ toJsonSchema: () => ({})
42
+ })).annotate({ description: `${noun} ID: \`${prefix}\` followed by a UUID v7.` });
43
+ const SandboxId = prefixedId("sbx_", "Sandbox");
44
+ const SnapshotId = prefixedId("snap_", "Snapshot");
45
+ const API_KEY_ID_PREFIX = "key_";
46
+ const MANAGEMENT_KEY_ID_PREFIX = "mkey_";
47
+ const ApiKeyId = prefixedId(API_KEY_ID_PREFIX, "API key");
48
+ const KeyId = String$1.check(makeFilter((value) => hasPrefixedUuid(value, API_KEY_ID_PREFIX) || hasPrefixedUuid(value, MANAGEMENT_KEY_ID_PREFIX), {
49
+ expected: `${API_KEY_ID_PREFIX} or ${MANAGEMENT_KEY_ID_PREFIX} followed by a UUID v7`,
50
+ toJsonSchema: () => ({})
51
+ })).annotate({ description: `Key ID: \`${API_KEY_ID_PREFIX}\` for an API key or \`${MANAGEMENT_KEY_ID_PREFIX}\` for a management key, followed by a UUID v7.` });
52
+ const SECRET_TEXT_LENGTH = 43;
53
+ const isBase64Url = is(String$1.check(isBase64Url$1()));
54
+ const API_KEY_SECRET_PREFIX = "sand_";
55
+ const MANAGEMENT_KEY_SECRET_PREFIX = "sandm_";
56
+ const hasPrefixedSecret = (value, prefix) => value.startsWith(prefix) && value.length === prefix.length + SECRET_TEXT_LENGTH && isBase64Url(value.slice(prefix.length));
57
+ const KeySecret = String$1.check(makeFilter((value) => hasPrefixedSecret(value, API_KEY_SECRET_PREFIX) || hasPrefixedSecret(value, MANAGEMENT_KEY_SECRET_PREFIX), {
58
+ expected: `${API_KEY_SECRET_PREFIX} or ${MANAGEMENT_KEY_SECRET_PREFIX} followed by 43 base64url characters`,
59
+ toJsonSchema: () => ({})
60
+ })).annotate({ description: `The key secret, returned once at creation: \`${API_KEY_SECRET_PREFIX}\` for an API key or \`${MANAGEMENT_KEY_SECRET_PREFIX}\` for a management key, followed by 32 random bytes as 43 unpadded base64url characters.` });
61
+ // ../sandcovery-contract/src/routing.ts
62
+ const STANDARD_SIZES = [
63
+ {
64
+ memory_mib: 2048,
65
+ name: "1x2",
66
+ vcpu: 1
67
+ },
68
+ {
69
+ memory_mib: 4096,
70
+ name: "2x4",
71
+ vcpu: 2
72
+ },
73
+ {
74
+ memory_mib: 8192,
75
+ name: "4x8",
76
+ vcpu: 4
77
+ },
78
+ {
79
+ memory_mib: 16384,
80
+ name: "8x16",
81
+ vcpu: 8
82
+ }
83
+ ];
84
+ const StandardSize = NonEmptyString.annotate({
85
+ description: "A standard size named `<vCPU>x<memory GiB>`, such as `1x2`, `2x4`, `4x8`, or `8x16`. The API adds sizes over time.",
86
+ examples: STANDARD_SIZES.map(({ name }) => name),
87
+ identifier: "StandardSize"
88
+ });
89
+ const ProviderSort = Literals([
90
+ "latency",
91
+ "price",
92
+ "uptime"
93
+ ]).annotate({
94
+ description: "Candidate order: `price` by list price, `latency` by measured create latency, and `uptime` by uptime over the last 15 minutes.",
95
+ identifier: "ProviderSort"
96
+ });
97
+ const ROUTING_SUFFIXES = [
98
+ {
99
+ sort: "price",
100
+ suffix: "cheapest"
101
+ },
102
+ {
103
+ sort: "latency",
104
+ suffix: "fastest"
105
+ },
106
+ {
107
+ sort: "uptime",
108
+ suffix: "most-reliable"
109
+ }
110
+ ];
111
+ const SIZE_NAMES = STANDARD_SIZES.flatMap((size) => [{
112
+ name: size.name,
113
+ size,
114
+ sort: null
115
+ }, ...ROUTING_SUFFIXES.map(({ sort, suffix }) => ({
116
+ name: `${size.name}:${suffix}`,
117
+ size,
118
+ sort
119
+ }))]);
120
+ const isPositiveInteger = (text) => {
121
+ const value = Number(text);
122
+ return Number.isSafeInteger(value) && value > 0 && String(value) === text;
123
+ };
124
+ const isSizeName = (name) => {
125
+ const [dimensions = "", ...suffixes] = name.split(":");
126
+ const counts = dimensions.split("x");
127
+ return counts.length === 2 && counts.every(isPositiveInteger) && suffixes.length <= 1 && suffixes.every((suffix) => suffix !== "");
128
+ };
129
+ const SizeName = String$1.check(makeFilter(isSizeName, {
130
+ expected: "<vcpu>x<memory_gib>, optionally followed by a routing suffix",
131
+ toJsonSchema: () => ({ minLength: 1 })
132
+ })).annotate({
133
+ description: "A size named `<vcpu>x<memory_gib>`, such as `2x4` for 2 vCPU and 4 GiB, optionally followed by a routing suffix: `:cheapest` sorts candidates by list price, `:fastest` by measured create latency, and `:most-reliable` by uptime over the last 15 minutes. A name with no suffix uses default routing, which balances price, latency, and uptime and spreads concurrent load across providers. A malformed name or an unknown suffix answers 400 `invalid_request`, and a size no candidate provider can run answers 422 `unsupported`, listing the sizes that would run as `options`.",
134
+ examples: SIZE_NAMES.map(({ name }) => name),
135
+ identifier: "SizeName"
136
+ });
137
+ const ProviderPreferences = Struct({
138
+ allow_fallbacks: optionalKey(Boolean.annotate({ description: "Whether a failed create (capacity, quota, a provider 5xx, or a timeout) moves to the next candidate. Defaults to true." })),
139
+ ignore: optionalKey(ArraySchema(Provider).annotate({ description: "Providers never to route to." })),
140
+ only: optionalKey(ArraySchema(Provider).annotate({ description: "The only providers to route to." })),
141
+ order: optionalKey(ArraySchema(Provider).annotate({ description: "Providers to try first, in this order, before the remaining candidates in sorted order." })),
142
+ sort: optionalKey(ProviderSort)
143
+ }).annotate({
144
+ description: "Routing preferences in the shape of OpenRouter provider preferences. A size suffix sets `sort`, and a request whose suffix and `sort` disagree answers 400 `invalid_request`.",
145
+ identifier: "ProviderPreferences"
146
+ });
147
+ // ../sandcovery-contract/src/sandbox.ts
148
+ const MAX_TTL_SECONDS = 86400;
149
+ const MIN_TTL_SECONDS = 60;
150
+ const MAX_PORT = 65535;
151
+ const MAX_PORTS = 8;
152
+ const between = (minimum, maximum) => Int.check(isBetween({
153
+ maximum,
154
+ minimum
155
+ }));
156
+ const Port = between(1, MAX_PORT);
157
+ const EnvironmentVariables = Record(NonEmptyString, String$1).annotate({ description: "Environment variables by name. Sandcovery passes them to the provider and never returns them." });
158
+ const EgressPolicy = Union([
159
+ Struct({ mode: Literal("allow_all") }),
160
+ Struct({ mode: Literal("deny_all") }),
161
+ Struct({
162
+ destinations: NonEmptyArray(NonEmptyString).annotate({ description: "Host names or CIDR blocks the sandbox may reach." }),
163
+ mode: Literal("allowlist")
164
+ })
165
+ ]).annotate({
166
+ description: "Outbound network access: `allow_all`, `deny_all`, or `allowlist` with the destinations the sandbox may reach.",
167
+ identifier: "EgressPolicy"
168
+ });
169
+ const SandboxSpec = Struct({
170
+ disk_mib: optionalKey(Int.check(isGreaterThanOrEqualTo(1024)).annotate({ description: "Disk size in MiB. Defaults to the provider default." })),
171
+ egress: optionalKey(EgressPolicy),
172
+ env: optionalKey(EnvironmentVariables),
173
+ idle_timeout_seconds: optionalKey(Int.check(isGreaterThanOrEqualTo(MIN_TTL_SECONDS)).annotate({ description: "Seconds without a running command after which the provider pauses the sandbox. Unset means no idle timeout." })),
174
+ image: optionalKey(NonEmptyString.annotate({ description: "An OCI image reference. Unset means the provider's default Linux image." })),
175
+ memory_mib: optionalKey(Int.check(isGreaterThanOrEqualTo(256)).annotate({ description: "Memory in MiB. Set with `vcpu`, and never with `size`." })),
176
+ ports: optionalKey(ArraySchema(Port).check(isMaxLength(MAX_PORTS)).annotate({ description: "Ports to expose for preview URLs. Some providers expose only ports declared at create." })),
177
+ region: optionalKey(Region),
178
+ size: optionalKey(SizeName),
179
+ ttl_seconds: optionalKey(between(MIN_TTL_SECONDS, MAX_TTL_SECONDS).annotate({ description: "Seconds from creation after which Sandcovery destroys the sandbox, even when the client is gone. Defaults to 3600, and the API key may cap it lower." })),
180
+ vcpu: optionalKey(between(1, 64).annotate({ description: "vCPU count. Set with `memory_mib`, and never with `size`." }))
181
+ });
182
+ const CreateSandboxRequest = Struct({
183
+ ...SandboxSpec.fields,
184
+ provider: optionalKey(ProviderPreferences),
185
+ snapshot_id: optionalKey(SnapshotId.annotate({ description: "A snapshot to start from. The sandbox runs on the snapshot's provider." }))
186
+ }).annotate({
187
+ description: "A sandbox spec plus routing preferences. Give either `size` or both `vcpu` and `memory_mib`; with neither, the size is `2x4`. A spec option that no candidate provider can enforce answers 422 `unsupported` and is never ignored.",
188
+ identifier: "CreateSandboxRequest"
189
+ });
190
+ const CreateAttempt = Struct({
191
+ duration_ms: Natural,
192
+ failure: NullOr(Struct({
193
+ message: String$1,
194
+ reason: Literals([
195
+ "capacity",
196
+ "quota",
197
+ "rejected",
198
+ "server_error",
199
+ "timeout"
200
+ ]).annotate({ identifier: "CreateFailureReason" })
201
+ }).annotate({ description: "Why the attempt failed: `capacity`, `quota`, `server_error` (a provider 5xx), and `timeout` fall back to the next candidate when `allow_fallbacks` is not false, while `rejected` (any other provider refusal, such as an invalid credential) stops the create, which answers 502 `provider_error` naming that provider." })),
202
+ provider: Provider,
203
+ started_at: Timestamp
204
+ }).annotate({
205
+ description: "One provider create call made while routing a sandbox. `failure` is null on the attempt that created it.",
206
+ identifier: "CreateAttempt"
207
+ });
208
+ const SandboxStatus = Literals([
209
+ "creating",
210
+ "destroyed",
211
+ "destroying",
212
+ "failed",
213
+ "paused",
214
+ "running"
215
+ ]).annotate({ identifier: "SandboxStatus" });
216
+ const SandboxEndReason = Literals([
217
+ "create_failed",
218
+ "destroyed",
219
+ "expired",
220
+ "gone"
221
+ ]).annotate({
222
+ description: "Why the sandbox ended: `create_failed` when no create attempt succeeded, `destroyed` by a destroy call, `expired` at its TTL, or `gone` when the provider no longer had it.",
223
+ identifier: "SandboxEndReason"
224
+ });
225
+ const SandboxCost = Struct({
226
+ estimated_micro_usd: MicroUsd.annotate({ description: "Estimated list-price cost so far, from the rate card, until the sandbox is destroyed." }),
227
+ hourly_micro_usd: MicroUsd,
228
+ rate_card_version: String$1
229
+ }).annotate({
230
+ description: "Estimated cost at the provider's list price from a versioned rate card. The provider bills your own account.",
231
+ identifier: "SandboxCost"
232
+ });
233
+ const Sandbox = Struct({
234
+ api_key_id: ApiKeyId.annotate({ description: "The API key that created the sandbox." }),
235
+ attempts: ArraySchema(CreateAttempt),
236
+ cost: SandboxCost,
237
+ created_at: Timestamp,
238
+ disk_mib: NullOr(Natural),
239
+ egress: EgressPolicy,
240
+ end_reason: NullOr(SandboxEndReason),
241
+ ended_at: NullOr(Timestamp),
242
+ expires_at: Timestamp,
243
+ id: SandboxId,
244
+ idle_timeout_seconds: NullOr(Natural),
245
+ image: NullOr(String$1),
246
+ memory_mib: Natural,
247
+ ports: ArraySchema(Port),
248
+ provider: NullOr(Provider).annotate({ description: "The provider the sandbox is bound to, or null while it is creating or when every create attempt failed." }),
249
+ provider_sandbox_id: NullOr(String$1),
250
+ region: NullOr(Region),
251
+ size: NullOr(SizeName),
252
+ started_at: NullOr(Timestamp).annotate({ description: "When the provider reported the sandbox running." }),
253
+ status: SandboxStatus,
254
+ ttl_seconds: Natural,
255
+ vcpu: Natural
256
+ }).annotate({
257
+ description: "A sandbox, bound to the provider that created it. `expires_at` is when Sandcovery destroys it, and pausing does not move it. `ended_at` and `end_reason` are set once it ends.",
258
+ identifier: "Sandbox"
259
+ });
260
+ const SandboxList = Struct({
261
+ data: ArraySchema(Sandbox),
262
+ next_cursor: NullOr(String$1)
263
+ }).annotate({ identifier: "SandboxList" });
264
+ const Snapshot = Struct({
265
+ created_at: Timestamp,
266
+ id: SnapshotId,
267
+ provider: Provider,
268
+ sandbox_id: SandboxId
269
+ }).annotate({
270
+ description: "A snapshot of a sandbox filesystem. A sandbox created from it runs on the same provider.",
271
+ identifier: "Snapshot"
272
+ });
273
+ const PortPreview = Struct({
274
+ expires_at: NullOr(Timestamp),
275
+ headers: Record(String$1, String$1).annotate({ description: "Headers a request to `url` must carry, such as a provider preview token. Often empty." }),
276
+ port: Port,
277
+ url: String$1
278
+ }).annotate({
279
+ description: "A provider URL that reaches a port inside the sandbox.",
280
+ identifier: "PortPreview"
281
+ });
282
+ // ../sandcovery-contract/src/keys.ts
283
+ const KeyName = NonEmptyString.check(isMaxLength(64));
284
+ const PositiveInt = Int.check(isGreaterThanOrEqualTo(1));
285
+ const KeyKind = Literals(["api", "management"]).annotate({
286
+ description: "An `api` key creates and drives sandboxes. A `management` key mints, changes, and revokes keys, sets provider credentials, and reads usage, and reaches no sandbox.",
287
+ identifier: "KeyKind"
288
+ });
289
+ const SpendLimit = Struct({
290
+ limit_micro_usd: MicroUsd,
291
+ period: Literals([
292
+ "day",
293
+ "month",
294
+ "total",
295
+ "week"
296
+ ]).annotate({
297
+ description: "The window the limit counts: a UTC `day`, an ISO `week` from Monday 00:00 UTC, a UTC calendar `month`, or the key `total`.",
298
+ identifier: "SpendLimitPeriod"
299
+ })
300
+ }).annotate({
301
+ description: "A cap on the list-price cost of sandboxes the key creates, counting usage billed to your own provider accounts.",
302
+ identifier: "SpendLimit"
303
+ });
304
+ const keyPolicyFields = {
305
+ allowed_providers: NullOr(ArraySchema(Provider)).annotate({ description: "The only providers the key may route to. Null allows all." }),
306
+ max_concurrent_sandboxes: NullOr(PositiveInt),
307
+ max_ttl_seconds: NullOr(PositiveInt),
308
+ spend_limit: NullOr(SpendLimit)
309
+ };
310
+ const Key = Struct({
311
+ ...keyPolicyFields,
312
+ created_at: Timestamp,
313
+ expires_at: NullOr(Timestamp),
314
+ id: KeyId,
315
+ kind: KeyKind,
316
+ last_used_at: NullOr(Timestamp),
317
+ name: String$1,
318
+ revoked_at: NullOr(Timestamp),
319
+ spend: Struct({
320
+ resets_at: NullOr(Timestamp),
321
+ spent_micro_usd: MicroUsd
322
+ }).annotate({ description: "List-price cost counted against `spend_limit` in its current window, or in total when the key has no limit. Always 0 for a management key." }),
323
+ start: String$1.annotate({ description: "The first 12 characters of the secret, for display." })
324
+ }).annotate({
325
+ description: "An API key or a management key. Its secret is never returned after creation, and the limits are null on a management key.",
326
+ identifier: "Key"
327
+ });
328
+ const KeyList = Struct({ data: ArraySchema(Key) }).annotate({ identifier: "KeyList" });
329
+ const CreateKeyRequest = Struct({
330
+ allowed_providers: optionalKey(keyPolicyFields.allowed_providers),
331
+ expires_at: optionalKey(NullOr(Timestamp)),
332
+ kind: optionalKey(KeyKind).annotate({ description: "Defaults to `api`. Only a signed-in owner or admin mints a `management` key, and a management key takes no limits." }),
333
+ max_concurrent_sandboxes: optionalKey(keyPolicyFields.max_concurrent_sandboxes),
334
+ max_ttl_seconds: optionalKey(keyPolicyFields.max_ttl_seconds),
335
+ name: KeyName,
336
+ spend_limit: optionalKey(keyPolicyFields.spend_limit)
337
+ }).annotate({ identifier: "CreateKeyRequest" });
338
+ const UpdateKeyRequest = Struct({
339
+ allowed_providers: optionalKey(keyPolicyFields.allowed_providers),
340
+ expires_at: optionalKey(NullOr(Timestamp)),
341
+ max_concurrent_sandboxes: optionalKey(keyPolicyFields.max_concurrent_sandboxes),
342
+ max_ttl_seconds: optionalKey(keyPolicyFields.max_ttl_seconds),
343
+ name: optionalKey(KeyName),
344
+ spend_limit: optionalKey(keyPolicyFields.spend_limit)
345
+ }).annotate({
346
+ description: "Fields to change. An absent field keeps its value, and null clears a limit. A limit on a management key answers 400 `invalid_request`.",
347
+ identifier: "UpdateKeyRequest"
348
+ });
349
+ const CreatedKey = Struct({
350
+ key: Key,
351
+ secret: KeySecret
352
+ }).annotate({ identifier: "CreatedKey" });
353
+ // ../sandcovery-contract/src/origin.ts
354
+ const SANDCOVERY_ORIGIN = "https://www.sandcovery.com";
355
+ const API_PREFIX = "/api/v1";
356
+ export { KeyId as C, Region as D, Provider as E, SandboxId as O, ApiKeyId as S, MicroUsd as T, SandboxStatus as _, Key as a, ProviderSort as b, SpendLimit as c, CreateSandboxRequest as d, Port as f, SandboxSpec as g, SandboxList as h, CreatedKey as i, Timestamp as k, UpdateKeyRequest as l, Sandbox as m, SANDCOVERY_ORIGIN as n, KeyKind as o, PortPreview as p, CreateKeyRequest as r, KeyList as s, API_PREFIX as t, CreateAttempt as u, Snapshot as v, KeySecret as w, StandardSize as x, ProviderPreferences as y };
@@ -0,0 +1 @@
1
+ export { t as OTLP_DESTINATIONS, n as POSTHOG_INGEST_HOST, r as POSTHOG_PROJECT_TOKEN, i as WORKER_OBSERVABILITY } from "./posthog-project-Bb0IFKUv.mjs";
@@ -0,0 +1,20 @@
1
+ // ../sandcovery-contract/src/posthog-project.ts
2
+ const POSTHOG_PROJECT_TOKEN = "phc_z6QJckCpFsqoDDAcCJQuQpYFrH2BtqvmrFUNtAkzTwJd";
3
+ const POSTHOG_INGEST_HOST = "https://us.i.posthog.com";
4
+ const OTLP_DESTINATIONS = {
5
+ logs: "sandcovery-otlp-logs",
6
+ traces: "sandcovery-otlp-traces"
7
+ };
8
+ const WORKER_OBSERVABILITY = {
9
+ enabled: true,
10
+ logs: {
11
+ destinations: [OTLP_DESTINATIONS.logs],
12
+ enabled: true,
13
+ invocation_logs: true
14
+ },
15
+ traces: {
16
+ destinations: [OTLP_DESTINATIONS.traces],
17
+ enabled: true
18
+ }
19
+ };
20
+ export { WORKER_OBSERVABILITY as i, POSTHOG_INGEST_HOST as n, POSTHOG_PROJECT_TOKEN as r, OTLP_DESTINATIONS as t };