@sandbox-kit/sandbox 0.0.0-stage → 0.1.1

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 (39) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +129 -2
  3. package/dist/client/client.d.ts +17 -0
  4. package/dist/client/client.js +222 -0
  5. package/dist/client/errors.d.ts +35 -0
  6. package/dist/client/errors.js +88 -0
  7. package/dist/client/operation.d.ts +12 -0
  8. package/dist/client/operation.js +73 -0
  9. package/dist/client/sandbox.d.ts +33 -0
  10. package/dist/client/sandbox.js +160 -0
  11. package/dist/client/types.d.ts +63 -0
  12. package/dist/client/types.js +3 -0
  13. package/dist/client/validation.d.ts +9 -0
  14. package/dist/client/validation.js +221 -0
  15. package/dist/contracts/config_paths.d.ts +44 -0
  16. package/dist/contracts/config_paths.js +50 -0
  17. package/dist/contracts/field_paths.d.ts +216 -0
  18. package/dist/contracts/field_paths.js +222 -0
  19. package/dist/contracts/sandbox_data_contracts.d.ts +206 -0
  20. package/dist/contracts/sandbox_data_contracts.js +22 -0
  21. package/dist/index.d.ts +6 -0
  22. package/dist/index.js +6 -0
  23. package/dist/internal/duration_ms.d.ts +15 -0
  24. package/dist/internal/duration_ms.js +41 -0
  25. package/dist/internal/input_remap.d.ts +36 -0
  26. package/dist/internal/input_remap.js +1 -0
  27. package/dist/internal/net_validate.d.ts +4 -0
  28. package/dist/internal/net_validate.js +53 -0
  29. package/dist/internal/oneof_input.d.ts +32 -0
  30. package/dist/internal/oneof_input.js +1 -0
  31. package/dist/internal/proto_enum.d.ts +25 -0
  32. package/dist/internal/proto_enum.js +25 -0
  33. package/dist/internal/strip_proto.d.ts +46 -0
  34. package/dist/internal/strip_proto.js +1 -0
  35. package/dist/metadata/metadata_object.d.ts +7 -0
  36. package/dist/metadata/metadata_object.js +103 -0
  37. package/dist/metadata/metadata_plain.d.ts +9 -0
  38. package/dist/metadata/metadata_plain.js +1 -0
  39. package/package.json +71 -4
@@ -0,0 +1,22 @@
1
+ // Portable sandbox data contracts come from standard protobuf generation.
2
+ // These aliases keep the SDK entrypoint concise while ensuring one representation.
3
+ import { EgressMode as ProtoEgressMode, IsolationKind as ProtoIsolationKind, LifecycleCapability as ProtoLifecycleCapability, PolicyMode as ProtoPolicyMode, PortTransport as ProtoPortTransport, SandboxState as ProtoSandboxState, SecretInjection as ProtoSecretInjection, SnapshotKind as ProtoSnapshotKind, ValueOrigin as ProtoValueOrigin, WaitCondition as ProtoWaitCondition, } from "@sandbox-kit/contracts/sandbox";
4
+ import { protoEnum } from "#internal/proto_enum.js";
5
+ // Ergonomic PascalCase names over protobuf enum values; not a second contract.
6
+ export const SnapshotKind = protoEnum(ProtoSnapshotKind);
7
+ export const SnapshotKindNumber = SnapshotKind;
8
+ export const IsolationKind = protoEnum(ProtoIsolationKind);
9
+ export const IsolationKindNumber = IsolationKind;
10
+ export const EgressMode = protoEnum(ProtoEgressMode);
11
+ export const EgressModeNumber = EgressMode;
12
+ export const PortTransport = protoEnum(ProtoPortTransport);
13
+ export const PortTransportNumber = PortTransport;
14
+ export const SecretInjection = protoEnum(ProtoSecretInjection);
15
+ export const SecretInjectionNumber = SecretInjection;
16
+ export const PolicyMode = protoEnum(ProtoPolicyMode);
17
+ export const PolicyModeNumber = PolicyMode;
18
+ export const WaitCondition = protoEnum(ProtoWaitCondition);
19
+ export const WaitConditionNumber = WaitCondition;
20
+ export const SandboxState = protoEnum(ProtoSandboxState);
21
+ export const LifecycleCapability = protoEnum(ProtoLifecycleCapability);
22
+ export const ValueOrigin = protoEnum(ProtoValueOrigin);
@@ -0,0 +1,6 @@
1
+ export * from "#contracts/sandbox_data_contracts.js";
2
+ export * from "#contracts/field_paths.js";
3
+ export * from "#contracts/config_paths.js";
4
+ export * from "#metadata/metadata_object.js";
5
+ export * from "#client/client.js";
6
+ export { validCidr, validDomain, validEnvName, } from "#internal/net_validate.js";
package/dist/index.js ADDED
@@ -0,0 +1,6 @@
1
+ export * from "#contracts/sandbox_data_contracts.js";
2
+ export * from "#contracts/field_paths.js";
3
+ export * from "#contracts/config_paths.js";
4
+ export * from "#metadata/metadata_object.js";
5
+ export * from "#client/client.js";
6
+ export { validCidr, validDomain, validEnvName, } from "#internal/net_validate.js";
@@ -0,0 +1,15 @@
1
+ import { type Duration } from "@bufbuild/protobuf/wkt";
2
+ /** True when a value looks like a protobuf Duration message or init. */
3
+ export declare function isDurationValue(value: unknown): value is Duration;
4
+ type DurationFieldName = "timeout" | "queueTimeout" | "maximumLifetime" | "after";
5
+ /**
6
+ * Recursively replace known protobuf Duration fields with millisecond numbers
7
+ * for public request construction. Field-name based so maps like `labels` are
8
+ * left alone. Public values are always milliseconds.
9
+ */
10
+ export type DurationFieldsToMs<T> = T extends readonly (infer U)[] ? DurationFieldsToMs<U>[] : T extends object ? {
11
+ [K in keyof T]: K extends DurationFieldName ? undefined extends T[K] ? number | undefined : number : DurationFieldsToMs<T[K]>;
12
+ } : T;
13
+ /** Convert public ms numbers on known duration fields into protobuf Durations. */
14
+ export declare function materializeDurationFields<T>(value: T): T;
15
+ export {};
@@ -0,0 +1,41 @@
1
+ import { durationFromMs } from "@bufbuild/protobuf/wkt";
2
+ /** True when a value looks like a protobuf Duration message or init. */
3
+ export function isDurationValue(value) {
4
+ return (typeof value === "object" &&
5
+ value !== null &&
6
+ ("seconds" in value || "nanos" in value) &&
7
+ !Array.isArray(value));
8
+ }
9
+ const durationFieldNames = new Set([
10
+ "timeout",
11
+ "queueTimeout",
12
+ "maximumLifetime",
13
+ "after",
14
+ ]);
15
+ /** Convert public ms numbers on known duration fields into protobuf Durations. */
16
+ export function materializeDurationFields(value) {
17
+ return materializeDurationFieldsAt(value, []);
18
+ }
19
+ function materializeDurationFieldsAt(value, path) {
20
+ if (value === null || value === undefined)
21
+ return value;
22
+ if (typeof value === "number") {
23
+ const leaf = path[path.length - 1];
24
+ if (leaf !== undefined && durationFieldNames.has(leaf)) {
25
+ return durationFromMs(value);
26
+ }
27
+ return value;
28
+ }
29
+ if (typeof value !== "object")
30
+ return value;
31
+ if (isDurationValue(value))
32
+ return value;
33
+ if (Array.isArray(value)) {
34
+ return value.map((item) => materializeDurationFieldsAt(item, path));
35
+ }
36
+ const out = {};
37
+ for (const [key, child] of Object.entries(value)) {
38
+ out[key] = materializeDurationFieldsAt(child, [...path, key]);
39
+ }
40
+ return out;
41
+ }
@@ -0,0 +1,36 @@
1
+ type Simplify<T> = {
2
+ [K in keyof T]: T[K];
3
+ } & {};
4
+ type PreserveOptional<Orig, New> = undefined extends Orig ? New | undefined : New;
5
+ /**
6
+ * Replace selected fields with R[K], keeping each field's optionality from T.
7
+ * Prefer this over call-site `Omit<T, K> & { K?: New }`. Keys in R that are
8
+ * absent from T are ignored; only overlapping keys are rewritten.
9
+ */
10
+ export type RemapFields<T, R> = Simplify<{
11
+ [K in keyof T]: K extends keyof R ? PreserveOptional<T[K], R[K]> : T[K];
12
+ }>;
13
+ type AllowlistField = "outboundCidrs" | "outboundDomains" | "inboundCidrs";
14
+ /**
15
+ * Recursively unwrap StringAllowlist-shaped fields to plain `string[]`.
16
+ * Present empty arrays still mean deny-all after materialize.
17
+ */
18
+ export type FlattenAllowlistFields<T> = T extends readonly (infer U)[] ? FlattenAllowlistFields<U>[] : T extends object ? {
19
+ [K in keyof T]: K extends AllowlistField ? PreserveOptional<T[K], string[]> : FlattenAllowlistFields<T[K]>;
20
+ } : T;
21
+ type EmptyMarkerField = "providerDefault";
22
+ /**
23
+ * Recursively turn empty wire marker messages into `true` presence flags
24
+ * (e.g. `source.providerDefault?: true`).
25
+ */
26
+ export type EmptyMarkersAsTrue<T> = T extends readonly (infer U)[] ? EmptyMarkersAsTrue<U>[] : T extends object ? {
27
+ [K in keyof T]: K extends EmptyMarkerField ? PreserveOptional<T[K], true> : EmptyMarkersAsTrue<T[K]>;
28
+ } : T;
29
+ type StringMapField = "environment" | "labels";
30
+ /**
31
+ * Recursively replace noisy proto string maps with `Record<string, string>`.
32
+ */
33
+ export type PlainStringMapFields<T> = T extends readonly (infer U)[] ? PlainStringMapFields<U>[] : T extends object ? {
34
+ [K in keyof T]: K extends StringMapField ? PreserveOptional<T[K], Record<string, string>> : PlainStringMapFields<T[K]>;
35
+ } : T;
36
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ /** Shared network / env name validators used by provider create checks. */
2
+ export declare function validEnvName(value: string): boolean;
3
+ export declare function validDomain(value: string): boolean;
4
+ export declare function validCidr(value: string): boolean;
@@ -0,0 +1,53 @@
1
+ /** Shared network / env name validators used by provider create checks. */
2
+ export function validEnvName(value) {
3
+ return /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
4
+ }
5
+ export function validDomain(value) {
6
+ const domain = value.startsWith("*.") ? value.slice(2) : value;
7
+ return (domain.length <= 253 &&
8
+ /^(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)*[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.?$/i.test(domain));
9
+ }
10
+ export function validCidr(value) {
11
+ const separator = value.lastIndexOf("/");
12
+ if (separator <= 0)
13
+ return false;
14
+ const address = value.slice(0, separator);
15
+ const prefix = Number(value.slice(separator + 1));
16
+ if (!Number.isInteger(prefix))
17
+ return false;
18
+ return address.includes(":")
19
+ ? prefix >= 0 && prefix <= 128 && validIpv6(address)
20
+ : prefix >= 0 && prefix <= 32 && validIpv4(address);
21
+ }
22
+ function validIpv4(value) {
23
+ const parts = value.split(".");
24
+ return (parts.length === 4 &&
25
+ parts.every((part) => /^(0|[1-9][0-9]{0,2})$/.test(part) && Number(part) <= 255));
26
+ }
27
+ function validIpv6(value) {
28
+ if ((value.match(/::/g)?.length ?? 0) > 1)
29
+ return false;
30
+ const halves = value.split("::");
31
+ if (halves.length > 2)
32
+ return false;
33
+ const count = (part) => {
34
+ if (part === "")
35
+ return 0;
36
+ const groups = part.split(":");
37
+ let total = 0;
38
+ for (const group of groups) {
39
+ if (/^[0-9a-f]{1,4}$/i.test(group))
40
+ total++;
41
+ else if (validIpv4(group))
42
+ total += 2;
43
+ else
44
+ return undefined;
45
+ }
46
+ return total;
47
+ };
48
+ const left = count(halves[0] ?? "");
49
+ const right = count(halves[1] ?? "");
50
+ return (left !== undefined &&
51
+ right !== undefined &&
52
+ (halves.length === 2 ? left + right < 8 : left === 8));
53
+ }
@@ -0,0 +1,32 @@
1
+ import type { RemapFields } from "./input_remap.js";
2
+ import type { StripProto } from "./strip_proto.js";
3
+ type Simplify<T> = {
4
+ [K in keyof T]: T[K];
5
+ } & {};
6
+ type ProtoOneof = {
7
+ case: string | undefined;
8
+ value?: unknown;
9
+ };
10
+ /**
11
+ * Derive nested exclusive input fields from a protobuf-es `{ case, value }` oneof.
12
+ * Variant payloads are StripProto'd (no `$typeName` / `$unknown`).
13
+ */
14
+ export type FlattenOneof<T extends ProtoOneof> = Simplify<{
15
+ [K in Exclude<T["case"], undefined>]?: StripProto<Exclude<Extract<T, {
16
+ case: K;
17
+ }>["value"], undefined>>;
18
+ }>;
19
+ /**
20
+ * Strip protobuf-es internals, then replace listed fields with flattened oneof
21
+ * bags. Use when a wire field is a carrier message whose oneof should surface
22
+ * as exclusive keys on the public input (e.g. `source.kind` → `source.image`).
23
+ *
24
+ * `Oneofs` maps each remapped field to the oneof union to flatten.
25
+ * Further public remaps (allowlists, ms durations, plain maps) compose outside.
26
+ */
27
+ export type StripAndFlatten<T, Oneofs extends {
28
+ [K in keyof Oneofs]: K extends keyof T ? ProtoOneof : never;
29
+ }> = RemapFields<StripProto<T>, {
30
+ [K in keyof Oneofs & string]: FlattenOneof<Oneofs[K]>;
31
+ }>;
32
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,25 @@
1
+ type Simplify<T> = {
2
+ [K in keyof T]: T[K];
3
+ } & {};
4
+ /** `ALLOW_ALL` → `AllowAll`, `HTTP2_TLS` → `Http2Tls`. */
5
+ type SnakeToPascal<S extends string> = S extends `${infer Head}_${infer Tail}` ? `${Capitalize<Lowercase<Head>>}${SnakeToPascal<Tail>}` : Capitalize<Lowercase<S>>;
6
+ /** Forward protobuf-es enum member names (skip reverse numeric keys). */
7
+ type EnumMemberKeys<E> = {
8
+ [K in keyof E]: K extends string ? E[K] extends number ? K extends `${number}` ? never : K : never : never;
9
+ }[keyof E];
10
+ /**
11
+ * Public const object for a protobuf-es enum: PascalCase keys, same numeric
12
+ * values. Does not invent a second contract — only renames member keys.
13
+ */
14
+ export type EnumConst<E> = Simplify<{
15
+ readonly [K in EnumMemberKeys<E> as SnakeToPascal<K & string>]: E[K];
16
+ }>;
17
+ /**
18
+ * Build an ergonomic enum const from a protobuf-es numeric enum object.
19
+ *
20
+ * @example
21
+ * export const EgressMode = protoEnum(ProtoEgressMode);
22
+ * // { Default: 0, AllowAll: 1, BlockAll: 2, Restricted: 3 }
23
+ */
24
+ export declare function protoEnum<E extends Record<string, string | number>>(proto: E): EnumConst<E>;
25
+ export {};
@@ -0,0 +1,25 @@
1
+ function snakeToPascal(name) {
2
+ return name
3
+ .toLowerCase()
4
+ .split("_")
5
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
6
+ .join("");
7
+ }
8
+ /**
9
+ * Build an ergonomic enum const from a protobuf-es numeric enum object.
10
+ *
11
+ * @example
12
+ * export const EgressMode = protoEnum(ProtoEgressMode);
13
+ * // { Default: 0, AllowAll: 1, BlockAll: 2, Restricted: 3 }
14
+ */
15
+ export function protoEnum(proto) {
16
+ const out = {};
17
+ for (const [key, value] of Object.entries(proto)) {
18
+ if (typeof value !== "number")
19
+ continue;
20
+ if (/^\d+$/.test(key))
21
+ continue;
22
+ out[snakeToPascal(key)] = value;
23
+ }
24
+ return out;
25
+ }
@@ -0,0 +1,46 @@
1
+ import type { Duration, Timestamp } from "@bufbuild/protobuf/wkt";
2
+ type ProtoKey = "$typeName" | "$unknown";
3
+ /**
4
+ * True for proto3 map fields (`{ [key: string]: V }`), including non-string
5
+ * values such as `map<string, ValueOrigin>`. Not true for plain messages.
6
+ */
7
+ type IsProtoMap<T> = T extends object ? string extends keyof T ? T extends readonly unknown[] ? false : true : false : false;
8
+ /**
9
+ * Required proto3 maps/repeated/enums become optional for construction.
10
+ * protobuf-es enums are numeric, so required `number` fields soften too.
11
+ * Map *entry* keys (index signatures) are not softened — that would yield
12
+ * `Record<string, V | undefined>`.
13
+ */
14
+ type SoftenField<V, K> = string extends K ? false : V extends readonly unknown[] ? true : IsProtoMap<V> extends true ? true : V extends number ? true : false;
15
+ type OptionalKeys<T> = Exclude<{
16
+ [K in keyof T]-?: undefined extends T[K] ? K : never;
17
+ }[keyof T], ProtoKey>;
18
+ type RequiredKeys<T> = Exclude<keyof T, OptionalKeys<T> | ProtoKey>;
19
+ type SoftenedKeys<T> = {
20
+ [K in RequiredKeys<T>]: SoftenField<T[K], K> extends true ? K : never;
21
+ }[RequiredKeys<T>];
22
+ type KeptRequiredKeys<T> = Exclude<RequiredKeys<T>, SoftenedKeys<T>>;
23
+ type Simplify<T> = {
24
+ [K in keyof T]: T[K];
25
+ } & {};
26
+ type StripProtoObject<T> = Simplify<{
27
+ [K in OptionalKeys<T> & keyof T]?: StripProto<Exclude<T[K], undefined>>;
28
+ } & {
29
+ [K in SoftenedKeys<T>]?: StripProto<T[K]>;
30
+ } & {
31
+ [K in KeptRequiredKeys<T>]: StripProto<T[K]>;
32
+ }>;
33
+ /**
34
+ * Recursively drop protobuf-es message internals for public SDK types:
35
+ *
36
+ * - removes `$typeName` / `$unknown` at every level (including nested messages)
37
+ * - keeps normal field optionality
38
+ * - softens required proto3 maps/repeated/enums to optional
39
+ * - keeps wire `Duration` opaque for provider helpers
40
+ * - maps `Timestamp` to `Date`
41
+ *
42
+ * Nested messages are stripped in place, so aliases do not need `Omit` + remap
43
+ * just to clean child protobuf fields.
44
+ */
45
+ export type StripProto<T> = T extends Duration ? Duration : T extends Timestamp ? Date : T extends string | number | boolean | bigint | null | undefined | symbol | Date | Uint8Array | ((...args: never[]) => unknown) ? T : T extends readonly (infer U)[] ? StripProto<U>[] : T extends object ? StripProtoObject<T> : T;
46
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import type { MetadataObject } from "#contracts/sandbox_data_contracts.js";
2
+ import type { MetadataPlain } from "#metadata/metadata_plain.js";
3
+ export type { MetadataPlain } from "#metadata/metadata_plain.js";
4
+ /** Converts a declarative map into the protobuf metadata object. */
5
+ export declare function metadataObjectFromMap(source: Record<string, MetadataPlain> | undefined): MetadataObject | undefined;
6
+ /** Converts a protobuf metadata object into a declarative map. */
7
+ export declare function metadataObjectAsMap(source: MetadataObject | undefined): Record<string, MetadataPlain> | undefined;
@@ -0,0 +1,103 @@
1
+ // Handwritten helpers for protobuf metadata objects (mirrors Go sandbox metadata helpers).
2
+ import { create } from "@bufbuild/protobuf";
3
+ import { MetadataListSchema, MetadataObjectSchema, MetadataValueSchema, } from "@sandbox-kit/contracts/sandbox";
4
+ /** Converts a declarative map into the protobuf metadata object. */
5
+ export function metadataObjectFromMap(source) {
6
+ if (source === undefined)
7
+ return undefined;
8
+ const values = {};
9
+ for (const [key, value] of Object.entries(source)) {
10
+ values[key] = metadataValueFromPlain(value);
11
+ }
12
+ return create(MetadataObjectSchema, { values });
13
+ }
14
+ /** Converts a protobuf metadata object into a declarative map. */
15
+ export function metadataObjectAsMap(source) {
16
+ if (source === undefined)
17
+ return undefined;
18
+ const out = {};
19
+ for (const [key, value] of Object.entries(source.values ?? {})) {
20
+ out[key] = metadataValueAsPlain(value);
21
+ }
22
+ return out;
23
+ }
24
+ function metadataValueFromPlain(value) {
25
+ // create() returns a protobuf Message; public aliases are StripProto shapes.
26
+ if (value === null)
27
+ return create(MetadataValueSchema, {});
28
+ if (typeof value === "boolean")
29
+ return create(MetadataValueSchema, {
30
+ value: { case: "boolean", value },
31
+ });
32
+ if (typeof value === "string")
33
+ return create(MetadataValueSchema, {
34
+ value: { case: "text", value },
35
+ });
36
+ if (typeof value === "bigint") {
37
+ if (value < 0n)
38
+ return create(MetadataValueSchema, {
39
+ value: { case: "signedInteger", value },
40
+ });
41
+ return create(MetadataValueSchema, {
42
+ value: { case: "unsignedInteger", value },
43
+ });
44
+ }
45
+ if (typeof value === "number") {
46
+ if (!Number.isFinite(value)) {
47
+ throw new Error("sandbox-kit: metadata numbers must be finite");
48
+ }
49
+ if (Number.isInteger(value)) {
50
+ const asBigInt = BigInt(value);
51
+ if (value < 0)
52
+ return create(MetadataValueSchema, {
53
+ value: { case: "signedInteger", value: asBigInt },
54
+ });
55
+ return create(MetadataValueSchema, {
56
+ value: { case: "unsignedInteger", value: asBigInt },
57
+ });
58
+ }
59
+ return create(MetadataValueSchema, {
60
+ value: { case: "number", value },
61
+ });
62
+ }
63
+ if (value instanceof Uint8Array)
64
+ return create(MetadataValueSchema, {
65
+ value: { case: "binary", value },
66
+ });
67
+ if (Array.isArray(value)) {
68
+ return create(MetadataValueSchema, {
69
+ value: {
70
+ case: "list",
71
+ value: create(MetadataListSchema, {
72
+ values: value.map(metadataValueFromPlain),
73
+ }),
74
+ },
75
+ });
76
+ }
77
+ return create(MetadataValueSchema, {
78
+ value: {
79
+ case: "object",
80
+ value: metadataObjectFromMap(value),
81
+ },
82
+ });
83
+ }
84
+ function metadataValueAsPlain(value) {
85
+ switch (value.value?.case) {
86
+ case undefined:
87
+ return null;
88
+ case "boolean":
89
+ case "text":
90
+ case "number":
91
+ case "binary":
92
+ return value.value.value;
93
+ case "signedInteger":
94
+ case "unsignedInteger":
95
+ return value.value.value;
96
+ case "list":
97
+ return (value.value.value?.values ?? []).map(metadataValueAsPlain);
98
+ case "object":
99
+ return metadataObjectAsMap(value.value.value) ?? {};
100
+ default:
101
+ return null;
102
+ }
103
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Plain JSON-like values accepted for public metadata / providerOptions maps.
3
+ * Nested objects use an interface so IDEs do not expand the recursive union.
4
+ */
5
+ export type MetadataPlain = null | boolean | string | number | bigint | Uint8Array | MetadataPlain[] | MetadataPlainObject;
6
+ /** Nested object branch of {@link MetadataPlain}. */
7
+ export interface MetadataPlainObject {
8
+ [key: string]: MetadataPlain;
9
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,73 @@
1
1
  {
2
2
  "name": "@sandbox-kit/sandbox",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.1",
4
+ "description": "one pluggable sdk for all your sandbox providers",
5
+ "keywords": [
6
+ "sandbox-kit",
7
+ "sandbox",
8
+ "sdk"
9
+ ],
10
+ "license": "MIT",
11
+ "type": "module",
12
+ "packageManager": "npm@11.19.0",
13
+ "engines": {
14
+ "node": "^20.0.0 || ^22.0.0 || >=24.15.0"
15
+ },
16
+ "repository": {
17
+ "type": "git",
18
+ "url": "git+https://github.com/sandbox-kit/kit.git",
19
+ "directory": "sdks/typescript/sandbox"
20
+ },
21
+ "homepage": "https://github.com/sandbox-kit/kit/tree/main/sdks/typescript/sandbox",
22
+ "bugs": {
23
+ "url": "https://github.com/sandbox-kit/kit/issues"
24
+ },
25
+ "publishConfig": {
26
+ "access": "public"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "README.md",
31
+ "LICENSE"
32
+ ],
33
+ "main": "./dist/index.js",
34
+ "types": "./dist/index.d.ts",
35
+ "exports": {
36
+ ".": {
37
+ "types": "./dist/index.d.ts",
38
+ "import": "./dist/index.js"
39
+ }
40
+ },
41
+ "imports": {
42
+ "#client/*.js": {
43
+ "@sandbox-kit/source": "./src/client/*.ts",
44
+ "default": "./dist/client/*.js"
45
+ },
46
+ "#contracts/*.js": {
47
+ "@sandbox-kit/source": "./src/contracts/*.ts",
48
+ "default": "./dist/contracts/*.js"
49
+ },
50
+ "#metadata/*.js": {
51
+ "@sandbox-kit/source": "./src/metadata/*.ts",
52
+ "default": "./dist/metadata/*.js"
53
+ },
54
+ "#internal/*.js": {
55
+ "@sandbox-kit/source": "./src/internal/*.ts",
56
+ "default": "./dist/internal/*.js"
57
+ }
58
+ },
59
+ "dependencies": {
60
+ "@bufbuild/protobuf": "2.16.0",
61
+ "@bufbuild/protovalidate": "1.3.0",
62
+ "@sandbox-kit/contracts": "0.1.1"
63
+ },
64
+ "scripts": {
65
+ "build": "tsc -p tsconfig.build.json",
66
+ "prepublishOnly": "npm run build",
67
+ "test": "vitest run"
68
+ },
69
+ "devDependencies": {
70
+ "typescript": "5.9.3",
71
+ "vitest": "4.1.11"
72
+ }
73
+ }