diff --git a/AGENTS.md b/AGENTS.md index b8ab012c..c8a822d6 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -33,8 +33,8 @@ public client owns cleanup through `Close`. fields, and plain allowlists. The client materializes wire messages privately for Protovalidate. Application code depends on `@sandbox-kit/sandbox` (and a provider); `@sandbox-kit/contracts` is an internal SDK dependency. -- Creation returns a sandbox handle. Implement lifecycle methods on that handle - separately from creation configuration. +- Creation returns a sandbox handle. Implement lifecycle and filesystem methods + on that handle separately from creation configuration. - Preserve field presence, units, source kinds, and provider defaults. - Reject unsupported intent before provider calls. Account quotas, permissions, and capacity remain provider-enforced. @@ -72,9 +72,10 @@ classification are handwritten per language. ## Examples and documentation For every public feature, update its language's runnable example and guide. -Use small, independent provider-specific projects under `examples//`. -Each example demonstrates one operation with its own configuration and no provider -selector or CLI flags. +Use small, independent provider-specific projects under +`examples///` in `filesystem/`, `configuration/`, +`lifecycle/`, or `errors/`. Each example demonstrates one operation with its +own configuration and no provider selector or CLI flags. Keep examples aligned with the implemented API. Label test doubles and local verification limits clearly. Verify changed examples before handoff and update diff --git a/README.md b/README.md index f8904183..82d1a0d1 100644 --- a/README.md +++ b/README.md @@ -115,7 +115,7 @@ TypeScript (Daytona): ```sh git clone https://github.com/sandbox-kit/kit.git -cd kit/examples/typescript/daytona/create-daytona-sandbox +cd kit/examples/typescript/daytona/configuration/create-daytona-sandbox cp .env.example .env # set DAYTONA_API_KEY npm install && npm run build && npm start ``` @@ -124,19 +124,20 @@ Go (Daytona), from a fresh clone: ```sh git clone https://github.com/sandbox-kit/kit.git -cd kit/examples/go/daytona/create-daytona-sandbox +cd kit/examples/go/daytona/configuration/create-daytona-sandbox cp .env.example .env # set DAYTONA_API_KEY go run . ``` Modal needs a token pair and an existing app: -[TypeScript](examples/typescript/modal/create-modal-sandbox/README.md) · -[Go](examples/go/modal/create-modal-sandbox/README.md). +[TypeScript](examples/typescript/modal/configuration/create-modal-sandbox/README.md) · +[Go](examples/go/modal/configuration/create-modal-sandbox/README.md). -Creation examples provision real sandboxes. Lifecycle examples use the ID in -`.env` (stop / terminate / archive / delete can destroy that resource). -Error-handling examples fail locally and create nothing. Skip copying -`.env.example` if you already have a configured `.env`. +Creation examples provision real sandboxes. Filesystem and lifecycle examples +use the ID in `.env` (stop / terminate / archive / delete can destroy that +resource; filesystem examples use the path you set). Error-handling examples +fail locally and create nothing. Skip copying `.env.example` if you already +have a configured `.env`. Full catalog: [examples/README.md](examples/README.md) · [TypeScript](examples/typescript/README.md) · [Go](examples/go/README.md). @@ -238,7 +239,8 @@ More detail: [responses and errors](docs/responses-and-errors.md). Guides: [configuration](docs/configuration.md) · [creation](docs/sandbox-creation.md) · -[lifecycle](docs/sandbox-lifecycle.md). +[lifecycle](docs/sandbox-lifecycle.md) · +[filesystem](docs/filesystem.md). ## Documentation @@ -259,6 +261,7 @@ These pages are the behavior reference for the same API: | [Client configuration](docs/configuration.md) | Auth, scope, defaults, deadlines | | [Sandbox creation](docs/sandbox-creation.md) | Fields, units, policies | | [Sandbox lifecycle](docs/sandbox-lifecycle.md) | Get, attach, capabilities | +| [Filesystem](docs/filesystem.md) | Read, write, copy, list, stat, mkdir, remove | | [Providers](docs/providers.md) | Daytona and Modal | | [Responses and errors](docs/responses-and-errors.md) | Error details and provider causes | | [TS Daytona](sdks/typescript/providers/daytona/README.md) / [Modal](sdks/typescript/providers/modal/README.md) | TypeScript provider notes | diff --git a/docs/agent-skills.md b/docs/agent-skills.md index ce1dfd21..ab272a5d 100644 --- a/docs/agent-skills.md +++ b/docs/agent-skills.md @@ -81,14 +81,15 @@ rules instead of invocable skills (`/skill-name`). - **Source:** `wshobson/agents` - **Why selected:** Covers package boundaries, public exports, `pyproject.toml`, - source layouts, and dependency organization for a Python SDK under - `sdks/python/`. + source layouts, and dependency organization for a Python language binding that + would follow the same provider-neutral module layout as Go and TypeScript. ### `python-testing-patterns` - **Source:** `wshobson/agents` - **Why selected:** Adds focused pytest fixtures, parametrization, mocking, - integration tests, and asynchronous test patterns for a Python SDK. + integration tests, and asynchronous test patterns for a Python language + binding. ### `python-error-handling` @@ -100,8 +101,8 @@ rules instead of invocable skills (`/skill-name`). - **Source:** `wshobson/agents` - **Why selected:** Covers structured concurrency, cancellation, timeouts, - resource cleanup, and async context managers for a Python SDK that wraps - networked sandbox providers. + resource cleanup, and async context managers when wrapping networked sandbox + providers from Python. ### `docs-current-state` diff --git a/docs/api-declarations.md b/docs/api-declarations.md index 04958e68..eff29d05 100644 --- a/docs/api-declarations.md +++ b/docs/api-declarations.md @@ -19,7 +19,7 @@ provider classification are handwritten per language. ## Handwritten runtime -- `Client` / `Sandbox` facades and lifecycle dispatch +- `Client` / `Sandbox` facades, lifecycle dispatch, and `Filesystem` - TypeScript public create/config input types and materialization to wire - Provider selection, native SDK initialization, and cleanup - Error wrappers, cause chaining, and provider-native error classification @@ -27,6 +27,7 @@ provider classification are handwritten per language. - Protovalidate evaluation for shared create/config rules (`secure_endpoint` is handwritten) - Provider checks, field mappings, and config assembly +- Path validation and provider filesystem bindings - Provider orchestration that the mapping inventory cannot express See [Protobuf SDK boundary](protobuf-sdk-boundary.md) and diff --git a/docs/code-generation.md b/docs/code-generation.md index 07beb33c..5d057b98 100644 --- a/docs/code-generation.md +++ b/docs/code-generation.md @@ -59,7 +59,7 @@ the SDK. | Input | Defines | | --------------------------------- | ---------------------------------------------------------------------------------- | -| `proto/kit/sandbox/v1/` | Public portable types (config, create, lifecycle options, metadata, errors) | +| `proto/kit/sandbox/v1/` | Public portable types (config, create, lifecycle options, filesystem options, metadata, errors) | | `specs/validation.yaml` | Portable create-validation inventory (mirrors Protovalidate options in proto) | | `specs/client.yaml` | Config validation inventory (mirrors Protovalidate; `secure_endpoint` handwritten) | | `specs/contracts.yaml` | Metadata/error contract limits | @@ -85,8 +85,9 @@ plus per-provider classification mappers. Go provider helpers `sdks/go/internal/sdk`. `RejectUnmapped` sets `Provider` to the provider name and `Field` to the parent path plus the leftover protobuf name. -Handwritten `CreateField*`, `ConfigField*`, `InfoField*`, and `ResultField*` -constants are the field paths used by validation, mappings, and errors. +Handwritten `CreateField*`, `ConfigField*`, `InfoField*`, `ResultField*`, and +`FileField*` constants are the field paths used by validation, mappings, and +errors. `specs/contracts.yaml` names the shared metadata and error messages. Portable messages come from standard protobuf generation into contract packages. @@ -249,18 +250,19 @@ Backend state capture and metadata cloning are handwritten in the SDK runtime 5. Run the CLI verification command. SDK orchestration that the inventory cannot express stays in handwritten -provider integration files (Go `sandbox.go`, `creation.go`, and, where the -provider observes native state, `lifecycle.go` and `metadata.go`; TypeScript -provider-named `.ts` plus `mappings.ts` files): lookup sequences, source -selection, readiness, and remaining provider semantics. Handwritten -`provider_mappings` / `provider_config` own field conversions and native client -configuration; handwritten `provider_checks` enforces create checks; handwritten -`errors` classifies native provider errors. - -Lifecycle option and result types come from protobuf contracts. Handle methods, -typed provider dispatch, capability discovery, and close coordination remain -handwritten runtime code on `Client`, `Sandbox`, and provider `Backend` -adapters. +provider integration files (Go `sandbox.go`, `creation.go`, `filesystem.go`, +and, where the provider observes native state, `lifecycle.go` and +`metadata.go`; TypeScript provider-named `.ts` plus `mappings.ts` files): +lookup sequences, source selection, readiness, filesystem bindings, and +remaining provider semantics. Handwritten `provider_mappings` / +`provider_config` own field conversions and native client configuration; +handwritten `provider_checks` enforces create checks; handwritten `errors` +classifies native provider errors. + +Lifecycle and filesystem option and result types come from protobuf contracts. +Handle methods, typed provider dispatch, lifecycle capability discovery, +filesystem backend methods, and close coordination remain handwritten runtime +code on `Client`, `Sandbox` / `Filesystem`, and provider `Backend` adapters. See [tooling](../tooling/README.md), [naming](naming.md), and [reference verification](provider-verification.md). diff --git a/docs/filesystem.md b/docs/filesystem.md new file mode 100644 index 00000000..fee0ca05 --- /dev/null +++ b/docs/filesystem.md @@ -0,0 +1,249 @@ +# Filesystem + +File calls live on the sandbox handle, next to lifecycle. Daytona and Modal +implement the same methods. Open the handle with `Create`, Daytona `Get`, or +Modal `Attach`, then call `Filesystem` / `sandbox.filesystem`. + +| You want to | Go | TypeScript | +| ----------------------------- | --------------- | --------------- | +| Read the bytes of one file | `ReadFile` | `readFile` | +| Replace one file | `WriteFile` | `writeFile` | +| Copy a file from your machine | `CopyFromLocal` | `copyFromLocal` | +| Copy a file onto your machine | `CopyToLocal` | `copyToLocal` | +| Create a directory | `MakeDirectory` | `makeDirectory` | +| List one directory | `ListDirectory` | `listDirectory` | +| Read metadata for one path | `Stat` | `stat` | +| Delete a file or directory | `Remove` | `remove` | + +Calls on one handle run one at a time, including lifecycle calls. A second +handle for the same sandbox does not wait. + +## Paths + +A path inside the sandbox is absolute: `/tmp/note.txt`. A relative path, a +blank path, or a path that contains a NUL byte is rejected before the provider +is called. The error field is `path`. + +A path on your machine, used by copy, may be relative to the process, such as +`./note.txt`. It must be non-blank and must not contain a NUL byte. A rejected +local path uses the field `local_path`. + +## Bytes and disk + +`ReadFile` and `WriteFile` move bytes. Encode text before you write it, and +decode text after you read it. `WriteFile` replaces an existing file and +creates missing parent directories. + +`CopyFromLocal` and `CopyToLocal` use files on disk. The local file is the +first argument of `CopyFromLocal` and the second argument of `CopyToLocal`. +An existing destination file is replaced. + +## Timeouts + +Leave the timeout unset to use the client deadline. Set it to zero when this +call should add no Kit deadline. TypeScript records the timeout in +milliseconds. Go records it as a `time.Duration`. + +TypeScript Daytona `readFile`, `writeFile`, `copyFromLocal`, and `copyToLocal` +pass that duration to Daytona as a whole number of seconds. `2000` is two +seconds. `1500` is 1.5 seconds, so those four calls reject it. The error field +is `timeout`. An omitted timeout, and an explicit zero, on those four calls +are passed as `0`. Daytona adds no transfer limit. When the timeout is +omitted, the abort signal carries the client deadline. + +`makeDirectory`, `listDirectory`, `stat`, and `remove` use the abort signal. +`1500` ends the call at 1.5 seconds. Every Go file call uses the context as +the deadline, so `1500 * time.Millisecond` ends the call at 1.5 seconds. Modal +file calls use the context or the abort signal. `1500` milliseconds ends the +call at 1.5 seconds. + +```ts +await sandbox.filesystem.readFile("/tmp/note.txt", { timeout: 2_000 }); +await sandbox.filesystem.listDirectory("/tmp", { timeout: 1_500 }); +``` + +```go +data, err := instance.Filesystem().ReadFile(ctx, "/tmp/note.txt", &sandbox.FileReadOptions{ + Timeout: sandbox.Duration(1500 * time.Millisecond), +}) +``` + +## Read a file + +`ReadFile` returns the bytes of one file. A missing file comes back as not +found. A directory path fails at the provider. + +```ts +const data = await sandbox.filesystem.readFile("/tmp/note.txt"); +const text = new TextDecoder().decode(data); +``` + +```go +data, err := instance.Filesystem().ReadFile(ctx, "/tmp/note.txt", nil) +``` + +[Go Daytona](../examples/go/daytona/filesystem/read-daytona-file/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/read-daytona-file/README.md) · +[Go Modal](../examples/go/modal/filesystem/read-modal-file/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/read-modal-file/README.md). + +## Write a file + +`WriteFile` replaces the file at that path. Parent directories are created +when they are missing. + +```ts +const body = new TextEncoder().encode("hello\n"); +await sandbox.filesystem.writeFile("/tmp/kit-files/note.txt", body); +``` + +```go +err := instance.Filesystem().WriteFile(ctx, "/tmp/kit-files/note.txt", []byte("hello\n"), nil) +``` + +[Go Daytona](../examples/go/daytona/filesystem/write-daytona-file/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/write-daytona-file/README.md) · +[Go Modal](../examples/go/modal/filesystem/write-modal-file/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/write-modal-file/README.md). + +## Copy a file + +`CopyFromLocal` reads a file on your machine and writes it in the sandbox. +`CopyToLocal` does the reverse. `CopyFromLocal` creates missing parent +directories of the sandbox path. + +A missing local file is not found. The error field is `local_path`. A local +directory is an invalid argument with the same field. + +`CopyToLocal` creates a missing local parent directory. A local destination +that is already a directory is an invalid argument, and the field is +`local_path`. + +```ts +await sandbox.filesystem.copyFromLocal("./note.txt", "/tmp/note.txt"); +await sandbox.filesystem.copyToLocal("/tmp/note.txt", "./note.txt"); +``` + +```go +files := instance.Filesystem() +if err := files.CopyFromLocal(ctx, "note.txt", "/tmp/note.txt", nil); err != nil { + return err +} +if err := files.CopyToLocal(ctx, "/tmp/note.txt", "note.txt", nil); err != nil { + return err +} +``` + +Into the sandbox: +[Go Daytona](../examples/go/daytona/filesystem/copy-file-into-daytona/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/copy-file-into-daytona/README.md) · +[Go Modal](../examples/go/modal/filesystem/copy-file-into-modal/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/copy-file-into-modal/README.md). + +Out of the sandbox: +[Go Daytona](../examples/go/daytona/filesystem/copy-file-from-daytona/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/copy-file-from-daytona/README.md) · +[Go Modal](../examples/go/modal/filesystem/copy-file-from-modal/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/copy-file-from-modal/README.md). + +## Create a directory + +`parents` defaults to true, so the call creates missing parents. Modal accepts +a directory that already exists. Daytona returns the provider error when it +already exists. + +Set `parents` to false when the parent directory must already exist. Modal +then requires that parent, and returns an error if the new directory is +already there. Daytona rejects `false` before the call. The error field is +`parents`. + +```ts +await sandbox.filesystem.makeDirectory("/tmp/kit-files"); +await sandbox.filesystem.makeDirectory("/tmp/kit-files/nested", { + parents: false, +}); +``` + +```go +err := instance.Filesystem().MakeDirectory(ctx, "/tmp/kit-files", nil) +err = instance.Filesystem().MakeDirectory(ctx, "/tmp/kit-files/nested", &sandbox.MakeDirectoryOptions{ + Parents: sandbox.Value(false), +}) +``` + +[Go Daytona](../examples/go/daytona/filesystem/make-daytona-directory/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/make-daytona-directory/README.md) · +[Go Modal](../examples/go/modal/filesystem/make-modal-directory/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/make-modal-directory/README.md). + +## List a directory + +`ListDirectory` returns the entries in that directory. It does not walk into +subdirectories. A file path fails at the provider. + +```ts +const entries = await sandbox.filesystem.listDirectory("/tmp/kit-files"); +for (const entry of entries) console.log(entry.name, entry.size); +``` + +```go +entries, err := instance.Filesystem().ListDirectory(ctx, "/tmp/kit-files", nil) +``` + +`size` is a byte count: `bigint` in TypeScript and `int64` in Go. + +[Go Daytona](../examples/go/daytona/filesystem/list-daytona-directory/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/list-daytona-directory/README.md) · +[Go Modal](../examples/go/modal/filesystem/list-modal-directory/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/list-modal-directory/README.md). + +## Read metadata + +`Stat` returns one path. A symlink result describes the symlink. Modal can +report a symlink. Daytona reports a file or a directory. `mode` is an octal +string when the provider supplies one, such as `0644`. `permissions`, `owner`, +and `group` are set when the provider supplies them. `modifiedAt` is set when +the provider supplies a time. + +```ts +const info = await sandbox.filesystem.stat("/tmp/note.txt"); +console.log(info.type, info.size); +``` + +```go +info, err := instance.Filesystem().Stat(ctx, "/tmp/note.txt", nil) +``` + +[Go Daytona](../examples/go/daytona/filesystem/stat-daytona-file/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/stat-daytona-file/README.md) · +[Go Modal](../examples/go/modal/filesystem/stat-modal-file/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/stat-modal-file/README.md). + +## Delete a file or directory + +`Remove` with no `recursive` flag deletes a file or an empty directory. Set +`recursive` to delete a directory and its contents. A directory that still +has entries fails when the flag is omitted. A missing path comes back as not +found. + +```ts +await sandbox.filesystem.remove("/tmp/note.txt"); +await sandbox.filesystem.remove("/tmp/kit-files", { recursive: true }); +``` + +```go +files := instance.Filesystem() +if err := files.Remove(ctx, "/tmp/note.txt", nil); err != nil { + return err +} +if err := files.Remove(ctx, "/tmp/kit-files", &sandbox.RemoveOptions{ + Recursive: sandbox.Value(true), +}); err != nil { + return err +} +``` + +[Go Daytona](../examples/go/daytona/filesystem/remove-daytona-file/README.md) · +[TypeScript Daytona](../examples/typescript/daytona/filesystem/remove-daytona-file/README.md) · +[Go Modal](../examples/go/modal/filesystem/remove-modal-file/README.md) · +[TypeScript Modal](../examples/typescript/modal/filesystem/remove-modal-file/README.md). diff --git a/docs/naming.md b/docs/naming.md index 3ea51353..3f271d1e 100644 --- a/docs/naming.md +++ b/docs/naming.md @@ -8,7 +8,7 @@ Use names that read clearly at the call site. Public Go APIs follow Go | Concept | Go name | Responsibility | | ----------------------- | --------------------- | ---------------------------------------------------- | -| Public SDK | `sandbox` | Configuration, lifecycle, and shared metadata | +| Public SDK | `sandbox` | Configuration, lifecycle, filesystem, and metadata | | Provider selection | `Provider` | `Name()` and `NewClient(*Config)` | | Initialized integration | `Backend` | Provider identity and local SDK cleanup | | Optional creation | `SandboxCreator` | `Create()` when the provider supports creation | @@ -17,13 +17,14 @@ Use names that read clearly at the call site. Public Go APIs follow Go | Client settings | `Config` | Provider, auth, scope, endpoint, region, timeout | | Creation request | `CreateOptions` | Source, runtime, resources, and creation policies | | Backend result | `CreateResult` | Shared sandbox metadata | -| Public handle | `Sandbox` | Identity, copied metadata, and lifecycle methods | +| Public handle | `Sandbox` | Identity, copied metadata, lifecycle, and files | +| Files in the sandbox | `Filesystem` | Read, write, copy, mkdir, list, stat, and remove | Public portable types come from protobuf contracts (`kit.sandbox.v1`) aliased in the SDK runtime. TypeScript app-facing `CreateOptions` / `Config` are handwritten facades (ms timeouts, nested oneofs); wire messages stay private to the client. Field-path constants use prefixes such as `CreateField`, `ConfigField`, -`InfoField`, and `ResultField`. Protobuf annotations identify source contracts +`InfoField`, `ResultField`, and `FileField`. Protobuf annotations identify source contracts and operation metadata. Provider packages expose `New() *Provider`. The initialized `backend` and native @@ -42,13 +43,15 @@ sdks/go/internal/sdk/ Shared SDK error type and provider helpers proto/kit/sandbox/v1/ Shared contracts specs/ Portable validation and mapping inventories tooling/ Developer CLI and YAML inventory loaders -examples/go// One folder per provider, one module per example +examples/go// One folder per provider; examples sit under + filesystem/, configuration/, lifecycle/, or errors/ sdks/typescript/contracts/ Generated protobuf wire types (@sandbox-kit/contracts) sdks/typescript/sandbox/ Public TypeScript SDK (@sandbox-kit/sandbox) src/client/ Client runtime split across focused modules: client.ts (Client + public re-exports), - sandbox.ts (handle), types.ts, errors.ts, - validation.ts, operation.ts (deadlines/signals) + sandbox.ts (handle), filesystem.ts, types.ts, + errors.ts, validation.ts, operation.ts + (deadlines/signals) src/contracts/ Public type aliases over protobuf messages src/metadata/ Metadata map helpers src/internal/ Package-private duration/oneof/strip helpers @@ -56,7 +59,8 @@ sdks/typescript/providers/ Optional providers (@sandbox-kit/daytona, @sandbox- src/mappings/ Create/info field mappings src/checks/ Provider create checks src/config/ Native SDK client configuration -examples/typescript// One package per example +examples/typescript// One package per example under + filesystem/, configuration/, lifecycle/, or errors/ ``` Published TypeScript packages expose only their root export (`.`). Cross-folder @@ -68,8 +72,8 @@ Go wire messages live in `sdks/go/internal/contracts`. `RejectUnmapped`, `OptionalDuration`, and `WithErrorContext` live in `sdks/go/internal/sdk`. Application modules cannot import either package. They use the aliases in `sdks/go/sandbox` (`CreateOptions`, `Config`, `ErrorInfo`, `NewError`). -`CreateField`, `ConfigField`, and `InfoField` stay exported so application code -can match `ErrorInfo.Field`. +`CreateField`, `ConfigField`, `InfoField`, and `FileField` stay exported so +application code can match `ErrorInfo.Field`. Portable messages and enums come from standard protobuf contract packages plus handwritten aliases such as `sandbox_data_contracts.go` / @@ -84,24 +88,26 @@ handwritten aliases such as `sandbox_data_contracts.go` / | `provider_mappings.go` / `mappings/provider_mappings.ts` | Request and metadata field conversions | | `provider_checks.go` / `checks/provider_checks.ts` | Provider-specific create checks | | `config/provider_config.ts` | Native SDK configuration assembly (TS) | -| `capabilities.go` | Optional backend operation interfaces (Go) | +| `capabilities.go` | Lifecycle and filesystem backend interfaces (Go) | | `creation.go` | Provider create planning (Go) | | `lifecycle.go` | Provider lifecycle calls (Go) | +| `filesystem.go` | Filesystem calls on the sandbox handle (Go) | | `metadata.go` | Observed sandbox metadata (Go) | | `operation.go` | Sandbox handle operation gate (Go) | Handwritten runtime and provider files own client/orchestration behavior and metadata clone helpers. Go providers keep SDK calls in `sandbox.go` and the create plan in `creation.go`. Daytona also keeps lifecycle calls in -`lifecycle.go` and observed metadata in `metadata.go`. Keep YAML inventories -aligned when changing those files. +`lifecycle.go` and observed metadata in `metadata.go`. Filesystem adapters live +in each provider's `filesystem.go`. Keep YAML inventories aligned when changing +those files. ## Language conventions Field-path constants use names such as `CreateFieldResourcesCpuCores`, -`ConfigFieldScopeAppName`, `InfoFieldResources`, and `ResultFieldExitCode`. -Their values retain -canonical protobuf field names, including nested paths. +`ConfigFieldScopeAppName`, `InfoFieldResources`, `ResultFieldExitCode`, +`FileFieldPath`, and `FileFieldLocalPath`. Their values retain canonical +protobuf field names, including nested paths. Protobuf and YAML use snake_case semantic field names. Generated Go contract types follow protobuf Go naming (`CpuCores`, `MemoryMib`, `OutboundCidrs`, diff --git a/docs/protobuf-sdk-boundary.md b/docs/protobuf-sdk-boundary.md index c8f2cd6e..6893de91 100644 --- a/docs/protobuf-sdk-boundary.md +++ b/docs/protobuf-sdk-boundary.md @@ -6,22 +6,23 @@ types, constructors, methods, errors, or control flow. ## Contract packages -`kit.sandbox.v1` contains public, portable data contracts: +`kit.sandbox.v1` contains public, portable data contracts in `client.proto` and +`sandbox.proto`: - configuration and creation options; -- sandbox metadata, lifecycle options, results, and portable error details. +- sandbox metadata, lifecycle options, filesystem options and results, and + portable error details. Kit does not declare a protobuf RPC service. Language SDKs expose handwritten -`Client` / `Sandbox` APIs and provider `Backend` adapters over vendor SDKs. +`Client` / `Sandbox` / `Filesystem` APIs and provider `Backend` adapters over +vendor SDKs. -`kit.sandbox.internal.v1` is reserved for implementation-only contract data used -by the SDK runtime and provider adapters. Public contracts live in -`client.proto` / `sandbox.proto`. Internal generated Go output belongs under a -Go `internal/` directory; TypeScript must not re-export that module from a -package entrypoint. - -An internal protobuf message is still a data contract. It must not contain a -native SDK client, callback, mutex, function, or another runtime object. +Generated Go wire output lives under `sdks/go/internal/contracts/` so only +modules under `sdks/go` can import it. TypeScript wire types live in +`@sandbox-kit/contracts` and are not re-exported from the public sandbox +package entrypoint. A protobuf message is a data contract only: it must not +contain a native SDK client, callback, mutex, function, or another runtime +object. ## Generated versus handwritten code @@ -31,12 +32,12 @@ representation of portable data. Handwritten language runtime code owns behavior: -- public `Client` and `Sandbox` facades; +- public `Client`, `Sandbox`, and `Filesystem` facades; - TypeScript public create/config input types (materialized to wire privately); - provider selection, native SDK initialization, cleanup, and deadlines; - private adapter interfaces and private native SDK state; - error behavior and conversion at provider boundaries; -- provider checks, field mappings, and config assembly. +- provider checks, field mappings, filesystem bindings, and config assembly. The runtime consumes generated request and response messages for Protovalidate and provider mapping. It does not regenerate parallel structs or assemble diff --git a/docs/provider-verification.md b/docs/provider-verification.md index 89b7d760..be39b6c0 100644 --- a/docs/provider-verification.md +++ b/docs/provider-verification.md @@ -5,14 +5,18 @@ Go and TypeScript bindings target Modal v0.11.1 and Daytona v0.225.0 APIs; pinned SDK source and compilation determine the signatures and serialization used by this checkout. -This review covers authentication, mapped creation settings, and lifecycle -bindings. Local tests verify conversions, validation, SDK request serialization, -and ownership. -They do not prove live scheduling or account capacity. Lifecycle contract tests -cover capability dispatch, metadata updates, class checks, attachment semantics, -provider-class capability resolution, and error translation without provisioning -cloud resources. Provider tests use the pinned SDK's transport/service seams; -they do not expose those native clients through the public SDK. +This review covers authentication, mapped creation settings, lifecycle +bindings, and filesystem bindings. Local tests verify conversions, validation, +SDK request serialization, and ownership. They do not prove live scheduling or +account capacity. Lifecycle contract tests cover capability dispatch, metadata +updates, class checks, attachment semantics, provider-class capability +resolution, and error translation without provisioning cloud resources. +Filesystem tests cover path validation, local copy classification, timeouts, +and provider file APIs (Modal `readBytes` / `writeBytes` / `copyFromLocal` / +`listFiles`; Daytona high-level `FileSystem` plus toolbox list/stat, and +`downloadFiles` with timeout `0` when Kit adds no transfer limit). Provider +tests use the pinned SDK's transport/service seams; they do not expose those +native clients through the public SDK. ## Reference sources diff --git a/docs/providers.md b/docs/providers.md index 088aaba3..2e138e2c 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -34,6 +34,7 @@ await using client = new Client({ | Open an existing sandbox | `attach` (ID only) | `get` (provider lookup) | | Start, stop, pause, archive, delete | Unsupported | Supported | | Terminate | Supported | Unsupported | +| Filesystem | Same eight shared methods | Same eight shared methods | `supports` reports whether the provider implements that operation. A missing operation fails before the provider call. Daytona still accepts or rejects a @@ -47,9 +48,9 @@ Closing the client closes your connection to the provider. The sandboxes keep running. Closing a handle leaves the sandbox as it is. You can keep using the handle. The next call returns the provider's result. -The public API covers create and lifecycle. In-sandbox execution, GPU -requests, resizing, storage, browsers, and macOS or Windows creation are -outside it. +The public API covers create, lifecycle, and files inside the sandbox. GPU +requests, resizing, storage volumes, browsers, process execution, and macOS +or Windows creation are outside it. -See [configuration](configuration.md), [creation](sandbox-creation.md), and -[lifecycle](sandbox-lifecycle.md). +See [configuration](configuration.md), [creation](sandbox-creation.md), +[lifecycle](sandbox-lifecycle.md), and [filesystem](filesystem.md). diff --git a/docs/responses-and-errors.md b/docs/responses-and-errors.md index a8424957..b6a0160d 100644 --- a/docs/responses-and-errors.md +++ b/docs/responses-and-errors.md @@ -25,10 +25,11 @@ the client when the provider returns no sandbox ID. When the provider sets ## Read an error -Initialization, creation, lifecycle calls, and cleanup return the same error -shape: `Kind`, `Provider`, `Operation`, `Field`, `Rule`, and `Message`. -`StatusCode`, `ProviderCode`, and `ProviderSource` carry the provider's own -codes when it sent them. +Initialization, creation, lifecycle calls, filesystem calls, and cleanup return +the same error shape: `Kind`, `Provider`, `Operation`, `Field`, `Rule`, and +`Message`. `StatusCode`, `ProviderCode`, and `ProviderSource` carry the +provider's own codes when it sent them. `NotFound` covers a missing sandbox or +a missing file path. ```go var detail *sandbox.Error @@ -43,9 +44,9 @@ if errors.As(err, &detail) { ``` The same switch works for either provider. Runnable examples: -[Modal unsupported settings](../examples/go/modal/handle-modal-errors/README.md) +[Modal unsupported settings](../examples/go/modal/errors/handle-modal-errors/README.md) and -[Daytona invalid configuration](../examples/go/daytona/handle-daytona-errors/README.md). +[Daytona invalid configuration](../examples/go/daytona/errors/handle-daytona-errors/README.md). Go and TypeScript use the same field string. A rule about one setting names that setting, such as `resources.cpu_limit_cores`. A rule about several @@ -77,9 +78,9 @@ try { ``` TypeScript examples: -[handle-daytona-errors](../examples/typescript/daytona/handle-daytona-errors/README.md) +[handle-daytona-errors](../examples/typescript/daytona/errors/handle-daytona-errors/README.md) and -[handle-modal-errors](../examples/typescript/modal/handle-modal-errors/README.md). +[handle-modal-errors](../examples/typescript/modal/errors/handle-modal-errors/README.md). ## Provider errors diff --git a/docs/sandbox-creation.md b/docs/sandbox-creation.md index 05728c26..5bc1084a 100644 --- a/docs/sandbox-creation.md +++ b/docs/sandbox-creation.md @@ -128,8 +128,10 @@ Closing the client closes your connection to the provider. The sandbox keeps running. Closing a handle leaves the sandbox as it is. You can keep using the handle. The next call returns the provider's result. Lifecycle operations are described in the [lifecycle guide](sandbox-lifecycle.md). +Files inside a sandbox are described in the [filesystem guide](filesystem.md). -Creation covers the sandbox itself. In-sandbox execution, GPU requests, -resizing, storage, browsers, and macOS or Windows creation are outside it. +Creation covers the sandbox itself. GPU requests, resizing, storage volumes, +browsers, process execution, and macOS or Windows creation are outside it. -See [configuration](configuration.md) and [lifecycle](sandbox-lifecycle.md). +See [configuration](configuration.md), [lifecycle](sandbox-lifecycle.md), and +[filesystem](filesystem.md). diff --git a/docs/sandbox-lifecycle.md b/docs/sandbox-lifecycle.md index a7f35077..5b9a0571 100644 --- a/docs/sandbox-lifecycle.md +++ b/docs/sandbox-lifecycle.md @@ -104,3 +104,7 @@ Modal gVisor and Linux VM sandboxes share Modal's terminal execution lifecycle. `Terminate` maps to Modal termination; it is deliberately not presented as `Stop` or `Delete`. Modal's native `FromID` performs no remote lookup, so Kit exposes it as `Client.Attach`; Modal does not advertise `Get` or `Refresh`. + +File calls on the same handle are documented in [filesystem](filesystem.md). +Both providers implement the same eight methods; each handle serializes those +calls with its lifecycle transitions. diff --git a/examples/README.md b/examples/README.md index 9e1179bc..37dcd729 100644 --- a/examples/README.md +++ b/examples/README.md @@ -1,30 +1,33 @@ # Examples Independent Go and TypeScript projects. Each selects one provider, loads its own -`.env`, and demonstrates one creation, lifecycle, cleanup, or error-handling -operation. Every project README explains what the example does for that provider, -with edge cases drawn from Daytona and Modal behavior. +`.env`, and demonstrates one operation. Projects for a provider sit in +`filesystem`, `configuration`, `lifecycle`, or `errors`. Every project README +explains what the example does for that provider, with edge cases drawn from +Daytona and Modal behavior. ## Run one ```sh # Go — requires Go 1.26.0+ -cd examples/go/daytona/create-daytona-sandbox +cd examples/go/daytona/configuration/create-daytona-sandbox cp .env.example .env # set DAYTONA_API_KEY go run . # TypeScript — requires Node.js 20/22/24.15+ and npm 11.19.0 -cd examples/typescript/daytona/create-daytona-sandbox +cd examples/typescript/daytona/configuration/create-daytona-sandbox cp .env.example .env # set DAYTONA_API_KEY npm install && npm run build && npm start ``` Modal needs a token pair and an existing app: -[Go](go/modal/create-modal-sandbox/README.md) · -[TypeScript](typescript/modal/create-modal-sandbox/README.md). +[Go](go/modal/configuration/create-modal-sandbox/README.md) · +[TypeScript](typescript/modal/configuration/create-modal-sandbox/README.md). -Creation examples provision real resources. Lifecycle examples use the sandbox -ID in `.env` (stop / terminate / archive / delete can destroy it). +Creation examples provision real resources. Filesystem and lifecycle examples +use the sandbox ID in `.env`. A filesystem example runs one file operation +(read, write, copy, mkdir, list, stat, or remove) on the path you set. Stop, +terminate, archive, and delete can destroy the sandbox. Error-handling examples fail locally. `Client.Close` closes your connection to Daytona or Modal. `Sandbox.Close` does not change the sandbox, and you can keep using the handle. @@ -33,55 +36,71 @@ Indexes: [Go](go/README.md) · [TypeScript](typescript/README.md). ## Catalog -| Example | Go | TypeScript | -| ------------------------- | ------------------------------------------------------- | ----------------------------------------------------------------------- | -| Daytona creation | [go](go/daytona/create-daytona-sandbox/README.md) | [typescript](typescript/daytona/create-daytona-sandbox/README.md) | -| Daytona snapshot | [go](go/daytona/create-daytona-from-snapshot/README.md) | [typescript](typescript/daytona/create-daytona-from-snapshot/README.md) | -| Daytona image | [go](go/daytona/create-daytona-from-image/README.md) | [typescript](typescript/daytona/create-daytona-from-image/README.md) | -| Daytona runtime | [go](go/daytona/create-daytona-with-runtime/README.md) | [typescript](typescript/daytona/create-daytona-with-runtime/README.md) | -| Daytona ephemeral | [go](go/daytona/create-daytona-ephemeral/README.md) | [typescript](typescript/daytona/create-daytona-ephemeral/README.md) | -| Daytona linked | [go](go/daytona/create-daytona-linked/README.md) | [typescript](typescript/daytona/create-daytona-linked/README.md) | -| Daytona policies | [go](go/daytona/create-daytona-with-policies/README.md) | [typescript](typescript/daytona/create-daytona-with-policies/README.md) | -| Daytona network | [go](go/daytona/create-daytona-with-network/README.md) | [typescript](typescript/daytona/create-daytona-with-network/README.md) | -| Daytona labels | [go](go/daytona/create-daytona-with-labels/README.md) | [typescript](typescript/daytona/create-daytona-with-labels/README.md) | -| Daytona secrets | [go](go/daytona/create-daytona-with-secrets/README.md) | [typescript](typescript/daytona/create-daytona-with-secrets/README.md) | -| Daytona KVM | [go](go/daytona/create-daytona-with-kvm/README.md) | [typescript](typescript/daytona/create-daytona-with-kvm/README.md) | -| Daytona TTL | [go](go/daytona/create-daytona-with-ttl/README.md) | [typescript](typescript/daytona/create-daytona-with-ttl/README.md) | -| Daytona get | [go](go/daytona/get-daytona-sandbox/README.md) | [typescript](typescript/daytona/get-daytona-sandbox/README.md) | -| Daytona refresh | [go](go/daytona/refresh-daytona-sandbox/README.md) | [typescript](typescript/daytona/refresh-daytona-sandbox/README.md) | -| Daytona start | [go](go/daytona/start-daytona-sandbox/README.md) | [typescript](typescript/daytona/start-daytona-sandbox/README.md) | -| Daytona start timeout | [go](go/daytona/start-daytona-with-timeout/README.md) | [typescript](typescript/daytona/start-daytona-with-timeout/README.md) | -| Daytona stop | [go](go/daytona/stop-daytona-sandbox/README.md) | [typescript](typescript/daytona/stop-daytona-sandbox/README.md) | -| Daytona force stop | [go](go/daytona/force-stop-daytona-sandbox/README.md) | [typescript](typescript/daytona/force-stop-daytona-sandbox/README.md) | -| Daytona pause | [go](go/daytona/pause-daytona-sandbox/README.md) | [typescript](typescript/daytona/pause-daytona-sandbox/README.md) | -| Daytona archive | [go](go/daytona/archive-daytona-sandbox/README.md) | [typescript](typescript/daytona/archive-daytona-sandbox/README.md) | -| Daytona delete | [go](go/daytona/delete-daytona-sandbox/README.md) | [typescript](typescript/daytona/delete-daytona-sandbox/README.md) | -| Daytona delete request | [go](go/daytona/request-daytona-deletion/README.md) | [typescript](typescript/daytona/request-daytona-deletion/README.md) | -| Daytona close handle | [go](go/daytona/close-daytona-handle/README.md) | [typescript](typescript/daytona/close-daytona-handle/README.md) | -| Daytona errors | [go](go/daytona/handle-daytona-errors/README.md) | [typescript](typescript/daytona/handle-daytona-errors/README.md) | -| Modal creation | [go](go/modal/create-modal-sandbox/README.md) | [typescript](typescript/modal/create-modal-sandbox/README.md) | -| Modal resources | [go](go/modal/create-modal-with-resources/README.md) | [typescript](typescript/modal/create-modal-with-resources/README.md) | -| Modal runtime | [go](go/modal/create-modal-with-runtime/README.md) | [typescript](typescript/modal/create-modal-with-runtime/README.md) | -| Modal gVisor | [go](go/modal/create-modal-gvisor/README.md) | [typescript](typescript/modal/create-modal-gvisor/README.md) | -| Modal Linux VM | [go](go/modal/create-modal-linux-vm/README.md) | [typescript](typescript/modal/create-modal-linux-vm/README.md) | -| Modal placement | [go](go/modal/create-modal-with-placement/README.md) | [typescript](typescript/modal/create-modal-with-placement/README.md) | -| Modal labels | [go](go/modal/create-modal-with-labels/README.md) | [typescript](typescript/modal/create-modal-with-labels/README.md) | -| Modal network | [go](go/modal/create-modal-with-network/README.md) | [typescript](typescript/modal/create-modal-with-network/README.md) | -| Modal idle timeout | [go](go/modal/create-modal-idle/README.md) | [typescript](typescript/modal/create-modal-idle/README.md) | -| Modal readiness | [go](go/modal/create-modal-ready/README.md) | [typescript](typescript/modal/create-modal-ready/README.md) | -| Modal TCP readiness | [go](go/modal/create-modal-tcp-ready/README.md) | [typescript](typescript/modal/create-modal-tcp-ready/README.md) | -| Modal client timeout wait | [go](go/modal/create-modal-client-timeout/README.md) | [typescript](typescript/modal/create-modal-client-timeout/README.md) | -| Modal ports | [go](go/modal/create-modal-with-ports/README.md) | [typescript](typescript/modal/create-modal-with-ports/README.md) | -| Modal allowlists | [go](go/modal/create-modal-with-allowlists/README.md) | [typescript](typescript/modal/create-modal-with-allowlists/README.md) | -| Modal secrets | [go](go/modal/create-modal-with-secrets/README.md) | [typescript](typescript/modal/create-modal-with-secrets/README.md) | -| Modal verbose | [go](go/modal/create-modal-verbose/README.md) | [typescript](typescript/modal/create-modal-verbose/README.md) | -| Modal identity | [go](go/modal/create-modal-with-identity/README.md) | [typescript](typescript/modal/create-modal-with-identity/README.md) | -| Modal attach | [go](go/modal/attach-modal-sandbox/README.md) | [typescript](typescript/modal/attach-modal-sandbox/README.md) | -| Modal terminate | [go](go/modal/terminate-modal-sandbox/README.md) | [typescript](typescript/modal/terminate-modal-sandbox/README.md) | -| Modal terminate timeout | [go](go/modal/terminate-modal-with-timeout/README.md) | [typescript](typescript/modal/terminate-modal-with-timeout/README.md) | -| Modal termination request | [go](go/modal/request-modal-termination/README.md) | [typescript](typescript/modal/request-modal-termination/README.md) | -| Modal close handle | [go](go/modal/close-modal-handle/README.md) | [typescript](typescript/modal/close-modal-handle/README.md) | -| Modal errors | [go](go/modal/handle-modal-errors/README.md) | [typescript](typescript/modal/handle-modal-errors/README.md) | +| Example | Go | TypeScript | +| ------------------------- | --------------------------------------------------------------------- | ------------------------------------------------------------------------------------- | +| Daytona creation | [go](go/daytona/configuration/create-daytona-sandbox/README.md) | [typescript](typescript/daytona/configuration/create-daytona-sandbox/README.md) | +| Daytona read file | [go](go/daytona/filesystem/read-daytona-file/README.md) | [typescript](typescript/daytona/filesystem/read-daytona-file/README.md) | +| Daytona write file | [go](go/daytona/filesystem/write-daytona-file/README.md) | [typescript](typescript/daytona/filesystem/write-daytona-file/README.md) | +| Daytona copy in | [go](go/daytona/filesystem/copy-file-into-daytona/README.md) | [typescript](typescript/daytona/filesystem/copy-file-into-daytona/README.md) | +| Daytona copy out | [go](go/daytona/filesystem/copy-file-from-daytona/README.md) | [typescript](typescript/daytona/filesystem/copy-file-from-daytona/README.md) | +| Daytona directory | [go](go/daytona/filesystem/make-daytona-directory/README.md) | [typescript](typescript/daytona/filesystem/make-daytona-directory/README.md) | +| Daytona list | [go](go/daytona/filesystem/list-daytona-directory/README.md) | [typescript](typescript/daytona/filesystem/list-daytona-directory/README.md) | +| Daytona stat | [go](go/daytona/filesystem/stat-daytona-file/README.md) | [typescript](typescript/daytona/filesystem/stat-daytona-file/README.md) | +| Daytona remove | [go](go/daytona/filesystem/remove-daytona-file/README.md) | [typescript](typescript/daytona/filesystem/remove-daytona-file/README.md) | +| Daytona snapshot | [go](go/daytona/configuration/create-daytona-from-snapshot/README.md) | [typescript](typescript/daytona/configuration/create-daytona-from-snapshot/README.md) | +| Daytona image | [go](go/daytona/configuration/create-daytona-from-image/README.md) | [typescript](typescript/daytona/configuration/create-daytona-from-image/README.md) | +| Daytona runtime | [go](go/daytona/configuration/create-daytona-with-runtime/README.md) | [typescript](typescript/daytona/configuration/create-daytona-with-runtime/README.md) | +| Daytona ephemeral | [go](go/daytona/configuration/create-daytona-ephemeral/README.md) | [typescript](typescript/daytona/configuration/create-daytona-ephemeral/README.md) | +| Daytona linked | [go](go/daytona/configuration/create-daytona-linked/README.md) | [typescript](typescript/daytona/configuration/create-daytona-linked/README.md) | +| Daytona policies | [go](go/daytona/configuration/create-daytona-with-policies/README.md) | [typescript](typescript/daytona/configuration/create-daytona-with-policies/README.md) | +| Daytona network | [go](go/daytona/configuration/create-daytona-with-network/README.md) | [typescript](typescript/daytona/configuration/create-daytona-with-network/README.md) | +| Daytona labels | [go](go/daytona/configuration/create-daytona-with-labels/README.md) | [typescript](typescript/daytona/configuration/create-daytona-with-labels/README.md) | +| Daytona secrets | [go](go/daytona/configuration/create-daytona-with-secrets/README.md) | [typescript](typescript/daytona/configuration/create-daytona-with-secrets/README.md) | +| Daytona KVM | [go](go/daytona/configuration/create-daytona-with-kvm/README.md) | [typescript](typescript/daytona/configuration/create-daytona-with-kvm/README.md) | +| Daytona TTL | [go](go/daytona/configuration/create-daytona-with-ttl/README.md) | [typescript](typescript/daytona/configuration/create-daytona-with-ttl/README.md) | +| Daytona get | [go](go/daytona/lifecycle/get-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/get-daytona-sandbox/README.md) | +| Daytona refresh | [go](go/daytona/lifecycle/refresh-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/refresh-daytona-sandbox/README.md) | +| Daytona start | [go](go/daytona/lifecycle/start-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/start-daytona-sandbox/README.md) | +| Daytona start timeout | [go](go/daytona/lifecycle/start-daytona-with-timeout/README.md) | [typescript](typescript/daytona/lifecycle/start-daytona-with-timeout/README.md) | +| Daytona stop | [go](go/daytona/lifecycle/stop-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/stop-daytona-sandbox/README.md) | +| Daytona force stop | [go](go/daytona/lifecycle/force-stop-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/force-stop-daytona-sandbox/README.md) | +| Daytona pause | [go](go/daytona/lifecycle/pause-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/pause-daytona-sandbox/README.md) | +| Daytona archive | [go](go/daytona/lifecycle/archive-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/archive-daytona-sandbox/README.md) | +| Daytona delete | [go](go/daytona/lifecycle/delete-daytona-sandbox/README.md) | [typescript](typescript/daytona/lifecycle/delete-daytona-sandbox/README.md) | +| Daytona delete request | [go](go/daytona/lifecycle/request-daytona-deletion/README.md) | [typescript](typescript/daytona/lifecycle/request-daytona-deletion/README.md) | +| Daytona close handle | [go](go/daytona/lifecycle/close-daytona-handle/README.md) | [typescript](typescript/daytona/lifecycle/close-daytona-handle/README.md) | +| Daytona errors | [go](go/daytona/errors/handle-daytona-errors/README.md) | [typescript](typescript/daytona/errors/handle-daytona-errors/README.md) | +| Modal creation | [go](go/modal/configuration/create-modal-sandbox/README.md) | [typescript](typescript/modal/configuration/create-modal-sandbox/README.md) | +| Modal read file | [go](go/modal/filesystem/read-modal-file/README.md) | [typescript](typescript/modal/filesystem/read-modal-file/README.md) | +| Modal write file | [go](go/modal/filesystem/write-modal-file/README.md) | [typescript](typescript/modal/filesystem/write-modal-file/README.md) | +| Modal copy in | [go](go/modal/filesystem/copy-file-into-modal/README.md) | [typescript](typescript/modal/filesystem/copy-file-into-modal/README.md) | +| Modal copy out | [go](go/modal/filesystem/copy-file-from-modal/README.md) | [typescript](typescript/modal/filesystem/copy-file-from-modal/README.md) | +| Modal directory | [go](go/modal/filesystem/make-modal-directory/README.md) | [typescript](typescript/modal/filesystem/make-modal-directory/README.md) | +| Modal list | [go](go/modal/filesystem/list-modal-directory/README.md) | [typescript](typescript/modal/filesystem/list-modal-directory/README.md) | +| Modal stat | [go](go/modal/filesystem/stat-modal-file/README.md) | [typescript](typescript/modal/filesystem/stat-modal-file/README.md) | +| Modal remove | [go](go/modal/filesystem/remove-modal-file/README.md) | [typescript](typescript/modal/filesystem/remove-modal-file/README.md) | +| Modal resources | [go](go/modal/configuration/create-modal-with-resources/README.md) | [typescript](typescript/modal/configuration/create-modal-with-resources/README.md) | +| Modal runtime | [go](go/modal/configuration/create-modal-with-runtime/README.md) | [typescript](typescript/modal/configuration/create-modal-with-runtime/README.md) | +| Modal gVisor | [go](go/modal/configuration/create-modal-gvisor/README.md) | [typescript](typescript/modal/configuration/create-modal-gvisor/README.md) | +| Modal Linux VM | [go](go/modal/configuration/create-modal-linux-vm/README.md) | [typescript](typescript/modal/configuration/create-modal-linux-vm/README.md) | +| Modal placement | [go](go/modal/configuration/create-modal-with-placement/README.md) | [typescript](typescript/modal/configuration/create-modal-with-placement/README.md) | +| Modal labels | [go](go/modal/configuration/create-modal-with-labels/README.md) | [typescript](typescript/modal/configuration/create-modal-with-labels/README.md) | +| Modal network | [go](go/modal/configuration/create-modal-with-network/README.md) | [typescript](typescript/modal/configuration/create-modal-with-network/README.md) | +| Modal idle timeout | [go](go/modal/configuration/create-modal-idle/README.md) | [typescript](typescript/modal/configuration/create-modal-idle/README.md) | +| Modal readiness | [go](go/modal/configuration/create-modal-ready/README.md) | [typescript](typescript/modal/configuration/create-modal-ready/README.md) | +| Modal TCP readiness | [go](go/modal/configuration/create-modal-tcp-ready/README.md) | [typescript](typescript/modal/configuration/create-modal-tcp-ready/README.md) | +| Modal client timeout wait | [go](go/modal/configuration/create-modal-client-timeout/README.md) | [typescript](typescript/modal/configuration/create-modal-client-timeout/README.md) | +| Modal ports | [go](go/modal/configuration/create-modal-with-ports/README.md) | [typescript](typescript/modal/configuration/create-modal-with-ports/README.md) | +| Modal allowlists | [go](go/modal/configuration/create-modal-with-allowlists/README.md) | [typescript](typescript/modal/configuration/create-modal-with-allowlists/README.md) | +| Modal secrets | [go](go/modal/configuration/create-modal-with-secrets/README.md) | [typescript](typescript/modal/configuration/create-modal-with-secrets/README.md) | +| Modal verbose | [go](go/modal/configuration/create-modal-verbose/README.md) | [typescript](typescript/modal/configuration/create-modal-verbose/README.md) | +| Modal identity | [go](go/modal/configuration/create-modal-with-identity/README.md) | [typescript](typescript/modal/configuration/create-modal-with-identity/README.md) | +| Modal attach | [go](go/modal/lifecycle/attach-modal-sandbox/README.md) | [typescript](typescript/modal/lifecycle/attach-modal-sandbox/README.md) | +| Modal terminate | [go](go/modal/lifecycle/terminate-modal-sandbox/README.md) | [typescript](typescript/modal/lifecycle/terminate-modal-sandbox/README.md) | +| Modal terminate timeout | [go](go/modal/lifecycle/terminate-modal-with-timeout/README.md) | [typescript](typescript/modal/lifecycle/terminate-modal-with-timeout/README.md) | +| Modal termination request | [go](go/modal/lifecycle/request-modal-termination/README.md) | [typescript](typescript/modal/lifecycle/request-modal-termination/README.md) | +| Modal close handle | [go](go/modal/lifecycle/close-modal-handle/README.md) | [typescript](typescript/modal/lifecycle/close-modal-handle/README.md) | +| Modal errors | [go](go/modal/errors/handle-modal-errors/README.md) | [typescript](typescript/modal/errors/handle-modal-errors/README.md) | ## Verify locally diff --git a/examples/go/README.md b/examples/go/README.md index 65cf689a..8ce3a0b8 100644 --- a/examples/go/README.md +++ b/examples/go/README.md @@ -1,12 +1,13 @@ # Go examples Each project uses the sandbox client and one provider from this repository. +Projects sit in `filesystem`, `configuration`, `lifecycle`, or `errors`. Requires Go 1.26.0 or newer and this checkout. ## Run one ```sh -cd examples/go/daytona/create-daytona-sandbox +cd examples/go/daytona/configuration/create-daytona-sandbox cp .env.example .env # Fill in the values, then: go run . @@ -14,72 +15,88 @@ go run . Skip copying if `.env` already exists. Programs load `.env` with `godotenv`; shell variables win. The SDK does not load files. Modal app setup: -[create-modal-sandbox](modal/create-modal-sandbox/README.md). +[create-modal-sandbox](modal/configuration/create-modal-sandbox/README.md). Creation programs provision real sandboxes (linked Daytona creates a parent and -child). Lifecycle programs use the configured sandbox ID—read the guide before -destructive stop, terminate, archive, or delete. Error-handling programs fail -locally. Closing a handle leaves the sandbox as it is. Closing the client +child). Filesystem and lifecycle programs use the configured sandbox ID. Read +the guide before a destructive stop, terminate, archive, delete, or remove. +Error-handling programs fail locally. Closing a handle leaves the sandbox as it is. Closing the client closes your connection to Daytona or Modal. ## Catalog ### Daytona -| Project | Demonstrates | -| ------------------------------------------------------------------------------ | --------------------------------------- | -| [create-daytona-sandbox](daytona/create-daytona-sandbox/README.md) | default Daytona snapshot | -| [create-daytona-from-snapshot](daytona/create-daytona-from-snapshot/README.md) | named snapshot source | -| [create-daytona-from-image](daytona/create-daytona-from-image/README.md) | image source and resource sizing | -| [create-daytona-with-runtime](daytona/create-daytona-with-runtime/README.md) | runtime language and user | -| [create-daytona-ephemeral](daytona/create-daytona-ephemeral/README.md) | delete-on-stop behavior | -| [create-daytona-linked](daytona/create-daytona-linked/README.md) | linked parent and ephemeral child | -| [create-daytona-with-policies](daytona/create-daytona-with-policies/README.md) | pause and deletion policies | -| [create-daytona-with-network](daytona/create-daytona-with-network/README.md) | restricted egress allowlists | -| [create-daytona-with-labels](daytona/create-daytona-with-labels/README.md) | labels and environment variables | -| [create-daytona-with-secrets](daytona/create-daytona-with-secrets/README.md) | injected organization secret | -| [create-daytona-with-kvm](daytona/create-daytona-with-kvm/README.md) | nested virtualization (KVM) | -| [create-daytona-with-ttl](daytona/create-daytona-with-ttl/README.md) | maximum lifetime TTL | -| [handle-daytona-errors](daytona/handle-daytona-errors/README.md) | typed validation errors | -| [get-daytona-sandbox](daytona/get-daytona-sandbox/README.md) | remote retrieval and metadata | -| [refresh-daytona-sandbox](daytona/refresh-daytona-sandbox/README.md) | metadata refresh | -| [start-daytona-sandbox](daytona/start-daytona-sandbox/README.md) | start lifecycle operation | -| [start-daytona-with-timeout](daytona/start-daytona-with-timeout/README.md) | start with operation timeout | -| [stop-daytona-sandbox](daytona/stop-daytona-sandbox/README.md) | stop lifecycle operation | -| [force-stop-daytona-sandbox](daytona/force-stop-daytona-sandbox/README.md) | force stop | -| [pause-daytona-sandbox](daytona/pause-daytona-sandbox/README.md) | pause lifecycle operation | -| [archive-daytona-sandbox](daytona/archive-daytona-sandbox/README.md) | archive lifecycle operation | -| [delete-daytona-sandbox](daytona/delete-daytona-sandbox/README.md) | waited deletion | -| [request-daytona-deletion](daytona/request-daytona-deletion/README.md) | non-waited deletion | -| [close-daytona-handle](daytona/close-daytona-handle/README.md) | close the handle; sandbox keeps running | +| Project | Demonstrates | +| -------------------------------------------------------------------------------------------- | --------------------------------------- | +| [create-daytona-sandbox](daytona/configuration/create-daytona-sandbox/README.md) | default Daytona snapshot | +| [read-daytona-file](daytona/filesystem/read-daytona-file/README.md) | read one file | +| [write-daytona-file](daytona/filesystem/write-daytona-file/README.md) | write one file | +| [copy-file-into-daytona](daytona/filesystem/copy-file-into-daytona/README.md) | copy a local file in | +| [copy-file-from-daytona](daytona/filesystem/copy-file-from-daytona/README.md) | copy a sandbox file out | +| [make-daytona-directory](daytona/filesystem/make-daytona-directory/README.md) | create a directory | +| [list-daytona-directory](daytona/filesystem/list-daytona-directory/README.md) | list one directory | +| [stat-daytona-file](daytona/filesystem/stat-daytona-file/README.md) | stat one path | +| [remove-daytona-file](daytona/filesystem/remove-daytona-file/README.md) | remove one path | +| [create-daytona-from-snapshot](daytona/configuration/create-daytona-from-snapshot/README.md) | named snapshot source | +| [create-daytona-from-image](daytona/configuration/create-daytona-from-image/README.md) | image source and resource sizing | +| [create-daytona-with-runtime](daytona/configuration/create-daytona-with-runtime/README.md) | runtime language and user | +| [create-daytona-ephemeral](daytona/configuration/create-daytona-ephemeral/README.md) | delete-on-stop behavior | +| [create-daytona-linked](daytona/configuration/create-daytona-linked/README.md) | linked parent and ephemeral child | +| [create-daytona-with-policies](daytona/configuration/create-daytona-with-policies/README.md) | pause and deletion policies | +| [create-daytona-with-network](daytona/configuration/create-daytona-with-network/README.md) | restricted egress allowlists | +| [create-daytona-with-labels](daytona/configuration/create-daytona-with-labels/README.md) | labels and environment variables | +| [create-daytona-with-secrets](daytona/configuration/create-daytona-with-secrets/README.md) | injected organization secret | +| [create-daytona-with-kvm](daytona/configuration/create-daytona-with-kvm/README.md) | nested virtualization (KVM) | +| [create-daytona-with-ttl](daytona/configuration/create-daytona-with-ttl/README.md) | maximum lifetime TTL | +| [handle-daytona-errors](daytona/errors/handle-daytona-errors/README.md) | typed validation errors | +| [get-daytona-sandbox](daytona/lifecycle/get-daytona-sandbox/README.md) | remote retrieval and metadata | +| [refresh-daytona-sandbox](daytona/lifecycle/refresh-daytona-sandbox/README.md) | metadata refresh | +| [start-daytona-sandbox](daytona/lifecycle/start-daytona-sandbox/README.md) | start lifecycle operation | +| [start-daytona-with-timeout](daytona/lifecycle/start-daytona-with-timeout/README.md) | start with operation timeout | +| [stop-daytona-sandbox](daytona/lifecycle/stop-daytona-sandbox/README.md) | stop lifecycle operation | +| [force-stop-daytona-sandbox](daytona/lifecycle/force-stop-daytona-sandbox/README.md) | force stop | +| [pause-daytona-sandbox](daytona/lifecycle/pause-daytona-sandbox/README.md) | pause lifecycle operation | +| [archive-daytona-sandbox](daytona/lifecycle/archive-daytona-sandbox/README.md) | archive lifecycle operation | +| [delete-daytona-sandbox](daytona/lifecycle/delete-daytona-sandbox/README.md) | waited deletion | +| [request-daytona-deletion](daytona/lifecycle/request-daytona-deletion/README.md) | non-waited deletion | +| [close-daytona-handle](daytona/lifecycle/close-daytona-handle/README.md) | close the handle; sandbox keeps running | ### Modal -| Project | Demonstrates | -| ---------------------------------------------------------------------------- | ------------------------------------------ | -| [create-modal-sandbox](modal/create-modal-sandbox/README.md) | image creation with resources and policies | -| [create-modal-with-resources](modal/create-modal-with-resources/README.md) | fractional CPU, memory, and lifetime | -| [create-modal-with-runtime](modal/create-modal-with-runtime/README.md) | working directory, entrypoint, and PTY | -| [create-modal-gvisor](modal/create-modal-gvisor/README.md) | gVisor/container isolation | -| [create-modal-linux-vm](modal/create-modal-linux-vm/README.md) | Linux VM isolation | -| [create-modal-with-placement](modal/create-modal-with-placement/README.md) | cloud and region placement | -| [create-modal-with-labels](modal/create-modal-with-labels/README.md) | environment variables and tags | -| [create-modal-with-network](modal/create-modal-with-network/README.md) | managed outbound proxy | -| [create-modal-idle](modal/create-modal-idle/README.md) | idle termination | -| [create-modal-ready](modal/create-modal-ready/README.md) | command readiness | -| [create-modal-tcp-ready](modal/create-modal-tcp-ready/README.md) | TCP port readiness | -| [create-modal-client-timeout](modal/create-modal-client-timeout/README.md) | ready-wait via client timeout | -| [create-modal-with-ports](modal/create-modal-with-ports/README.md) | TLS and plain port bindings | -| [create-modal-with-allowlists](modal/create-modal-with-allowlists/README.md) | outbound CIDR/domain allowlists | -| [create-modal-with-secrets](modal/create-modal-with-secrets/README.md) | named Modal secret | -| [create-modal-verbose](modal/create-modal-verbose/README.md) | verbose provider logging | -| [create-modal-with-identity](modal/create-modal-with-identity/README.md) | workload identity | -| [handle-modal-errors](modal/handle-modal-errors/README.md) | typed unsupported-intent errors | -| [attach-modal-sandbox](modal/attach-modal-sandbox/README.md) | ID-only attachment | -| [terminate-modal-sandbox](modal/terminate-modal-sandbox/README.md) | waited termination | -| [terminate-modal-with-timeout](modal/terminate-modal-with-timeout/README.md) | waited terminate with timeout | -| [request-modal-termination](modal/request-modal-termination/README.md) | non-waited termination | -| [close-modal-handle](modal/close-modal-handle/README.md) | close the handle; sandbox keeps running | +| Project | Demonstrates | +| ------------------------------------------------------------------------------------------ | ------------------------------------------ | +| [create-modal-sandbox](modal/configuration/create-modal-sandbox/README.md) | image creation with resources and policies | +| [read-modal-file](modal/filesystem/read-modal-file/README.md) | read one file | +| [write-modal-file](modal/filesystem/write-modal-file/README.md) | write one file | +| [copy-file-into-modal](modal/filesystem/copy-file-into-modal/README.md) | copy a local file in | +| [copy-file-from-modal](modal/filesystem/copy-file-from-modal/README.md) | copy a sandbox file out | +| [make-modal-directory](modal/filesystem/make-modal-directory/README.md) | create a directory | +| [list-modal-directory](modal/filesystem/list-modal-directory/README.md) | list one directory | +| [stat-modal-file](modal/filesystem/stat-modal-file/README.md) | stat one path | +| [remove-modal-file](modal/filesystem/remove-modal-file/README.md) | remove one path | +| [create-modal-with-resources](modal/configuration/create-modal-with-resources/README.md) | fractional CPU, memory, and lifetime | +| [create-modal-with-runtime](modal/configuration/create-modal-with-runtime/README.md) | working directory, entrypoint, and PTY | +| [create-modal-gvisor](modal/configuration/create-modal-gvisor/README.md) | gVisor/container isolation | +| [create-modal-linux-vm](modal/configuration/create-modal-linux-vm/README.md) | Linux VM isolation | +| [create-modal-with-placement](modal/configuration/create-modal-with-placement/README.md) | cloud and region placement | +| [create-modal-with-labels](modal/configuration/create-modal-with-labels/README.md) | environment variables and tags | +| [create-modal-with-network](modal/configuration/create-modal-with-network/README.md) | managed outbound proxy | +| [create-modal-idle](modal/configuration/create-modal-idle/README.md) | idle termination | +| [create-modal-ready](modal/configuration/create-modal-ready/README.md) | command readiness | +| [create-modal-tcp-ready](modal/configuration/create-modal-tcp-ready/README.md) | TCP port readiness | +| [create-modal-client-timeout](modal/configuration/create-modal-client-timeout/README.md) | ready-wait via client timeout | +| [create-modal-with-ports](modal/configuration/create-modal-with-ports/README.md) | TLS and plain port bindings | +| [create-modal-with-allowlists](modal/configuration/create-modal-with-allowlists/README.md) | outbound CIDR/domain allowlists | +| [create-modal-with-secrets](modal/configuration/create-modal-with-secrets/README.md) | named Modal secret | +| [create-modal-verbose](modal/configuration/create-modal-verbose/README.md) | verbose provider logging | +| [create-modal-with-identity](modal/configuration/create-modal-with-identity/README.md) | workload identity | +| [handle-modal-errors](modal/errors/handle-modal-errors/README.md) | typed unsupported-intent errors | +| [attach-modal-sandbox](modal/lifecycle/attach-modal-sandbox/README.md) | ID-only attachment | +| [terminate-modal-sandbox](modal/lifecycle/terminate-modal-sandbox/README.md) | waited termination | +| [terminate-modal-with-timeout](modal/lifecycle/terminate-modal-with-timeout/README.md) | waited terminate with timeout | +| [request-modal-termination](modal/lifecycle/request-modal-termination/README.md) | non-waited termination | +| [close-modal-handle](modal/lifecycle/close-modal-handle/README.md) | close the handle; sandbox keeps running | ## Verify without credentials @@ -96,8 +113,8 @@ Repository-wide: `sandbox-kit test go` from `tooling/`. ## Error handling -[handle-modal-errors](modal/handle-modal-errors/README.md) and -[handle-daytona-errors](daytona/handle-daytona-errors/README.md) switch on +[handle-modal-errors](modal/errors/handle-modal-errors/README.md) and +[handle-daytona-errors](daytona/errors/handle-daytona-errors/README.md) switch on `*sandbox.Error` `Kind` in `main.go`. Other create projects print and exit. Cleanup failures do not replace creation failures. diff --git a/examples/go/daytona/create-daytona-ephemeral/.env.example b/examples/go/daytona/configuration/create-daytona-ephemeral/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-ephemeral/.env.example rename to examples/go/daytona/configuration/create-daytona-ephemeral/.env.example diff --git a/examples/go/daytona/create-daytona-ephemeral/README.md b/examples/go/daytona/configuration/create-daytona-ephemeral/README.md similarity index 84% rename from examples/go/daytona/create-daytona-ephemeral/README.md rename to examples/go/daytona/configuration/create-daytona-ephemeral/README.md index a102b23c..ae96d6eb 100644 --- a/examples/go/daytona/create-daytona-ephemeral/README.md +++ b/examples/go/daytona/configuration/create-daytona-ephemeral/README.md @@ -19,7 +19,7 @@ sets auto-delete to immediate (`0`) for ephemeral creates. See ## Run ```sh -cd examples/go/daytona/create-daytona-ephemeral +cd examples/go/daytona/configuration/create-daytona-ephemeral cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-ephemeral/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-ephemeral/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-ephemeral/go.mod b/examples/go/daytona/configuration/create-daytona-ephemeral/go.mod new file mode 100644 index 00000000..6b3bc7e6 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-ephemeral/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-ephemeral + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/archive-daytona-sandbox/go.sum b/examples/go/daytona/configuration/create-daytona-ephemeral/go.sum similarity index 100% rename from examples/go/daytona/archive-daytona-sandbox/go.sum rename to examples/go/daytona/configuration/create-daytona-ephemeral/go.sum diff --git a/examples/go/daytona/create-daytona-ephemeral/main.go b/examples/go/daytona/configuration/create-daytona-ephemeral/main.go similarity index 100% rename from examples/go/daytona/create-daytona-ephemeral/main.go rename to examples/go/daytona/configuration/create-daytona-ephemeral/main.go diff --git a/examples/go/daytona/create-daytona-from-image/.env.example b/examples/go/daytona/configuration/create-daytona-from-image/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-from-image/.env.example rename to examples/go/daytona/configuration/create-daytona-from-image/.env.example diff --git a/examples/go/daytona/create-daytona-from-image/README.md b/examples/go/daytona/configuration/create-daytona-from-image/README.md similarity index 86% rename from examples/go/daytona/create-daytona-from-image/README.md rename to examples/go/daytona/configuration/create-daytona-from-image/README.md index 2f7469f4..53af14cb 100644 --- a/examples/go/daytona/create-daytona-from-image/README.md +++ b/examples/go/daytona/configuration/create-daytona-from-image/README.md @@ -26,7 +26,7 @@ Documented organization defaults for image create are often 1 vCPU / 1 GiB / ## Run ```sh -cd examples/go/daytona/create-daytona-from-image +cd examples/go/daytona/configuration/create-daytona-from-image cp .env.example .env # Fill in the values below, then: go run . @@ -49,6 +49,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-from-image/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-from-image/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-from-image/go.mod b/examples/go/daytona/configuration/create-daytona-from-image/go.mod new file mode 100644 index 00000000..0ab117c5 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-from-image/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-from-image + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/close-daytona-handle/go.sum b/examples/go/daytona/configuration/create-daytona-from-image/go.sum similarity index 100% rename from examples/go/daytona/close-daytona-handle/go.sum rename to examples/go/daytona/configuration/create-daytona-from-image/go.sum diff --git a/examples/go/daytona/create-daytona-from-image/main.go b/examples/go/daytona/configuration/create-daytona-from-image/main.go similarity index 100% rename from examples/go/daytona/create-daytona-from-image/main.go rename to examples/go/daytona/configuration/create-daytona-from-image/main.go diff --git a/examples/go/daytona/create-daytona-from-snapshot/.env.example b/examples/go/daytona/configuration/create-daytona-from-snapshot/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-from-snapshot/.env.example rename to examples/go/daytona/configuration/create-daytona-from-snapshot/.env.example diff --git a/examples/go/daytona/create-daytona-from-snapshot/README.md b/examples/go/daytona/configuration/create-daytona-from-snapshot/README.md similarity index 86% rename from examples/go/daytona/create-daytona-from-snapshot/README.md rename to examples/go/daytona/configuration/create-daytona-from-snapshot/README.md index 7adf422b..ac33081e 100644 --- a/examples/go/daytona/create-daytona-from-snapshot/README.md +++ b/examples/go/daytona/configuration/create-daytona-from-snapshot/README.md @@ -25,7 +25,7 @@ warm-pool sources are not mapped and are rejected if supplied. ## Run ```sh -cd examples/go/daytona/create-daytona-from-snapshot +cd examples/go/daytona/configuration/create-daytona-from-snapshot cp .env.example .env # Fill in the values below, then: go run . @@ -48,6 +48,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-from-snapshot/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-from-snapshot/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-from-snapshot/go.mod b/examples/go/daytona/configuration/create-daytona-from-snapshot/go.mod new file mode 100644 index 00000000..f9a09310 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-from-snapshot/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-from-snapshot + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-ephemeral/go.sum b/examples/go/daytona/configuration/create-daytona-from-snapshot/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-ephemeral/go.sum rename to examples/go/daytona/configuration/create-daytona-from-snapshot/go.sum diff --git a/examples/go/daytona/create-daytona-from-snapshot/main.go b/examples/go/daytona/configuration/create-daytona-from-snapshot/main.go similarity index 100% rename from examples/go/daytona/create-daytona-from-snapshot/main.go rename to examples/go/daytona/configuration/create-daytona-from-snapshot/main.go diff --git a/examples/go/daytona/create-daytona-linked/.env.example b/examples/go/daytona/configuration/create-daytona-linked/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-linked/.env.example rename to examples/go/daytona/configuration/create-daytona-linked/.env.example diff --git a/examples/go/daytona/create-daytona-linked/README.md b/examples/go/daytona/configuration/create-daytona-linked/README.md similarity index 86% rename from examples/go/daytona/create-daytona-linked/README.md rename to examples/go/daytona/configuration/create-daytona-linked/README.md index e681d002..08441e50 100644 --- a/examples/go/daytona/create-daytona-linked/README.md +++ b/examples/go/daytona/configuration/create-daytona-linked/README.md @@ -22,7 +22,7 @@ This example creates **two** cloud sandboxes. ## Run ```sh -cd examples/go/daytona/create-daytona-linked +cd examples/go/daytona/configuration/create-daytona-linked cp .env.example .env # Fill in the values below, then: go run . @@ -45,6 +45,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-linked/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-linked/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-linked/go.mod b/examples/go/daytona/configuration/create-daytona-linked/go.mod new file mode 100644 index 00000000..cb4c48ac --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-linked/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-linked + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-from-image/go.sum b/examples/go/daytona/configuration/create-daytona-linked/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-from-image/go.sum rename to examples/go/daytona/configuration/create-daytona-linked/go.sum diff --git a/examples/go/daytona/create-daytona-linked/main.go b/examples/go/daytona/configuration/create-daytona-linked/main.go similarity index 100% rename from examples/go/daytona/create-daytona-linked/main.go rename to examples/go/daytona/configuration/create-daytona-linked/main.go diff --git a/examples/go/daytona/create-daytona-sandbox/.env.example b/examples/go/daytona/configuration/create-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-sandbox/.env.example rename to examples/go/daytona/configuration/create-daytona-sandbox/.env.example diff --git a/examples/go/daytona/create-daytona-sandbox/README.md b/examples/go/daytona/configuration/create-daytona-sandbox/README.md similarity index 90% rename from examples/go/daytona/create-daytona-sandbox/README.md rename to examples/go/daytona/configuration/create-daytona-sandbox/README.md index 6e623c55..2814508e 100644 --- a/examples/go/daytona/create-daytona-sandbox/README.md +++ b/examples/go/daytona/configuration/create-daytona-sandbox/README.md @@ -32,7 +32,7 @@ sandbox until you stop/delete it or a lifetime policy fires. ## Run ```sh -cd examples/go/daytona/create-daytona-sandbox +cd examples/go/daytona/configuration/create-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -55,6 +55,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-sandbox/go.mod b/examples/go/daytona/configuration/create-daytona-sandbox/go.mod new file mode 100644 index 00000000..d68411fc --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-from-snapshot/go.sum b/examples/go/daytona/configuration/create-daytona-sandbox/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-from-snapshot/go.sum rename to examples/go/daytona/configuration/create-daytona-sandbox/go.sum diff --git a/examples/go/daytona/create-daytona-sandbox/main.go b/examples/go/daytona/configuration/create-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/create-daytona-sandbox/main.go rename to examples/go/daytona/configuration/create-daytona-sandbox/main.go diff --git a/examples/go/daytona/create-daytona-with-kvm/.env.example b/examples/go/daytona/configuration/create-daytona-with-kvm/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-with-kvm/.env.example rename to examples/go/daytona/configuration/create-daytona-with-kvm/.env.example diff --git a/examples/go/daytona/create-daytona-with-kvm/README.md b/examples/go/daytona/configuration/create-daytona-with-kvm/README.md similarity index 81% rename from examples/go/daytona/create-daytona-with-kvm/README.md rename to examples/go/daytona/configuration/create-daytona-with-kvm/README.md index 5028a692..d80e9819 100644 --- a/examples/go/daytona/create-daytona-with-kvm/README.md +++ b/examples/go/daytona/configuration/create-daytona-with-kvm/README.md @@ -16,7 +16,7 @@ chooses the sandbox class from the source image. ## Run ```sh -cd examples/go/daytona/create-daytona-with-kvm +cd examples/go/daytona/configuration/create-daytona-with-kvm cp .env.example .env # Fill in the values below, then: go run . @@ -39,6 +39,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-with-kvm/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-with-kvm/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-with-kvm/go.mod b/examples/go/daytona/configuration/create-daytona-with-kvm/go.mod new file mode 100644 index 00000000..f48bf498 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-with-kvm/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-with-kvm + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-linked/go.sum b/examples/go/daytona/configuration/create-daytona-with-kvm/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-linked/go.sum rename to examples/go/daytona/configuration/create-daytona-with-kvm/go.sum diff --git a/examples/go/daytona/create-daytona-with-kvm/main.go b/examples/go/daytona/configuration/create-daytona-with-kvm/main.go similarity index 100% rename from examples/go/daytona/create-daytona-with-kvm/main.go rename to examples/go/daytona/configuration/create-daytona-with-kvm/main.go diff --git a/examples/go/daytona/create-daytona-with-labels/.env.example b/examples/go/daytona/configuration/create-daytona-with-labels/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-with-labels/.env.example rename to examples/go/daytona/configuration/create-daytona-with-labels/.env.example diff --git a/examples/go/daytona/create-daytona-with-labels/README.md b/examples/go/daytona/configuration/create-daytona-with-labels/README.md similarity index 80% rename from examples/go/daytona/create-daytona-with-labels/README.md rename to examples/go/daytona/configuration/create-daytona-with-labels/README.md index 420500e9..07b5d482 100644 --- a/examples/go/daytona/create-daytona-with-labels/README.md +++ b/examples/go/daytona/configuration/create-daytona-with-labels/README.md @@ -15,7 +15,7 @@ the sandbox process environment. ## Run ```sh -cd examples/go/daytona/create-daytona-with-labels +cd examples/go/daytona/configuration/create-daytona-with-labels cp .env.example .env # Fill in the values below, then: go run . @@ -38,6 +38,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-with-labels/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-with-labels/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-with-labels/go.mod b/examples/go/daytona/configuration/create-daytona-with-labels/go.mod new file mode 100644 index 00000000..63b021e6 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-with-labels/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-with-labels + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-sandbox/go.sum b/examples/go/daytona/configuration/create-daytona-with-labels/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-sandbox/go.sum rename to examples/go/daytona/configuration/create-daytona-with-labels/go.sum diff --git a/examples/go/daytona/create-daytona-with-labels/main.go b/examples/go/daytona/configuration/create-daytona-with-labels/main.go similarity index 100% rename from examples/go/daytona/create-daytona-with-labels/main.go rename to examples/go/daytona/configuration/create-daytona-with-labels/main.go diff --git a/examples/go/daytona/create-daytona-with-network/.env.example b/examples/go/daytona/configuration/create-daytona-with-network/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-with-network/.env.example rename to examples/go/daytona/configuration/create-daytona-with-network/.env.example diff --git a/examples/go/daytona/create-daytona-with-network/README.md b/examples/go/daytona/configuration/create-daytona-with-network/README.md similarity index 81% rename from examples/go/daytona/create-daytona-with-network/README.md rename to examples/go/daytona/configuration/create-daytona-with-network/README.md index 43156c89..2460bf18 100644 --- a/examples/go/daytona/create-daytona-with-network/README.md +++ b/examples/go/daytona/configuration/create-daytona-with-network/README.md @@ -17,7 +17,7 @@ domain entries before the provider call. ## Run ```sh -cd examples/go/daytona/create-daytona-with-network +cd examples/go/daytona/configuration/create-daytona-with-network cp .env.example .env # Fill in the values below, then: go run . @@ -40,6 +40,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-with-network/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-with-network/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-with-network/go.mod b/examples/go/daytona/configuration/create-daytona-with-network/go.mod new file mode 100644 index 00000000..116e7f64 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-with-network/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-with-network + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-kvm/go.sum b/examples/go/daytona/configuration/create-daytona-with-network/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-with-kvm/go.sum rename to examples/go/daytona/configuration/create-daytona-with-network/go.sum diff --git a/examples/go/daytona/create-daytona-with-network/main.go b/examples/go/daytona/configuration/create-daytona-with-network/main.go similarity index 100% rename from examples/go/daytona/create-daytona-with-network/main.go rename to examples/go/daytona/configuration/create-daytona-with-network/main.go diff --git a/examples/go/daytona/create-daytona-with-policies/.env.example b/examples/go/daytona/configuration/create-daytona-with-policies/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-with-policies/.env.example rename to examples/go/daytona/configuration/create-daytona-with-policies/.env.example diff --git a/examples/go/daytona/create-daytona-with-policies/README.md b/examples/go/daytona/configuration/create-daytona-with-policies/README.md similarity index 89% rename from examples/go/daytona/create-daytona-with-policies/README.md rename to examples/go/daytona/configuration/create-daytona-with-policies/README.md index f7f5b6de..141263de 100644 --- a/examples/go/daytona/create-daytona-with-policies/README.md +++ b/examples/go/daytona/configuration/create-daytona-with-policies/README.md @@ -32,7 +32,7 @@ Kit's [policy matrix](../../../../docs/sandbox-creation.md#policy-semantics) ## Run ```sh -cd examples/go/daytona/create-daytona-with-policies +cd examples/go/daytona/configuration/create-daytona-with-policies cp .env.example .env # Fill in the values below, then: go run . @@ -55,6 +55,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-with-policies/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-with-policies/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-with-policies/go.mod b/examples/go/daytona/configuration/create-daytona-with-policies/go.mod new file mode 100644 index 00000000..93d95453 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-with-policies/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-with-policies + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-labels/go.sum b/examples/go/daytona/configuration/create-daytona-with-policies/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-with-labels/go.sum rename to examples/go/daytona/configuration/create-daytona-with-policies/go.sum diff --git a/examples/go/daytona/create-daytona-with-policies/main.go b/examples/go/daytona/configuration/create-daytona-with-policies/main.go similarity index 100% rename from examples/go/daytona/create-daytona-with-policies/main.go rename to examples/go/daytona/configuration/create-daytona-with-policies/main.go diff --git a/examples/go/daytona/create-daytona-with-policies/main_test.go b/examples/go/daytona/configuration/create-daytona-with-policies/main_test.go similarity index 100% rename from examples/go/daytona/create-daytona-with-policies/main_test.go rename to examples/go/daytona/configuration/create-daytona-with-policies/main_test.go diff --git a/examples/go/daytona/create-daytona-with-runtime/.env.example b/examples/go/daytona/configuration/create-daytona-with-runtime/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-with-runtime/.env.example rename to examples/go/daytona/configuration/create-daytona-with-runtime/.env.example diff --git a/examples/go/daytona/create-daytona-with-runtime/README.md b/examples/go/daytona/configuration/create-daytona-with-runtime/README.md similarity index 85% rename from examples/go/daytona/create-daytona-with-runtime/README.md rename to examples/go/daytona/configuration/create-daytona-with-runtime/README.md index 849cde32..1c68fd5b 100644 --- a/examples/go/daytona/create-daytona-with-runtime/README.md +++ b/examples/go/daytona/configuration/create-daytona-with-runtime/README.md @@ -22,7 +22,7 @@ the snapshot's sandbox class. ## Run ```sh -cd examples/go/daytona/create-daytona-with-runtime +cd examples/go/daytona/configuration/create-daytona-with-runtime cp .env.example .env # Fill in the values below, then: go run . @@ -45,6 +45,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-with-runtime/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-with-runtime/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-with-runtime/go.mod b/examples/go/daytona/configuration/create-daytona-with-runtime/go.mod new file mode 100644 index 00000000..6995fc78 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-with-runtime/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-with-runtime + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-network/go.sum b/examples/go/daytona/configuration/create-daytona-with-runtime/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-with-network/go.sum rename to examples/go/daytona/configuration/create-daytona-with-runtime/go.sum diff --git a/examples/go/daytona/create-daytona-with-runtime/main.go b/examples/go/daytona/configuration/create-daytona-with-runtime/main.go similarity index 100% rename from examples/go/daytona/create-daytona-with-runtime/main.go rename to examples/go/daytona/configuration/create-daytona-with-runtime/main.go diff --git a/examples/go/daytona/create-daytona-with-secrets/.env.example b/examples/go/daytona/configuration/create-daytona-with-secrets/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-with-secrets/.env.example rename to examples/go/daytona/configuration/create-daytona-with-secrets/.env.example diff --git a/examples/go/daytona/create-daytona-with-secrets/README.md b/examples/go/daytona/configuration/create-daytona-with-secrets/README.md similarity index 80% rename from examples/go/daytona/create-daytona-with-secrets/README.md rename to examples/go/daytona/configuration/create-daytona-with-secrets/README.md index 3a81a8f6..50b5ae33 100644 --- a/examples/go/daytona/create-daytona-with-secrets/README.md +++ b/examples/go/daytona/configuration/create-daytona-with-secrets/README.md @@ -15,7 +15,7 @@ injection. It must already exist in the Daytona organization. ## Run ```sh -cd examples/go/daytona/create-daytona-with-secrets +cd examples/go/daytona/configuration/create-daytona-with-secrets cp .env.example .env # Fill in the values below, then: go run . @@ -39,6 +39,6 @@ DAYTONA_SECRET_NAME= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-with-secrets/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-with-secrets/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-with-secrets/go.mod b/examples/go/daytona/configuration/create-daytona-with-secrets/go.mod new file mode 100644 index 00000000..7e3028fc --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-with-secrets/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-with-secrets + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-policies/go.sum b/examples/go/daytona/configuration/create-daytona-with-secrets/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-with-policies/go.sum rename to examples/go/daytona/configuration/create-daytona-with-secrets/go.sum diff --git a/examples/go/daytona/create-daytona-with-secrets/main.go b/examples/go/daytona/configuration/create-daytona-with-secrets/main.go similarity index 100% rename from examples/go/daytona/create-daytona-with-secrets/main.go rename to examples/go/daytona/configuration/create-daytona-with-secrets/main.go diff --git a/examples/go/daytona/create-daytona-with-ttl/.env.example b/examples/go/daytona/configuration/create-daytona-with-ttl/.env.example similarity index 100% rename from examples/go/daytona/create-daytona-with-ttl/.env.example rename to examples/go/daytona/configuration/create-daytona-with-ttl/.env.example diff --git a/examples/go/daytona/create-daytona-with-ttl/README.md b/examples/go/daytona/configuration/create-daytona-with-ttl/README.md similarity index 81% rename from examples/go/daytona/create-daytona-with-ttl/README.md rename to examples/go/daytona/configuration/create-daytona-with-ttl/README.md index a65dc633..f1399f95 100644 --- a/examples/go/daytona/create-daytona-with-ttl/README.md +++ b/examples/go/daytona/configuration/create-daytona-with-ttl/README.md @@ -16,7 +16,7 @@ whole number of minutes. ## Run ```sh -cd examples/go/daytona/create-daytona-with-ttl +cd examples/go/daytona/configuration/create-daytona-with-ttl cp .env.example .env # Fill in the values below, then: go run . @@ -39,6 +39,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/create-daytona-with-ttl/README.md) +- [typescript twin](../../../../typescript/daytona/configuration/create-daytona-with-ttl/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/configuration/create-daytona-with-ttl/go.mod b/examples/go/daytona/configuration/create-daytona-with-ttl/go.mod new file mode 100644 index 00000000..d9bfe4b0 --- /dev/null +++ b/examples/go/daytona/configuration/create-daytona-with-ttl/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/configuration/create-daytona-with-ttl + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-runtime/go.sum b/examples/go/daytona/configuration/create-daytona-with-ttl/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-with-runtime/go.sum rename to examples/go/daytona/configuration/create-daytona-with-ttl/go.sum diff --git a/examples/go/daytona/create-daytona-with-ttl/main.go b/examples/go/daytona/configuration/create-daytona-with-ttl/main.go similarity index 100% rename from examples/go/daytona/create-daytona-with-ttl/main.go rename to examples/go/daytona/configuration/create-daytona-with-ttl/main.go diff --git a/examples/go/daytona/create-daytona-from-snapshot/go.mod b/examples/go/daytona/create-daytona-from-snapshot/go.mod deleted file mode 100644 index fa8a1a05..00000000 --- a/examples/go/daytona/create-daytona-from-snapshot/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-from-snapshot - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-linked/go.mod b/examples/go/daytona/create-daytona-linked/go.mod deleted file mode 100644 index fbc75eec..00000000 --- a/examples/go/daytona/create-daytona-linked/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-linked - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-sandbox/go.mod b/examples/go/daytona/create-daytona-sandbox/go.mod deleted file mode 100644 index 53ffe85b..00000000 --- a/examples/go/daytona/create-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-kvm/go.mod b/examples/go/daytona/create-daytona-with-kvm/go.mod deleted file mode 100644 index 82790ae1..00000000 --- a/examples/go/daytona/create-daytona-with-kvm/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-with-kvm - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-labels/go.mod b/examples/go/daytona/create-daytona-with-labels/go.mod deleted file mode 100644 index 7bf9ee3f..00000000 --- a/examples/go/daytona/create-daytona-with-labels/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-with-labels - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-network/go.mod b/examples/go/daytona/create-daytona-with-network/go.mod deleted file mode 100644 index 60de4054..00000000 --- a/examples/go/daytona/create-daytona-with-network/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-with-network - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-policies/go.mod b/examples/go/daytona/create-daytona-with-policies/go.mod deleted file mode 100644 index fecf7167..00000000 --- a/examples/go/daytona/create-daytona-with-policies/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-with-policies - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-runtime/go.mod b/examples/go/daytona/create-daytona-with-runtime/go.mod deleted file mode 100644 index 77fc7bc1..00000000 --- a/examples/go/daytona/create-daytona-with-runtime/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-with-runtime - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-secrets/go.mod b/examples/go/daytona/create-daytona-with-secrets/go.mod deleted file mode 100644 index 18904152..00000000 --- a/examples/go/daytona/create-daytona-with-secrets/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-with-secrets - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-ttl/go.mod b/examples/go/daytona/create-daytona-with-ttl/go.mod deleted file mode 100644 index 9cf16745..00000000 --- a/examples/go/daytona/create-daytona-with-ttl/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-with-ttl - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/delete-daytona-sandbox/go.mod b/examples/go/daytona/delete-daytona-sandbox/go.mod deleted file mode 100644 index 5762882c..00000000 --- a/examples/go/daytona/delete-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/delete-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/handle-daytona-errors/.env.example b/examples/go/daytona/errors/handle-daytona-errors/.env.example similarity index 100% rename from examples/go/daytona/handle-daytona-errors/.env.example rename to examples/go/daytona/errors/handle-daytona-errors/.env.example diff --git a/examples/go/daytona/handle-daytona-errors/README.md b/examples/go/daytona/errors/handle-daytona-errors/README.md similarity index 85% rename from examples/go/daytona/handle-daytona-errors/README.md rename to examples/go/daytona/errors/handle-daytona-errors/README.md index 4e58d432..4248c021 100644 --- a/examples/go/daytona/handle-daytona-errors/README.md +++ b/examples/go/daytona/errors/handle-daytona-errors/README.md @@ -19,7 +19,7 @@ whole core count). Failures expose portable `kind`, `field`, `operation`, and ## Run ```sh -cd examples/go/daytona/handle-daytona-errors +cd examples/go/daytona/errors/handle-daytona-errors cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_API_KEY= ## Related -- [typescript twin](../../../typescript/daytona/handle-daytona-errors/README.md) +- [typescript twin](../../../../typescript/daytona/errors/handle-daytona-errors/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/create-daytona-ephemeral/go.mod b/examples/go/daytona/errors/handle-daytona-errors/go.mod similarity index 94% rename from examples/go/daytona/create-daytona-ephemeral/go.mod rename to examples/go/daytona/errors/handle-daytona-errors/go.mod index bfdf8019..c52054b4 100644 --- a/examples/go/daytona/create-daytona-ephemeral/go.mod +++ b/examples/go/daytona/errors/handle-daytona-errors/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-ephemeral +module github.com/sandbox-kit/kit/examples/go/daytona/errors/handle-daytona-errors go 1.26.0 @@ -62,10 +62,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-secrets/go.sum b/examples/go/daytona/errors/handle-daytona-errors/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-with-secrets/go.sum rename to examples/go/daytona/errors/handle-daytona-errors/go.sum diff --git a/examples/go/daytona/handle-daytona-errors/main.go b/examples/go/daytona/errors/handle-daytona-errors/main.go similarity index 100% rename from examples/go/daytona/handle-daytona-errors/main.go rename to examples/go/daytona/errors/handle-daytona-errors/main.go diff --git a/examples/go/daytona/handle-daytona-errors/main_test.go b/examples/go/daytona/errors/handle-daytona-errors/main_test.go similarity index 100% rename from examples/go/daytona/handle-daytona-errors/main_test.go rename to examples/go/daytona/errors/handle-daytona-errors/main_test.go diff --git a/examples/go/daytona/filesystem/copy-file-from-daytona/.env.example b/examples/go/daytona/filesystem/copy-file-from-daytona/.env.example new file mode 100644 index 00000000..36c8dcb9 --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-from-daytona/.env.example @@ -0,0 +1,8 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt diff --git a/examples/go/daytona/filesystem/copy-file-from-daytona/README.md b/examples/go/daytona/filesystem/copy-file-from-daytona/README.md new file mode 100644 index 00000000..4df67479 --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-from-daytona/README.md @@ -0,0 +1,50 @@ +# Copy a file from Daytona + +Copy `DAYTONA_REMOTE_PATH` from the sandbox to `DAYTONA_LOCAL_PATH` on this machine. The program loads that sandbox with `client.get`. + +## What this means + +The call copies `DAYTONA_REMOTE_PATH` from the sandbox to `DAYTONA_LOCAL_PATH` on this machine. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Daytona is called. The error field is `local_path`. +- A missing remote file comes back from Daytona as not found. +- A missing local parent directory is created. A local directory is an invalid argument, and the field is `local_path`. +- An existing local file is replaced. + +## Run + +```sh +cd examples/go/daytona/filesystem/copy-file-from-daytona +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the local file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/copy-file-from-daytona/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/filesystem/copy-file-from-daytona/go.mod b/examples/go/daytona/filesystem/copy-file-from-daytona/go.mod new file mode 100644 index 00000000..94be5210 --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-from-daytona/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/copy-file-from-daytona + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/create-daytona-with-ttl/go.sum b/examples/go/daytona/filesystem/copy-file-from-daytona/go.sum similarity index 100% rename from examples/go/daytona/create-daytona-with-ttl/go.sum rename to examples/go/daytona/filesystem/copy-file-from-daytona/go.sum diff --git a/examples/go/daytona/filesystem/copy-file-from-daytona/main.go b/examples/go/daytona/filesystem/copy-file-from-daytona/main.go new file mode 100644 index 00000000..f833dbec --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-from-daytona/main.go @@ -0,0 +1,52 @@ +// Copy a file from Daytona. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + local := os.Getenv("DAYTONA_LOCAL_PATH") + if err := files.CopyToLocal(context.Background(), remote, local, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("copied %s to %s\n", remote, local) +} diff --git a/examples/go/daytona/filesystem/copy-file-into-daytona/.env.example b/examples/go/daytona/filesystem/copy-file-into-daytona/.env.example new file mode 100644 index 00000000..36c8dcb9 --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-into-daytona/.env.example @@ -0,0 +1,8 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt diff --git a/examples/go/daytona/filesystem/copy-file-into-daytona/README.md b/examples/go/daytona/filesystem/copy-file-into-daytona/README.md new file mode 100644 index 00000000..57b43711 --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-into-daytona/README.md @@ -0,0 +1,49 @@ +# Copy a file into Daytona + +Copy `DAYTONA_LOCAL_PATH` on this machine to `DAYTONA_REMOTE_PATH` in the sandbox. The program loads that sandbox with `client.get`. + +## What this means + +The call copies `DAYTONA_LOCAL_PATH` on this machine to `DAYTONA_REMOTE_PATH` in the sandbox. Missing parent directories of the remote file are created. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Daytona is called. The error field is `local_path`. +- A missing local file is not found before Daytona is called. The error field is `local_path`. A directory at that path is an invalid argument with the same field. +- An existing remote file is replaced. + +## Run + +```sh +cd examples/go/daytona/filesystem/copy-file-into-daytona +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the remote file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/copy-file-into-daytona/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/filesystem/copy-file-into-daytona/go.mod b/examples/go/daytona/filesystem/copy-file-into-daytona/go.mod new file mode 100644 index 00000000..7bda9e45 --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-into-daytona/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/copy-file-into-daytona + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/delete-daytona-sandbox/go.sum b/examples/go/daytona/filesystem/copy-file-into-daytona/go.sum similarity index 100% rename from examples/go/daytona/delete-daytona-sandbox/go.sum rename to examples/go/daytona/filesystem/copy-file-into-daytona/go.sum diff --git a/examples/go/daytona/filesystem/copy-file-into-daytona/main.go b/examples/go/daytona/filesystem/copy-file-into-daytona/main.go new file mode 100644 index 00000000..86ebcd76 --- /dev/null +++ b/examples/go/daytona/filesystem/copy-file-into-daytona/main.go @@ -0,0 +1,52 @@ +// Copy a file into Daytona. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + local := os.Getenv("DAYTONA_LOCAL_PATH") + if err := files.CopyFromLocal(context.Background(), local, remote, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("copied %s to %s\n", local, remote) +} diff --git a/examples/go/daytona/filesystem/list-daytona-directory/.env.example b/examples/go/daytona/filesystem/list-daytona-directory/.env.example new file mode 100644 index 00000000..04b400d2 --- /dev/null +++ b/examples/go/daytona/filesystem/list-daytona-directory/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/go/daytona/filesystem/list-daytona-directory/README.md b/examples/go/daytona/filesystem/list-daytona-directory/README.md new file mode 100644 index 00000000..028804ae --- /dev/null +++ b/examples/go/daytona/filesystem/list-daytona-directory/README.md @@ -0,0 +1,48 @@ +# List a Daytona directory + +Print the names in the directory at `DAYTONA_REMOTE_PATH`. The program loads that sandbox with `client.get`. + +## What this means + +The call prints the names in one directory. It does not walk into subdirectories. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- A missing directory comes back from Daytona as not found. +- A file path fails at the provider. + +## Run + +```sh +cd examples/go/daytona/filesystem/list-daytona-directory +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Needs an existing sandbox and a directory at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/list-daytona-directory/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/filesystem/list-daytona-directory/go.mod b/examples/go/daytona/filesystem/list-daytona-directory/go.mod new file mode 100644 index 00000000..5899165d --- /dev/null +++ b/examples/go/daytona/filesystem/list-daytona-directory/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/list-daytona-directory + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/force-stop-daytona-sandbox/go.sum b/examples/go/daytona/filesystem/list-daytona-directory/go.sum similarity index 100% rename from examples/go/daytona/force-stop-daytona-sandbox/go.sum rename to examples/go/daytona/filesystem/list-daytona-directory/go.sum diff --git a/examples/go/daytona/filesystem/list-daytona-directory/main.go b/examples/go/daytona/filesystem/list-daytona-directory/main.go new file mode 100644 index 00000000..068b6411 --- /dev/null +++ b/examples/go/daytona/filesystem/list-daytona-directory/main.go @@ -0,0 +1,55 @@ +// List a Daytona directory. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + entries, err := files.ListDirectory(context.Background(), remote, nil) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%s (%d entries)\n", remote, len(entries)) + for _, entry := range entries { + fmt.Println(entry.GetName()) + } +} diff --git a/examples/go/daytona/filesystem/make-daytona-directory/.env.example b/examples/go/daytona/filesystem/make-daytona-directory/.env.example new file mode 100644 index 00000000..5c501883 --- /dev/null +++ b/examples/go/daytona/filesystem/make-daytona-directory/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/kit-files + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/go/daytona/filesystem/make-daytona-directory/README.md b/examples/go/daytona/filesystem/make-daytona-directory/README.md new file mode 100644 index 00000000..8e9dcc14 --- /dev/null +++ b/examples/go/daytona/filesystem/make-daytona-directory/README.md @@ -0,0 +1,49 @@ +# Create a Daytona directory + +Create the directory at `DAYTONA_REMOTE_PATH`, including any missing parents. The program loads that sandbox with `client.get`. + +## What this means + +The call creates `DAYTONA_REMOTE_PATH` and any missing parents. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- `Parents` defaults to true and creates missing parents. +- `Parents` set to false is rejected before Daytona is called. +- Daytona returns an error when that directory already exists. + +## Run + +```sh +cd examples/go/daytona/filesystem/make-daytona-directory +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/kit-files + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Creates the directory inside the existing sandbox. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/make-daytona-directory/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/filesystem/make-daytona-directory/go.mod b/examples/go/daytona/filesystem/make-daytona-directory/go.mod new file mode 100644 index 00000000..23b04870 --- /dev/null +++ b/examples/go/daytona/filesystem/make-daytona-directory/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/make-daytona-directory + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/get-daytona-sandbox/go.sum b/examples/go/daytona/filesystem/make-daytona-directory/go.sum similarity index 100% rename from examples/go/daytona/get-daytona-sandbox/go.sum rename to examples/go/daytona/filesystem/make-daytona-directory/go.sum diff --git a/examples/go/daytona/filesystem/make-daytona-directory/main.go b/examples/go/daytona/filesystem/make-daytona-directory/main.go new file mode 100644 index 00000000..7f8f7852 --- /dev/null +++ b/examples/go/daytona/filesystem/make-daytona-directory/main.go @@ -0,0 +1,51 @@ +// Create a Daytona directory. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + if err := files.MakeDirectory(context.Background(), remote, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("created %s\n", remote) +} diff --git a/examples/go/daytona/filesystem/read-daytona-file/.env.example b/examples/go/daytona/filesystem/read-daytona-file/.env.example new file mode 100644 index 00000000..b06909e8 --- /dev/null +++ b/examples/go/daytona/filesystem/read-daytona-file/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/go/daytona/filesystem/read-daytona-file/README.md b/examples/go/daytona/filesystem/read-daytona-file/README.md new file mode 100644 index 00000000..6be82071 --- /dev/null +++ b/examples/go/daytona/filesystem/read-daytona-file/README.md @@ -0,0 +1,48 @@ +# Read a Daytona file + +Read the bytes at `DAYTONA_REMOTE_PATH` with `Filesystem.ReadFile` / `sandbox.filesystem.readFile`. The program loads that sandbox with `client.get`. + +## What this means + +The call returns the file contents as bytes. Decode text in your own program. The sandbox path is absolute. + +## Edge cases + +- A relative path, a blank path, or a path that contains a NUL byte is rejected before Daytona is called. The error field is `path`. +- A missing file comes back from Daytona as not found. +- A directory path fails at the provider. + +## Run + +```sh +cd examples/go/daytona/filesystem/read-daytona-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Needs an existing sandbox and a file at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/read-daytona-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/archive-daytona-sandbox/go.mod b/examples/go/daytona/filesystem/read-daytona-file/go.mod similarity index 94% rename from examples/go/daytona/archive-daytona-sandbox/go.mod rename to examples/go/daytona/filesystem/read-daytona-file/go.mod index 0d37fda2..04f53c8a 100644 --- a/examples/go/daytona/archive-daytona-sandbox/go.mod +++ b/examples/go/daytona/filesystem/read-daytona-file/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/archive-daytona-sandbox +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/read-daytona-file go 1.26.0 @@ -62,10 +62,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/handle-daytona-errors/go.sum b/examples/go/daytona/filesystem/read-daytona-file/go.sum similarity index 100% rename from examples/go/daytona/handle-daytona-errors/go.sum rename to examples/go/daytona/filesystem/read-daytona-file/go.sum diff --git a/examples/go/daytona/filesystem/read-daytona-file/main.go b/examples/go/daytona/filesystem/read-daytona-file/main.go new file mode 100644 index 00000000..6d5c7744 --- /dev/null +++ b/examples/go/daytona/filesystem/read-daytona-file/main.go @@ -0,0 +1,52 @@ +// Read a Daytona file. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + data, err := files.ReadFile(context.Background(), remote, nil) + if err != nil { + log.Fatal(err) + } + fmt.Printf("read %s (%d bytes)\n", remote, len(data)) +} diff --git a/examples/go/daytona/filesystem/remove-daytona-file/.env.example b/examples/go/daytona/filesystem/remove-daytona-file/.env.example new file mode 100644 index 00000000..de595213 --- /dev/null +++ b/examples/go/daytona/filesystem/remove-daytona-file/.env.example @@ -0,0 +1,8 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +# DAYTONA_RECURSIVE=true diff --git a/examples/go/daytona/filesystem/remove-daytona-file/README.md b/examples/go/daytona/filesystem/remove-daytona-file/README.md new file mode 100644 index 00000000..4e5400db --- /dev/null +++ b/examples/go/daytona/filesystem/remove-daytona-file/README.md @@ -0,0 +1,49 @@ +# Remove a Daytona path + +Delete `DAYTONA_REMOTE_PATH`. The program loads that sandbox with `client.get`. + +## What this means + +The call deletes `DAYTONA_REMOTE_PATH`. With `DAYTONA_RECURSIVE` unset, it removes a file or an empty directory. Set `DAYTONA_RECURSIVE=true` to delete a directory and its contents. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- A missing path comes back from Daytona as not found. +- A directory that still has entries fails when `DAYTONA_RECURSIVE` is unset. + +## Run + +```sh +cd examples/go/daytona/filesystem/remove-daytona-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +# DAYTONA_RECURSIVE=true + +``` + +## Warnings + +- Deletes the remote path. A recursive delete removes the directory and everything inside it. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/remove-daytona-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/filesystem/remove-daytona-file/go.mod b/examples/go/daytona/filesystem/remove-daytona-file/go.mod new file mode 100644 index 00000000..b2b2476f --- /dev/null +++ b/examples/go/daytona/filesystem/remove-daytona-file/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/remove-daytona-file + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/pause-daytona-sandbox/go.sum b/examples/go/daytona/filesystem/remove-daytona-file/go.sum similarity index 100% rename from examples/go/daytona/pause-daytona-sandbox/go.sum rename to examples/go/daytona/filesystem/remove-daytona-file/go.sum diff --git a/examples/go/daytona/filesystem/remove-daytona-file/main.go b/examples/go/daytona/filesystem/remove-daytona-file/main.go new file mode 100644 index 00000000..24eaf848 --- /dev/null +++ b/examples/go/daytona/filesystem/remove-daytona-file/main.go @@ -0,0 +1,55 @@ +// Remove a Daytona path. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + var options *sandbox.RemoveOptions + if os.Getenv("DAYTONA_RECURSIVE") == "true" { + options = &sandbox.RemoveOptions{Recursive: sandbox.Value(true)} + } + if err := files.Remove(context.Background(), remote, options); err != nil { + log.Fatal(err) + } + fmt.Printf("removed %s\n", remote) +} diff --git a/examples/go/daytona/filesystem/stat-daytona-file/.env.example b/examples/go/daytona/filesystem/stat-daytona-file/.env.example new file mode 100644 index 00000000..b06909e8 --- /dev/null +++ b/examples/go/daytona/filesystem/stat-daytona-file/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/go/daytona/filesystem/stat-daytona-file/README.md b/examples/go/daytona/filesystem/stat-daytona-file/README.md new file mode 100644 index 00000000..02fb826a --- /dev/null +++ b/examples/go/daytona/filesystem/stat-daytona-file/README.md @@ -0,0 +1,47 @@ +# Stat a Daytona path + +Print the path, type, and size of `DAYTONA_REMOTE_PATH`. The program loads that sandbox with `client.get`. + +## What this means + +The call prints the path, type, and size. Daytona reports a file or a directory. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- A missing path comes back from Daytona as not found. + +## Run + +```sh +cd examples/go/daytona/filesystem/stat-daytona-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Needs an existing sandbox and a path at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/stat-daytona-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/create-daytona-from-image/go.mod b/examples/go/daytona/filesystem/stat-daytona-file/go.mod similarity index 94% rename from examples/go/daytona/create-daytona-from-image/go.mod rename to examples/go/daytona/filesystem/stat-daytona-file/go.mod index 3534930a..6b0bde16 100644 --- a/examples/go/daytona/create-daytona-from-image/go.mod +++ b/examples/go/daytona/filesystem/stat-daytona-file/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/create-daytona-from-image +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/stat-daytona-file go 1.26.0 @@ -62,10 +62,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/refresh-daytona-sandbox/go.sum b/examples/go/daytona/filesystem/stat-daytona-file/go.sum similarity index 100% rename from examples/go/daytona/refresh-daytona-sandbox/go.sum rename to examples/go/daytona/filesystem/stat-daytona-file/go.sum diff --git a/examples/go/daytona/filesystem/stat-daytona-file/main.go b/examples/go/daytona/filesystem/stat-daytona-file/main.go new file mode 100644 index 00000000..059b352b --- /dev/null +++ b/examples/go/daytona/filesystem/stat-daytona-file/main.go @@ -0,0 +1,52 @@ +// Stat a Daytona path. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + info, err := files.Stat(context.Background(), remote, nil) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%s type=%s size=%d\n", info.GetPath(), info.GetType(), info.GetSize()) +} diff --git a/examples/go/daytona/filesystem/write-daytona-file/.env.example b/examples/go/daytona/filesystem/write-daytona-file/.env.example new file mode 100644 index 00000000..b06909e8 --- /dev/null +++ b/examples/go/daytona/filesystem/write-daytona-file/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/go/daytona/filesystem/write-daytona-file/README.md b/examples/go/daytona/filesystem/write-daytona-file/README.md new file mode 100644 index 00000000..1e5a2439 --- /dev/null +++ b/examples/go/daytona/filesystem/write-daytona-file/README.md @@ -0,0 +1,48 @@ +# Write a Daytona file + +Replace the file at `DAYTONA_REMOTE_PATH` with the bytes of `hello from sandbox-kit`. The program loads that sandbox with `client.get`. + +## What this means + +The call replaces the file with the bytes of `hello from sandbox-kit` and creates any missing parent directories. + +## Edge cases + +- A relative sandbox path is rejected before Daytona is called. The error field is `path`. +- An existing file at that path is replaced. +- A path that names a directory fails at the provider. + +## Run + +```sh +cd examples/go/daytona/filesystem/write-daytona-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Overwrites the file at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/daytona/filesystem/write-daytona-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/close-daytona-handle/go.mod b/examples/go/daytona/filesystem/write-daytona-file/go.mod similarity index 94% rename from examples/go/daytona/close-daytona-handle/go.mod rename to examples/go/daytona/filesystem/write-daytona-file/go.mod index c418d6d1..1fa90549 100644 --- a/examples/go/daytona/close-daytona-handle/go.mod +++ b/examples/go/daytona/filesystem/write-daytona-file/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/close-daytona-handle +module github.com/sandbox-kit/kit/examples/go/daytona/filesystem/write-daytona-file go 1.26.0 @@ -62,10 +62,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/request-daytona-deletion/go.sum b/examples/go/daytona/filesystem/write-daytona-file/go.sum similarity index 100% rename from examples/go/daytona/request-daytona-deletion/go.sum rename to examples/go/daytona/filesystem/write-daytona-file/go.sum diff --git a/examples/go/daytona/filesystem/write-daytona-file/main.go b/examples/go/daytona/filesystem/write-daytona-file/main.go new file mode 100644 index 00000000..18fdc68c --- /dev/null +++ b/examples/go/daytona/filesystem/write-daytona-file/main.go @@ -0,0 +1,52 @@ +// Write a Daytona file. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/daytona" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + config := &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.APIKey{ + ApiKey: &sandbox.APIKeyCredentials{ + Key: os.Getenv("DAYTONA_API_KEY"), + }, + }, + }, + Timeout: sandbox.Duration(2 * time.Minute), + } + if endpoint := os.Getenv("DAYTONA_API_URL"); endpoint != "" { + config.Endpoint = sandbox.Value(endpoint) + } + if target := os.Getenv("DAYTONA_TARGET"); target != "" { + config.Region = sandbox.Value(target) + } + client, err := sandbox.NewClient(daytona.New(), config) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Get(context.Background(), os.Getenv("DAYTONA_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("DAYTONA_REMOTE_PATH") + body := []byte("hello from sandbox-kit\n") + if err := files.WriteFile(context.Background(), remote, body, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("wrote %s (%d bytes)\n", remote, len(body)) +} diff --git a/examples/go/daytona/force-stop-daytona-sandbox/go.mod b/examples/go/daytona/force-stop-daytona-sandbox/go.mod deleted file mode 100644 index 179374d6..00000000 --- a/examples/go/daytona/force-stop-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/force-stop-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/get-daytona-sandbox/go.mod b/examples/go/daytona/get-daytona-sandbox/go.mod deleted file mode 100644 index 08171987..00000000 --- a/examples/go/daytona/get-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/get-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/handle-daytona-errors/go.mod b/examples/go/daytona/handle-daytona-errors/go.mod deleted file mode 100644 index 518b056d..00000000 --- a/examples/go/daytona/handle-daytona-errors/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/handle-daytona-errors - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/archive-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/archive-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/archive-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/archive-daytona-sandbox/.env.example diff --git a/examples/go/daytona/archive-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/archive-daytona-sandbox/README.md similarity index 82% rename from examples/go/daytona/archive-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/archive-daytona-sandbox/README.md index cfec2ffa..2532571d 100644 --- a/examples/go/daytona/archive-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/archive-daytona-sandbox/README.md @@ -17,7 +17,7 @@ accepts or rejects that sandbox. See ## Run ```sh -cd examples/go/daytona/archive-daytona-sandbox +cd examples/go/daytona/lifecycle/archive-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/archive-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/archive-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/archive-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/archive-daytona-sandbox/go.mod new file mode 100644 index 00000000..5b0bde82 --- /dev/null +++ b/examples/go/daytona/lifecycle/archive-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/archive-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/start-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/archive-daytona-sandbox/go.sum similarity index 100% rename from examples/go/daytona/start-daytona-sandbox/go.sum rename to examples/go/daytona/lifecycle/archive-daytona-sandbox/go.sum diff --git a/examples/go/daytona/archive-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/archive-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/archive-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/archive-daytona-sandbox/main.go diff --git a/examples/go/daytona/close-daytona-handle/.env.example b/examples/go/daytona/lifecycle/close-daytona-handle/.env.example similarity index 100% rename from examples/go/daytona/close-daytona-handle/.env.example rename to examples/go/daytona/lifecycle/close-daytona-handle/.env.example diff --git a/examples/go/daytona/close-daytona-handle/README.md b/examples/go/daytona/lifecycle/close-daytona-handle/README.md similarity index 83% rename from examples/go/daytona/close-daytona-handle/README.md rename to examples/go/daytona/lifecycle/close-daytona-handle/README.md index e6fc94ce..909c9bb4 100644 --- a/examples/go/daytona/close-daytona-handle/README.md +++ b/examples/go/daytona/lifecycle/close-daytona-handle/README.md @@ -17,7 +17,7 @@ You can keep using the handle. The next call returns Daytona's result. ## Run ```sh -cd examples/go/daytona/close-daytona-handle +cd examples/go/daytona/lifecycle/close-daytona-handle cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/close-daytona-handle/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/close-daytona-handle/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/close-daytona-handle/go.mod b/examples/go/daytona/lifecycle/close-daytona-handle/go.mod new file mode 100644 index 00000000..989f1638 --- /dev/null +++ b/examples/go/daytona/lifecycle/close-daytona-handle/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/close-daytona-handle + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/start-daytona-with-timeout/go.sum b/examples/go/daytona/lifecycle/close-daytona-handle/go.sum similarity index 100% rename from examples/go/daytona/start-daytona-with-timeout/go.sum rename to examples/go/daytona/lifecycle/close-daytona-handle/go.sum diff --git a/examples/go/daytona/close-daytona-handle/main.go b/examples/go/daytona/lifecycle/close-daytona-handle/main.go similarity index 100% rename from examples/go/daytona/close-daytona-handle/main.go rename to examples/go/daytona/lifecycle/close-daytona-handle/main.go diff --git a/examples/go/daytona/delete-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/delete-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/delete-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/delete-daytona-sandbox/.env.example diff --git a/examples/go/daytona/delete-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/delete-daytona-sandbox/README.md similarity index 83% rename from examples/go/daytona/delete-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/delete-daytona-sandbox/README.md index 68caa15e..69861e24 100644 --- a/examples/go/daytona/delete-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/delete-daytona-sandbox/README.md @@ -18,7 +18,7 @@ result. ## Run ```sh -cd examples/go/daytona/delete-daytona-sandbox +cd examples/go/daytona/lifecycle/delete-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -43,6 +43,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/delete-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/delete-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/delete-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/delete-daytona-sandbox/go.mod new file mode 100644 index 00000000..b584d201 --- /dev/null +++ b/examples/go/daytona/lifecycle/delete-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/delete-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/stop-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/delete-daytona-sandbox/go.sum similarity index 100% rename from examples/go/daytona/stop-daytona-sandbox/go.sum rename to examples/go/daytona/lifecycle/delete-daytona-sandbox/go.sum diff --git a/examples/go/daytona/delete-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/delete-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/delete-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/delete-daytona-sandbox/main.go diff --git a/examples/go/daytona/force-stop-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/force-stop-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/force-stop-daytona-sandbox/.env.example diff --git a/examples/go/daytona/force-stop-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/README.md similarity index 83% rename from examples/go/daytona/force-stop-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/force-stop-daytona-sandbox/README.md index bbb2ebb6..cc9f47fd 100644 --- a/examples/go/daytona/force-stop-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/README.md @@ -17,7 +17,7 @@ the call timeout. ## Run ```sh -cd examples/go/daytona/force-stop-daytona-sandbox +cd examples/go/daytona/lifecycle/force-stop-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/force-stop-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/force-stop-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/go.mod new file mode 100644 index 00000000..5472cf62 --- /dev/null +++ b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/force-stop-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/force-stop-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/force-stop-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/force-stop-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/force-stop-daytona-sandbox/main.go diff --git a/examples/go/daytona/get-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/get-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/get-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/get-daytona-sandbox/.env.example diff --git a/examples/go/daytona/get-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/get-daytona-sandbox/README.md similarity index 84% rename from examples/go/daytona/get-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/get-daytona-sandbox/README.md index a54fb72b..59def8d1 100644 --- a/examples/go/daytona/get-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/get-daytona-sandbox/README.md @@ -18,7 +18,7 @@ Capabilities list the lifecycle methods Daytona implements. ## Run ```sh -cd examples/go/daytona/get-daytona-sandbox +cd examples/go/daytona/lifecycle/get-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/get-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/get-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/get-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/get-daytona-sandbox/go.mod new file mode 100644 index 00000000..5b3b1277 --- /dev/null +++ b/examples/go/daytona/lifecycle/get-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/get-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/get-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/get-daytona-sandbox/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/get-daytona-sandbox/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/get-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/get-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/get-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/get-daytona-sandbox/main.go diff --git a/examples/go/daytona/pause-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/pause-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/pause-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/pause-daytona-sandbox/.env.example diff --git a/examples/go/daytona/pause-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/pause-daytona-sandbox/README.md similarity index 82% rename from examples/go/daytona/pause-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/pause-daytona-sandbox/README.md index 06c5108b..b6a5acd1 100644 --- a/examples/go/daytona/pause-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/pause-daytona-sandbox/README.md @@ -17,7 +17,7 @@ sandbox. See Daytona's lifecycle docs under ## Run ```sh -cd examples/go/daytona/pause-daytona-sandbox +cd examples/go/daytona/lifecycle/pause-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/pause-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/pause-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/pause-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/pause-daytona-sandbox/go.mod new file mode 100644 index 00000000..b7d57bbc --- /dev/null +++ b/examples/go/daytona/lifecycle/pause-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/pause-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/pause-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/pause-daytona-sandbox/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/pause-daytona-sandbox/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/pause-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/pause-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/pause-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/pause-daytona-sandbox/main.go diff --git a/examples/go/daytona/refresh-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/refresh-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/refresh-daytona-sandbox/.env.example diff --git a/examples/go/daytona/refresh-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/README.md similarity index 82% rename from examples/go/daytona/refresh-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/refresh-daytona-sandbox/README.md index 40eeb84b..32462a77 100644 --- a/examples/go/daytona/refresh-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/README.md @@ -16,7 +16,7 @@ or delete the sandbox. Useful after another process may have changed state. ## Run ```sh -cd examples/go/daytona/refresh-daytona-sandbox +cd examples/go/daytona/lifecycle/refresh-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -40,6 +40,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/refresh-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/refresh-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/refresh-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/go.mod new file mode 100644 index 00000000..4405c55f --- /dev/null +++ b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/refresh-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/refresh-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/refresh-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/refresh-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/refresh-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/refresh-daytona-sandbox/main.go diff --git a/examples/go/daytona/request-daytona-deletion/.env.example b/examples/go/daytona/lifecycle/request-daytona-deletion/.env.example similarity index 100% rename from examples/go/daytona/request-daytona-deletion/.env.example rename to examples/go/daytona/lifecycle/request-daytona-deletion/.env.example diff --git a/examples/go/daytona/request-daytona-deletion/README.md b/examples/go/daytona/lifecycle/request-daytona-deletion/README.md similarity index 82% rename from examples/go/daytona/request-daytona-deletion/README.md rename to examples/go/daytona/lifecycle/request-daytona-deletion/README.md index cd3752d9..2b776791 100644 --- a/examples/go/daytona/request-daytona-deletion/README.md +++ b/examples/go/daytona/lifecycle/request-daytona-deletion/README.md @@ -16,7 +16,7 @@ handle stores the metadata from that response. ## Run ```sh -cd examples/go/daytona/request-daytona-deletion +cd examples/go/daytona/lifecycle/request-daytona-deletion cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/request-daytona-deletion/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/request-daytona-deletion/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/request-daytona-deletion/go.mod b/examples/go/daytona/lifecycle/request-daytona-deletion/go.mod new file mode 100644 index 00000000..a0785d6a --- /dev/null +++ b/examples/go/daytona/lifecycle/request-daytona-deletion/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/request-daytona-deletion + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/request-daytona-deletion/go.sum b/examples/go/daytona/lifecycle/request-daytona-deletion/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/request-daytona-deletion/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/request-daytona-deletion/main.go b/examples/go/daytona/lifecycle/request-daytona-deletion/main.go similarity index 100% rename from examples/go/daytona/request-daytona-deletion/main.go rename to examples/go/daytona/lifecycle/request-daytona-deletion/main.go diff --git a/examples/go/daytona/start-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/start-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/start-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/start-daytona-sandbox/.env.example diff --git a/examples/go/daytona/start-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/start-daytona-sandbox/README.md similarity index 83% rename from examples/go/daytona/start-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/start-daytona-sandbox/README.md index 7ae5c31a..57a9b498 100644 --- a/examples/go/daytona/start-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/start-daytona-sandbox/README.md @@ -17,7 +17,7 @@ can be started again. See [persistence](https://www.daytona.io/docs/en/persisten ## Run ```sh -cd examples/go/daytona/start-daytona-sandbox +cd examples/go/daytona/lifecycle/start-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/start-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/start-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/start-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/start-daytona-sandbox/go.mod new file mode 100644 index 00000000..9ae870ad --- /dev/null +++ b/examples/go/daytona/lifecycle/start-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/start-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/start-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/start-daytona-sandbox/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/start-daytona-sandbox/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/start-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/start-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/start-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/start-daytona-sandbox/main.go diff --git a/examples/go/daytona/start-daytona-with-timeout/.env.example b/examples/go/daytona/lifecycle/start-daytona-with-timeout/.env.example similarity index 100% rename from examples/go/daytona/start-daytona-with-timeout/.env.example rename to examples/go/daytona/lifecycle/start-daytona-with-timeout/.env.example diff --git a/examples/go/daytona/start-daytona-with-timeout/README.md b/examples/go/daytona/lifecycle/start-daytona-with-timeout/README.md similarity index 83% rename from examples/go/daytona/start-daytona-with-timeout/README.md rename to examples/go/daytona/lifecycle/start-daytona-with-timeout/README.md index 34913862..4f28b95e 100644 --- a/examples/go/daytona/start-daytona-with-timeout/README.md +++ b/examples/go/daytona/lifecycle/start-daytona-with-timeout/README.md @@ -17,7 +17,7 @@ uses and the start timeout Daytona receives, in whole seconds. ## Run ```sh -cd examples/go/daytona/start-daytona-with-timeout +cd examples/go/daytona/lifecycle/start-daytona-with-timeout cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/start-daytona-with-timeout/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/start-daytona-with-timeout/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/start-daytona-with-timeout/go.mod b/examples/go/daytona/lifecycle/start-daytona-with-timeout/go.mod new file mode 100644 index 00000000..22ed8f1c --- /dev/null +++ b/examples/go/daytona/lifecycle/start-daytona-with-timeout/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/start-daytona-with-timeout + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/start-daytona-with-timeout/go.sum b/examples/go/daytona/lifecycle/start-daytona-with-timeout/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/start-daytona-with-timeout/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/start-daytona-with-timeout/main.go b/examples/go/daytona/lifecycle/start-daytona-with-timeout/main.go similarity index 100% rename from examples/go/daytona/start-daytona-with-timeout/main.go rename to examples/go/daytona/lifecycle/start-daytona-with-timeout/main.go diff --git a/examples/go/daytona/stop-daytona-sandbox/.env.example b/examples/go/daytona/lifecycle/stop-daytona-sandbox/.env.example similarity index 100% rename from examples/go/daytona/stop-daytona-sandbox/.env.example rename to examples/go/daytona/lifecycle/stop-daytona-sandbox/.env.example diff --git a/examples/go/daytona/stop-daytona-sandbox/README.md b/examples/go/daytona/lifecycle/stop-daytona-sandbox/README.md similarity index 83% rename from examples/go/daytona/stop-daytona-sandbox/README.md rename to examples/go/daytona/lifecycle/stop-daytona-sandbox/README.md index 632dc271..ac520554 100644 --- a/examples/go/daytona/stop-daytona-sandbox/README.md +++ b/examples/go/daytona/lifecycle/stop-daytona-sandbox/README.md @@ -17,7 +17,7 @@ again. An ephemeral sandbox can be deleted by its policy. See ## Run ```sh -cd examples/go/daytona/stop-daytona-sandbox +cd examples/go/daytona/lifecycle/stop-daytona-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/daytona/stop-daytona-sandbox/README.md) +- [typescript twin](../../../../typescript/daytona/lifecycle/stop-daytona-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/daytona/lifecycle/stop-daytona-sandbox/go.mod b/examples/go/daytona/lifecycle/stop-daytona-sandbox/go.mod new file mode 100644 index 00000000..87ab68e9 --- /dev/null +++ b/examples/go/daytona/lifecycle/stop-daytona-sandbox/go.mod @@ -0,0 +1,71 @@ +module github.com/sandbox-kit/kit/examples/go/daytona/lifecycle/stop-daytona-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect + github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect + github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect + github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect + github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect + github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect + github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect + github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect + github.com/aws/smithy-go v1.28.5 // indirect + github.com/cenkalti/backoff/v5 v5.0.3 // indirect + github.com/cespare/xxhash/v2 v2.3.0 // indirect + github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect + github.com/daytona/clients/api-client-go v0.225.0 // indirect + github.com/daytona/clients/sdk-go v0.225.0 // indirect + github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect + github.com/go-logr/logr v1.4.4 // indirect + github.com/go-logr/stdr v1.2.2 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect + github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + go.opentelemetry.io/auto/sdk v1.2.1 // indirect + go.opentelemetry.io/otel v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect + go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect + go.opentelemetry.io/otel/log v1.47.0 // indirect + go.opentelemetry.io/otel/metric v1.47.0 // indirect + go.opentelemetry.io/otel/sdk v1.47.0 // indirect + go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect + go.opentelemetry.io/otel/trace v1.47.0 // indirect + go.opentelemetry.io/proto/otlp v1.11.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../../sdks/go/providers/daytona + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/lifecycle/stop-daytona-sandbox/go.sum b/examples/go/daytona/lifecycle/stop-daytona-sandbox/go.sum new file mode 100644 index 00000000..d0a9e0cd --- /dev/null +++ b/examples/go/daytona/lifecycle/stop-daytona-sandbox/go.sum @@ -0,0 +1,129 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aws/aws-sdk-go-v2 v1.47.3 h1:HRoT/MkNi3bjO5xF4dCzLzvVmkvRGHj3/cLINDnJejk= +github.com/aws/aws-sdk-go-v2 v1.47.3/go.mod h1:xSl+OSI5ZUw6bSMupWc218zE5Pl+65MCCu3ySWFY99A= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 h1:oiEmPz/YMMeh/JvAE8xSxNCIsvWE6lpFe4ZPlyFykQI= +github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22/go.mod h1:QWUDuRi9PFjBHIU2iH1Pkldbe7zqLfXJC4wWLbF8nuQ= +github.com/aws/aws-sdk-go-v2/config v1.33.9 h1:Hv6bcQUJVnmuWaKjqD6Ot8sE75NrWsWV20oGT5aWle0= +github.com/aws/aws-sdk-go-v2/config v1.33.9/go.mod h1:ivowmrZNfBQLcg4QkaItgi5wae4Bzot9RzIdbY1hfTg= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9 h1:SNO55PnWhaDafsOcv16lCA0kdoFMl/YlegWoVsU02s0= +github.com/aws/aws-sdk-go-v2/credentials v1.20.9/go.mod h1:+2reOTRtdD3VSBqpRDNwrZIYy8yMCYa7oK3WKTJ/I1I= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3 h1:gr3b87OLB29jymWPzp/CAyXwQRJVE+sC4Wm0qBIKHsk= +github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.20.3/go.mod h1:BRjf4L/Yx2hY54o+ZibPbLJyMMeSwqYQXwcJfqW66a8= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 h1:q9YuNkYR/7lxflWCcEv3C0cecUt3Zvrh2hn9ZNxieNA= +github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16/go.mod h1:3BSeJQF55QQI+dDFHx4WTIjTvX/Lvtk8Jaaf/SGAnBM= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 h1:CqL8NN3p4I0JTwwV5MEoatIl4Y2amZ2X9dRD+0hbRL0= +github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6/go.mod h1:exdJ32hMqXl0Wyo6NwqEC5yIhtua3+PDaKE8P29m4qE= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 h1:FpBq24TG6WVSObTNhQOv7Q0088rounUUlwn3zlNItkM= +github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6/go.mod h1:ONzdPVYC95oBOu0VWNEsKEntcoemP3xVKjT+qWml1s4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 h1:Qmn60RWuk9+bd2ddvJJqwf3Cpac3VvGMOdbGemtUhX4= +github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6/go.mod h1:h/YJhe4AVyQxEUMluph10iqV7mjajH7A9L+BHF5ppis= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 h1:e6YW5uME30TkrElR+4/xcY7NB6CCj2dcv7vtmGXhfhQ= +github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21/go.mod h1:obpHAMP693+f3/A8PkLhIqfK1C+NWWn8zXzqD3OH520= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 h1:CwvFlKw0uUScfgOMflXSRZa+ayXgOf6wk7lhyMemQYU= +github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7/go.mod h1:4SbD8BB+p+QEnG0aX6DoWwrtk9SufyYXRsUv0nve8LE= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 h1:LHHdobjo5le1sjJdolitV7uVvYg3wkaeM1Ju2fDgeZQ= +github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6/go.mod h1:CBGB0evAiaMD3Lk4wPO7LQCcCZLuhzL5Qf/wfEUHQ5w= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 h1:mYViDr2azcgxOpRrObZOl631bvavqILoE/L+Kxgbwys= +github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6/go.mod h1:OXVdAo9jNhggB+hJRGOyy7WolGTKB6Rg7IIulDeSzPM= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 h1:NyeuyXkZL476uoAowNActm4XJO1QPKf7aassgXHpiqA= +github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3/go.mod h1:GfoBeKMDJecgRUsGf/0RGdx0NJAh81ObTd922h8pQys= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4 h1:tvpDjuUvgKURf3Yk4hOaGbZ4QdY+070OWcA5d6LUv2A= +github.com/aws/aws-sdk-go-v2/service/signin v1.10.4/go.mod h1:3ibVKg5Ng82Zby8++jELTD2nHxiPk2DJRLEeW/LKp8M= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4 h1:ChCtagixSFOxltv0o6E3NT8F7ksvZtZGPwUBynO5Nmk= +github.com/aws/aws-sdk-go-v2/service/sso v1.38.4/go.mod h1:+FEO9jrVMpc9oN3CdAxJbtlQEu3z8UddDPSedpeM3PY= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4 h1:j6c+HA4AoS0EBEjArPjavFEBrucJEryfrQU0TffmACk= +github.com/aws/aws-sdk-go-v2/service/ssooidc v1.43.4/go.mod h1:RhghaXUk9q66VtOQUX1FdPddQuHnqQZzbB0fEYXmPRA= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4 h1:OKEfbf2tcfsF2pBk/S9QqNpo6alaAtiBs4hysCsBjPw= +github.com/aws/aws-sdk-go-v2/service/sts v1.51.4/go.mod h1:mCd6qGo9b8hTtfjgsmNkFlzwjyce4owd7HDVFnCLXhM= +github.com/aws/smithy-go v1.28.5 h1:OqbqKtzY9NUnr2yAe9+hiTdFb20tNaK/lI0PMOGXX9k= +github.com/aws/smithy-go v1.28.5/go.mod h1:YE2RhdIuDbA5E5bTdciG9KrW3+TiEONeUWCqxX9i1Fc= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= +github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 h1:vlfG6CqZ0wLdks8dzvNtuo8mBADO/RL0q5J2tseEI4s= +github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5/go.mod h1:+kRgiUXoVO3BX/VzeNadSCTXPXElAkPk1pNk1haKIDw= +github.com/daytona/clients/api-client-go v0.225.0 h1:C4Ucqync8uhSYkn6uVM7GJ2/O1rGWtJY9F916RRxGXg= +github.com/daytona/clients/api-client-go v0.225.0/go.mod h1:US+IQTDTZam9c4UpPMB3WDYYMIyWSKlgfDZzwWffY94= +github.com/daytona/clients/sdk-go v0.225.0 h1:C0zGXGtwYczb1b/MrX/Tc8YLQJuLQaztnu+u7Tz7i74= +github.com/daytona/clients/sdk-go v0.225.0/go.mod h1:TodsNlnrGObpupcLuxGl2F+kp7yyoFUTBt/CFaLJyqQ= +github.com/daytona/clients/toolbox-api-client-go v0.225.0 h1:tNrV4+lo970ZrNXdOVCR3yxpvRSh9LZL8OtzFupOkDs= +github.com/daytona/clients/toolbox-api-client-go v0.225.0/go.mod h1:lwZA3j823fNNiAgTSMThjZkYWegIigoFIREAtdo7o3E= +github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= +github.com/go-logr/logr v1.4.4 h1:tG4xh9yMsRCAiodLVTxyrkzSZ9+o0L1Kg/+cPVcbP/8= +github.com/go-logr/logr v1.4.4/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 h1:JeSE6pjso5THxAzdVpqr6/geYxZytqFMBCOtn/ujyeo= +github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674/go.mod h1:r4w70xmWCQKmi1ONH4KIaBptdivuRPyosB9RmPlGEwA= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 h1:/Tnpcb2E0Pz/tN9s3bfEY2Q8ePCEX9iuS+cneUwncnw= +github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0/go.mod h1:zOBXOsUaBSjKgmH4OGzV1esUpR3oUSCPYVd2cUBjKYY= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.47.0 h1:j7ALJ/zgkS7Z6aeJW09p8VC9804bC+PpeTfCD4XPnOM= +go.opentelemetry.io/otel v1.47.0/go.mod h1:8wS9O2qfXrYrzp6hIF/HOYJJf/wIhFPhR2xLuP+iXQU= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 h1:7kszRN4Ze5GeAkUnBjBSUIunVBMA+mZIG04auueqguM= +go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0/go.mod h1:CLzakYy8jOdkBfcveCWYkeKJxujcF4xPhh2Z7IfE98U= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 h1:julhjPeUH/q/7hinbSdDdqt5h7Zw9YWmRlWRhI0jd54= +go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0/go.mod h1:Ao2mz688LH/tFf0yMAenidq6k2YNSx6SIY2q6jDACck= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 h1:aXZXsZ012wOgVkqaiQv+Z/d8V0xKjmg70F6m4CE94lc= +go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0/go.mod h1:ziu1gUIJhAaxM3EV1e3Ralk5AAyL1UOYz3lJJ4VSI38= +go.opentelemetry.io/otel/log v1.47.0 h1:cOTS1CcLbSQeZKanGJ+0JpF/+t4PELi3O3bbl2lqCcI= +go.opentelemetry.io/otel/log v1.47.0/go.mod h1:9byitSQ5pLC6PpqwGXjqdMKya6ZTswHRZh2vvXT33nw= +go.opentelemetry.io/otel/metric v1.47.0 h1:4PptaldXx3Eat1XjMZ68pPJEs5wrhlemctZE9a3UdWY= +go.opentelemetry.io/otel/metric v1.47.0/go.mod h1:ADGSXxRrXM6bjbvLo535EstVFlPpPYZm4LBKixjDHwU= +go.opentelemetry.io/otel/metric/x v0.69.0 h1:DjRLr15H83v+hCW7JA9NoJvOkYTtmq5YoDRbe9deYpM= +go.opentelemetry.io/otel/metric/x v0.69.0/go.mod h1:uVvsMPMFFyj/HUQfrUnH3JjnOQ1dwFDorgFLRBasM0k= +go.opentelemetry.io/otel/sdk v1.47.0 h1:zWXEr4j2lFefG87TU6Yg8a7ngfohIKFZHKp0Hf5hC6I= +go.opentelemetry.io/otel/sdk v1.47.0/go.mod h1:VUc24kiOeoGsxG8G9ULx3fWKvB7jMhnGE8Oi607lgR0= +go.opentelemetry.io/otel/sdk/metric v1.47.0 h1:lfISg2j93VT6yqdk9OfUaZmw/GfcZqCCV3jdXtsPnKw= +go.opentelemetry.io/otel/sdk/metric v1.47.0/go.mod h1:ypLp+mW1Nt2x+Szt3b5/i1syodyts49lMOwxpDI3VGw= +go.opentelemetry.io/otel/trace v1.47.0 h1:JOjX/Oci8K94QHddo+bbfya/Ai/nf6/dt9ZfrFNWSrM= +go.opentelemetry.io/otel/trace v1.47.0/go.mod h1:jNaSLa2PZEYFG6fRjJABAu+bw4FS08uDmPg28lTghu0= +go.opentelemetry.io/proto/otlp v1.11.0 h1:5rrYs0Ykyj50sdU/JU0x8etU+LubXWb+gED6TbEdMIk= +go.opentelemetry.io/proto/otlp v1.11.0/go.mod h1:SmVizdCOAm3XBtG1g1NnOdhW6jtddT72hLMhv8VwA8E= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc h1:rZHRz0ogq4Pid1IKtA/ivHi8XONVF5tqUQXA2TtgpkE= +google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:K/n0XLazCJHjD73YuMyNJsN38BPPy1kfFnKxUXaThFU= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc h1:4bNTbnb44EqGVy9HaQxSY2jnafSUdgV3qHtedvNpDKg= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc/go.mod h1:OaIUM3+LpYcK2GXM4FTmhWoIq371Owdr+Cc7/BsYHHc= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/daytona/stop-daytona-sandbox/main.go b/examples/go/daytona/lifecycle/stop-daytona-sandbox/main.go similarity index 100% rename from examples/go/daytona/stop-daytona-sandbox/main.go rename to examples/go/daytona/lifecycle/stop-daytona-sandbox/main.go diff --git a/examples/go/daytona/pause-daytona-sandbox/go.mod b/examples/go/daytona/pause-daytona-sandbox/go.mod deleted file mode 100644 index 97ddc059..00000000 --- a/examples/go/daytona/pause-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/pause-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/refresh-daytona-sandbox/go.mod b/examples/go/daytona/refresh-daytona-sandbox/go.mod deleted file mode 100644 index 16057578..00000000 --- a/examples/go/daytona/refresh-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/refresh-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/request-daytona-deletion/go.mod b/examples/go/daytona/request-daytona-deletion/go.mod deleted file mode 100644 index 46029346..00000000 --- a/examples/go/daytona/request-daytona-deletion/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/request-daytona-deletion - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/start-daytona-sandbox/go.mod b/examples/go/daytona/start-daytona-sandbox/go.mod deleted file mode 100644 index afe74d6d..00000000 --- a/examples/go/daytona/start-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/start-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/start-daytona-with-timeout/go.mod b/examples/go/daytona/start-daytona-with-timeout/go.mod deleted file mode 100644 index 723991e7..00000000 --- a/examples/go/daytona/start-daytona-with-timeout/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/start-daytona-with-timeout - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/daytona/stop-daytona-sandbox/go.mod b/examples/go/daytona/stop-daytona-sandbox/go.mod deleted file mode 100644 index 452e4f78..00000000 --- a/examples/go/daytona/stop-daytona-sandbox/go.mod +++ /dev/null @@ -1,71 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/daytona/stop-daytona-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/daytona v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aws/aws-sdk-go-v2 v1.47.3 // indirect - github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.7.22 // indirect - github.com/aws/aws-sdk-go-v2/credentials v1.20.9 // indirect - github.com/aws/aws-sdk-go-v2/feature/s3/transfermanager v0.4.16 // indirect - github.com/aws/aws-sdk-go-v2/internal/configsources v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.8.6 // indirect - github.com/aws/aws-sdk-go-v2/internal/v4a v1.5.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.21 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.11.7 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.14.6 // indirect - github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.20.6 // indirect - github.com/aws/aws-sdk-go-v2/service/s3 v1.114.3 // indirect - github.com/aws/smithy-go v1.28.5 // indirect - github.com/cenkalti/backoff/v5 v5.0.3 // indirect - github.com/cespare/xxhash/v2 v2.3.0 // indirect - github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/api-client-go v0.225.0 // indirect - github.com/daytona/clients/sdk-go v0.225.0 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect - github.com/go-logr/logr v1.4.4 // indirect - github.com/go-logr/stdr v1.2.2 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/gorilla/websocket v1.5.4-0.20250319132907-e064f32e3674 // indirect - github.com/grpc-ecosystem/grpc-gateway/v2 v2.30.0 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - go.opentelemetry.io/auto/sdk v1.2.1 // indirect - go.opentelemetry.io/otel v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.47.0 // indirect - go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.47.0 // indirect - go.opentelemetry.io/otel/log v1.47.0 // indirect - go.opentelemetry.io/otel/metric v1.47.0 // indirect - go.opentelemetry.io/otel/sdk v1.47.0 // indirect - go.opentelemetry.io/otel/sdk/metric v1.47.0 // indirect - go.opentelemetry.io/otel/trace v1.47.0 // indirect - go.opentelemetry.io/proto/otlp v1.11.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260928230214-8a89bd6388cc // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/daytona => ../../../../sdks/go/providers/daytona - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-client-timeout/.env.example b/examples/go/modal/configuration/create-modal-client-timeout/.env.example similarity index 100% rename from examples/go/modal/create-modal-client-timeout/.env.example rename to examples/go/modal/configuration/create-modal-client-timeout/.env.example diff --git a/examples/go/modal/create-modal-client-timeout/README.md b/examples/go/modal/configuration/create-modal-client-timeout/README.md similarity index 82% rename from examples/go/modal/create-modal-client-timeout/README.md rename to examples/go/modal/configuration/create-modal-client-timeout/README.md index 150b3649..2d61c555 100644 --- a/examples/go/modal/create-modal-client-timeout/README.md +++ b/examples/go/modal/configuration/create-modal-client-timeout/README.md @@ -17,7 +17,7 @@ passes. ## Run ```sh -cd examples/go/modal/create-modal-client-timeout +cd examples/go/modal/configuration/create-modal-client-timeout cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-client-timeout/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-client-timeout/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-client-timeout/go.mod b/examples/go/modal/configuration/create-modal-client-timeout/go.mod new file mode 100644 index 00000000..08c76b53 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-client-timeout/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-client-timeout + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/attach-modal-sandbox/go.sum b/examples/go/modal/configuration/create-modal-client-timeout/go.sum similarity index 100% rename from examples/go/modal/attach-modal-sandbox/go.sum rename to examples/go/modal/configuration/create-modal-client-timeout/go.sum diff --git a/examples/go/modal/create-modal-client-timeout/main.go b/examples/go/modal/configuration/create-modal-client-timeout/main.go similarity index 100% rename from examples/go/modal/create-modal-client-timeout/main.go rename to examples/go/modal/configuration/create-modal-client-timeout/main.go diff --git a/examples/go/modal/create-modal-gvisor/.env.example b/examples/go/modal/configuration/create-modal-gvisor/.env.example similarity index 100% rename from examples/go/modal/create-modal-gvisor/.env.example rename to examples/go/modal/configuration/create-modal-gvisor/.env.example diff --git a/examples/go/modal/create-modal-gvisor/README.md b/examples/go/modal/configuration/create-modal-gvisor/README.md similarity index 83% rename from examples/go/modal/create-modal-gvisor/README.md rename to examples/go/modal/configuration/create-modal-gvisor/README.md index fb1d081e..c23f76fa 100644 --- a/examples/go/modal/create-modal-gvisor/README.md +++ b/examples/go/modal/configuration/create-modal-gvisor/README.md @@ -16,7 +16,7 @@ the gVisor runtime. See [Sandboxes](https://modal.com/docs/guide/sandboxes) and ## Run ```sh -cd examples/go/modal/create-modal-gvisor +cd examples/go/modal/configuration/create-modal-gvisor cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-gvisor/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-gvisor/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/create-modal-ready/go.mod b/examples/go/modal/configuration/create-modal-gvisor/go.mod similarity index 90% rename from examples/go/modal/create-modal-ready/go.mod rename to examples/go/modal/configuration/create-modal-gvisor/go.mod index 4efab3e6..ddff9dc3 100644 --- a/examples/go/modal/create-modal-ready/go.mod +++ b/examples/go/modal/configuration/create-modal-gvisor/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-ready +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-gvisor go 1.26.0 @@ -39,10 +39,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-gvisor/go.sum b/examples/go/modal/configuration/create-modal-gvisor/go.sum similarity index 100% rename from examples/go/modal/create-modal-gvisor/go.sum rename to examples/go/modal/configuration/create-modal-gvisor/go.sum diff --git a/examples/go/modal/create-modal-gvisor/main.go b/examples/go/modal/configuration/create-modal-gvisor/main.go similarity index 100% rename from examples/go/modal/create-modal-gvisor/main.go rename to examples/go/modal/configuration/create-modal-gvisor/main.go diff --git a/examples/go/modal/create-modal-idle/.env.example b/examples/go/modal/configuration/create-modal-idle/.env.example similarity index 100% rename from examples/go/modal/create-modal-idle/.env.example rename to examples/go/modal/configuration/create-modal-idle/.env.example diff --git a/examples/go/modal/create-modal-idle/README.md b/examples/go/modal/configuration/create-modal-idle/README.md similarity index 84% rename from examples/go/modal/create-modal-idle/README.md rename to examples/go/modal/configuration/create-modal-idle/README.md index 110e5971..bceedd2e 100644 --- a/examples/go/modal/create-modal-idle/README.md +++ b/examples/go/modal/configuration/create-modal-idle/README.md @@ -18,7 +18,7 @@ lifetime `timeout`. See ## Run ```sh -cd examples/go/modal/create-modal-idle +cd examples/go/modal/configuration/create-modal-idle cp .env.example .env # Fill in the values below, then: go run . @@ -43,6 +43,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-idle/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-idle/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/create-modal-idle/go.mod b/examples/go/modal/configuration/create-modal-idle/go.mod similarity index 90% rename from examples/go/modal/create-modal-idle/go.mod rename to examples/go/modal/configuration/create-modal-idle/go.mod index 41d1ba1d..e9f3e4f1 100644 --- a/examples/go/modal/create-modal-idle/go.mod +++ b/examples/go/modal/configuration/create-modal-idle/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-idle +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-idle go 1.26.0 @@ -39,10 +39,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-idle/go.sum b/examples/go/modal/configuration/create-modal-idle/go.sum similarity index 100% rename from examples/go/modal/create-modal-idle/go.sum rename to examples/go/modal/configuration/create-modal-idle/go.sum diff --git a/examples/go/modal/create-modal-idle/main.go b/examples/go/modal/configuration/create-modal-idle/main.go similarity index 100% rename from examples/go/modal/create-modal-idle/main.go rename to examples/go/modal/configuration/create-modal-idle/main.go diff --git a/examples/go/modal/create-modal-linux-vm/.env.example b/examples/go/modal/configuration/create-modal-linux-vm/.env.example similarity index 100% rename from examples/go/modal/create-modal-linux-vm/.env.example rename to examples/go/modal/configuration/create-modal-linux-vm/.env.example diff --git a/examples/go/modal/create-modal-linux-vm/README.md b/examples/go/modal/configuration/create-modal-linux-vm/README.md similarity index 81% rename from examples/go/modal/create-modal-linux-vm/README.md rename to examples/go/modal/configuration/create-modal-linux-vm/README.md index f605f744..5dae62e3 100644 --- a/examples/go/modal/create-modal-linux-vm/README.md +++ b/examples/go/modal/configuration/create-modal-linux-vm/README.md @@ -16,7 +16,7 @@ docs. ## Run ```sh -cd examples/go/modal/create-modal-linux-vm +cd examples/go/modal/configuration/create-modal-linux-vm cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-linux-vm/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-linux-vm/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-linux-vm/go.mod b/examples/go/modal/configuration/create-modal-linux-vm/go.mod new file mode 100644 index 00000000..6bf609ee --- /dev/null +++ b/examples/go/modal/configuration/create-modal-linux-vm/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-linux-vm + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-linux-vm/go.sum b/examples/go/modal/configuration/create-modal-linux-vm/go.sum similarity index 100% rename from examples/go/modal/create-modal-linux-vm/go.sum rename to examples/go/modal/configuration/create-modal-linux-vm/go.sum diff --git a/examples/go/modal/create-modal-linux-vm/main.go b/examples/go/modal/configuration/create-modal-linux-vm/main.go similarity index 100% rename from examples/go/modal/create-modal-linux-vm/main.go rename to examples/go/modal/configuration/create-modal-linux-vm/main.go diff --git a/examples/go/modal/create-modal-ready/.env.example b/examples/go/modal/configuration/create-modal-ready/.env.example similarity index 100% rename from examples/go/modal/create-modal-ready/.env.example rename to examples/go/modal/configuration/create-modal-ready/.env.example diff --git a/examples/go/modal/create-modal-ready/README.md b/examples/go/modal/configuration/create-modal-ready/README.md similarity index 86% rename from examples/go/modal/create-modal-ready/README.md rename to examples/go/modal/configuration/create-modal-ready/README.md index 12a4dc07..743d91b5 100644 --- a/examples/go/modal/create-modal-ready/README.md +++ b/examples/go/modal/configuration/create-modal-ready/README.md @@ -22,7 +22,7 @@ Kit requires a probe and a positive create timeout for ready wait. ## Run ```sh -cd examples/go/modal/create-modal-ready +cd examples/go/modal/configuration/create-modal-ready cp .env.example .env # Fill in the values below, then: go run . @@ -47,6 +47,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-ready/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-ready/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/create-modal-linux-vm/go.mod b/examples/go/modal/configuration/create-modal-ready/go.mod similarity index 90% rename from examples/go/modal/create-modal-linux-vm/go.mod rename to examples/go/modal/configuration/create-modal-ready/go.mod index f3b3050b..6c41dac0 100644 --- a/examples/go/modal/create-modal-linux-vm/go.mod +++ b/examples/go/modal/configuration/create-modal-ready/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-linux-vm +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-ready go 1.26.0 @@ -39,10 +39,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-ready/go.sum b/examples/go/modal/configuration/create-modal-ready/go.sum similarity index 100% rename from examples/go/modal/create-modal-ready/go.sum rename to examples/go/modal/configuration/create-modal-ready/go.sum diff --git a/examples/go/modal/create-modal-ready/main.go b/examples/go/modal/configuration/create-modal-ready/main.go similarity index 100% rename from examples/go/modal/create-modal-ready/main.go rename to examples/go/modal/configuration/create-modal-ready/main.go diff --git a/examples/go/modal/create-modal-sandbox/.env.example b/examples/go/modal/configuration/create-modal-sandbox/.env.example similarity index 100% rename from examples/go/modal/create-modal-sandbox/.env.example rename to examples/go/modal/configuration/create-modal-sandbox/.env.example diff --git a/examples/go/modal/create-modal-sandbox/README.md b/examples/go/modal/configuration/create-modal-sandbox/README.md similarity index 90% rename from examples/go/modal/create-modal-sandbox/README.md rename to examples/go/modal/configuration/create-modal-sandbox/README.md index 826d64a8..0fce045c 100644 --- a/examples/go/modal/create-modal-sandbox/README.md +++ b/examples/go/modal/configuration/create-modal-sandbox/README.md @@ -25,7 +25,7 @@ timeouts or a terminate example. ## Run ```sh -cd examples/go/modal/create-modal-sandbox +cd examples/go/modal/configuration/create-modal-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -65,6 +65,6 @@ Set `MODAL_APP_NAME=sandbox-kit-example` in `.env`. See ## Related -- [typescript twin](../../../typescript/modal/create-modal-sandbox/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-sandbox/go.mod b/examples/go/modal/configuration/create-modal-sandbox/go.mod new file mode 100644 index 00000000..dfc1206e --- /dev/null +++ b/examples/go/modal/configuration/create-modal-sandbox/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-sandbox/go.sum b/examples/go/modal/configuration/create-modal-sandbox/go.sum similarity index 100% rename from examples/go/modal/create-modal-sandbox/go.sum rename to examples/go/modal/configuration/create-modal-sandbox/go.sum diff --git a/examples/go/modal/create-modal-sandbox/main.go b/examples/go/modal/configuration/create-modal-sandbox/main.go similarity index 100% rename from examples/go/modal/create-modal-sandbox/main.go rename to examples/go/modal/configuration/create-modal-sandbox/main.go diff --git a/examples/go/modal/create-modal-tcp-ready/.env.example b/examples/go/modal/configuration/create-modal-tcp-ready/.env.example similarity index 100% rename from examples/go/modal/create-modal-tcp-ready/.env.example rename to examples/go/modal/configuration/create-modal-tcp-ready/.env.example diff --git a/examples/go/modal/create-modal-tcp-ready/README.md b/examples/go/modal/configuration/create-modal-tcp-ready/README.md similarity index 81% rename from examples/go/modal/create-modal-tcp-ready/README.md rename to examples/go/modal/configuration/create-modal-tcp-ready/README.md index db3f0403..9b1c881a 100644 --- a/examples/go/modal/create-modal-tcp-ready/README.md +++ b/examples/go/modal/configuration/create-modal-tcp-ready/README.md @@ -16,7 +16,7 @@ entrypoint runs `nc -l -p 8080` so the probe can succeed. ## Run ```sh -cd examples/go/modal/create-modal-tcp-ready +cd examples/go/modal/configuration/create-modal-tcp-ready cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-tcp-ready/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-tcp-ready/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-tcp-ready/go.mod b/examples/go/modal/configuration/create-modal-tcp-ready/go.mod new file mode 100644 index 00000000..6bb9f703 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-tcp-ready/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-tcp-ready + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/close-modal-handle/go.sum b/examples/go/modal/configuration/create-modal-tcp-ready/go.sum similarity index 100% rename from examples/go/modal/close-modal-handle/go.sum rename to examples/go/modal/configuration/create-modal-tcp-ready/go.sum diff --git a/examples/go/modal/create-modal-tcp-ready/main.go b/examples/go/modal/configuration/create-modal-tcp-ready/main.go similarity index 100% rename from examples/go/modal/create-modal-tcp-ready/main.go rename to examples/go/modal/configuration/create-modal-tcp-ready/main.go diff --git a/examples/go/modal/create-modal-verbose/.env.example b/examples/go/modal/configuration/create-modal-verbose/.env.example similarity index 100% rename from examples/go/modal/create-modal-verbose/.env.example rename to examples/go/modal/configuration/create-modal-verbose/.env.example diff --git a/examples/go/modal/create-modal-verbose/README.md b/examples/go/modal/configuration/create-modal-verbose/README.md similarity index 80% rename from examples/go/modal/create-modal-verbose/README.md rename to examples/go/modal/configuration/create-modal-verbose/README.md index 98628c3d..c979eb92 100644 --- a/examples/go/modal/create-modal-verbose/README.md +++ b/examples/go/modal/configuration/create-modal-verbose/README.md @@ -15,7 +15,7 @@ detail in logs/UI for debugging. ## Run ```sh -cd examples/go/modal/create-modal-verbose +cd examples/go/modal/configuration/create-modal-verbose cp .env.example .env # Fill in the values below, then: go run . @@ -40,6 +40,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-verbose/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-verbose/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-verbose/go.mod b/examples/go/modal/configuration/create-modal-verbose/go.mod new file mode 100644 index 00000000..89705f91 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-verbose/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-verbose + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-verbose/go.sum b/examples/go/modal/configuration/create-modal-verbose/go.sum similarity index 100% rename from examples/go/modal/create-modal-verbose/go.sum rename to examples/go/modal/configuration/create-modal-verbose/go.sum diff --git a/examples/go/modal/create-modal-verbose/main.go b/examples/go/modal/configuration/create-modal-verbose/main.go similarity index 100% rename from examples/go/modal/create-modal-verbose/main.go rename to examples/go/modal/configuration/create-modal-verbose/main.go diff --git a/examples/go/modal/create-modal-with-allowlists/.env.example b/examples/go/modal/configuration/create-modal-with-allowlists/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-allowlists/.env.example rename to examples/go/modal/configuration/create-modal-with-allowlists/.env.example diff --git a/examples/go/modal/create-modal-with-allowlists/README.md b/examples/go/modal/configuration/create-modal-with-allowlists/README.md similarity index 79% rename from examples/go/modal/create-modal-with-allowlists/README.md rename to examples/go/modal/configuration/create-modal-with-allowlists/README.md index 421ac432..d116c592 100644 --- a/examples/go/modal/create-modal-with-allowlists/README.md +++ b/examples/go/modal/configuration/create-modal-with-allowlists/README.md @@ -15,7 +15,7 @@ The request limits outbound traffic and turns on Modal private networking. ## Run ```sh -cd examples/go/modal/create-modal-with-allowlists +cd examples/go/modal/configuration/create-modal-with-allowlists cp .env.example .env # Fill in the values below, then: go run . @@ -40,6 +40,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-allowlists/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-allowlists/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-allowlists/go.mod b/examples/go/modal/configuration/create-modal-with-allowlists/go.mod new file mode 100644 index 00000000..31313c70 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-allowlists/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-allowlists + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-client-timeout/go.sum b/examples/go/modal/configuration/create-modal-with-allowlists/go.sum similarity index 100% rename from examples/go/modal/create-modal-client-timeout/go.sum rename to examples/go/modal/configuration/create-modal-with-allowlists/go.sum diff --git a/examples/go/modal/create-modal-with-allowlists/main.go b/examples/go/modal/configuration/create-modal-with-allowlists/main.go similarity index 100% rename from examples/go/modal/create-modal-with-allowlists/main.go rename to examples/go/modal/configuration/create-modal-with-allowlists/main.go diff --git a/examples/go/modal/create-modal-with-identity/.env.example b/examples/go/modal/configuration/create-modal-with-identity/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-identity/.env.example rename to examples/go/modal/configuration/create-modal-with-identity/.env.example diff --git a/examples/go/modal/create-modal-with-identity/README.md b/examples/go/modal/configuration/create-modal-with-identity/README.md similarity index 81% rename from examples/go/modal/create-modal-with-identity/README.md rename to examples/go/modal/configuration/create-modal-with-identity/README.md index f989cf35..25f0188c 100644 --- a/examples/go/modal/create-modal-with-identity/README.md +++ b/examples/go/modal/configuration/create-modal-with-identity/README.md @@ -16,7 +16,7 @@ authenticate to identity-aware APIs. Kit client auth still uses your ## Run ```sh -cd examples/go/modal/create-modal-with-identity +cd examples/go/modal/configuration/create-modal-with-identity cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-identity/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-identity/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-identity/go.mod b/examples/go/modal/configuration/create-modal-with-identity/go.mod new file mode 100644 index 00000000..bd249e42 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-identity/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-identity + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-identity/go.sum b/examples/go/modal/configuration/create-modal-with-identity/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-identity/go.sum rename to examples/go/modal/configuration/create-modal-with-identity/go.sum diff --git a/examples/go/modal/create-modal-with-identity/main.go b/examples/go/modal/configuration/create-modal-with-identity/main.go similarity index 100% rename from examples/go/modal/create-modal-with-identity/main.go rename to examples/go/modal/configuration/create-modal-with-identity/main.go diff --git a/examples/go/modal/create-modal-with-labels/.env.example b/examples/go/modal/configuration/create-modal-with-labels/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-labels/.env.example rename to examples/go/modal/configuration/create-modal-with-labels/.env.example diff --git a/examples/go/modal/create-modal-with-labels/README.md b/examples/go/modal/configuration/create-modal-with-labels/README.md similarity index 82% rename from examples/go/modal/create-modal-with-labels/README.md rename to examples/go/modal/configuration/create-modal-with-labels/README.md index 1d4861ee..643ffd05 100644 --- a/examples/go/modal/create-modal-with-labels/README.md +++ b/examples/go/modal/configuration/create-modal-with-labels/README.md @@ -16,7 +16,7 @@ when mapping. ## Run ```sh -cd examples/go/modal/create-modal-with-labels +cd examples/go/modal/configuration/create-modal-with-labels cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-labels/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-labels/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-labels/go.mod b/examples/go/modal/configuration/create-modal-with-labels/go.mod new file mode 100644 index 00000000..597d77fb --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-labels/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-labels + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-labels/go.sum b/examples/go/modal/configuration/create-modal-with-labels/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-labels/go.sum rename to examples/go/modal/configuration/create-modal-with-labels/go.sum diff --git a/examples/go/modal/create-modal-with-labels/main.go b/examples/go/modal/configuration/create-modal-with-labels/main.go similarity index 100% rename from examples/go/modal/create-modal-with-labels/main.go rename to examples/go/modal/configuration/create-modal-with-labels/main.go diff --git a/examples/go/modal/create-modal-with-network/.env.example b/examples/go/modal/configuration/create-modal-with-network/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-network/.env.example rename to examples/go/modal/configuration/create-modal-with-network/.env.example diff --git a/examples/go/modal/create-modal-with-network/README.md b/examples/go/modal/configuration/create-modal-with-network/README.md similarity index 84% rename from examples/go/modal/create-modal-with-network/README.md rename to examples/go/modal/configuration/create-modal-with-network/README.md index 1b9a767f..95cd8c1e 100644 --- a/examples/go/modal/create-modal-with-network/README.md +++ b/examples/go/modal/configuration/create-modal-with-network/README.md @@ -18,7 +18,7 @@ outbound traffic can be routed through that proxy. The proxy must already exist. ## Run ```sh -cd examples/go/modal/create-modal-with-network +cd examples/go/modal/configuration/create-modal-with-network cp .env.example .env # Fill in the values below, then: go run . @@ -45,6 +45,6 @@ Required: `MODAL_PROXY_NAME` (existing proxy in the environment). ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-network/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-network/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-network/go.mod b/examples/go/modal/configuration/create-modal-with-network/go.mod new file mode 100644 index 00000000..62b2b2b9 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-network/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-network + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-network/go.sum b/examples/go/modal/configuration/create-modal-with-network/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-network/go.sum rename to examples/go/modal/configuration/create-modal-with-network/go.sum diff --git a/examples/go/modal/create-modal-with-network/main.go b/examples/go/modal/configuration/create-modal-with-network/main.go similarity index 100% rename from examples/go/modal/create-modal-with-network/main.go rename to examples/go/modal/configuration/create-modal-with-network/main.go diff --git a/examples/go/modal/create-modal-with-placement/.env.example b/examples/go/modal/configuration/create-modal-with-placement/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-placement/.env.example rename to examples/go/modal/configuration/create-modal-with-placement/.env.example diff --git a/examples/go/modal/create-modal-with-placement/README.md b/examples/go/modal/configuration/create-modal-with-placement/README.md similarity index 83% rename from examples/go/modal/create-modal-with-placement/README.md rename to examples/go/modal/configuration/create-modal-with-placement/README.md index f6f6259b..eb60f9e5 100644 --- a/examples/go/modal/create-modal-with-placement/README.md +++ b/examples/go/modal/configuration/create-modal-with-placement/README.md @@ -17,7 +17,7 @@ in Kit checks include `aws`, `gcp`, `oci`, and `auto`. See ## Run ```sh -cd examples/go/modal/create-modal-with-placement +cd examples/go/modal/configuration/create-modal-with-placement cp .env.example .env # Fill in the values below, then: go run . @@ -44,6 +44,6 @@ Optional: `MODAL_CLOUD` (default `auto`), `MODAL_REGION`. ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-placement/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-placement/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-placement/go.mod b/examples/go/modal/configuration/create-modal-with-placement/go.mod new file mode 100644 index 00000000..e7fb6d50 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-placement/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-placement + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-placement/go.sum b/examples/go/modal/configuration/create-modal-with-placement/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-placement/go.sum rename to examples/go/modal/configuration/create-modal-with-placement/go.sum diff --git a/examples/go/modal/create-modal-with-placement/main.go b/examples/go/modal/configuration/create-modal-with-placement/main.go similarity index 100% rename from examples/go/modal/create-modal-with-placement/main.go rename to examples/go/modal/configuration/create-modal-with-placement/main.go diff --git a/examples/go/modal/create-modal-with-ports/.env.example b/examples/go/modal/configuration/create-modal-with-ports/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-ports/.env.example rename to examples/go/modal/configuration/create-modal-with-ports/.env.example diff --git a/examples/go/modal/create-modal-with-ports/README.md b/examples/go/modal/configuration/create-modal-with-ports/README.md similarity index 80% rename from examples/go/modal/create-modal-with-ports/README.md rename to examples/go/modal/configuration/create-modal-with-ports/README.md index 1c8154b0..69355da5 100644 --- a/examples/go/modal/create-modal-with-ports/README.md +++ b/examples/go/modal/configuration/create-modal-with-ports/README.md @@ -15,7 +15,7 @@ an unencrypted port. HTTP/2 TLS maps to an h2 port. ## Run ```sh -cd examples/go/modal/create-modal-with-ports +cd examples/go/modal/configuration/create-modal-with-ports cp .env.example .env # Fill in the values below, then: go run . @@ -40,6 +40,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-ports/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-ports/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-ports/go.mod b/examples/go/modal/configuration/create-modal-with-ports/go.mod new file mode 100644 index 00000000..b66c897e --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-ports/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-ports + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-tcp-ready/go.sum b/examples/go/modal/configuration/create-modal-with-ports/go.sum similarity index 100% rename from examples/go/modal/create-modal-tcp-ready/go.sum rename to examples/go/modal/configuration/create-modal-with-ports/go.sum diff --git a/examples/go/modal/create-modal-with-ports/main.go b/examples/go/modal/configuration/create-modal-with-ports/main.go similarity index 100% rename from examples/go/modal/create-modal-with-ports/main.go rename to examples/go/modal/configuration/create-modal-with-ports/main.go diff --git a/examples/go/modal/create-modal-with-resources/.env.example b/examples/go/modal/configuration/create-modal-with-resources/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-resources/.env.example rename to examples/go/modal/configuration/create-modal-with-resources/.env.example diff --git a/examples/go/modal/create-modal-with-resources/README.md b/examples/go/modal/configuration/create-modal-with-resources/README.md similarity index 86% rename from examples/go/modal/create-modal-with-resources/README.md rename to examples/go/modal/configuration/create-modal-with-resources/README.md index 706f0d38..b79f3f3d 100644 --- a/examples/go/modal/create-modal-with-resources/README.md +++ b/examples/go/modal/configuration/create-modal-with-resources/README.md @@ -23,7 +23,7 @@ a maximum lifetime up to 24 hours (whole seconds). ## Run ```sh -cd examples/go/modal/create-modal-with-resources +cd examples/go/modal/configuration/create-modal-with-resources cp .env.example .env # Fill in the values below, then: go run . @@ -48,6 +48,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-resources/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-resources/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-resources/go.mod b/examples/go/modal/configuration/create-modal-with-resources/go.mod new file mode 100644 index 00000000..0b933b10 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-resources/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-resources + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-resources/go.sum b/examples/go/modal/configuration/create-modal-with-resources/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-resources/go.sum rename to examples/go/modal/configuration/create-modal-with-resources/go.sum diff --git a/examples/go/modal/create-modal-with-resources/main.go b/examples/go/modal/configuration/create-modal-with-resources/main.go similarity index 100% rename from examples/go/modal/create-modal-with-resources/main.go rename to examples/go/modal/configuration/create-modal-with-resources/main.go diff --git a/examples/go/modal/create-modal-with-resources/main_test.go b/examples/go/modal/configuration/create-modal-with-resources/main_test.go similarity index 100% rename from examples/go/modal/create-modal-with-resources/main_test.go rename to examples/go/modal/configuration/create-modal-with-resources/main_test.go diff --git a/examples/go/modal/create-modal-with-runtime/.env.example b/examples/go/modal/configuration/create-modal-with-runtime/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-runtime/.env.example rename to examples/go/modal/configuration/create-modal-with-runtime/.env.example diff --git a/examples/go/modal/create-modal-with-runtime/README.md b/examples/go/modal/configuration/create-modal-with-runtime/README.md similarity index 83% rename from examples/go/modal/create-modal-with-runtime/README.md rename to examples/go/modal/configuration/create-modal-with-runtime/README.md index 379f9209..3059fe11 100644 --- a/examples/go/modal/create-modal-with-runtime/README.md +++ b/examples/go/modal/configuration/create-modal-with-runtime/README.md @@ -17,7 +17,7 @@ command runs (`entrypoint`), and whether a PTY is attached. See Modal ## Run ```sh -cd examples/go/modal/create-modal-with-runtime +cd examples/go/modal/configuration/create-modal-with-runtime cp .env.example .env # Fill in the values below, then: go run . @@ -42,6 +42,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-runtime/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-runtime/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-runtime/go.mod b/examples/go/modal/configuration/create-modal-with-runtime/go.mod new file mode 100644 index 00000000..531735a6 --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-runtime/go.mod @@ -0,0 +1,48 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-runtime + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.opentelemetry.io/otel/metric v1.46.0 // indirect + go.opentelemetry.io/otel/sdk v1.46.0 // indirect + go.opentelemetry.io/otel/trace v1.46.0 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-runtime/go.sum b/examples/go/modal/configuration/create-modal-with-runtime/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-runtime/go.sum rename to examples/go/modal/configuration/create-modal-with-runtime/go.sum diff --git a/examples/go/modal/create-modal-with-runtime/main.go b/examples/go/modal/configuration/create-modal-with-runtime/main.go similarity index 100% rename from examples/go/modal/create-modal-with-runtime/main.go rename to examples/go/modal/configuration/create-modal-with-runtime/main.go diff --git a/examples/go/modal/create-modal-with-secrets/.env.example b/examples/go/modal/configuration/create-modal-with-secrets/.env.example similarity index 100% rename from examples/go/modal/create-modal-with-secrets/.env.example rename to examples/go/modal/configuration/create-modal-with-secrets/.env.example diff --git a/examples/go/modal/create-modal-with-secrets/README.md b/examples/go/modal/configuration/create-modal-with-secrets/README.md similarity index 81% rename from examples/go/modal/create-modal-with-secrets/README.md rename to examples/go/modal/configuration/create-modal-with-secrets/README.md index 814293a7..637fc58c 100644 --- a/examples/go/modal/create-modal-with-secrets/README.md +++ b/examples/go/modal/configuration/create-modal-with-secrets/README.md @@ -15,7 +15,7 @@ injects it as environment variables. ## Run ```sh -cd examples/go/modal/create-modal-with-secrets +cd examples/go/modal/configuration/create-modal-with-secrets cp .env.example .env # Fill in the values below, then: go run . @@ -41,6 +41,6 @@ MODAL_SECRET_NAME= ## Related -- [typescript twin](../../../typescript/modal/create-modal-with-secrets/README.md) +- [typescript twin](../../../../typescript/modal/configuration/create-modal-with-secrets/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/configuration/create-modal-with-secrets/go.mod b/examples/go/modal/configuration/create-modal-with-secrets/go.mod new file mode 100644 index 00000000..53d911fa --- /dev/null +++ b/examples/go/modal/configuration/create-modal-with-secrets/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/configuration/create-modal-with-secrets + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-allowlists/go.sum b/examples/go/modal/configuration/create-modal-with-secrets/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-allowlists/go.sum rename to examples/go/modal/configuration/create-modal-with-secrets/go.sum diff --git a/examples/go/modal/create-modal-with-secrets/main.go b/examples/go/modal/configuration/create-modal-with-secrets/main.go similarity index 100% rename from examples/go/modal/create-modal-with-secrets/main.go rename to examples/go/modal/configuration/create-modal-with-secrets/main.go diff --git a/examples/go/modal/create-modal-sandbox/go.mod b/examples/go/modal/create-modal-sandbox/go.mod deleted file mode 100644 index 88c177a8..00000000 --- a/examples/go/modal/create-modal-sandbox/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-verbose/go.mod b/examples/go/modal/create-modal-verbose/go.mod deleted file mode 100644 index 9427f2c3..00000000 --- a/examples/go/modal/create-modal-verbose/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-verbose - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-allowlists/go.mod b/examples/go/modal/create-modal-with-allowlists/go.mod deleted file mode 100644 index 0502b7bd..00000000 --- a/examples/go/modal/create-modal-with-allowlists/go.mod +++ /dev/null @@ -1,45 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-allowlists - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-identity/go.mod b/examples/go/modal/create-modal-with-identity/go.mod deleted file mode 100644 index b73330a6..00000000 --- a/examples/go/modal/create-modal-with-identity/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-identity - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-labels/go.mod b/examples/go/modal/create-modal-with-labels/go.mod deleted file mode 100644 index d38f94fd..00000000 --- a/examples/go/modal/create-modal-with-labels/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-labels - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-network/go.mod b/examples/go/modal/create-modal-with-network/go.mod deleted file mode 100644 index 5fcdbde2..00000000 --- a/examples/go/modal/create-modal-with-network/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-network - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-placement/go.mod b/examples/go/modal/create-modal-with-placement/go.mod deleted file mode 100644 index d3f42968..00000000 --- a/examples/go/modal/create-modal-with-placement/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-placement - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-ports/go.mod b/examples/go/modal/create-modal-with-ports/go.mod deleted file mode 100644 index 1a7caa9c..00000000 --- a/examples/go/modal/create-modal-with-ports/go.mod +++ /dev/null @@ -1,45 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-ports - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-resources/go.mod b/examples/go/modal/create-modal-with-resources/go.mod deleted file mode 100644 index cc1806cc..00000000 --- a/examples/go/modal/create-modal-with-resources/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-resources - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-runtime/go.mod b/examples/go/modal/create-modal-with-runtime/go.mod deleted file mode 100644 index ee8abeaf..00000000 --- a/examples/go/modal/create-modal-with-runtime/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-runtime - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-secrets/go.mod b/examples/go/modal/create-modal-with-secrets/go.mod deleted file mode 100644 index 2efe0d7b..00000000 --- a/examples/go/modal/create-modal-with-secrets/go.mod +++ /dev/null @@ -1,45 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-with-secrets - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/handle-modal-errors/.env.example b/examples/go/modal/errors/handle-modal-errors/.env.example similarity index 100% rename from examples/go/modal/handle-modal-errors/.env.example rename to examples/go/modal/errors/handle-modal-errors/.env.example diff --git a/examples/go/modal/handle-modal-errors/README.md b/examples/go/modal/errors/handle-modal-errors/README.md similarity index 86% rename from examples/go/modal/handle-modal-errors/README.md rename to examples/go/modal/errors/handle-modal-errors/README.md index 3e91a00f..ee95a4d6 100644 --- a/examples/go/modal/handle-modal-errors/README.md +++ b/examples/go/modal/errors/handle-modal-errors/README.md @@ -20,7 +20,7 @@ is `resources.disk_mib`. See ## Run ```sh -cd examples/go/modal/handle-modal-errors +cd examples/go/modal/errors/handle-modal-errors cp .env.example .env # Fill in the values below, then: go run . @@ -45,6 +45,6 @@ MODAL_ENVIRONMENT=main ## Related -- [typescript twin](../../../typescript/modal/handle-modal-errors/README.md) +- [typescript twin](../../../../typescript/modal/errors/handle-modal-errors/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/create-modal-gvisor/go.mod b/examples/go/modal/errors/handle-modal-errors/go.mod similarity index 90% rename from examples/go/modal/create-modal-gvisor/go.mod rename to examples/go/modal/errors/handle-modal-errors/go.mod index c3892c5a..bc0476bd 100644 --- a/examples/go/modal/create-modal-gvisor/go.mod +++ b/examples/go/modal/errors/handle-modal-errors/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-gvisor +module github.com/sandbox-kit/kit/examples/go/modal/errors/handle-modal-errors go 1.26.0 @@ -39,10 +39,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/handle-modal-errors/go.sum b/examples/go/modal/errors/handle-modal-errors/go.sum similarity index 100% rename from examples/go/modal/handle-modal-errors/go.sum rename to examples/go/modal/errors/handle-modal-errors/go.sum diff --git a/examples/go/modal/handle-modal-errors/main.go b/examples/go/modal/errors/handle-modal-errors/main.go similarity index 100% rename from examples/go/modal/handle-modal-errors/main.go rename to examples/go/modal/errors/handle-modal-errors/main.go diff --git a/examples/go/modal/handle-modal-errors/main_test.go b/examples/go/modal/errors/handle-modal-errors/main_test.go similarity index 100% rename from examples/go/modal/handle-modal-errors/main_test.go rename to examples/go/modal/errors/handle-modal-errors/main_test.go diff --git a/examples/go/modal/filesystem/copy-file-from-modal/.env.example b/examples/go/modal/filesystem/copy-file-from-modal/.env.example new file mode 100644 index 00000000..98fb27ad --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-from-modal/.env.example @@ -0,0 +1,7 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt diff --git a/examples/go/modal/filesystem/copy-file-from-modal/README.md b/examples/go/modal/filesystem/copy-file-from-modal/README.md new file mode 100644 index 00000000..557da12b --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-from-modal/README.md @@ -0,0 +1,49 @@ +# Copy a file from Modal + +Copy `MODAL_REMOTE_PATH` from the sandbox to `MODAL_LOCAL_PATH` on this machine. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call copies `MODAL_REMOTE_PATH` from the sandbox to `MODAL_LOCAL_PATH` on this machine. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Modal is called. The error field is `local_path`. +- A missing remote file comes back from Modal as not found. +- A missing local parent directory is created. A local directory is an invalid argument, and the field is `local_path`. +- An existing local file is replaced. + +## Run + +```sh +cd examples/go/modal/filesystem/copy-file-from-modal +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the local file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/copy-file-from-modal/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/filesystem/copy-file-from-modal/go.mod b/examples/go/modal/filesystem/copy-file-from-modal/go.mod new file mode 100644 index 00000000..9285653b --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-from-modal/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/copy-file-from-modal + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-ports/go.sum b/examples/go/modal/filesystem/copy-file-from-modal/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-ports/go.sum rename to examples/go/modal/filesystem/copy-file-from-modal/go.sum diff --git a/examples/go/modal/filesystem/copy-file-from-modal/main.go b/examples/go/modal/filesystem/copy-file-from-modal/main.go new file mode 100644 index 00000000..e899f192 --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-from-modal/main.go @@ -0,0 +1,54 @@ +// Copy a file from Modal. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + local := os.Getenv("MODAL_LOCAL_PATH") + if err := files.CopyToLocal(context.Background(), remote, local, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("copied %s to %s\n", remote, local) +} diff --git a/examples/go/modal/filesystem/copy-file-into-modal/.env.example b/examples/go/modal/filesystem/copy-file-into-modal/.env.example new file mode 100644 index 00000000..98fb27ad --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-into-modal/.env.example @@ -0,0 +1,7 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt diff --git a/examples/go/modal/filesystem/copy-file-into-modal/README.md b/examples/go/modal/filesystem/copy-file-into-modal/README.md new file mode 100644 index 00000000..beece83e --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-into-modal/README.md @@ -0,0 +1,48 @@ +# Copy a file into Modal + +Copy `MODAL_LOCAL_PATH` on this machine to `MODAL_REMOTE_PATH` in the sandbox. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call copies `MODAL_LOCAL_PATH` on this machine to `MODAL_REMOTE_PATH` in the sandbox. Missing parent directories of the remote file are created. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Modal is called. The error field is `local_path`. +- A missing local file is not found. The error field is `local_path`. A directory at that path is an invalid argument with the same field. +- An existing remote file is replaced. + +## Run + +```sh +cd examples/go/modal/filesystem/copy-file-into-modal +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the remote file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/copy-file-into-modal/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/filesystem/copy-file-into-modal/go.mod b/examples/go/modal/filesystem/copy-file-into-modal/go.mod new file mode 100644 index 00000000..8b98a02b --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-into-modal/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/copy-file-into-modal + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/create-modal-with-secrets/go.sum b/examples/go/modal/filesystem/copy-file-into-modal/go.sum similarity index 100% rename from examples/go/modal/create-modal-with-secrets/go.sum rename to examples/go/modal/filesystem/copy-file-into-modal/go.sum diff --git a/examples/go/modal/filesystem/copy-file-into-modal/main.go b/examples/go/modal/filesystem/copy-file-into-modal/main.go new file mode 100644 index 00000000..02eb5be9 --- /dev/null +++ b/examples/go/modal/filesystem/copy-file-into-modal/main.go @@ -0,0 +1,54 @@ +// Copy a file into Modal. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + local := os.Getenv("MODAL_LOCAL_PATH") + if err := files.CopyFromLocal(context.Background(), local, remote, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("copied %s to %s\n", local, remote) +} diff --git a/examples/go/modal/filesystem/list-modal-directory/.env.example b/examples/go/modal/filesystem/list-modal-directory/.env.example new file mode 100644 index 00000000..428b0d07 --- /dev/null +++ b/examples/go/modal/filesystem/list-modal-directory/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp diff --git a/examples/go/modal/filesystem/list-modal-directory/README.md b/examples/go/modal/filesystem/list-modal-directory/README.md new file mode 100644 index 00000000..edd45831 --- /dev/null +++ b/examples/go/modal/filesystem/list-modal-directory/README.md @@ -0,0 +1,47 @@ +# List a Modal directory + +Print the names in the directory at `MODAL_REMOTE_PATH`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call prints the names in one directory. It does not walk into subdirectories. + +## Edge cases + +- A relative path is rejected before Modal is called. +- A missing directory comes back from Modal as not found. +- A file path fails at the provider. + +## Run + +```sh +cd examples/go/modal/filesystem/list-modal-directory +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp + +``` + +## Warnings + +- Needs an existing sandbox and a directory at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/list-modal-directory/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/filesystem/list-modal-directory/go.mod b/examples/go/modal/filesystem/list-modal-directory/go.mod new file mode 100644 index 00000000..a364e6e3 --- /dev/null +++ b/examples/go/modal/filesystem/list-modal-directory/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/list-modal-directory + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/request-modal-termination/go.sum b/examples/go/modal/filesystem/list-modal-directory/go.sum similarity index 100% rename from examples/go/modal/request-modal-termination/go.sum rename to examples/go/modal/filesystem/list-modal-directory/go.sum diff --git a/examples/go/modal/filesystem/list-modal-directory/main.go b/examples/go/modal/filesystem/list-modal-directory/main.go new file mode 100644 index 00000000..551a8317 --- /dev/null +++ b/examples/go/modal/filesystem/list-modal-directory/main.go @@ -0,0 +1,57 @@ +// List a Modal directory. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + entries, err := files.ListDirectory(context.Background(), remote, nil) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%s (%d entries)\n", remote, len(entries)) + for _, entry := range entries { + fmt.Println(entry.GetName()) + } +} diff --git a/examples/go/modal/filesystem/make-modal-directory/.env.example b/examples/go/modal/filesystem/make-modal-directory/.env.example new file mode 100644 index 00000000..f3a16272 --- /dev/null +++ b/examples/go/modal/filesystem/make-modal-directory/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/kit-files diff --git a/examples/go/modal/filesystem/make-modal-directory/README.md b/examples/go/modal/filesystem/make-modal-directory/README.md new file mode 100644 index 00000000..b9dd02fa --- /dev/null +++ b/examples/go/modal/filesystem/make-modal-directory/README.md @@ -0,0 +1,47 @@ +# Create a Modal directory + +Create the directory at `MODAL_REMOTE_PATH`, including any missing parents. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call creates `MODAL_REMOTE_PATH` and any missing parents. + +## Edge cases + +- A relative path is rejected before Modal is called. +- `Parents` defaults to true: missing parents are created, and an existing directory is accepted. +- `Parents` false requires the parent directory to exist. + +## Run + +```sh +cd examples/go/modal/filesystem/make-modal-directory +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/kit-files + +``` + +## Warnings + +- Creates the directory inside the existing sandbox. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/make-modal-directory/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/filesystem/make-modal-directory/go.mod b/examples/go/modal/filesystem/make-modal-directory/go.mod new file mode 100644 index 00000000..5846706b --- /dev/null +++ b/examples/go/modal/filesystem/make-modal-directory/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/make-modal-directory + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/terminate-modal-sandbox/go.sum b/examples/go/modal/filesystem/make-modal-directory/go.sum similarity index 100% rename from examples/go/modal/terminate-modal-sandbox/go.sum rename to examples/go/modal/filesystem/make-modal-directory/go.sum diff --git a/examples/go/modal/filesystem/make-modal-directory/main.go b/examples/go/modal/filesystem/make-modal-directory/main.go new file mode 100644 index 00000000..a44f534e --- /dev/null +++ b/examples/go/modal/filesystem/make-modal-directory/main.go @@ -0,0 +1,53 @@ +// Create a Modal directory. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + if err := files.MakeDirectory(context.Background(), remote, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("created %s\n", remote) +} diff --git a/examples/go/modal/filesystem/read-modal-file/.env.example b/examples/go/modal/filesystem/read-modal-file/.env.example new file mode 100644 index 00000000..2e44e59a --- /dev/null +++ b/examples/go/modal/filesystem/read-modal-file/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt diff --git a/examples/go/modal/filesystem/read-modal-file/README.md b/examples/go/modal/filesystem/read-modal-file/README.md new file mode 100644 index 00000000..6dd787d3 --- /dev/null +++ b/examples/go/modal/filesystem/read-modal-file/README.md @@ -0,0 +1,47 @@ +# Read a Modal file + +Read the bytes at `MODAL_REMOTE_PATH` with `Filesystem.ReadFile` / `sandbox.filesystem.readFile`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call returns the file contents as bytes. Decode text in your own program. The sandbox path is absolute. + +## Edge cases + +- A relative path, a blank path, or a path that contains a NUL byte is rejected before Modal is called. The error field is `path`. +- A missing file comes back from Modal as not found. +- A directory path fails at the provider. + +## Run + +```sh +cd examples/go/modal/filesystem/read-modal-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt + +``` + +## Warnings + +- Needs an existing sandbox and a file at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/read-modal-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/create-modal-tcp-ready/go.mod b/examples/go/modal/filesystem/read-modal-file/go.mod similarity index 89% rename from examples/go/modal/create-modal-tcp-ready/go.mod rename to examples/go/modal/filesystem/read-modal-file/go.mod index 15d067e2..792e6465 100644 --- a/examples/go/modal/create-modal-tcp-ready/go.mod +++ b/examples/go/modal/filesystem/read-modal-file/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-tcp-ready +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/read-modal-file go 1.26.0 @@ -36,10 +36,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/terminate-modal-with-timeout/go.sum b/examples/go/modal/filesystem/read-modal-file/go.sum similarity index 100% rename from examples/go/modal/terminate-modal-with-timeout/go.sum rename to examples/go/modal/filesystem/read-modal-file/go.sum diff --git a/examples/go/modal/filesystem/read-modal-file/main.go b/examples/go/modal/filesystem/read-modal-file/main.go new file mode 100644 index 00000000..61e635d6 --- /dev/null +++ b/examples/go/modal/filesystem/read-modal-file/main.go @@ -0,0 +1,54 @@ +// Read a Modal file. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + data, err := files.ReadFile(context.Background(), remote, nil) + if err != nil { + log.Fatal(err) + } + fmt.Printf("read %s (%d bytes)\n", remote, len(data)) +} diff --git a/examples/go/modal/filesystem/remove-modal-file/.env.example b/examples/go/modal/filesystem/remove-modal-file/.env.example new file mode 100644 index 00000000..2920124a --- /dev/null +++ b/examples/go/modal/filesystem/remove-modal-file/.env.example @@ -0,0 +1,7 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +# MODAL_RECURSIVE=true diff --git a/examples/go/modal/filesystem/remove-modal-file/README.md b/examples/go/modal/filesystem/remove-modal-file/README.md new file mode 100644 index 00000000..d4d365f8 --- /dev/null +++ b/examples/go/modal/filesystem/remove-modal-file/README.md @@ -0,0 +1,48 @@ +# Remove a Modal path + +Delete `MODAL_REMOTE_PATH`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call deletes `MODAL_REMOTE_PATH`. With `MODAL_RECURSIVE` unset, it removes a file or an empty directory. Set `MODAL_RECURSIVE=true` to delete a directory and its contents. + +## Edge cases + +- A relative path is rejected before Modal is called. +- A missing path comes back from Modal as not found. +- A directory that still has entries fails when `MODAL_RECURSIVE` is unset. + +## Run + +```sh +cd examples/go/modal/filesystem/remove-modal-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +# MODAL_RECURSIVE=true + +``` + +## Warnings + +- Deletes the remote path. A recursive delete removes the directory and everything inside it. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/remove-modal-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/create-modal-client-timeout/go.mod b/examples/go/modal/filesystem/remove-modal-file/go.mod similarity index 89% rename from examples/go/modal/create-modal-client-timeout/go.mod rename to examples/go/modal/filesystem/remove-modal-file/go.mod index e87157d7..fc7257ca 100644 --- a/examples/go/modal/create-modal-client-timeout/go.mod +++ b/examples/go/modal/filesystem/remove-modal-file/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/create-modal-client-timeout +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/remove-modal-file go 1.26.0 @@ -36,10 +36,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/filesystem/remove-modal-file/go.sum b/examples/go/modal/filesystem/remove-modal-file/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/filesystem/remove-modal-file/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/filesystem/remove-modal-file/main.go b/examples/go/modal/filesystem/remove-modal-file/main.go new file mode 100644 index 00000000..bfa0c7f4 --- /dev/null +++ b/examples/go/modal/filesystem/remove-modal-file/main.go @@ -0,0 +1,57 @@ +// Remove a Modal path. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + var options *sandbox.RemoveOptions + if os.Getenv("MODAL_RECURSIVE") == "true" { + options = &sandbox.RemoveOptions{Recursive: sandbox.Value(true)} + } + if err := files.Remove(context.Background(), remote, options); err != nil { + log.Fatal(err) + } + fmt.Printf("removed %s\n", remote) +} diff --git a/examples/go/modal/filesystem/stat-modal-file/.env.example b/examples/go/modal/filesystem/stat-modal-file/.env.example new file mode 100644 index 00000000..2e44e59a --- /dev/null +++ b/examples/go/modal/filesystem/stat-modal-file/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt diff --git a/examples/go/modal/filesystem/stat-modal-file/README.md b/examples/go/modal/filesystem/stat-modal-file/README.md new file mode 100644 index 00000000..08289a1f --- /dev/null +++ b/examples/go/modal/filesystem/stat-modal-file/README.md @@ -0,0 +1,46 @@ +# Stat a Modal path + +Print the path, type, and size of `MODAL_REMOTE_PATH`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call prints the path, type, and size. A symlink result describes the symlink. Modal reports `mode` as a four-digit octal string when it has one. + +## Edge cases + +- A relative path is rejected before Modal is called. +- A missing path comes back from Modal as not found. + +## Run + +```sh +cd examples/go/modal/filesystem/stat-modal-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt + +``` + +## Warnings + +- Needs an existing sandbox and a path at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/stat-modal-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/close-modal-handle/go.mod b/examples/go/modal/filesystem/stat-modal-file/go.mod similarity index 89% rename from examples/go/modal/close-modal-handle/go.mod rename to examples/go/modal/filesystem/stat-modal-file/go.mod index ebfa6b47..442e9a60 100644 --- a/examples/go/modal/close-modal-handle/go.mod +++ b/examples/go/modal/filesystem/stat-modal-file/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/close-modal-handle +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/stat-modal-file go 1.26.0 @@ -36,10 +36,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/filesystem/stat-modal-file/go.sum b/examples/go/modal/filesystem/stat-modal-file/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/filesystem/stat-modal-file/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/filesystem/stat-modal-file/main.go b/examples/go/modal/filesystem/stat-modal-file/main.go new file mode 100644 index 00000000..ff7c6fb0 --- /dev/null +++ b/examples/go/modal/filesystem/stat-modal-file/main.go @@ -0,0 +1,54 @@ +// Stat a Modal path. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + info, err := files.Stat(context.Background(), remote, nil) + if err != nil { + log.Fatal(err) + } + fmt.Printf("%s type=%s size=%d\n", info.GetPath(), info.GetType(), info.GetSize()) +} diff --git a/examples/go/modal/filesystem/write-modal-file/.env.example b/examples/go/modal/filesystem/write-modal-file/.env.example new file mode 100644 index 00000000..2e44e59a --- /dev/null +++ b/examples/go/modal/filesystem/write-modal-file/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt diff --git a/examples/go/modal/filesystem/write-modal-file/README.md b/examples/go/modal/filesystem/write-modal-file/README.md new file mode 100644 index 00000000..7f629f07 --- /dev/null +++ b/examples/go/modal/filesystem/write-modal-file/README.md @@ -0,0 +1,47 @@ +# Write a Modal file + +Replace the file at `MODAL_REMOTE_PATH` with the bytes of `hello from sandbox-kit`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call replaces the file with the bytes of `hello from sandbox-kit` and creates any missing parent directories. + +## Edge cases + +- A relative sandbox path is rejected before Modal is called. The error field is `path`. +- An existing file at that path is replaced. +- A path that names a directory fails at the provider. + +## Run + +```sh +cd examples/go/modal/filesystem/write-modal-file +cp .env.example .env +# Fill in the values below, then: +go run . +``` + +Requires Go 1.26.0+ and this checkout. Skip copying if `.env` already exists. +Local check: `GOWORK=off go test ./...`. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt + +``` + +## Warnings + +- Overwrites the file at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [typescript twin](../../../../typescript/modal/filesystem/write-modal-file/README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/attach-modal-sandbox/go.mod b/examples/go/modal/filesystem/write-modal-file/go.mod similarity index 89% rename from examples/go/modal/attach-modal-sandbox/go.mod rename to examples/go/modal/filesystem/write-modal-file/go.mod index 30ddad11..2db02351 100644 --- a/examples/go/modal/attach-modal-sandbox/go.mod +++ b/examples/go/modal/filesystem/write-modal-file/go.mod @@ -1,4 +1,4 @@ -module github.com/sandbox-kit/kit/examples/go/modal/attach-modal-sandbox +module github.com/sandbox-kit/kit/examples/go/modal/filesystem/write-modal-file go 1.26.0 @@ -36,10 +36,10 @@ require ( google.golang.org/protobuf v1.36.12 // indirect ) -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/filesystem/write-modal-file/go.sum b/examples/go/modal/filesystem/write-modal-file/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/filesystem/write-modal-file/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/filesystem/write-modal-file/main.go b/examples/go/modal/filesystem/write-modal-file/main.go new file mode 100644 index 00000000..225ed5ec --- /dev/null +++ b/examples/go/modal/filesystem/write-modal-file/main.go @@ -0,0 +1,54 @@ +// Write a Modal file. +package main + +import ( + "context" + "fmt" + "log" + "os" + "time" + + "github.com/joho/godotenv" + "github.com/sandbox-kit/kit/sdks/go/providers/modal" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func main() { + if err := godotenv.Load(".env"); err != nil { + log.Fatalf("copy .env.example to .env and fill in its values: %v", err) + } + environment := os.Getenv("MODAL_ENVIRONMENT") + if environment == "" { + environment = "main" + } + client, err := sandbox.NewClient(modal.New(), &sandbox.Config{ + Auth: &sandbox.AuthConfig{ + Credentials: &sandbox.TokenPair{ + TokenPair: &sandbox.TokenPairCredentials{ + Id: os.Getenv("MODAL_TOKEN_ID"), + Secret: os.Getenv("MODAL_TOKEN_SECRET"), + }, + }, + }, + Scope: &sandbox.Scope{ + AppName: sandbox.Value(os.Getenv("MODAL_APP_NAME")), + Environment: sandbox.Value(environment), + }, + Timeout: sandbox.Duration(2 * time.Minute), + }) + if err != nil { + log.Fatal(err) + } + defer client.Close(context.Background()) + instance, err := client.Attach(context.Background(), os.Getenv("MODAL_SANDBOX_ID")) + if err != nil { + log.Fatal(err) + } + files := instance.Filesystem() + remote := os.Getenv("MODAL_REMOTE_PATH") + body := []byte("hello from sandbox-kit\n") + if err := files.WriteFile(context.Background(), remote, body, nil); err != nil { + log.Fatal(err) + } + fmt.Printf("wrote %s (%d bytes)\n", remote, len(body)) +} diff --git a/examples/go/modal/handle-modal-errors/go.mod b/examples/go/modal/handle-modal-errors/go.mod deleted file mode 100644 index f01fdedc..00000000 --- a/examples/go/modal/handle-modal-errors/go.mod +++ /dev/null @@ -1,48 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/handle-modal-errors - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.opentelemetry.io/otel/metric v1.46.0 // indirect - go.opentelemetry.io/otel/sdk v1.46.0 // indirect - go.opentelemetry.io/otel/trace v1.46.0 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/attach-modal-sandbox/.env.example b/examples/go/modal/lifecycle/attach-modal-sandbox/.env.example similarity index 100% rename from examples/go/modal/attach-modal-sandbox/.env.example rename to examples/go/modal/lifecycle/attach-modal-sandbox/.env.example diff --git a/examples/go/modal/attach-modal-sandbox/README.md b/examples/go/modal/lifecycle/attach-modal-sandbox/README.md similarity index 84% rename from examples/go/modal/attach-modal-sandbox/README.md rename to examples/go/modal/lifecycle/attach-modal-sandbox/README.md index ec507b33..17e64775 100644 --- a/examples/go/modal/attach-modal-sandbox/README.md +++ b/examples/go/modal/lifecycle/attach-modal-sandbox/README.md @@ -18,7 +18,7 @@ handle. ## Run ```sh -cd examples/go/modal/attach-modal-sandbox +cd examples/go/modal/lifecycle/attach-modal-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -44,6 +44,6 @@ MODAL_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/modal/attach-modal-sandbox/README.md) +- [typescript twin](../../../../typescript/modal/lifecycle/attach-modal-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/lifecycle/attach-modal-sandbox/go.mod b/examples/go/modal/lifecycle/attach-modal-sandbox/go.mod new file mode 100644 index 00000000..0984ba1d --- /dev/null +++ b/examples/go/modal/lifecycle/attach-modal-sandbox/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/lifecycle/attach-modal-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/lifecycle/attach-modal-sandbox/go.sum b/examples/go/modal/lifecycle/attach-modal-sandbox/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/lifecycle/attach-modal-sandbox/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/attach-modal-sandbox/main.go b/examples/go/modal/lifecycle/attach-modal-sandbox/main.go similarity index 100% rename from examples/go/modal/attach-modal-sandbox/main.go rename to examples/go/modal/lifecycle/attach-modal-sandbox/main.go diff --git a/examples/go/modal/close-modal-handle/.env.example b/examples/go/modal/lifecycle/close-modal-handle/.env.example similarity index 100% rename from examples/go/modal/close-modal-handle/.env.example rename to examples/go/modal/lifecycle/close-modal-handle/.env.example diff --git a/examples/go/modal/close-modal-handle/README.md b/examples/go/modal/lifecycle/close-modal-handle/README.md similarity index 83% rename from examples/go/modal/close-modal-handle/README.md rename to examples/go/modal/lifecycle/close-modal-handle/README.md index 08da8bad..ff5ac849 100644 --- a/examples/go/modal/close-modal-handle/README.md +++ b/examples/go/modal/lifecycle/close-modal-handle/README.md @@ -18,7 +18,7 @@ handle. ## Run ```sh -cd examples/go/modal/close-modal-handle +cd examples/go/modal/lifecycle/close-modal-handle cp .env.example .env # Fill in the values below, then: go run . @@ -44,6 +44,6 @@ MODAL_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/modal/close-modal-handle/README.md) +- [typescript twin](../../../../typescript/modal/lifecycle/close-modal-handle/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/lifecycle/close-modal-handle/go.mod b/examples/go/modal/lifecycle/close-modal-handle/go.mod new file mode 100644 index 00000000..9b1b46c0 --- /dev/null +++ b/examples/go/modal/lifecycle/close-modal-handle/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/lifecycle/close-modal-handle + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/lifecycle/close-modal-handle/go.sum b/examples/go/modal/lifecycle/close-modal-handle/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/lifecycle/close-modal-handle/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/close-modal-handle/main.go b/examples/go/modal/lifecycle/close-modal-handle/main.go similarity index 100% rename from examples/go/modal/close-modal-handle/main.go rename to examples/go/modal/lifecycle/close-modal-handle/main.go diff --git a/examples/go/modal/request-modal-termination/.env.example b/examples/go/modal/lifecycle/request-modal-termination/.env.example similarity index 100% rename from examples/go/modal/request-modal-termination/.env.example rename to examples/go/modal/lifecycle/request-modal-termination/.env.example diff --git a/examples/go/modal/request-modal-termination/README.md b/examples/go/modal/lifecycle/request-modal-termination/README.md similarity index 82% rename from examples/go/modal/request-modal-termination/README.md rename to examples/go/modal/lifecycle/request-modal-termination/README.md index 4f734252..c2d23a91 100644 --- a/examples/go/modal/request-modal-termination/README.md +++ b/examples/go/modal/lifecycle/request-modal-termination/README.md @@ -16,7 +16,7 @@ accepted instead of blocking for an exit code. ## Run ```sh -cd examples/go/modal/request-modal-termination +cd examples/go/modal/lifecycle/request-modal-termination cp .env.example .env # Fill in the values below, then: go run . @@ -43,6 +43,6 @@ MODAL_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/modal/request-modal-termination/README.md) +- [typescript twin](../../../../typescript/modal/lifecycle/request-modal-termination/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/lifecycle/request-modal-termination/go.mod b/examples/go/modal/lifecycle/request-modal-termination/go.mod new file mode 100644 index 00000000..fc626177 --- /dev/null +++ b/examples/go/modal/lifecycle/request-modal-termination/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/lifecycle/request-modal-termination + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/lifecycle/request-modal-termination/go.sum b/examples/go/modal/lifecycle/request-modal-termination/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/lifecycle/request-modal-termination/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/request-modal-termination/main.go b/examples/go/modal/lifecycle/request-modal-termination/main.go similarity index 100% rename from examples/go/modal/request-modal-termination/main.go rename to examples/go/modal/lifecycle/request-modal-termination/main.go diff --git a/examples/go/modal/terminate-modal-sandbox/.env.example b/examples/go/modal/lifecycle/terminate-modal-sandbox/.env.example similarity index 100% rename from examples/go/modal/terminate-modal-sandbox/.env.example rename to examples/go/modal/lifecycle/terminate-modal-sandbox/.env.example diff --git a/examples/go/modal/terminate-modal-sandbox/README.md b/examples/go/modal/lifecycle/terminate-modal-sandbox/README.md similarity index 85% rename from examples/go/modal/terminate-modal-sandbox/README.md rename to examples/go/modal/lifecycle/terminate-modal-sandbox/README.md index 92f299b1..043ddedf 100644 --- a/examples/go/modal/terminate-modal-sandbox/README.md +++ b/examples/go/modal/lifecycle/terminate-modal-sandbox/README.md @@ -20,7 +20,7 @@ result when available. A later call goes to Modal, and Kit returns that result. ## Run ```sh -cd examples/go/modal/terminate-modal-sandbox +cd examples/go/modal/lifecycle/terminate-modal-sandbox cp .env.example .env # Fill in the values below, then: go run . @@ -47,6 +47,6 @@ MODAL_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/modal/terminate-modal-sandbox/README.md) +- [typescript twin](../../../../typescript/modal/lifecycle/terminate-modal-sandbox/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/lifecycle/terminate-modal-sandbox/go.mod b/examples/go/modal/lifecycle/terminate-modal-sandbox/go.mod new file mode 100644 index 00000000..ef6f8335 --- /dev/null +++ b/examples/go/modal/lifecycle/terminate-modal-sandbox/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/lifecycle/terminate-modal-sandbox + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/lifecycle/terminate-modal-sandbox/go.sum b/examples/go/modal/lifecycle/terminate-modal-sandbox/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/lifecycle/terminate-modal-sandbox/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/terminate-modal-sandbox/main.go b/examples/go/modal/lifecycle/terminate-modal-sandbox/main.go similarity index 100% rename from examples/go/modal/terminate-modal-sandbox/main.go rename to examples/go/modal/lifecycle/terminate-modal-sandbox/main.go diff --git a/examples/go/modal/terminate-modal-with-timeout/.env.example b/examples/go/modal/lifecycle/terminate-modal-with-timeout/.env.example similarity index 100% rename from examples/go/modal/terminate-modal-with-timeout/.env.example rename to examples/go/modal/lifecycle/terminate-modal-with-timeout/.env.example diff --git a/examples/go/modal/terminate-modal-with-timeout/README.md b/examples/go/modal/lifecycle/terminate-modal-with-timeout/README.md similarity index 83% rename from examples/go/modal/terminate-modal-with-timeout/README.md rename to examples/go/modal/lifecycle/terminate-modal-with-timeout/README.md index 04a84f47..9edeb527 100644 --- a/examples/go/modal/terminate-modal-with-timeout/README.md +++ b/examples/go/modal/lifecycle/terminate-modal-with-timeout/README.md @@ -17,7 +17,7 @@ the sandbox exits or that deadline fires. It does not take a separate duration. ## Run ```sh -cd examples/go/modal/terminate-modal-with-timeout +cd examples/go/modal/lifecycle/terminate-modal-with-timeout cp .env.example .env # Fill in the values below, then: go run . @@ -44,6 +44,6 @@ MODAL_SANDBOX_ID= ## Related -- [typescript twin](../../../typescript/modal/terminate-modal-with-timeout/README.md) +- [typescript twin](../../../../typescript/modal/lifecycle/terminate-modal-with-timeout/README.md) -- Catalog: [examples/go/README.md](../../README.md) +- Catalog: [examples/go/README.md](../../../README.md) diff --git a/examples/go/modal/lifecycle/terminate-modal-with-timeout/go.mod b/examples/go/modal/lifecycle/terminate-modal-with-timeout/go.mod new file mode 100644 index 00000000..2ed97089 --- /dev/null +++ b/examples/go/modal/lifecycle/terminate-modal-with-timeout/go.mod @@ -0,0 +1,45 @@ +module github.com/sandbox-kit/kit/examples/go/modal/lifecycle/terminate-modal-with-timeout + +go 1.26.0 + +require ( + github.com/joho/godotenv v1.5.1 + github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 + github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 +) + +require ( + buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect + buf.build/go/protovalidate v1.4.0 // indirect + cel.dev/cel-go v0.32.0 // indirect + cel.dev/expr v0.25.3 // indirect + github.com/antlr4-go/antlr/v4 v4.13.1 // indirect + github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect + github.com/fxamacker/cbor/v2 v2.9.0 // indirect + github.com/golang-jwt/jwt/v5 v5.3.0 // indirect + github.com/google/uuid v1.6.0 // indirect + github.com/kisielk/og-rek v1.3.0 // indirect + github.com/modal-labs/modal-client/go v0.11.1 // indirect + github.com/pelletier/go-toml/v2 v2.2.4 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect + github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect + github.com/x448/float16 v0.8.4 // indirect + go.yaml.in/yaml/v3 v3.0.5 // indirect + golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect + golang.org/x/net v0.60.0 // indirect + golang.org/x/sync v0.23.0 // indirect + golang.org/x/sys v0.48.0 // indirect + golang.org/x/text v0.42.0 // indirect + google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect + google.golang.org/grpc v1.83.2 // indirect + google.golang.org/protobuf v1.36.12 // indirect +) + +replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../../sdks/go/sandbox + +replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../../sdks/go/providers/modal + +replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../../sdks/go/internal/contracts + +replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/lifecycle/terminate-modal-with-timeout/go.sum b/examples/go/modal/lifecycle/terminate-modal-with-timeout/go.sum new file mode 100644 index 00000000..3b03342e --- /dev/null +++ b/examples/go/modal/lifecycle/terminate-modal-with-timeout/go.sum @@ -0,0 +1,80 @@ +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 h1:NbnlmV26O7oZ1iM5tsCI+GEx+3ZSdrhvnKQ/eWSrLiY= +buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2/go.mod h1:TCt1lluMFnctISJXvkIQ4x3ABrPuUKCWKyjKdkJNBpw= +buf.build/go/protovalidate v1.4.0 h1:UjLrYbt5VX7+TMOs2+pG5FhZhIG1mSfK4EIopbb4LcM= +buf.build/go/protovalidate v1.4.0/go.mod h1:8vJfzNT6NIG2qm3uFsJDXMlRmG+bQJzbcIn1Aa0vPGs= +cel.dev/cel-go v0.32.0 h1:irvpFKr5EuGPyxeME03ERh0rii1TX+BDAnB9eL3IvNk= +cel.dev/cel-go v0.32.0/go.mod h1:DnVip7tpJSsgZymwfT+m1tnEVy3ivAjSMXPx12YrMkU= +cel.dev/expr v0.25.3 h1:A2jO8jwOugrrovveCWfj0KEZOfqiLgAcwjpHPhzIGw0= +cel.dev/expr v0.25.3/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= +github.com/antlr4-go/antlr/v4 v4.13.1 h1:SqQKkuVZ+zWkMMNkjy5FZe5mr5WURWnlpmOuzYWrPrQ= +github.com/antlr4-go/antlr/v4 v4.13.1/go.mod h1:GKmUxMtwp6ZgGwZSva4eWPC5mS6vUAmOABFgjdkM7Nw= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced h1:HxlRMDx/VeRqzj3nvqX9k4tjeBcEIkoNHDJPsS389hs= +github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced/go.mod h1:p7lmI+ecoe1RTyD11SPXWsSQ3H+pJ4cp5y7vtKW4QdM= +github.com/brianvoe/gofakeit/v6 v6.28.0 h1:Xib46XXuQfmlLS2EXRuJpqcw8St6qSZz75OUo0tgAW4= +github.com/brianvoe/gofakeit/v6 v6.28.0/go.mod h1:Xj58BMSnFqcn/fAQeSK+/PLtC5kSb7FJIq4JyGa8vEs= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/fxamacker/cbor/v2 v2.9.0 h1:NpKPmjDBgUfBms6tr6JZkTHtfFGcMKsw3eGcmD/sapM= +github.com/fxamacker/cbor/v2 v2.9.0/go.mod h1:vM4b+DJCtHn+zz7h3FFp/hDAI9WNWCsZj23V5ytsSxQ= +github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI= +github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY= +github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag= +github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE= +github.com/golang-jwt/jwt/v5 v5.3.0 h1:pv4AsKCKKZuqlgs5sUmn4x8UlGa0kEVt/puTpKx9vvo= +github.com/golang-jwt/jwt/v5 v5.3.0/go.mod h1:fxCRLWMO43lRc8nhHWY6LGqRcf+1gQWArsqaEUEa5bE= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= +github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= +github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= +github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0= +github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4= +github.com/kisielk/og-rek v1.3.0 h1:lTXdQXqFETZKA//FWH4RBNAuiJ/dofxIwHAidoUZoMk= +github.com/kisielk/og-rek v1.3.0/go.mod h1:4at7oxyfBTDilURhNCf7irHWtosJlJl9uyqUqAkrP4w= +github.com/modal-labs/modal-client/go v0.11.1 h1:1ozfDwwgXsMqoVb2qsNdfo3ew6Ekq9Wo62dnS0oYwGc= +github.com/modal-labs/modal-client/go v0.11.1/go.mod h1:8jvKba8kejJuPZisuyYYl4n4kPhou+jEcg5w3XLymTo= +github.com/onsi/gomega v1.38.2 h1:eZCjf2xjZAqe+LeWvKb5weQ+NcPwX84kqJ0cZNxok2A= +github.com/onsi/gomega v1.38.2/go.mod h1:W2MJcYxRGV63b418Ai34Ud0hEdTVXq9NW9+Sx6uXf3k= +github.com/pelletier/go-toml/v2 v2.2.4 h1:mye9XuhQ6gvn5h28+VilKrrPoQVanw5PMw/TB0t5Ec4= +github.com/pelletier/go-toml/v2 v2.2.4/go.mod h1:2gIqNv+qfxSVS7cM2xJQKtLSTLUE9V8t9Stt+h56mCY= +github.com/rodaine/protogofakeit v0.1.1 h1:ZKouljuRM3A+TArppfBqnH8tGZHOwM/pjvtXe9DaXH8= +github.com/rodaine/protogofakeit v0.1.1/go.mod h1:pXn/AstBYMaSfc1/RqH3N82pBuxtWgejz1AlYpY1mI0= +github.com/stretchr/testify v1.12.1 h1:EuwCh5fleGS7H32xRwO3wRGT7DxrDhLAT6FF8MpWDWE= +github.com/stretchr/testify v1.12.1/go.mod h1:MDEgiDPPsNp5cuIrHPPCyornHKgEVbtFUmoNlxoYthg= +github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= +github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= +go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64= +go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y= +go.opentelemetry.io/otel v1.46.0 h1:FHt5/CDyVxi/8IM1CH7VE/rRgq3kLHa2mSTVMO8AWyc= +go.opentelemetry.io/otel v1.46.0/go.mod h1:Gj3SEScelsNC45tp4nSxRYlS+f5iez7W8XPMCt905kE= +go.opentelemetry.io/otel/metric v1.44.0 h1:1w0gILTcHdr3YI+ixLyjemwrVnsMURbTZFrSYCdDdmc= +go.opentelemetry.io/otel/metric v1.44.0/go.mod h1:8O7hanEPBNgEMmybD3s2VBKcgWOCsA6tzHBPODAiquo= +go.opentelemetry.io/otel/sdk v1.44.0 h1:nHYwb9lK+fJPU/dnT6s7W7Z8itMWyqrnVfbheVYrZ58= +go.opentelemetry.io/otel/sdk v1.44.0/go.mod h1:Osuydd3Se74nqjAKxid74N5eC+jfEqfTegHRnq58oK0= +go.opentelemetry.io/otel/sdk/metric v1.46.0 h1:0piZ26EG4RBfebb2jhDH6ERCYHoVWduc3kLgPCwSnSE= +go.opentelemetry.io/otel/sdk/metric v1.46.0/go.mod h1:I1PbKrdVc8Qu8HYVDNtqVIwLwjNrhsV/uFuxfwg8mO4= +go.opentelemetry.io/otel/trace v1.44.0 h1:jxF5CsGYCe74MCRx2X4g7WsY/VBKRqqpNvXlX/6gtIk= +go.opentelemetry.io/otel/trace v1.44.0/go.mod h1:oLl1jrMQAVo6v3GAggN+1VH9VIz9iUSvW53sW1Q8PIE= +go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= +go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e h1:01Ju2A/fZKkci4zqx0eZxw//DnRYOnBiGJG14hFBhO8= +golang.org/x/exp v0.0.0-20260820142414-ca536658362e/go.mod h1:zeBbvyFKDaLwa7CH/zI8KXt7gTl14SF7sO08Pl5jBCM= +golang.org/x/net v0.60.0 h1:79p50tfZlm0J9YfoDsSi639qSXNGVwEzOPLCxM2FsYU= +golang.org/x/net v0.60.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= +golang.org/x/sync v0.23.0 h1:KameEIfc1IkluZyXWLn39Wd4tURc6GbCiISGiZm2bQk= +golang.org/x/sync v0.23.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.48.0 h1:bbX/i/6MgT9BVLM9RT1thmxL04yeTAhbEz4SyadbXoo= +golang.org/x/sys v0.48.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/text v0.42.0 h1:JbOZXgfeCPU9gacVtYliJqOhD+zhrEqK4LfdpmlUZqI= +golang.org/x/text v0.42.0/go.mod h1:ojzP1Z+2QtioaF8DTtO8K5q7JWVVYwZKenzujK0Zd0E= +gonum.org/v1/gonum v0.17.0 h1:VbpOemQlsSMrYmn7T2OUvQ4dqxQXU+ouZFQsZOx50z4= +gonum.org/v1/gonum v0.17.0/go.mod h1:El3tOrEuMpv2UdMrbNlKEh9vd86bmQ6vqIcDwxEOc1E= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 h1:ax2KzoSRIZU/M0cIxri3pKxy99vniH1PVxWC6si/eZI= +google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688/go.mod h1:1RJ9BQGyNdZwkGc1eTqkErfRZ6RJyYPHZo73BZ1vQqI= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 h1:cYNAzI2sUwhmCcoj9TxvihSrqsxt6uIkj3rDRhSDmW4= +google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688/go.mod h1:DjtHYE8FKJLivXcBEjGwndXfIC23G0VpXiXKqG179uA= +google.golang.org/grpc v1.83.2 h1:EManeRomTObA0BU7I8vXgg/78uE5MJ9M8B39EX2WscU= +google.golang.org/grpc v1.83.2/go.mod h1:YPI1hK3kDked6iHvgX3tR0y+nX/qpMFKhPgFsokw1S8= +google.golang.org/protobuf v1.36.12 h1:pJOKDDOyeXErUroCihFAd5LQuwXBSpVnKGrj5o/fwxc= +google.golang.org/protobuf v1.36.12/go.mod h1:HTf+CrKn2C3g5S8VImy6tdcUvCska2kB7j23XfzDpco= diff --git a/examples/go/modal/terminate-modal-with-timeout/main.go b/examples/go/modal/lifecycle/terminate-modal-with-timeout/main.go similarity index 100% rename from examples/go/modal/terminate-modal-with-timeout/main.go rename to examples/go/modal/lifecycle/terminate-modal-with-timeout/main.go diff --git a/examples/go/modal/request-modal-termination/go.mod b/examples/go/modal/request-modal-termination/go.mod deleted file mode 100644 index c1a2f554..00000000 --- a/examples/go/modal/request-modal-termination/go.mod +++ /dev/null @@ -1,45 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/request-modal-termination - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/terminate-modal-sandbox/go.mod b/examples/go/modal/terminate-modal-sandbox/go.mod deleted file mode 100644 index 45d0d32f..00000000 --- a/examples/go/modal/terminate-modal-sandbox/go.mod +++ /dev/null @@ -1,45 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/terminate-modal-sandbox - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/go/modal/terminate-modal-with-timeout/go.mod b/examples/go/modal/terminate-modal-with-timeout/go.mod deleted file mode 100644 index c27df94b..00000000 --- a/examples/go/modal/terminate-modal-with-timeout/go.mod +++ /dev/null @@ -1,45 +0,0 @@ -module github.com/sandbox-kit/kit/examples/go/modal/terminate-modal-with-timeout - -go 1.26.0 - -require ( - github.com/joho/godotenv v1.5.1 - github.com/sandbox-kit/kit/sdks/go/providers/modal v0.1.3 - github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 -) - -require ( - buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.36.12-20260825204119-511051f7f437.2 // indirect - buf.build/go/protovalidate v1.4.0 // indirect - cel.dev/cel-go v0.32.0 // indirect - cel.dev/expr v0.25.3 // indirect - github.com/antlr4-go/antlr/v4 v4.13.1 // indirect - github.com/aristanetworks/gomap v0.0.0-20230726210543-f4e41046dced // indirect - github.com/fxamacker/cbor/v2 v2.9.0 // indirect - github.com/golang-jwt/jwt/v5 v5.3.0 // indirect - github.com/google/uuid v1.6.0 // indirect - github.com/kisielk/og-rek v1.3.0 // indirect - github.com/modal-labs/modal-client/go v0.11.1 // indirect - github.com/pelletier/go-toml/v2 v2.2.4 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/contracts v0.1.3 // indirect - github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 // indirect - github.com/x448/float16 v0.8.4 // indirect - go.yaml.in/yaml/v3 v3.0.5 // indirect - golang.org/x/exp v0.0.0-20260820142414-ca536658362e // indirect - golang.org/x/net v0.60.0 // indirect - golang.org/x/sync v0.23.0 // indirect - golang.org/x/sys v0.48.0 // indirect - golang.org/x/text v0.42.0 // indirect - google.golang.org/genproto/googleapis/api v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/genproto/googleapis/rpc v0.0.0-20260819154853-08b0e4226688 // indirect - google.golang.org/grpc v1.83.2 // indirect - google.golang.org/protobuf v1.36.12 // indirect -) - -replace github.com/sandbox-kit/kit/sdks/go/sandbox => ../../../../sdks/go/sandbox - -replace github.com/sandbox-kit/kit/sdks/go/providers/modal => ../../../../sdks/go/providers/modal - -replace github.com/sandbox-kit/kit/sdks/go/internal/contracts => ../../../../sdks/go/internal/contracts - -replace github.com/sandbox-kit/kit/sdks/go/internal/sdk => ../../../../sdks/go/internal/sdk diff --git a/examples/typescript/README.md b/examples/typescript/README.md index 18221958..274a01b0 100644 --- a/examples/typescript/README.md +++ b/examples/typescript/README.md @@ -1,7 +1,8 @@ # TypeScript examples Independent Node.js projects. Each selects one provider and demonstrates one -operation. Requires Node.js 24.15.0 (or Node.js 20/22), npm 11.19.0, and this +operation. Projects sit in `filesystem`, `configuration`, `lifecycle`, or +`errors`. Requires Node.js 24.15.0 (or Node.js 20/22), npm 11.19.0, and this checkout. Examples use the public `@sandbox-kit/sandbox` API: nested exclusive fields @@ -11,7 +12,7 @@ allowlists. ## Run one ```sh -cd examples/typescript/daytona/create-daytona-sandbox +cd examples/typescript/daytona/configuration/create-daytona-sandbox cp .env.example .env # Fill in DAYTONA_API_KEY, then: npm install @@ -19,69 +20,85 @@ npm run build npm start ``` -Creation examples provision real cloud resources. Lifecycle examples act on the -sandbox ID in `.env`. Closing a handle leaves the sandbox as it is. Closing +Creation examples provision real cloud resources. Filesystem and lifecycle +examples act on the sandbox ID in `.env`. Closing a handle leaves the sandbox as it is. Closing the client closes your connection to Daytona or Modal. Modal setup: -[create-modal-sandbox](modal/create-modal-sandbox/README.md). +[create-modal-sandbox](modal/configuration/create-modal-sandbox/README.md). ## Catalog ### Daytona -| Project | Demonstrates | -| ------------------------------------------------------------------------------ | --------------------------------- | -| [create-daytona-sandbox](daytona/create-daytona-sandbox/README.md) | default Daytona snapshot | -| [create-daytona-from-snapshot](daytona/create-daytona-from-snapshot/README.md) | named snapshot source | -| [create-daytona-from-image](daytona/create-daytona-from-image/README.md) | image source and resource sizing | -| [create-daytona-with-runtime](daytona/create-daytona-with-runtime/README.md) | runtime language and user | -| [create-daytona-ephemeral](daytona/create-daytona-ephemeral/README.md) | delete-on-stop behavior | -| [create-daytona-linked](daytona/create-daytona-linked/README.md) | linked parent and ephemeral child | -| [create-daytona-with-policies](daytona/create-daytona-with-policies/README.md) | pause and deletion policies | -| [create-daytona-with-network](daytona/create-daytona-with-network/README.md) | restricted egress allowlists | -| [create-daytona-with-labels](daytona/create-daytona-with-labels/README.md) | labels and environment variables | -| [create-daytona-with-secrets](daytona/create-daytona-with-secrets/README.md) | injected organization secret | -| [create-daytona-with-kvm](daytona/create-daytona-with-kvm/README.md) | nested virtualization (KVM) | -| [create-daytona-with-ttl](daytona/create-daytona-with-ttl/README.md) | maximum lifetime TTL | -| [handle-daytona-errors](daytona/handle-daytona-errors/README.md) | typed validation errors | -| [get-daytona-sandbox](daytona/get-daytona-sandbox/README.md) | remote retrieval and metadata | -| [refresh-daytona-sandbox](daytona/refresh-daytona-sandbox/README.md) | metadata refresh | -| [start-daytona-sandbox](daytona/start-daytona-sandbox/README.md) | start lifecycle operation | -| [start-daytona-with-timeout](daytona/start-daytona-with-timeout/README.md) | start with operation timeout | -| [stop-daytona-sandbox](daytona/stop-daytona-sandbox/README.md) | stop lifecycle operation | -| [force-stop-daytona-sandbox](daytona/force-stop-daytona-sandbox/README.md) | force stop | -| [pause-daytona-sandbox](daytona/pause-daytona-sandbox/README.md) | pause lifecycle operation | -| [archive-daytona-sandbox](daytona/archive-daytona-sandbox/README.md) | archive lifecycle operation | -| [delete-daytona-sandbox](daytona/delete-daytona-sandbox/README.md) | waited deletion | -| [request-daytona-deletion](daytona/request-daytona-deletion/README.md) | non-waited deletion | -| [close-daytona-handle](daytona/close-daytona-handle/README.md) | close the handle; sandbox keeps running | +| Project | Demonstrates | +| -------------------------------------------------------------------------------------------- | --------------------------------------- | +| [create-daytona-sandbox](daytona/configuration/create-daytona-sandbox/README.md) | default Daytona snapshot | +| [read-daytona-file](daytona/filesystem/read-daytona-file/README.md) | read one file | +| [write-daytona-file](daytona/filesystem/write-daytona-file/README.md) | write one file | +| [copy-file-into-daytona](daytona/filesystem/copy-file-into-daytona/README.md) | copy a local file in | +| [copy-file-from-daytona](daytona/filesystem/copy-file-from-daytona/README.md) | copy a sandbox file out | +| [make-daytona-directory](daytona/filesystem/make-daytona-directory/README.md) | create a directory | +| [list-daytona-directory](daytona/filesystem/list-daytona-directory/README.md) | list one directory | +| [stat-daytona-file](daytona/filesystem/stat-daytona-file/README.md) | stat one path | +| [remove-daytona-file](daytona/filesystem/remove-daytona-file/README.md) | remove one path | +| [create-daytona-from-snapshot](daytona/configuration/create-daytona-from-snapshot/README.md) | named snapshot source | +| [create-daytona-from-image](daytona/configuration/create-daytona-from-image/README.md) | image source and resource sizing | +| [create-daytona-with-runtime](daytona/configuration/create-daytona-with-runtime/README.md) | runtime language and user | +| [create-daytona-ephemeral](daytona/configuration/create-daytona-ephemeral/README.md) | delete-on-stop behavior | +| [create-daytona-linked](daytona/configuration/create-daytona-linked/README.md) | linked parent and ephemeral child | +| [create-daytona-with-policies](daytona/configuration/create-daytona-with-policies/README.md) | pause and deletion policies | +| [create-daytona-with-network](daytona/configuration/create-daytona-with-network/README.md) | restricted egress allowlists | +| [create-daytona-with-labels](daytona/configuration/create-daytona-with-labels/README.md) | labels and environment variables | +| [create-daytona-with-secrets](daytona/configuration/create-daytona-with-secrets/README.md) | injected organization secret | +| [create-daytona-with-kvm](daytona/configuration/create-daytona-with-kvm/README.md) | nested virtualization (KVM) | +| [create-daytona-with-ttl](daytona/configuration/create-daytona-with-ttl/README.md) | maximum lifetime TTL | +| [handle-daytona-errors](daytona/errors/handle-daytona-errors/README.md) | typed validation errors | +| [get-daytona-sandbox](daytona/lifecycle/get-daytona-sandbox/README.md) | remote retrieval and metadata | +| [refresh-daytona-sandbox](daytona/lifecycle/refresh-daytona-sandbox/README.md) | metadata refresh | +| [start-daytona-sandbox](daytona/lifecycle/start-daytona-sandbox/README.md) | start lifecycle operation | +| [start-daytona-with-timeout](daytona/lifecycle/start-daytona-with-timeout/README.md) | start with operation timeout | +| [stop-daytona-sandbox](daytona/lifecycle/stop-daytona-sandbox/README.md) | stop lifecycle operation | +| [force-stop-daytona-sandbox](daytona/lifecycle/force-stop-daytona-sandbox/README.md) | force stop | +| [pause-daytona-sandbox](daytona/lifecycle/pause-daytona-sandbox/README.md) | pause lifecycle operation | +| [archive-daytona-sandbox](daytona/lifecycle/archive-daytona-sandbox/README.md) | archive lifecycle operation | +| [delete-daytona-sandbox](daytona/lifecycle/delete-daytona-sandbox/README.md) | waited deletion | +| [request-daytona-deletion](daytona/lifecycle/request-daytona-deletion/README.md) | non-waited deletion | +| [close-daytona-handle](daytona/lifecycle/close-daytona-handle/README.md) | close the handle; sandbox keeps running | ### Modal -| Project | Demonstrates | -| ---------------------------------------------------------------------------- | ------------------------------------------ | -| [create-modal-sandbox](modal/create-modal-sandbox/README.md) | image creation with resources and policies | -| [create-modal-with-resources](modal/create-modal-with-resources/README.md) | fractional CPU, memory, and lifetime | -| [create-modal-with-runtime](modal/create-modal-with-runtime/README.md) | working directory, entrypoint, and PTY | -| [create-modal-gvisor](modal/create-modal-gvisor/README.md) | gVisor/container isolation | -| [create-modal-linux-vm](modal/create-modal-linux-vm/README.md) | Linux VM isolation | -| [create-modal-with-placement](modal/create-modal-with-placement/README.md) | cloud and region placement | -| [create-modal-with-labels](modal/create-modal-with-labels/README.md) | environment variables and tags | -| [create-modal-with-network](modal/create-modal-with-network/README.md) | managed outbound proxy | -| [create-modal-idle](modal/create-modal-idle/README.md) | idle termination | -| [create-modal-ready](modal/create-modal-ready/README.md) | command readiness | -| [create-modal-tcp-ready](modal/create-modal-tcp-ready/README.md) | TCP port readiness | -| [create-modal-client-timeout](modal/create-modal-client-timeout/README.md) | ready-wait via client timeout | -| [create-modal-with-ports](modal/create-modal-with-ports/README.md) | TLS and plain port bindings | -| [create-modal-with-allowlists](modal/create-modal-with-allowlists/README.md) | outbound CIDR/domain allowlists | -| [create-modal-with-secrets](modal/create-modal-with-secrets/README.md) | named Modal secret | -| [create-modal-verbose](modal/create-modal-verbose/README.md) | verbose provider logging | -| [create-modal-with-identity](modal/create-modal-with-identity/README.md) | workload identity | -| [handle-modal-errors](modal/handle-modal-errors/README.md) | typed unsupported-intent errors | -| [attach-modal-sandbox](modal/attach-modal-sandbox/README.md) | ID-only attachment | -| [terminate-modal-sandbox](modal/terminate-modal-sandbox/README.md) | waited termination | -| [terminate-modal-with-timeout](modal/terminate-modal-with-timeout/README.md) | waited terminate with timeout | -| [request-modal-termination](modal/request-modal-termination/README.md) | non-waited termination | -| [close-modal-handle](modal/close-modal-handle/README.md) | close the handle; sandbox keeps running | +| Project | Demonstrates | +| ------------------------------------------------------------------------------------------ | ------------------------------------------ | +| [create-modal-sandbox](modal/configuration/create-modal-sandbox/README.md) | image creation with resources and policies | +| [read-modal-file](modal/filesystem/read-modal-file/README.md) | read one file | +| [write-modal-file](modal/filesystem/write-modal-file/README.md) | write one file | +| [copy-file-into-modal](modal/filesystem/copy-file-into-modal/README.md) | copy a local file in | +| [copy-file-from-modal](modal/filesystem/copy-file-from-modal/README.md) | copy a sandbox file out | +| [make-modal-directory](modal/filesystem/make-modal-directory/README.md) | create a directory | +| [list-modal-directory](modal/filesystem/list-modal-directory/README.md) | list one directory | +| [stat-modal-file](modal/filesystem/stat-modal-file/README.md) | stat one path | +| [remove-modal-file](modal/filesystem/remove-modal-file/README.md) | remove one path | +| [create-modal-with-resources](modal/configuration/create-modal-with-resources/README.md) | fractional CPU, memory, and lifetime | +| [create-modal-with-runtime](modal/configuration/create-modal-with-runtime/README.md) | working directory, entrypoint, and PTY | +| [create-modal-gvisor](modal/configuration/create-modal-gvisor/README.md) | gVisor/container isolation | +| [create-modal-linux-vm](modal/configuration/create-modal-linux-vm/README.md) | Linux VM isolation | +| [create-modal-with-placement](modal/configuration/create-modal-with-placement/README.md) | cloud and region placement | +| [create-modal-with-labels](modal/configuration/create-modal-with-labels/README.md) | environment variables and tags | +| [create-modal-with-network](modal/configuration/create-modal-with-network/README.md) | managed outbound proxy | +| [create-modal-idle](modal/configuration/create-modal-idle/README.md) | idle termination | +| [create-modal-ready](modal/configuration/create-modal-ready/README.md) | command readiness | +| [create-modal-tcp-ready](modal/configuration/create-modal-tcp-ready/README.md) | TCP port readiness | +| [create-modal-client-timeout](modal/configuration/create-modal-client-timeout/README.md) | ready-wait via client timeout | +| [create-modal-with-ports](modal/configuration/create-modal-with-ports/README.md) | TLS and plain port bindings | +| [create-modal-with-allowlists](modal/configuration/create-modal-with-allowlists/README.md) | outbound CIDR/domain allowlists | +| [create-modal-with-secrets](modal/configuration/create-modal-with-secrets/README.md) | named Modal secret | +| [create-modal-verbose](modal/configuration/create-modal-verbose/README.md) | verbose provider logging | +| [create-modal-with-identity](modal/configuration/create-modal-with-identity/README.md) | workload identity | +| [handle-modal-errors](modal/errors/handle-modal-errors/README.md) | typed unsupported-intent errors | +| [attach-modal-sandbox](modal/lifecycle/attach-modal-sandbox/README.md) | ID-only attachment | +| [terminate-modal-sandbox](modal/lifecycle/terminate-modal-sandbox/README.md) | waited termination | +| [terminate-modal-with-timeout](modal/lifecycle/terminate-modal-with-timeout/README.md) | waited terminate with timeout | +| [request-modal-termination](modal/lifecycle/request-modal-termination/README.md) | non-waited termination | +| [close-modal-handle](modal/lifecycle/close-modal-handle/README.md) | close the handle; sandbox keeps running | ## Verify all TypeScript projects diff --git a/examples/typescript/daytona/create-daytona-ephemeral/.env.example b/examples/typescript/daytona/configuration/create-daytona-ephemeral/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-ephemeral/.env.example rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/.env.example diff --git a/examples/typescript/daytona/archive-daytona-sandbox/.gitignore b/examples/typescript/daytona/configuration/create-daytona-ephemeral/.gitignore similarity index 100% rename from examples/typescript/daytona/archive-daytona-sandbox/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/.gitignore diff --git a/examples/typescript/daytona/archive-daytona-sandbox/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-ephemeral/.nvmrc similarity index 100% rename from examples/typescript/daytona/archive-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-ephemeral/README.md b/examples/typescript/daytona/configuration/create-daytona-ephemeral/README.md similarity index 85% rename from examples/typescript/daytona/create-daytona-ephemeral/README.md rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/README.md index 0852da2a..98ac9e8e 100644 --- a/examples/typescript/daytona/create-daytona-ephemeral/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-ephemeral/README.md @@ -19,7 +19,7 @@ sets auto-delete to immediate (`0`) for ephemeral creates. See ## Run ```sh -cd examples/typescript/daytona/create-daytona-ephemeral +cd examples/typescript/daytona/configuration/create-daytona-ephemeral cp .env.example .env # Fill in the values below, then: npm install @@ -44,6 +44,6 @@ DAYTONA_API_KEY= ## Related -- [go twin](../../../go/daytona/create-daytona-ephemeral/README.md) +- [go twin](../../../../go/daytona/configuration/create-daytona-ephemeral/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-ephemeral/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-ephemeral/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-ephemeral/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/package-lock.json index 63b5bc72..3cef804b 100644 --- a/examples/typescript/daytona/create-daytona-ephemeral/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-ephemeral/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-ephemeral", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-ephemeral/package.json b/examples/typescript/daytona/configuration/create-daytona-ephemeral/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-ephemeral/package.json rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/package.json index c6c9537d..7eae5644 100644 --- a/examples/typescript/daytona/create-daytona-ephemeral/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-ephemeral/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-ephemeral/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-ephemeral/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-ephemeral/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/src/main.ts diff --git a/examples/typescript/daytona/archive-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-ephemeral/tsconfig.json similarity index 100% rename from examples/typescript/daytona/archive-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-ephemeral/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-from-image/.env.example b/examples/typescript/daytona/configuration/create-daytona-from-image/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-from-image/.env.example rename to examples/typescript/daytona/configuration/create-daytona-from-image/.env.example diff --git a/examples/typescript/daytona/close-daytona-handle/.gitignore b/examples/typescript/daytona/configuration/create-daytona-from-image/.gitignore similarity index 100% rename from examples/typescript/daytona/close-daytona-handle/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-from-image/.gitignore diff --git a/examples/typescript/daytona/close-daytona-handle/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-from-image/.nvmrc similarity index 100% rename from examples/typescript/daytona/close-daytona-handle/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-from-image/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-from-image/README.md b/examples/typescript/daytona/configuration/create-daytona-from-image/README.md similarity index 87% rename from examples/typescript/daytona/create-daytona-from-image/README.md rename to examples/typescript/daytona/configuration/create-daytona-from-image/README.md index 736f89f9..0caf80d1 100644 --- a/examples/typescript/daytona/create-daytona-from-image/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-from-image/README.md @@ -26,7 +26,7 @@ Documented organization defaults for image create are often 1 vCPU / 1 GiB / ## Run ```sh -cd examples/typescript/daytona/create-daytona-from-image +cd examples/typescript/daytona/configuration/create-daytona-from-image cp .env.example .env # Fill in the values below, then: npm install @@ -51,6 +51,6 @@ DAYTONA_API_KEY= ## Related -- [go twin](../../../go/daytona/create-daytona-from-image/README.md) +- [go twin](../../../../go/daytona/configuration/create-daytona-from-image/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-from-image/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-from-image/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-from-image/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-from-image/package-lock.json index 0a090266..ce5ca498 100644 --- a/examples/typescript/daytona/create-daytona-from-image/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-from-image/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-from-image", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-from-image/package.json b/examples/typescript/daytona/configuration/create-daytona-from-image/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-from-image/package.json rename to examples/typescript/daytona/configuration/create-daytona-from-image/package.json index 689f3f61..a05e8054 100644 --- a/examples/typescript/daytona/create-daytona-from-image/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-from-image/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-from-image/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-from-image/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-from-image/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-from-image/src/main.ts diff --git a/examples/typescript/daytona/close-daytona-handle/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-from-image/tsconfig.json similarity index 100% rename from examples/typescript/daytona/close-daytona-handle/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-from-image/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/.env.example b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-from-snapshot/.env.example rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/.env.example diff --git a/examples/typescript/daytona/create-daytona-ephemeral/.gitignore b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-ephemeral/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/.gitignore diff --git a/examples/typescript/daytona/create-daytona-ephemeral/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-ephemeral/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/README.md b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/README.md similarity index 86% rename from examples/typescript/daytona/create-daytona-from-snapshot/README.md rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/README.md index a847d228..c29932c3 100644 --- a/examples/typescript/daytona/create-daytona-from-snapshot/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/README.md @@ -25,7 +25,7 @@ warm-pool sources are not mapped and are rejected if supplied. ## Run ```sh -cd examples/typescript/daytona/create-daytona-from-snapshot +cd examples/typescript/daytona/configuration/create-daytona-from-snapshot cp .env.example .env # Fill in the values below, then: npm install @@ -50,6 +50,6 @@ DAYTONA_API_KEY= ## Related -- [go twin](../../../go/daytona/create-daytona-from-snapshot/README.md) +- [go twin](../../../../go/daytona/configuration/create-daytona-from-snapshot/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-from-snapshot/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/package-lock.json index ad15d480..8fd67d36 100644 --- a/examples/typescript/daytona/create-daytona-from-snapshot/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-from-snapshot", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/package.json b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-from-snapshot/package.json rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/package.json index ed435476..717d912e 100644 --- a/examples/typescript/daytona/create-daytona-from-snapshot/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-from-snapshot/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-ephemeral/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-from-snapshot/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-ephemeral/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-from-snapshot/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-linked/.env.example b/examples/typescript/daytona/configuration/create-daytona-linked/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-linked/.env.example rename to examples/typescript/daytona/configuration/create-daytona-linked/.env.example diff --git a/examples/typescript/daytona/create-daytona-from-image/.gitignore b/examples/typescript/daytona/configuration/create-daytona-linked/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-from-image/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-linked/.gitignore diff --git a/examples/typescript/daytona/create-daytona-from-image/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-linked/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-from-image/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-linked/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-linked/README.md b/examples/typescript/daytona/configuration/create-daytona-linked/README.md similarity index 86% rename from examples/typescript/daytona/create-daytona-linked/README.md rename to examples/typescript/daytona/configuration/create-daytona-linked/README.md index 55d60405..620aabb8 100644 --- a/examples/typescript/daytona/create-daytona-linked/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-linked/README.md @@ -22,7 +22,7 @@ This example creates **two** cloud sandboxes. ## Run ```sh -cd examples/typescript/daytona/create-daytona-linked +cd examples/typescript/daytona/configuration/create-daytona-linked cp .env.example .env # Fill in the values below, then: npm install @@ -47,6 +47,6 @@ DAYTONA_API_KEY= ## Related -- [go twin](../../../go/daytona/create-daytona-linked/README.md) +- [go twin](../../../../go/daytona/configuration/create-daytona-linked/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-linked/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-linked/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-linked/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-linked/package-lock.json index 6acdd666..a0c5e2e4 100644 --- a/examples/typescript/daytona/create-daytona-linked/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-linked/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-linked", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-linked/package.json b/examples/typescript/daytona/configuration/create-daytona-linked/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-linked/package.json rename to examples/typescript/daytona/configuration/create-daytona-linked/package.json index 20a6bf02..90395d84 100644 --- a/examples/typescript/daytona/create-daytona-linked/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-linked/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-linked/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-linked/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-linked/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-linked/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-from-image/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-linked/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-from-image/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-linked/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-sandbox/.env.example b/examples/typescript/daytona/configuration/create-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-sandbox/.env.example rename to examples/typescript/daytona/configuration/create-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/create-daytona-sandbox/.gitignore b/examples/typescript/daytona/configuration/create-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-sandbox/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/create-daytona-sandbox/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-sandbox/README.md b/examples/typescript/daytona/configuration/create-daytona-sandbox/README.md similarity index 91% rename from examples/typescript/daytona/create-daytona-sandbox/README.md rename to examples/typescript/daytona/configuration/create-daytona-sandbox/README.md index 370bad53..b84612ba 100644 --- a/examples/typescript/daytona/create-daytona-sandbox/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-sandbox/README.md @@ -32,7 +32,7 @@ sandbox until you stop/delete it or a lifetime policy fires. ## Run ```sh -cd examples/typescript/daytona/create-daytona-sandbox +cd examples/typescript/daytona/configuration/create-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -63,6 +63,6 @@ resolve its supported environment credentials. Bearer auth maps through ## Related -- [go twin](../../../go/daytona/create-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/configuration/create-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-sandbox/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-sandbox/package-lock.json index 1fd1610f..66822e57 100644 --- a/examples/typescript/daytona/create-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-sandbox/package.json b/examples/typescript/daytona/configuration/create-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-sandbox/package.json rename to examples/typescript/daytona/configuration/create-daytona-sandbox/package.json index efeda6b4..c9ae7b33 100644 --- a/examples/typescript/daytona/create-daytona-sandbox/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-sandbox/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-sandbox/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-from-snapshot/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-with-kvm/.env.example b/examples/typescript/daytona/configuration/create-daytona-with-kvm/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-with-kvm/.env.example rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/.env.example diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/.gitignore b/examples/typescript/daytona/configuration/create-daytona-with-kvm/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-from-snapshot/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/.gitignore diff --git a/examples/typescript/daytona/create-daytona-from-snapshot/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-with-kvm/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-from-snapshot/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-with-kvm/README.md b/examples/typescript/daytona/configuration/create-daytona-with-kvm/README.md similarity index 88% rename from examples/typescript/daytona/create-daytona-with-kvm/README.md rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/README.md index 7179f610..813a1cc1 100644 --- a/examples/typescript/daytona/create-daytona-with-kvm/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-with-kvm/README.md @@ -14,7 +14,7 @@ Nested virtualization is optional and account-dependent. Kit does not invent an ## Run ```sh -cd examples/typescript/daytona/create-daytona-with-kvm +cd examples/typescript/daytona/configuration/create-daytona-with-kvm cp .env.example .env # Fill in the values below, then: npm install @@ -39,4 +39,4 @@ DAYTONA_API_KEY= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-with-kvm/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-with-kvm/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-with-kvm/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/package-lock.json index b01695cf..cf4891a0 100644 --- a/examples/typescript/daytona/create-daytona-with-kvm/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-kvm/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-with-kvm", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-with-kvm/package.json b/examples/typescript/daytona/configuration/create-daytona-with-kvm/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-with-kvm/package.json rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/package.json index a1696d33..880de97d 100644 --- a/examples/typescript/daytona/create-daytona-with-kvm/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-kvm/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-with-kvm/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-with-kvm/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-with-kvm/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-linked/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-with-kvm/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-linked/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-with-kvm/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-with-labels/.env.example b/examples/typescript/daytona/configuration/create-daytona-with-labels/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-with-labels/.env.example rename to examples/typescript/daytona/configuration/create-daytona-with-labels/.env.example diff --git a/examples/typescript/daytona/create-daytona-linked/.gitignore b/examples/typescript/daytona/configuration/create-daytona-with-labels/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-linked/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-with-labels/.gitignore diff --git a/examples/typescript/daytona/create-daytona-linked/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-with-labels/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-linked/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-with-labels/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-with-labels/README.md b/examples/typescript/daytona/configuration/create-daytona-with-labels/README.md similarity index 87% rename from examples/typescript/daytona/create-daytona-with-labels/README.md rename to examples/typescript/daytona/configuration/create-daytona-with-labels/README.md index c4079013..62643c20 100644 --- a/examples/typescript/daytona/create-daytona-with-labels/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-with-labels/README.md @@ -14,7 +14,7 @@ Labels become Daytona sandbox labels; environment variables are passed into the ## Run ```sh -cd examples/typescript/daytona/create-daytona-with-labels +cd examples/typescript/daytona/configuration/create-daytona-with-labels cp .env.example .env # Fill in the values below, then: npm install @@ -39,4 +39,4 @@ DAYTONA_API_KEY= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-with-labels/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-with-labels/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-with-labels/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-with-labels/package-lock.json index c57112da..c95bf296 100644 --- a/examples/typescript/daytona/create-daytona-with-labels/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-labels/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-with-labels", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-with-labels/package.json b/examples/typescript/daytona/configuration/create-daytona-with-labels/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-with-labels/package.json rename to examples/typescript/daytona/configuration/create-daytona-with-labels/package.json index 18f7bb1b..5230f1cf 100644 --- a/examples/typescript/daytona/create-daytona-with-labels/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-labels/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-with-labels/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-with-labels/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-with-labels/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-with-labels/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-with-labels/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-with-labels/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-with-network/.env.example b/examples/typescript/daytona/configuration/create-daytona-with-network/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-with-network/.env.example rename to examples/typescript/daytona/configuration/create-daytona-with-network/.env.example diff --git a/examples/typescript/daytona/create-daytona-with-kvm/.gitignore b/examples/typescript/daytona/configuration/create-daytona-with-network/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-with-kvm/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-with-network/.gitignore diff --git a/examples/typescript/daytona/create-daytona-with-kvm/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-with-network/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-with-kvm/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-with-network/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-with-network/README.md b/examples/typescript/daytona/configuration/create-daytona-with-network/README.md similarity index 89% rename from examples/typescript/daytona/create-daytona-with-network/README.md rename to examples/typescript/daytona/configuration/create-daytona-with-network/README.md index 93726e0a..25f7a9bd 100644 --- a/examples/typescript/daytona/create-daytona-with-network/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-with-network/README.md @@ -16,7 +16,7 @@ Daytona maps restricted egress to network allowlists. Kit validates CIDR/domain ## Run ```sh -cd examples/typescript/daytona/create-daytona-with-network +cd examples/typescript/daytona/configuration/create-daytona-with-network cp .env.example .env # Fill in the values below, then: npm install @@ -41,4 +41,4 @@ DAYTONA_API_KEY= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-with-network/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-with-network/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-with-network/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-with-network/package-lock.json index 85bdda56..0bd695aa 100644 --- a/examples/typescript/daytona/create-daytona-with-network/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-network/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-with-network", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-with-network/package.json b/examples/typescript/daytona/configuration/create-daytona-with-network/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-with-network/package.json rename to examples/typescript/daytona/configuration/create-daytona-with-network/package.json index 5d8b5797..f494783c 100644 --- a/examples/typescript/daytona/create-daytona-with-network/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-network/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-with-network/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-with-network/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-with-network/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-with-network/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-with-kvm/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-with-network/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-with-kvm/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-with-network/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-with-policies/.env.example b/examples/typescript/daytona/configuration/create-daytona-with-policies/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-with-policies/.env.example rename to examples/typescript/daytona/configuration/create-daytona-with-policies/.env.example diff --git a/examples/typescript/daytona/create-daytona-with-labels/.gitignore b/examples/typescript/daytona/configuration/create-daytona-with-policies/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-with-labels/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-with-policies/.gitignore diff --git a/examples/typescript/daytona/create-daytona-with-labels/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-with-policies/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-with-labels/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-with-policies/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-with-policies/README.md b/examples/typescript/daytona/configuration/create-daytona-with-policies/README.md similarity index 90% rename from examples/typescript/daytona/create-daytona-with-policies/README.md rename to examples/typescript/daytona/configuration/create-daytona-with-policies/README.md index 6ba8974c..5bf5797a 100644 --- a/examples/typescript/daytona/create-daytona-with-policies/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-with-policies/README.md @@ -32,7 +32,7 @@ Kit's [policy matrix](../../../../docs/sandbox-creation.md#policy-semantics) ## Run ```sh -cd examples/typescript/daytona/create-daytona-with-policies +cd examples/typescript/daytona/configuration/create-daytona-with-policies cp .env.example .env # Fill in the values below, then: npm install @@ -57,6 +57,6 @@ DAYTONA_API_KEY= ## Related -- [go twin](../../../go/daytona/create-daytona-with-policies/README.md) +- [go twin](../../../../go/daytona/configuration/create-daytona-with-policies/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-with-policies/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-with-policies/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-with-policies/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-with-policies/package-lock.json index d4c27fe1..a2509af0 100644 --- a/examples/typescript/daytona/create-daytona-with-policies/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-policies/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-with-policies", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-with-policies/package.json b/examples/typescript/daytona/configuration/create-daytona-with-policies/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-with-policies/package.json rename to examples/typescript/daytona/configuration/create-daytona-with-policies/package.json index e9f62fc5..63cb1dac 100644 --- a/examples/typescript/daytona/create-daytona-with-policies/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-policies/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-with-policies/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-with-policies/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-with-policies/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-with-policies/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-with-labels/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-with-policies/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-with-labels/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-with-policies/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-with-runtime/.env.example b/examples/typescript/daytona/configuration/create-daytona-with-runtime/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-with-runtime/.env.example rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/.env.example diff --git a/examples/typescript/daytona/create-daytona-with-network/.gitignore b/examples/typescript/daytona/configuration/create-daytona-with-runtime/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-with-network/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/.gitignore diff --git a/examples/typescript/daytona/create-daytona-with-network/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-with-runtime/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-with-network/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-with-runtime/README.md b/examples/typescript/daytona/configuration/create-daytona-with-runtime/README.md similarity index 85% rename from examples/typescript/daytona/create-daytona-with-runtime/README.md rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/README.md index 2a3a499e..47150736 100644 --- a/examples/typescript/daytona/create-daytona-with-runtime/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-with-runtime/README.md @@ -22,7 +22,7 @@ the snapshot's sandbox class. ## Run ```sh -cd examples/typescript/daytona/create-daytona-with-runtime +cd examples/typescript/daytona/configuration/create-daytona-with-runtime cp .env.example .env # Fill in the values below, then: npm install @@ -47,6 +47,6 @@ DAYTONA_API_KEY= ## Related -- [go twin](../../../go/daytona/create-daytona-with-runtime/README.md) +- [go twin](../../../../go/daytona/configuration/create-daytona-with-runtime/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-with-runtime/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-with-runtime/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-with-runtime/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/package-lock.json index e493d1ce..76d21444 100644 --- a/examples/typescript/daytona/create-daytona-with-runtime/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-runtime/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-with-runtime", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-with-runtime/package.json b/examples/typescript/daytona/configuration/create-daytona-with-runtime/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-with-runtime/package.json rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/package.json index d725ba9b..64b58ba5 100644 --- a/examples/typescript/daytona/create-daytona-with-runtime/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-runtime/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-with-runtime/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-with-runtime/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-with-runtime/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-with-network/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-with-runtime/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-with-network/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-with-runtime/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-with-secrets/.env.example b/examples/typescript/daytona/configuration/create-daytona-with-secrets/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-with-secrets/.env.example rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/.env.example diff --git a/examples/typescript/daytona/create-daytona-with-policies/.gitignore b/examples/typescript/daytona/configuration/create-daytona-with-secrets/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-with-policies/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/.gitignore diff --git a/examples/typescript/daytona/create-daytona-with-policies/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-with-secrets/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-with-policies/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-with-secrets/README.md b/examples/typescript/daytona/configuration/create-daytona-with-secrets/README.md similarity index 88% rename from examples/typescript/daytona/create-daytona-with-secrets/README.md rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/README.md index 90fae136..23779887 100644 --- a/examples/typescript/daytona/create-daytona-with-secrets/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-with-secrets/README.md @@ -14,7 +14,7 @@ Daytona secrets require an environment variable name and typically egress-placeh ## Run ```sh -cd examples/typescript/daytona/create-daytona-with-secrets +cd examples/typescript/daytona/configuration/create-daytona-with-secrets cp .env.example .env # Fill in the values below, then: npm install @@ -40,4 +40,4 @@ DAYTONA_SECRET_NAME= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-with-secrets/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-with-secrets/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-with-secrets/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/package-lock.json index 4f54f2d4..c26c78f3 100644 --- a/examples/typescript/daytona/create-daytona-with-secrets/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-secrets/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-with-secrets", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-with-secrets/package.json b/examples/typescript/daytona/configuration/create-daytona-with-secrets/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-with-secrets/package.json rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/package.json index 86c5240e..4b23f5d2 100644 --- a/examples/typescript/daytona/create-daytona-with-secrets/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-secrets/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-with-secrets/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-with-secrets/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-with-secrets/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-with-policies/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-with-secrets/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-with-policies/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-with-secrets/tsconfig.json diff --git a/examples/typescript/daytona/create-daytona-with-ttl/.env.example b/examples/typescript/daytona/configuration/create-daytona-with-ttl/.env.example similarity index 100% rename from examples/typescript/daytona/create-daytona-with-ttl/.env.example rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/.env.example diff --git a/examples/typescript/daytona/create-daytona-with-runtime/.gitignore b/examples/typescript/daytona/configuration/create-daytona-with-ttl/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-with-runtime/.gitignore rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/.gitignore diff --git a/examples/typescript/daytona/create-daytona-with-runtime/.nvmrc b/examples/typescript/daytona/configuration/create-daytona-with-ttl/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-with-runtime/.nvmrc rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/.nvmrc diff --git a/examples/typescript/daytona/create-daytona-with-ttl/README.md b/examples/typescript/daytona/configuration/create-daytona-with-ttl/README.md similarity index 88% rename from examples/typescript/daytona/create-daytona-with-ttl/README.md rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/README.md index 49c8331e..ad00aa31 100644 --- a/examples/typescript/daytona/create-daytona-with-ttl/README.md +++ b/examples/typescript/daytona/configuration/create-daytona-with-ttl/README.md @@ -16,7 +16,7 @@ whole-minute millisecond value. ## Run ```sh -cd examples/typescript/daytona/create-daytona-with-ttl +cd examples/typescript/daytona/configuration/create-daytona-with-ttl cp .env.example .env # Fill in the values below, then: npm install @@ -41,4 +41,4 @@ DAYTONA_API_KEY= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/create-daytona-with-ttl/package-lock.json b/examples/typescript/daytona/configuration/create-daytona-with-ttl/package-lock.json similarity index 86% rename from examples/typescript/daytona/create-daytona-with-ttl/package-lock.json rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/package-lock.json index ad65e578..259e1f9b 100644 --- a/examples/typescript/daytona/create-daytona-with-ttl/package-lock.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-ttl/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-daytona-with-ttl", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/create-daytona-with-ttl/package.json b/examples/typescript/daytona/configuration/create-daytona-with-ttl/package.json similarity index 73% rename from examples/typescript/daytona/create-daytona-with-ttl/package.json rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/package.json index 72e598a4..e8ff147d 100644 --- a/examples/typescript/daytona/create-daytona-with-ttl/package.json +++ b/examples/typescript/daytona/configuration/create-daytona-with-ttl/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/create-daytona-with-ttl/src/main.ts b/examples/typescript/daytona/configuration/create-daytona-with-ttl/src/main.ts similarity index 100% rename from examples/typescript/daytona/create-daytona-with-ttl/src/main.ts rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-with-runtime/tsconfig.json b/examples/typescript/daytona/configuration/create-daytona-with-ttl/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-with-runtime/tsconfig.json rename to examples/typescript/daytona/configuration/create-daytona-with-ttl/tsconfig.json diff --git a/examples/typescript/daytona/handle-daytona-errors/.env.example b/examples/typescript/daytona/errors/handle-daytona-errors/.env.example similarity index 100% rename from examples/typescript/daytona/handle-daytona-errors/.env.example rename to examples/typescript/daytona/errors/handle-daytona-errors/.env.example diff --git a/examples/typescript/daytona/create-daytona-with-secrets/.gitignore b/examples/typescript/daytona/errors/handle-daytona-errors/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-with-secrets/.gitignore rename to examples/typescript/daytona/errors/handle-daytona-errors/.gitignore diff --git a/examples/typescript/daytona/create-daytona-with-secrets/.nvmrc b/examples/typescript/daytona/errors/handle-daytona-errors/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-with-secrets/.nvmrc rename to examples/typescript/daytona/errors/handle-daytona-errors/.nvmrc diff --git a/examples/typescript/daytona/handle-daytona-errors/README.md b/examples/typescript/daytona/errors/handle-daytona-errors/README.md similarity index 85% rename from examples/typescript/daytona/handle-daytona-errors/README.md rename to examples/typescript/daytona/errors/handle-daytona-errors/README.md index f3b615d9..3d4e1ffb 100644 --- a/examples/typescript/daytona/handle-daytona-errors/README.md +++ b/examples/typescript/daytona/errors/handle-daytona-errors/README.md @@ -18,7 +18,7 @@ whole core count). Failures expose portable `kind`, `field`, `operation`, and ## Run ```sh -cd examples/typescript/daytona/handle-daytona-errors +cd examples/typescript/daytona/errors/handle-daytona-errors cp .env.example .env # Fill in the values below, then: npm install @@ -43,6 +43,6 @@ DAYTONA_API_KEY= ## Related -- [go twin](../../../go/daytona/handle-daytona-errors/README.md) +- [go twin](../../../../go/daytona/errors/handle-daytona-errors/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/handle-daytona-errors/package-lock.json b/examples/typescript/daytona/errors/handle-daytona-errors/package-lock.json similarity index 86% rename from examples/typescript/daytona/handle-daytona-errors/package-lock.json rename to examples/typescript/daytona/errors/handle-daytona-errors/package-lock.json index 1ee07bf8..b8e714bb 100644 --- a/examples/typescript/daytona/handle-daytona-errors/package-lock.json +++ b/examples/typescript/daytona/errors/handle-daytona-errors/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-handle-daytona-errors", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/handle-daytona-errors/package.json b/examples/typescript/daytona/errors/handle-daytona-errors/package.json similarity index 73% rename from examples/typescript/daytona/handle-daytona-errors/package.json rename to examples/typescript/daytona/errors/handle-daytona-errors/package.json index 86417440..91dc0b83 100644 --- a/examples/typescript/daytona/handle-daytona-errors/package.json +++ b/examples/typescript/daytona/errors/handle-daytona-errors/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/handle-daytona-errors/src/main.ts b/examples/typescript/daytona/errors/handle-daytona-errors/src/main.ts similarity index 100% rename from examples/typescript/daytona/handle-daytona-errors/src/main.ts rename to examples/typescript/daytona/errors/handle-daytona-errors/src/main.ts diff --git a/examples/typescript/daytona/create-daytona-with-secrets/tsconfig.json b/examples/typescript/daytona/errors/handle-daytona-errors/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-with-secrets/tsconfig.json rename to examples/typescript/daytona/errors/handle-daytona-errors/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/copy-file-from-daytona/.env.example b/examples/typescript/daytona/filesystem/copy-file-from-daytona/.env.example new file mode 100644 index 00000000..36c8dcb9 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-from-daytona/.env.example @@ -0,0 +1,8 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt diff --git a/examples/typescript/daytona/filesystem/copy-file-from-daytona/.gitignore b/examples/typescript/daytona/filesystem/copy-file-from-daytona/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-from-daytona/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/copy-file-from-daytona/README.md b/examples/typescript/daytona/filesystem/copy-file-from-daytona/README.md new file mode 100644 index 00000000..2fd141d3 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-from-daytona/README.md @@ -0,0 +1,52 @@ +# Copy a file from Daytona + +Copy `DAYTONA_REMOTE_PATH` from the sandbox to `DAYTONA_LOCAL_PATH` on this machine. The program loads that sandbox with `client.get`. + +## What this means + +The call copies `DAYTONA_REMOTE_PATH` from the sandbox to `DAYTONA_LOCAL_PATH` on this machine. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Daytona is called. The error field is `local_path`. +- A missing remote file comes back from Daytona as not found. +- A missing local parent directory is created. A local directory is an invalid argument, and the field is `local_path`. +- An existing local file is replaced. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/copy-file-from-daytona +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the local file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/copy-file-from-daytona/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/copy-file-from-daytona/package-lock.json b/examples/typescript/daytona/filesystem/copy-file-from-daytona/package-lock.json new file mode 100644 index 00000000..cb7d7657 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-from-daytona/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-copy-file-from-daytona", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-copy-file-from-daytona", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/copy-file-from-daytona/package.json b/examples/typescript/daytona/filesystem/copy-file-from-daytona/package.json new file mode 100644 index 00000000..86d590b4 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-from-daytona/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-copy-file-from-daytona", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/copy-file-from-daytona/src/main.ts b/examples/typescript/daytona/filesystem/copy-file-from-daytona/src/main.ts new file mode 100644 index 00000000..19d7c1ce --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-from-daytona/src/main.ts @@ -0,0 +1,16 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +const local = process.env.DAYTONA_LOCAL_PATH!; +await sandbox.filesystem.copyToLocal(remote, local); +console.log(`copied ${remote} to ${local}`); diff --git a/examples/typescript/daytona/create-daytona-with-ttl/tsconfig.json b/examples/typescript/daytona/filesystem/copy-file-from-daytona/tsconfig.json similarity index 100% rename from examples/typescript/daytona/create-daytona-with-ttl/tsconfig.json rename to examples/typescript/daytona/filesystem/copy-file-from-daytona/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/copy-file-into-daytona/.env.example b/examples/typescript/daytona/filesystem/copy-file-into-daytona/.env.example new file mode 100644 index 00000000..36c8dcb9 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-into-daytona/.env.example @@ -0,0 +1,8 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt diff --git a/examples/typescript/daytona/filesystem/copy-file-into-daytona/.gitignore b/examples/typescript/daytona/filesystem/copy-file-into-daytona/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-into-daytona/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/copy-file-into-daytona/README.md b/examples/typescript/daytona/filesystem/copy-file-into-daytona/README.md new file mode 100644 index 00000000..6b91d2d7 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-into-daytona/README.md @@ -0,0 +1,51 @@ +# Copy a file into Daytona + +Copy `DAYTONA_LOCAL_PATH` on this machine to `DAYTONA_REMOTE_PATH` in the sandbox. The program loads that sandbox with `client.get`. + +## What this means + +The call copies `DAYTONA_LOCAL_PATH` on this machine to `DAYTONA_REMOTE_PATH` in the sandbox. Missing parent directories of the remote file are created. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Daytona is called. The error field is `local_path`. +- A missing local file is not found before Daytona is called. The error field is `local_path`. A directory at that path is an invalid argument with the same field. +- An existing remote file is replaced. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/copy-file-into-daytona +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +DAYTONA_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the remote file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/copy-file-into-daytona/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/copy-file-into-daytona/package-lock.json b/examples/typescript/daytona/filesystem/copy-file-into-daytona/package-lock.json new file mode 100644 index 00000000..8e6aac60 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-into-daytona/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-copy-file-into-daytona", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-copy-file-into-daytona", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/copy-file-into-daytona/package.json b/examples/typescript/daytona/filesystem/copy-file-into-daytona/package.json new file mode 100644 index 00000000..d57f04f7 --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-into-daytona/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-copy-file-into-daytona", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/copy-file-into-daytona/src/main.ts b/examples/typescript/daytona/filesystem/copy-file-into-daytona/src/main.ts new file mode 100644 index 00000000..0af5f63e --- /dev/null +++ b/examples/typescript/daytona/filesystem/copy-file-into-daytona/src/main.ts @@ -0,0 +1,16 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +const local = process.env.DAYTONA_LOCAL_PATH!; +await sandbox.filesystem.copyFromLocal(local, remote); +console.log(`copied ${local} to ${remote}`); diff --git a/examples/typescript/daytona/delete-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/filesystem/copy-file-into-daytona/tsconfig.json similarity index 100% rename from examples/typescript/daytona/delete-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/filesystem/copy-file-into-daytona/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/list-daytona-directory/.env.example b/examples/typescript/daytona/filesystem/list-daytona-directory/.env.example new file mode 100644 index 00000000..04b400d2 --- /dev/null +++ b/examples/typescript/daytona/filesystem/list-daytona-directory/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/typescript/daytona/filesystem/list-daytona-directory/.gitignore b/examples/typescript/daytona/filesystem/list-daytona-directory/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/list-daytona-directory/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/list-daytona-directory/README.md b/examples/typescript/daytona/filesystem/list-daytona-directory/README.md new file mode 100644 index 00000000..857a0399 --- /dev/null +++ b/examples/typescript/daytona/filesystem/list-daytona-directory/README.md @@ -0,0 +1,50 @@ +# List a Daytona directory + +Print the names in the directory at `DAYTONA_REMOTE_PATH`. The program loads that sandbox with `client.get`. + +## What this means + +The call prints the names in one directory. It does not walk into subdirectories. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- A missing directory comes back from Daytona as not found. +- A file path fails at the provider. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/list-daytona-directory +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Needs an existing sandbox and a directory at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/list-daytona-directory/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/list-daytona-directory/package-lock.json b/examples/typescript/daytona/filesystem/list-daytona-directory/package-lock.json new file mode 100644 index 00000000..febb26c4 --- /dev/null +++ b/examples/typescript/daytona/filesystem/list-daytona-directory/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-list-daytona-directory", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-list-daytona-directory", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/list-daytona-directory/package.json b/examples/typescript/daytona/filesystem/list-daytona-directory/package.json new file mode 100644 index 00000000..58152390 --- /dev/null +++ b/examples/typescript/daytona/filesystem/list-daytona-directory/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-list-daytona-directory", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/list-daytona-directory/src/main.ts b/examples/typescript/daytona/filesystem/list-daytona-directory/src/main.ts new file mode 100644 index 00000000..76a5e84b --- /dev/null +++ b/examples/typescript/daytona/filesystem/list-daytona-directory/src/main.ts @@ -0,0 +1,16 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +const entries = await sandbox.filesystem.listDirectory(remote); +console.log(`${remote} (${entries.length} entries)`); +for (const entry of entries) console.log(entry.name); diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/filesystem/list-daytona-directory/tsconfig.json similarity index 100% rename from examples/typescript/daytona/force-stop-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/filesystem/list-daytona-directory/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/make-daytona-directory/.env.example b/examples/typescript/daytona/filesystem/make-daytona-directory/.env.example new file mode 100644 index 00000000..5c501883 --- /dev/null +++ b/examples/typescript/daytona/filesystem/make-daytona-directory/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/kit-files + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/typescript/daytona/filesystem/make-daytona-directory/.gitignore b/examples/typescript/daytona/filesystem/make-daytona-directory/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/make-daytona-directory/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/make-daytona-directory/README.md b/examples/typescript/daytona/filesystem/make-daytona-directory/README.md new file mode 100644 index 00000000..087ec138 --- /dev/null +++ b/examples/typescript/daytona/filesystem/make-daytona-directory/README.md @@ -0,0 +1,51 @@ +# Create a Daytona directory + +Create the directory at `DAYTONA_REMOTE_PATH`, including any missing parents. The program loads that sandbox with `client.get`. + +## What this means + +The call creates `DAYTONA_REMOTE_PATH` and any missing parents. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- `parents` defaults to true and creates missing parents. +- `parents: false` is rejected before Daytona is called. +- Daytona returns an error when that directory already exists. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/make-daytona-directory +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/kit-files + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Creates the directory inside the existing sandbox. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/make-daytona-directory/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/make-daytona-directory/package-lock.json b/examples/typescript/daytona/filesystem/make-daytona-directory/package-lock.json new file mode 100644 index 00000000..8485c4e0 --- /dev/null +++ b/examples/typescript/daytona/filesystem/make-daytona-directory/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-make-daytona-directory", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-make-daytona-directory", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/make-daytona-directory/package.json b/examples/typescript/daytona/filesystem/make-daytona-directory/package.json new file mode 100644 index 00000000..9b11127a --- /dev/null +++ b/examples/typescript/daytona/filesystem/make-daytona-directory/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-make-daytona-directory", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/make-daytona-directory/src/main.ts b/examples/typescript/daytona/filesystem/make-daytona-directory/src/main.ts new file mode 100644 index 00000000..eb3a7579 --- /dev/null +++ b/examples/typescript/daytona/filesystem/make-daytona-directory/src/main.ts @@ -0,0 +1,15 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +await sandbox.filesystem.makeDirectory(remote); +console.log(`created ${remote}`); diff --git a/examples/typescript/daytona/get-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/filesystem/make-daytona-directory/tsconfig.json similarity index 100% rename from examples/typescript/daytona/get-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/filesystem/make-daytona-directory/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/read-daytona-file/.env.example b/examples/typescript/daytona/filesystem/read-daytona-file/.env.example new file mode 100644 index 00000000..b06909e8 --- /dev/null +++ b/examples/typescript/daytona/filesystem/read-daytona-file/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/typescript/daytona/filesystem/read-daytona-file/.gitignore b/examples/typescript/daytona/filesystem/read-daytona-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/read-daytona-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/read-daytona-file/README.md b/examples/typescript/daytona/filesystem/read-daytona-file/README.md new file mode 100644 index 00000000..773e8a81 --- /dev/null +++ b/examples/typescript/daytona/filesystem/read-daytona-file/README.md @@ -0,0 +1,50 @@ +# Read a Daytona file + +Read the bytes at `DAYTONA_REMOTE_PATH` with `Filesystem.ReadFile` / `sandbox.filesystem.readFile`. The program loads that sandbox with `client.get`. + +## What this means + +The call returns the file contents as bytes. Decode text in your own program. The sandbox path is absolute. + +## Edge cases + +- A relative path, a blank path, or a path that contains a NUL byte is rejected before Daytona is called. The error field is `path`. +- A missing file comes back from Daytona as not found. +- A directory path fails at the provider. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/read-daytona-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Needs an existing sandbox and a file at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/read-daytona-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/read-daytona-file/package-lock.json b/examples/typescript/daytona/filesystem/read-daytona-file/package-lock.json new file mode 100644 index 00000000..feb82d9b --- /dev/null +++ b/examples/typescript/daytona/filesystem/read-daytona-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-read-daytona-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-read-daytona-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/read-daytona-file/package.json b/examples/typescript/daytona/filesystem/read-daytona-file/package.json new file mode 100644 index 00000000..a8f4f38b --- /dev/null +++ b/examples/typescript/daytona/filesystem/read-daytona-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-read-daytona-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/read-daytona-file/src/main.ts b/examples/typescript/daytona/filesystem/read-daytona-file/src/main.ts new file mode 100644 index 00000000..18e60c22 --- /dev/null +++ b/examples/typescript/daytona/filesystem/read-daytona-file/src/main.ts @@ -0,0 +1,15 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +const data = await sandbox.filesystem.readFile(remote); +console.log(`read ${remote} (${data.byteLength} bytes)`); diff --git a/examples/typescript/daytona/handle-daytona-errors/tsconfig.json b/examples/typescript/daytona/filesystem/read-daytona-file/tsconfig.json similarity index 100% rename from examples/typescript/daytona/handle-daytona-errors/tsconfig.json rename to examples/typescript/daytona/filesystem/read-daytona-file/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/remove-daytona-file/.env.example b/examples/typescript/daytona/filesystem/remove-daytona-file/.env.example new file mode 100644 index 00000000..de595213 --- /dev/null +++ b/examples/typescript/daytona/filesystem/remove-daytona-file/.env.example @@ -0,0 +1,8 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +# DAYTONA_RECURSIVE=true diff --git a/examples/typescript/daytona/filesystem/remove-daytona-file/.gitignore b/examples/typescript/daytona/filesystem/remove-daytona-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/remove-daytona-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/remove-daytona-file/README.md b/examples/typescript/daytona/filesystem/remove-daytona-file/README.md new file mode 100644 index 00000000..5b5a5d7b --- /dev/null +++ b/examples/typescript/daytona/filesystem/remove-daytona-file/README.md @@ -0,0 +1,51 @@ +# Remove a Daytona path + +Delete `DAYTONA_REMOTE_PATH`. The program loads that sandbox with `client.get`. + +## What this means + +The call deletes `DAYTONA_REMOTE_PATH`. With `DAYTONA_RECURSIVE` unset, it removes a file or an empty directory. Set `DAYTONA_RECURSIVE=true` to delete a directory and its contents. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- A missing path comes back from Daytona as not found. +- A directory that still has entries fails when `DAYTONA_RECURSIVE` is unset. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/remove-daytona-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= +# DAYTONA_RECURSIVE=true + +``` + +## Warnings + +- Deletes the remote path. A recursive delete removes the directory and everything inside it. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/remove-daytona-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/remove-daytona-file/package-lock.json b/examples/typescript/daytona/filesystem/remove-daytona-file/package-lock.json new file mode 100644 index 00000000..3b05b760 --- /dev/null +++ b/examples/typescript/daytona/filesystem/remove-daytona-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-remove-daytona-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-remove-daytona-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/remove-daytona-file/package.json b/examples/typescript/daytona/filesystem/remove-daytona-file/package.json new file mode 100644 index 00000000..17d04f06 --- /dev/null +++ b/examples/typescript/daytona/filesystem/remove-daytona-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-remove-daytona-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/remove-daytona-file/src/main.ts b/examples/typescript/daytona/filesystem/remove-daytona-file/src/main.ts new file mode 100644 index 00000000..bd030b97 --- /dev/null +++ b/examples/typescript/daytona/filesystem/remove-daytona-file/src/main.ts @@ -0,0 +1,16 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +const recursive = process.env.DAYTONA_RECURSIVE === "true"; +await sandbox.filesystem.remove(remote, recursive ? { recursive: true } : {}); +console.log(`removed ${remote}`); diff --git a/examples/typescript/daytona/pause-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/filesystem/remove-daytona-file/tsconfig.json similarity index 100% rename from examples/typescript/daytona/pause-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/filesystem/remove-daytona-file/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/stat-daytona-file/.env.example b/examples/typescript/daytona/filesystem/stat-daytona-file/.env.example new file mode 100644 index 00000000..b06909e8 --- /dev/null +++ b/examples/typescript/daytona/filesystem/stat-daytona-file/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/typescript/daytona/filesystem/stat-daytona-file/.gitignore b/examples/typescript/daytona/filesystem/stat-daytona-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/stat-daytona-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/stat-daytona-file/README.md b/examples/typescript/daytona/filesystem/stat-daytona-file/README.md new file mode 100644 index 00000000..400d923c --- /dev/null +++ b/examples/typescript/daytona/filesystem/stat-daytona-file/README.md @@ -0,0 +1,49 @@ +# Stat a Daytona path + +Print the path, type, and size of `DAYTONA_REMOTE_PATH`. The program loads that sandbox with `client.get`. + +## What this means + +The call prints the path, type, and size. Daytona reports a file or a directory. + +## Edge cases + +- A relative path is rejected before Daytona is called. +- A missing path comes back from Daytona as not found. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/stat-daytona-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Needs an existing sandbox and a path at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/stat-daytona-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/stat-daytona-file/package-lock.json b/examples/typescript/daytona/filesystem/stat-daytona-file/package-lock.json new file mode 100644 index 00000000..f38f24b0 --- /dev/null +++ b/examples/typescript/daytona/filesystem/stat-daytona-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-stat-daytona-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-stat-daytona-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/stat-daytona-file/package.json b/examples/typescript/daytona/filesystem/stat-daytona-file/package.json new file mode 100644 index 00000000..5a95b51c --- /dev/null +++ b/examples/typescript/daytona/filesystem/stat-daytona-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-stat-daytona-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/stat-daytona-file/src/main.ts b/examples/typescript/daytona/filesystem/stat-daytona-file/src/main.ts new file mode 100644 index 00000000..1a151645 --- /dev/null +++ b/examples/typescript/daytona/filesystem/stat-daytona-file/src/main.ts @@ -0,0 +1,15 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +const info = await sandbox.filesystem.stat(remote); +console.log(`${info.path} type=${info.type} size=${info.size}`); diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/filesystem/stat-daytona-file/tsconfig.json similarity index 100% rename from examples/typescript/daytona/refresh-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/filesystem/stat-daytona-file/tsconfig.json diff --git a/examples/typescript/daytona/filesystem/write-daytona-file/.env.example b/examples/typescript/daytona/filesystem/write-daytona-file/.env.example new file mode 100644 index 00000000..b06909e8 --- /dev/null +++ b/examples/typescript/daytona/filesystem/write-daytona-file/.env.example @@ -0,0 +1,7 @@ +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= diff --git a/examples/typescript/daytona/filesystem/write-daytona-file/.gitignore b/examples/typescript/daytona/filesystem/write-daytona-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/daytona/filesystem/write-daytona-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/daytona/filesystem/write-daytona-file/README.md b/examples/typescript/daytona/filesystem/write-daytona-file/README.md new file mode 100644 index 00000000..e9f4d3fe --- /dev/null +++ b/examples/typescript/daytona/filesystem/write-daytona-file/README.md @@ -0,0 +1,50 @@ +# Write a Daytona file + +Replace the file at `DAYTONA_REMOTE_PATH` with the bytes of `hello from sandbox-kit`. The program loads that sandbox with `client.get`. + +## What this means + +The call replaces the file with the bytes of `hello from sandbox-kit` and creates any missing parent directories. + +## Edge cases + +- A relative sandbox path is rejected before Daytona is called. The error field is `path`. +- An existing file at that path is replaced. +- A path that names a directory fails at the provider. + +## Run + +```sh +cd examples/typescript/daytona/filesystem/write-daytona-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +DAYTONA_API_KEY= +DAYTONA_SANDBOX_ID= +DAYTONA_REMOTE_PATH=/tmp/note.txt + +# Optional Daytona endpoint and target overrides. +# DAYTONA_API_URL=https://app.daytona.io/api +# DAYTONA_TARGET= + +``` + +## Warnings + +- Overwrites the file at `DAYTONA_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/daytona/filesystem/write-daytona-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/filesystem/write-daytona-file/package-lock.json b/examples/typescript/daytona/filesystem/write-daytona-file/package-lock.json new file mode 100644 index 00000000..c59d50a0 --- /dev/null +++ b/examples/typescript/daytona/filesystem/write-daytona-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-write-daytona-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-write-daytona-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/daytona": { + "name": "@sandbox-kit/daytona", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@daytona/sdk": "0.225.0", + "@sandbox-kit/sandbox": "0.1.5" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/daytona": { + "resolved": "../../../../../sdks/typescript/providers/daytona", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/daytona/filesystem/write-daytona-file/package.json b/examples/typescript/daytona/filesystem/write-daytona-file/package.json new file mode 100644 index 00000000..8aaf9d9b --- /dev/null +++ b/examples/typescript/daytona/filesystem/write-daytona-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-write-daytona-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/daytona/filesystem/write-daytona-file/src/main.ts b/examples/typescript/daytona/filesystem/write-daytona-file/src/main.ts new file mode 100644 index 00000000..7a6ffa00 --- /dev/null +++ b/examples/typescript/daytona/filesystem/write-daytona-file/src/main.ts @@ -0,0 +1,16 @@ +import { daytona } from "@sandbox-kit/daytona"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: daytona(), + auth: { apiKey: { key: process.env.DAYTONA_API_KEY! } }, + timeout: 120_000, + ...(process.env.DAYTONA_API_URL ? { endpoint: process.env.DAYTONA_API_URL } : {}), + ...(process.env.DAYTONA_TARGET ? { region: process.env.DAYTONA_TARGET } : {}), +}); + +const sandbox = await client.get(process.env.DAYTONA_SANDBOX_ID!); +const remote = process.env.DAYTONA_REMOTE_PATH!; +const body = new TextEncoder().encode("hello from sandbox-kit\n"); +await sandbox.filesystem.writeFile(remote, body); +console.log(`wrote ${remote} (${body.byteLength} bytes)`); diff --git a/examples/typescript/daytona/request-daytona-deletion/tsconfig.json b/examples/typescript/daytona/filesystem/write-daytona-file/tsconfig.json similarity index 100% rename from examples/typescript/daytona/request-daytona-deletion/tsconfig.json rename to examples/typescript/daytona/filesystem/write-daytona-file/tsconfig.json diff --git a/examples/typescript/daytona/archive-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/archive-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/create-daytona-with-ttl/.gitignore b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/create-daytona-with-ttl/.gitignore rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/create-daytona-with-ttl/.nvmrc b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/create-daytona-with-ttl/.nvmrc rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/archive-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/README.md similarity index 82% rename from examples/typescript/daytona/archive-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/README.md index 5dfcda63..9a8ca206 100644 --- a/examples/typescript/daytona/archive-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/README.md @@ -17,7 +17,7 @@ accepts or rejects that sandbox. See ## Run ```sh -cd examples/typescript/daytona/archive-daytona-sandbox +cd examples/typescript/daytona/lifecycle/archive-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -44,6 +44,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/archive-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/lifecycle/archive-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/archive-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/archive-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/package-lock.json index c5c9c2b4..aebb86d8 100644 --- a/examples/typescript/daytona/archive-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-archive-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/archive-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/archive-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/package.json index 8f2d1f60..293c6423 100644 --- a/examples/typescript/daytona/archive-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/archive-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/archive-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/src/main.ts diff --git a/examples/typescript/daytona/start-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/lifecycle/archive-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/daytona/start-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/lifecycle/archive-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/close-daytona-handle/.env.example b/examples/typescript/daytona/lifecycle/close-daytona-handle/.env.example similarity index 100% rename from examples/typescript/daytona/close-daytona-handle/.env.example rename to examples/typescript/daytona/lifecycle/close-daytona-handle/.env.example diff --git a/examples/typescript/daytona/delete-daytona-sandbox/.gitignore b/examples/typescript/daytona/lifecycle/close-daytona-handle/.gitignore similarity index 100% rename from examples/typescript/daytona/delete-daytona-sandbox/.gitignore rename to examples/typescript/daytona/lifecycle/close-daytona-handle/.gitignore diff --git a/examples/typescript/daytona/delete-daytona-sandbox/.nvmrc b/examples/typescript/daytona/lifecycle/close-daytona-handle/.nvmrc similarity index 100% rename from examples/typescript/daytona/delete-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/lifecycle/close-daytona-handle/.nvmrc diff --git a/examples/typescript/daytona/close-daytona-handle/README.md b/examples/typescript/daytona/lifecycle/close-daytona-handle/README.md similarity index 84% rename from examples/typescript/daytona/close-daytona-handle/README.md rename to examples/typescript/daytona/lifecycle/close-daytona-handle/README.md index b060c8bc..1c595926 100644 --- a/examples/typescript/daytona/close-daytona-handle/README.md +++ b/examples/typescript/daytona/lifecycle/close-daytona-handle/README.md @@ -17,7 +17,7 @@ You can keep using the handle. The next call returns Daytona's result. ## Run ```sh -cd examples/typescript/daytona/close-daytona-handle +cd examples/typescript/daytona/lifecycle/close-daytona-handle cp .env.example .env # Fill in the values below, then: npm install @@ -43,6 +43,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/close-daytona-handle/README.md) +- [go twin](../../../../go/daytona/lifecycle/close-daytona-handle/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/close-daytona-handle/package-lock.json b/examples/typescript/daytona/lifecycle/close-daytona-handle/package-lock.json similarity index 86% rename from examples/typescript/daytona/close-daytona-handle/package-lock.json rename to examples/typescript/daytona/lifecycle/close-daytona-handle/package-lock.json index ec1d3d14..4b6ed538 100644 --- a/examples/typescript/daytona/close-daytona-handle/package-lock.json +++ b/examples/typescript/daytona/lifecycle/close-daytona-handle/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-close-daytona-handle", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/close-daytona-handle/package.json b/examples/typescript/daytona/lifecycle/close-daytona-handle/package.json similarity index 73% rename from examples/typescript/daytona/close-daytona-handle/package.json rename to examples/typescript/daytona/lifecycle/close-daytona-handle/package.json index 8be2e2a3..9607dce4 100644 --- a/examples/typescript/daytona/close-daytona-handle/package.json +++ b/examples/typescript/daytona/lifecycle/close-daytona-handle/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/close-daytona-handle/src/main.ts b/examples/typescript/daytona/lifecycle/close-daytona-handle/src/main.ts similarity index 100% rename from examples/typescript/daytona/close-daytona-handle/src/main.ts rename to examples/typescript/daytona/lifecycle/close-daytona-handle/src/main.ts diff --git a/examples/typescript/daytona/start-daytona-with-timeout/tsconfig.json b/examples/typescript/daytona/lifecycle/close-daytona-handle/tsconfig.json similarity index 100% rename from examples/typescript/daytona/start-daytona-with-timeout/tsconfig.json rename to examples/typescript/daytona/lifecycle/close-daytona-handle/tsconfig.json diff --git a/examples/typescript/daytona/delete-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/delete-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/.gitignore b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/force-stop-daytona-sandbox/.gitignore rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/.nvmrc b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/force-stop-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/delete-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/README.md similarity index 84% rename from examples/typescript/daytona/delete-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/README.md index 801b4cbd..db23a0a2 100644 --- a/examples/typescript/daytona/delete-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/README.md @@ -18,7 +18,7 @@ result. ## Run ```sh -cd examples/typescript/daytona/delete-daytona-sandbox +cd examples/typescript/daytona/lifecycle/delete-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -45,6 +45,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/delete-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/lifecycle/delete-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/delete-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/delete-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/package-lock.json index 3bcea90f..db03c604 100644 --- a/examples/typescript/daytona/delete-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-delete-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/delete-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/delete-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/package.json index 1618c490..2390c1e5 100644 --- a/examples/typescript/daytona/delete-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/delete-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/delete-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/src/main.ts diff --git a/examples/typescript/daytona/stop-daytona-sandbox/tsconfig.json b/examples/typescript/daytona/lifecycle/delete-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/daytona/stop-daytona-sandbox/tsconfig.json rename to examples/typescript/daytona/lifecycle/delete-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/force-stop-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/get-daytona-sandbox/.gitignore b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/get-daytona-sandbox/.gitignore rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/get-daytona-sandbox/.nvmrc b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/get-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/README.md similarity index 89% rename from examples/typescript/daytona/force-stop-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/README.md index 5f257b03..58c52666 100644 --- a/examples/typescript/daytona/force-stop-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/README.md @@ -17,7 +17,7 @@ options bag as the call timeout. ## Run ```sh -cd examples/typescript/daytona/force-stop-daytona-sandbox +cd examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -44,4 +44,4 @@ DAYTONA_SANDBOX_ID= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/force-stop-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/package-lock.json index 8bbe4de7..39373a55 100644 --- a/examples/typescript/daytona/force-stop-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-force-stop-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/force-stop-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/package.json index e7c08b39..32a87dec 100644 --- a/examples/typescript/daytona/force-stop-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/force-stop-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/force-stop-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/src/main.ts diff --git a/examples/typescript/modal/attach-modal-sandbox/tsconfig.json b/examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/modal/attach-modal-sandbox/tsconfig.json rename to examples/typescript/daytona/lifecycle/force-stop-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/get-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/get-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/handle-daytona-errors/.gitignore b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/handle-daytona-errors/.gitignore rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/handle-daytona-errors/.nvmrc b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/handle-daytona-errors/.nvmrc rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/get-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/README.md similarity index 85% rename from examples/typescript/daytona/get-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/README.md index 4a1cc0c0..43105b71 100644 --- a/examples/typescript/daytona/get-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/README.md @@ -18,7 +18,7 @@ Capabilities list the lifecycle methods Daytona implements. ## Run ```sh -cd examples/typescript/daytona/get-daytona-sandbox +cd examples/typescript/daytona/lifecycle/get-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -44,6 +44,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/get-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/lifecycle/get-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/get-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/get-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/package-lock.json index 95c02345..d555f89d 100644 --- a/examples/typescript/daytona/get-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-get-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/get-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/get-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/package.json index fe5a8d09..25974386 100644 --- a/examples/typescript/daytona/get-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/get-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/get-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/src/main.ts diff --git a/examples/typescript/modal/close-modal-handle/tsconfig.json b/examples/typescript/daytona/lifecycle/get-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/modal/close-modal-handle/tsconfig.json rename to examples/typescript/daytona/lifecycle/get-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/pause-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/pause-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/pause-daytona-sandbox/.gitignore b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/pause-daytona-sandbox/.gitignore rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/pause-daytona-sandbox/.nvmrc b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/pause-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/pause-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/README.md similarity index 83% rename from examples/typescript/daytona/pause-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/README.md index 74fc1725..4a04cb27 100644 --- a/examples/typescript/daytona/pause-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/README.md @@ -17,7 +17,7 @@ sandbox. See Daytona's lifecycle docs under ## Run ```sh -cd examples/typescript/daytona/pause-daytona-sandbox +cd examples/typescript/daytona/lifecycle/pause-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -44,6 +44,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/pause-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/lifecycle/pause-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/pause-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/pause-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/package-lock.json index fb87c854..3a513cbf 100644 --- a/examples/typescript/daytona/pause-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-pause-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/pause-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/pause-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/package.json index 4d88f14f..dd35cc83 100644 --- a/examples/typescript/daytona/pause-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/pause-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/pause-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/src/main.ts diff --git a/examples/typescript/modal/create-modal-client-timeout/tsconfig.json b/examples/typescript/daytona/lifecycle/pause-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-client-timeout/tsconfig.json rename to examples/typescript/daytona/lifecycle/pause-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/refresh-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/.gitignore b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/refresh-daytona-sandbox/.gitignore rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/.nvmrc b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/refresh-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/README.md similarity index 82% rename from examples/typescript/daytona/refresh-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/README.md index 84c282f7..a13c29b0 100644 --- a/examples/typescript/daytona/refresh-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/README.md @@ -16,7 +16,7 @@ or delete the sandbox. Useful after another process may have changed state. ## Run ```sh -cd examples/typescript/daytona/refresh-daytona-sandbox +cd examples/typescript/daytona/lifecycle/refresh-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -42,6 +42,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/refresh-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/lifecycle/refresh-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/refresh-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/package-lock.json index fbe376f6..cadc4bf2 100644 --- a/examples/typescript/daytona/refresh-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-refresh-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/refresh-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/package.json index d856e826..56371366 100644 --- a/examples/typescript/daytona/refresh-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/refresh-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/refresh-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/src/main.ts diff --git a/examples/typescript/modal/create-modal-gvisor/tsconfig.json b/examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-gvisor/tsconfig.json rename to examples/typescript/daytona/lifecycle/refresh-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/request-daytona-deletion/.env.example b/examples/typescript/daytona/lifecycle/request-daytona-deletion/.env.example similarity index 100% rename from examples/typescript/daytona/request-daytona-deletion/.env.example rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/.env.example diff --git a/examples/typescript/daytona/request-daytona-deletion/.gitignore b/examples/typescript/daytona/lifecycle/request-daytona-deletion/.gitignore similarity index 100% rename from examples/typescript/daytona/request-daytona-deletion/.gitignore rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/.gitignore diff --git a/examples/typescript/daytona/request-daytona-deletion/.nvmrc b/examples/typescript/daytona/lifecycle/request-daytona-deletion/.nvmrc similarity index 100% rename from examples/typescript/daytona/request-daytona-deletion/.nvmrc rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/.nvmrc diff --git a/examples/typescript/daytona/request-daytona-deletion/README.md b/examples/typescript/daytona/lifecycle/request-daytona-deletion/README.md similarity index 89% rename from examples/typescript/daytona/request-daytona-deletion/README.md rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/README.md index b2ba4861..eff12bdc 100644 --- a/examples/typescript/daytona/request-daytona-deletion/README.md +++ b/examples/typescript/daytona/lifecycle/request-daytona-deletion/README.md @@ -16,7 +16,7 @@ accepted. The handle stores the metadata Daytona returns with that response. ## Run ```sh -cd examples/typescript/daytona/request-daytona-deletion +cd examples/typescript/daytona/lifecycle/request-daytona-deletion cp .env.example .env # Fill in the values below, then: npm install @@ -43,4 +43,4 @@ DAYTONA_SANDBOX_ID= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/request-daytona-deletion/package-lock.json b/examples/typescript/daytona/lifecycle/request-daytona-deletion/package-lock.json similarity index 86% rename from examples/typescript/daytona/request-daytona-deletion/package-lock.json rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/package-lock.json index a97f6fa9..4589a03d 100644 --- a/examples/typescript/daytona/request-daytona-deletion/package-lock.json +++ b/examples/typescript/daytona/lifecycle/request-daytona-deletion/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-request-daytona-deletion", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/request-daytona-deletion/package.json b/examples/typescript/daytona/lifecycle/request-daytona-deletion/package.json similarity index 73% rename from examples/typescript/daytona/request-daytona-deletion/package.json rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/package.json index 42583433..ec54b452 100644 --- a/examples/typescript/daytona/request-daytona-deletion/package.json +++ b/examples/typescript/daytona/lifecycle/request-daytona-deletion/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/request-daytona-deletion/src/main.ts b/examples/typescript/daytona/lifecycle/request-daytona-deletion/src/main.ts similarity index 100% rename from examples/typescript/daytona/request-daytona-deletion/src/main.ts rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/src/main.ts diff --git a/examples/typescript/modal/create-modal-idle/tsconfig.json b/examples/typescript/daytona/lifecycle/request-daytona-deletion/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-idle/tsconfig.json rename to examples/typescript/daytona/lifecycle/request-daytona-deletion/tsconfig.json diff --git a/examples/typescript/daytona/start-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/start-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/start-daytona-sandbox/.gitignore b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/start-daytona-sandbox/.gitignore rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/start-daytona-sandbox/.nvmrc b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/start-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/start-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/README.md similarity index 84% rename from examples/typescript/daytona/start-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/README.md index 51bba34a..24d971a4 100644 --- a/examples/typescript/daytona/start-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/README.md @@ -17,7 +17,7 @@ can be started again. See [persistence](https://www.daytona.io/docs/en/persisten ## Run ```sh -cd examples/typescript/daytona/start-daytona-sandbox +cd examples/typescript/daytona/lifecycle/start-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -44,6 +44,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/start-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/lifecycle/start-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/start-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/start-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/package-lock.json index 82654607..e555ca00 100644 --- a/examples/typescript/daytona/start-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-start-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/start-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/start-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/package.json index 6d883a43..12f366ed 100644 --- a/examples/typescript/daytona/start-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/start-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/start-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/src/main.ts diff --git a/examples/typescript/modal/create-modal-linux-vm/tsconfig.json b/examples/typescript/daytona/lifecycle/start-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-linux-vm/tsconfig.json rename to examples/typescript/daytona/lifecycle/start-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/daytona/start-daytona-with-timeout/.env.example b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/.env.example similarity index 100% rename from examples/typescript/daytona/start-daytona-with-timeout/.env.example rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/.env.example diff --git a/examples/typescript/daytona/start-daytona-with-timeout/.gitignore b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/.gitignore similarity index 100% rename from examples/typescript/daytona/start-daytona-with-timeout/.gitignore rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/.gitignore diff --git a/examples/typescript/daytona/start-daytona-with-timeout/.nvmrc b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/.nvmrc similarity index 100% rename from examples/typescript/daytona/start-daytona-with-timeout/.nvmrc rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/.nvmrc diff --git a/examples/typescript/daytona/start-daytona-with-timeout/README.md b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/README.md similarity index 89% rename from examples/typescript/daytona/start-daytona-with-timeout/README.md rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/README.md index bb60adb2..473353b8 100644 --- a/examples/typescript/daytona/start-daytona-with-timeout/README.md +++ b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/README.md @@ -16,7 +16,7 @@ deadline and the native start timeout passed to Daytona (converted to seconds). ## Run ```sh -cd examples/typescript/daytona/start-daytona-with-timeout +cd examples/typescript/daytona/lifecycle/start-daytona-with-timeout cp .env.example .env # Fill in the values below, then: npm install @@ -43,4 +43,4 @@ DAYTONA_SANDBOX_ID= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/start-daytona-with-timeout/package-lock.json b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/package-lock.json similarity index 86% rename from examples/typescript/daytona/start-daytona-with-timeout/package-lock.json rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/package-lock.json index 48a609af..9ead3c39 100644 --- a/examples/typescript/daytona/start-daytona-with-timeout/package-lock.json +++ b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-start-daytona-with-timeout", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/start-daytona-with-timeout/package.json b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/package.json similarity index 73% rename from examples/typescript/daytona/start-daytona-with-timeout/package.json rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/package.json index 7718f63b..438308d5 100644 --- a/examples/typescript/daytona/start-daytona-with-timeout/package.json +++ b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/start-daytona-with-timeout/src/main.ts b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/src/main.ts similarity index 100% rename from examples/typescript/daytona/start-daytona-with-timeout/src/main.ts rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/src/main.ts diff --git a/examples/typescript/modal/create-modal-ready/tsconfig.json b/examples/typescript/daytona/lifecycle/start-daytona-with-timeout/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-ready/tsconfig.json rename to examples/typescript/daytona/lifecycle/start-daytona-with-timeout/tsconfig.json diff --git a/examples/typescript/daytona/stop-daytona-sandbox/.env.example b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/.env.example similarity index 100% rename from examples/typescript/daytona/stop-daytona-sandbox/.env.example rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/.env.example diff --git a/examples/typescript/daytona/stop-daytona-sandbox/.gitignore b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/.gitignore similarity index 100% rename from examples/typescript/daytona/stop-daytona-sandbox/.gitignore rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/.gitignore diff --git a/examples/typescript/daytona/stop-daytona-sandbox/.nvmrc b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/.nvmrc similarity index 100% rename from examples/typescript/daytona/stop-daytona-sandbox/.nvmrc rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/.nvmrc diff --git a/examples/typescript/daytona/stop-daytona-sandbox/README.md b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/README.md similarity index 83% rename from examples/typescript/daytona/stop-daytona-sandbox/README.md rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/README.md index c8ad4cf7..42166249 100644 --- a/examples/typescript/daytona/stop-daytona-sandbox/README.md +++ b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/README.md @@ -17,7 +17,7 @@ again. An ephemeral sandbox can be deleted by its policy. See ## Run ```sh -cd examples/typescript/daytona/stop-daytona-sandbox +cd examples/typescript/daytona/lifecycle/stop-daytona-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -44,6 +44,6 @@ DAYTONA_SANDBOX_ID= ## Related -- [go twin](../../../go/daytona/stop-daytona-sandbox/README.md) +- [go twin](../../../../go/daytona/lifecycle/stop-daytona-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/daytona/stop-daytona-sandbox/package-lock.json b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/package-lock.json similarity index 86% rename from examples/typescript/daytona/stop-daytona-sandbox/package-lock.json rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/package-lock.json index 8f09a6c0..b900cf85 100644 --- a/examples/typescript/daytona/stop-daytona-sandbox/package-lock.json +++ b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-stop-daytona-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/daytona": { + "../../../../../sdks/typescript/providers/daytona": { "name": "@sandbox-kit/daytona", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/daytona": { - "resolved": "../../../../sdks/typescript/providers/daytona", + "resolved": "../../../../../sdks/typescript/providers/daytona", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/daytona/stop-daytona-sandbox/package.json b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/package.json similarity index 73% rename from examples/typescript/daytona/stop-daytona-sandbox/package.json rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/package.json index 9705fc40..054e453a 100644 --- a/examples/typescript/daytona/stop-daytona-sandbox/package.json +++ b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/daytona": "file:../../../../sdks/typescript/providers/daytona", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/daytona": "file:../../../../../sdks/typescript/providers/daytona", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/daytona/stop-daytona-sandbox/src/main.ts b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/src/main.ts similarity index 100% rename from examples/typescript/daytona/stop-daytona-sandbox/src/main.ts rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/src/main.ts diff --git a/examples/typescript/modal/create-modal-sandbox/tsconfig.json b/examples/typescript/daytona/lifecycle/stop-daytona-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-sandbox/tsconfig.json rename to examples/typescript/daytona/lifecycle/stop-daytona-sandbox/tsconfig.json diff --git a/examples/typescript/modal/create-modal-client-timeout/.env.example b/examples/typescript/modal/configuration/create-modal-client-timeout/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-client-timeout/.env.example rename to examples/typescript/modal/configuration/create-modal-client-timeout/.env.example diff --git a/examples/typescript/modal/attach-modal-sandbox/.gitignore b/examples/typescript/modal/configuration/create-modal-client-timeout/.gitignore similarity index 100% rename from examples/typescript/modal/attach-modal-sandbox/.gitignore rename to examples/typescript/modal/configuration/create-modal-client-timeout/.gitignore diff --git a/examples/typescript/modal/attach-modal-sandbox/.nvmrc b/examples/typescript/modal/configuration/create-modal-client-timeout/.nvmrc similarity index 100% rename from examples/typescript/modal/attach-modal-sandbox/.nvmrc rename to examples/typescript/modal/configuration/create-modal-client-timeout/.nvmrc diff --git a/examples/typescript/modal/create-modal-client-timeout/README.md b/examples/typescript/modal/configuration/create-modal-client-timeout/README.md similarity index 89% rename from examples/typescript/modal/create-modal-client-timeout/README.md rename to examples/typescript/modal/configuration/create-modal-client-timeout/README.md index d1d360c4..e6374eb9 100644 --- a/examples/typescript/modal/create-modal-client-timeout/README.md +++ b/examples/typescript/modal/configuration/create-modal-client-timeout/README.md @@ -17,7 +17,7 @@ validation so Modal ready-wait and the call abort share one deadline. ## Run ```sh -cd examples/typescript/modal/create-modal-client-timeout +cd examples/typescript/modal/configuration/create-modal-client-timeout cp .env.example .env # Fill in the values below, then: npm install @@ -44,4 +44,4 @@ MODAL_ENVIRONMENT=main ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-client-timeout/package-lock.json b/examples/typescript/modal/configuration/create-modal-client-timeout/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-client-timeout/package-lock.json rename to examples/typescript/modal/configuration/create-modal-client-timeout/package-lock.json index 3a251625..085e4702 100644 --- a/examples/typescript/modal/create-modal-client-timeout/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-client-timeout/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-client-timeout", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-client-timeout/package.json b/examples/typescript/modal/configuration/create-modal-client-timeout/package.json similarity index 74% rename from examples/typescript/modal/create-modal-client-timeout/package.json rename to examples/typescript/modal/configuration/create-modal-client-timeout/package.json index af7349a7..552ab8af 100644 --- a/examples/typescript/modal/create-modal-client-timeout/package.json +++ b/examples/typescript/modal/configuration/create-modal-client-timeout/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-client-timeout/src/main.ts b/examples/typescript/modal/configuration/create-modal-client-timeout/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-client-timeout/src/main.ts rename to examples/typescript/modal/configuration/create-modal-client-timeout/src/main.ts diff --git a/examples/typescript/modal/create-modal-tcp-ready/tsconfig.json b/examples/typescript/modal/configuration/create-modal-client-timeout/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-tcp-ready/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-client-timeout/tsconfig.json diff --git a/examples/typescript/modal/create-modal-gvisor/.env.example b/examples/typescript/modal/configuration/create-modal-gvisor/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-gvisor/.env.example rename to examples/typescript/modal/configuration/create-modal-gvisor/.env.example diff --git a/examples/typescript/modal/close-modal-handle/.gitignore b/examples/typescript/modal/configuration/create-modal-gvisor/.gitignore similarity index 100% rename from examples/typescript/modal/close-modal-handle/.gitignore rename to examples/typescript/modal/configuration/create-modal-gvisor/.gitignore diff --git a/examples/typescript/modal/close-modal-handle/.nvmrc b/examples/typescript/modal/configuration/create-modal-gvisor/.nvmrc similarity index 100% rename from examples/typescript/modal/close-modal-handle/.nvmrc rename to examples/typescript/modal/configuration/create-modal-gvisor/.nvmrc diff --git a/examples/typescript/modal/create-modal-gvisor/README.md b/examples/typescript/modal/configuration/create-modal-gvisor/README.md similarity index 83% rename from examples/typescript/modal/create-modal-gvisor/README.md rename to examples/typescript/modal/configuration/create-modal-gvisor/README.md index 34c6ad54..b62a7cbf 100644 --- a/examples/typescript/modal/create-modal-gvisor/README.md +++ b/examples/typescript/modal/configuration/create-modal-gvisor/README.md @@ -16,7 +16,7 @@ the gVisor runtime. See [Sandboxes](https://modal.com/docs/guide/sandboxes) and ## Run ```sh -cd examples/typescript/modal/create-modal-gvisor +cd examples/typescript/modal/configuration/create-modal-gvisor cp .env.example .env # Fill in the values below, then: npm install @@ -43,6 +43,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-gvisor/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-gvisor/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-gvisor/package-lock.json b/examples/typescript/modal/configuration/create-modal-gvisor/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-gvisor/package-lock.json rename to examples/typescript/modal/configuration/create-modal-gvisor/package-lock.json index 1a531a90..a92cd5da 100644 --- a/examples/typescript/modal/create-modal-gvisor/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-gvisor/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-gvisor", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-gvisor/package.json b/examples/typescript/modal/configuration/create-modal-gvisor/package.json similarity index 74% rename from examples/typescript/modal/create-modal-gvisor/package.json rename to examples/typescript/modal/configuration/create-modal-gvisor/package.json index e7fd632a..7db0cdae 100644 --- a/examples/typescript/modal/create-modal-gvisor/package.json +++ b/examples/typescript/modal/configuration/create-modal-gvisor/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-gvisor/src/main.ts b/examples/typescript/modal/configuration/create-modal-gvisor/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-gvisor/src/main.ts rename to examples/typescript/modal/configuration/create-modal-gvisor/src/main.ts diff --git a/examples/typescript/modal/create-modal-verbose/tsconfig.json b/examples/typescript/modal/configuration/create-modal-gvisor/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-verbose/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-gvisor/tsconfig.json diff --git a/examples/typescript/modal/create-modal-idle/.env.example b/examples/typescript/modal/configuration/create-modal-idle/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-idle/.env.example rename to examples/typescript/modal/configuration/create-modal-idle/.env.example diff --git a/examples/typescript/modal/create-modal-client-timeout/.gitignore b/examples/typescript/modal/configuration/create-modal-idle/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-client-timeout/.gitignore rename to examples/typescript/modal/configuration/create-modal-idle/.gitignore diff --git a/examples/typescript/modal/create-modal-client-timeout/.nvmrc b/examples/typescript/modal/configuration/create-modal-idle/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-client-timeout/.nvmrc rename to examples/typescript/modal/configuration/create-modal-idle/.nvmrc diff --git a/examples/typescript/modal/create-modal-idle/README.md b/examples/typescript/modal/configuration/create-modal-idle/README.md similarity index 86% rename from examples/typescript/modal/create-modal-idle/README.md rename to examples/typescript/modal/configuration/create-modal-idle/README.md index 4be649ad..a30c322f 100644 --- a/examples/typescript/modal/create-modal-idle/README.md +++ b/examples/typescript/modal/configuration/create-modal-idle/README.md @@ -21,7 +21,7 @@ active exec/tunnels/etc., per Modal's idle rules). Separate from ## Run ```sh -cd examples/typescript/modal/create-modal-idle +cd examples/typescript/modal/configuration/create-modal-idle cp .env.example .env # Fill in the values below, then: npm install @@ -48,6 +48,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-idle/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-idle/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-idle/package-lock.json b/examples/typescript/modal/configuration/create-modal-idle/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-idle/package-lock.json rename to examples/typescript/modal/configuration/create-modal-idle/package-lock.json index f4c3f6ca..2914048b 100644 --- a/examples/typescript/modal/create-modal-idle/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-idle/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-idle", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-idle/package.json b/examples/typescript/modal/configuration/create-modal-idle/package.json similarity index 73% rename from examples/typescript/modal/create-modal-idle/package.json rename to examples/typescript/modal/configuration/create-modal-idle/package.json index 3ce03049..3f67f415 100644 --- a/examples/typescript/modal/create-modal-idle/package.json +++ b/examples/typescript/modal/configuration/create-modal-idle/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-idle/src/main.ts b/examples/typescript/modal/configuration/create-modal-idle/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-idle/src/main.ts rename to examples/typescript/modal/configuration/create-modal-idle/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-allowlists/tsconfig.json b/examples/typescript/modal/configuration/create-modal-idle/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-allowlists/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-idle/tsconfig.json diff --git a/examples/typescript/modal/create-modal-linux-vm/.env.example b/examples/typescript/modal/configuration/create-modal-linux-vm/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-linux-vm/.env.example rename to examples/typescript/modal/configuration/create-modal-linux-vm/.env.example diff --git a/examples/typescript/modal/create-modal-gvisor/.gitignore b/examples/typescript/modal/configuration/create-modal-linux-vm/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-gvisor/.gitignore rename to examples/typescript/modal/configuration/create-modal-linux-vm/.gitignore diff --git a/examples/typescript/modal/create-modal-gvisor/.nvmrc b/examples/typescript/modal/configuration/create-modal-linux-vm/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-gvisor/.nvmrc rename to examples/typescript/modal/configuration/create-modal-linux-vm/.nvmrc diff --git a/examples/typescript/modal/create-modal-linux-vm/README.md b/examples/typescript/modal/configuration/create-modal-linux-vm/README.md similarity index 81% rename from examples/typescript/modal/create-modal-linux-vm/README.md rename to examples/typescript/modal/configuration/create-modal-linux-vm/README.md index caefca59..e6a4211c 100644 --- a/examples/typescript/modal/create-modal-linux-vm/README.md +++ b/examples/typescript/modal/configuration/create-modal-linux-vm/README.md @@ -16,7 +16,7 @@ docs. ## Run ```sh -cd examples/typescript/modal/create-modal-linux-vm +cd examples/typescript/modal/configuration/create-modal-linux-vm cp .env.example .env # Fill in the values below, then: npm install @@ -43,6 +43,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-linux-vm/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-linux-vm/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-linux-vm/package-lock.json b/examples/typescript/modal/configuration/create-modal-linux-vm/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-linux-vm/package-lock.json rename to examples/typescript/modal/configuration/create-modal-linux-vm/package-lock.json index 26ebce25..9a89f5cf 100644 --- a/examples/typescript/modal/create-modal-linux-vm/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-linux-vm/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-linux-vm", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-linux-vm/package.json b/examples/typescript/modal/configuration/create-modal-linux-vm/package.json similarity index 74% rename from examples/typescript/modal/create-modal-linux-vm/package.json rename to examples/typescript/modal/configuration/create-modal-linux-vm/package.json index 6ca835c9..ffa18493 100644 --- a/examples/typescript/modal/create-modal-linux-vm/package.json +++ b/examples/typescript/modal/configuration/create-modal-linux-vm/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-linux-vm/src/main.ts b/examples/typescript/modal/configuration/create-modal-linux-vm/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-linux-vm/src/main.ts rename to examples/typescript/modal/configuration/create-modal-linux-vm/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-identity/tsconfig.json b/examples/typescript/modal/configuration/create-modal-linux-vm/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-identity/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-linux-vm/tsconfig.json diff --git a/examples/typescript/modal/create-modal-ready/.env.example b/examples/typescript/modal/configuration/create-modal-ready/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-ready/.env.example rename to examples/typescript/modal/configuration/create-modal-ready/.env.example diff --git a/examples/typescript/modal/create-modal-idle/.gitignore b/examples/typescript/modal/configuration/create-modal-ready/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-idle/.gitignore rename to examples/typescript/modal/configuration/create-modal-ready/.gitignore diff --git a/examples/typescript/modal/create-modal-idle/.nvmrc b/examples/typescript/modal/configuration/create-modal-ready/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-idle/.nvmrc rename to examples/typescript/modal/configuration/create-modal-ready/.nvmrc diff --git a/examples/typescript/modal/create-modal-ready/README.md b/examples/typescript/modal/configuration/create-modal-ready/README.md similarity index 86% rename from examples/typescript/modal/create-modal-ready/README.md rename to examples/typescript/modal/configuration/create-modal-ready/README.md index 503ca0eb..978b592e 100644 --- a/examples/typescript/modal/create-modal-ready/README.md +++ b/examples/typescript/modal/configuration/create-modal-ready/README.md @@ -22,7 +22,7 @@ Ready wait requires a probe and a positive `provisioning.timeout` (ms). ## Run ```sh -cd examples/typescript/modal/create-modal-ready +cd examples/typescript/modal/configuration/create-modal-ready cp .env.example .env # Fill in the values below, then: npm install @@ -49,6 +49,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-ready/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-ready/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-ready/package-lock.json b/examples/typescript/modal/configuration/create-modal-ready/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-ready/package-lock.json rename to examples/typescript/modal/configuration/create-modal-ready/package-lock.json index 578aed52..dd452d62 100644 --- a/examples/typescript/modal/create-modal-ready/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-ready/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-ready", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-ready/package.json b/examples/typescript/modal/configuration/create-modal-ready/package.json similarity index 74% rename from examples/typescript/modal/create-modal-ready/package.json rename to examples/typescript/modal/configuration/create-modal-ready/package.json index d0a6684d..bc383a57 100644 --- a/examples/typescript/modal/create-modal-ready/package.json +++ b/examples/typescript/modal/configuration/create-modal-ready/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-ready/src/main.ts b/examples/typescript/modal/configuration/create-modal-ready/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-ready/src/main.ts rename to examples/typescript/modal/configuration/create-modal-ready/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-labels/tsconfig.json b/examples/typescript/modal/configuration/create-modal-ready/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-labels/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-ready/tsconfig.json diff --git a/examples/typescript/modal/create-modal-sandbox/.env.example b/examples/typescript/modal/configuration/create-modal-sandbox/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-sandbox/.env.example rename to examples/typescript/modal/configuration/create-modal-sandbox/.env.example diff --git a/examples/typescript/modal/create-modal-sandbox/.gitignore b/examples/typescript/modal/configuration/create-modal-sandbox/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-sandbox/.gitignore rename to examples/typescript/modal/configuration/create-modal-sandbox/.gitignore diff --git a/examples/typescript/modal/create-modal-sandbox/.nvmrc b/examples/typescript/modal/configuration/create-modal-sandbox/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-sandbox/.nvmrc rename to examples/typescript/modal/configuration/create-modal-sandbox/.nvmrc diff --git a/examples/typescript/modal/create-modal-sandbox/README.md b/examples/typescript/modal/configuration/create-modal-sandbox/README.md similarity index 90% rename from examples/typescript/modal/create-modal-sandbox/README.md rename to examples/typescript/modal/configuration/create-modal-sandbox/README.md index fb07e4e7..74f03cc6 100644 --- a/examples/typescript/modal/create-modal-sandbox/README.md +++ b/examples/typescript/modal/configuration/create-modal-sandbox/README.md @@ -24,7 +24,7 @@ timeouts or a terminate example. ## Run ```sh -cd examples/typescript/modal/create-modal-sandbox +cd examples/typescript/modal/configuration/create-modal-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -65,6 +65,6 @@ Set `MODAL_APP_NAME=sandbox-kit-example` in `.env`. See ## Related -- [go twin](../../../go/modal/create-modal-sandbox/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-sandbox/package-lock.json b/examples/typescript/modal/configuration/create-modal-sandbox/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-sandbox/package-lock.json rename to examples/typescript/modal/configuration/create-modal-sandbox/package-lock.json index e5622c72..d1eaefdf 100644 --- a/examples/typescript/modal/create-modal-sandbox/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-sandbox/package.json b/examples/typescript/modal/configuration/create-modal-sandbox/package.json similarity index 74% rename from examples/typescript/modal/create-modal-sandbox/package.json rename to examples/typescript/modal/configuration/create-modal-sandbox/package.json index 80bbc0f9..bf7a4c96 100644 --- a/examples/typescript/modal/create-modal-sandbox/package.json +++ b/examples/typescript/modal/configuration/create-modal-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-sandbox/src/main.ts b/examples/typescript/modal/configuration/create-modal-sandbox/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-sandbox/src/main.ts rename to examples/typescript/modal/configuration/create-modal-sandbox/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-network/tsconfig.json b/examples/typescript/modal/configuration/create-modal-sandbox/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-network/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-sandbox/tsconfig.json diff --git a/examples/typescript/modal/create-modal-tcp-ready/.env.example b/examples/typescript/modal/configuration/create-modal-tcp-ready/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-tcp-ready/.env.example rename to examples/typescript/modal/configuration/create-modal-tcp-ready/.env.example diff --git a/examples/typescript/modal/create-modal-linux-vm/.gitignore b/examples/typescript/modal/configuration/create-modal-tcp-ready/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-linux-vm/.gitignore rename to examples/typescript/modal/configuration/create-modal-tcp-ready/.gitignore diff --git a/examples/typescript/modal/create-modal-linux-vm/.nvmrc b/examples/typescript/modal/configuration/create-modal-tcp-ready/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-linux-vm/.nvmrc rename to examples/typescript/modal/configuration/create-modal-tcp-ready/.nvmrc diff --git a/examples/typescript/modal/create-modal-tcp-ready/README.md b/examples/typescript/modal/configuration/create-modal-tcp-ready/README.md similarity index 88% rename from examples/typescript/modal/create-modal-tcp-ready/README.md rename to examples/typescript/modal/configuration/create-modal-tcp-ready/README.md index 8223c4b9..358a33e0 100644 --- a/examples/typescript/modal/create-modal-tcp-ready/README.md +++ b/examples/typescript/modal/configuration/create-modal-tcp-ready/README.md @@ -17,7 +17,7 @@ listener so the probe can succeed. ## Run ```sh -cd examples/typescript/modal/create-modal-tcp-ready +cd examples/typescript/modal/configuration/create-modal-tcp-ready cp .env.example .env # Fill in the values below, then: npm install @@ -44,4 +44,4 @@ MODAL_ENVIRONMENT=main ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-tcp-ready/package-lock.json b/examples/typescript/modal/configuration/create-modal-tcp-ready/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-tcp-ready/package-lock.json rename to examples/typescript/modal/configuration/create-modal-tcp-ready/package-lock.json index f357ea57..33f8cf14 100644 --- a/examples/typescript/modal/create-modal-tcp-ready/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-tcp-ready/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-tcp-ready", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-tcp-ready/package.json b/examples/typescript/modal/configuration/create-modal-tcp-ready/package.json similarity index 74% rename from examples/typescript/modal/create-modal-tcp-ready/package.json rename to examples/typescript/modal/configuration/create-modal-tcp-ready/package.json index d3776756..c6b8adf2 100644 --- a/examples/typescript/modal/create-modal-tcp-ready/package.json +++ b/examples/typescript/modal/configuration/create-modal-tcp-ready/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-tcp-ready/src/main.ts b/examples/typescript/modal/configuration/create-modal-tcp-ready/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-tcp-ready/src/main.ts rename to examples/typescript/modal/configuration/create-modal-tcp-ready/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-placement/tsconfig.json b/examples/typescript/modal/configuration/create-modal-tcp-ready/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-placement/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-tcp-ready/tsconfig.json diff --git a/examples/typescript/modal/create-modal-verbose/.env.example b/examples/typescript/modal/configuration/create-modal-verbose/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-verbose/.env.example rename to examples/typescript/modal/configuration/create-modal-verbose/.env.example diff --git a/examples/typescript/modal/create-modal-ready/.gitignore b/examples/typescript/modal/configuration/create-modal-verbose/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-ready/.gitignore rename to examples/typescript/modal/configuration/create-modal-verbose/.gitignore diff --git a/examples/typescript/modal/create-modal-ready/.nvmrc b/examples/typescript/modal/configuration/create-modal-verbose/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-ready/.nvmrc rename to examples/typescript/modal/configuration/create-modal-verbose/.nvmrc diff --git a/examples/typescript/modal/create-modal-verbose/README.md b/examples/typescript/modal/configuration/create-modal-verbose/README.md similarity index 81% rename from examples/typescript/modal/create-modal-verbose/README.md rename to examples/typescript/modal/configuration/create-modal-verbose/README.md index 190273fd..b4bede51 100644 --- a/examples/typescript/modal/create-modal-verbose/README.md +++ b/examples/typescript/modal/configuration/create-modal-verbose/README.md @@ -15,7 +15,7 @@ detail in logs/UI for debugging. ## Run ```sh -cd examples/typescript/modal/create-modal-verbose +cd examples/typescript/modal/configuration/create-modal-verbose cp .env.example .env # Fill in the values below, then: npm install @@ -42,6 +42,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-verbose/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-verbose/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-verbose/package-lock.json b/examples/typescript/modal/configuration/create-modal-verbose/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-verbose/package-lock.json rename to examples/typescript/modal/configuration/create-modal-verbose/package-lock.json index ea89bb77..959ea2a6 100644 --- a/examples/typescript/modal/create-modal-verbose/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-verbose/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-verbose", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-verbose/package.json b/examples/typescript/modal/configuration/create-modal-verbose/package.json similarity index 74% rename from examples/typescript/modal/create-modal-verbose/package.json rename to examples/typescript/modal/configuration/create-modal-verbose/package.json index 1ed3527e..d9230c48 100644 --- a/examples/typescript/modal/create-modal-verbose/package.json +++ b/examples/typescript/modal/configuration/create-modal-verbose/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-verbose/src/main.ts b/examples/typescript/modal/configuration/create-modal-verbose/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-verbose/src/main.ts rename to examples/typescript/modal/configuration/create-modal-verbose/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-ports/tsconfig.json b/examples/typescript/modal/configuration/create-modal-verbose/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-ports/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-verbose/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-allowlists/.env.example b/examples/typescript/modal/configuration/create-modal-with-allowlists/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-allowlists/.env.example rename to examples/typescript/modal/configuration/create-modal-with-allowlists/.env.example diff --git a/examples/typescript/modal/create-modal-tcp-ready/.gitignore b/examples/typescript/modal/configuration/create-modal-with-allowlists/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-tcp-ready/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-allowlists/.gitignore diff --git a/examples/typescript/modal/create-modal-tcp-ready/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-allowlists/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-tcp-ready/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-allowlists/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-allowlists/README.md b/examples/typescript/modal/configuration/create-modal-with-allowlists/README.md similarity index 87% rename from examples/typescript/modal/create-modal-with-allowlists/README.md rename to examples/typescript/modal/configuration/create-modal-with-allowlists/README.md index b799d436..2711ba29 100644 --- a/examples/typescript/modal/create-modal-with-allowlists/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-allowlists/README.md @@ -15,7 +15,7 @@ Sets outbound allowlists and private networking on the create request. ## Run ```sh -cd examples/typescript/modal/create-modal-with-allowlists +cd examples/typescript/modal/configuration/create-modal-with-allowlists cp .env.example .env # Fill in the values below, then: npm install @@ -42,4 +42,4 @@ MODAL_ENVIRONMENT=main ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-allowlists/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-allowlists/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-allowlists/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-allowlists/package-lock.json index e6fd2f29..80fbe32e 100644 --- a/examples/typescript/modal/create-modal-with-allowlists/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-allowlists/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-allowlists", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-allowlists/package.json b/examples/typescript/modal/configuration/create-modal-with-allowlists/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-allowlists/package.json rename to examples/typescript/modal/configuration/create-modal-with-allowlists/package.json index 07731666..181183a0 100644 --- a/examples/typescript/modal/create-modal-with-allowlists/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-allowlists/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-allowlists/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-allowlists/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-allowlists/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-allowlists/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-resources/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-allowlists/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-resources/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-with-allowlists/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-identity/.env.example b/examples/typescript/modal/configuration/create-modal-with-identity/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-identity/.env.example rename to examples/typescript/modal/configuration/create-modal-with-identity/.env.example diff --git a/examples/typescript/modal/create-modal-verbose/.gitignore b/examples/typescript/modal/configuration/create-modal-with-identity/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-verbose/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-identity/.gitignore diff --git a/examples/typescript/modal/create-modal-verbose/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-identity/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-verbose/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-identity/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-identity/README.md b/examples/typescript/modal/configuration/create-modal-with-identity/README.md similarity index 82% rename from examples/typescript/modal/create-modal-with-identity/README.md rename to examples/typescript/modal/configuration/create-modal-with-identity/README.md index 4497f8af..b0948edf 100644 --- a/examples/typescript/modal/create-modal-with-identity/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-identity/README.md @@ -16,7 +16,7 @@ authenticate to identity-aware APIs. Kit client auth still uses your ## Run ```sh -cd examples/typescript/modal/create-modal-with-identity +cd examples/typescript/modal/configuration/create-modal-with-identity cp .env.example .env # Fill in the values below, then: npm install @@ -43,6 +43,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-with-identity/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-with-identity/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-identity/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-identity/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-identity/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-identity/package-lock.json index 97c27d5e..e896c945 100644 --- a/examples/typescript/modal/create-modal-with-identity/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-identity/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-identity", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-identity/package.json b/examples/typescript/modal/configuration/create-modal-with-identity/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-identity/package.json rename to examples/typescript/modal/configuration/create-modal-with-identity/package.json index 54c7bff5..bc38de6e 100644 --- a/examples/typescript/modal/create-modal-with-identity/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-identity/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-identity/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-identity/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-identity/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-identity/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-runtime/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-identity/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-runtime/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-with-identity/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-labels/.env.example b/examples/typescript/modal/configuration/create-modal-with-labels/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-labels/.env.example rename to examples/typescript/modal/configuration/create-modal-with-labels/.env.example diff --git a/examples/typescript/modal/create-modal-with-allowlists/.gitignore b/examples/typescript/modal/configuration/create-modal-with-labels/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-allowlists/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-labels/.gitignore diff --git a/examples/typescript/modal/create-modal-with-allowlists/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-labels/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-allowlists/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-labels/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-labels/README.md b/examples/typescript/modal/configuration/create-modal-with-labels/README.md similarity index 82% rename from examples/typescript/modal/create-modal-with-labels/README.md rename to examples/typescript/modal/configuration/create-modal-with-labels/README.md index 71e73bc1..758ff276 100644 --- a/examples/typescript/modal/create-modal-with-labels/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-labels/README.md @@ -16,7 +16,7 @@ when mapping. ## Run ```sh -cd examples/typescript/modal/create-modal-with-labels +cd examples/typescript/modal/configuration/create-modal-with-labels cp .env.example .env # Fill in the values below, then: npm install @@ -43,6 +43,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-with-labels/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-with-labels/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-labels/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-labels/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-labels/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-labels/package-lock.json index 3b6d6f0d..48e21130 100644 --- a/examples/typescript/modal/create-modal-with-labels/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-labels/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-labels", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-labels/package.json b/examples/typescript/modal/configuration/create-modal-with-labels/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-labels/package.json rename to examples/typescript/modal/configuration/create-modal-with-labels/package.json index 4093d681..8b001f0e 100644 --- a/examples/typescript/modal/create-modal-with-labels/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-labels/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-labels/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-labels/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-labels/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-labels/src/main.ts diff --git a/examples/typescript/modal/create-modal-with-secrets/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-labels/tsconfig.json similarity index 100% rename from examples/typescript/modal/create-modal-with-secrets/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-with-labels/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-network/.env.example b/examples/typescript/modal/configuration/create-modal-with-network/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-network/.env.example rename to examples/typescript/modal/configuration/create-modal-with-network/.env.example diff --git a/examples/typescript/modal/create-modal-with-identity/.gitignore b/examples/typescript/modal/configuration/create-modal-with-network/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-identity/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-network/.gitignore diff --git a/examples/typescript/modal/create-modal-with-identity/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-network/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-identity/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-network/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-network/README.md b/examples/typescript/modal/configuration/create-modal-with-network/README.md similarity index 84% rename from examples/typescript/modal/create-modal-with-network/README.md rename to examples/typescript/modal/configuration/create-modal-with-network/README.md index 584ee247..436753f0 100644 --- a/examples/typescript/modal/create-modal-with-network/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-network/README.md @@ -18,7 +18,7 @@ outbound traffic can be routed through that proxy. The proxy must already exist. ## Run ```sh -cd examples/typescript/modal/create-modal-with-network +cd examples/typescript/modal/configuration/create-modal-with-network cp .env.example .env # Fill in the values below, then: npm install @@ -47,6 +47,6 @@ Required: `MODAL_PROXY_NAME` (existing proxy in the environment). ## Related -- [go twin](../../../go/modal/create-modal-with-network/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-with-network/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-network/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-network/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-network/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-network/package-lock.json index 2b22b1a8..4462337c 100644 --- a/examples/typescript/modal/create-modal-with-network/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-network/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-network", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-network/package.json b/examples/typescript/modal/configuration/create-modal-with-network/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-network/package.json rename to examples/typescript/modal/configuration/create-modal-with-network/package.json index 9b5484cd..dd8d7918 100644 --- a/examples/typescript/modal/create-modal-with-network/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-network/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-network/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-network/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-network/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-network/src/main.ts diff --git a/examples/typescript/modal/handle-modal-errors/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-network/tsconfig.json similarity index 100% rename from examples/typescript/modal/handle-modal-errors/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-with-network/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-placement/.env.example b/examples/typescript/modal/configuration/create-modal-with-placement/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-placement/.env.example rename to examples/typescript/modal/configuration/create-modal-with-placement/.env.example diff --git a/examples/typescript/modal/create-modal-with-labels/.gitignore b/examples/typescript/modal/configuration/create-modal-with-placement/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-labels/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-placement/.gitignore diff --git a/examples/typescript/modal/create-modal-with-labels/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-placement/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-labels/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-placement/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-placement/README.md b/examples/typescript/modal/configuration/create-modal-with-placement/README.md similarity index 83% rename from examples/typescript/modal/create-modal-with-placement/README.md rename to examples/typescript/modal/configuration/create-modal-with-placement/README.md index 7f9b1730..eec384a2 100644 --- a/examples/typescript/modal/create-modal-with-placement/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-placement/README.md @@ -17,7 +17,7 @@ in Kit checks include `aws`, `gcp`, `oci`, and `auto`. See ## Run ```sh -cd examples/typescript/modal/create-modal-with-placement +cd examples/typescript/modal/configuration/create-modal-with-placement cp .env.example .env # Fill in the values below, then: npm install @@ -46,6 +46,6 @@ Optional: `MODAL_CLOUD` (default `auto`), `MODAL_REGION`. ## Related -- [go twin](../../../go/modal/create-modal-with-placement/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-with-placement/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-placement/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-placement/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-placement/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-placement/package-lock.json index 2ff1af8a..7cb5cef0 100644 --- a/examples/typescript/modal/create-modal-with-placement/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-placement/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-placement", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-placement/package.json b/examples/typescript/modal/configuration/create-modal-with-placement/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-placement/package.json rename to examples/typescript/modal/configuration/create-modal-with-placement/package.json index 52d2ab7c..04faa5c4 100644 --- a/examples/typescript/modal/create-modal-with-placement/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-placement/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-placement/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-placement/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-placement/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-placement/src/main.ts diff --git a/examples/typescript/modal/request-modal-termination/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-placement/tsconfig.json similarity index 100% rename from examples/typescript/modal/request-modal-termination/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-with-placement/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-ports/.env.example b/examples/typescript/modal/configuration/create-modal-with-ports/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-ports/.env.example rename to examples/typescript/modal/configuration/create-modal-with-ports/.env.example diff --git a/examples/typescript/modal/create-modal-with-network/.gitignore b/examples/typescript/modal/configuration/create-modal-with-ports/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-network/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-ports/.gitignore diff --git a/examples/typescript/modal/create-modal-with-network/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-ports/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-network/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-ports/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-ports/README.md b/examples/typescript/modal/configuration/create-modal-with-ports/README.md similarity index 87% rename from examples/typescript/modal/create-modal-with-ports/README.md rename to examples/typescript/modal/configuration/create-modal-with-ports/README.md index 2042b4bb..3b78c76b 100644 --- a/examples/typescript/modal/create-modal-with-ports/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-ports/README.md @@ -14,7 +14,7 @@ Each port needs an explicit `PortTransport`. Kit maps TLS → encrypted ports, p ## Run ```sh -cd examples/typescript/modal/create-modal-with-ports +cd examples/typescript/modal/configuration/create-modal-with-ports cp .env.example .env # Fill in the values below, then: npm install @@ -41,4 +41,4 @@ MODAL_ENVIRONMENT=main ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-ports/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-ports/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-ports/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-ports/package-lock.json index 8ff9f052..33ff8035 100644 --- a/examples/typescript/modal/create-modal-with-ports/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-ports/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-ports", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-ports/package.json b/examples/typescript/modal/configuration/create-modal-with-ports/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-ports/package.json rename to examples/typescript/modal/configuration/create-modal-with-ports/package.json index 3dc9dc7e..dbb506f8 100644 --- a/examples/typescript/modal/create-modal-with-ports/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-ports/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-ports/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-ports/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-ports/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-ports/src/main.ts diff --git a/examples/typescript/modal/terminate-modal-sandbox/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-ports/tsconfig.json similarity index 100% rename from examples/typescript/modal/terminate-modal-sandbox/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-with-ports/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-resources/.env.example b/examples/typescript/modal/configuration/create-modal-with-resources/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-resources/.env.example rename to examples/typescript/modal/configuration/create-modal-with-resources/.env.example diff --git a/examples/typescript/modal/create-modal-with-placement/.gitignore b/examples/typescript/modal/configuration/create-modal-with-resources/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-placement/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-resources/.gitignore diff --git a/examples/typescript/modal/create-modal-with-placement/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-resources/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-placement/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-resources/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-resources/README.md b/examples/typescript/modal/configuration/create-modal-with-resources/README.md similarity index 87% rename from examples/typescript/modal/create-modal-with-resources/README.md rename to examples/typescript/modal/configuration/create-modal-with-resources/README.md index 8261fc84..5e7c2e7d 100644 --- a/examples/typescript/modal/create-modal-with-resources/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-resources/README.md @@ -25,7 +25,7 @@ seconds). ## Run ```sh -cd examples/typescript/modal/create-modal-with-resources +cd examples/typescript/modal/configuration/create-modal-with-resources cp .env.example .env # Fill in the values below, then: npm install @@ -52,6 +52,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-with-resources/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-with-resources/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-resources/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-resources/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-resources/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-resources/package-lock.json index bc56943e..19505a14 100644 --- a/examples/typescript/modal/create-modal-with-resources/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-resources/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-resources", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-resources/package.json b/examples/typescript/modal/configuration/create-modal-with-resources/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-resources/package.json rename to examples/typescript/modal/configuration/create-modal-with-resources/package.json index ef2e2dd8..d6f3fbce 100644 --- a/examples/typescript/modal/create-modal-with-resources/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-resources/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-resources/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-resources/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-resources/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-resources/src/main.ts diff --git a/examples/typescript/modal/terminate-modal-with-timeout/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-resources/tsconfig.json similarity index 100% rename from examples/typescript/modal/terminate-modal-with-timeout/tsconfig.json rename to examples/typescript/modal/configuration/create-modal-with-resources/tsconfig.json diff --git a/examples/typescript/modal/create-modal-with-runtime/.env.example b/examples/typescript/modal/configuration/create-modal-with-runtime/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-runtime/.env.example rename to examples/typescript/modal/configuration/create-modal-with-runtime/.env.example diff --git a/examples/typescript/modal/create-modal-with-ports/.gitignore b/examples/typescript/modal/configuration/create-modal-with-runtime/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-ports/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-runtime/.gitignore diff --git a/examples/typescript/modal/create-modal-with-ports/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-runtime/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-ports/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-runtime/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-runtime/README.md b/examples/typescript/modal/configuration/create-modal-with-runtime/README.md similarity index 83% rename from examples/typescript/modal/create-modal-with-runtime/README.md rename to examples/typescript/modal/configuration/create-modal-with-runtime/README.md index 3211ce22..26fa7a06 100644 --- a/examples/typescript/modal/create-modal-with-runtime/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-runtime/README.md @@ -17,7 +17,7 @@ command runs (`entrypoint`), and whether a PTY is attached. See Modal ## Run ```sh -cd examples/typescript/modal/create-modal-with-runtime +cd examples/typescript/modal/configuration/create-modal-with-runtime cp .env.example .env # Fill in the values below, then: npm install @@ -44,6 +44,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/create-modal-with-runtime/README.md) +- [go twin](../../../../go/modal/configuration/create-modal-with-runtime/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-runtime/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-runtime/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-runtime/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-runtime/package-lock.json index 5df53e50..80b03ea4 100644 --- a/examples/typescript/modal/create-modal-with-runtime/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-runtime/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-runtime", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-runtime/package.json b/examples/typescript/modal/configuration/create-modal-with-runtime/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-runtime/package.json rename to examples/typescript/modal/configuration/create-modal-with-runtime/package.json index 877171e2..affff93f 100644 --- a/examples/typescript/modal/create-modal-with-runtime/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-runtime/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-runtime/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-runtime/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-runtime/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-runtime/src/main.ts diff --git a/examples/typescript/modal/configuration/create-modal-with-runtime/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-runtime/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/configuration/create-modal-with-runtime/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/create-modal-with-secrets/.env.example b/examples/typescript/modal/configuration/create-modal-with-secrets/.env.example similarity index 100% rename from examples/typescript/modal/create-modal-with-secrets/.env.example rename to examples/typescript/modal/configuration/create-modal-with-secrets/.env.example diff --git a/examples/typescript/modal/create-modal-with-resources/.gitignore b/examples/typescript/modal/configuration/create-modal-with-secrets/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-resources/.gitignore rename to examples/typescript/modal/configuration/create-modal-with-secrets/.gitignore diff --git a/examples/typescript/modal/create-modal-with-resources/.nvmrc b/examples/typescript/modal/configuration/create-modal-with-secrets/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-resources/.nvmrc rename to examples/typescript/modal/configuration/create-modal-with-secrets/.nvmrc diff --git a/examples/typescript/modal/create-modal-with-secrets/README.md b/examples/typescript/modal/configuration/create-modal-with-secrets/README.md similarity index 88% rename from examples/typescript/modal/create-modal-with-secrets/README.md rename to examples/typescript/modal/configuration/create-modal-with-secrets/README.md index cb955d2d..93800836 100644 --- a/examples/typescript/modal/create-modal-with-secrets/README.md +++ b/examples/typescript/modal/configuration/create-modal-with-secrets/README.md @@ -14,7 +14,7 @@ Modal secrets are resolved by name in the configured app/environment and injecte ## Run ```sh -cd examples/typescript/modal/create-modal-with-secrets +cd examples/typescript/modal/configuration/create-modal-with-secrets cp .env.example .env # Fill in the values below, then: npm install @@ -42,4 +42,4 @@ MODAL_SECRET_NAME= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/create-modal-with-secrets/package-lock.json b/examples/typescript/modal/configuration/create-modal-with-secrets/package-lock.json similarity index 86% rename from examples/typescript/modal/create-modal-with-secrets/package-lock.json rename to examples/typescript/modal/configuration/create-modal-with-secrets/package-lock.json index 31f60771..5f9ab693 100644 --- a/examples/typescript/modal/create-modal-with-secrets/package-lock.json +++ b/examples/typescript/modal/configuration/create-modal-with-secrets/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-create-modal-with-secrets", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/create-modal-with-secrets/package.json b/examples/typescript/modal/configuration/create-modal-with-secrets/package.json similarity index 74% rename from examples/typescript/modal/create-modal-with-secrets/package.json rename to examples/typescript/modal/configuration/create-modal-with-secrets/package.json index 3c782d34..53f3287f 100644 --- a/examples/typescript/modal/create-modal-with-secrets/package.json +++ b/examples/typescript/modal/configuration/create-modal-with-secrets/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/create-modal-with-secrets/src/main.ts b/examples/typescript/modal/configuration/create-modal-with-secrets/src/main.ts similarity index 100% rename from examples/typescript/modal/create-modal-with-secrets/src/main.ts rename to examples/typescript/modal/configuration/create-modal-with-secrets/src/main.ts diff --git a/examples/typescript/modal/configuration/create-modal-with-secrets/tsconfig.json b/examples/typescript/modal/configuration/create-modal-with-secrets/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/configuration/create-modal-with-secrets/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/handle-modal-errors/.env.example b/examples/typescript/modal/errors/handle-modal-errors/.env.example similarity index 100% rename from examples/typescript/modal/handle-modal-errors/.env.example rename to examples/typescript/modal/errors/handle-modal-errors/.env.example diff --git a/examples/typescript/modal/create-modal-with-runtime/.gitignore b/examples/typescript/modal/errors/handle-modal-errors/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-runtime/.gitignore rename to examples/typescript/modal/errors/handle-modal-errors/.gitignore diff --git a/examples/typescript/modal/create-modal-with-runtime/.nvmrc b/examples/typescript/modal/errors/handle-modal-errors/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-runtime/.nvmrc rename to examples/typescript/modal/errors/handle-modal-errors/.nvmrc diff --git a/examples/typescript/modal/handle-modal-errors/README.md b/examples/typescript/modal/errors/handle-modal-errors/README.md similarity index 87% rename from examples/typescript/modal/handle-modal-errors/README.md rename to examples/typescript/modal/errors/handle-modal-errors/README.md index 26f800a0..731d4b4b 100644 --- a/examples/typescript/modal/handle-modal-errors/README.md +++ b/examples/typescript/modal/errors/handle-modal-errors/README.md @@ -20,7 +20,7 @@ is `resources.disk_mib`. See ## Run ```sh -cd examples/typescript/modal/handle-modal-errors +cd examples/typescript/modal/errors/handle-modal-errors cp .env.example .env # Fill in the values below, then: npm install @@ -47,6 +47,6 @@ MODAL_ENVIRONMENT=main ## Related -- [go twin](../../../go/modal/handle-modal-errors/README.md) +- [go twin](../../../../go/modal/errors/handle-modal-errors/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/handle-modal-errors/package-lock.json b/examples/typescript/modal/errors/handle-modal-errors/package-lock.json similarity index 86% rename from examples/typescript/modal/handle-modal-errors/package-lock.json rename to examples/typescript/modal/errors/handle-modal-errors/package-lock.json index 1332a46b..ff71fdf4 100644 --- a/examples/typescript/modal/handle-modal-errors/package-lock.json +++ b/examples/typescript/modal/errors/handle-modal-errors/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-handle-modal-errors", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/handle-modal-errors/package.json b/examples/typescript/modal/errors/handle-modal-errors/package.json similarity index 74% rename from examples/typescript/modal/handle-modal-errors/package.json rename to examples/typescript/modal/errors/handle-modal-errors/package.json index 97491e4f..f89f526f 100644 --- a/examples/typescript/modal/handle-modal-errors/package.json +++ b/examples/typescript/modal/errors/handle-modal-errors/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/handle-modal-errors/src/main.ts b/examples/typescript/modal/errors/handle-modal-errors/src/main.ts similarity index 100% rename from examples/typescript/modal/handle-modal-errors/src/main.ts rename to examples/typescript/modal/errors/handle-modal-errors/src/main.ts diff --git a/examples/typescript/modal/errors/handle-modal-errors/tsconfig.json b/examples/typescript/modal/errors/handle-modal-errors/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/errors/handle-modal-errors/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/copy-file-from-modal/.env.example b/examples/typescript/modal/filesystem/copy-file-from-modal/.env.example new file mode 100644 index 00000000..98fb27ad --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-from-modal/.env.example @@ -0,0 +1,7 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt diff --git a/examples/typescript/modal/filesystem/copy-file-from-modal/.gitignore b/examples/typescript/modal/filesystem/copy-file-from-modal/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-from-modal/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/copy-file-from-modal/README.md b/examples/typescript/modal/filesystem/copy-file-from-modal/README.md new file mode 100644 index 00000000..25a08661 --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-from-modal/README.md @@ -0,0 +1,51 @@ +# Copy a file from Modal + +Copy `MODAL_REMOTE_PATH` from the sandbox to `MODAL_LOCAL_PATH` on this machine. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call copies `MODAL_REMOTE_PATH` from the sandbox to `MODAL_LOCAL_PATH` on this machine. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Modal is called. The error field is `local_path`. +- A missing remote file comes back from Modal as not found. +- A missing local parent directory is created. A local directory is an invalid argument, and the field is `local_path`. +- An existing local file is replaced. + +## Run + +```sh +cd examples/typescript/modal/filesystem/copy-file-from-modal +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the local file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/copy-file-from-modal/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/copy-file-from-modal/package-lock.json b/examples/typescript/modal/filesystem/copy-file-from-modal/package-lock.json new file mode 100644 index 00000000..f4936644 --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-from-modal/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-copy-file-from-modal", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-copy-file-from-modal", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/copy-file-from-modal/package.json b/examples/typescript/modal/filesystem/copy-file-from-modal/package.json new file mode 100644 index 00000000..06210fd6 --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-from-modal/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-copy-file-from-modal", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/copy-file-from-modal/src/main.ts b/examples/typescript/modal/filesystem/copy-file-from-modal/src/main.ts new file mode 100644 index 00000000..0da57e6e --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-from-modal/src/main.ts @@ -0,0 +1,23 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +const local = process.env.MODAL_LOCAL_PATH!; +await sandbox.filesystem.copyToLocal(remote, local); +console.log(`copied ${remote} to ${local}`); diff --git a/examples/typescript/modal/filesystem/copy-file-from-modal/tsconfig.json b/examples/typescript/modal/filesystem/copy-file-from-modal/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-from-modal/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/copy-file-into-modal/.env.example b/examples/typescript/modal/filesystem/copy-file-into-modal/.env.example new file mode 100644 index 00000000..98fb27ad --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-into-modal/.env.example @@ -0,0 +1,7 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt diff --git a/examples/typescript/modal/filesystem/copy-file-into-modal/.gitignore b/examples/typescript/modal/filesystem/copy-file-into-modal/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-into-modal/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/copy-file-into-modal/README.md b/examples/typescript/modal/filesystem/copy-file-into-modal/README.md new file mode 100644 index 00000000..053f0561 --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-into-modal/README.md @@ -0,0 +1,50 @@ +# Copy a file into Modal + +Copy `MODAL_LOCAL_PATH` on this machine to `MODAL_REMOTE_PATH` in the sandbox. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call copies `MODAL_LOCAL_PATH` on this machine to `MODAL_REMOTE_PATH` in the sandbox. Missing parent directories of the remote file are created. + +## Edge cases + +- The sandbox path must be absolute. A blank local path is rejected before Modal is called. The error field is `local_path`. +- A missing local file is not found before Modal is called. The error field is `local_path`. A directory at that path is an invalid argument with the same field. +- An existing remote file is replaced. + +## Run + +```sh +cd examples/typescript/modal/filesystem/copy-file-into-modal +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +MODAL_LOCAL_PATH=./note.txt + +``` + +## Warnings + +- Overwrites the remote file when it already exists. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/copy-file-into-modal/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/copy-file-into-modal/package-lock.json b/examples/typescript/modal/filesystem/copy-file-into-modal/package-lock.json new file mode 100644 index 00000000..f712953d --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-into-modal/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-copy-file-into-modal", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-copy-file-into-modal", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/copy-file-into-modal/package.json b/examples/typescript/modal/filesystem/copy-file-into-modal/package.json new file mode 100644 index 00000000..b9faea3c --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-into-modal/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-copy-file-into-modal", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/copy-file-into-modal/src/main.ts b/examples/typescript/modal/filesystem/copy-file-into-modal/src/main.ts new file mode 100644 index 00000000..795dd2ab --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-into-modal/src/main.ts @@ -0,0 +1,23 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +const local = process.env.MODAL_LOCAL_PATH!; +await sandbox.filesystem.copyFromLocal(local, remote); +console.log(`copied ${local} to ${remote}`); diff --git a/examples/typescript/modal/filesystem/copy-file-into-modal/tsconfig.json b/examples/typescript/modal/filesystem/copy-file-into-modal/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/copy-file-into-modal/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/list-modal-directory/.env.example b/examples/typescript/modal/filesystem/list-modal-directory/.env.example new file mode 100644 index 00000000..428b0d07 --- /dev/null +++ b/examples/typescript/modal/filesystem/list-modal-directory/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp diff --git a/examples/typescript/modal/filesystem/list-modal-directory/.gitignore b/examples/typescript/modal/filesystem/list-modal-directory/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/list-modal-directory/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/list-modal-directory/README.md b/examples/typescript/modal/filesystem/list-modal-directory/README.md new file mode 100644 index 00000000..09ba33e9 --- /dev/null +++ b/examples/typescript/modal/filesystem/list-modal-directory/README.md @@ -0,0 +1,49 @@ +# List a Modal directory + +Print the names in the directory at `MODAL_REMOTE_PATH`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call prints the names in one directory. It does not walk into subdirectories. + +## Edge cases + +- A relative path is rejected before Modal is called. +- A missing directory comes back from Modal as not found. +- A file path fails at the provider. + +## Run + +```sh +cd examples/typescript/modal/filesystem/list-modal-directory +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp + +``` + +## Warnings + +- Needs an existing sandbox and a directory at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/list-modal-directory/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/list-modal-directory/package-lock.json b/examples/typescript/modal/filesystem/list-modal-directory/package-lock.json new file mode 100644 index 00000000..3fc4bd89 --- /dev/null +++ b/examples/typescript/modal/filesystem/list-modal-directory/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-list-modal-directory", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-list-modal-directory", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/list-modal-directory/package.json b/examples/typescript/modal/filesystem/list-modal-directory/package.json new file mode 100644 index 00000000..6a7c987b --- /dev/null +++ b/examples/typescript/modal/filesystem/list-modal-directory/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-list-modal-directory", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/list-modal-directory/src/main.ts b/examples/typescript/modal/filesystem/list-modal-directory/src/main.ts new file mode 100644 index 00000000..d1329fe0 --- /dev/null +++ b/examples/typescript/modal/filesystem/list-modal-directory/src/main.ts @@ -0,0 +1,23 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +const entries = await sandbox.filesystem.listDirectory(remote); +console.log(`${remote} (${entries.length} entries)`); +for (const entry of entries) console.log(entry.name); diff --git a/examples/typescript/modal/filesystem/list-modal-directory/tsconfig.json b/examples/typescript/modal/filesystem/list-modal-directory/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/list-modal-directory/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/make-modal-directory/.env.example b/examples/typescript/modal/filesystem/make-modal-directory/.env.example new file mode 100644 index 00000000..f3a16272 --- /dev/null +++ b/examples/typescript/modal/filesystem/make-modal-directory/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/kit-files diff --git a/examples/typescript/modal/filesystem/make-modal-directory/.gitignore b/examples/typescript/modal/filesystem/make-modal-directory/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/make-modal-directory/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/make-modal-directory/README.md b/examples/typescript/modal/filesystem/make-modal-directory/README.md new file mode 100644 index 00000000..2aa82dee --- /dev/null +++ b/examples/typescript/modal/filesystem/make-modal-directory/README.md @@ -0,0 +1,49 @@ +# Create a Modal directory + +Create the directory at `MODAL_REMOTE_PATH`, including any missing parents. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call creates `MODAL_REMOTE_PATH` and any missing parents. + +## Edge cases + +- A relative path is rejected before Modal is called. +- `parents` defaults to true: missing parents are created, and an existing directory is accepted. +- `parents: false` requires the parent directory to exist. + +## Run + +```sh +cd examples/typescript/modal/filesystem/make-modal-directory +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/kit-files + +``` + +## Warnings + +- Creates the directory inside the existing sandbox. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/make-modal-directory/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/make-modal-directory/package-lock.json b/examples/typescript/modal/filesystem/make-modal-directory/package-lock.json new file mode 100644 index 00000000..0ad5a603 --- /dev/null +++ b/examples/typescript/modal/filesystem/make-modal-directory/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-make-modal-directory", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-make-modal-directory", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/make-modal-directory/package.json b/examples/typescript/modal/filesystem/make-modal-directory/package.json new file mode 100644 index 00000000..24b88828 --- /dev/null +++ b/examples/typescript/modal/filesystem/make-modal-directory/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-make-modal-directory", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/make-modal-directory/src/main.ts b/examples/typescript/modal/filesystem/make-modal-directory/src/main.ts new file mode 100644 index 00000000..eb93a107 --- /dev/null +++ b/examples/typescript/modal/filesystem/make-modal-directory/src/main.ts @@ -0,0 +1,22 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +await sandbox.filesystem.makeDirectory(remote); +console.log(`created ${remote}`); diff --git a/examples/typescript/modal/filesystem/make-modal-directory/tsconfig.json b/examples/typescript/modal/filesystem/make-modal-directory/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/make-modal-directory/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/read-modal-file/.env.example b/examples/typescript/modal/filesystem/read-modal-file/.env.example new file mode 100644 index 00000000..2e44e59a --- /dev/null +++ b/examples/typescript/modal/filesystem/read-modal-file/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt diff --git a/examples/typescript/modal/filesystem/read-modal-file/.gitignore b/examples/typescript/modal/filesystem/read-modal-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/read-modal-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/read-modal-file/README.md b/examples/typescript/modal/filesystem/read-modal-file/README.md new file mode 100644 index 00000000..b4f7b7da --- /dev/null +++ b/examples/typescript/modal/filesystem/read-modal-file/README.md @@ -0,0 +1,49 @@ +# Read a Modal file + +Read the bytes at `MODAL_REMOTE_PATH` with `Filesystem.ReadFile` / `sandbox.filesystem.readFile`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call returns the file contents as bytes. Decode text in your own program. The sandbox path is absolute. + +## Edge cases + +- A relative path, a blank path, or a path that contains a NUL byte is rejected before Modal is called. The error field is `path`. +- A missing file comes back from Modal as not found. +- A directory path fails at the provider. + +## Run + +```sh +cd examples/typescript/modal/filesystem/read-modal-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt + +``` + +## Warnings + +- Needs an existing sandbox and a file at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/read-modal-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/read-modal-file/package-lock.json b/examples/typescript/modal/filesystem/read-modal-file/package-lock.json new file mode 100644 index 00000000..59d8fc9b --- /dev/null +++ b/examples/typescript/modal/filesystem/read-modal-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-read-modal-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-read-modal-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/read-modal-file/package.json b/examples/typescript/modal/filesystem/read-modal-file/package.json new file mode 100644 index 00000000..ed806239 --- /dev/null +++ b/examples/typescript/modal/filesystem/read-modal-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-read-modal-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/read-modal-file/src/main.ts b/examples/typescript/modal/filesystem/read-modal-file/src/main.ts new file mode 100644 index 00000000..23392845 --- /dev/null +++ b/examples/typescript/modal/filesystem/read-modal-file/src/main.ts @@ -0,0 +1,22 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +const data = await sandbox.filesystem.readFile(remote); +console.log(`read ${remote} (${data.byteLength} bytes)`); diff --git a/examples/typescript/modal/filesystem/read-modal-file/tsconfig.json b/examples/typescript/modal/filesystem/read-modal-file/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/read-modal-file/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/remove-modal-file/.env.example b/examples/typescript/modal/filesystem/remove-modal-file/.env.example new file mode 100644 index 00000000..2920124a --- /dev/null +++ b/examples/typescript/modal/filesystem/remove-modal-file/.env.example @@ -0,0 +1,7 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +# MODAL_RECURSIVE=true diff --git a/examples/typescript/modal/filesystem/remove-modal-file/.gitignore b/examples/typescript/modal/filesystem/remove-modal-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/remove-modal-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/remove-modal-file/README.md b/examples/typescript/modal/filesystem/remove-modal-file/README.md new file mode 100644 index 00000000..2ed9e79b --- /dev/null +++ b/examples/typescript/modal/filesystem/remove-modal-file/README.md @@ -0,0 +1,50 @@ +# Remove a Modal path + +Delete `MODAL_REMOTE_PATH`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call deletes `MODAL_REMOTE_PATH`. With `MODAL_RECURSIVE` unset, it removes a file or an empty directory. Set `MODAL_RECURSIVE=true` to delete a directory and its contents. + +## Edge cases + +- A relative path is rejected before Modal is called. +- A missing path comes back from Modal as not found. +- A directory that still has entries fails when `MODAL_RECURSIVE` is unset. + +## Run + +```sh +cd examples/typescript/modal/filesystem/remove-modal-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt +# MODAL_RECURSIVE=true + +``` + +## Warnings + +- Deletes the remote path. A recursive delete removes the directory and everything inside it. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/remove-modal-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/remove-modal-file/package-lock.json b/examples/typescript/modal/filesystem/remove-modal-file/package-lock.json new file mode 100644 index 00000000..74a4e6c3 --- /dev/null +++ b/examples/typescript/modal/filesystem/remove-modal-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-remove-modal-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-remove-modal-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/remove-modal-file/package.json b/examples/typescript/modal/filesystem/remove-modal-file/package.json new file mode 100644 index 00000000..935346fe --- /dev/null +++ b/examples/typescript/modal/filesystem/remove-modal-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-remove-modal-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/remove-modal-file/src/main.ts b/examples/typescript/modal/filesystem/remove-modal-file/src/main.ts new file mode 100644 index 00000000..cc921aa1 --- /dev/null +++ b/examples/typescript/modal/filesystem/remove-modal-file/src/main.ts @@ -0,0 +1,23 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +const recursive = process.env.MODAL_RECURSIVE === "true"; +await sandbox.filesystem.remove(remote, recursive ? { recursive: true } : {}); +console.log(`removed ${remote}`); diff --git a/examples/typescript/modal/filesystem/remove-modal-file/tsconfig.json b/examples/typescript/modal/filesystem/remove-modal-file/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/remove-modal-file/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/stat-modal-file/.env.example b/examples/typescript/modal/filesystem/stat-modal-file/.env.example new file mode 100644 index 00000000..2e44e59a --- /dev/null +++ b/examples/typescript/modal/filesystem/stat-modal-file/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt diff --git a/examples/typescript/modal/filesystem/stat-modal-file/.gitignore b/examples/typescript/modal/filesystem/stat-modal-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/stat-modal-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/stat-modal-file/README.md b/examples/typescript/modal/filesystem/stat-modal-file/README.md new file mode 100644 index 00000000..49768681 --- /dev/null +++ b/examples/typescript/modal/filesystem/stat-modal-file/README.md @@ -0,0 +1,48 @@ +# Stat a Modal path + +Print the path, type, and size of `MODAL_REMOTE_PATH`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call prints the path, type, and size. A symlink result describes the symlink. Modal reports `mode` as a four-digit octal string when it has one. + +## Edge cases + +- A relative path is rejected before Modal is called. +- A missing path comes back from Modal as not found. + +## Run + +```sh +cd examples/typescript/modal/filesystem/stat-modal-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt + +``` + +## Warnings + +- Needs an existing sandbox and a path at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/stat-modal-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/stat-modal-file/package-lock.json b/examples/typescript/modal/filesystem/stat-modal-file/package-lock.json new file mode 100644 index 00000000..789725a9 --- /dev/null +++ b/examples/typescript/modal/filesystem/stat-modal-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-stat-modal-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-stat-modal-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/stat-modal-file/package.json b/examples/typescript/modal/filesystem/stat-modal-file/package.json new file mode 100644 index 00000000..5c900ad4 --- /dev/null +++ b/examples/typescript/modal/filesystem/stat-modal-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-stat-modal-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/stat-modal-file/src/main.ts b/examples/typescript/modal/filesystem/stat-modal-file/src/main.ts new file mode 100644 index 00000000..f4dbf112 --- /dev/null +++ b/examples/typescript/modal/filesystem/stat-modal-file/src/main.ts @@ -0,0 +1,22 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +const info = await sandbox.filesystem.stat(remote); +console.log(`${info.path} type=${info.type} size=${info.size}`); diff --git a/examples/typescript/modal/filesystem/stat-modal-file/tsconfig.json b/examples/typescript/modal/filesystem/stat-modal-file/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/stat-modal-file/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/filesystem/write-modal-file/.env.example b/examples/typescript/modal/filesystem/write-modal-file/.env.example new file mode 100644 index 00000000..2e44e59a --- /dev/null +++ b/examples/typescript/modal/filesystem/write-modal-file/.env.example @@ -0,0 +1,6 @@ +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt diff --git a/examples/typescript/modal/filesystem/write-modal-file/.gitignore b/examples/typescript/modal/filesystem/write-modal-file/.gitignore new file mode 100644 index 00000000..a8b14857 --- /dev/null +++ b/examples/typescript/modal/filesystem/write-modal-file/.gitignore @@ -0,0 +1,3 @@ +dist/ +node_modules/ +.env diff --git a/examples/typescript/modal/filesystem/write-modal-file/README.md b/examples/typescript/modal/filesystem/write-modal-file/README.md new file mode 100644 index 00000000..06b5e4a0 --- /dev/null +++ b/examples/typescript/modal/filesystem/write-modal-file/README.md @@ -0,0 +1,49 @@ +# Write a Modal file + +Replace the file at `MODAL_REMOTE_PATH` with the bytes of `hello from sandbox-kit`. The program opens that sandbox with `client.attach`. Attach does not look the id up. + +## What this means + +The call replaces the file with the bytes of `hello from sandbox-kit` and creates any missing parent directories. + +## Edge cases + +- A relative sandbox path is rejected before Modal is called. The error field is `path`. +- An existing file at that path is replaced. +- A path that names a directory fails at the provider. + +## Run + +```sh +cd examples/typescript/modal/filesystem/write-modal-file +cp .env.example .env +# Fill in the values below, then: +npm install +npm run build +npm start +``` + +Requires Node.js 20/22/24.15+, npm 11.19.0, and this checkout. Uses `await using` +so local client cleanup runs on success or failure. + +### Environment + +```dotenv +MODAL_TOKEN_ID= +MODAL_TOKEN_SECRET= +MODAL_APP_NAME= +MODAL_ENVIRONMENT=main +MODAL_SANDBOX_ID= +MODAL_REMOTE_PATH=/tmp/note.txt + +``` + +## Warnings + +- Overwrites the file at `MODAL_REMOTE_PATH`. +- Closing the handle leaves the sandbox as it is. Closing the client closes your connection to the provider. + +## Related + +- [go twin](../../../../go/modal/filesystem/write-modal-file/README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/filesystem/write-modal-file/package-lock.json b/examples/typescript/modal/filesystem/write-modal-file/package-lock.json new file mode 100644 index 00000000..d2a96eaf --- /dev/null +++ b/examples/typescript/modal/filesystem/write-modal-file/package-lock.json @@ -0,0 +1,97 @@ +{ + "name": "sandbox-kit-example-write-modal-file", + "version": "0.1.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "sandbox-kit-example-write-modal-file", + "version": "0.1.0", + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/providers/modal": { + "name": "@sandbox-kit/modal", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@sandbox-kit/sandbox": "0.1.5", + "modal": "0.11.1" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "../../../../../sdks/typescript/sandbox": { + "name": "@sandbox-kit/sandbox", + "version": "0.1.5", + "license": "MIT", + "dependencies": { + "@bufbuild/protobuf": "2.16.0", + "@bufbuild/protovalidate": "1.3.0", + "@sandbox-kit/contracts": "0.1.5" + }, + "devDependencies": { + "typescript": "5.9.3", + "vitest": "4.1.11" + }, + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + } + }, + "node_modules/@sandbox-kit/modal": { + "resolved": "../../../../../sdks/typescript/providers/modal", + "link": true + }, + "node_modules/@sandbox-kit/sandbox": { + "resolved": "../../../../../sdks/typescript/sandbox", + "link": true + }, + "node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + } + } +} diff --git a/examples/typescript/modal/filesystem/write-modal-file/package.json b/examples/typescript/modal/filesystem/write-modal-file/package.json new file mode 100644 index 00000000..14d4faa9 --- /dev/null +++ b/examples/typescript/modal/filesystem/write-modal-file/package.json @@ -0,0 +1,22 @@ +{ + "name": "sandbox-kit-example-write-modal-file", + "version": "0.1.0", + "private": true, + "type": "module", + "packageManager": "npm@11.19.0", + "engines": { + "node": "^20.0.0 || ^22.0.0 || >=24.15.0" + }, + "scripts": { + "build": "tsc -p tsconfig.json", + "start": "node --env-file-if-exists=.env dist/main.js" + }, + "dependencies": { + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" + }, + "devDependencies": { + "@types/node": "24.10.1", + "typescript": "5.9.3" + } +} diff --git a/examples/typescript/modal/filesystem/write-modal-file/src/main.ts b/examples/typescript/modal/filesystem/write-modal-file/src/main.ts new file mode 100644 index 00000000..a70704f8 --- /dev/null +++ b/examples/typescript/modal/filesystem/write-modal-file/src/main.ts @@ -0,0 +1,23 @@ +import { modal } from "@sandbox-kit/modal"; +import { Client } from "@sandbox-kit/sandbox"; + +await using client = new Client({ + provider: modal(), + auth: { + tokenPair: { + id: process.env.MODAL_TOKEN_ID!, + secret: process.env.MODAL_TOKEN_SECRET!, + }, + }, + scope: { + appName: process.env.MODAL_APP_NAME!, + environment: process.env.MODAL_ENVIRONMENT || "main", + }, + timeout: 120_000, +}); + +const sandbox = await client.attach(process.env.MODAL_SANDBOX_ID!); +const remote = process.env.MODAL_REMOTE_PATH!; +const body = new TextEncoder().encode("hello from sandbox-kit\n"); +await sandbox.filesystem.writeFile(remote, body); +console.log(`wrote ${remote} (${body.byteLength} bytes)`); diff --git a/examples/typescript/modal/filesystem/write-modal-file/tsconfig.json b/examples/typescript/modal/filesystem/write-modal-file/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/filesystem/write-modal-file/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/attach-modal-sandbox/.env.example b/examples/typescript/modal/lifecycle/attach-modal-sandbox/.env.example similarity index 100% rename from examples/typescript/modal/attach-modal-sandbox/.env.example rename to examples/typescript/modal/lifecycle/attach-modal-sandbox/.env.example diff --git a/examples/typescript/modal/create-modal-with-secrets/.gitignore b/examples/typescript/modal/lifecycle/attach-modal-sandbox/.gitignore similarity index 100% rename from examples/typescript/modal/create-modal-with-secrets/.gitignore rename to examples/typescript/modal/lifecycle/attach-modal-sandbox/.gitignore diff --git a/examples/typescript/modal/create-modal-with-secrets/.nvmrc b/examples/typescript/modal/lifecycle/attach-modal-sandbox/.nvmrc similarity index 100% rename from examples/typescript/modal/create-modal-with-secrets/.nvmrc rename to examples/typescript/modal/lifecycle/attach-modal-sandbox/.nvmrc diff --git a/examples/typescript/modal/attach-modal-sandbox/README.md b/examples/typescript/modal/lifecycle/attach-modal-sandbox/README.md similarity index 84% rename from examples/typescript/modal/attach-modal-sandbox/README.md rename to examples/typescript/modal/lifecycle/attach-modal-sandbox/README.md index 4052c24b..f6c30db7 100644 --- a/examples/typescript/modal/attach-modal-sandbox/README.md +++ b/examples/typescript/modal/lifecycle/attach-modal-sandbox/README.md @@ -18,7 +18,7 @@ handle. ## Run ```sh -cd examples/typescript/modal/attach-modal-sandbox +cd examples/typescript/modal/lifecycle/attach-modal-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -46,6 +46,6 @@ MODAL_SANDBOX_ID= ## Related -- [go twin](../../../go/modal/attach-modal-sandbox/README.md) +- [go twin](../../../../go/modal/lifecycle/attach-modal-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/attach-modal-sandbox/package-lock.json b/examples/typescript/modal/lifecycle/attach-modal-sandbox/package-lock.json similarity index 86% rename from examples/typescript/modal/attach-modal-sandbox/package-lock.json rename to examples/typescript/modal/lifecycle/attach-modal-sandbox/package-lock.json index 79966c85..70f331ff 100644 --- a/examples/typescript/modal/attach-modal-sandbox/package-lock.json +++ b/examples/typescript/modal/lifecycle/attach-modal-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-attach-modal-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/attach-modal-sandbox/package.json b/examples/typescript/modal/lifecycle/attach-modal-sandbox/package.json similarity index 74% rename from examples/typescript/modal/attach-modal-sandbox/package.json rename to examples/typescript/modal/lifecycle/attach-modal-sandbox/package.json index 90fe8e19..43a45214 100644 --- a/examples/typescript/modal/attach-modal-sandbox/package.json +++ b/examples/typescript/modal/lifecycle/attach-modal-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/attach-modal-sandbox/src/main.ts b/examples/typescript/modal/lifecycle/attach-modal-sandbox/src/main.ts similarity index 100% rename from examples/typescript/modal/attach-modal-sandbox/src/main.ts rename to examples/typescript/modal/lifecycle/attach-modal-sandbox/src/main.ts diff --git a/examples/typescript/modal/lifecycle/attach-modal-sandbox/tsconfig.json b/examples/typescript/modal/lifecycle/attach-modal-sandbox/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/lifecycle/attach-modal-sandbox/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/close-modal-handle/.env.example b/examples/typescript/modal/lifecycle/close-modal-handle/.env.example similarity index 100% rename from examples/typescript/modal/close-modal-handle/.env.example rename to examples/typescript/modal/lifecycle/close-modal-handle/.env.example diff --git a/examples/typescript/modal/handle-modal-errors/.gitignore b/examples/typescript/modal/lifecycle/close-modal-handle/.gitignore similarity index 100% rename from examples/typescript/modal/handle-modal-errors/.gitignore rename to examples/typescript/modal/lifecycle/close-modal-handle/.gitignore diff --git a/examples/typescript/modal/handle-modal-errors/.nvmrc b/examples/typescript/modal/lifecycle/close-modal-handle/.nvmrc similarity index 100% rename from examples/typescript/modal/handle-modal-errors/.nvmrc rename to examples/typescript/modal/lifecycle/close-modal-handle/.nvmrc diff --git a/examples/typescript/modal/close-modal-handle/README.md b/examples/typescript/modal/lifecycle/close-modal-handle/README.md similarity index 84% rename from examples/typescript/modal/close-modal-handle/README.md rename to examples/typescript/modal/lifecycle/close-modal-handle/README.md index caddec83..d7ac8f07 100644 --- a/examples/typescript/modal/close-modal-handle/README.md +++ b/examples/typescript/modal/lifecycle/close-modal-handle/README.md @@ -18,7 +18,7 @@ handle. ## Run ```sh -cd examples/typescript/modal/close-modal-handle +cd examples/typescript/modal/lifecycle/close-modal-handle cp .env.example .env # Fill in the values below, then: npm install @@ -46,6 +46,6 @@ MODAL_SANDBOX_ID= ## Related -- [go twin](../../../go/modal/close-modal-handle/README.md) +- [go twin](../../../../go/modal/lifecycle/close-modal-handle/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/close-modal-handle/package-lock.json b/examples/typescript/modal/lifecycle/close-modal-handle/package-lock.json similarity index 86% rename from examples/typescript/modal/close-modal-handle/package-lock.json rename to examples/typescript/modal/lifecycle/close-modal-handle/package-lock.json index 6f31ea31..71302d30 100644 --- a/examples/typescript/modal/close-modal-handle/package-lock.json +++ b/examples/typescript/modal/lifecycle/close-modal-handle/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-close-modal-handle", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/close-modal-handle/package.json b/examples/typescript/modal/lifecycle/close-modal-handle/package.json similarity index 74% rename from examples/typescript/modal/close-modal-handle/package.json rename to examples/typescript/modal/lifecycle/close-modal-handle/package.json index dcc28d13..04fa938d 100644 --- a/examples/typescript/modal/close-modal-handle/package.json +++ b/examples/typescript/modal/lifecycle/close-modal-handle/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/close-modal-handle/src/main.ts b/examples/typescript/modal/lifecycle/close-modal-handle/src/main.ts similarity index 100% rename from examples/typescript/modal/close-modal-handle/src/main.ts rename to examples/typescript/modal/lifecycle/close-modal-handle/src/main.ts diff --git a/examples/typescript/modal/lifecycle/close-modal-handle/tsconfig.json b/examples/typescript/modal/lifecycle/close-modal-handle/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/lifecycle/close-modal-handle/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/request-modal-termination/.env.example b/examples/typescript/modal/lifecycle/request-modal-termination/.env.example similarity index 100% rename from examples/typescript/modal/request-modal-termination/.env.example rename to examples/typescript/modal/lifecycle/request-modal-termination/.env.example diff --git a/examples/typescript/modal/request-modal-termination/.gitignore b/examples/typescript/modal/lifecycle/request-modal-termination/.gitignore similarity index 100% rename from examples/typescript/modal/request-modal-termination/.gitignore rename to examples/typescript/modal/lifecycle/request-modal-termination/.gitignore diff --git a/examples/typescript/modal/request-modal-termination/.nvmrc b/examples/typescript/modal/lifecycle/request-modal-termination/.nvmrc similarity index 100% rename from examples/typescript/modal/request-modal-termination/.nvmrc rename to examples/typescript/modal/lifecycle/request-modal-termination/.nvmrc diff --git a/examples/typescript/modal/request-modal-termination/README.md b/examples/typescript/modal/lifecycle/request-modal-termination/README.md similarity index 82% rename from examples/typescript/modal/request-modal-termination/README.md rename to examples/typescript/modal/lifecycle/request-modal-termination/README.md index f541ac21..2891acc3 100644 --- a/examples/typescript/modal/request-modal-termination/README.md +++ b/examples/typescript/modal/lifecycle/request-modal-termination/README.md @@ -16,7 +16,7 @@ accepted instead of blocking for an exit code. ## Run ```sh -cd examples/typescript/modal/request-modal-termination +cd examples/typescript/modal/lifecycle/request-modal-termination cp .env.example .env # Fill in the values below, then: npm install @@ -45,6 +45,6 @@ MODAL_SANDBOX_ID= ## Related -- [go twin](../../../go/modal/request-modal-termination/README.md) +- [go twin](../../../../go/modal/lifecycle/request-modal-termination/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/request-modal-termination/package-lock.json b/examples/typescript/modal/lifecycle/request-modal-termination/package-lock.json similarity index 86% rename from examples/typescript/modal/request-modal-termination/package-lock.json rename to examples/typescript/modal/lifecycle/request-modal-termination/package-lock.json index 8daa8dfb..96c811a5 100644 --- a/examples/typescript/modal/request-modal-termination/package-lock.json +++ b/examples/typescript/modal/lifecycle/request-modal-termination/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-request-modal-termination", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/request-modal-termination/package.json b/examples/typescript/modal/lifecycle/request-modal-termination/package.json similarity index 74% rename from examples/typescript/modal/request-modal-termination/package.json rename to examples/typescript/modal/lifecycle/request-modal-termination/package.json index 20282953..3c03c96f 100644 --- a/examples/typescript/modal/request-modal-termination/package.json +++ b/examples/typescript/modal/lifecycle/request-modal-termination/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/request-modal-termination/src/main.ts b/examples/typescript/modal/lifecycle/request-modal-termination/src/main.ts similarity index 100% rename from examples/typescript/modal/request-modal-termination/src/main.ts rename to examples/typescript/modal/lifecycle/request-modal-termination/src/main.ts diff --git a/examples/typescript/modal/lifecycle/request-modal-termination/tsconfig.json b/examples/typescript/modal/lifecycle/request-modal-termination/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/lifecycle/request-modal-termination/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/terminate-modal-sandbox/.env.example b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/.env.example similarity index 100% rename from examples/typescript/modal/terminate-modal-sandbox/.env.example rename to examples/typescript/modal/lifecycle/terminate-modal-sandbox/.env.example diff --git a/examples/typescript/modal/terminate-modal-sandbox/.gitignore b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/.gitignore similarity index 100% rename from examples/typescript/modal/terminate-modal-sandbox/.gitignore rename to examples/typescript/modal/lifecycle/terminate-modal-sandbox/.gitignore diff --git a/examples/typescript/modal/terminate-modal-sandbox/.nvmrc b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/.nvmrc similarity index 100% rename from examples/typescript/modal/terminate-modal-sandbox/.nvmrc rename to examples/typescript/modal/lifecycle/terminate-modal-sandbox/.nvmrc diff --git a/examples/typescript/modal/terminate-modal-sandbox/README.md b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/README.md similarity index 86% rename from examples/typescript/modal/terminate-modal-sandbox/README.md rename to examples/typescript/modal/lifecycle/terminate-modal-sandbox/README.md index 3af52e17..e3d70149 100644 --- a/examples/typescript/modal/terminate-modal-sandbox/README.md +++ b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/README.md @@ -20,7 +20,7 @@ result when available. A later call goes to Modal, and Kit returns that result. ## Run ```sh -cd examples/typescript/modal/terminate-modal-sandbox +cd examples/typescript/modal/lifecycle/terminate-modal-sandbox cp .env.example .env # Fill in the values below, then: npm install @@ -49,6 +49,6 @@ MODAL_SANDBOX_ID= ## Related -- [go twin](../../../go/modal/terminate-modal-sandbox/README.md) +- [go twin](../../../../go/modal/lifecycle/terminate-modal-sandbox/README.md) -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/terminate-modal-sandbox/package-lock.json b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/package-lock.json similarity index 86% rename from examples/typescript/modal/terminate-modal-sandbox/package-lock.json rename to examples/typescript/modal/lifecycle/terminate-modal-sandbox/package-lock.json index f285398a..d7b573c7 100644 --- a/examples/typescript/modal/terminate-modal-sandbox/package-lock.json +++ b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-terminate-modal-sandbox", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/terminate-modal-sandbox/package.json b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/package.json similarity index 74% rename from examples/typescript/modal/terminate-modal-sandbox/package.json rename to examples/typescript/modal/lifecycle/terminate-modal-sandbox/package.json index f3000f4a..1cb42af4 100644 --- a/examples/typescript/modal/terminate-modal-sandbox/package.json +++ b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/terminate-modal-sandbox/src/main.ts b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/src/main.ts similarity index 100% rename from examples/typescript/modal/terminate-modal-sandbox/src/main.ts rename to examples/typescript/modal/lifecycle/terminate-modal-sandbox/src/main.ts diff --git a/examples/typescript/modal/lifecycle/terminate-modal-sandbox/tsconfig.json b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/lifecycle/terminate-modal-sandbox/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/examples/typescript/modal/terminate-modal-with-timeout/.env.example b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/.env.example similarity index 100% rename from examples/typescript/modal/terminate-modal-with-timeout/.env.example rename to examples/typescript/modal/lifecycle/terminate-modal-with-timeout/.env.example diff --git a/examples/typescript/modal/terminate-modal-with-timeout/.gitignore b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/.gitignore similarity index 100% rename from examples/typescript/modal/terminate-modal-with-timeout/.gitignore rename to examples/typescript/modal/lifecycle/terminate-modal-with-timeout/.gitignore diff --git a/examples/typescript/modal/terminate-modal-with-timeout/.nvmrc b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/.nvmrc similarity index 100% rename from examples/typescript/modal/terminate-modal-with-timeout/.nvmrc rename to examples/typescript/modal/lifecycle/terminate-modal-with-timeout/.nvmrc diff --git a/examples/typescript/modal/terminate-modal-with-timeout/README.md b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/README.md similarity index 90% rename from examples/typescript/modal/terminate-modal-with-timeout/README.md rename to examples/typescript/modal/lifecycle/terminate-modal-with-timeout/README.md index e3e3fdc4..42f9bf10 100644 --- a/examples/typescript/modal/terminate-modal-with-timeout/README.md +++ b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/README.md @@ -17,7 +17,7 @@ single options bag also sets Kit’s abort deadline for the waited terminate. ## Run ```sh -cd examples/typescript/modal/terminate-modal-with-timeout +cd examples/typescript/modal/lifecycle/terminate-modal-with-timeout cp .env.example .env # Fill in the values below, then: npm install @@ -46,4 +46,4 @@ MODAL_SANDBOX_ID= ## Related -- Catalog: [examples/typescript/README.md](../../README.md) +- Catalog: [examples/typescript/README.md](../../../README.md) diff --git a/examples/typescript/modal/terminate-modal-with-timeout/package-lock.json b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/package-lock.json similarity index 86% rename from examples/typescript/modal/terminate-modal-with-timeout/package-lock.json rename to examples/typescript/modal/lifecycle/terminate-modal-with-timeout/package-lock.json index fa8f6177..befb72e9 100644 --- a/examples/typescript/modal/terminate-modal-with-timeout/package-lock.json +++ b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/package-lock.json @@ -8,8 +8,8 @@ "name": "sandbox-kit-example-terminate-modal-with-timeout", "version": "0.1.0", "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", @@ -19,7 +19,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/providers/modal": { + "../../../../../sdks/typescript/providers/modal": { "name": "@sandbox-kit/modal", "version": "0.1.5", "license": "MIT", @@ -37,7 +37,7 @@ "node": "^20.0.0 || ^22.0.0 || >=24.15.0" } }, - "../../../../sdks/typescript/sandbox": { + "../../../../../sdks/typescript/sandbox": { "name": "@sandbox-kit/sandbox", "version": "0.1.5", "license": "MIT", @@ -55,11 +55,11 @@ } }, "node_modules/@sandbox-kit/modal": { - "resolved": "../../../../sdks/typescript/providers/modal", + "resolved": "../../../../../sdks/typescript/providers/modal", "link": true }, "node_modules/@sandbox-kit/sandbox": { - "resolved": "../../../../sdks/typescript/sandbox", + "resolved": "../../../../../sdks/typescript/sandbox", "link": true }, "node_modules/@types/node": { diff --git a/examples/typescript/modal/terminate-modal-with-timeout/package.json b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/package.json similarity index 74% rename from examples/typescript/modal/terminate-modal-with-timeout/package.json rename to examples/typescript/modal/lifecycle/terminate-modal-with-timeout/package.json index ac76601c..ec9bc73b 100644 --- a/examples/typescript/modal/terminate-modal-with-timeout/package.json +++ b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/package.json @@ -12,8 +12,8 @@ "start": "node --env-file-if-exists=.env dist/main.js" }, "dependencies": { - "@sandbox-kit/modal": "file:../../../../sdks/typescript/providers/modal", - "@sandbox-kit/sandbox": "file:../../../../sdks/typescript/sandbox" + "@sandbox-kit/modal": "file:../../../../../sdks/typescript/providers/modal", + "@sandbox-kit/sandbox": "file:../../../../../sdks/typescript/sandbox" }, "devDependencies": { "@types/node": "24.10.1", diff --git a/examples/typescript/modal/terminate-modal-with-timeout/src/main.ts b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/src/main.ts similarity index 100% rename from examples/typescript/modal/terminate-modal-with-timeout/src/main.ts rename to examples/typescript/modal/lifecycle/terminate-modal-with-timeout/src/main.ts diff --git a/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/tsconfig.json b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/tsconfig.json new file mode 100644 index 00000000..b1e6e13e --- /dev/null +++ b/examples/typescript/modal/lifecycle/terminate-modal-with-timeout/tsconfig.json @@ -0,0 +1,18 @@ +{ + "compilerOptions": { + "target": "ES2022", + "module": "NodeNext", + "moduleResolution": "NodeNext", + "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], + "outDir": "dist", + "rootDir": "src", + "strict": true, + "exactOptionalPropertyTypes": true, + "noUncheckedIndexedAccess": true, + "useUnknownInCatchVariables": true, + "verbatimModuleSyntax": true, + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +} diff --git a/go.work b/go.work index d99eb36e..28b248f1 100644 --- a/go.work +++ b/go.work @@ -1,53 +1,69 @@ go 1.26.0 use ( - ./examples/go/daytona/archive-daytona-sandbox - ./examples/go/daytona/close-daytona-handle - ./examples/go/daytona/create-daytona-ephemeral - ./examples/go/daytona/create-daytona-from-image - ./examples/go/daytona/create-daytona-from-snapshot - ./examples/go/daytona/create-daytona-linked - ./examples/go/daytona/create-daytona-sandbox - ./examples/go/daytona/create-daytona-with-kvm - ./examples/go/daytona/create-daytona-with-labels - ./examples/go/daytona/create-daytona-with-network - ./examples/go/daytona/create-daytona-with-policies - ./examples/go/daytona/create-daytona-with-runtime - ./examples/go/daytona/create-daytona-with-secrets - ./examples/go/daytona/create-daytona-with-ttl - ./examples/go/daytona/delete-daytona-sandbox - ./examples/go/daytona/force-stop-daytona-sandbox - ./examples/go/daytona/get-daytona-sandbox - ./examples/go/daytona/handle-daytona-errors - ./examples/go/daytona/pause-daytona-sandbox - ./examples/go/daytona/refresh-daytona-sandbox - ./examples/go/daytona/request-daytona-deletion - ./examples/go/daytona/start-daytona-sandbox - ./examples/go/daytona/start-daytona-with-timeout - ./examples/go/daytona/stop-daytona-sandbox - ./examples/go/modal/attach-modal-sandbox - ./examples/go/modal/close-modal-handle - ./examples/go/modal/create-modal-client-timeout - ./examples/go/modal/create-modal-gvisor - ./examples/go/modal/create-modal-idle - ./examples/go/modal/create-modal-linux-vm - ./examples/go/modal/create-modal-ready - ./examples/go/modal/create-modal-sandbox - ./examples/go/modal/create-modal-tcp-ready - ./examples/go/modal/create-modal-verbose - ./examples/go/modal/create-modal-with-allowlists - ./examples/go/modal/create-modal-with-identity - ./examples/go/modal/create-modal-with-labels - ./examples/go/modal/create-modal-with-network - ./examples/go/modal/create-modal-with-placement - ./examples/go/modal/create-modal-with-ports - ./examples/go/modal/create-modal-with-resources - ./examples/go/modal/create-modal-with-runtime - ./examples/go/modal/create-modal-with-secrets - ./examples/go/modal/handle-modal-errors - ./examples/go/modal/request-modal-termination - ./examples/go/modal/terminate-modal-sandbox - ./examples/go/modal/terminate-modal-with-timeout + ./examples/go/daytona/lifecycle/archive-daytona-sandbox + ./examples/go/daytona/lifecycle/close-daytona-handle + ./examples/go/daytona/configuration/create-daytona-ephemeral + ./examples/go/daytona/configuration/create-daytona-from-image + ./examples/go/daytona/configuration/create-daytona-from-snapshot + ./examples/go/daytona/configuration/create-daytona-linked + ./examples/go/daytona/configuration/create-daytona-sandbox + ./examples/go/daytona/configuration/create-daytona-with-kvm + ./examples/go/daytona/configuration/create-daytona-with-labels + ./examples/go/daytona/configuration/create-daytona-with-network + ./examples/go/daytona/configuration/create-daytona-with-policies + ./examples/go/daytona/configuration/create-daytona-with-runtime + ./examples/go/daytona/configuration/create-daytona-with-secrets + ./examples/go/daytona/configuration/create-daytona-with-ttl + ./examples/go/daytona/lifecycle/delete-daytona-sandbox + ./examples/go/daytona/lifecycle/force-stop-daytona-sandbox + ./examples/go/daytona/lifecycle/get-daytona-sandbox + ./examples/go/daytona/errors/handle-daytona-errors + ./examples/go/daytona/lifecycle/pause-daytona-sandbox + ./examples/go/daytona/lifecycle/refresh-daytona-sandbox + ./examples/go/daytona/lifecycle/request-daytona-deletion + ./examples/go/daytona/lifecycle/start-daytona-sandbox + ./examples/go/daytona/lifecycle/start-daytona-with-timeout + ./examples/go/daytona/lifecycle/stop-daytona-sandbox + ./examples/go/modal/lifecycle/attach-modal-sandbox + ./examples/go/modal/lifecycle/close-modal-handle + ./examples/go/modal/configuration/create-modal-client-timeout + ./examples/go/modal/configuration/create-modal-gvisor + ./examples/go/modal/configuration/create-modal-idle + ./examples/go/modal/configuration/create-modal-linux-vm + ./examples/go/modal/configuration/create-modal-ready + ./examples/go/modal/configuration/create-modal-sandbox + ./examples/go/modal/configuration/create-modal-tcp-ready + ./examples/go/modal/configuration/create-modal-verbose + ./examples/go/modal/configuration/create-modal-with-allowlists + ./examples/go/modal/configuration/create-modal-with-identity + ./examples/go/modal/configuration/create-modal-with-labels + ./examples/go/modal/configuration/create-modal-with-network + ./examples/go/modal/configuration/create-modal-with-placement + ./examples/go/modal/configuration/create-modal-with-ports + ./examples/go/modal/configuration/create-modal-with-resources + ./examples/go/modal/configuration/create-modal-with-runtime + ./examples/go/modal/configuration/create-modal-with-secrets + ./examples/go/modal/errors/handle-modal-errors + ./examples/go/modal/lifecycle/request-modal-termination + ./examples/go/modal/lifecycle/terminate-modal-sandbox + ./examples/go/modal/lifecycle/terminate-modal-with-timeout + ./examples/go/daytona/filesystem/copy-file-from-daytona + ./examples/go/daytona/filesystem/copy-file-into-daytona + ./examples/go/daytona/filesystem/list-daytona-directory + ./examples/go/daytona/filesystem/make-daytona-directory + ./examples/go/daytona/filesystem/read-daytona-file + ./examples/go/daytona/filesystem/remove-daytona-file + ./examples/go/daytona/filesystem/stat-daytona-file + ./examples/go/daytona/filesystem/write-daytona-file + ./examples/go/modal/filesystem/copy-file-from-modal + ./examples/go/modal/filesystem/copy-file-into-modal + ./examples/go/modal/filesystem/list-modal-directory + ./examples/go/modal/filesystem/make-modal-directory + ./examples/go/modal/filesystem/read-modal-file + ./examples/go/modal/filesystem/remove-modal-file + ./examples/go/modal/filesystem/stat-modal-file + ./examples/go/modal/filesystem/write-modal-file ./sdks/go/internal/contracts ./sdks/go/internal/sdk ./sdks/go/providers/daytona diff --git a/go.work.sum b/go.work.sum index 0b3040ed..967c9e08 100644 --- a/go.work.sum +++ b/go.work.sum @@ -1,9 +1,7 @@ -buf.build/go/hyperpb v0.1.3/go.mod h1:IHXAM5qnS0/Fsnd7/HGDghFNvUET646WoHmq1FDZXIE= cel.dev/expr v0.25.2/go.mod h1:hrXvqGP6G6gyx8UAHSHJ5RGk//1Oj5nXQ2NI02Nrsg4= cloud.google.com/go/auth v0.18.2/go.mod h1:xD+oY7gcahcu7G2SG2DsBerfFxgPAJz17zz2joOFF3M= cloud.google.com/go/compute/metadata v0.9.0/go.mod h1:E0bWwX5wTnLPedCKqk3pJmVgCBSM6qQI1yTBdEb3C10= github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.33.0/go.mod h1:pJTkW8hEUIIi3Pf65lPZOnn4Y81yCllX6IWk2jNXdkM= -github.com/apapsch/go-jsonmerge/v2 v2.0.0/go.mod h1:lvDnEdqiQrp0O42VQGgmlKpxL1AP2+08jFMw88y4klk= github.com/cncf/xds/go v0.0.0-20260202195803-dba9d589def2/go.mod h1:qwXFYgsP6T7XnJtbKlf1HP8AjxZZyzxMmc+Lq5GjlU4= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -14,81 +12,39 @@ github.com/envoyproxy/protoc-gen-validate v1.3.3/go.mod h1:TsndJ/ngyIdQRhMcVVGDD github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U= github.com/felixge/httpsnoop v1.1.0/go.mod h1:Zqxgdd+1Rkcz8euOqdr7lqgCRJztwr5hp9vDSi5UZCE= github.com/go-jose/go-jose/v4 v4.1.4/go.mod h1:x4oUasVrzR7071A4TnHLGSPpNOm2a21K9Kf04k1rs08= -github.com/go-openapi/analysis v0.25.5/go.mod h1:d3UGtQC5uq5Kqqqis2VH09Km/v3vwsWrYkbp4gdm+Rc= -github.com/go-openapi/errors v0.22.8/go.mod h1:BuUoHcYrU6E7V9gfj1I5wLQqgtIHnup/alXZ8KdgQ0w= -github.com/go-openapi/jsonpointer v1.0.0/go.mod h1:Z3rw7dWu1p9IgitXCFamSlA5lmDiklEB6vkaxcNZW5Y= -github.com/go-openapi/jsonreference v1.0.0/go.mod h1:jtwdyGbJk0Xhe5Y+rwtglQP6Sb1WZST4rT32LWB+sv0= -github.com/go-openapi/loads v0.25.0/go.mod h1:JFBw4SIB9+PTIFHDfcXuSSy5h6aWzjtUCrPYyx3qWU8= -github.com/go-openapi/runtime v0.33.0/go.mod h1:+rsupH3+TFKqmFysqkmgBOTxpVJV8eV+j9myvvea2Xw= -github.com/go-openapi/runtime/server-middleware v0.30.0/go.mod h1:OYNT/TxNvB/VK5oe4htM2jDTwlEXuejVJmu0DVZfAMs= -github.com/go-openapi/spec v0.22.9/go.mod h1:b/mNUYIOQOyIiUzUzXEE8xzyZqf93KvM9hQGP91yfl0= -github.com/go-openapi/strfmt v0.27.0/go.mod h1:s/qhDqfY72irigXUGJmtgid2Rm+3tnz3k8hZaRmvWYc= -github.com/go-openapi/swag v0.28.0/go.mod h1:4qYnT3Cqr1p1VknOdPo70evN4rgQnAg6jwApHyxSGIg= -github.com/go-openapi/swag/cmdutils v0.28.0/go.mod h1:Sm1MVFMkF6guJJ+pQqHnQA3N0j9qALV3NxzDSv6bETM= -github.com/go-openapi/swag/conv v0.28.0/go.mod h1:mbUE+mzctnhxi864m0Q07SpN8OowD9JhxmxuYvZZD/k= -github.com/go-openapi/swag/fileutils v0.28.0/go.mod h1:VvJFZLTZS0AI854gEQz5tk7dBESdLjiNUMSZ/th2ry8= -github.com/go-openapi/swag/jsonutils v0.28.0/go.mod h1:CYM3WlTUcagR2ZoHdz54di/cbBqt82tuxuXgAjxw+mg= -github.com/go-openapi/swag/loading v0.28.0/go.mod h1:rXB0QiQX5mMveXEA7ouM4KiiM9jVJe4K6BVbwhD1M4k= -github.com/go-openapi/swag/mangling v0.28.0/go.mod h1:jtBE2+V+3pILxOR7Vgce+Cwp6A2PgZbvVqfNntbVs0w= -github.com/go-openapi/swag/netutils v0.28.0/go.mod h1:J+WYyFMLtvtCGqa6jLv+YNUmIKI3ZRQRrvfNDMoQoEQ= -github.com/go-openapi/swag/pools v0.28.0/go.mod h1:kVQefhSK5RWuRe7BXsL8htgBPAMpN7HDGpGEknqugeE= -github.com/go-openapi/swag/stringutils v0.28.0/go.mod h1:lzRN95CxXmA03XcDWHLOb6nOMcxCqR5rGY0lOgsfRoM= -github.com/go-openapi/swag/typeutils v0.28.0/go.mod h1:Srm0xFNRZ1Y+vCxJclo5qzx8aj+1pAKda/YfFPrG0dQ= -github.com/go-openapi/swag/yamlutils v0.28.0/go.mod h1:x0q/yndZHEgk9Rx3DyDqzFUmHy55KTvIZldvF2dTJXs= -github.com/go-openapi/validate v0.26.1/go.mod h1:B8UMgXiQiwwQWIbmuROlwJZDPGlikPuh7iHV1vPX9Oo= -github.com/go-viper/mapstructure/v2 v2.5.0/go.mod h1:oJDH3BJKyqBA2TXFhDsKDGDTlndYOZ6rGS0BRZIxGhM= github.com/golang/glog v1.2.5/go.mod h1:6AhwSGph0fcJtXVM/PEHPqZlFeoLxhs7/t5UDAwmO+w= github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= -github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= -github.com/google/pprof v0.0.0-20250820193118-f64d9cf942d6/go.mod h1:I6V7YzU0XDpsHqbsyrghnFZLO1gwK6NPTNvmetQIk9U= github.com/google/s2a-go v0.1.9/go.mod h1:YA0Ei2ZQL3acow2O62kdp9UlnvMmU7kA6Eutn0dXayM= github.com/googleapis/enterprise-certificate-proxy v0.3.11/go.mod h1:RFV7MUdlb7AgEq2v7FmMCfeSMCllAzWxFgRdusoGks8= github.com/googleapis/gax-go/v2 v2.17.0/go.mod h1:mzaqghpQp4JDh3HvADwrat+6M3MOIDp5YKHhb9PAgDY= -github.com/oapi-codegen/runtime v1.6.0/go.mod h1:GwV7hC2hviaMzj+ITfHVRESK5J2W/GefVwIND/bMGvU= -github.com/oklog/ulid/v2 v2.1.1/go.mod h1:rcEKHmBBKfef9DhnvX7y1HZBYxjXb0cP5ExxNsTT1QQ= github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10/go.mod h1:t/avpk3KcrXxUnYOhZhMXJlSEyie6gQbtLq5NM3loB8= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/spiffe/go-spiffe/v2 v2.7.0/go.mod h1:47Q0Q9/AqGha8QLHp+kxpH4Wca7X7EnOtlIJy3mxZ3U= github.com/stretchr/objx v0.5.3/go.mod h1:rDQraq+vQZU7Fde9LOZLr8Tax6zZvy4kuNKF+QYS+U0= github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U= -github.com/timandy/routine v1.1.6/go.mod h1:kXslgIosdY8LW0byTyPnenDgn4/azt2euufAq9rK51w= -github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= go.opentelemetry.io/contrib/detectors/gcp v1.44.0/go.mod h1:tNAsgd8avTGke1+MndXlU5Cru4PQ9Ai/cCNWQv/ZJ/s= -go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.70.0/go.mod h1:DqEFwLumhzMBDQv9PcWbyoDxHI/4lAk6CM4nJBH39sc= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.61.0/go.mod h1:UHB22Z8QsdRDrnAtX4PntOl36ajSxcdUMt1sF7Y6E7Q= go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.70.0/go.mod h1:085m8qbm4hgc8rZWGDEa4vmyyo2c3nPxUslYUKUIU04= go.opentelemetry.io/otel v1.44.0/go.mod h1:BMgjTHL9WPRlRjL2oZCBTL4whCGtXch2H4BhOPIAyYc= go.opentelemetry.io/otel v1.45.0/go.mod h1:XZxIqPapzEYnhNSScF5DIqXhm/rYi0FzCe2XddAwZfQ= -go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.45.0/go.mod h1:L7u+MirGoB1bjeLH66+xDykF4RC8C3RN7lIFpBiewUo= go.opentelemetry.io/otel/metric v1.45.0/go.mod h1:HAPbm1nd3p1PmFH7v2dR+6BjXxw+Lq4a2+pndMAm08s= go.opentelemetry.io/otel/sdk v1.45.0/go.mod h1:Sr40LgXV7DsKMMJMKOhUWOgMWTfAaqvm2kF0g7ilwuA= go.opentelemetry.io/otel/sdk/metric v1.44.0/go.mod h1:5B5pMARnXxKhltooO4xUuCBorl65a4EpnTalObqOigA= go.opentelemetry.io/otel/sdk/metric v1.45.0/go.mod h1:vUWUxDZvu1WVRj8JA8S0AdhsPrZoDpA2DdZauIh4mDA= go.opentelemetry.io/otel/trace v1.45.0/go.mod h1:qoJJA2xNMnxRrdISU/kLtfUH2wNeQbiv+jhs/CxI8bc= golang.org/x/crypto v0.55.0/go.mod h1:uq0V9dE/fzQuJtbnL+2EhWOE63vo164FY8xqEnV9xis= -golang.org/x/crypto v0.57.0 h1:3ZVCjf8Ggz7zneR/EHRVx68Ctf+2pmIMP2UFhh9cC6M= golang.org/x/crypto v0.57.0/go.mod h1:Fdz0i5U6CoizGwLda9DttjSk6qlZo25zYNtR+ycvuZA= -golang.org/x/exp v0.0.0-20250606033433-dcc06ee1d476/go.mod h1:3//PLf8L/X+8b4vuAfHzxeRUl04Adcb341+IGKfnqS8= -golang.org/x/mod v0.38.0/go.mod h1:V6Xz0pq8TQ3dGqVQ1FVHuelZpAL0uNhSkk9ogYP3c40= -golang.org/x/mod v0.39.0/go.mod h1:bvIbwjQ0HUFFf5AKukeeYQG4ZBUG9yxQbR9aEweIwYY= golang.org/x/mod v0.41.0/go.mod h1:Ek9pY8RKWXwsWvd3rQiHYtMqkjSUV+s1Rj7j4H5Ur6o= golang.org/x/net v0.57.0/go.mod h1:KpXc8iv+r3XplLAG/f7Jsf9RPszJzdR0f58q9vGOuEU= golang.org/x/net v0.58.0/go.mod h1:YwCddHnFlT7eLQqVprV19OnhLGtc5xOKgE0RyqgfWAU= -golang.org/x/net v0.59.0/go.mod h1:2DA/G1UfVbCpQPeWTmMPGY7Cs2PkBkwu743bVX5PIVg= golang.org/x/oauth2 v0.36.0/go.mod h1:YDBUJMTkDnJS+A4BP4eZBjCqtokkg1hODuPjwiGPO7Q= golang.org/x/sync v0.22.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0= golang.org/x/sys v0.47.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw= -golang.org/x/telemetry v0.0.0-20260811182544-a038080d80e5/go.mod h1:LVehoXe41cL5SCVQilsV7Gg6BNG+Js6P9PhSbYTIUkQ= -golang.org/x/term v0.45.0/go.mod h1:9aqxs0blBcrm/n0L9QW0aRVD+ktan8ssZromtqJC43w= golang.org/x/term v0.46.0/go.mod h1:+K02xbkittuwc0Am4abfA3Fc+XRGXkvBXNO88NCXPoc= golang.org/x/text v0.40.0/go.mod h1:hpnzDAfGV753zIKo+wk3u1bVKCGPbrnF7+7LBF/UHVY= -golang.org/x/tools v0.48.0/go.mod h1:08xX0orndb/F7jJxGDicx061tyd5pcMto75YMAXr6lk= golang.org/x/tools v0.49.0/go.mod h1:SJNXV9DBKT0UbdttsQjbfJlAE/q+y36++zo3uL3N0Oo= -golang.org/x/tools/go/expect v0.1.1-deprecated/go.mod h1:eihoPOH+FgIqa3FpoTwguz/bVUSGBlGQU67vpBeOrBY= -golang.org/x/tools/go/packages/packagestest v0.1.1-deprecated/go.mod h1:RVAQXBGNv1ib0J382/DPCRS/BPnsGebyM1Gj5VSDpG8= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/genproto v0.0.0-20260128011058-8636f8732409 h1:VQZ/yAbAtjkHgH80teYd2em3xtIkkHd7ZhqfH2N9CsM= google.golang.org/genproto/googleapis/api v0.0.0-20260526163538-3dc84a4a5aaa/go.mod h1:q4lMZS6kskjT5HvCPrnnypcDPVJqT/f4nfxmkE7gryY= diff --git a/proto/kit/sandbox/v1/sandbox.proto b/proto/kit/sandbox/v1/sandbox.proto index b84d6e74..ef84a2fc 100644 --- a/proto/kit/sandbox/v1/sandbox.proto +++ b/proto/kit/sandbox/v1/sandbox.proto @@ -496,6 +496,71 @@ message DeleteOptions { message ExitResult { optional int32 exit_code = 1; } + +// FileType classifies one filesystem entry. Preserve the numeric values. +enum FileType { + FILE_TYPE_UNSPECIFIED = 0; + FILE_TYPE_FILE = 1; + FILE_TYPE_DIRECTORY = 2; + FILE_TYPE_SYMLINK = 3; +} + +// FileInfo is metadata for one file, directory, or symlink. +// Optional fields stay absent when the provider did not report them. +message FileInfo { + string name = 1; + string path = 2; + FileType type = 3 [(buf.validate.field).enum.defined_only = true]; + int64 size = 4; + // Unix mode as reported by the provider, such as "0644". + optional string mode = 5; + // Symbolic permissions when the provider reports them, such as "rw-r--r--". + optional string permissions = 6; + optional string owner = 7; + optional string group = 8; + google.protobuf.Timestamp modified_at = 9; + optional string symlink_target = 10; +} + +// FileReadOptions configures reading one file. Nil timeout inherits Config.Timeout. +message FileReadOptions { + google.protobuf.Duration timeout = 1; +} + +// FileWriteOptions configures writing one file. Nil timeout inherits Config.Timeout. +message FileWriteOptions { + google.protobuf.Duration timeout = 1; +} + +// FileCopyOptions configures a copy between the caller and the sandbox. +// Nil timeout inherits Config.Timeout. +message FileCopyOptions { + google.protobuf.Duration timeout = 1; +} + +// MakeDirectoryOptions configures creating one directory. Nil timeout inherits Config.Timeout. +// An omitted parents flag is true: missing parents are created. Daytona rejects false. +message MakeDirectoryOptions { + google.protobuf.Duration timeout = 1; + optional bool parents = 2; +} + +// ListDirectoryOptions configures listing one directory. Nil timeout inherits Config.Timeout. +message ListDirectoryOptions { + google.protobuf.Duration timeout = 1; +} + +// StatOptions configures reading metadata for one path. Nil timeout inherits Config.Timeout. +message StatOptions { + google.protobuf.Duration timeout = 1; +} + +// RemoveOptions configures removing one path. Recursive removes a directory and its contents. +// Nil timeout inherits Config.Timeout. An omitted recursive flag removes a file or an empty directory. +message RemoveOptions { + google.protobuf.Duration timeout = 1; + optional bool recursive = 2; +} // SandboxState is a portable lifecycle state. ProviderState retains the native value. enum SandboxState { SANDBOX_STATE_UNKNOWN = 0; diff --git a/sdks/go/internal/contracts/README.md b/sdks/go/internal/contracts/README.md index 8c461130..1b6ca420 100644 --- a/sdks/go/internal/contracts/README.md +++ b/sdks/go/internal/contracts/README.md @@ -1,8 +1,9 @@ # Sandbox Kit wire messages -This module is installed automatically with the sandbox client. The client -re-exports the messages a program constructs, including Config, CreateOptions, -and ErrorInfo. +Generated protobuf messages for modules under `sdks/go`. Only packages inside +`sdks/go` can import this module. Applications use the aliases on +[the sandbox client](https://pkg.go.dev/github.com/sandbox-kit/kit/sdks/go/sandbox) +(`Config`, `CreateOptions`, `ErrorInfo`, and related types). Install the public client and one provider: @@ -13,8 +14,6 @@ go get github.com/sandbox-kit/kit/sdks/go/providers/daytona@latest go get github.com/sandbox-kit/kit/sdks/go/providers/modal@latest ``` -Start with [the sandbox client](https://pkg.go.dev/github.com/sandbox-kit/kit/sdks/go/sandbox). - ## License MIT diff --git a/sdks/go/internal/contracts/kit/sandbox/v1/sandbox.pb.go b/sdks/go/internal/contracts/kit/sandbox/v1/sandbox.pb.go index 0bd47106..0aced011 100644 --- a/sdks/go/internal/contracts/kit/sandbox/v1/sandbox.pb.go +++ b/sdks/go/internal/contracts/kit/sandbox/v1/sandbox.pb.go @@ -408,6 +408,59 @@ func (WaitCondition) EnumDescriptor() ([]byte, []int) { return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{6} } +// FileType classifies one filesystem entry. Preserve the numeric values. +type FileType int32 + +const ( + FileType_FILE_TYPE_UNSPECIFIED FileType = 0 + FileType_FILE_TYPE_FILE FileType = 1 + FileType_FILE_TYPE_DIRECTORY FileType = 2 + FileType_FILE_TYPE_SYMLINK FileType = 3 +) + +// Enum value maps for FileType. +var ( + FileType_name = map[int32]string{ + 0: "FILE_TYPE_UNSPECIFIED", + 1: "FILE_TYPE_FILE", + 2: "FILE_TYPE_DIRECTORY", + 3: "FILE_TYPE_SYMLINK", + } + FileType_value = map[string]int32{ + "FILE_TYPE_UNSPECIFIED": 0, + "FILE_TYPE_FILE": 1, + "FILE_TYPE_DIRECTORY": 2, + "FILE_TYPE_SYMLINK": 3, + } +) + +func (x FileType) Enum() *FileType { + p := new(FileType) + *p = x + return p +} + +func (x FileType) String() string { + return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x)) +} + +func (FileType) Descriptor() protoreflect.EnumDescriptor { + return file_kit_sandbox_v1_sandbox_proto_enumTypes[7].Descriptor() +} + +func (FileType) Type() protoreflect.EnumType { + return &file_kit_sandbox_v1_sandbox_proto_enumTypes[7] +} + +func (x FileType) Number() protoreflect.EnumNumber { + return protoreflect.EnumNumber(x) +} + +// Deprecated: Use FileType.Descriptor instead. +func (FileType) EnumDescriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{7} +} + // SandboxState is a portable lifecycle state. ProviderState retains the native value. type SandboxState int32 @@ -478,11 +531,11 @@ func (x SandboxState) String() string { } func (SandboxState) Descriptor() protoreflect.EnumDescriptor { - return file_kit_sandbox_v1_sandbox_proto_enumTypes[7].Descriptor() + return file_kit_sandbox_v1_sandbox_proto_enumTypes[8].Descriptor() } func (SandboxState) Type() protoreflect.EnumType { - return &file_kit_sandbox_v1_sandbox_proto_enumTypes[7] + return &file_kit_sandbox_v1_sandbox_proto_enumTypes[8] } func (x SandboxState) Number() protoreflect.EnumNumber { @@ -491,7 +544,7 @@ func (x SandboxState) Number() protoreflect.EnumNumber { // Deprecated: Use SandboxState.Descriptor instead. func (SandboxState) EnumDescriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{7} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{8} } // LifecycleCapability identifies a lifecycle operation a provider implements. @@ -543,11 +596,11 @@ func (x LifecycleCapability) String() string { } func (LifecycleCapability) Descriptor() protoreflect.EnumDescriptor { - return file_kit_sandbox_v1_sandbox_proto_enumTypes[8].Descriptor() + return file_kit_sandbox_v1_sandbox_proto_enumTypes[9].Descriptor() } func (LifecycleCapability) Type() protoreflect.EnumType { - return &file_kit_sandbox_v1_sandbox_proto_enumTypes[8] + return &file_kit_sandbox_v1_sandbox_proto_enumTypes[9] } func (x LifecycleCapability) Number() protoreflect.EnumNumber { @@ -556,7 +609,7 @@ func (x LifecycleCapability) Number() protoreflect.EnumNumber { // Deprecated: Use LifecycleCapability.Descriptor instead. func (LifecycleCapability) EnumDescriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{8} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{9} } // ErrorKind is the shared error category. It does not imply that a retry is safe. @@ -632,11 +685,11 @@ func (x ErrorKind) String() string { } func (ErrorKind) Descriptor() protoreflect.EnumDescriptor { - return file_kit_sandbox_v1_sandbox_proto_enumTypes[9].Descriptor() + return file_kit_sandbox_v1_sandbox_proto_enumTypes[10].Descriptor() } func (ErrorKind) Type() protoreflect.EnumType { - return &file_kit_sandbox_v1_sandbox_proto_enumTypes[9] + return &file_kit_sandbox_v1_sandbox_proto_enumTypes[10] } func (x ErrorKind) Number() protoreflect.EnumNumber { @@ -645,7 +698,7 @@ func (x ErrorKind) Number() protoreflect.EnumNumber { // Deprecated: Use ErrorKind.Descriptor instead. func (ErrorKind) EnumDescriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{9} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{10} } // CreateOptions is the creation request. It does not include lifecycle operations or credentials. @@ -2564,6 +2617,460 @@ func (x *ExitResult) GetExitCode() int32 { return 0 } +// FileInfo is metadata for one file, directory, or symlink. +// Optional fields stay absent when the provider did not report them. +type FileInfo struct { + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Path string `protobuf:"bytes,2,opt,name=path,proto3" json:"path,omitempty"` + Type FileType `protobuf:"varint,3,opt,name=type,proto3,enum=kit.sandbox.v1.FileType" json:"type,omitempty"` + Size int64 `protobuf:"varint,4,opt,name=size,proto3" json:"size,omitempty"` + // Unix mode as reported by the provider, such as "0644". + Mode *string `protobuf:"bytes,5,opt,name=mode,proto3,oneof" json:"mode,omitempty"` + // Symbolic permissions when the provider reports them, such as "rw-r--r--". + Permissions *string `protobuf:"bytes,6,opt,name=permissions,proto3,oneof" json:"permissions,omitempty"` + Owner *string `protobuf:"bytes,7,opt,name=owner,proto3,oneof" json:"owner,omitempty"` + Group *string `protobuf:"bytes,8,opt,name=group,proto3,oneof" json:"group,omitempty"` + ModifiedAt *timestamppb.Timestamp `protobuf:"bytes,9,opt,name=modified_at,json=modifiedAt,proto3" json:"modified_at,omitempty"` + SymlinkTarget *string `protobuf:"bytes,10,opt,name=symlink_target,json=symlinkTarget,proto3,oneof" json:"symlink_target,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FileInfo) Reset() { + *x = FileInfo{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[29] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FileInfo) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FileInfo) ProtoMessage() {} + +func (x *FileInfo) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[29] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FileInfo.ProtoReflect.Descriptor instead. +func (*FileInfo) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{29} +} + +func (x *FileInfo) GetName() string { + if x != nil { + return x.Name + } + return "" +} + +func (x *FileInfo) GetPath() string { + if x != nil { + return x.Path + } + return "" +} + +func (x *FileInfo) GetType() FileType { + if x != nil { + return x.Type + } + return FileType_FILE_TYPE_UNSPECIFIED +} + +func (x *FileInfo) GetSize() int64 { + if x != nil { + return x.Size + } + return 0 +} + +func (x *FileInfo) GetMode() string { + if x != nil && x.Mode != nil { + return *x.Mode + } + return "" +} + +func (x *FileInfo) GetPermissions() string { + if x != nil && x.Permissions != nil { + return *x.Permissions + } + return "" +} + +func (x *FileInfo) GetOwner() string { + if x != nil && x.Owner != nil { + return *x.Owner + } + return "" +} + +func (x *FileInfo) GetGroup() string { + if x != nil && x.Group != nil { + return *x.Group + } + return "" +} + +func (x *FileInfo) GetModifiedAt() *timestamppb.Timestamp { + if x != nil { + return x.ModifiedAt + } + return nil +} + +func (x *FileInfo) GetSymlinkTarget() string { + if x != nil && x.SymlinkTarget != nil { + return *x.SymlinkTarget + } + return "" +} + +// FileReadOptions configures reading one file. Nil timeout inherits Config.Timeout. +type FileReadOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FileReadOptions) Reset() { + *x = FileReadOptions{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[30] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FileReadOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FileReadOptions) ProtoMessage() {} + +func (x *FileReadOptions) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[30] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FileReadOptions.ProtoReflect.Descriptor instead. +func (*FileReadOptions) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{30} +} + +func (x *FileReadOptions) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// FileWriteOptions configures writing one file. Nil timeout inherits Config.Timeout. +type FileWriteOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FileWriteOptions) Reset() { + *x = FileWriteOptions{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[31] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FileWriteOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FileWriteOptions) ProtoMessage() {} + +func (x *FileWriteOptions) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[31] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FileWriteOptions.ProtoReflect.Descriptor instead. +func (*FileWriteOptions) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{31} +} + +func (x *FileWriteOptions) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// FileCopyOptions configures a copy between the caller and the sandbox. +// Nil timeout inherits Config.Timeout. +type FileCopyOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *FileCopyOptions) Reset() { + *x = FileCopyOptions{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[32] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *FileCopyOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*FileCopyOptions) ProtoMessage() {} + +func (x *FileCopyOptions) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[32] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use FileCopyOptions.ProtoReflect.Descriptor instead. +func (*FileCopyOptions) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{32} +} + +func (x *FileCopyOptions) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// MakeDirectoryOptions configures creating one directory. Nil timeout inherits Config.Timeout. +// An omitted parents flag is true: missing parents are created. Daytona rejects false. +type MakeDirectoryOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + Parents *bool `protobuf:"varint,2,opt,name=parents,proto3,oneof" json:"parents,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *MakeDirectoryOptions) Reset() { + *x = MakeDirectoryOptions{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[33] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *MakeDirectoryOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*MakeDirectoryOptions) ProtoMessage() {} + +func (x *MakeDirectoryOptions) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[33] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use MakeDirectoryOptions.ProtoReflect.Descriptor instead. +func (*MakeDirectoryOptions) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{33} +} + +func (x *MakeDirectoryOptions) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *MakeDirectoryOptions) GetParents() bool { + if x != nil && x.Parents != nil { + return *x.Parents + } + return false +} + +// ListDirectoryOptions configures listing one directory. Nil timeout inherits Config.Timeout. +type ListDirectoryOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *ListDirectoryOptions) Reset() { + *x = ListDirectoryOptions{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[34] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *ListDirectoryOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*ListDirectoryOptions) ProtoMessage() {} + +func (x *ListDirectoryOptions) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[34] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use ListDirectoryOptions.ProtoReflect.Descriptor instead. +func (*ListDirectoryOptions) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{34} +} + +func (x *ListDirectoryOptions) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// StatOptions configures reading metadata for one path. Nil timeout inherits Config.Timeout. +type StatOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *StatOptions) Reset() { + *x = StatOptions{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[35] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *StatOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*StatOptions) ProtoMessage() {} + +func (x *StatOptions) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[35] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use StatOptions.ProtoReflect.Descriptor instead. +func (*StatOptions) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{35} +} + +func (x *StatOptions) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +// RemoveOptions configures removing one path. Recursive removes a directory and its contents. +// Nil timeout inherits Config.Timeout. An omitted recursive flag removes a file or an empty directory. +type RemoveOptions struct { + state protoimpl.MessageState `protogen:"open.v1"` + Timeout *durationpb.Duration `protobuf:"bytes,1,opt,name=timeout,proto3" json:"timeout,omitempty"` + Recursive *bool `protobuf:"varint,2,opt,name=recursive,proto3,oneof" json:"recursive,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache +} + +func (x *RemoveOptions) Reset() { + *x = RemoveOptions{} + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[36] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) +} + +func (x *RemoveOptions) String() string { + return protoimpl.X.MessageStringOf(x) +} + +func (*RemoveOptions) ProtoMessage() {} + +func (x *RemoveOptions) ProtoReflect() protoreflect.Message { + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[36] + if x != nil { + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + if ms.LoadMessageInfo() == nil { + ms.StoreMessageInfo(mi) + } + return ms + } + return mi.MessageOf(x) +} + +// Deprecated: Use RemoveOptions.ProtoReflect.Descriptor instead. +func (*RemoveOptions) Descriptor() ([]byte, []int) { + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{36} +} + +func (x *RemoveOptions) GetTimeout() *durationpb.Duration { + if x != nil { + return x.Timeout + } + return nil +} + +func (x *RemoveOptions) GetRecursive() bool { + if x != nil && x.Recursive != nil { + return *x.Recursive + } + return false +} + // SandboxInfo is shared metadata. Optional fields stay absent when the provider did not report them. // // Example: @@ -2596,7 +3103,7 @@ type SandboxInfo struct { func (x *SandboxInfo) Reset() { *x = SandboxInfo{} - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[29] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[37] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2608,7 +3115,7 @@ func (x *SandboxInfo) String() string { func (*SandboxInfo) ProtoMessage() {} func (x *SandboxInfo) ProtoReflect() protoreflect.Message { - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[29] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[37] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2621,7 +3128,7 @@ func (x *SandboxInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use SandboxInfo.ProtoReflect.Descriptor instead. func (*SandboxInfo) Descriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{29} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{37} } func (x *SandboxInfo) GetId() string { @@ -2744,7 +3251,7 @@ type ErrorInfo struct { func (x *ErrorInfo) Reset() { *x = ErrorInfo{} - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[30] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[38] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2756,7 +3263,7 @@ func (x *ErrorInfo) String() string { func (*ErrorInfo) ProtoMessage() {} func (x *ErrorInfo) ProtoReflect() protoreflect.Message { - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[30] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[38] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2769,7 +3276,7 @@ func (x *ErrorInfo) ProtoReflect() protoreflect.Message { // Deprecated: Use ErrorInfo.ProtoReflect.Descriptor instead. func (*ErrorInfo) Descriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{30} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{38} } func (x *ErrorInfo) GetKind() ErrorKind { @@ -2856,7 +3363,7 @@ type MetadataValue struct { func (x *MetadataValue) Reset() { *x = MetadataValue{} - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[31] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[39] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -2868,7 +3375,7 @@ func (x *MetadataValue) String() string { func (*MetadataValue) ProtoMessage() {} func (x *MetadataValue) ProtoReflect() protoreflect.Message { - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[31] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[39] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -2881,7 +3388,7 @@ func (x *MetadataValue) ProtoReflect() protoreflect.Message { // Deprecated: Use MetadataValue.ProtoReflect.Descriptor instead. func (*MetadataValue) Descriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{31} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{39} } func (x *MetadataValue) GetValue() isMetadataValue_Value { @@ -3026,7 +3533,7 @@ type MetadataList struct { func (x *MetadataList) Reset() { *x = MetadataList{} - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[32] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[40] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3038,7 +3545,7 @@ func (x *MetadataList) String() string { func (*MetadataList) ProtoMessage() {} func (x *MetadataList) ProtoReflect() protoreflect.Message { - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[32] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[40] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3051,7 +3558,7 @@ func (x *MetadataList) ProtoReflect() protoreflect.Message { // Deprecated: Use MetadataList.ProtoReflect.Descriptor instead. func (*MetadataList) Descriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{32} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{40} } func (x *MetadataList) GetValues() []*MetadataValue { @@ -3072,7 +3579,7 @@ type MetadataObject struct { func (x *MetadataObject) Reset() { *x = MetadataObject{} - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[33] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[41] ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms.StoreMessageInfo(mi) } @@ -3084,7 +3591,7 @@ func (x *MetadataObject) String() string { func (*MetadataObject) ProtoMessage() {} func (x *MetadataObject) ProtoReflect() protoreflect.Message { - mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[33] + mi := &file_kit_sandbox_v1_sandbox_proto_msgTypes[41] if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { @@ -3097,7 +3604,7 @@ func (x *MetadataObject) ProtoReflect() protoreflect.Message { // Deprecated: Use MetadataObject.ProtoReflect.Descriptor instead. func (*MetadataObject) Descriptor() ([]byte, []int) { - return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{33} + return file_kit_sandbox_v1_sandbox_proto_rawDescGZIP(), []int{41} } func (x *MetadataObject) GetValues() map[string]*MetadataValue { @@ -3314,7 +3821,45 @@ const file_kit_sandbox_v1_sandbox_proto_rawDesc = "" + "ExitResult\x12 \n" + "\texit_code\x18\x01 \x01(\x05H\x00R\bexitCode\x88\x01\x01B\f\n" + "\n" + - "_exit_code\"\xaf\x05\n" + + "_exit_code\"\x9d\x03\n" + + "\bFileInfo\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12\x12\n" + + "\x04path\x18\x02 \x01(\tR\x04path\x126\n" + + "\x04type\x18\x03 \x01(\x0e2\x18.kit.sandbox.v1.FileTypeB\b\xbaH\x05\x82\x01\x02\x10\x01R\x04type\x12\x12\n" + + "\x04size\x18\x04 \x01(\x03R\x04size\x12\x17\n" + + "\x04mode\x18\x05 \x01(\tH\x00R\x04mode\x88\x01\x01\x12%\n" + + "\vpermissions\x18\x06 \x01(\tH\x01R\vpermissions\x88\x01\x01\x12\x19\n" + + "\x05owner\x18\a \x01(\tH\x02R\x05owner\x88\x01\x01\x12\x19\n" + + "\x05group\x18\b \x01(\tH\x03R\x05group\x88\x01\x01\x12;\n" + + "\vmodified_at\x18\t \x01(\v2\x1a.google.protobuf.TimestampR\n" + + "modifiedAt\x12*\n" + + "\x0esymlink_target\x18\n" + + " \x01(\tH\x04R\rsymlinkTarget\x88\x01\x01B\a\n" + + "\x05_modeB\x0e\n" + + "\f_permissionsB\b\n" + + "\x06_ownerB\b\n" + + "\x06_groupB\x11\n" + + "\x0f_symlink_target\"F\n" + + "\x0fFileReadOptions\x123\n" + + "\atimeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"G\n" + + "\x10FileWriteOptions\x123\n" + + "\atimeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"F\n" + + "\x0fFileCopyOptions\x123\n" + + "\atimeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"v\n" + + "\x14MakeDirectoryOptions\x123\n" + + "\atimeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\atimeout\x12\x1d\n" + + "\aparents\x18\x02 \x01(\bH\x00R\aparents\x88\x01\x01B\n" + + "\n" + + "\b_parents\"K\n" + + "\x14ListDirectoryOptions\x123\n" + + "\atimeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"B\n" + + "\vStatOptions\x123\n" + + "\atimeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\atimeout\"u\n" + + "\rRemoveOptions\x123\n" + + "\atimeout\x18\x01 \x01(\v2\x19.google.protobuf.DurationR\atimeout\x12!\n" + + "\trecursive\x18\x02 \x01(\bH\x00R\trecursive\x88\x01\x01B\f\n" + + "\n" + + "_recursive\"\xaf\x05\n" + "\vSandboxInfo\x12\x0e\n" + "\x02id\x18\x01 \x01(\tR\x02id\x12\x1a\n" + "\bprovider\x18\x02 \x01(\tR\bprovider\x12\x17\n" + @@ -3409,7 +3954,12 @@ const file_kit_sandbox_v1_sandbox_proto_rawDesc = "" + "\x18WAIT_CONDITION_SUBMITTED\x10\x01\x12\x1c\n" + "\x18WAIT_CONDITION_SCHEDULED\x10\x02\x12\x1a\n" + "\x16WAIT_CONDITION_STARTED\x10\x03\x12\x18\n" + - "\x14WAIT_CONDITION_READY\x10\x04*\xac\x03\n" + + "\x14WAIT_CONDITION_READY\x10\x04*i\n" + + "\bFileType\x12\x19\n" + + "\x15FILE_TYPE_UNSPECIFIED\x10\x00\x12\x12\n" + + "\x0eFILE_TYPE_FILE\x10\x01\x12\x17\n" + + "\x13FILE_TYPE_DIRECTORY\x10\x02\x12\x15\n" + + "\x11FILE_TYPE_SYMLINK\x10\x03*\xac\x03\n" + "\fSandboxState\x12\x19\n" + "\x15SANDBOX_STATE_UNKNOWN\x10\x00\x12\x18\n" + "\x14SANDBOX_STATE_QUEUED\x10\x01\x12\x1a\n" + @@ -3467,8 +4017,8 @@ func file_kit_sandbox_v1_sandbox_proto_rawDescGZIP() []byte { return file_kit_sandbox_v1_sandbox_proto_rawDescData } -var file_kit_sandbox_v1_sandbox_proto_enumTypes = make([]protoimpl.EnumInfo, 10) -var file_kit_sandbox_v1_sandbox_proto_msgTypes = make([]protoimpl.MessageInfo, 38) +var file_kit_sandbox_v1_sandbox_proto_enumTypes = make([]protoimpl.EnumInfo, 11) +var file_kit_sandbox_v1_sandbox_proto_msgTypes = make([]protoimpl.MessageInfo, 46) var file_kit_sandbox_v1_sandbox_proto_goTypes = []any{ (SnapshotKind)(0), // 0: kit.sandbox.v1.SnapshotKind (IsolationKind)(0), // 1: kit.sandbox.v1.IsolationKind @@ -3477,114 +4027,132 @@ var file_kit_sandbox_v1_sandbox_proto_goTypes = []any{ (SecretInjection)(0), // 4: kit.sandbox.v1.SecretInjection (PolicyMode)(0), // 5: kit.sandbox.v1.PolicyMode (WaitCondition)(0), // 6: kit.sandbox.v1.WaitCondition - (SandboxState)(0), // 7: kit.sandbox.v1.SandboxState - (LifecycleCapability)(0), // 8: kit.sandbox.v1.LifecycleCapability - (ErrorKind)(0), // 9: kit.sandbox.v1.ErrorKind - (*CreateOptions)(nil), // 10: kit.sandbox.v1.CreateOptions - (*SandboxSource)(nil), // 11: kit.sandbox.v1.SandboxSource - (*ProviderDefaultSource)(nil), // 12: kit.sandbox.v1.ProviderDefaultSource - (*ImageSource)(nil), // 13: kit.sandbox.v1.ImageSource - (*SnapshotSource)(nil), // 14: kit.sandbox.v1.SnapshotSource - (*WarmPoolSource)(nil), // 15: kit.sandbox.v1.WarmPoolSource - (*RuntimeConfig)(nil), // 16: kit.sandbox.v1.RuntimeConfig - (*IsolationConfig)(nil), // 17: kit.sandbox.v1.IsolationConfig - (*Resources)(nil), // 18: kit.sandbox.v1.Resources - (*Placement)(nil), // 19: kit.sandbox.v1.Placement - (*StringAllowlist)(nil), // 20: kit.sandbox.v1.StringAllowlist - (*NetworkConfig)(nil), // 21: kit.sandbox.v1.NetworkConfig - (*PortBinding)(nil), // 22: kit.sandbox.v1.PortBinding - (*SecurityConfig)(nil), // 23: kit.sandbox.v1.SecurityConfig - (*SecretReference)(nil), // 24: kit.sandbox.v1.SecretReference - (*LifetimePolicy)(nil), // 25: kit.sandbox.v1.LifetimePolicy - (*AutomaticAction)(nil), // 26: kit.sandbox.v1.AutomaticAction - (*ProvisioningOptions)(nil), // 27: kit.sandbox.v1.ProvisioningOptions - (*ReadinessProbe)(nil), // 28: kit.sandbox.v1.ReadinessProbe - (*CommandProbe)(nil), // 29: kit.sandbox.v1.CommandProbe - (*ObservabilityConfig)(nil), // 30: kit.sandbox.v1.ObservabilityConfig - (*CreateResult)(nil), // 31: kit.sandbox.v1.CreateResult - (*StartOptions)(nil), // 32: kit.sandbox.v1.StartOptions - (*StopOptions)(nil), // 33: kit.sandbox.v1.StopOptions - (*PauseOptions)(nil), // 34: kit.sandbox.v1.PauseOptions - (*TerminateOptions)(nil), // 35: kit.sandbox.v1.TerminateOptions - (*ArchiveOptions)(nil), // 36: kit.sandbox.v1.ArchiveOptions - (*DeleteOptions)(nil), // 37: kit.sandbox.v1.DeleteOptions - (*ExitResult)(nil), // 38: kit.sandbox.v1.ExitResult - (*SandboxInfo)(nil), // 39: kit.sandbox.v1.SandboxInfo - (*ErrorInfo)(nil), // 40: kit.sandbox.v1.ErrorInfo - (*MetadataValue)(nil), // 41: kit.sandbox.v1.MetadataValue - (*MetadataList)(nil), // 42: kit.sandbox.v1.MetadataList - (*MetadataObject)(nil), // 43: kit.sandbox.v1.MetadataObject - nil, // 44: kit.sandbox.v1.CreateOptions.EnvironmentEntry - nil, // 45: kit.sandbox.v1.CreateOptions.LabelsEntry - nil, // 46: kit.sandbox.v1.SandboxInfo.LabelsEntry - nil, // 47: kit.sandbox.v1.MetadataObject.ValuesEntry - (*durationpb.Duration)(nil), // 48: google.protobuf.Duration - (*timestamppb.Timestamp)(nil), // 49: google.protobuf.Timestamp + (FileType)(0), // 7: kit.sandbox.v1.FileType + (SandboxState)(0), // 8: kit.sandbox.v1.SandboxState + (LifecycleCapability)(0), // 9: kit.sandbox.v1.LifecycleCapability + (ErrorKind)(0), // 10: kit.sandbox.v1.ErrorKind + (*CreateOptions)(nil), // 11: kit.sandbox.v1.CreateOptions + (*SandboxSource)(nil), // 12: kit.sandbox.v1.SandboxSource + (*ProviderDefaultSource)(nil), // 13: kit.sandbox.v1.ProviderDefaultSource + (*ImageSource)(nil), // 14: kit.sandbox.v1.ImageSource + (*SnapshotSource)(nil), // 15: kit.sandbox.v1.SnapshotSource + (*WarmPoolSource)(nil), // 16: kit.sandbox.v1.WarmPoolSource + (*RuntimeConfig)(nil), // 17: kit.sandbox.v1.RuntimeConfig + (*IsolationConfig)(nil), // 18: kit.sandbox.v1.IsolationConfig + (*Resources)(nil), // 19: kit.sandbox.v1.Resources + (*Placement)(nil), // 20: kit.sandbox.v1.Placement + (*StringAllowlist)(nil), // 21: kit.sandbox.v1.StringAllowlist + (*NetworkConfig)(nil), // 22: kit.sandbox.v1.NetworkConfig + (*PortBinding)(nil), // 23: kit.sandbox.v1.PortBinding + (*SecurityConfig)(nil), // 24: kit.sandbox.v1.SecurityConfig + (*SecretReference)(nil), // 25: kit.sandbox.v1.SecretReference + (*LifetimePolicy)(nil), // 26: kit.sandbox.v1.LifetimePolicy + (*AutomaticAction)(nil), // 27: kit.sandbox.v1.AutomaticAction + (*ProvisioningOptions)(nil), // 28: kit.sandbox.v1.ProvisioningOptions + (*ReadinessProbe)(nil), // 29: kit.sandbox.v1.ReadinessProbe + (*CommandProbe)(nil), // 30: kit.sandbox.v1.CommandProbe + (*ObservabilityConfig)(nil), // 31: kit.sandbox.v1.ObservabilityConfig + (*CreateResult)(nil), // 32: kit.sandbox.v1.CreateResult + (*StartOptions)(nil), // 33: kit.sandbox.v1.StartOptions + (*StopOptions)(nil), // 34: kit.sandbox.v1.StopOptions + (*PauseOptions)(nil), // 35: kit.sandbox.v1.PauseOptions + (*TerminateOptions)(nil), // 36: kit.sandbox.v1.TerminateOptions + (*ArchiveOptions)(nil), // 37: kit.sandbox.v1.ArchiveOptions + (*DeleteOptions)(nil), // 38: kit.sandbox.v1.DeleteOptions + (*ExitResult)(nil), // 39: kit.sandbox.v1.ExitResult + (*FileInfo)(nil), // 40: kit.sandbox.v1.FileInfo + (*FileReadOptions)(nil), // 41: kit.sandbox.v1.FileReadOptions + (*FileWriteOptions)(nil), // 42: kit.sandbox.v1.FileWriteOptions + (*FileCopyOptions)(nil), // 43: kit.sandbox.v1.FileCopyOptions + (*MakeDirectoryOptions)(nil), // 44: kit.sandbox.v1.MakeDirectoryOptions + (*ListDirectoryOptions)(nil), // 45: kit.sandbox.v1.ListDirectoryOptions + (*StatOptions)(nil), // 46: kit.sandbox.v1.StatOptions + (*RemoveOptions)(nil), // 47: kit.sandbox.v1.RemoveOptions + (*SandboxInfo)(nil), // 48: kit.sandbox.v1.SandboxInfo + (*ErrorInfo)(nil), // 49: kit.sandbox.v1.ErrorInfo + (*MetadataValue)(nil), // 50: kit.sandbox.v1.MetadataValue + (*MetadataList)(nil), // 51: kit.sandbox.v1.MetadataList + (*MetadataObject)(nil), // 52: kit.sandbox.v1.MetadataObject + nil, // 53: kit.sandbox.v1.CreateOptions.EnvironmentEntry + nil, // 54: kit.sandbox.v1.CreateOptions.LabelsEntry + nil, // 55: kit.sandbox.v1.SandboxInfo.LabelsEntry + nil, // 56: kit.sandbox.v1.MetadataObject.ValuesEntry + (*durationpb.Duration)(nil), // 57: google.protobuf.Duration + (*timestamppb.Timestamp)(nil), // 58: google.protobuf.Timestamp } var file_kit_sandbox_v1_sandbox_proto_depIdxs = []int32{ - 11, // 0: kit.sandbox.v1.CreateOptions.source:type_name -> kit.sandbox.v1.SandboxSource - 16, // 1: kit.sandbox.v1.CreateOptions.runtime:type_name -> kit.sandbox.v1.RuntimeConfig - 17, // 2: kit.sandbox.v1.CreateOptions.isolation:type_name -> kit.sandbox.v1.IsolationConfig - 18, // 3: kit.sandbox.v1.CreateOptions.resources:type_name -> kit.sandbox.v1.Resources - 19, // 4: kit.sandbox.v1.CreateOptions.placement:type_name -> kit.sandbox.v1.Placement - 44, // 5: kit.sandbox.v1.CreateOptions.environment:type_name -> kit.sandbox.v1.CreateOptions.EnvironmentEntry - 45, // 6: kit.sandbox.v1.CreateOptions.labels:type_name -> kit.sandbox.v1.CreateOptions.LabelsEntry - 21, // 7: kit.sandbox.v1.CreateOptions.network:type_name -> kit.sandbox.v1.NetworkConfig - 23, // 8: kit.sandbox.v1.CreateOptions.security:type_name -> kit.sandbox.v1.SecurityConfig - 25, // 9: kit.sandbox.v1.CreateOptions.lifetime:type_name -> kit.sandbox.v1.LifetimePolicy - 27, // 10: kit.sandbox.v1.CreateOptions.provisioning:type_name -> kit.sandbox.v1.ProvisioningOptions - 28, // 11: kit.sandbox.v1.CreateOptions.readiness:type_name -> kit.sandbox.v1.ReadinessProbe - 30, // 12: kit.sandbox.v1.CreateOptions.observability:type_name -> kit.sandbox.v1.ObservabilityConfig - 12, // 13: kit.sandbox.v1.SandboxSource.provider_default:type_name -> kit.sandbox.v1.ProviderDefaultSource - 13, // 14: kit.sandbox.v1.SandboxSource.image:type_name -> kit.sandbox.v1.ImageSource - 14, // 15: kit.sandbox.v1.SandboxSource.snapshot:type_name -> kit.sandbox.v1.SnapshotSource - 15, // 16: kit.sandbox.v1.SandboxSource.warm_pool:type_name -> kit.sandbox.v1.WarmPoolSource + 12, // 0: kit.sandbox.v1.CreateOptions.source:type_name -> kit.sandbox.v1.SandboxSource + 17, // 1: kit.sandbox.v1.CreateOptions.runtime:type_name -> kit.sandbox.v1.RuntimeConfig + 18, // 2: kit.sandbox.v1.CreateOptions.isolation:type_name -> kit.sandbox.v1.IsolationConfig + 19, // 3: kit.sandbox.v1.CreateOptions.resources:type_name -> kit.sandbox.v1.Resources + 20, // 4: kit.sandbox.v1.CreateOptions.placement:type_name -> kit.sandbox.v1.Placement + 53, // 5: kit.sandbox.v1.CreateOptions.environment:type_name -> kit.sandbox.v1.CreateOptions.EnvironmentEntry + 54, // 6: kit.sandbox.v1.CreateOptions.labels:type_name -> kit.sandbox.v1.CreateOptions.LabelsEntry + 22, // 7: kit.sandbox.v1.CreateOptions.network:type_name -> kit.sandbox.v1.NetworkConfig + 24, // 8: kit.sandbox.v1.CreateOptions.security:type_name -> kit.sandbox.v1.SecurityConfig + 26, // 9: kit.sandbox.v1.CreateOptions.lifetime:type_name -> kit.sandbox.v1.LifetimePolicy + 28, // 10: kit.sandbox.v1.CreateOptions.provisioning:type_name -> kit.sandbox.v1.ProvisioningOptions + 29, // 11: kit.sandbox.v1.CreateOptions.readiness:type_name -> kit.sandbox.v1.ReadinessProbe + 31, // 12: kit.sandbox.v1.CreateOptions.observability:type_name -> kit.sandbox.v1.ObservabilityConfig + 13, // 13: kit.sandbox.v1.SandboxSource.provider_default:type_name -> kit.sandbox.v1.ProviderDefaultSource + 14, // 14: kit.sandbox.v1.SandboxSource.image:type_name -> kit.sandbox.v1.ImageSource + 15, // 15: kit.sandbox.v1.SandboxSource.snapshot:type_name -> kit.sandbox.v1.SnapshotSource + 16, // 16: kit.sandbox.v1.SandboxSource.warm_pool:type_name -> kit.sandbox.v1.WarmPoolSource 0, // 17: kit.sandbox.v1.SnapshotSource.kind:type_name -> kit.sandbox.v1.SnapshotKind 1, // 18: kit.sandbox.v1.IsolationConfig.kind:type_name -> kit.sandbox.v1.IsolationKind 2, // 19: kit.sandbox.v1.NetworkConfig.egress:type_name -> kit.sandbox.v1.EgressMode - 20, // 20: kit.sandbox.v1.NetworkConfig.outbound_cidrs:type_name -> kit.sandbox.v1.StringAllowlist - 20, // 21: kit.sandbox.v1.NetworkConfig.outbound_domains:type_name -> kit.sandbox.v1.StringAllowlist - 20, // 22: kit.sandbox.v1.NetworkConfig.inbound_cidrs:type_name -> kit.sandbox.v1.StringAllowlist - 22, // 23: kit.sandbox.v1.NetworkConfig.ports:type_name -> kit.sandbox.v1.PortBinding + 21, // 20: kit.sandbox.v1.NetworkConfig.outbound_cidrs:type_name -> kit.sandbox.v1.StringAllowlist + 21, // 21: kit.sandbox.v1.NetworkConfig.outbound_domains:type_name -> kit.sandbox.v1.StringAllowlist + 21, // 22: kit.sandbox.v1.NetworkConfig.inbound_cidrs:type_name -> kit.sandbox.v1.StringAllowlist + 23, // 23: kit.sandbox.v1.NetworkConfig.ports:type_name -> kit.sandbox.v1.PortBinding 3, // 24: kit.sandbox.v1.PortBinding.transport:type_name -> kit.sandbox.v1.PortTransport - 24, // 25: kit.sandbox.v1.SecurityConfig.secrets:type_name -> kit.sandbox.v1.SecretReference + 25, // 25: kit.sandbox.v1.SecurityConfig.secrets:type_name -> kit.sandbox.v1.SecretReference 4, // 26: kit.sandbox.v1.SecretReference.injection:type_name -> kit.sandbox.v1.SecretInjection - 48, // 27: kit.sandbox.v1.LifetimePolicy.maximum_lifetime:type_name -> google.protobuf.Duration - 26, // 28: kit.sandbox.v1.LifetimePolicy.idle_terminate:type_name -> kit.sandbox.v1.AutomaticAction - 26, // 29: kit.sandbox.v1.LifetimePolicy.idle_stop:type_name -> kit.sandbox.v1.AutomaticAction - 26, // 30: kit.sandbox.v1.LifetimePolicy.idle_pause:type_name -> kit.sandbox.v1.AutomaticAction - 26, // 31: kit.sandbox.v1.LifetimePolicy.stopped_archive:type_name -> kit.sandbox.v1.AutomaticAction - 26, // 32: kit.sandbox.v1.LifetimePolicy.stopped_delete:type_name -> kit.sandbox.v1.AutomaticAction + 57, // 27: kit.sandbox.v1.LifetimePolicy.maximum_lifetime:type_name -> google.protobuf.Duration + 27, // 28: kit.sandbox.v1.LifetimePolicy.idle_terminate:type_name -> kit.sandbox.v1.AutomaticAction + 27, // 29: kit.sandbox.v1.LifetimePolicy.idle_stop:type_name -> kit.sandbox.v1.AutomaticAction + 27, // 30: kit.sandbox.v1.LifetimePolicy.idle_pause:type_name -> kit.sandbox.v1.AutomaticAction + 27, // 31: kit.sandbox.v1.LifetimePolicy.stopped_archive:type_name -> kit.sandbox.v1.AutomaticAction + 27, // 32: kit.sandbox.v1.LifetimePolicy.stopped_delete:type_name -> kit.sandbox.v1.AutomaticAction 5, // 33: kit.sandbox.v1.AutomaticAction.mode:type_name -> kit.sandbox.v1.PolicyMode - 48, // 34: kit.sandbox.v1.AutomaticAction.after:type_name -> google.protobuf.Duration - 48, // 35: kit.sandbox.v1.ProvisioningOptions.timeout:type_name -> google.protobuf.Duration - 48, // 36: kit.sandbox.v1.ProvisioningOptions.queue_timeout:type_name -> google.protobuf.Duration + 57, // 34: kit.sandbox.v1.AutomaticAction.after:type_name -> google.protobuf.Duration + 57, // 35: kit.sandbox.v1.ProvisioningOptions.timeout:type_name -> google.protobuf.Duration + 57, // 36: kit.sandbox.v1.ProvisioningOptions.queue_timeout:type_name -> google.protobuf.Duration 6, // 37: kit.sandbox.v1.ProvisioningOptions.wait_for:type_name -> kit.sandbox.v1.WaitCondition - 29, // 38: kit.sandbox.v1.ReadinessProbe.command:type_name -> kit.sandbox.v1.CommandProbe - 39, // 39: kit.sandbox.v1.CreateResult.sandbox:type_name -> kit.sandbox.v1.SandboxInfo - 48, // 40: kit.sandbox.v1.StartOptions.timeout:type_name -> google.protobuf.Duration - 48, // 41: kit.sandbox.v1.StopOptions.timeout:type_name -> google.protobuf.Duration - 48, // 42: kit.sandbox.v1.PauseOptions.timeout:type_name -> google.protobuf.Duration - 48, // 43: kit.sandbox.v1.TerminateOptions.timeout:type_name -> google.protobuf.Duration - 48, // 44: kit.sandbox.v1.ArchiveOptions.timeout:type_name -> google.protobuf.Duration - 48, // 45: kit.sandbox.v1.DeleteOptions.timeout:type_name -> google.protobuf.Duration - 17, // 46: kit.sandbox.v1.SandboxInfo.isolation:type_name -> kit.sandbox.v1.IsolationConfig - 18, // 47: kit.sandbox.v1.SandboxInfo.resources:type_name -> kit.sandbox.v1.Resources - 46, // 48: kit.sandbox.v1.SandboxInfo.labels:type_name -> kit.sandbox.v1.SandboxInfo.LabelsEntry - 49, // 49: kit.sandbox.v1.SandboxInfo.created_at:type_name -> google.protobuf.Timestamp - 43, // 50: kit.sandbox.v1.SandboxInfo.provider_metadata:type_name -> kit.sandbox.v1.MetadataObject - 7, // 51: kit.sandbox.v1.SandboxInfo.state:type_name -> kit.sandbox.v1.SandboxState - 9, // 52: kit.sandbox.v1.ErrorInfo.kind:type_name -> kit.sandbox.v1.ErrorKind - 42, // 53: kit.sandbox.v1.MetadataValue.list:type_name -> kit.sandbox.v1.MetadataList - 43, // 54: kit.sandbox.v1.MetadataValue.object:type_name -> kit.sandbox.v1.MetadataObject - 41, // 55: kit.sandbox.v1.MetadataList.values:type_name -> kit.sandbox.v1.MetadataValue - 47, // 56: kit.sandbox.v1.MetadataObject.values:type_name -> kit.sandbox.v1.MetadataObject.ValuesEntry - 41, // 57: kit.sandbox.v1.MetadataObject.ValuesEntry.value:type_name -> kit.sandbox.v1.MetadataValue - 58, // [58:58] is the sub-list for method output_type - 58, // [58:58] is the sub-list for method input_type - 58, // [58:58] is the sub-list for extension type_name - 58, // [58:58] is the sub-list for extension extendee - 0, // [0:58] is the sub-list for field type_name + 30, // 38: kit.sandbox.v1.ReadinessProbe.command:type_name -> kit.sandbox.v1.CommandProbe + 48, // 39: kit.sandbox.v1.CreateResult.sandbox:type_name -> kit.sandbox.v1.SandboxInfo + 57, // 40: kit.sandbox.v1.StartOptions.timeout:type_name -> google.protobuf.Duration + 57, // 41: kit.sandbox.v1.StopOptions.timeout:type_name -> google.protobuf.Duration + 57, // 42: kit.sandbox.v1.PauseOptions.timeout:type_name -> google.protobuf.Duration + 57, // 43: kit.sandbox.v1.TerminateOptions.timeout:type_name -> google.protobuf.Duration + 57, // 44: kit.sandbox.v1.ArchiveOptions.timeout:type_name -> google.protobuf.Duration + 57, // 45: kit.sandbox.v1.DeleteOptions.timeout:type_name -> google.protobuf.Duration + 7, // 46: kit.sandbox.v1.FileInfo.type:type_name -> kit.sandbox.v1.FileType + 58, // 47: kit.sandbox.v1.FileInfo.modified_at:type_name -> google.protobuf.Timestamp + 57, // 48: kit.sandbox.v1.FileReadOptions.timeout:type_name -> google.protobuf.Duration + 57, // 49: kit.sandbox.v1.FileWriteOptions.timeout:type_name -> google.protobuf.Duration + 57, // 50: kit.sandbox.v1.FileCopyOptions.timeout:type_name -> google.protobuf.Duration + 57, // 51: kit.sandbox.v1.MakeDirectoryOptions.timeout:type_name -> google.protobuf.Duration + 57, // 52: kit.sandbox.v1.ListDirectoryOptions.timeout:type_name -> google.protobuf.Duration + 57, // 53: kit.sandbox.v1.StatOptions.timeout:type_name -> google.protobuf.Duration + 57, // 54: kit.sandbox.v1.RemoveOptions.timeout:type_name -> google.protobuf.Duration + 18, // 55: kit.sandbox.v1.SandboxInfo.isolation:type_name -> kit.sandbox.v1.IsolationConfig + 19, // 56: kit.sandbox.v1.SandboxInfo.resources:type_name -> kit.sandbox.v1.Resources + 55, // 57: kit.sandbox.v1.SandboxInfo.labels:type_name -> kit.sandbox.v1.SandboxInfo.LabelsEntry + 58, // 58: kit.sandbox.v1.SandboxInfo.created_at:type_name -> google.protobuf.Timestamp + 52, // 59: kit.sandbox.v1.SandboxInfo.provider_metadata:type_name -> kit.sandbox.v1.MetadataObject + 8, // 60: kit.sandbox.v1.SandboxInfo.state:type_name -> kit.sandbox.v1.SandboxState + 10, // 61: kit.sandbox.v1.ErrorInfo.kind:type_name -> kit.sandbox.v1.ErrorKind + 51, // 62: kit.sandbox.v1.MetadataValue.list:type_name -> kit.sandbox.v1.MetadataList + 52, // 63: kit.sandbox.v1.MetadataValue.object:type_name -> kit.sandbox.v1.MetadataObject + 50, // 64: kit.sandbox.v1.MetadataList.values:type_name -> kit.sandbox.v1.MetadataValue + 56, // 65: kit.sandbox.v1.MetadataObject.values:type_name -> kit.sandbox.v1.MetadataObject.ValuesEntry + 50, // 66: kit.sandbox.v1.MetadataObject.ValuesEntry.value:type_name -> kit.sandbox.v1.MetadataValue + 67, // [67:67] is the sub-list for method output_type + 67, // [67:67] is the sub-list for method input_type + 67, // [67:67] is the sub-list for extension type_name + 67, // [67:67] is the sub-list for extension extendee + 0, // [0:67] is the sub-list for field type_name } func init() { file_kit_sandbox_v1_sandbox_proto_init() } @@ -3618,8 +4186,11 @@ func file_kit_sandbox_v1_sandbox_proto_init() { file_kit_sandbox_v1_sandbox_proto_msgTypes[27].OneofWrappers = []any{} file_kit_sandbox_v1_sandbox_proto_msgTypes[28].OneofWrappers = []any{} file_kit_sandbox_v1_sandbox_proto_msgTypes[29].OneofWrappers = []any{} - file_kit_sandbox_v1_sandbox_proto_msgTypes[30].OneofWrappers = []any{} - file_kit_sandbox_v1_sandbox_proto_msgTypes[31].OneofWrappers = []any{ + file_kit_sandbox_v1_sandbox_proto_msgTypes[33].OneofWrappers = []any{} + file_kit_sandbox_v1_sandbox_proto_msgTypes[36].OneofWrappers = []any{} + file_kit_sandbox_v1_sandbox_proto_msgTypes[37].OneofWrappers = []any{} + file_kit_sandbox_v1_sandbox_proto_msgTypes[38].OneofWrappers = []any{} + file_kit_sandbox_v1_sandbox_proto_msgTypes[39].OneofWrappers = []any{ (*MetadataValue_Boolean)(nil), (*MetadataValue_Text)(nil), (*MetadataValue_SignedInteger)(nil), @@ -3634,8 +4205,8 @@ func file_kit_sandbox_v1_sandbox_proto_init() { File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), RawDescriptor: unsafe.Slice(unsafe.StringData(file_kit_sandbox_v1_sandbox_proto_rawDesc), len(file_kit_sandbox_v1_sandbox_proto_rawDesc)), - NumEnums: 10, - NumMessages: 38, + NumEnums: 11, + NumMessages: 46, NumExtensions: 0, NumServices: 0, }, diff --git a/sdks/go/providers/daytona/README.md b/sdks/go/providers/daytona/README.md index f56989c2..2400bae6 100644 --- a/sdks/go/providers/daytona/README.md +++ b/sdks/go/providers/daytona/README.md @@ -75,18 +75,29 @@ On the handle: `Get`, `Refresh`, `Start`, `Stop`, `Pause`, `Archive`, supported. Daytona accepts or rejects each lifecycle call for that sandbox. `Close` does not contact Daytona and does not change the sandbox. +`Filesystem` supports the shared file calls: `ReadFile`, `WriteFile`, +`CopyFromLocal`, `CopyToLocal`, `MakeDirectory`, `ListDirectory`, `Stat`, and +`Remove`. Paths in the sandbox are absolute. A file timeout is the context +deadline. `1500 * time.Millisecond` ends the call at 1.5 seconds. `Parents` +defaults to true and creates missing parents. `Parents` set to false is +rejected. `MakeDirectory` returns the provider error when the directory already +exists. A missing file passed to `CopyFromLocal` is not found, and the error +field is `local_path`. A local directory is an invalid argument with the same +field. `CopyToLocal` creates a missing local parent directory. + CPU is a whole number of cores. Memory and disk are a whole number of GiB, written as MiB. A resource override requires an image source. A snapshot create uses the snapshot's resources. ## Examples -| Operation | Program | -| --------- | ----------------------------------------------------------------------------------------------------------------------------- | -| Create | [create-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/create-daytona-sandbox) | -| Policies | [create-daytona-with-policies](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/create-daytona-with-policies) | -| Look up | [get-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/get-daytona-sandbox) | -| All | [Go examples](https://github.com/sandbox-kit/kit/tree/main/examples/go) | +| Operation | Program | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------------- | +| Create | [create-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/configuration/create-daytona-sandbox) | +| Read a file | [read-daytona-file](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/read-daytona-file) | +| Policies | [create-daytona-with-policies](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/configuration/create-daytona-with-policies) | +| Look up | [get-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/lifecycle/get-daytona-sandbox) | +| All | [Go examples](https://github.com/sandbox-kit/kit/tree/main/examples/go) | ## License diff --git a/sdks/go/providers/daytona/doc.go b/sdks/go/providers/daytona/doc.go index fceb373d..19704e80 100644 --- a/sdks/go/providers/daytona/doc.go +++ b/sdks/go/providers/daytona/doc.go @@ -1,6 +1,7 @@ // Package daytona connects the sandbox client to Daytona. // // Pass [New] to sandbox.NewClient. [sandbox.Client.Create] with a nil request -// uses Daytona's default snapshot. Closing the client releases the local SDK -// and leaves the Daytona sandbox running. +// uses Daytona's default snapshot. The backend implements shared filesystem +// operations through [sandbox.SandboxFiles]. Closing the client releases the +// local SDK and leaves the Daytona sandbox running. package daytona diff --git a/sdks/go/providers/daytona/filesystem.go b/sdks/go/providers/daytona/filesystem.go new file mode 100644 index 00000000..832dc4f4 --- /dev/null +++ b/sdks/go/providers/daytona/filesystem.go @@ -0,0 +1,304 @@ +package daytona + +import ( + "context" + "errors" + "os" + "path/filepath" + "time" + + daytona "github.com/daytona/clients/sdk-go/pkg/daytona" + sdkerrors "github.com/daytona/clients/sdk-go/pkg/errors" + "github.com/daytona/clients/toolbox-api-client-go" + "github.com/sandbox-kit/kit/sdks/go/sandbox" + "google.golang.org/protobuf/types/known/timestamppb" +) + +var _ sandbox.SandboxFiles = (*backend)(nil) + +func (b *backend) ReadFile(ctx context.Context, id, path string, _ *sandbox.FileReadOptions) ([]byte, error) { + instance, err := b.fileSandbox(ctx, id, "read_file") + if err != nil { + return nil, err + } + data, err := instance.FileSystem.DownloadFile(ctx, path, nil) + if err != nil { + return nil, mapProviderError(err, "read_file") + } + return data, nil +} + +func (b *backend) WriteFile(ctx context.Context, id, path string, data []byte, _ *sandbox.FileWriteOptions) error { + instance, err := b.fileSandbox(ctx, id, "write_file") + if err != nil { + return err + } + if data == nil { + data = []byte{} + } + if err := instance.FileSystem.UploadFile(ctx, data, path); err != nil { + return mapProviderError(err, "write_file") + } + return nil +} + +func (b *backend) CopyFromLocal(ctx context.Context, id, localPath, remotePath string, _ *sandbox.FileCopyOptions) error { + if err := localSourceFile(localPath, "copy_from_local"); err != nil { + return err + } + instance, err := b.fileSandbox(ctx, id, "copy_from_local") + if err != nil { + return err + } + if err := instance.FileSystem.UploadFile(ctx, localPath, remotePath); err != nil { + return mapCallerPathError(err, "copy_from_local", localPath) + } + return nil +} + +func (b *backend) CopyToLocal(ctx context.Context, id, remotePath, localPath string, _ *sandbox.FileCopyOptions) error { + if err := localDestination(localPath, "copy_to_local"); err != nil { + return err + } + if err := ensureLocalParent(localPath, "copy_to_local"); err != nil { + return err + } + instance, err := b.fileSandbox(ctx, id, "copy_to_local") + if err != nil { + return err + } + if _, err := instance.FileSystem.DownloadFile(ctx, remotePath, &localPath); err != nil { + return mapCallerPathError(err, "copy_to_local", localPath) + } + return nil +} + +func (b *backend) MakeDirectory(ctx context.Context, id, path string, options *sandbox.MakeDirectoryOptions) error { + if err := rejectParents(options); err != nil { + return err + } + instance, err := b.fileSandbox(ctx, id, "make_directory") + if err != nil { + return err + } + if err := instance.FileSystem.CreateFolder(ctx, path); err != nil { + return mapProviderError(err, "make_directory") + } + return nil +} + +func (b *backend) ListDirectory(ctx context.Context, id, path string, _ *sandbox.ListDirectoryOptions) ([]*sandbox.FileInfo, error) { + client, err := b.toolbox(ctx, id, "list_directory") + if err != nil { + return nil, err + } + entries, httpResp, err := client.FileSystemAPI.ListFiles(ctx).Path(path).Execute() + if err != nil { + return nil, mapProviderError(sdkerrors.ConvertToolboxError(err, httpResp), "list_directory") + } + result := make([]*sandbox.FileInfo, 0, len(entries)) + for i := range entries { + info, err := daytonaFileInfo(&entries[i], "list_directory") + if err != nil { + return nil, err + } + result = append(result, info) + } + return result, nil +} + +func (b *backend) Stat(ctx context.Context, id, path string, _ *sandbox.StatOptions) (*sandbox.FileInfo, error) { + client, err := b.toolbox(ctx, id, "stat") + if err != nil { + return nil, err + } + info, httpResp, err := client.FileSystemAPI.GetFileInfo(ctx).Path(path).Execute() + if err != nil { + return nil, mapProviderError(sdkerrors.ConvertToolboxError(err, httpResp), "stat") + } + return daytonaFileInfo(info, "stat") +} + +func (b *backend) Remove(ctx context.Context, id, path string, options *sandbox.RemoveOptions) error { + instance, err := b.fileSandbox(ctx, id, "remove") + if err != nil { + return err + } + recursive := options != nil && options.GetRecursive() + if err := instance.FileSystem.DeleteFile(ctx, path, recursive); err != nil { + return mapProviderError(err, "remove") + } + return nil +} + +func (b *backend) toolbox(ctx context.Context, id, operation string) (*toolbox.APIClient, error) { + instance, err := b.fileSandbox(ctx, id, operation) + if err != nil { + return nil, err + } + if instance.ToolboxClient == nil { + return nil, sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindInvalidResponse, + Provider: "daytona", + Operation: operation, + Message: "sandbox-kit daytona: SDK returned no filesystem", + }, nil) + } + return instance.ToolboxClient, nil +} + +func (b *backend) fileSandbox(ctx context.Context, id, operation string) (*daytona.Sandbox, error) { + instance, err := b.nativeSandbox(ctx, id) + if err != nil { + return nil, mapProviderError(err, operation) + } + if instance == nil || instance.FileSystem == nil { + return nil, sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindInvalidResponse, + Provider: "daytona", + Operation: operation, + Message: "sandbox-kit daytona: SDK returned no filesystem", + }, nil) + } + return instance, nil +} + +func rejectParents(options *sandbox.MakeDirectoryOptions) error { + if options == nil || options.Parents == nil || *options.Parents { + return nil + } + return sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindUnsupported, + Provider: "daytona", + Operation: "make_directory", + Field: sandbox.FileFieldParents, + Message: "sandbox-kit daytona: parents false is not available", + }, nil) +} + +func localSourceFile(path, operation string) error { + info, err := os.Stat(path) + if err != nil { + return localPathError(err, operation) + } + if info.IsDir() { + return localDirectoryError(operation) + } + return nil +} + +// localDestination rejects a path that is already a directory. A missing path +// is left for ensureLocalParent and Daytona's write. +func localDestination(path, operation string) error { + info, err := os.Stat(path) + if errors.Is(err, os.ErrNotExist) { + return nil + } + if err != nil { + return localPathError(err, operation) + } + if info.IsDir() { + return localDirectoryError(operation) + } + return nil +} + +// ensureLocalParent creates missing local parents. Daytona's DownloadFile uses +// os.WriteFile, which does not create them. +func ensureLocalParent(path, operation string) error { + parent := filepath.Dir(path) + if parent == "." || parent == string(filepath.Separator) { + return nil + } + if err := os.MkdirAll(parent, 0o755); err != nil { + return localPathError(err, operation) + } + return nil +} + +func localDirectoryError(operation string) error { + return sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindInvalidArgument, + Provider: "daytona", + Operation: operation, + Field: sandbox.FileFieldLocalPath, + Message: "sandbox-kit daytona: local path is a directory", + }, nil) +} + +func localPathError(err error, operation string) error { + kind := sandbox.ErrorKindInvalidArgument + if errors.Is(err, os.ErrNotExist) { + kind = sandbox.ErrorKindNotFound + } + return sandbox.NewError(&sandbox.ErrorInfo{ + Kind: kind, + Provider: "daytona", + Operation: operation, + Field: sandbox.FileFieldLocalPath, + Message: err.Error(), + }, err) +} + +func mapCallerPathError(err error, operation, localPath string) error { + var pathError *os.PathError + if errors.As(err, &pathError) && filepath.Clean(pathError.Path) == filepath.Clean(localPath) { + return localPathError(pathError, operation) + } + return mapProviderError(err, operation) +} + +func daytonaFileInfo(info *toolbox.FileInfo, operation string) (*sandbox.FileInfo, error) { + if info == nil { + return nil, sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindInvalidResponse, + Provider: "daytona", + Operation: operation, + Field: sandbox.FileFieldPath, + Message: "sandbox-kit daytona: SDK returned no file metadata", + }, nil) + } + kind := sandbox.FileTypeFile + if info.GetIsDir() { + kind = sandbox.FileTypeDirectory + } + result := &sandbox.FileInfo{ + Name: info.GetName(), + Path: info.GetPath(), + Type: kind, + Size: int64(info.GetSize()), + } + if mode := info.GetMode(); mode != "" { + result.Mode = sandbox.Value(mode) + } + if permissions := info.GetPermissions(); permissions != "" { + result.Permissions = sandbox.Value(permissions) + } + if owner := info.GetOwner(); owner != "" { + result.Owner = sandbox.Value(owner) + } + if group := info.GetGroup(); group != "" { + result.Group = sandbox.Value(group) + } + if modified := daytonaModifiedAt(info); modified != nil { + result.ModifiedAt = modified + } + return result, nil +} + +// modifiedAt wins when it is present. A fractional RFC3339 timestamp is kept. +// modTime is used only when modifiedAt is empty, matching the TypeScript mapper. +func daytonaModifiedAt(info *toolbox.FileInfo) *timestamppb.Timestamp { + raw := info.GetModifiedAt() + if raw == "" { + raw = info.GetModTime() + } + if raw == "" { + return nil + } + parsed, err := time.Parse(time.RFC3339Nano, raw) + if err != nil { + return nil + } + return timestamppb.New(parsed) +} diff --git a/sdks/go/providers/daytona/filesystem_test.go b/sdks/go/providers/daytona/filesystem_test.go new file mode 100644 index 00000000..3497b64b --- /dev/null +++ b/sdks/go/providers/daytona/filesystem_test.go @@ -0,0 +1,217 @@ +package daytona + +import ( + "context" + "errors" + "net/http" + "net/http/httptest" + "os" + "path/filepath" + "testing" + "time" + + sdkerrors "github.com/daytona/clients/sdk-go/pkg/errors" + "github.com/daytona/clients/toolbox-api-client-go" + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func TestRejectParents(t *testing.T) { + if err := rejectParents(nil); err != nil { + t.Fatal(err) + } + if err := rejectParents(&sandbox.MakeDirectoryOptions{}); err != nil { + t.Fatal(err) + } + if err := rejectParents(&sandbox.MakeDirectoryOptions{Parents: sandbox.Value(true)}); err != nil { + t.Fatal(err) + } + err := rejectParents(&sandbox.MakeDirectoryOptions{Parents: sandbox.Value(false)}) + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindUnsupported || detail.Field != sandbox.FileFieldParents || detail.Operation != "make_directory" { + t.Fatalf("parents false: %#v", err) + } +} + +func TestLocalSourceFile(t *testing.T) { + dir := t.TempDir() + missing := filepath.Join(dir, "missing.txt") + err := localSourceFile(missing, "copy_from_local") + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindNotFound || detail.Field != sandbox.FileFieldLocalPath || detail.Operation != "copy_from_local" || !errors.Is(err, os.ErrNotExist) { + t.Fatalf("missing file: %#v", err) + } + err = localSourceFile(dir, "copy_from_local") + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindInvalidArgument || detail.Field != sandbox.FileFieldLocalPath { + t.Fatalf("directory: %#v", err) + } + path := filepath.Join(dir, "note.txt") + if err := os.WriteFile(path, []byte("hi"), 0o644); err != nil { + t.Fatal(err) + } + if err := localSourceFile(path, "copy_from_local"); err != nil { + t.Fatal(err) + } +} + +func TestLocalDestination(t *testing.T) { + dir := t.TempDir() + if err := localDestination(filepath.Join(dir, "out.txt"), "copy_to_local"); err != nil { + t.Fatal(err) + } + if err := localDestination(filepath.Join(dir, "missing", "out.txt"), "copy_to_local"); err != nil { + t.Fatal(err) + } + err := localDestination(dir, "copy_to_local") + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindInvalidArgument || detail.Field != sandbox.FileFieldLocalPath || detail.Operation != "copy_to_local" { + t.Fatalf("directory: %#v", err) + } + path := filepath.Join(dir, "out.txt") + if err := os.WriteFile(path, []byte("hi"), 0o644); err != nil { + t.Fatal(err) + } + if err := localDestination(path, "copy_to_local"); err != nil { + t.Fatal(err) + } +} + +func TestEnsureLocalParent(t *testing.T) { + dir := t.TempDir() + path := filepath.Join(dir, "nested", "out.txt") + if err := ensureLocalParent(path, "copy_to_local"); err != nil { + t.Fatal(err) + } + info, err := os.Stat(filepath.Dir(path)) + if err != nil || !info.IsDir() { + t.Fatalf("parent: %#v %#v", info, err) + } + if err := ensureLocalParent(filepath.Join(dir, "out.txt"), "copy_to_local"); err != nil { + t.Fatal(err) + } +} + +func TestMapCallerPathError(t *testing.T) { + path := filepath.Join(t.TempDir(), "out.txt") + cause := &os.PathError{Op: "open", Path: path, Err: os.ErrNotExist} + err := mapCallerPathError(sdkerrors.WrapDaytonaError(cause, "Failed to write file", 0, nil), "copy_to_local", path) + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindNotFound || detail.Field != sandbox.FileFieldLocalPath || !errors.Is(err, os.ErrNotExist) { + t.Fatalf("local write: %#v", err) + } + temp := &os.PathError{Op: "open", Path: filepath.Join(t.TempDir(), "daytona-upload"), Err: os.ErrNotExist} + err = mapCallerPathError(sdkerrors.WrapDaytonaError(temp, "Failed to read file", 0, nil), "copy_from_local", path) + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindUnavailable || detail.Field != "" { + t.Fatalf("temp file: %#v", err) + } + denied := &os.PathError{Op: "open", Path: path, Err: os.ErrPermission} + err = mapCallerPathError(sdkerrors.WrapDaytonaError(denied, "Failed to write file", 0, nil), "copy_to_local", path) + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindInvalidArgument || detail.Field != sandbox.FileFieldLocalPath { + t.Fatalf("permission: %#v", err) + } +} + +func TestDaytonaFileInfoKeepsToolboxFields(t *testing.T) { + modified := "2020-01-02T15:04:05.123456789Z" + info, err := daytonaFileInfo(&toolbox.FileInfo{ + Name: "note.txt", + Path: sandbox.Value("/tmp/note.txt"), + Size: 12, + Mode: "0644", + Permissions: "rw-r--r--", + Owner: "daytona", + Group: "staff", + ModifiedAt: modified, + ModTime: "not-used", + IsDir: false, + }, "stat") + if err != nil { + t.Fatal(err) + } + if info.GetPath() != "/tmp/note.txt" || info.GetName() != "note.txt" || info.GetSize() != 12 || info.GetType() != sandbox.FileTypeFile { + t.Fatalf("identity: %#v", info) + } + if info.GetMode() != "0644" || info.GetPermissions() != "rw-r--r--" || info.GetOwner() != "daytona" || info.GetGroup() != "staff" { + t.Fatalf("metadata: %#v", info) + } + want := time.Date(2020, 1, 2, 15, 4, 5, 123456789, time.UTC) + if info.ModifiedAt == nil || !info.ModifiedAt.AsTime().Equal(want) { + t.Fatalf("modified: %#v", info.ModifiedAt) + } +} + +func TestDaytonaFileInfoOmitsEmptyAndUnparsedTimes(t *testing.T) { + info, err := daytonaFileInfo(&toolbox.FileInfo{Name: "nested", IsDir: true, ModifiedAt: "not-a-timestamp", ModTime: "2020-01-02T15:04:05Z"}, "list_directory") + if err != nil { + t.Fatal(err) + } + if info.GetType() != sandbox.FileTypeDirectory || info.Path != "" || info.Mode != nil || info.Permissions != nil || info.Owner != nil || info.Group != nil || info.ModifiedAt != nil { + t.Fatalf("directory: %#v", info) + } + info, err = daytonaFileInfo(&toolbox.FileInfo{Name: "note.txt", ModTime: "2020-01-02T15:04:05Z"}, "stat") + if err != nil { + t.Fatal(err) + } + want := time.Date(2020, 1, 2, 15, 4, 5, 0, time.UTC) + if info.ModifiedAt == nil || !info.ModifiedAt.AsTime().Equal(want) { + t.Fatalf("modTime fallback: %#v", info.ModifiedAt) + } + if _, err := daytonaFileInfo(nil, "stat"); err == nil { + t.Fatal("nil metadata accepted") + } +} + +func TestToolboxStatAndListKeepReportedFields(t *testing.T) { + const body = `{"group":"staff","isDir":false,"modTime":"2020-01-02T15:04:05Z","mode":"0644","modifiedAt":"2020-01-02T15:04:05.123456789Z","name":"note.txt","owner":"daytona","path":"/tmp/note.txt","permissions":"rw-r--r--","size":12}` + server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { + if r.URL.Query().Get("path") != "/tmp" && r.URL.Query().Get("path") != "/tmp/note.txt" { + t.Errorf("path query: %s %s", r.URL.Path, r.URL.RawQuery) + } + w.Header().Set("Content-Type", "application/json") + switch r.URL.Path { + case "/files/info": + _, _ = w.Write([]byte(body)) + case "/files": + _, _ = w.Write([]byte("[" + body + "]")) + default: + http.NotFound(w, r) + } + })) + defer server.Close() + cfg := toolbox.NewConfiguration() + cfg.Servers = toolbox.ServerConfigurations{{URL: server.URL}} + cfg.HTTPClient = server.Client() + client := toolbox.NewAPIClient(cfg) + + info, httpResp, err := client.FileSystemAPI.GetFileInfo(context.Background()).Path("/tmp/note.txt").Execute() + if err != nil { + t.Fatal(err) + } + if httpResp != nil && httpResp.Body != nil { + httpResp.Body.Close() + } + mapped, err := daytonaFileInfo(info, "stat") + if err != nil { + t.Fatal(err) + } + if mapped.GetPath() != "/tmp/note.txt" || mapped.GetOwner() != "daytona" || mapped.GetPermissions() != "rw-r--r--" || mapped.GetGroup() != "staff" || mapped.ModifiedAt == nil { + t.Fatalf("stat: %#v", mapped) + } + + entries, httpResp, err := client.FileSystemAPI.ListFiles(context.Background()).Path("/tmp").Execute() + if err != nil { + t.Fatal(err) + } + if httpResp != nil && httpResp.Body != nil { + httpResp.Body.Close() + } + if len(entries) != 1 { + t.Fatalf("entries: %#v", entries) + } + mapped, err = daytonaFileInfo(&entries[0], "list_directory") + if err != nil { + t.Fatal(err) + } + if mapped.GetPath() != "/tmp/note.txt" || mapped.GetOwner() != "daytona" { + t.Fatalf("list: %#v", mapped) + } +} diff --git a/sdks/go/providers/daytona/go.mod b/sdks/go/providers/daytona/go.mod index be8d2511..e1c5e8e2 100644 --- a/sdks/go/providers/daytona/go.mod +++ b/sdks/go/providers/daytona/go.mod @@ -5,6 +5,7 @@ go 1.26.0 require ( github.com/daytona/clients/api-client-go v0.225.0 github.com/daytona/clients/sdk-go v0.225.0 + github.com/daytona/clients/toolbox-api-client-go v0.225.0 github.com/sandbox-kit/kit/sdks/go/internal/sdk v0.1.3 github.com/sandbox-kit/kit/sdks/go/sandbox v0.1.3 google.golang.org/protobuf v1.36.12 @@ -32,7 +33,6 @@ require ( github.com/cenkalti/backoff/v5 v5.0.3 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/daytona/clients/analytics-api-client-go v0.0.0-20260722121532-3d2223c79fe5 // indirect - github.com/daytona/clients/toolbox-api-client-go v0.225.0 // indirect github.com/go-logr/logr v1.4.4 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/sdks/go/providers/daytona/provider_checks.go b/sdks/go/providers/daytona/provider_checks.go index d861b81f..a1f6ddd7 100644 --- a/sdks/go/providers/daytona/provider_checks.go +++ b/sdks/go/providers/daytona/provider_checks.go @@ -16,7 +16,7 @@ var providerDomainPattern = regexp.MustCompile(`(?i)^(?:[a-z0-9](?:[a-z0-9-]*[a- // It runs before the native create call. // // Rules are inventoried in specs/providers/daytona.yaml checks and kept in sync -// here by hand (no longer emitted). +// here by hand (not emitted). func validateProviderCreate(request *sandbox.CreateOptions) error { if request == nil { return nil diff --git a/sdks/go/providers/modal/README.md b/sdks/go/providers/modal/README.md index e31c6dfc..ef15f196 100644 --- a/sdks/go/providers/modal/README.md +++ b/sdks/go/providers/modal/README.md @@ -77,18 +77,29 @@ On the handle: `Attach`, `Terminate`, and `Close`. `Close` does not terminate the sandbox. `Get`, `Refresh`, `Start`, `Stop`, `Pause`, `Archive`, and `Delete` are not supported. +`Filesystem` supports the shared file calls: `ReadFile`, `WriteFile`, +`CopyFromLocal`, `CopyToLocal`, `MakeDirectory`, `ListDirectory`, `Stat`, and +`Remove`. Paths in the sandbox are absolute. A file timeout is the context +deadline. `1500 * time.Millisecond` ends the call at 1.5 seconds. `Parents` +defaults to true: missing parents are created, and an existing directory is +accepted. `Parents` false requires the parent to exist. A missing file passed +to `CopyFromLocal` is not found, and the error field is `local_path`. A local +directory is an invalid argument with the same field. `CopyToLocal` creates a +missing local parent directory. + When you set resources, Modal requires at least 0.125 CPU cores and 128 MiB of memory. Omitted values keep Modal's defaults. Disk size cannot be raised at create time. ## Examples -| Operation | Program | -| --------- | ------------------------------------------------------------------------------------------------------------------------- | -| Create | [create-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/create-modal-sandbox) | -| Resources | [create-modal-with-resources](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/create-modal-with-resources) | -| Attach | [attach-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/attach-modal-sandbox) | -| All | [Go examples](https://github.com/sandbox-kit/kit/tree/main/examples/go) | +| Operation | Program | +| ----------- | --------------------------------------------------------------------------------------------------------------------------------------- | +| Create | [create-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/configuration/create-modal-sandbox) | +| Read a file | [read-modal-file](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/read-modal-file) | +| Resources | [create-modal-with-resources](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/configuration/create-modal-with-resources) | +| Attach | [attach-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/lifecycle/attach-modal-sandbox) | +| All | [Go examples](https://github.com/sandbox-kit/kit/tree/main/examples/go) | ## License diff --git a/sdks/go/providers/modal/doc.go b/sdks/go/providers/modal/doc.go index f29b3b0f..c42b3082 100644 --- a/sdks/go/providers/modal/doc.go +++ b/sdks/go/providers/modal/doc.go @@ -1,7 +1,8 @@ // Package modal connects the sandbox client to Modal. // // Pass [New] to sandbox.NewClient. Create requires an image. Set Scope.AppName -// to an existing Modal app. Closing the client releases the local SDK and -// leaves the Modal sandbox running. Reclaim it with Terminate or a lifetime -// policy. +// to an existing Modal app. The backend implements shared filesystem +// operations through [sandbox.SandboxFiles]. Closing the client releases the +// local SDK and leaves the Modal sandbox running. Reclaim it with Terminate or +// a lifetime policy. package modal diff --git a/sdks/go/providers/modal/errors.go b/sdks/go/providers/modal/errors.go index b8b1051d..da93ab6e 100644 --- a/sdks/go/providers/modal/errors.go +++ b/sdks/go/providers/modal/errors.go @@ -83,6 +83,50 @@ func mapProviderError(err error, operation string) error { kind = sandbox.ErrorKindFailedPrecondition } } + if kind == sandbox.ErrorKindUnknown { + var notFound sdk.SandboxFilesystemNotFoundError + var notFoundPtr *sdk.SandboxFilesystemNotFoundError + if errors.As(err, ¬Found) || errors.As(err, ¬FoundPtr) { + kind = sandbox.ErrorKindNotFound + } + } + if kind == sandbox.ErrorKindUnknown { + var denied sdk.SandboxFilesystemPermissionError + var deniedPtr *sdk.SandboxFilesystemPermissionError + if errors.As(err, &denied) || errors.As(err, &deniedPtr) { + kind = sandbox.ErrorKindPermissionDenied + } + } + if kind == sandbox.ErrorKindUnknown { + var exists sdk.SandboxFilesystemPathAlreadyExistsError + var existsPtr *sdk.SandboxFilesystemPathAlreadyExistsError + if errors.As(err, &exists) || errors.As(err, &existsPtr) { + kind = sandbox.ErrorKindAlreadyExists + } + } + if kind == sandbox.ErrorKindUnknown { + var notEmpty sdk.SandboxFilesystemDirectoryNotEmptyError + var notEmptyPtr *sdk.SandboxFilesystemDirectoryNotEmptyError + if errors.As(err, ¬Empty) || errors.As(err, ¬EmptyPtr) { + kind = sandbox.ErrorKindFailedPrecondition + } + } + if kind == sandbox.ErrorKindUnknown { + var tooLarge sdk.SandboxFilesystemFileTooLargeError + var tooLargePtr *sdk.SandboxFilesystemFileTooLargeError + if errors.As(err, &tooLarge) || errors.As(err, &tooLargePtr) { + kind = sandbox.ErrorKindResourceExhausted + } + } + if kind == sandbox.ErrorKindUnknown { + var notDir sdk.SandboxFilesystemNotADirectoryError + var notDirPtr *sdk.SandboxFilesystemNotADirectoryError + var isDir sdk.SandboxFilesystemIsADirectoryError + var isDirPtr *sdk.SandboxFilesystemIsADirectoryError + if errors.As(err, ¬Dir) || errors.As(err, ¬DirPtr) || errors.As(err, &isDir) || errors.As(err, &isDirPtr) { + kind = sandbox.ErrorKindInvalidArgument + } + } if kind == sandbox.ErrorKindUnknown { switch status.Code(err) { case codes.Code(1): diff --git a/sdks/go/providers/modal/filesystem.go b/sdks/go/providers/modal/filesystem.go new file mode 100644 index 00000000..b27cd756 --- /dev/null +++ b/sdks/go/providers/modal/filesystem.go @@ -0,0 +1,261 @@ +package modal + +import ( + "context" + "errors" + "fmt" + "math" + "os" + "time" + + sdk "github.com/modal-labs/modal-client/go" + "github.com/sandbox-kit/kit/sdks/go/sandbox" + "google.golang.org/protobuf/types/known/timestamppb" +) + +var _ sandbox.SandboxFiles = (*backend)(nil) + +func (b *backend) ReadFile(ctx context.Context, id, path string, _ *sandbox.FileReadOptions) ([]byte, error) { + instance, err := b.fileSandbox(ctx, id, "read_file") + if err != nil { + return nil, err + } + data, err := instance.Filesystem.ReadBytes(ctx, path, nil) + if err != nil { + return nil, mapFileError(err, "read_file", "") + } + return data, nil +} + +func (b *backend) WriteFile(ctx context.Context, id, path string, data []byte, _ *sandbox.FileWriteOptions) error { + instance, err := b.fileSandbox(ctx, id, "write_file") + if err != nil { + return err + } + if data == nil { + data = []byte{} + } + if err := instance.Filesystem.WriteBytes(ctx, data, path, nil); err != nil { + return mapFileError(err, "write_file", "") + } + return nil +} + +func (b *backend) CopyFromLocal(ctx context.Context, id, localPath, remotePath string, _ *sandbox.FileCopyOptions) error { + if err := localSourceFile(localPath, "copy_from_local"); err != nil { + return err + } + instance, err := b.fileSandbox(ctx, id, "copy_from_local") + if err != nil { + return err + } + if err := instance.Filesystem.CopyFromLocal(ctx, localPath, remotePath, nil); err != nil { + return mapFileError(err, "copy_from_local", sandbox.FileFieldLocalPath) + } + return nil +} + +func (b *backend) CopyToLocal(ctx context.Context, id, remotePath, localPath string, _ *sandbox.FileCopyOptions) error { + if err := localDestination(localPath, "copy_to_local"); err != nil { + return err + } + instance, err := b.fileSandbox(ctx, id, "copy_to_local") + if err != nil { + return err + } + if err := instance.Filesystem.CopyToLocal(ctx, remotePath, localPath, nil); err != nil { + return mapFileError(err, "copy_to_local", sandbox.FileFieldLocalPath) + } + return nil +} + +func (b *backend) MakeDirectory(ctx context.Context, id, path string, options *sandbox.MakeDirectoryOptions) error { + instance, err := b.fileSandbox(ctx, id, "make_directory") + if err != nil { + return err + } + if err := instance.Filesystem.MakeDirectory(ctx, path, makeDirectoryParams(options)); err != nil { + return mapFileError(err, "make_directory", "") + } + return nil +} + +func makeDirectoryParams(options *sandbox.MakeDirectoryOptions) *sdk.SandboxFilesystemMakeDirectoryParams { + parents := true + if options != nil && options.Parents != nil { + parents = *options.Parents + } + return &sdk.SandboxFilesystemMakeDirectoryParams{CreateParents: &parents} +} + +func (b *backend) ListDirectory(ctx context.Context, id, path string, _ *sandbox.ListDirectoryOptions) ([]*sandbox.FileInfo, error) { + instance, err := b.fileSandbox(ctx, id, "list_directory") + if err != nil { + return nil, err + } + entries, err := instance.Filesystem.ListFiles(ctx, path, nil) + if err != nil { + return nil, mapFileError(err, "list_directory", "") + } + result := make([]*sandbox.FileInfo, 0, len(entries)) + for _, entry := range entries { + result = append(result, modalFileInfo(entry)) + } + return result, nil +} + +func (b *backend) Stat(ctx context.Context, id, path string, _ *sandbox.StatOptions) (*sandbox.FileInfo, error) { + instance, err := b.fileSandbox(ctx, id, "stat") + if err != nil { + return nil, err + } + info, err := instance.Filesystem.Stat(ctx, path, nil) + if err != nil { + return nil, mapFileError(err, "stat", "") + } + if info == nil { + return nil, sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindInvalidResponse, + Provider: "modal", + Operation: "stat", + Field: sandbox.FileFieldPath, + Message: "sandbox-kit modal: SDK returned no file metadata", + }, nil) + } + return modalFileInfo(*info), nil +} + +func (b *backend) Remove(ctx context.Context, id, path string, options *sandbox.RemoveOptions) error { + instance, err := b.fileSandbox(ctx, id, "remove") + if err != nil { + return err + } + recursive := options != nil && options.GetRecursive() + if err := instance.Filesystem.Remove(ctx, path, &sdk.SandboxFilesystemRemoveParams{Recursive: recursive}); err != nil { + return mapFileError(err, "remove", "") + } + return nil +} + +func (b *backend) fileSandbox(ctx context.Context, id, operation string) (*sdk.Sandbox, error) { + instance, err := b.client.Sandboxes.FromID(ctx, id, nil) + if err != nil { + return nil, mapProviderError(err, operation) + } + if instance == nil || instance.Filesystem == nil { + return nil, sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindInvalidResponse, + Provider: "modal", + Operation: operation, + Message: "sandbox-kit modal: SDK returned no filesystem", + }, nil) + } + return instance, nil +} + +func mapFileError(err error, operation, localField string) error { + if err == nil { + return nil + } + var pathError *os.PathError + if localField != "" && errors.As(err, &pathError) { + kind := sandbox.ErrorKindInvalidArgument + if errors.Is(pathError.Err, os.ErrNotExist) { + kind = sandbox.ErrorKindNotFound + } + return sandbox.NewError(&sandbox.ErrorInfo{ + Kind: kind, + Provider: "modal", + Operation: operation, + Field: localField, + Message: err.Error(), + }, err) + } + return mapProviderError(err, operation) +} + +func localSourceFile(path, operation string) error { + info, err := os.Stat(path) + if err != nil { + return localPathError(err, operation) + } + if info.IsDir() { + return localDirectoryError(operation) + } + return nil +} + +// localDestination rejects a path that is already a directory. A missing path +// is left for Modal to create, including missing parents. +func localDestination(path, operation string) error { + info, err := os.Stat(path) + if errors.Is(err, os.ErrNotExist) { + return nil + } + if err != nil { + return localPathError(err, operation) + } + if info.IsDir() { + return localDirectoryError(operation) + } + return nil +} + +func localDirectoryError(operation string) error { + return sandbox.NewError(&sandbox.ErrorInfo{ + Kind: sandbox.ErrorKindInvalidArgument, + Provider: "modal", + Operation: operation, + Field: sandbox.FileFieldLocalPath, + Message: "sandbox-kit modal: local path is a directory", + }, nil) +} + +func localPathError(err error, operation string) error { + kind := sandbox.ErrorKindInvalidArgument + if errors.Is(err, os.ErrNotExist) { + kind = sandbox.ErrorKindNotFound + } + return sandbox.NewError(&sandbox.ErrorInfo{ + Kind: kind, + Provider: "modal", + Operation: operation, + Field: sandbox.FileFieldLocalPath, + Message: err.Error(), + }, err) +} + +func modalFileInfo(info sdk.FileInfo) *sandbox.FileInfo { + kind := sandbox.FileTypeFile + switch info.Type { + case sdk.FileTypeDirectory: + kind = sandbox.FileTypeDirectory + case sdk.FileTypeSymlink: + kind = sandbox.FileTypeSymlink + } + result := &sandbox.FileInfo{ + Name: info.Name, + Path: info.Path, + Type: kind, + Size: info.Size, + Mode: sandbox.Value(fmt.Sprintf("%04o", info.Mode&0o7777)), + } + if info.Permissions != "" { + result.Permissions = sandbox.Value(info.Permissions) + } + if info.Owner != "" { + result.Owner = sandbox.Value(info.Owner) + } + if info.Group != "" { + result.Group = sandbox.Value(info.Group) + } + if target := info.SymlinkTarget; target != nil && *target != "" { + result.SymlinkTarget = target + } + if !math.IsNaN(info.ModifiedTime) && !math.IsInf(info.ModifiedTime, 0) { + whole := int64(info.ModifiedTime) + frac := info.ModifiedTime - float64(whole) + result.ModifiedAt = timestamppb.New(time.Unix(whole, int64(frac*1e9)).UTC()) + } + return result +} diff --git a/sdks/go/providers/modal/filesystem_test.go b/sdks/go/providers/modal/filesystem_test.go new file mode 100644 index 00000000..15e6025e --- /dev/null +++ b/sdks/go/providers/modal/filesystem_test.go @@ -0,0 +1,83 @@ +package modal + +import ( + "errors" + "os" + "path/filepath" + "testing" + + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +func TestMakeDirectoryParams(t *testing.T) { + for _, options := range []*sandbox.MakeDirectoryOptions{ + nil, + {}, + {Parents: sandbox.Value(true)}, + } { + params := makeDirectoryParams(options) + if params == nil || params.CreateParents == nil || !*params.CreateParents { + t.Fatalf("parents true: %#v from %#v", params, options) + } + } + params := makeDirectoryParams(&sandbox.MakeDirectoryOptions{Parents: sandbox.Value(false)}) + if params == nil || params.CreateParents == nil || *params.CreateParents { + t.Fatalf("parents false: %#v", params) + } +} + +func TestLocalSourceFile(t *testing.T) { + dir := t.TempDir() + missing := filepath.Join(dir, "missing.txt") + err := localSourceFile(missing, "copy_from_local") + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindNotFound || detail.Field != sandbox.FileFieldLocalPath || detail.Operation != "copy_from_local" || !errors.Is(err, os.ErrNotExist) { + t.Fatalf("missing file: %#v", err) + } + err = localSourceFile(dir, "copy_from_local") + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindInvalidArgument || detail.Field != sandbox.FileFieldLocalPath { + t.Fatalf("directory: %#v", err) + } + path := filepath.Join(dir, "note.txt") + if err := os.WriteFile(path, []byte("hi"), 0o644); err != nil { + t.Fatal(err) + } + if err := localSourceFile(path, "copy_from_local"); err != nil { + t.Fatal(err) + } +} + +func TestLocalDestination(t *testing.T) { + dir := t.TempDir() + if err := localDestination(filepath.Join(dir, "out.txt"), "copy_to_local"); err != nil { + t.Fatal(err) + } + if err := localDestination(filepath.Join(dir, "missing", "out.txt"), "copy_to_local"); err != nil { + t.Fatal(err) + } + err := localDestination(dir, "copy_to_local") + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindInvalidArgument || detail.Field != sandbox.FileFieldLocalPath || detail.Operation != "copy_to_local" { + t.Fatalf("directory: %#v", err) + } + path := filepath.Join(dir, "out.txt") + if err := os.WriteFile(path, []byte("hi"), 0o644); err != nil { + t.Fatal(err) + } + if err := localDestination(path, "copy_to_local"); err != nil { + t.Fatal(err) + } +} + +func TestMapFileErrorLocalPathOnly(t *testing.T) { + cause := &os.PathError{Op: "open", Path: "/tmp/note.txt", Err: os.ErrNotExist} + err := mapFileError(cause, "copy_from_local", sandbox.FileFieldLocalPath) + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindNotFound || detail.Field != sandbox.FileFieldLocalPath || !errors.Is(err, os.ErrNotExist) { + t.Fatalf("copy path error: %#v", err) + } + err = mapFileError(cause, "read_file", "") + if !errors.As(err, &detail) || detail.Field != "" || detail.Operation != "read_file" { + t.Fatalf("remote path error: %#v", err) + } +} diff --git a/sdks/go/providers/modal/provider_checks.go b/sdks/go/providers/modal/provider_checks.go index 5b181ea1..9c9c8fc6 100644 --- a/sdks/go/providers/modal/provider_checks.go +++ b/sdks/go/providers/modal/provider_checks.go @@ -15,7 +15,7 @@ var providerDomainPattern = regexp.MustCompile(`(?i)^(?:[a-z0-9](?:[a-z0-9-]*[a- // It runs before the native create call. // // Rules are inventoried in specs/providers/modal.yaml checks and kept in sync -// here by hand (no longer emitted). +// here by hand (not emitted). func validateProviderCreate(request *sandbox.CreateOptions) error { if request == nil { return nil diff --git a/sdks/go/sandbox/README.md b/sdks/go/sandbox/README.md index 2ebe2bb2..737b76d1 100644 --- a/sdks/go/sandbox/README.md +++ b/sdks/go/sandbox/README.md @@ -34,6 +34,11 @@ if err != nil { log.Fatal(err) } fmt.Println(instance.ID()) + +files := instance.Filesystem() +if err := files.WriteFile(context.Background(), "/tmp/note.txt", []byte("hello\n"), nil); err != nil { + log.Fatal(err) +} ``` `Create` with a nil request uses the provider default when that default is diff --git a/sdks/go/sandbox/capabilities.go b/sdks/go/sandbox/capabilities.go index fe325c24..8e3fe7b4 100644 --- a/sdks/go/sandbox/capabilities.go +++ b/sdks/go/sandbox/capabilities.go @@ -59,6 +59,28 @@ type SandboxArchiver interface { ArchiveSandbox(context.Context, string, *ArchiveOptions) (*SandboxInfo, error) } +// SandboxFiles performs file operations in a sandbox: read, write, copy to or +// from the caller, make directory, list directory, stat, and remove. +// Daytona and Modal implement it. Use Sandbox.Filesystem. +type SandboxFiles interface { + // ReadFile returns the bytes of one file. + ReadFile(context.Context, string, string, *FileReadOptions) ([]byte, error) + // WriteFile replaces one file with data and creates missing parent directories. + WriteFile(context.Context, string, string, []byte, *FileWriteOptions) error + // CopyFromLocal copies a local file into the sandbox. + CopyFromLocal(context.Context, string, string, string, *FileCopyOptions) error + // CopyToLocal copies a sandbox file onto the caller's disk. + CopyToLocal(context.Context, string, string, string, *FileCopyOptions) error + // MakeDirectory creates a directory. A nil Parents flag is true. Daytona rejects false. + MakeDirectory(context.Context, string, string, *MakeDirectoryOptions) error + // ListDirectory lists the entries in one directory. + ListDirectory(context.Context, string, string, *ListDirectoryOptions) ([]*FileInfo, error) + // Stat returns metadata for one path. + Stat(context.Context, string, string, *StatOptions) (*FileInfo, error) + // Remove deletes a file, or a directory when Recursive is set. + Remove(context.Context, string, string, *RemoveOptions) error +} + // SandboxDeleter deletes a sandbox. // Daytona implements it. Call Sandbox.Delete. Close does not delete the cloud sandbox. type SandboxDeleter interface { diff --git a/sdks/go/sandbox/client_contracts.go b/sdks/go/sandbox/client_contracts.go index b8520e93..2f0edffe 100644 --- a/sdks/go/sandbox/client_contracts.go +++ b/sdks/go/sandbox/client_contracts.go @@ -50,7 +50,8 @@ type ( Scope = sandboxv1.Scope ) -// Duration converts a Go duration into the timeout value used by Config and lifecycle options. +// Duration converts a Go duration into the timeout value used by Config, +// lifecycle options, and Filesystem option messages. func Duration(value time.Duration) *durationpb.Duration { return durationpb.New(value) } diff --git a/sdks/go/sandbox/doc.go b/sdks/go/sandbox/doc.go index db5b7c07..7ed7e601 100644 --- a/sdks/go/sandbox/doc.go +++ b/sdks/go/sandbox/doc.go @@ -5,11 +5,13 @@ // // [Client.Close] and [Sandbox.Close] release local resources. They leave the // cloud sandbox running. Stop, terminate, archive, or delete it with a -// lifecycle method the provider supports. +// lifecycle method the provider supports. Use [Sandbox.Filesystem] for file +// operations. // // When a call fails, use errors.As with [*Error]. Kind is the shared category. // Field names the setting to change, such as "resources.cpu_cores" or "endpoint". -// Compare it with [CreateFieldResourcesCpuCores], [ConfigFieldEndpoint], and the other field constants. +// Compare it with [CreateFieldResourcesCpuCores], [ConfigFieldEndpoint], +// [FileFieldPath], and the other field constants. // // [Client.Create] with a nil request uses Daytona's default snapshot. Modal requires an image. package sandbox diff --git a/sdks/go/sandbox/field_paths.go b/sdks/go/sandbox/field_paths.go index 9cf36ffc..b799198b 100644 --- a/sdks/go/sandbox/field_paths.go +++ b/sdks/go/sandbox/field_paths.go @@ -371,3 +371,12 @@ const InfoFieldTerminal = "terminal" // ResultFieldExitCode is the canonical path "exit_code" on ExitResult. const ResultFieldExitCode = "exit_code" + +// FileFieldPath is the canonical path "path" on a filesystem call. +const FileFieldPath = "path" + +// FileFieldLocalPath is the canonical path "local_path" on a copy between the caller and the sandbox. +const FileFieldLocalPath = "local_path" + +// FileFieldParents is the canonical path "parents" on MakeDirectoryOptions. +const FileFieldParents = "parents" diff --git a/sdks/go/sandbox/filesystem.go b/sdks/go/sandbox/filesystem.go new file mode 100644 index 00000000..84431a72 --- /dev/null +++ b/sdks/go/sandbox/filesystem.go @@ -0,0 +1,211 @@ +package sandbox + +import ( + "context" + "reflect" + "strings" + + "github.com/sandbox-kit/kit/sdks/go/internal/sdk" + "google.golang.org/protobuf/proto" + durationpb "google.golang.org/protobuf/types/known/durationpb" +) + +// Filesystem performs file operations inside one sandbox: read, write, copy to +// or from the caller, make directory, list directory, stat, and remove. +// Obtain it from Sandbox.Filesystem. Paths in the sandbox are absolute. +// A nil timeout inherits Config.Timeout. Explicit zero adds no Kit deadline. +type Filesystem struct { + owner *Sandbox +} + +// Filesystem returns the file operations for this sandbox. +// Methods on a nil handle return ErrorKindFailedPrecondition. +func (s *Sandbox) Filesystem() *Filesystem { + if s == nil { + return &Filesystem{} + } + return &Filesystem{owner: s} +} + +// ReadFile returns the bytes of the file at path. +// path is absolute. A nil context returns ErrorKindInvalidArgument. +func (f *Filesystem) ReadFile(ctx context.Context, path string, options *FileReadOptions) ([]byte, error) { + var data []byte + err := f.call(ctx, "read_file", options.GetTimeout(), path, nil, func(operationContext context.Context, id string) error { + files, err := f.files("read_file") + if err != nil { + return err + } + data, err = files.ReadFile(operationContext, id, path, cloneMessage(options)) + return err + }) + return data, err +} + +// WriteFile replaces the file at path with data and creates missing parent directories. +// path is absolute. A nil context returns ErrorKindInvalidArgument. +func (f *Filesystem) WriteFile(ctx context.Context, path string, data []byte, options *FileWriteOptions) error { + return f.call(ctx, "write_file", options.GetTimeout(), path, nil, func(operationContext context.Context, id string) error { + files, err := f.files("write_file") + if err != nil { + return err + } + return files.WriteFile(operationContext, id, path, data, cloneMessage(options)) + }) +} + +// CopyFromLocal copies the file at localPath into remotePath. +// remotePath is absolute. localPath is a path on the caller's machine. +func (f *Filesystem) CopyFromLocal(ctx context.Context, localPath, remotePath string, options *FileCopyOptions) error { + return f.call(ctx, "copy_from_local", options.GetTimeout(), remotePath, &localPath, func(operationContext context.Context, id string) error { + files, err := f.files("copy_from_local") + if err != nil { + return err + } + return files.CopyFromLocal(operationContext, id, localPath, remotePath, cloneMessage(options)) + }) +} + +// CopyToLocal copies the file at remotePath to localPath. +// remotePath is absolute. localPath is a path on the caller's machine. +// Missing local parent directories are created. An existing local directory is rejected. +func (f *Filesystem) CopyToLocal(ctx context.Context, remotePath, localPath string, options *FileCopyOptions) error { + return f.call(ctx, "copy_to_local", options.GetTimeout(), remotePath, &localPath, func(operationContext context.Context, id string) error { + files, err := f.files("copy_to_local") + if err != nil { + return err + } + return files.CopyToLocal(operationContext, id, remotePath, localPath, cloneMessage(options)) + }) +} + +// MakeDirectory creates the directory at path. +// An omitted Parents flag is true: missing parents are created. Set false with Value. +// Daytona rejects false. +// path is absolute. A nil context returns ErrorKindInvalidArgument. +func (f *Filesystem) MakeDirectory(ctx context.Context, path string, options *MakeDirectoryOptions) error { + return f.call(ctx, "make_directory", options.GetTimeout(), path, nil, func(operationContext context.Context, id string) error { + files, err := f.files("make_directory") + if err != nil { + return err + } + return files.MakeDirectory(operationContext, id, path, cloneMessage(options)) + }) +} + +// ListDirectory lists the entries in the directory at path. +// path is absolute. The result is one directory level. +func (f *Filesystem) ListDirectory(ctx context.Context, path string, options *ListDirectoryOptions) ([]*FileInfo, error) { + var entries []*FileInfo + err := f.call(ctx, "list_directory", options.GetTimeout(), path, nil, func(operationContext context.Context, id string) error { + files, err := f.files("list_directory") + if err != nil { + return err + } + entries, err = files.ListDirectory(operationContext, id, path, cloneMessage(options)) + return err + }) + return entries, err +} + +// Stat returns metadata for path. +// path is absolute. A symlink result describes the symlink. +func (f *Filesystem) Stat(ctx context.Context, path string, options *StatOptions) (*FileInfo, error) { + var info *FileInfo + err := f.call(ctx, "stat", options.GetTimeout(), path, nil, func(operationContext context.Context, id string) error { + files, err := f.files("stat") + if err != nil { + return err + } + info, err = files.Stat(operationContext, id, path, cloneMessage(options)) + return err + }) + if err != nil { + return nil, err + } + return cloneMessage(info), nil +} + +// Remove deletes the file at path. +// path is absolute. Set RemoveOptions.Recursive with Value(true) to delete a +// directory and its contents. An omitted recursive flag removes a file or an +// empty directory. +func (f *Filesystem) Remove(ctx context.Context, path string, options *RemoveOptions) error { + return f.call(ctx, "remove", options.GetTimeout(), path, nil, func(operationContext context.Context, id string) error { + files, err := f.files("remove") + if err != nil { + return err + } + return files.Remove(operationContext, id, path, cloneMessage(options)) + }) +} + +func (f *Filesystem) call(ctx context.Context, operation string, timeout *durationpb.Duration, sandboxPath string, localPath *string, invoke func(context.Context, string) error) error { + owner := f.owner + if owner == nil { + if ctx == nil { + return NewError(&ErrorInfo{Kind: ErrorKindInvalidArgument, Operation: operation, Field: "context", Message: "sandbox-kit: context is required"}, nil) + } + return NewError(&ErrorInfo{Kind: ErrorKindFailedPrecondition, Operation: operation, Message: "sandbox-kit: sandbox handle is not initialized"}, nil) + } + if err := absoluteSandboxPath(owner, operation, sandboxPath); err != nil { + return err + } + if localPath != nil { + if err := callerPath(owner, operation, *localPath); err != nil { + return err + } + } + operationContext, cancel, id, err := owner.operationContext(ctx, operation, sdk.OptionalDuration(timeout)) + if err != nil { + return err + } + defer cancel() + if err := invoke(operationContext, id); err != nil { + return sdk.WithErrorContext(err, owner.ProviderName(), operation) + } + return nil +} + +func (f *Filesystem) files(operation string) (SandboxFiles, error) { + files, ok := f.owner.operations.(SandboxFiles) + if !ok { + return nil, f.owner.unsupported(operation) + } + return files, nil +} + +func absoluteSandboxPath(owner *Sandbox, operation, path string) error { + if path == "" || !strings.HasPrefix(path, "/") || strings.ContainsRune(path, 0) { + return NewError(&ErrorInfo{ + Kind: ErrorKindInvalidArgument, + Provider: owner.ProviderName(), + Operation: operation, + Field: FileFieldPath, + Message: "sandbox-kit: sandbox path must be absolute", + }, nil) + } + return nil +} + +func callerPath(owner *Sandbox, operation, path string) error { + if path == "" || strings.ContainsRune(path, 0) { + return NewError(&ErrorInfo{ + Kind: ErrorKindInvalidArgument, + Provider: owner.ProviderName(), + Operation: operation, + Field: FileFieldLocalPath, + Message: "sandbox-kit: local path is required", + }, nil) + } + return nil +} + +func cloneMessage[T proto.Message](message T) T { + value := reflect.ValueOf(message) + if !value.IsValid() || (value.Kind() == reflect.Pointer && value.IsNil()) { + return message + } + cloned, _ := proto.Clone(message).(T) + return cloned +} diff --git a/sdks/go/sandbox/sandbox.go b/sdks/go/sandbox/sandbox.go index 49393054..db63ad18 100644 --- a/sdks/go/sandbox/sandbox.go +++ b/sdks/go/sandbox/sandbox.go @@ -7,8 +7,9 @@ import ( ) // Sandbox is the handle for one cloud sandbox. -// ID and Info describe it. Lifecycle methods change it. Close does not change -// the cloud sandbox. You can keep using the handle. +// ID and Info describe it. Lifecycle methods change it. Filesystem returns the +// shared file operations. Close does not change the cloud sandbox. You can keep +// using the handle. // // Example: // @@ -93,6 +94,7 @@ func (s *Sandbox) Info() *SandboxInfo { } // Capabilities lists the lifecycle operations this provider implements. +// File operations are not lifecycle capabilities; call Filesystem instead. // Pass a value to Supports, or compare it with LifecycleCapabilityPause and the other capability constants. func (s *Sandbox) Capabilities() []LifecycleCapability { if s == nil || s.operations == nil || s.currentID() == "" { @@ -113,7 +115,8 @@ func (s *Sandbox) currentID() string { return s.info.Id } -// Supports reports whether this provider implements capability. +// Supports reports whether this provider implements a lifecycle capability. +// File operations are checked by calling Filesystem methods, not Supports. func (s *Sandbox) Supports(capability LifecycleCapability) bool { for _, candidate := range s.Capabilities() { if candidate == capability { diff --git a/sdks/go/sandbox/sandbox_data_contracts.go b/sdks/go/sandbox/sandbox_data_contracts.go index 7897a9b2..d6107211 100644 --- a/sdks/go/sandbox/sandbox_data_contracts.go +++ b/sdks/go/sandbox/sandbox_data_contracts.go @@ -120,6 +120,35 @@ type ( // ExitResult is the outcome of Sandbox.Terminate, including the exit code when Wait is set. ExitResult = sandboxv1.ExitResult + // FileInfo is metadata for one file, directory, or symlink. + FileInfo = sandboxv1.FileInfo + + // FileType classifies a FileInfo entry. + FileType = sandboxv1.FileType + + // FileReadOptions sets the timeout for Filesystem.ReadFile. + FileReadOptions = sandboxv1.FileReadOptions + + // FileWriteOptions sets the timeout for Filesystem.WriteFile. + FileWriteOptions = sandboxv1.FileWriteOptions + + // FileCopyOptions sets the timeout for a copy between the caller and the sandbox. + FileCopyOptions = sandboxv1.FileCopyOptions + + // MakeDirectoryOptions sets the timeout and Parents flag for Filesystem.MakeDirectory. + // An omitted Parents flag is true. Set false with Value. Daytona rejects false. + MakeDirectoryOptions = sandboxv1.MakeDirectoryOptions + + // ListDirectoryOptions sets the timeout for Filesystem.ListDirectory. + ListDirectoryOptions = sandboxv1.ListDirectoryOptions + + // StatOptions sets the timeout for Filesystem.Stat. + StatOptions = sandboxv1.StatOptions + + // RemoveOptions sets the timeout and Recursive flag for Filesystem.Remove. + // Set Recursive with Value(true) to remove a directory and its contents. + RemoveOptions = sandboxv1.RemoveOptions + // SandboxInfo is the metadata for one sandbox. // Sandbox.Info returns a copy. State is a SandboxState. SandboxInfo = sandboxv1.SandboxInfo @@ -182,8 +211,8 @@ type ( // SandboxState is the lifecycle state reported on SandboxInfo. SandboxState = sandboxv1.SandboxState - // LifecycleCapability names one operation Sandbox.Supports can check. - // The value means the provider implements that operation. + // LifecycleCapability names one lifecycle operation Sandbox.Supports can check. + // File operations are not lifecycle capabilities; call Filesystem instead. LifecycleCapability = sandboxv1.LifecycleCapability ) @@ -306,6 +335,15 @@ const ( LifecycleCapabilityArchive = sandboxv1.LifecycleCapability_LIFECYCLE_CAPABILITY_ARCHIVE // LifecycleCapabilityDelete means the provider implements Delete. LifecycleCapabilityDelete = sandboxv1.LifecycleCapability_LIFECYCLE_CAPABILITY_DELETE + + // FileTypeUnspecified means the provider did not classify the entry. + FileTypeUnspecified = sandboxv1.FileType_FILE_TYPE_UNSPECIFIED + // FileTypeFile is a regular file. + FileTypeFile = sandboxv1.FileType_FILE_TYPE_FILE + // FileTypeDirectory is a directory. + FileTypeDirectory = sandboxv1.FileType_FILE_TYPE_DIRECTORY + // FileTypeSymlink is a symlink. Stat describes the symlink, not its target. + FileTypeSymlink = sandboxv1.FileType_FILE_TYPE_SYMLINK ) // Value pointers an optional field so the provider can tell a set value from an omitted one. diff --git a/sdks/go/sandbox/tests/filesystem_test.go b/sdks/go/sandbox/tests/filesystem_test.go new file mode 100644 index 00000000..9d7004d3 --- /dev/null +++ b/sdks/go/sandbox/tests/filesystem_test.go @@ -0,0 +1,141 @@ +package sandbox_test + +import ( + "context" + "errors" + "testing" + + "github.com/sandbox-kit/kit/sdks/go/sandbox" +) + +type fileBackend struct { + read func(context.Context, string, string, *sandbox.FileReadOptions) ([]byte, error) +} + +func (*fileBackend) Name() string { return "files" } +func (*fileBackend) Close(context.Context) error { return nil } +func (*fileBackend) CloseSandbox(context.Context, string) error { + return nil +} +func (*fileBackend) Create(context.Context, *sandbox.CreateOptions) (*sandbox.CreateResult, error) { + return &sandbox.CreateResult{Sandbox: &sandbox.SandboxInfo{Id: "created"}}, nil +} +func (b *fileBackend) ReadFile(ctx context.Context, id, path string, options *sandbox.FileReadOptions) ([]byte, error) { + return b.read(ctx, id, path, options) +} +func (*fileBackend) WriteFile(context.Context, string, string, []byte, *sandbox.FileWriteOptions) error { + return nil +} +func (*fileBackend) CopyFromLocal(context.Context, string, string, string, *sandbox.FileCopyOptions) error { + return nil +} +func (*fileBackend) CopyToLocal(context.Context, string, string, string, *sandbox.FileCopyOptions) error { + return nil +} +func (*fileBackend) MakeDirectory(context.Context, string, string, *sandbox.MakeDirectoryOptions) error { + return nil +} +func (*fileBackend) ListDirectory(context.Context, string, string, *sandbox.ListDirectoryOptions) ([]*sandbox.FileInfo, error) { + return nil, nil +} +func (*fileBackend) Stat(context.Context, string, string, *sandbox.StatOptions) (*sandbox.FileInfo, error) { + return &sandbox.FileInfo{}, nil +} +func (*fileBackend) Remove(context.Context, string, string, *sandbox.RemoveOptions) error { + return nil +} + +type fileProvider struct{ backend sandbox.Backend } + +func (*fileProvider) Name() string { return "files" } +func (p *fileProvider) NewClient(*sandbox.Config) (sandbox.Backend, error) { + return p.backend, nil +} + +func TestFilesystemNilHandle(t *testing.T) { + _, err := (*sandbox.Sandbox)(nil).Filesystem().ReadFile(context.Background(), "/tmp/note.txt", nil) + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindFailedPrecondition { + t.Fatalf("unexpected error: %v", err) + } +} + +func TestFilesystemRejectsRelativePathBeforeProvider(t *testing.T) { + calls := 0 + backend := &fileBackend{read: func(context.Context, string, string, *sandbox.FileReadOptions) ([]byte, error) { + calls++ + return nil, nil + }} + client, err := sandbox.NewClient(&fileProvider{backend: backend}, &sandbox.Config{}) + if err != nil { + t.Fatal(err) + } + instance, err := client.Create(context.Background(), nil) + if err != nil { + t.Fatal(err) + } + _, err = instance.Filesystem().ReadFile(context.Background(), "relative.txt", nil) + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindInvalidArgument || detail.Field != sandbox.FileFieldPath || detail.Operation != "read_file" { + t.Fatalf("unexpected error: %v", err) + } + if calls != 0 { + t.Fatal("provider was called for a relative path") + } +} + +func TestFilesystemReadsAbsolutePath(t *testing.T) { + backend := &fileBackend{read: func(_ context.Context, id, path string, _ *sandbox.FileReadOptions) ([]byte, error) { + if id != "created" || path != "/workspace/note.txt" { + t.Fatalf("unexpected read %s %s", id, path) + } + return []byte("hello"), nil + }} + client, err := sandbox.NewClient(&fileProvider{backend: backend}, &sandbox.Config{}) + if err != nil { + t.Fatal(err) + } + instance, err := client.Create(context.Background(), nil) + if err != nil { + t.Fatal(err) + } + data, err := instance.Filesystem().ReadFile(context.Background(), "/workspace/note.txt", nil) + if err != nil { + t.Fatal(err) + } + if string(data) != "hello" { + t.Fatalf("unexpected bytes %q", data) + } +} + +func TestFilesystemCopyRequiresLocalPath(t *testing.T) { + client, err := sandbox.NewClient(&fileProvider{backend: &fileBackend{}}, &sandbox.Config{}) + if err != nil { + t.Fatal(err) + } + instance, err := client.Create(context.Background(), nil) + if err != nil { + t.Fatal(err) + } + err = instance.Filesystem().CopyFromLocal(context.Background(), "", "/workspace/note.txt", nil) + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindInvalidArgument || detail.Field != sandbox.FileFieldLocalPath { + t.Fatalf("unexpected error: %v", err) + } +} + +func TestFilesystemUnsupportedWithoutCapability(t *testing.T) { + client, err := sandbox.NewClient(&lifecycleProvider{backend: &lifecycleBackend{}}, &sandbox.Config{}) + if err != nil { + t.Fatal(err) + } + instance, err := client.Create(context.Background(), nil) + if err != nil { + t.Fatal(err) + } + _, err = instance.Filesystem().Stat(context.Background(), "/workspace", nil) + var detail *sandbox.Error + if !errors.As(err, &detail) || detail.Kind != sandbox.ErrorKindUnsupported || detail.Operation != "stat" { + t.Fatalf("unexpected error: %v", err) + } +} diff --git a/sdks/typescript/contracts/src/kit/sandbox/v1/sandbox_pb.ts b/sdks/typescript/contracts/src/kit/sandbox/v1/sandbox_pb.ts index 4142946b..94c65264 100644 --- a/sdks/typescript/contracts/src/kit/sandbox/v1/sandbox_pb.ts +++ b/sdks/typescript/contracts/src/kit/sandbox/v1/sandbox_pb.ts @@ -13,7 +13,7 @@ import type { Message } from "@bufbuild/protobuf"; * Describes the file kit/sandbox/v1/sandbox.proto. */ export const file_kit_sandbox_v1_sandbox: GenFile = /*@__PURE__*/ - fileDesc("ChxraXQvc2FuZGJveC92MS9zYW5kYm94LnByb3RvEg5raXQuc2FuZGJveC52MSLdBgoNQ3JlYXRlT3B0aW9ucxIRCgRuYW1lGAEgASgJSACIAQESLQoGc291cmNlGAIgASgLMh0ua2l0LnNhbmRib3gudjEuU2FuZGJveFNvdXJjZRIuCgdydW50aW1lGAMgASgLMh0ua2l0LnNhbmRib3gudjEuUnVudGltZUNvbmZpZxIyCglpc29sYXRpb24YBCABKAsyHy5raXQuc2FuZGJveC52MS5Jc29sYXRpb25Db25maWcSLAoJcmVzb3VyY2VzGAUgASgLMhkua2l0LnNhbmRib3gudjEuUmVzb3VyY2VzEiwKCXBsYWNlbWVudBgGIAEoCzIZLmtpdC5zYW5kYm94LnYxLlBsYWNlbWVudBJDCgtlbnZpcm9ubWVudBgHIAMoCzIuLmtpdC5zYW5kYm94LnYxLkNyZWF0ZU9wdGlvbnMuRW52aXJvbm1lbnRFbnRyeRI5CgZsYWJlbHMYCCADKAsyKS5raXQuc2FuZGJveC52MS5DcmVhdGVPcHRpb25zLkxhYmVsc0VudHJ5Ei4KB25ldHdvcmsYCSABKAsyHS5raXQuc2FuZGJveC52MS5OZXR3b3JrQ29uZmlnEjAKCHNlY3VyaXR5GAogASgLMh4ua2l0LnNhbmRib3gudjEuU2VjdXJpdHlDb25maWcSMAoIbGlmZXRpbWUYCyABKAsyHi5raXQuc2FuZGJveC52MS5MaWZldGltZVBvbGljeRJDCgxwcm92aXNpb25pbmcYDCABKAsyIy5raXQuc2FuZGJveC52MS5Qcm92aXNpb25pbmdPcHRpb25zUghjcmVhdGlvbhIxCglyZWFkaW5lc3MYDSABKAsyHi5raXQuc2FuZGJveC52MS5SZWFkaW5lc3NQcm9iZRI6Cg1vYnNlcnZhYmlsaXR5GA4gASgLMiMua2l0LnNhbmRib3gudjEuT2JzZXJ2YWJpbGl0eUNvbmZpZxoyChBFbnZpcm9ubWVudEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaLQoLTGFiZWxzRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIHCgVfbmFtZUoECA8QEFIQcHJvdmlkZXJfb3B0aW9ucyLxAQoNU2FuZGJveFNvdXJjZRJBChBwcm92aWRlcl9kZWZhdWx0GAEgASgLMiUua2l0LnNhbmRib3gudjEuUHJvdmlkZXJEZWZhdWx0U291cmNlSAASLAoFaW1hZ2UYAiABKAsyGy5raXQuc2FuZGJveC52MS5JbWFnZVNvdXJjZUgAEjIKCHNuYXBzaG90GAMgASgLMh4ua2l0LnNhbmRib3gudjEuU25hcHNob3RTb3VyY2VIABIzCgl3YXJtX3Bvb2wYBCABKAsyHi5raXQuc2FuZGJveC52MS5XYXJtUG9vbFNvdXJjZUgAQgYKBGtpbmQiFwoVUHJvdmlkZXJEZWZhdWx0U291cmNlIo4DCgtJbWFnZVNvdXJjZRL+AgoJcmVmZXJlbmNlGAEgASgJQuoCukjmAroBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJ7oBrwIKD2ltYWdlX3JlZmVyZW5jZRIjbXVzdCBiZSBhIGNvbnRhaW5lciBpbWFnZSByZWZlcmVuY2Ua9gF0aGlzLnNpemUoKSA8PSA1MTIgJiYgdGhpcy5tYXRjaGVzKCdeKD86W0EtWmEtejAtOV0oPzpbQS1aYS16MC05Li1dKltBLVphLXowLTldKT8oPzo6WzAtOV0rKT8vKT9bYS16MC05XSsoPzooPzpbLl9dfF9ffC0rKVthLXowLTldKykqKD86L1thLXowLTldKyg/Oig/OlsuX118X198LSspW2EtejAtOV0rKSopKig/OjpbQS1aYS16MC05X11bQS1aYS16MC05Xy4tXXswLDEyN30pPyg/OkBzaGEyNTY6W2EtZkEtRjAtOV17NjR9KT8kJykivwEKDlNuYXBzaG90U291cmNlEkkKCXJlZmVyZW5jZRgBIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnEjQKBGtpbmQYAiABKA4yHC5raXQuc2FuZGJveC52MS5TbmFwc2hvdEtpbmRCCLpIBYIBAhABEhoKDXByb3ZpZGVyX2tpbmQYAyABKAlIAIgBAUIQCg5fcHJvdmlkZXJfa2luZCJbCg5XYXJtUG9vbFNvdXJjZRJJCglyZWZlcmVuY2UYASABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJyLyAwoNUnVudGltZUNvbmZpZxJNCghsYW5ndWFnZRgBIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSACIAQESTAoHdmVyc2lvbhgCIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAGIAQESSQoEdXNlchgDIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAKIAQESVgoRd29ya2luZ19kaXJlY3RvcnkYBCABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJ0gDiAEBEk8KCmVudHJ5cG9pbnQYBSADKAlCO7pIOJIBNSIzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnEhAKA3B0eRgGIAEoCEgEiAEBQgsKCV9sYW5ndWFnZUIKCghfdmVyc2lvbkIHCgVfdXNlckIUChJfd29ya2luZ19kaXJlY3RvcnlCBgoEX3B0eSK0AQoPSXNvbGF0aW9uQ29uZmlnEjUKBGtpbmQYASABKA4yHS5raXQuc2FuZGJveC52MS5Jc29sYXRpb25LaW5kQgi6SAWCAQIQARIaCg1wcm92aWRlcl9raW5kGAIgASgJSACIAQESIgoVbmVzdGVkX3ZpcnR1YWxpemF0aW9uGAMgASgISAGIAQFCEAoOX3Byb3ZpZGVyX2tpbmRCGAoWX25lc3RlZF92aXJ0dWFsaXphdGlvbiKTCwoJUmVzb3VyY2VzEpABCgljcHVfY29yZXMYASABKAFCeLpIdboBOAoGZmluaXRlEg5tdXN0IGJlIGZpbml0ZRoeIXRoaXMuaXNOYW4oKSAmJiAhdGhpcy5pc0luZigpugE3ChFleGNsdXNpdmVfbWluaW11bRIWbXVzdCBiZSBncmVhdGVyIHRoYW4gMBoKdGhpcyA+IDAuMEgAiAEBEokBCg9jcHVfbGltaXRfY29yZXMYAiABKAFCa7pIaLoBOAoGZmluaXRlEg5tdXN0IGJlIGZpbml0ZRoeIXRoaXMuaXNOYW4oKSAmJiAhdGhpcy5pc0luZigpugEqCgdtaW5pbXVtEhJtdXN0IGJlIGF0IGxlYXN0IDAaC3RoaXMgPj0gMC4wSAGIAQESVQoKbWVtb3J5X21pYhgDIAEoBEI8ukg5ugE2ChFleGNsdXNpdmVfbWluaW11bRIWbXVzdCBiZSBncmVhdGVyIHRoYW4gMBoJdGhpcyA+IDB1SAKIAQESHQoQbWVtb3J5X2xpbWl0X21pYhgEIAEoBEgDiAEBElMKCGRpc2tfbWliGAUgASgEQjy6SDm6ATYKEWV4Y2x1c2l2ZV9taW5pbXVtEhZtdXN0IGJlIGdyZWF0ZXIgdGhhbiAwGgl0aGlzID4gMHVIBIgBATrIBrpIxAYazwEKCWNwdV9saW1pdBJFY3B1X2xpbWl0X2NvcmVzIG11c3QgYmUgYXQgbGVhc3QgY3B1X2NvcmVzIHdoZW4gdGhlIGxpbWl0IGlzIHBvc2l0aXZlGnshaGFzKHRoaXMuY3B1X2xpbWl0X2NvcmVzKSB8fCB0aGlzLmNwdV9saW1pdF9jb3JlcyA8PSAwLjAgfHwgIWhhcyh0aGlzLmNwdV9jb3JlcykgfHwgdGhpcy5jcHVfbGltaXRfY29yZXMgPj0gdGhpcy5jcHVfY29yZXMa2AEKDG1lbW9yeV9saW1pdBJHbWVtb3J5X2xpbWl0X21pYiBtdXN0IGJlIGF0IGxlYXN0IG1lbW9yeV9taWIgd2hlbiB0aGUgbGltaXQgaXMgcG9zaXRpdmUafyFoYXModGhpcy5tZW1vcnlfbGltaXRfbWliKSB8fCB0aGlzLm1lbW9yeV9saW1pdF9taWIgPT0gMHUgfHwgIWhhcyh0aGlzLm1lbW9yeV9taWIpIHx8IHRoaXMubWVtb3J5X2xpbWl0X21pYiA+PSB0aGlzLm1lbW9yeV9taWIaxQEKFWNwdV9yZXF1aXJlc19wb3NpdGl2ZRJAYSBwb3NpdGl2ZSBjcHVfbGltaXRfY29yZXMgcmVxdWlyZXMgYSBwb3NpdGl2ZSBjcHVfY29yZXMgcmVxdWVzdBpqIWhhcyh0aGlzLmNwdV9saW1pdF9jb3JlcykgfHwgdGhpcy5jcHVfbGltaXRfY29yZXMgPD0gMC4wIHx8IChoYXModGhpcy5jcHVfY29yZXMpICYmIHRoaXMuY3B1X2NvcmVzID4gMC4wKRrMAQoYbWVtb3J5X3JlcXVpcmVzX3Bvc2l0aXZlEkJhIHBvc2l0aXZlIG1lbW9yeV9saW1pdF9taWIgcmVxdWlyZXMgYSBwb3NpdGl2ZSBtZW1vcnlfbWliIHJlcXVlc3QabCFoYXModGhpcy5tZW1vcnlfbGltaXRfbWliKSB8fCB0aGlzLm1lbW9yeV9saW1pdF9taWIgPT0gMHUgfHwgKGhhcyh0aGlzLm1lbW9yeV9taWIpICYmIHRoaXMubWVtb3J5X21pYiA+IDB1KUIMCgpfY3B1X2NvcmVzQhIKEF9jcHVfbGltaXRfY29yZXNCDQoLX21lbW9yeV9taWJCEwoRX21lbW9yeV9saW1pdF9taWJCCwoJX2Rpc2tfbWliIpcBCglQbGFjZW1lbnQSEgoFY2xvdWQYASABKAlIAIgBARJMCgdyZWdpb25zGAIgAygJQju6SDiSATUiM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJxITCgZ0YXJnZXQYAyABKAlIAYgBAUIICgZfY2xvdWRCCQoHX3RhcmdldCIiCg9TdHJpbmdBbGxvd2xpc3QSDwoHZW50cmllcxgBIAMoCSKXCgoNTmV0d29ya0NvbmZpZxI0CgZlZ3Jlc3MYASABKA4yGi5raXQuc2FuZGJveC52MS5FZ3Jlc3NNb2RlQgi6SAWCAQIQARI3Cg5vdXRib3VuZF9jaWRycxgCIAEoCzIfLmtpdC5zYW5kYm94LnYxLlN0cmluZ0FsbG93bGlzdBI5ChBvdXRib3VuZF9kb21haW5zGAMgASgLMh8ua2l0LnNhbmRib3gudjEuU3RyaW5nQWxsb3dsaXN0EjYKDWluYm91bmRfY2lkcnMYBCABKAsyHy5raXQuc2FuZGJveC52MS5TdHJpbmdBbGxvd2xpc3QSHAoPcHJpdmF0ZV9uZXR3b3JrGAUgASgISACIAQESUwoObGlua2VkX3NhbmRib3gYBiABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJ0gBiAEBElQKD3Byb3h5X3JlZmVyZW5jZRgHIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAKIAQESHwoSb3V0Ym91bmRfcHJveHlfdXJsGAggASgJSAOIAQESGgoNY3VzdG9tX2RvbWFpbhgJIAEoCUgEiAEBEioKBXBvcnRzGAogAygLMhsua2l0LnNhbmRib3gudjEuUG9ydEJpbmRpbmc6jQW6SIkFGqoBCh1yZXN0cmljdGVkX3JlcXVpcmVzX2FsbG93bGlzdBI9cmVzdHJpY3RlZCBlZ3Jlc3MgcmVxdWlyZXMgb3V0Ym91bmRfY2lkcnMgb3Igb3V0Ym91bmRfZG9tYWlucxpKdGhpcy5lZ3Jlc3MgIT0gMyB8fCBoYXModGhpcy5vdXRib3VuZF9jaWRycykgfHwgaGFzKHRoaXMub3V0Ym91bmRfZG9tYWlucykaugIKGWJsb2NrX2FsbF9mb3JiaWRzX25ldHdvcmsSQGJsb2NrLWFsbCBlZ3Jlc3MgZm9yYmlkcyBuZXR3b3JraW5nIGFsbG93bGlzdHMsIGxpbmtzLCBhbmQgcG9ydHMa2gF0aGlzLmVncmVzcyAhPSAyIHx8ICghaGFzKHRoaXMub3V0Ym91bmRfY2lkcnMpICYmICFoYXModGhpcy5vdXRib3VuZF9kb21haW5zKSAmJiAhaGFzKHRoaXMuaW5ib3VuZF9jaWRycykgJiYgIWhhcyh0aGlzLmxpbmtlZF9zYW5kYm94KSAmJiB0aGlzLnBvcnRzLnNpemUoKSA9PSAwICYmICghaGFzKHRoaXMucHJpdmF0ZV9uZXR3b3JrKSB8fCAhdGhpcy5wcml2YXRlX25ldHdvcmspKRqcAQocYWxsb3dfYWxsX2ZvcmJpZHNfYWxsb3dsaXN0cxIsYWxsb3ctYWxsIGVncmVzcyBmb3JiaWRzIG91dGJvdW5kIGFsbG93bGlzdHMaTnRoaXMuZWdyZXNzICE9IDEgfHwgKCFoYXModGhpcy5vdXRib3VuZF9jaWRycykgJiYgIWhhcyh0aGlzLm91dGJvdW5kX2RvbWFpbnMpKUISChBfcHJpdmF0ZV9uZXR3b3JrQhEKD19saW5rZWRfc2FuZGJveEISChBfcHJveHlfcmVmZXJlbmNlQhUKE19vdXRib3VuZF9wcm94eV91cmxCEAoOX2N1c3RvbV9kb21haW4ijwEKC1BvcnRCaW5kaW5nEkQKBHBvcnQYASABKA1CNrpIM7oBMAoHbWF4aW11bRIVbXVzdCBiZSBhdCBtb3N0IDY1NTM1Gg50aGlzIDw9IDY1NTM1dRI6Cgl0cmFuc3BvcnQYAiABKA4yHS5raXQuc2FuZGJveC52MS5Qb3J0VHJhbnNwb3J0Qgi6SAWCAQIQASKmAQoOU2VjdXJpdHlDb25maWcSGgoNcHVibGljX2FjY2VzcxgBIAEoCEgAiAEBEh4KEXdvcmtsb2FkX2lkZW50aXR5GAIgASgISAGIAQESMAoHc2VjcmV0cxgDIAMoCzIfLmtpdC5zYW5kYm94LnYxLlNlY3JldFJlZmVyZW5jZUIQCg5fcHVibGljX2FjY2Vzc0IUChJfd29ya2xvYWRfaWRlbnRpdHkijgIKD1NlY3JldFJlZmVyZW5jZRJJCglyZWZlcmVuY2UYASABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJxJZChRlbnZpcm9ubWVudF92YXJpYWJsZRgCIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSACIAQESPAoJaW5qZWN0aW9uGAMgASgOMh8ua2l0LnNhbmRib3gudjEuU2VjcmV0SW5qZWN0aW9uQgi6SAWCAQIQAUIXChVfZW52aXJvbm1lbnRfdmFyaWFibGUiigMKDkxpZmV0aW1lUG9saWN5Ej0KEG1heGltdW1fbGlmZXRpbWUYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25CCLpIBaoBAjIAEhYKCWVwaGVtZXJhbBgCIAEoCEgAiAEBEjcKDmlkbGVfdGVybWluYXRlGAMgASgLMh8ua2l0LnNhbmRib3gudjEuQXV0b21hdGljQWN0aW9uEjIKCWlkbGVfc3RvcBgEIAEoCzIfLmtpdC5zYW5kYm94LnYxLkF1dG9tYXRpY0FjdGlvbhIzCgppZGxlX3BhdXNlGAUgASgLMh8ua2l0LnNhbmRib3gudjEuQXV0b21hdGljQWN0aW9uEjgKD3N0b3BwZWRfYXJjaGl2ZRgGIAEoCzIfLmtpdC5zYW5kYm94LnYxLkF1dG9tYXRpY0FjdGlvbhI3Cg5zdG9wcGVkX2RlbGV0ZRgHIAEoCzIfLmtpdC5zYW5kYm94LnYxLkF1dG9tYXRpY0FjdGlvbkIMCgpfZXBoZW1lcmFsIr0CCg9BdXRvbWF0aWNBY3Rpb24SMgoEbW9kZRgBIAEoDjIaLmtpdC5zYW5kYm94LnYxLlBvbGljeU1vZGVCCLpIBYIBAhABEjIKBWFmdGVyGAIgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uQgi6SAWqAQIyADrBAbpIvQEaVwoXYWZ0ZXJfcmVxdWlyZXNfZHVyYXRpb24SGW1vZGUgYWZ0ZXIgcmVxdWlyZXMgYWZ0ZXIaIXRoaXMubW9kZSAhPSAyIHx8IGhhcyh0aGlzLmFmdGVyKRpiChZhZnRlcl9mb3JiaWRzX2R1cmF0aW9uEiRhZnRlciBpcyBvbmx5IHNldCB3aGVuIG1vZGUgaXMgYWZ0ZXIaInRoaXMubW9kZSA9PSAyIHx8ICFoYXModGhpcy5hZnRlcikiwgEKE1Byb3Zpc2lvbmluZ09wdGlvbnMSNAoHdGltZW91dBgBIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbkIIukgFqgECMgASOgoNcXVldWVfdGltZW91dBgCIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbkIIukgFqgECMgASOQoId2FpdF9mb3IYAyABKA4yHS5raXQuc2FuZGJveC52MS5XYWl0Q29uZGl0aW9uQgi6SAWCAQIQASLJAQoOUmVhZGluZXNzUHJvYmUSdgoIdGNwX3BvcnQYASABKA1CYrpIX7oBKQoHbWluaW11bRISbXVzdCBiZSBhdCBsZWFzdCAxGgp0aGlzID49IDF1ugEwCgdtYXhpbXVtEhVtdXN0IGJlIGF0IG1vc3QgNjU1MzUaDnRoaXMgPD0gNjU1MzV1SAASLwoHY29tbWFuZBgCIAEoCzIcLmtpdC5zYW5kYm94LnYxLkNvbW1hbmRQcm9iZUgAQg4KBWNoZWNrEgW6SAIIASJlCgxDb21tYW5kUHJvYmUSVQoEYXJndhgBIAMoCUJHukhEugFBCgltaW5faXRlbXMSIm11c3QgY29udGFpbiBhdCBsZWFzdCBvbmUgYXJndW1lbnQaEHRoaXMuc2l6ZSgpID49IDEipwEKE09ic2VydmFiaWxpdHlDb25maWcSFAoHdmVyYm9zZRgBIAEoCEgAiAEBElcKEnRlbGVtZXRyeV9lbmRwb2ludBgCIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAGIAQFCCgoIX3ZlcmJvc2VCFQoTX3RlbGVtZXRyeV9lbmRwb2ludCI8CgxDcmVhdGVSZXN1bHQSLAoHc2FuZGJveBgBIAEoCzIbLmtpdC5zYW5kYm94LnYxLlNhbmRib3hJbmZvIjoKDFN0YXJ0T3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uIlcKC1N0b3BPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SEgoFZm9yY2UYAiABKAhIAIgBAUIICgZfZm9yY2UiOgoMUGF1c2VPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24iWgoQVGVybWluYXRlT3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEhEKBHdhaXQYAiABKAhIAIgBAUIHCgVfd2FpdCI8Cg5BcmNoaXZlT3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uIlcKDURlbGV0ZU9wdGlvbnMSKgoHdGltZW91dBgBIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbhIRCgR3YWl0GAIgASgISACIAQFCBwoFX3dhaXQiMgoKRXhpdFJlc3VsdBIWCglleGl0X2NvZGUYASABKAVIAIgBAUIMCgpfZXhpdF9jb2RlIqwECgtTYW5kYm94SW5mbxIKCgJpZBgBIAEoCRIQCghwcm92aWRlchgCIAEoCRIRCgRuYW1lGAMgASgJSACIAQESGwoOcHJvdmlkZXJfc3RhdGUYBCABKAlIAYgBARITCgZyZWdpb24YBSABKAlIAogBARIyCglpc29sYXRpb24YBiABKAsyHy5raXQuc2FuZGJveC52MS5Jc29sYXRpb25Db25maWcSLAoJcmVzb3VyY2VzGAcgASgLMhkua2l0LnNhbmRib3gudjEuUmVzb3VyY2VzEjcKBmxhYmVscxgIIAMoCzInLmtpdC5zYW5kYm94LnYxLlNhbmRib3hJbmZvLkxhYmVsc0VudHJ5Ei4KCmNyZWF0ZWRfYXQYCSABKAsyGi5nb29nbGUucHJvdG9idWYuVGltZXN0YW1wEjkKEXByb3ZpZGVyX21ldGFkYXRhGAogASgLMh4ua2l0LnNhbmRib3gudjEuTWV0YWRhdGFPYmplY3QSKwoFc3RhdGUYDCABKA4yHC5raXQuc2FuZGJveC52MS5TYW5kYm94U3RhdGUSFQoIdGVybWluYWwYDSABKAhIA4gBARotCgtMYWJlbHNFbnRyeRILCgNrZXkYASABKAkSDQoFdmFsdWUYAiABKAk6AjgBQgcKBV9uYW1lQhEKD19wcm92aWRlcl9zdGF0ZUIJCgdfcmVnaW9uQgsKCV90ZXJtaW5hbEoECAsQDFIHb3JpZ2lucyKfAgoJRXJyb3JJbmZvEicKBGtpbmQYASABKA4yGS5raXQuc2FuZGJveC52MS5FcnJvcktpbmQSEAoIcHJvdmlkZXIYAiABKAkSEQoJb3BlcmF0aW9uGAMgASgJEg0KBWZpZWxkGAQgASgJEg8KB21lc3NhZ2UYBSABKAkSGAoLc3RhdHVzX2NvZGUYBiABKA1IAIgBARIaCg1wcm92aWRlcl9jb2RlGAcgASgJSAGIAQESHAoPcHJvdmlkZXJfc291cmNlGAggASgJSAKIAQESEQoEcnVsZRgJIAEoCUgDiAEBQg4KDF9zdGF0dXNfY29kZUIQCg5fcHJvdmlkZXJfY29kZUISChBfcHJvdmlkZXJfc291cmNlQgcKBV9ydWxlIvUBCg1NZXRhZGF0YVZhbHVlEhEKB2Jvb2xlYW4YASABKAhIABIOCgR0ZXh0GAIgASgJSAASGAoOc2lnbmVkX2ludGVnZXIYAyABKANIABIaChB1bnNpZ25lZF9pbnRlZ2VyGAQgASgESAASEAoGbnVtYmVyGAUgASgBSAASEAoGYmluYXJ5GAYgASgMSAASLAoEbGlzdBgHIAEoCzIcLmtpdC5zYW5kYm94LnYxLk1ldGFkYXRhTGlzdEgAEjAKBm9iamVjdBgIIAEoCzIeLmtpdC5zYW5kYm94LnYxLk1ldGFkYXRhT2JqZWN0SABCBwoFdmFsdWUiPQoMTWV0YWRhdGFMaXN0Ei0KBnZhbHVlcxgBIAMoCzIdLmtpdC5zYW5kYm94LnYxLk1ldGFkYXRhVmFsdWUimgEKDk1ldGFkYXRhT2JqZWN0EjoKBnZhbHVlcxgBIAMoCzIqLmtpdC5zYW5kYm94LnYxLk1ldGFkYXRhT2JqZWN0LlZhbHVlc0VudHJ5GkwKC1ZhbHVlc0VudHJ5EgsKA2tleRgBIAEoCRIsCgV2YWx1ZRgCIAEoCzIdLmtpdC5zYW5kYm94LnYxLk1ldGFkYXRhVmFsdWU6AjgBKtgBCgxTbmFwc2hvdEtpbmQSGQoVU05BUFNIT1RfS0lORF9ERUZBVUxUEAASHAoYU05BUFNIT1RfS0lORF9GSUxFU1lTVEVNEAESGAoUU05BUFNIT1RfS0lORF9NRU1PUlkQAhIXChNTTkFQU0hPVF9LSU5EX0lNQUdFEAMSGQoVU05BUFNIT1RfS0lORF9NQUNISU5FEAQSHAoYU05BUFNIT1RfS0lORF9DSEVDS1BPSU5UEAUSIwofU05BUFNIT1RfS0lORF9QUk9WSURFUl9TUEVDSUZJQxAGKsMBCg1Jc29sYXRpb25LaW5kEhoKFklTT0xBVElPTl9LSU5EX0RFRkFVTFQQABIcChhJU09MQVRJT05fS0lORF9DT05UQUlORVIQARIaChZJU09MQVRJT05fS0lORF9NSUNST1ZNEAISGwoXSVNPTEFUSU9OX0tJTkRfTElOVVhfVk0QAxIZChVJU09MQVRJT05fS0lORF9XT1JLRVIQBBIkCiBJU09MQVRJT05fS0lORF9QUk9WSURFUl9TUEVDSUZJQxAFKncKCkVncmVzc01vZGUSFwoTRUdSRVNTX01PREVfREVGQVVMVBAAEhkKFUVHUkVTU19NT0RFX0FMTE9XX0FMTBABEhkKFUVHUkVTU19NT0RFX0JMT0NLX0FMTBACEhoKFkVHUkVTU19NT0RFX1JFU1RSSUNURUQQAyp7Cg1Qb3J0VHJhbnNwb3J0EhoKFlBPUlRfVFJBTlNQT1JUX0RFRkFVTFQQABIWChJQT1JUX1RSQU5TUE9SVF9UTFMQARIcChhQT1JUX1RSQU5TUE9SVF9IVFRQMl9UTFMQAhIYChRQT1JUX1RSQU5TUE9SVF9QTEFJThADKnoKD1NlY3JldEluamVjdGlvbhIcChhTRUNSRVRfSU5KRUNUSU9OX0RFRkFVTFQQABIgChxTRUNSRVRfSU5KRUNUSU9OX0VOVklST05NRU5UEAESJwojU0VDUkVUX0lOSkVDVElPTl9FR1JFU1NfUExBQ0VIT0xERVIQAipWCgpQb2xpY3lNb2RlEhcKE1BPTElDWV9NT0RFX0RFRkFVTFQQABIYChRQT0xJQ1lfTU9ERV9ESVNBQkxFRBABEhUKEVBPTElDWV9NT0RFX0FGVEVSEAIqnQEKDVdhaXRDb25kaXRpb24SGgoWV0FJVF9DT05ESVRJT05fREVGQVVMVBAAEhwKGFdBSVRfQ09ORElUSU9OX1NVQk1JVFRFRBABEhwKGFdBSVRfQ09ORElUSU9OX1NDSEVEVUxFRBACEhoKFldBSVRfQ09ORElUSU9OX1NUQVJURUQQAxIYChRXQUlUX0NPTkRJVElPTl9SRUFEWRAEKqwDCgxTYW5kYm94U3RhdGUSGQoVU0FOREJPWF9TVEFURV9VTktOT1dOEAASGAoUU0FOREJPWF9TVEFURV9RVUVVRUQQARIaChZTQU5EQk9YX1NUQVRFX1NUQVJUSU5HEAISGQoVU0FOREJPWF9TVEFURV9SVU5OSU5HEAMSGgoWU0FOREJPWF9TVEFURV9TVE9QUElORxAEEhkKFVNBTkRCT1hfU1RBVEVfU1RPUFBFRBAFEhkKFVNBTkRCT1hfU1RBVEVfUEFVU0lORxAGEhgKFFNBTkRCT1hfU1RBVEVfUEFVU0VEEAcSGwoXU0FOREJPWF9TVEFURV9BUkNISVZJTkcQCBIaChZTQU5EQk9YX1NUQVRFX0FSQ0hJVkVEEAkSHQoZU0FOREJPWF9TVEFURV9URVJNSU5BVElORxAKEhwKGFNBTkRCT1hfU1RBVEVfVEVSTUlOQVRFRBALEhoKFlNBTkRCT1hfU1RBVEVfREVMRVRJTkcQDBIZChVTQU5EQk9YX1NUQVRFX0RFTEVURUQQDRIXChNTQU5EQk9YX1NUQVRFX0VSUk9SEA4qnwIKE0xpZmVjeWNsZUNhcGFiaWxpdHkSIAocTElGRUNZQ0xFX0NBUEFCSUxJVFlfVU5LTk9XThAAEiAKHExJRkVDWUNMRV9DQVBBQklMSVRZX1JFRlJFU0gQARIeChpMSUZFQ1lDTEVfQ0FQQUJJTElUWV9TVEFSVBACEh0KGUxJRkVDWUNMRV9DQVBBQklMSVRZX1NUT1AQAxIeChpMSUZFQ1lDTEVfQ0FQQUJJTElUWV9QQVVTRRAEEiIKHkxJRkVDWUNMRV9DQVBBQklMSVRZX1RFUk1JTkFURRAFEiAKHExJRkVDWUNMRV9DQVBBQklMSVRZX0FSQ0hJVkUQBhIfChtMSUZFQ1lDTEVfQ0FQQUJJTElUWV9ERUxFVEUQByreAwoJRXJyb3JLaW5kEhYKEkVSUk9SX0tJTkRfVU5LTk9XThAAEh8KG0VSUk9SX0tJTkRfSU5WQUxJRF9BUkdVTUVOVBABEhoKFkVSUk9SX0tJTkRfVU5TVVBQT1JURUQQAhIdChlFUlJPUl9LSU5EX0FVVEhFTlRJQ0FUSU9OEAMSIAocRVJST1JfS0lORF9QRVJNSVNTSU9OX0RFTklFRBAEEhgKFEVSUk9SX0tJTkRfTk9UX0ZPVU5EEAUSHQoZRVJST1JfS0lORF9BTFJFQURZX0VYSVNUUxAGEhcKE0VSUk9SX0tJTkRfQ09ORkxJQ1QQBxIbChdFUlJPUl9LSU5EX1JBVEVfTElNSVRFRBAIEiEKHUVSUk9SX0tJTkRfUkVTT1VSQ0VfRVhIQVVTVEVEEAkSFgoSRVJST1JfS0lORF9USU1FT1VUEAoSFwoTRVJST1JfS0lORF9DQU5DRUxFRBALEhoKFkVSUk9SX0tJTkRfVU5BVkFJTEFCTEUQDBIfChtFUlJPUl9LSU5EX0lOVkFMSURfUkVTUE9OU0UQDRIXChNFUlJPUl9LSU5EX0lOVEVSTkFMEA4SIgoeRVJST1JfS0lORF9GQUlMRURfUFJFQ09ORElUSU9OEA9CUFpOZ2l0aHViLmNvbS9zYW5kYm94LWtpdC9raXQvc2Rrcy9nby9pbnRlcm5hbC9jb250cmFjdHMva2l0L3NhbmRib3gvdjE7c2FuZGJveHYxYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_duration, file_google_protobuf_timestamp]); + fileDesc("ChxraXQvc2FuZGJveC92MS9zYW5kYm94LnByb3RvEg5raXQuc2FuZGJveC52MSLdBgoNQ3JlYXRlT3B0aW9ucxIRCgRuYW1lGAEgASgJSACIAQESLQoGc291cmNlGAIgASgLMh0ua2l0LnNhbmRib3gudjEuU2FuZGJveFNvdXJjZRIuCgdydW50aW1lGAMgASgLMh0ua2l0LnNhbmRib3gudjEuUnVudGltZUNvbmZpZxIyCglpc29sYXRpb24YBCABKAsyHy5raXQuc2FuZGJveC52MS5Jc29sYXRpb25Db25maWcSLAoJcmVzb3VyY2VzGAUgASgLMhkua2l0LnNhbmRib3gudjEuUmVzb3VyY2VzEiwKCXBsYWNlbWVudBgGIAEoCzIZLmtpdC5zYW5kYm94LnYxLlBsYWNlbWVudBJDCgtlbnZpcm9ubWVudBgHIAMoCzIuLmtpdC5zYW5kYm94LnYxLkNyZWF0ZU9wdGlvbnMuRW52aXJvbm1lbnRFbnRyeRI5CgZsYWJlbHMYCCADKAsyKS5raXQuc2FuZGJveC52MS5DcmVhdGVPcHRpb25zLkxhYmVsc0VudHJ5Ei4KB25ldHdvcmsYCSABKAsyHS5raXQuc2FuZGJveC52MS5OZXR3b3JrQ29uZmlnEjAKCHNlY3VyaXR5GAogASgLMh4ua2l0LnNhbmRib3gudjEuU2VjdXJpdHlDb25maWcSMAoIbGlmZXRpbWUYCyABKAsyHi5raXQuc2FuZGJveC52MS5MaWZldGltZVBvbGljeRJDCgxwcm92aXNpb25pbmcYDCABKAsyIy5raXQuc2FuZGJveC52MS5Qcm92aXNpb25pbmdPcHRpb25zUghjcmVhdGlvbhIxCglyZWFkaW5lc3MYDSABKAsyHi5raXQuc2FuZGJveC52MS5SZWFkaW5lc3NQcm9iZRI6Cg1vYnNlcnZhYmlsaXR5GA4gASgLMiMua2l0LnNhbmRib3gudjEuT2JzZXJ2YWJpbGl0eUNvbmZpZxoyChBFbnZpcm9ubWVudEVudHJ5EgsKA2tleRgBIAEoCRINCgV2YWx1ZRgCIAEoCToCOAEaLQoLTGFiZWxzRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIHCgVfbmFtZUoECA8QEFIQcHJvdmlkZXJfb3B0aW9ucyLxAQoNU2FuZGJveFNvdXJjZRJBChBwcm92aWRlcl9kZWZhdWx0GAEgASgLMiUua2l0LnNhbmRib3gudjEuUHJvdmlkZXJEZWZhdWx0U291cmNlSAASLAoFaW1hZ2UYAiABKAsyGy5raXQuc2FuZGJveC52MS5JbWFnZVNvdXJjZUgAEjIKCHNuYXBzaG90GAMgASgLMh4ua2l0LnNhbmRib3gudjEuU25hcHNob3RTb3VyY2VIABIzCgl3YXJtX3Bvb2wYBCABKAsyHi5raXQuc2FuZGJveC52MS5XYXJtUG9vbFNvdXJjZUgAQgYKBGtpbmQiFwoVUHJvdmlkZXJEZWZhdWx0U291cmNlIo4DCgtJbWFnZVNvdXJjZRL+AgoJcmVmZXJlbmNlGAEgASgJQuoCukjmAroBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJ7oBrwIKD2ltYWdlX3JlZmVyZW5jZRIjbXVzdCBiZSBhIGNvbnRhaW5lciBpbWFnZSByZWZlcmVuY2Ua9gF0aGlzLnNpemUoKSA8PSA1MTIgJiYgdGhpcy5tYXRjaGVzKCdeKD86W0EtWmEtejAtOV0oPzpbQS1aYS16MC05Li1dKltBLVphLXowLTldKT8oPzo6WzAtOV0rKT8vKT9bYS16MC05XSsoPzooPzpbLl9dfF9ffC0rKVthLXowLTldKykqKD86L1thLXowLTldKyg/Oig/OlsuX118X198LSspW2EtejAtOV0rKSopKig/OjpbQS1aYS16MC05X11bQS1aYS16MC05Xy4tXXswLDEyN30pPyg/OkBzaGEyNTY6W2EtZkEtRjAtOV17NjR9KT8kJykivwEKDlNuYXBzaG90U291cmNlEkkKCXJlZmVyZW5jZRgBIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnEjQKBGtpbmQYAiABKA4yHC5raXQuc2FuZGJveC52MS5TbmFwc2hvdEtpbmRCCLpIBYIBAhABEhoKDXByb3ZpZGVyX2tpbmQYAyABKAlIAIgBAUIQCg5fcHJvdmlkZXJfa2luZCJbCg5XYXJtUG9vbFNvdXJjZRJJCglyZWZlcmVuY2UYASABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJyLyAwoNUnVudGltZUNvbmZpZxJNCghsYW5ndWFnZRgBIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSACIAQESTAoHdmVyc2lvbhgCIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAGIAQESSQoEdXNlchgDIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAKIAQESVgoRd29ya2luZ19kaXJlY3RvcnkYBCABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJ0gDiAEBEk8KCmVudHJ5cG9pbnQYBSADKAlCO7pIOJIBNSIzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnEhAKA3B0eRgGIAEoCEgEiAEBQgsKCV9sYW5ndWFnZUIKCghfdmVyc2lvbkIHCgVfdXNlckIUChJfd29ya2luZ19kaXJlY3RvcnlCBgoEX3B0eSK0AQoPSXNvbGF0aW9uQ29uZmlnEjUKBGtpbmQYASABKA4yHS5raXQuc2FuZGJveC52MS5Jc29sYXRpb25LaW5kQgi6SAWCAQIQARIaCg1wcm92aWRlcl9raW5kGAIgASgJSACIAQESIgoVbmVzdGVkX3ZpcnR1YWxpemF0aW9uGAMgASgISAGIAQFCEAoOX3Byb3ZpZGVyX2tpbmRCGAoWX25lc3RlZF92aXJ0dWFsaXphdGlvbiKTCwoJUmVzb3VyY2VzEpABCgljcHVfY29yZXMYASABKAFCeLpIdboBOAoGZmluaXRlEg5tdXN0IGJlIGZpbml0ZRoeIXRoaXMuaXNOYW4oKSAmJiAhdGhpcy5pc0luZigpugE3ChFleGNsdXNpdmVfbWluaW11bRIWbXVzdCBiZSBncmVhdGVyIHRoYW4gMBoKdGhpcyA+IDAuMEgAiAEBEokBCg9jcHVfbGltaXRfY29yZXMYAiABKAFCa7pIaLoBOAoGZmluaXRlEg5tdXN0IGJlIGZpbml0ZRoeIXRoaXMuaXNOYW4oKSAmJiAhdGhpcy5pc0luZigpugEqCgdtaW5pbXVtEhJtdXN0IGJlIGF0IGxlYXN0IDAaC3RoaXMgPj0gMC4wSAGIAQESVQoKbWVtb3J5X21pYhgDIAEoBEI8ukg5ugE2ChFleGNsdXNpdmVfbWluaW11bRIWbXVzdCBiZSBncmVhdGVyIHRoYW4gMBoJdGhpcyA+IDB1SAKIAQESHQoQbWVtb3J5X2xpbWl0X21pYhgEIAEoBEgDiAEBElMKCGRpc2tfbWliGAUgASgEQjy6SDm6ATYKEWV4Y2x1c2l2ZV9taW5pbXVtEhZtdXN0IGJlIGdyZWF0ZXIgdGhhbiAwGgl0aGlzID4gMHVIBIgBATrIBrpIxAYazwEKCWNwdV9saW1pdBJFY3B1X2xpbWl0X2NvcmVzIG11c3QgYmUgYXQgbGVhc3QgY3B1X2NvcmVzIHdoZW4gdGhlIGxpbWl0IGlzIHBvc2l0aXZlGnshaGFzKHRoaXMuY3B1X2xpbWl0X2NvcmVzKSB8fCB0aGlzLmNwdV9saW1pdF9jb3JlcyA8PSAwLjAgfHwgIWhhcyh0aGlzLmNwdV9jb3JlcykgfHwgdGhpcy5jcHVfbGltaXRfY29yZXMgPj0gdGhpcy5jcHVfY29yZXMa2AEKDG1lbW9yeV9saW1pdBJHbWVtb3J5X2xpbWl0X21pYiBtdXN0IGJlIGF0IGxlYXN0IG1lbW9yeV9taWIgd2hlbiB0aGUgbGltaXQgaXMgcG9zaXRpdmUafyFoYXModGhpcy5tZW1vcnlfbGltaXRfbWliKSB8fCB0aGlzLm1lbW9yeV9saW1pdF9taWIgPT0gMHUgfHwgIWhhcyh0aGlzLm1lbW9yeV9taWIpIHx8IHRoaXMubWVtb3J5X2xpbWl0X21pYiA+PSB0aGlzLm1lbW9yeV9taWIaxQEKFWNwdV9yZXF1aXJlc19wb3NpdGl2ZRJAYSBwb3NpdGl2ZSBjcHVfbGltaXRfY29yZXMgcmVxdWlyZXMgYSBwb3NpdGl2ZSBjcHVfY29yZXMgcmVxdWVzdBpqIWhhcyh0aGlzLmNwdV9saW1pdF9jb3JlcykgfHwgdGhpcy5jcHVfbGltaXRfY29yZXMgPD0gMC4wIHx8IChoYXModGhpcy5jcHVfY29yZXMpICYmIHRoaXMuY3B1X2NvcmVzID4gMC4wKRrMAQoYbWVtb3J5X3JlcXVpcmVzX3Bvc2l0aXZlEkJhIHBvc2l0aXZlIG1lbW9yeV9saW1pdF9taWIgcmVxdWlyZXMgYSBwb3NpdGl2ZSBtZW1vcnlfbWliIHJlcXVlc3QabCFoYXModGhpcy5tZW1vcnlfbGltaXRfbWliKSB8fCB0aGlzLm1lbW9yeV9saW1pdF9taWIgPT0gMHUgfHwgKGhhcyh0aGlzLm1lbW9yeV9taWIpICYmIHRoaXMubWVtb3J5X21pYiA+IDB1KUIMCgpfY3B1X2NvcmVzQhIKEF9jcHVfbGltaXRfY29yZXNCDQoLX21lbW9yeV9taWJCEwoRX21lbW9yeV9saW1pdF9taWJCCwoJX2Rpc2tfbWliIpcBCglQbGFjZW1lbnQSEgoFY2xvdWQYASABKAlIAIgBARJMCgdyZWdpb25zGAIgAygJQju6SDiSATUiM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJxITCgZ0YXJnZXQYAyABKAlIAYgBAUIICgZfY2xvdWRCCQoHX3RhcmdldCIiCg9TdHJpbmdBbGxvd2xpc3QSDwoHZW50cmllcxgBIAMoCSKXCgoNTmV0d29ya0NvbmZpZxI0CgZlZ3Jlc3MYASABKA4yGi5raXQuc2FuZGJveC52MS5FZ3Jlc3NNb2RlQgi6SAWCAQIQARI3Cg5vdXRib3VuZF9jaWRycxgCIAEoCzIfLmtpdC5zYW5kYm94LnYxLlN0cmluZ0FsbG93bGlzdBI5ChBvdXRib3VuZF9kb21haW5zGAMgASgLMh8ua2l0LnNhbmRib3gudjEuU3RyaW5nQWxsb3dsaXN0EjYKDWluYm91bmRfY2lkcnMYBCABKAsyHy5raXQuc2FuZGJveC52MS5TdHJpbmdBbGxvd2xpc3QSHAoPcHJpdmF0ZV9uZXR3b3JrGAUgASgISACIAQESUwoObGlua2VkX3NhbmRib3gYBiABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJ0gBiAEBElQKD3Byb3h5X3JlZmVyZW5jZRgHIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAKIAQESHwoSb3V0Ym91bmRfcHJveHlfdXJsGAggASgJSAOIAQESGgoNY3VzdG9tX2RvbWFpbhgJIAEoCUgEiAEBEioKBXBvcnRzGAogAygLMhsua2l0LnNhbmRib3gudjEuUG9ydEJpbmRpbmc6jQW6SIkFGqoBCh1yZXN0cmljdGVkX3JlcXVpcmVzX2FsbG93bGlzdBI9cmVzdHJpY3RlZCBlZ3Jlc3MgcmVxdWlyZXMgb3V0Ym91bmRfY2lkcnMgb3Igb3V0Ym91bmRfZG9tYWlucxpKdGhpcy5lZ3Jlc3MgIT0gMyB8fCBoYXModGhpcy5vdXRib3VuZF9jaWRycykgfHwgaGFzKHRoaXMub3V0Ym91bmRfZG9tYWlucykaugIKGWJsb2NrX2FsbF9mb3JiaWRzX25ldHdvcmsSQGJsb2NrLWFsbCBlZ3Jlc3MgZm9yYmlkcyBuZXR3b3JraW5nIGFsbG93bGlzdHMsIGxpbmtzLCBhbmQgcG9ydHMa2gF0aGlzLmVncmVzcyAhPSAyIHx8ICghaGFzKHRoaXMub3V0Ym91bmRfY2lkcnMpICYmICFoYXModGhpcy5vdXRib3VuZF9kb21haW5zKSAmJiAhaGFzKHRoaXMuaW5ib3VuZF9jaWRycykgJiYgIWhhcyh0aGlzLmxpbmtlZF9zYW5kYm94KSAmJiB0aGlzLnBvcnRzLnNpemUoKSA9PSAwICYmICghaGFzKHRoaXMucHJpdmF0ZV9uZXR3b3JrKSB8fCAhdGhpcy5wcml2YXRlX25ldHdvcmspKRqcAQocYWxsb3dfYWxsX2ZvcmJpZHNfYWxsb3dsaXN0cxIsYWxsb3ctYWxsIGVncmVzcyBmb3JiaWRzIG91dGJvdW5kIGFsbG93bGlzdHMaTnRoaXMuZWdyZXNzICE9IDEgfHwgKCFoYXModGhpcy5vdXRib3VuZF9jaWRycykgJiYgIWhhcyh0aGlzLm91dGJvdW5kX2RvbWFpbnMpKUISChBfcHJpdmF0ZV9uZXR3b3JrQhEKD19saW5rZWRfc2FuZGJveEISChBfcHJveHlfcmVmZXJlbmNlQhUKE19vdXRib3VuZF9wcm94eV91cmxCEAoOX2N1c3RvbV9kb21haW4ijwEKC1BvcnRCaW5kaW5nEkQKBHBvcnQYASABKA1CNrpIM7oBMAoHbWF4aW11bRIVbXVzdCBiZSBhdCBtb3N0IDY1NTM1Gg50aGlzIDw9IDY1NTM1dRI6Cgl0cmFuc3BvcnQYAiABKA4yHS5raXQuc2FuZGJveC52MS5Qb3J0VHJhbnNwb3J0Qgi6SAWCAQIQASKmAQoOU2VjdXJpdHlDb25maWcSGgoNcHVibGljX2FjY2VzcxgBIAEoCEgAiAEBEh4KEXdvcmtsb2FkX2lkZW50aXR5GAIgASgISAGIAQESMAoHc2VjcmV0cxgDIAMoCzIfLmtpdC5zYW5kYm94LnYxLlNlY3JldFJlZmVyZW5jZUIQCg5fcHVibGljX2FjY2Vzc0IUChJfd29ya2xvYWRfaWRlbnRpdHkijgIKD1NlY3JldFJlZmVyZW5jZRJJCglyZWZlcmVuY2UYASABKAlCNrpIM7oBMAoIbm9uYmxhbmsSEW11c3Qgbm90IGJlIGJsYW5rGhF0aGlzLnRyaW0oKSAhPSAnJxJZChRlbnZpcm9ubWVudF92YXJpYWJsZRgCIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSACIAQESPAoJaW5qZWN0aW9uGAMgASgOMh8ua2l0LnNhbmRib3gudjEuU2VjcmV0SW5qZWN0aW9uQgi6SAWCAQIQAUIXChVfZW52aXJvbm1lbnRfdmFyaWFibGUiigMKDkxpZmV0aW1lUG9saWN5Ej0KEG1heGltdW1fbGlmZXRpbWUYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb25CCLpIBaoBAjIAEhYKCWVwaGVtZXJhbBgCIAEoCEgAiAEBEjcKDmlkbGVfdGVybWluYXRlGAMgASgLMh8ua2l0LnNhbmRib3gudjEuQXV0b21hdGljQWN0aW9uEjIKCWlkbGVfc3RvcBgEIAEoCzIfLmtpdC5zYW5kYm94LnYxLkF1dG9tYXRpY0FjdGlvbhIzCgppZGxlX3BhdXNlGAUgASgLMh8ua2l0LnNhbmRib3gudjEuQXV0b21hdGljQWN0aW9uEjgKD3N0b3BwZWRfYXJjaGl2ZRgGIAEoCzIfLmtpdC5zYW5kYm94LnYxLkF1dG9tYXRpY0FjdGlvbhI3Cg5zdG9wcGVkX2RlbGV0ZRgHIAEoCzIfLmtpdC5zYW5kYm94LnYxLkF1dG9tYXRpY0FjdGlvbkIMCgpfZXBoZW1lcmFsIr0CCg9BdXRvbWF0aWNBY3Rpb24SMgoEbW9kZRgBIAEoDjIaLmtpdC5zYW5kYm94LnYxLlBvbGljeU1vZGVCCLpIBYIBAhABEjIKBWFmdGVyGAIgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uQgi6SAWqAQIyADrBAbpIvQEaVwoXYWZ0ZXJfcmVxdWlyZXNfZHVyYXRpb24SGW1vZGUgYWZ0ZXIgcmVxdWlyZXMgYWZ0ZXIaIXRoaXMubW9kZSAhPSAyIHx8IGhhcyh0aGlzLmFmdGVyKRpiChZhZnRlcl9mb3JiaWRzX2R1cmF0aW9uEiRhZnRlciBpcyBvbmx5IHNldCB3aGVuIG1vZGUgaXMgYWZ0ZXIaInRoaXMubW9kZSA9PSAyIHx8ICFoYXModGhpcy5hZnRlcikiwgEKE1Byb3Zpc2lvbmluZ09wdGlvbnMSNAoHdGltZW91dBgBIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbkIIukgFqgECMgASOgoNcXVldWVfdGltZW91dBgCIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbkIIukgFqgECMgASOQoId2FpdF9mb3IYAyABKA4yHS5raXQuc2FuZGJveC52MS5XYWl0Q29uZGl0aW9uQgi6SAWCAQIQASLJAQoOUmVhZGluZXNzUHJvYmUSdgoIdGNwX3BvcnQYASABKA1CYrpIX7oBKQoHbWluaW11bRISbXVzdCBiZSBhdCBsZWFzdCAxGgp0aGlzID49IDF1ugEwCgdtYXhpbXVtEhVtdXN0IGJlIGF0IG1vc3QgNjU1MzUaDnRoaXMgPD0gNjU1MzV1SAASLwoHY29tbWFuZBgCIAEoCzIcLmtpdC5zYW5kYm94LnYxLkNvbW1hbmRQcm9iZUgAQg4KBWNoZWNrEgW6SAIIASJlCgxDb21tYW5kUHJvYmUSVQoEYXJndhgBIAMoCUJHukhEugFBCgltaW5faXRlbXMSIm11c3QgY29udGFpbiBhdCBsZWFzdCBvbmUgYXJndW1lbnQaEHRoaXMuc2l6ZSgpID49IDEipwEKE09ic2VydmFiaWxpdHlDb25maWcSFAoHdmVyYm9zZRgBIAEoCEgAiAEBElcKEnRlbGVtZXRyeV9lbmRwb2ludBgCIAEoCUI2ukgzugEwCghub25ibGFuaxIRbXVzdCBub3QgYmUgYmxhbmsaEXRoaXMudHJpbSgpICE9ICcnSAGIAQFCCgoIX3ZlcmJvc2VCFQoTX3RlbGVtZXRyeV9lbmRwb2ludCI8CgxDcmVhdGVSZXN1bHQSLAoHc2FuZGJveBgBIAEoCzIbLmtpdC5zYW5kYm94LnYxLlNhbmRib3hJbmZvIjoKDFN0YXJ0T3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uIlcKC1N0b3BPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SEgoFZm9yY2UYAiABKAhIAIgBAUIICgZfZm9yY2UiOgoMUGF1c2VPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24iWgoQVGVybWluYXRlT3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uEhEKBHdhaXQYAiABKAhIAIgBAUIHCgVfd2FpdCI8Cg5BcmNoaXZlT3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uIlcKDURlbGV0ZU9wdGlvbnMSKgoHdGltZW91dBgBIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbhIRCgR3YWl0GAIgASgISACIAQFCBwoFX3dhaXQiMgoKRXhpdFJlc3VsdBIWCglleGl0X2NvZGUYASABKAVIAIgBAUIMCgpfZXhpdF9jb2RlIskCCghGaWxlSW5mbxIMCgRuYW1lGAEgASgJEgwKBHBhdGgYAiABKAkSMAoEdHlwZRgDIAEoDjIYLmtpdC5zYW5kYm94LnYxLkZpbGVUeXBlQgi6SAWCAQIQARIMCgRzaXplGAQgASgDEhEKBG1vZGUYBSABKAlIAIgBARIYCgtwZXJtaXNzaW9ucxgGIAEoCUgBiAEBEhIKBW93bmVyGAcgASgJSAKIAQESEgoFZ3JvdXAYCCABKAlIA4gBARIvCgttb2RpZmllZF9hdBgJIAEoCzIaLmdvb2dsZS5wcm90b2J1Zi5UaW1lc3RhbXASGwoOc3ltbGlua190YXJnZXQYCiABKAlIBIgBAUIHCgVfbW9kZUIOCgxfcGVybWlzc2lvbnNCCAoGX293bmVyQggKBl9ncm91cEIRCg9fc3ltbGlua190YXJnZXQiPQoPRmlsZVJlYWRPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24iPgoQRmlsZVdyaXRlT3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uIj0KD0ZpbGVDb3B5T3B0aW9ucxIqCgd0aW1lb3V0GAEgASgLMhkuZ29vZ2xlLnByb3RvYnVmLkR1cmF0aW9uImQKFE1ha2VEaXJlY3RvcnlPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SFAoHcGFyZW50cxgCIAEoCEgAiAEBQgoKCF9wYXJlbnRzIkIKFExpc3REaXJlY3RvcnlPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24iOQoLU3RhdE9wdGlvbnMSKgoHdGltZW91dBgBIAEoCzIZLmdvb2dsZS5wcm90b2J1Zi5EdXJhdGlvbiJhCg1SZW1vdmVPcHRpb25zEioKB3RpbWVvdXQYASABKAsyGS5nb29nbGUucHJvdG9idWYuRHVyYXRpb24SFgoJcmVjdXJzaXZlGAIgASgISACIAQFCDAoKX3JlY3Vyc2l2ZSKsBAoLU2FuZGJveEluZm8SCgoCaWQYASABKAkSEAoIcHJvdmlkZXIYAiABKAkSEQoEbmFtZRgDIAEoCUgAiAEBEhsKDnByb3ZpZGVyX3N0YXRlGAQgASgJSAGIAQESEwoGcmVnaW9uGAUgASgJSAKIAQESMgoJaXNvbGF0aW9uGAYgASgLMh8ua2l0LnNhbmRib3gudjEuSXNvbGF0aW9uQ29uZmlnEiwKCXJlc291cmNlcxgHIAEoCzIZLmtpdC5zYW5kYm94LnYxLlJlc291cmNlcxI3CgZsYWJlbHMYCCADKAsyJy5raXQuc2FuZGJveC52MS5TYW5kYm94SW5mby5MYWJlbHNFbnRyeRIuCgpjcmVhdGVkX2F0GAkgASgLMhouZ29vZ2xlLnByb3RvYnVmLlRpbWVzdGFtcBI5ChFwcm92aWRlcl9tZXRhZGF0YRgKIAEoCzIeLmtpdC5zYW5kYm94LnYxLk1ldGFkYXRhT2JqZWN0EisKBXN0YXRlGAwgASgOMhwua2l0LnNhbmRib3gudjEuU2FuZGJveFN0YXRlEhUKCHRlcm1pbmFsGA0gASgISAOIAQEaLQoLTGFiZWxzRW50cnkSCwoDa2V5GAEgASgJEg0KBXZhbHVlGAIgASgJOgI4AUIHCgVfbmFtZUIRCg9fcHJvdmlkZXJfc3RhdGVCCQoHX3JlZ2lvbkILCglfdGVybWluYWxKBAgLEAxSB29yaWdpbnMinwIKCUVycm9ySW5mbxInCgRraW5kGAEgASgOMhkua2l0LnNhbmRib3gudjEuRXJyb3JLaW5kEhAKCHByb3ZpZGVyGAIgASgJEhEKCW9wZXJhdGlvbhgDIAEoCRINCgVmaWVsZBgEIAEoCRIPCgdtZXNzYWdlGAUgASgJEhgKC3N0YXR1c19jb2RlGAYgASgNSACIAQESGgoNcHJvdmlkZXJfY29kZRgHIAEoCUgBiAEBEhwKD3Byb3ZpZGVyX3NvdXJjZRgIIAEoCUgCiAEBEhEKBHJ1bGUYCSABKAlIA4gBAUIOCgxfc3RhdHVzX2NvZGVCEAoOX3Byb3ZpZGVyX2NvZGVCEgoQX3Byb3ZpZGVyX3NvdXJjZUIHCgVfcnVsZSL1AQoNTWV0YWRhdGFWYWx1ZRIRCgdib29sZWFuGAEgASgISAASDgoEdGV4dBgCIAEoCUgAEhgKDnNpZ25lZF9pbnRlZ2VyGAMgASgDSAASGgoQdW5zaWduZWRfaW50ZWdlchgEIAEoBEgAEhAKBm51bWJlchgFIAEoAUgAEhAKBmJpbmFyeRgGIAEoDEgAEiwKBGxpc3QYByABKAsyHC5raXQuc2FuZGJveC52MS5NZXRhZGF0YUxpc3RIABIwCgZvYmplY3QYCCABKAsyHi5raXQuc2FuZGJveC52MS5NZXRhZGF0YU9iamVjdEgAQgcKBXZhbHVlIj0KDE1ldGFkYXRhTGlzdBItCgZ2YWx1ZXMYASADKAsyHS5raXQuc2FuZGJveC52MS5NZXRhZGF0YVZhbHVlIpoBCg5NZXRhZGF0YU9iamVjdBI6CgZ2YWx1ZXMYASADKAsyKi5raXQuc2FuZGJveC52MS5NZXRhZGF0YU9iamVjdC5WYWx1ZXNFbnRyeRpMCgtWYWx1ZXNFbnRyeRILCgNrZXkYASABKAkSLAoFdmFsdWUYAiABKAsyHS5raXQuc2FuZGJveC52MS5NZXRhZGF0YVZhbHVlOgI4ASrYAQoMU25hcHNob3RLaW5kEhkKFVNOQVBTSE9UX0tJTkRfREVGQVVMVBAAEhwKGFNOQVBTSE9UX0tJTkRfRklMRVNZU1RFTRABEhgKFFNOQVBTSE9UX0tJTkRfTUVNT1JZEAISFwoTU05BUFNIT1RfS0lORF9JTUFHRRADEhkKFVNOQVBTSE9UX0tJTkRfTUFDSElORRAEEhwKGFNOQVBTSE9UX0tJTkRfQ0hFQ0tQT0lOVBAFEiMKH1NOQVBTSE9UX0tJTkRfUFJPVklERVJfU1BFQ0lGSUMQBirDAQoNSXNvbGF0aW9uS2luZBIaChZJU09MQVRJT05fS0lORF9ERUZBVUxUEAASHAoYSVNPTEFUSU9OX0tJTkRfQ09OVEFJTkVSEAESGgoWSVNPTEFUSU9OX0tJTkRfTUlDUk9WTRACEhsKF0lTT0xBVElPTl9LSU5EX0xJTlVYX1ZNEAMSGQoVSVNPTEFUSU9OX0tJTkRfV09SS0VSEAQSJAogSVNPTEFUSU9OX0tJTkRfUFJPVklERVJfU1BFQ0lGSUMQBSp3CgpFZ3Jlc3NNb2RlEhcKE0VHUkVTU19NT0RFX0RFRkFVTFQQABIZChVFR1JFU1NfTU9ERV9BTExPV19BTEwQARIZChVFR1JFU1NfTU9ERV9CTE9DS19BTEwQAhIaChZFR1JFU1NfTU9ERV9SRVNUUklDVEVEEAMqewoNUG9ydFRyYW5zcG9ydBIaChZQT1JUX1RSQU5TUE9SVF9ERUZBVUxUEAASFgoSUE9SVF9UUkFOU1BPUlRfVExTEAESHAoYUE9SVF9UUkFOU1BPUlRfSFRUUDJfVExTEAISGAoUUE9SVF9UUkFOU1BPUlRfUExBSU4QAyp6Cg9TZWNyZXRJbmplY3Rpb24SHAoYU0VDUkVUX0lOSkVDVElPTl9ERUZBVUxUEAASIAocU0VDUkVUX0lOSkVDVElPTl9FTlZJUk9OTUVOVBABEicKI1NFQ1JFVF9JTkpFQ1RJT05fRUdSRVNTX1BMQUNFSE9MREVSEAIqVgoKUG9saWN5TW9kZRIXChNQT0xJQ1lfTU9ERV9ERUZBVUxUEAASGAoUUE9MSUNZX01PREVfRElTQUJMRUQQARIVChFQT0xJQ1lfTU9ERV9BRlRFUhACKp0BCg1XYWl0Q29uZGl0aW9uEhoKFldBSVRfQ09ORElUSU9OX0RFRkFVTFQQABIcChhXQUlUX0NPTkRJVElPTl9TVUJNSVRURUQQARIcChhXQUlUX0NPTkRJVElPTl9TQ0hFRFVMRUQQAhIaChZXQUlUX0NPTkRJVElPTl9TVEFSVEVEEAMSGAoUV0FJVF9DT05ESVRJT05fUkVBRFkQBCppCghGaWxlVHlwZRIZChVGSUxFX1RZUEVfVU5TUEVDSUZJRUQQABISCg5GSUxFX1RZUEVfRklMRRABEhcKE0ZJTEVfVFlQRV9ESVJFQ1RPUlkQAhIVChFGSUxFX1RZUEVfU1lNTElOSxADKqwDCgxTYW5kYm94U3RhdGUSGQoVU0FOREJPWF9TVEFURV9VTktOT1dOEAASGAoUU0FOREJPWF9TVEFURV9RVUVVRUQQARIaChZTQU5EQk9YX1NUQVRFX1NUQVJUSU5HEAISGQoVU0FOREJPWF9TVEFURV9SVU5OSU5HEAMSGgoWU0FOREJPWF9TVEFURV9TVE9QUElORxAEEhkKFVNBTkRCT1hfU1RBVEVfU1RPUFBFRBAFEhkKFVNBTkRCT1hfU1RBVEVfUEFVU0lORxAGEhgKFFNBTkRCT1hfU1RBVEVfUEFVU0VEEAcSGwoXU0FOREJPWF9TVEFURV9BUkNISVZJTkcQCBIaChZTQU5EQk9YX1NUQVRFX0FSQ0hJVkVEEAkSHQoZU0FOREJPWF9TVEFURV9URVJNSU5BVElORxAKEhwKGFNBTkRCT1hfU1RBVEVfVEVSTUlOQVRFRBALEhoKFlNBTkRCT1hfU1RBVEVfREVMRVRJTkcQDBIZChVTQU5EQk9YX1NUQVRFX0RFTEVURUQQDRIXChNTQU5EQk9YX1NUQVRFX0VSUk9SEA4qnwIKE0xpZmVjeWNsZUNhcGFiaWxpdHkSIAocTElGRUNZQ0xFX0NBUEFCSUxJVFlfVU5LTk9XThAAEiAKHExJRkVDWUNMRV9DQVBBQklMSVRZX1JFRlJFU0gQARIeChpMSUZFQ1lDTEVfQ0FQQUJJTElUWV9TVEFSVBACEh0KGUxJRkVDWUNMRV9DQVBBQklMSVRZX1NUT1AQAxIeChpMSUZFQ1lDTEVfQ0FQQUJJTElUWV9QQVVTRRAEEiIKHkxJRkVDWUNMRV9DQVBBQklMSVRZX1RFUk1JTkFURRAFEiAKHExJRkVDWUNMRV9DQVBBQklMSVRZX0FSQ0hJVkUQBhIfChtMSUZFQ1lDTEVfQ0FQQUJJTElUWV9ERUxFVEUQByreAwoJRXJyb3JLaW5kEhYKEkVSUk9SX0tJTkRfVU5LTk9XThAAEh8KG0VSUk9SX0tJTkRfSU5WQUxJRF9BUkdVTUVOVBABEhoKFkVSUk9SX0tJTkRfVU5TVVBQT1JURUQQAhIdChlFUlJPUl9LSU5EX0FVVEhFTlRJQ0FUSU9OEAMSIAocRVJST1JfS0lORF9QRVJNSVNTSU9OX0RFTklFRBAEEhgKFEVSUk9SX0tJTkRfTk9UX0ZPVU5EEAUSHQoZRVJST1JfS0lORF9BTFJFQURZX0VYSVNUUxAGEhcKE0VSUk9SX0tJTkRfQ09ORkxJQ1QQBxIbChdFUlJPUl9LSU5EX1JBVEVfTElNSVRFRBAIEiEKHUVSUk9SX0tJTkRfUkVTT1VSQ0VfRVhIQVVTVEVEEAkSFgoSRVJST1JfS0lORF9USU1FT1VUEAoSFwoTRVJST1JfS0lORF9DQU5DRUxFRBALEhoKFkVSUk9SX0tJTkRfVU5BVkFJTEFCTEUQDBIfChtFUlJPUl9LSU5EX0lOVkFMSURfUkVTUE9OU0UQDRIXChNFUlJPUl9LSU5EX0lOVEVSTkFMEA4SIgoeRVJST1JfS0lORF9GQUlMRURfUFJFQ09ORElUSU9OEA9CUFpOZ2l0aHViLmNvbS9zYW5kYm94LWtpdC9raXQvc2Rrcy9nby9pbnRlcm5hbC9jb250cmFjdHMva2l0L3NhbmRib3gvdjE7c2FuZGJveHYxYgZwcm90bzM", [file_buf_validate_validate, file_google_protobuf_duration, file_google_protobuf_timestamp]); /** * CreateOptions is the creation request. It does not include lifecycle operations or credentials. @@ -1002,6 +1002,221 @@ export type ExitResult = Message<"kit.sandbox.v1.ExitResult"> & { export const ExitResultSchema: GenMessage = /*@__PURE__*/ messageDesc(file_kit_sandbox_v1_sandbox, 28); +/** + * FileInfo is metadata for one file, directory, or symlink. + * Optional fields stay absent when the provider did not report them. + * + * @generated from message kit.sandbox.v1.FileInfo + */ +export type FileInfo = Message<"kit.sandbox.v1.FileInfo"> & { + /** + * @generated from field: string name = 1; + */ + name: string; + + /** + * @generated from field: string path = 2; + */ + path: string; + + /** + * @generated from field: kit.sandbox.v1.FileType type = 3; + */ + type: FileType; + + /** + * @generated from field: int64 size = 4; + */ + size: bigint; + + /** + * Unix mode as reported by the provider, such as "0644". + * + * @generated from field: optional string mode = 5; + */ + mode?: string | undefined; + + /** + * Symbolic permissions when the provider reports them, such as "rw-r--r--". + * + * @generated from field: optional string permissions = 6; + */ + permissions?: string | undefined; + + /** + * @generated from field: optional string owner = 7; + */ + owner?: string | undefined; + + /** + * @generated from field: optional string group = 8; + */ + group?: string | undefined; + + /** + * @generated from field: google.protobuf.Timestamp modified_at = 9; + */ + modifiedAt?: Timestamp | undefined; + + /** + * @generated from field: optional string symlink_target = 10; + */ + symlinkTarget?: string | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.FileInfo. + * Use `create(FileInfoSchema)` to create a new message. + */ +export const FileInfoSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 29); + +/** + * FileReadOptions configures reading one file. Nil timeout inherits Config.Timeout. + * + * @generated from message kit.sandbox.v1.FileReadOptions + */ +export type FileReadOptions = Message<"kit.sandbox.v1.FileReadOptions"> & { + /** + * @generated from field: google.protobuf.Duration timeout = 1; + */ + timeout?: Duration | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.FileReadOptions. + * Use `create(FileReadOptionsSchema)` to create a new message. + */ +export const FileReadOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 30); + +/** + * FileWriteOptions configures writing one file. Nil timeout inherits Config.Timeout. + * + * @generated from message kit.sandbox.v1.FileWriteOptions + */ +export type FileWriteOptions = Message<"kit.sandbox.v1.FileWriteOptions"> & { + /** + * @generated from field: google.protobuf.Duration timeout = 1; + */ + timeout?: Duration | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.FileWriteOptions. + * Use `create(FileWriteOptionsSchema)` to create a new message. + */ +export const FileWriteOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 31); + +/** + * FileCopyOptions configures a copy between the caller and the sandbox. + * Nil timeout inherits Config.Timeout. + * + * @generated from message kit.sandbox.v1.FileCopyOptions + */ +export type FileCopyOptions = Message<"kit.sandbox.v1.FileCopyOptions"> & { + /** + * @generated from field: google.protobuf.Duration timeout = 1; + */ + timeout?: Duration | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.FileCopyOptions. + * Use `create(FileCopyOptionsSchema)` to create a new message. + */ +export const FileCopyOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 32); + +/** + * MakeDirectoryOptions configures creating one directory. Nil timeout inherits Config.Timeout. + * An omitted parents flag is true: missing parents are created. Daytona rejects false. + * + * @generated from message kit.sandbox.v1.MakeDirectoryOptions + */ +export type MakeDirectoryOptions = Message<"kit.sandbox.v1.MakeDirectoryOptions"> & { + /** + * @generated from field: google.protobuf.Duration timeout = 1; + */ + timeout?: Duration | undefined; + + /** + * @generated from field: optional bool parents = 2; + */ + parents?: boolean | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.MakeDirectoryOptions. + * Use `create(MakeDirectoryOptionsSchema)` to create a new message. + */ +export const MakeDirectoryOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 33); + +/** + * ListDirectoryOptions configures listing one directory. Nil timeout inherits Config.Timeout. + * + * @generated from message kit.sandbox.v1.ListDirectoryOptions + */ +export type ListDirectoryOptions = Message<"kit.sandbox.v1.ListDirectoryOptions"> & { + /** + * @generated from field: google.protobuf.Duration timeout = 1; + */ + timeout?: Duration | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.ListDirectoryOptions. + * Use `create(ListDirectoryOptionsSchema)` to create a new message. + */ +export const ListDirectoryOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 34); + +/** + * StatOptions configures reading metadata for one path. Nil timeout inherits Config.Timeout. + * + * @generated from message kit.sandbox.v1.StatOptions + */ +export type StatOptions = Message<"kit.sandbox.v1.StatOptions"> & { + /** + * @generated from field: google.protobuf.Duration timeout = 1; + */ + timeout?: Duration | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.StatOptions. + * Use `create(StatOptionsSchema)` to create a new message. + */ +export const StatOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 35); + +/** + * RemoveOptions configures removing one path. Recursive removes a directory and its contents. + * Nil timeout inherits Config.Timeout. An omitted recursive flag removes a file or an empty directory. + * + * @generated from message kit.sandbox.v1.RemoveOptions + */ +export type RemoveOptions = Message<"kit.sandbox.v1.RemoveOptions"> & { + /** + * @generated from field: google.protobuf.Duration timeout = 1; + */ + timeout?: Duration | undefined; + + /** + * @generated from field: optional bool recursive = 2; + */ + recursive?: boolean | undefined; +}; + +/** + * Describes the message kit.sandbox.v1.RemoveOptions. + * Use `create(RemoveOptionsSchema)` to create a new message. + */ +export const RemoveOptionsSchema: GenMessage = /*@__PURE__*/ + messageDesc(file_kit_sandbox_v1_sandbox, 36); + /** * SandboxInfo is shared metadata. Optional fields stay absent when the provider did not report them. * @@ -1091,7 +1306,7 @@ export type SandboxInfo = Message<"kit.sandbox.v1.SandboxInfo"> & { * Use `create(SandboxInfoSchema)` to create a new message. */ export const SandboxInfoSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_kit_sandbox_v1_sandbox, 29); + messageDesc(file_kit_sandbox_v1_sandbox, 37); /** * ErrorInfo is the portable error detail. The native cause stays on the runtime error and is not serialized. @@ -1177,7 +1392,7 @@ export type ErrorInfo = Message<"kit.sandbox.v1.ErrorInfo"> & { * Use `create(ErrorInfoSchema)` to create a new message. */ export const ErrorInfoSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_kit_sandbox_v1_sandbox, 30); + messageDesc(file_kit_sandbox_v1_sandbox, 38); /** * Exact numeric alternatives avoid protobuf Struct's double-only representation. @@ -1245,7 +1460,7 @@ export type MetadataValue = Message<"kit.sandbox.v1.MetadataValue"> & { * Use `create(MetadataValueSchema)` to create a new message. */ export const MetadataValueSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_kit_sandbox_v1_sandbox, 31); + messageDesc(file_kit_sandbox_v1_sandbox, 39); /** * MetadataList is an ordered list of metadata values. @@ -1266,7 +1481,7 @@ export type MetadataList = Message<"kit.sandbox.v1.MetadataList"> & { * Use `create(MetadataListSchema)` to create a new message. */ export const MetadataListSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_kit_sandbox_v1_sandbox, 32); + messageDesc(file_kit_sandbox_v1_sandbox, 40); /** * MetadataObject is a string-keyed metadata object. Adapters fill values directly. @@ -1287,7 +1502,7 @@ export type MetadataObject = Message<"kit.sandbox.v1.MetadataObject"> & { * Use `create(MetadataObjectSchema)` to create a new message. */ export const MetadataObjectSchema: GenMessage = /*@__PURE__*/ - messageDesc(file_kit_sandbox_v1_sandbox, 33); + messageDesc(file_kit_sandbox_v1_sandbox, 41); /** * SnapshotKind classifies a snapshot. Preserve the numeric values. @@ -1542,6 +1757,39 @@ export enum WaitCondition { export const WaitConditionSchema: GenEnum = /*@__PURE__*/ enumDesc(file_kit_sandbox_v1_sandbox, 6); +/** + * FileType classifies one filesystem entry. Preserve the numeric values. + * + * @generated from enum kit.sandbox.v1.FileType + */ +export enum FileType { + /** + * @generated from enum value: FILE_TYPE_UNSPECIFIED = 0; + */ + UNSPECIFIED = 0, + + /** + * @generated from enum value: FILE_TYPE_FILE = 1; + */ + FILE = 1, + + /** + * @generated from enum value: FILE_TYPE_DIRECTORY = 2; + */ + DIRECTORY = 2, + + /** + * @generated from enum value: FILE_TYPE_SYMLINK = 3; + */ + SYMLINK = 3, +} + +/** + * Describes the enum kit.sandbox.v1.FileType. + */ +export const FileTypeSchema: GenEnum = /*@__PURE__*/ + enumDesc(file_kit_sandbox_v1_sandbox, 7); + /** * SandboxState is a portable lifecycle state. ProviderState retains the native value. * @@ -1628,7 +1876,7 @@ export enum SandboxState { * Describes the enum kit.sandbox.v1.SandboxState. */ export const SandboxStateSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_kit_sandbox_v1_sandbox, 7); + enumDesc(file_kit_sandbox_v1_sandbox, 8); /** * LifecycleCapability identifies a lifecycle operation a provider implements. @@ -1681,7 +1929,7 @@ export enum LifecycleCapability { * Describes the enum kit.sandbox.v1.LifecycleCapability. */ export const LifecycleCapabilitySchema: GenEnum = /*@__PURE__*/ - enumDesc(file_kit_sandbox_v1_sandbox, 8); + enumDesc(file_kit_sandbox_v1_sandbox, 9); /** * ErrorKind is the shared error category. It does not imply that a retry is safe. @@ -1774,5 +2022,5 @@ export enum ErrorKind { * Describes the enum kit.sandbox.v1.ErrorKind. */ export const ErrorKindSchema: GenEnum = /*@__PURE__*/ - enumDesc(file_kit_sandbox_v1_sandbox, 9); + enumDesc(file_kit_sandbox_v1_sandbox, 10); diff --git a/sdks/typescript/package-lock.json b/sdks/typescript/package-lock.json index e67422d4..747b541e 100644 --- a/sdks/typescript/package-lock.json +++ b/sdks/typescript/package-lock.json @@ -4089,6 +4089,7 @@ "@sandbox-kit/contracts": "0.1.5" }, "devDependencies": { + "@types/node": "24.10.1", "typescript": "5.9.3", "vitest": "4.1.11" }, @@ -4190,6 +4191,16 @@ "dev": true, "license": "MIT" }, + "sandbox/node_modules/@types/node": { + "version": "24.10.1", + "resolved": "https://registry.npmjs.org/@types/node/-/node-24.10.1.tgz", + "integrity": "sha512-GNWcUTRBgIRJD5zj+Tq0fKOJ5XZajIiBroOF0yvj2bSU1WvNdYS/dn9UxwsujGW4JX06dnHyjV2y9rRaybH0iQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, "sandbox/node_modules/@vitest/expect": { "version": "4.1.11", "dev": true, @@ -4589,6 +4600,13 @@ "node": ">=14.17" } }, + "sandbox/node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "dev": true, + "license": "MIT" + }, "sandbox/node_modules/vite": { "version": "8.3.4", "dev": true, diff --git a/sdks/typescript/providers/daytona/README.md b/sdks/typescript/providers/daytona/README.md index 177ccb61..4b1ee427 100644 --- a/sdks/typescript/providers/daytona/README.md +++ b/sdks/typescript/providers/daytona/README.md @@ -70,6 +70,20 @@ ephemeral behavior, and stop/pause/archive/delete policies. call for that sandbox. `close` does not contact Daytona and does not change the sandbox. +**Files** through `sandbox.filesystem`. Paths in the sandbox are absolute. +`readFile`, `writeFile`, `copyFromLocal`, and `copyToLocal` pass a timeout to +Daytona as a whole number of seconds. `2000` is two seconds. `1500` is +rejected, and the field is `timeout`. An omitted timeout, and an explicit +zero, on those four calls are passed as `0`. Daytona adds no transfer limit. +When the timeout is omitted, the abort signal carries the client deadline. +`makeDirectory`, `listDirectory`, `stat`, and `remove` use the abort signal, so +`1500` ends the call at 1.5 seconds. `parents` defaults to true and creates missing parents. `parents: +false` is rejected. `makeDirectory` returns the provider error when the +directory already exists. A missing file passed to `copyFromLocal` is not +found, and the error field is `local_path`. A local directory is an invalid +argument with the same field. `copyToLocal` creates a missing local parent +directory. + Daytona does not support unverified `attach`. Use `client.get(id)` for a provider-verified handle. @@ -79,12 +93,13 @@ inherit snapshot resources. ## Examples -| Example | Project | -| ---------- | ------------------------------------------------------------------------------------------------------------------------------------- | -| Creation | [create-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-sandbox) | -| Policies | [create-daytona-with-policies](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-with-policies) | -| Retrieval | [get-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/get-daytona-sandbox) | -| Full index | [TypeScript examples](https://github.com/sandbox-kit/kit/tree/main/examples/typescript) | +| Example | Project | +| ----------- | ------------------------------------------------------------------------------------------------------------------------------------- | +| Creation | [create-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-sandbox) | +| Read a file | [read-daytona-file](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/read-daytona-file) | +| Policies | [create-daytona-with-policies](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-with-policies) | +| Retrieval | [get-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/lifecycle/get-daytona-sandbox) | +| Full index | [TypeScript examples](https://github.com/sandbox-kit/kit/tree/main/examples/typescript) | ## License diff --git a/sdks/typescript/providers/daytona/src/daytona.test.ts b/sdks/typescript/providers/daytona/src/daytona.test.ts index 50fff14e..8a6434f7 100644 --- a/sdks/typescript/providers/daytona/src/daytona.test.ts +++ b/sdks/typescript/providers/daytona/src/daytona.test.ts @@ -1,3 +1,6 @@ +import { mkdtemp, stat, writeFile } from "node:fs/promises"; +import { tmpdir } from "node:os"; +import { join } from "node:path"; import { DaytonaError, type DaytonaConfig, @@ -25,6 +28,8 @@ import { ConfigFieldScopeOrganizationId, ConfigFieldScopeProjectId, ConfigFieldTimeout, + FileFieldLocalPath, + FileFieldParents, CreateFieldProvisioningTimeout, } from "@sandbox-kit/sandbox"; import type { CreateOptions } from "@sandbox-kit/sandbox"; @@ -261,7 +266,7 @@ describe("Daytona mappings", () => { ); }); - it("applies generated network and policy checks before mapping", () => { + it("applies network and policy checks before mapping", () => { expect(() => mapCreateRequest({ network: { outboundCidrs: ["not-a-cidr"] }, @@ -518,4 +523,225 @@ describe("Daytona provider orchestration", () => { }); expect(started).toBe(false); }); + + it("rejects parents false before Daytona is called", async () => { + const backend = new DaytonaProvider(() => ({ + async create() { + throw new Error("unused"); + }, + async get(): Promise { + throw new Error("native get must not run"); + }, + async [Symbol.asyncDispose](): Promise {}, + })).initialize({}); + const makeDirectory = backend.makeDirectory; + if (!makeDirectory) throw new Error("makeDirectory is missing"); + await expect( + makeDirectory.call( + backend, + "sandbox-1", + "/tmp/kit", + { parents: false }, + {}, + ), + ).rejects.toMatchObject({ + kind: ErrorKind.Unsupported, + field: FileFieldParents, + operation: "make_directory", + }); + }); + + it("sends whole seconds for a file read and keeps a fractional deadline for listing", async () => { + let downloadTimeout: number | undefined; + let bulkTimeout: number | undefined; + let listed = false; + const backend = new DaytonaProvider(() => ({ + async create(): Promise { + throw new Error("unused"); + }, + async get(): Promise { + return { + fs: { + async downloadFile(_path: string, timeout?: number) { + downloadTimeout = timeout; + return Buffer.from("hi"); + }, + async downloadFiles( + _files: readonly { source: string }[], + timeout?: number, + ) { + bulkTimeout = timeout; + return [{ source: "/tmp/note.txt", result: Buffer.from("hi") }]; + }, + async listFiles() { + listed = true; + return []; + }, + }, + } as unknown as DaytonaSandbox; + }, + async [Symbol.asyncDispose](): Promise {}, + })).initialize({}); + const readFile = backend.readFile; + const listDirectory = backend.listDirectory; + if (!readFile || !listDirectory) + throw new Error("filesystem methods are missing"); + await readFile.call( + backend, + "sandbox-1", + "/tmp/note.txt", + { timeout: 2_000 }, + {}, + ); + expect(downloadTimeout).toBe(2); + expect(bulkTimeout).toBeUndefined(); + await readFile.call(backend, "sandbox-1", "/tmp/note.txt", {}, {}); + expect(bulkTimeout).toBe(0); + expect(downloadTimeout).toBe(2); + await readFile.call( + backend, + "sandbox-1", + "/tmp/note.txt", + { timeout: 0 }, + {}, + ); + expect(bulkTimeout).toBe(0); + await expect( + readFile.call( + backend, + "sandbox-1", + "/tmp/note.txt", + { timeout: 1_500 }, + {}, + ), + ).rejects.toMatchObject({ + kind: ErrorKind.InvalidArgument, + field: ConfigFieldTimeout, + operation: "read_file", + }); + await listDirectory.call( + backend, + "sandbox-1", + "/tmp", + { timeout: 1_500 }, + {}, + ); + expect(listed).toBe(true); + }); + + it("rejects a missing or directory local source before Daytona is called", async () => { + const backend = new DaytonaProvider(() => ({ + async create(): Promise { + throw new Error("unused"); + }, + async get(): Promise { + throw new Error("native get must not run"); + }, + async [Symbol.asyncDispose](): Promise {}, + })).initialize({}); + const copyFromLocal = backend.copyFromLocal; + const copyToLocal = backend.copyToLocal; + if (!copyFromLocal || !copyToLocal) + throw new Error("copy methods are missing"); + await expect( + copyFromLocal.call( + backend, + "sandbox-1", + join(tmpdir(), "kit-missing-source.txt"), + "/tmp/note.txt", + {}, + {}, + ), + ).rejects.toMatchObject({ + kind: ErrorKind.NotFound, + field: FileFieldLocalPath, + operation: "copy_from_local", + }); + await expect( + copyFromLocal.call( + backend, + "sandbox-1", + tmpdir(), + "/tmp/note.txt", + {}, + {}, + ), + ).rejects.toMatchObject({ + kind: ErrorKind.InvalidArgument, + field: FileFieldLocalPath, + operation: "copy_from_local", + }); + await expect( + copyToLocal.call(backend, "sandbox-1", "/tmp/note.txt", tmpdir(), {}, {}), + ).rejects.toMatchObject({ + kind: ErrorKind.InvalidArgument, + field: FileFieldLocalPath, + operation: "copy_to_local", + }); + }); + + it("creates missing local parents before Daytona downloads", async () => { + const root = await mkdtemp(join(tmpdir(), "kit-copy-parent-")); + const local = join(root, "nested", "out.txt"); + let downloadedTo = ""; + const backend = new DaytonaProvider(() => ({ + async create(): Promise { + throw new Error("unused"); + }, + async get(): Promise { + return { + fs: { + async downloadFile(_remote: string, destination: string) { + downloadedTo = destination; + await writeFile(destination, "ok"); + }, + }, + } as unknown as DaytonaSandbox; + }, + async [Symbol.asyncDispose](): Promise {}, + })).initialize({}); + const copyToLocal = backend.copyToLocal; + if (!copyToLocal) throw new Error("copyToLocal is missing"); + await copyToLocal.call( + backend, + "sandbox-1", + "/tmp/note.txt", + local, + {}, + {}, + ); + expect(downloadedTo).toBe(local); + const parent = await stat(join(root, "nested")); + expect(parent.isDirectory()).toBe(true); + }); + + it("classifies a local write failure from copyToLocal", async () => { + const local = join(tmpdir(), `kit-copy-out-${Date.now()}.txt`); + const backend = new DaytonaProvider(() => ({ + async create(): Promise { + throw new Error("unused"); + }, + async get(): Promise { + return { + fs: { + async downloadFile() { + throw new DaytonaError( + `Write stream failed: ENOENT: no such file or directory, open '${local}'`, + ); + }, + }, + } as unknown as DaytonaSandbox; + }, + async [Symbol.asyncDispose](): Promise {}, + })).initialize({}); + const copyToLocal = backend.copyToLocal; + if (!copyToLocal) throw new Error("copyToLocal is missing"); + await expect( + copyToLocal.call(backend, "sandbox-1", "/tmp/note.txt", local, {}, {}), + ).rejects.toMatchObject({ + kind: ErrorKind.NotFound, + field: FileFieldLocalPath, + operation: "copy_to_local", + }); + }); }); diff --git a/sdks/typescript/providers/daytona/src/daytona.ts b/sdks/typescript/providers/daytona/src/daytona.ts index 082792c7..3ebd8ee6 100644 --- a/sdks/typescript/providers/daytona/src/daytona.ts +++ b/sdks/typescript/providers/daytona/src/daytona.ts @@ -1,12 +1,18 @@ +import { Buffer } from "node:buffer"; import { Daytona, + DaytonaError, type DaytonaConfig, + type FileDownloadResponse, type Sandbox as DaytonaSandbox, } from "@daytona/sdk"; import { ConfigFieldTimeout, CreateFieldProvisioningTimeout, ErrorKind, + FileFieldParents, + FileType, + type FileInfo, type OperationOptions, type Provider, type SandboxInfo, @@ -18,17 +24,32 @@ import type { CreateResult, ArchiveOptions, DeleteOptions, + FileCopyOptions, + FileReadOptions, + FileWriteOptions, + ListDirectoryOptions, + MakeDirectoryOptions, PauseOptions, + RemoveOptions, StartOptions, + StatOptions, StopOptions, } from "@sandbox-kit/sandbox"; +import type { FileInfo as DaytonaFileInfo } from "@daytona/sdk"; import { mapClientConfig, mapCreateRequest, mapSandboxInfo, } from "#mappings/mappings.js"; -import { mapDaytonaError, providerError } from "#errors.js"; +import { + ensureLocalParent, + mapDaytonaError, + providerError, + requireLocalDestination, + requireLocalFile, + translateLocalCopyError, +} from "#errors.js"; import { BackendBase, ProviderBase } from "./provider.js"; interface NativeDaytona { @@ -162,6 +183,191 @@ class DaytonaBackend extends BackendBase implements Backend { } } + async readFile( + id: string, + path: string, + request: FileReadOptions, + options: OperationOptions, + ): Promise { + return this.#file( + "read_file", + id, + options, + request.timeout, + async (sandbox, timeout) => { + const seconds = fileSeconds(timeout); + // downloadFile(path, 0) drops the 0, because 0 is not a string path, + // and Daytona then applies its 30-minute default. + if (!seconds) { + const [file] = await sandbox.fs.downloadFiles([{ source: path }], 0); + const body = file?.result; + if (!file || file.error || !body) throw downloadFailure(file); + return new Uint8Array( + typeof body === "string" ? Buffer.from(body) : body, + ); + } + const data = await sandbox.fs.downloadFile(path, seconds); + return new Uint8Array(data); + }, + ); + } + + async writeFile( + id: string, + path: string, + data: Uint8Array, + request: FileWriteOptions, + options: OperationOptions, + ): Promise { + await this.#file( + "write_file", + id, + options, + request.timeout, + async (sandbox, timeout) => { + await sandbox.fs.uploadFile( + Buffer.from(data), + path, + fileSeconds(timeout), + ); + }, + ); + } + + async copyFromLocal( + id: string, + localPath: string, + remotePath: string, + request: FileCopyOptions, + options: OperationOptions, + ): Promise { + await requireLocalFile(localPath, "copy_from_local"); + await this.#file( + "copy_from_local", + id, + options, + request.timeout, + async (sandbox, timeout) => { + await sandbox.fs.uploadFile( + localPath, + remotePath, + fileSeconds(timeout), + ); + }, + ); + } + + async copyToLocal( + id: string, + remotePath: string, + localPath: string, + request: FileCopyOptions, + options: OperationOptions, + ): Promise { + await requireLocalDestination(localPath, "copy_to_local"); + await ensureLocalParent(localPath, "copy_to_local"); + await this.#file( + "copy_to_local", + id, + options, + request.timeout, + async (sandbox, timeout) => { + try { + await sandbox.fs.downloadFile( + remotePath, + localPath, + fileSeconds(timeout), + ); + } catch (error) { + throw translateLocalCopyError(error, "copy_to_local"); + } + }, + ); + } + + async makeDirectory( + id: string, + path: string, + request: MakeDirectoryOptions, + options: OperationOptions, + ): Promise { + if (request.parents === false) { + providerError({ + kind: ErrorKind.Unsupported, + operation: "make_directory", + field: FileFieldParents, + message: "parents false is not available", + }); + } + await this.#file( + "make_directory", + id, + options, + undefined, + async (sandbox) => { + await sandbox.fs.createFolder(path, "0755"); + }, + ); + } + + async listDirectory( + id: string, + path: string, + _request: ListDirectoryOptions, + options: OperationOptions, + ): Promise { + return this.#file( + "list_directory", + id, + options, + undefined, + async (sandbox) => { + const entries = await sandbox.fs.listFiles(path); + return entries.map((entry) => daytonaFileInfo(entry)); + }, + ); + } + + async stat( + id: string, + path: string, + _request: StatOptions, + options: OperationOptions, + ): Promise { + return this.#file("stat", id, options, undefined, async (sandbox) => + daytonaFileInfo(await sandbox.fs.getFileDetails(path)), + ); + } + + async remove( + id: string, + path: string, + request: RemoveOptions, + options: OperationOptions, + ): Promise { + await this.#file("remove", id, options, undefined, async (sandbox) => { + await sandbox.fs.deleteFile(path, request.recursive === true); + }); + } + + async #file( + operation: string, + id: string, + options: OperationOptions, + timeoutMs: number | undefined, + body: (sandbox: DaytonaSandbox, timeout: number | undefined) => Promise, + ): Promise { + try { + throwIfAborted(options.signal); + const timeout = wholeSeconds(timeoutMs, operation, ConfigFieldTimeout); + const sandbox = await this.native.get(id); + throwIfAborted(options.signal); + return await body(sandbox, timeout); + } catch (error) { + throw mapDaytonaError(error, operation); + } + } + async closeSandbox(_id: string, _options: OperationOptions): Promise {} async close(options: OperationOptions): Promise { @@ -174,10 +380,56 @@ class DaytonaBackend extends BackendBase implements Backend { } } +function daytonaFileInfo(info: DaytonaFileInfo): FileInfo { + const modified = fileDate(info); + return { + name: info.name, + path: info.path || "", + type: info.isDir ? FileType.Directory : FileType.File, + size: BigInt(info.size), + ...(info.mode ? { mode: info.mode } : {}), + ...(info.permissions ? { permissions: info.permissions } : {}), + ...(info.owner ? { owner: info.owner } : {}), + ...(info.group ? { group: info.group } : {}), + ...(modified ? { modifiedAt: modified } : {}), + }; +} + +function fileDate(info: DaytonaFileInfo): Date | undefined { + const raw = info.modifiedAt || info.modTime; + if (!raw) return undefined; + const parsed = Date.parse(raw); + if (Number.isNaN(parsed)) return undefined; + return new Date(parsed); +} + function throwIfAborted(signal: AbortSignal | undefined): void { signal?.throwIfAborted(); } +/** + * Converts a Kit file timeout (ms) for Daytona upload/download. + * Omitted and explicit zero become `0` so Daytona adds no transfer limit. + * Daytona's native default for an omitted argument is 30 minutes. + */ +function fileSeconds(timeout: number | undefined): number { + return timeout ?? 0; +} + +function downloadFailure(file: FileDownloadResponse | undefined): DaytonaError { + const details = file?.errorDetails; + if (details) { + return new DaytonaError( + details.message, + details.statusCode, + undefined, + details.code ?? details.errorCode, + details.source, + ); + } + return new DaytonaError(file?.error ?? "download failed"); +} + /** Native Daytona APIs take whole seconds. Lifecycle zero means no operation timeout. */ function wholeSeconds( value: number | undefined, diff --git a/sdks/typescript/providers/daytona/src/errors.ts b/sdks/typescript/providers/daytona/src/errors.ts index 9f1f30e5..50398244 100644 --- a/sdks/typescript/providers/daytona/src/errors.ts +++ b/sdks/typescript/providers/daytona/src/errors.ts @@ -2,9 +2,12 @@ // Classification order: existing SandboxError, abort/timeout DOMException, // then DaytonaError code/status maps, then unknown. Cause stays on SandboxError.cause. +import { mkdir, stat } from "node:fs/promises"; +import { dirname } from "node:path"; import { DaytonaError } from "@daytona/sdk"; import { ErrorKind, + FileFieldLocalPath, SandboxError, sandboxError, type ErrorInfo, @@ -130,6 +133,112 @@ function create(input: MappedErrorInput): SandboxError { ); } +/** Rejects a missing local file or a directory before Daytona reads it. */ +export async function requireLocalFile( + localPath: string, + operation: string, +): Promise { + let info; + try { + info = await stat(localPath); + } catch (error) { + if (nodeCode(error)) throw localFileError(error, operation); + throw error; + } + if (info.isDirectory()) localDirectory(operation); +} + +/** Rejects a local destination that is already a directory. A missing path is left for ensureLocalParent and Daytona's write. */ +export async function requireLocalDestination( + localPath: string, + operation: string, +): Promise { + try { + const info = await stat(localPath); + if (info.isDirectory()) localDirectory(operation); + } catch (error) { + if (nodeCode(error) === "ENOENT") return; + if (nodeCode(error)) throw localFileError(error, operation); + throw error; + } +} + +/** Creates missing local parents. Daytona's downloadFile uses a write that does not create them. */ +export async function ensureLocalParent( + localPath: string, + operation: string, +): Promise { + const parent = dirname(localPath); + if (parent === "." || parent === "/" || parent === "") return; + try { + await mkdir(parent, { recursive: true }); + } catch (error) { + if (nodeCode(error)) throw localFileError(error, operation); + throw error; + } +} + +/** + * Classifies a local write failure from copyToLocal. + * Other errors are returned unchanged for provider mapping. + */ +export function translateLocalCopyError( + error: unknown, + operation: string, +): unknown { + if (error instanceof SandboxError) return error; + if (nodeCode(error)) return localFileError(error, operation); + if ( + error instanceof DaytonaError && + error.message.includes("Write stream failed") + ) { + return sandboxError( + { + kind: error.message.includes("ENOENT") + ? ErrorKind.NotFound + : ErrorKind.InvalidArgument, + provider: "daytona", + operation, + field: FileFieldLocalPath, + message: error.message, + }, + error, + ); + } + return error; +} + +function localDirectory(operation: string): never { + providerError({ + kind: ErrorKind.InvalidArgument, + operation, + field: FileFieldLocalPath, + message: "local path is a directory", + }); +} + +function localFileError(error: unknown, operation: string): SandboxError { + return sandboxError( + { + kind: + nodeCode(error) === "ENOENT" + ? ErrorKind.NotFound + : ErrorKind.InvalidArgument, + provider: "daytona", + operation, + field: FileFieldLocalPath, + message: error instanceof Error ? error.message : "local path failed", + }, + error, + ); +} + +function nodeCode(error: unknown): string | undefined { + if (typeof error !== "object" || !error || !("code" in error)) + return undefined; + return typeof error.code === "string" ? error.code : undefined; +} + /** Local throw helper for mappings, checks, and config. */ export function providerError(input: ProviderErrorInput): never { throw sandboxError({ diff --git a/sdks/typescript/providers/daytona/tsconfig.json b/sdks/typescript/providers/daytona/tsconfig.json index 5e62381c..35b5033f 100644 --- a/sdks/typescript/providers/daytona/tsconfig.json +++ b/sdks/typescript/providers/daytona/tsconfig.json @@ -4,6 +4,7 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], "declaration": true, "declarationMap": false, "outDir": "dist", diff --git a/sdks/typescript/providers/daytona/vitest.config.ts b/sdks/typescript/providers/daytona/vitest.config.ts index 929ca340..c7cbf691 100644 --- a/sdks/typescript/providers/daytona/vitest.config.ts +++ b/sdks/typescript/providers/daytona/vitest.config.ts @@ -1,3 +1,4 @@ +/// import path from "node:path"; import { fileURLToPath } from "node:url"; import { defineConfig } from "vitest/config"; diff --git a/sdks/typescript/providers/modal/README.md b/sdks/typescript/providers/modal/README.md index 48f0031b..8c3815b7 100644 --- a/sdks/typescript/providers/modal/README.md +++ b/sdks/typescript/providers/modal/README.md @@ -66,17 +66,28 @@ not terminate the sandbox. Provider-verified `get` / `refresh`, start, stop, pause, archive, and delete are unsupported. +**Files** through `sandbox.filesystem`: `readFile`, `writeFile`, +`copyFromLocal`, `copyToLocal`, `makeDirectory`, `listDirectory`, `stat`, and +`remove`. Paths in the sandbox are absolute. A file timeout is the abort +signal. `1_500` ends the call at 1.5 seconds. `parents` defaults to true: +missing parents are created, and an existing directory is accepted. +`parents: false` requires the parent to exist. A missing file passed to +`copyFromLocal` is not found before Modal is called, and the error field is +`local_path`. A local directory is an invalid argument with the same field. +`copyToLocal` creates a missing local parent directory. + When you set resources, Modal requires at least 0.125 CPU cores and 128 MiB memory. Omitted values keep Modal defaults. Disk size cannot be raised at create. ## Examples -| Example | Project | -| ---------- | --------------------------------------------------------------------------------------------------------------------------------- | -| Creation | [create-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-sandbox) | -| Resources | [create-modal-with-resources](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-with-resources) | -| Attach | [attach-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/attach-modal-sandbox) | -| Full index | [TypeScript examples](https://github.com/sandbox-kit/kit/tree/main/examples/typescript) | +| Example | Project | +| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | +| Creation | [create-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-sandbox) | +| Read a file | [read-modal-file](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/read-modal-file) | +| Resources | [create-modal-with-resources](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-with-resources) | +| Attach | [attach-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/lifecycle/attach-modal-sandbox) | +| Full index | [TypeScript examples](https://github.com/sandbox-kit/kit/tree/main/examples/typescript) | ## License diff --git a/sdks/typescript/providers/modal/src/errors.ts b/sdks/typescript/providers/modal/src/errors.ts index 3ad19e62..03942ba7 100644 --- a/sdks/typescript/providers/modal/src/errors.ts +++ b/sdks/typescript/providers/modal/src/errors.ts @@ -2,6 +2,8 @@ // Classification order: existing SandboxError, abort/timeout DOMException, // then native Modal types, then unknown. Cause stays on SandboxError.cause. +import { stat } from "node:fs/promises"; + import { AlreadyExistsError, ClientClosedError, @@ -9,11 +11,19 @@ import { InvalidError, NotFoundError, ResourceExhaustedError, + SandboxFilesystemDirectoryNotEmptyError, + SandboxFilesystemFileTooLargeError, + SandboxFilesystemIsADirectoryError, + SandboxFilesystemNotADirectoryError, + SandboxFilesystemNotFoundError, + SandboxFilesystemPathAlreadyExistsError, + SandboxFilesystemPermissionError, SandboxTimeoutError, TimeoutError, } from "modal"; import { ErrorKind, + FileFieldLocalPath, SandboxError, sandboxError, type ErrorInfo, @@ -60,6 +70,37 @@ export function mapModalError(error: unknown, operation: string): SandboxError { kind = ErrorKind.Timeout; if (kind === ErrorKind.Unknown && error instanceof ClientClosedError) kind = ErrorKind.FailedPrecondition; + if ( + kind === ErrorKind.Unknown && + error instanceof SandboxFilesystemNotFoundError + ) + kind = ErrorKind.NotFound; + if ( + kind === ErrorKind.Unknown && + error instanceof SandboxFilesystemPermissionError + ) + kind = ErrorKind.PermissionDenied; + if ( + kind === ErrorKind.Unknown && + error instanceof SandboxFilesystemPathAlreadyExistsError + ) + kind = ErrorKind.AlreadyExists; + if ( + kind === ErrorKind.Unknown && + error instanceof SandboxFilesystemDirectoryNotEmptyError + ) + kind = ErrorKind.FailedPrecondition; + if ( + kind === ErrorKind.Unknown && + error instanceof SandboxFilesystemFileTooLargeError + ) + kind = ErrorKind.ResourceExhausted; + if ( + kind === ErrorKind.Unknown && + (error instanceof SandboxFilesystemNotADirectoryError || + error instanceof SandboxFilesystemIsADirectoryError) + ) + kind = ErrorKind.InvalidArgument; return create({ kind, error, operation }); } @@ -84,6 +125,87 @@ function create(input: MappedErrorInput): SandboxError { ); } +/** Rejects a missing local file or a directory before Modal reads it. */ +export async function requireLocalFile( + localPath: string, + operation: string, +): Promise { + let info; + try { + info = await stat(localPath); + } catch (error) { + if (nodeCode(error)) throw localFileError(error, operation); + throw error; + } + if (info.isDirectory()) localDirectory(operation); +} + +/** Rejects a local destination that is already a directory. A missing path is left for Modal to create. */ +export async function requireLocalDestination( + localPath: string, + operation: string, +): Promise { + try { + const info = await stat(localPath); + if (info.isDirectory()) localDirectory(operation); + } catch (error) { + if (nodeCode(error) === "ENOENT") return; + if (nodeCode(error)) throw localFileError(error, operation); + throw error; + } +} + +/** Classifies a local filesystem failure. Other errors stay with provider mapping. */ +export function translateLocalCopyError( + error: unknown, + operation: string, +): unknown { + if (error instanceof SandboxError) return error; + const code = nodeCode(error); + if (!code || !localCodes.has(code)) return error; + return localFileError(error, operation); +} + +function localDirectory(operation: string): never { + providerError({ + kind: ErrorKind.InvalidArgument, + operation, + field: FileFieldLocalPath, + message: "local path is a directory", + }); +} + +function localFileError(error: unknown, operation: string): SandboxError { + return sandboxError( + { + kind: + nodeCode(error) === "ENOENT" + ? ErrorKind.NotFound + : ErrorKind.InvalidArgument, + provider: "modal", + operation, + field: FileFieldLocalPath, + message: error instanceof Error ? error.message : "local path failed", + }, + error, + ); +} + +function nodeCode(error: unknown): string | undefined { + if (typeof error !== "object" || !error || !("code" in error)) + return undefined; + return typeof error.code === "string" ? error.code : undefined; +} + +const localCodes = new Set([ + "ENOENT", + "EISDIR", + "ENOTDIR", + "EACCES", + "EPERM", + "ENOSPC", +]); + /** Local throw helper for mappings, checks, and config. */ export function providerError(input: ProviderErrorInput): never { throw sandboxError({ diff --git a/sdks/typescript/providers/modal/src/modal.test.ts b/sdks/typescript/providers/modal/src/modal.test.ts index e600376b..43e5617b 100644 --- a/sdks/typescript/providers/modal/src/modal.test.ts +++ b/sdks/typescript/providers/modal/src/modal.test.ts @@ -1,3 +1,5 @@ +import { tmpdir } from "node:os"; +import { join } from "node:path"; import { describe, expect, it } from "vitest"; import { Client, @@ -16,6 +18,7 @@ import { CreateFieldResourcesCpuLimitCores, ConfigFieldAuthTokenPairId, ConfigFieldEndpoint, + FileFieldLocalPath, } from "@sandbox-kit/sandbox"; import { App, @@ -252,7 +255,7 @@ describe("Modal mappings", () => { }); }); - it("applies generated environment and network checks before mapping", () => { + it("applies environment and network checks before mapping", () => { const config = { scope: { appName: "app" } }; expect(() => mapCreateRequest( @@ -455,13 +458,94 @@ describe("Modal provider orchestration", () => { }, close(): void {}, })).initialize({ scope: { appName: "app" } }); - if (backend.terminate === undefined) throw new Error("terminate is missing"); + if (backend.terminate === undefined) + throw new Error("terminate is missing"); await expect( - backend.terminate("sandbox-1", { wait: true }, { signal: controller.signal }), + backend.terminate( + "sandbox-1", + { wait: true }, + { signal: controller.signal }, + ), ).rejects.toMatchObject({ kind: ErrorKind.Canceled, operation: "terminate", }); expect(polls).toBe(1); }); + + it("rejects a missing or directory local file before Modal is called", async () => { + let lookedUp = false; + const backend = new ModalProvider(() => ({ + apps: { + async fromName(): Promise { + throw new Error("unexpected app lookup"); + }, + }, + images: { + fromRegistry(): Image { + return {} as Image; + }, + }, + proxies: { + async fromName(): Promise { + throw new Error("unexpected proxy lookup"); + }, + }, + secrets: { + async fromName(): Promise { + throw new Error("unexpected secret lookup"); + }, + }, + sandboxes: { + async create(): Promise { + throw new Error("unexpected create"); + }, + async fromId(): Promise { + lookedUp = true; + throw new Error("native fromId must not run"); + }, + }, + close(): void {}, + })).initialize({ scope: { appName: "app" } }); + const copyFromLocal = backend.copyFromLocal; + const copyToLocal = backend.copyToLocal; + if (!copyFromLocal || !copyToLocal) + throw new Error("copy methods are missing"); + await expect( + copyFromLocal.call( + backend, + "sandbox-1", + join(tmpdir(), "kit-missing-source.txt"), + "/tmp/note.txt", + {}, + {}, + ), + ).rejects.toMatchObject({ + kind: ErrorKind.NotFound, + field: FileFieldLocalPath, + operation: "copy_from_local", + }); + await expect( + copyFromLocal.call( + backend, + "sandbox-1", + tmpdir(), + "/tmp/note.txt", + {}, + {}, + ), + ).rejects.toMatchObject({ + kind: ErrorKind.InvalidArgument, + field: FileFieldLocalPath, + operation: "copy_from_local", + }); + await expect( + copyToLocal.call(backend, "sandbox-1", "/tmp/note.txt", tmpdir(), {}, {}), + ).rejects.toMatchObject({ + kind: ErrorKind.InvalidArgument, + field: FileFieldLocalPath, + operation: "copy_to_local", + }); + expect(lookedUp).toBe(false); + }); }); diff --git a/sdks/typescript/providers/modal/src/modal.ts b/sdks/typescript/providers/modal/src/modal.ts index fe7d8003..398a84c1 100644 --- a/sdks/typescript/providers/modal/src/modal.ts +++ b/sdks/typescript/providers/modal/src/modal.ts @@ -1,9 +1,12 @@ import { ModalClient, + type FileInfo as ModalFileInfo, type ModalClientParams, type Sandbox as ModalSandbox, } from "modal"; import { + FileType, + type FileInfo, type OperationOptions, type Provider, type SandboxInfo, @@ -14,6 +17,13 @@ import type { CreateOptions, CreateResult, ExitResult, + FileCopyOptions, + FileReadOptions, + FileWriteOptions, + ListDirectoryOptions, + MakeDirectoryOptions, + RemoveOptions, + StatOptions, TerminateOptions, } from "@sandbox-kit/sandbox"; import { @@ -21,7 +31,12 @@ import { mapCreateRequest, mapSandboxInfo, } from "#mappings/mappings.js"; -import { mapModalError } from "#errors.js"; +import { + mapModalError, + requireLocalDestination, + requireLocalFile, + translateLocalCopyError, +} from "#errors.js"; import { BackendBase, ProviderBase } from "./provider.js"; import { captureProviderState, @@ -142,6 +157,128 @@ class ModalBackend extends BackendBase implements Backend { } } + async readFile( + id: string, + path: string, + _request: FileReadOptions, + options: OperationOptions, + ): Promise { + return this.#file("read_file", id, options, async (sandbox) => + sandbox.filesystem.readBytes(path), + ); + } + + async writeFile( + id: string, + path: string, + data: Uint8Array, + _request: FileWriteOptions, + options: OperationOptions, + ): Promise { + await this.#file("write_file", id, options, async (sandbox) => { + await sandbox.filesystem.writeBytes(data, path); + }); + } + + async copyFromLocal( + id: string, + localPath: string, + remotePath: string, + _request: FileCopyOptions, + options: OperationOptions, + ): Promise { + await requireLocalFile(localPath, "copy_from_local"); + await this.#file("copy_from_local", id, options, async (sandbox) => { + try { + await sandbox.filesystem.copyFromLocal(localPath, remotePath); + } catch (error) { + throw translateLocalCopyError(error, "copy_from_local"); + } + }); + } + + async copyToLocal( + id: string, + remotePath: string, + localPath: string, + _request: FileCopyOptions, + options: OperationOptions, + ): Promise { + await requireLocalDestination(localPath, "copy_to_local"); + await this.#file("copy_to_local", id, options, async (sandbox) => { + try { + await sandbox.filesystem.copyToLocal(remotePath, localPath); + } catch (error) { + throw translateLocalCopyError(error, "copy_to_local"); + } + }); + } + + async makeDirectory( + id: string, + path: string, + request: MakeDirectoryOptions, + options: OperationOptions, + ): Promise { + await this.#file("make_directory", id, options, async (sandbox) => { + await sandbox.filesystem.makeDirectory(path, { + createParents: request.parents ?? true, + }); + }); + } + + async listDirectory( + id: string, + path: string, + _request: ListDirectoryOptions, + options: OperationOptions, + ): Promise { + return this.#file("list_directory", id, options, async (sandbox) => { + const entries = await sandbox.filesystem.listFiles(path); + return entries.map((entry) => modalFileInfo(entry)); + }); + } + + async stat( + id: string, + path: string, + _request: StatOptions, + options: OperationOptions, + ): Promise { + return this.#file("stat", id, options, async (sandbox) => + modalFileInfo(await sandbox.filesystem.stat(path)), + ); + } + + async remove( + id: string, + path: string, + request: RemoveOptions, + options: OperationOptions, + ): Promise { + await this.#file("remove", id, options, async (sandbox) => { + await sandbox.filesystem.remove(path, { + recursive: request.recursive === true, + }); + }); + } + + async #file( + operation: string, + id: string, + options: OperationOptions, + body: (sandbox: ModalSandbox) => Promise, + ): Promise { + try { + throwIfAborted(options.signal); + const sandbox = await this.native.sandboxes.fromId(id); + throwIfAborted(options.signal); + return await body(sandbox); + } catch (error) { + throw mapModalError(error, operation); + } + } + async closeSandbox(id: string, options: OperationOptions): Promise { try { throwIfAborted(options.signal); @@ -161,6 +298,29 @@ class ModalBackend extends BackendBase implements Backend { } } +function modalFileInfo(info: ModalFileInfo): FileInfo { + const type = + info.type === "directory" + ? FileType.Directory + : info.type === "symlink" + ? FileType.Symlink + : FileType.File; + return { + name: info.name, + path: info.path, + type, + size: BigInt(Math.trunc(info.size)), + mode: (info.mode & 0o7777).toString(8).padStart(4, "0"), + ...(info.permissions ? { permissions: info.permissions } : {}), + ...(info.owner ? { owner: info.owner } : {}), + ...(info.group ? { group: info.group } : {}), + ...(info.symlinkTarget ? { symlinkTarget: info.symlinkTarget } : {}), + ...(Number.isFinite(info.modifiedTime) + ? { modifiedAt: new Date(info.modifiedTime * 1000) } + : {}), + }; +} + function throwIfAborted(signal: AbortSignal | undefined): void { signal?.throwIfAborted(); } diff --git a/sdks/typescript/providers/modal/tsconfig.json b/sdks/typescript/providers/modal/tsconfig.json index 5e62381c..35b5033f 100644 --- a/sdks/typescript/providers/modal/tsconfig.json +++ b/sdks/typescript/providers/modal/tsconfig.json @@ -4,6 +4,7 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], "declaration": true, "declarationMap": false, "outDir": "dist", diff --git a/sdks/typescript/providers/modal/vitest.config.ts b/sdks/typescript/providers/modal/vitest.config.ts index df10e2f0..da559838 100644 --- a/sdks/typescript/providers/modal/vitest.config.ts +++ b/sdks/typescript/providers/modal/vitest.config.ts @@ -1,3 +1,4 @@ +/// import path from "node:path"; import { fileURLToPath } from "node:url"; import { defineConfig } from "vitest/config"; diff --git a/sdks/typescript/sandbox/README.md b/sdks/typescript/sandbox/README.md index 3ab50500..a77a40a5 100644 --- a/sdks/typescript/sandbox/README.md +++ b/sdks/typescript/sandbox/README.md @@ -90,6 +90,7 @@ const fetched = await client.get(id); // provider-verified lookup | `delete` | Delete (`wait` when supported) | | `terminate` | Terminate (`wait` when supported) | | `close` | Close the handle. The sandbox keeps running | +| `filesystem` | Read, write, copy, list, mkdir, stat, remove | `supports` reports whether the provider implements that operation. An unimplemented method throws before the provider call. A provider rejection, diff --git a/sdks/typescript/sandbox/package.json b/sdks/typescript/sandbox/package.json index 6210a743..2852ed07 100644 --- a/sdks/typescript/sandbox/package.json +++ b/sdks/typescript/sandbox/package.json @@ -68,6 +68,7 @@ "test": "vitest run" }, "devDependencies": { + "@types/node": "24.10.1", "typescript": "5.9.3", "vitest": "4.1.11" } diff --git a/sdks/typescript/sandbox/src/client/client.test.ts b/sdks/typescript/sandbox/src/client/client.test.ts index 1f56c9d0..eaece14b 100644 --- a/sdks/typescript/sandbox/src/client/client.test.ts +++ b/sdks/typescript/sandbox/src/client/client.test.ts @@ -1,5 +1,7 @@ import { describe, expect, it } from "vitest"; import { + FileFieldLocalPath, + FileFieldPath, CreateFieldLifetimeIdleStopAfter, CreateFieldLifetimeIdleStopMode, CreateFieldNetwork, @@ -625,4 +627,54 @@ describe("Sandbox lifecycle", () => { await Promise.all([first, third]); expect(maximumActive).toBe(1); }); + + it("rejects a relative sandbox path before the provider call", async () => { + const { client, backend } = fixture(); + const files: Backend = backend; + let calls = 0; + files.readFile = async () => { + calls++; + return new Uint8Array(); + }; + const sandbox = await client.create(); + await expect(sandbox.filesystem.readFile("relative.txt")).rejects.toMatchObject({ + kind: ErrorKind.InvalidArgument, + operation: "read_file", + field: FileFieldPath, + }); + expect(calls).toBe(0); + }); + + it("reads an absolute path through the provider", async () => { + const { client, backend } = fixture(); + const files: Backend = backend; + files.readFile = async (_id, path) => { + expect(path).toBe("/workspace/note.txt"); + return new TextEncoder().encode("hello"); + }; + const sandbox = await client.create(); + const data = await sandbox.filesystem.readFile("/workspace/note.txt"); + expect(new TextDecoder().decode(data)).toBe("hello"); + }); + + it("requires a local path for copy", async () => { + const { client } = fixture(); + const sandbox = await client.create(); + await expect( + sandbox.filesystem.copyFromLocal("", "/workspace/note.txt"), + ).rejects.toMatchObject({ + kind: ErrorKind.InvalidArgument, + operation: "copy_from_local", + field: FileFieldLocalPath, + }); + }); + + it("reports filesystem methods the provider does not implement", async () => { + const { client } = fixture(); + const sandbox = await client.create(); + await expect(sandbox.filesystem.stat("/workspace")).rejects.toMatchObject({ + kind: ErrorKind.Unsupported, + operation: "stat", + }); + }); }); diff --git a/sdks/typescript/sandbox/src/client/client.ts b/sdks/typescript/sandbox/src/client/client.ts index 16a5924f..df8ca80d 100644 --- a/sdks/typescript/sandbox/src/client/client.ts +++ b/sdks/typescript/sandbox/src/client/client.ts @@ -1,6 +1,7 @@ // Client runtime behavior is handwritten. Portable request and response data // remain generated from protobuf. This module owns construction and create / -// attach / get / close; validation, errors, and the Sandbox handle live beside it. +// attach / get / close; validation, errors, and the Sandbox handle +// (lifecycle + filesystem) live beside it. import type { CreateOptions, @@ -40,6 +41,7 @@ export type { TokenPairCredentials, } from "#client/types.js"; export { ErrorKind, SandboxError, sandboxError } from "#client/errors.js"; +export { Filesystem } from "#client/filesystem.js"; export { Sandbox } from "#client/sandbox.js"; export { validateConfig, validateCreateOptions } from "#client/validation.js"; diff --git a/sdks/typescript/sandbox/src/client/filesystem.ts b/sdks/typescript/sandbox/src/client/filesystem.ts new file mode 100644 index 00000000..97dad718 --- /dev/null +++ b/sdks/typescript/sandbox/src/client/filesystem.ts @@ -0,0 +1,311 @@ +// Filesystem calls are handwritten. They validate paths, then dispatch +// through optional Backend methods. + +import { FileFieldLocalPath, FileFieldPath } from "#contracts/field_paths.js"; +import type { + FileCopyOptions, + FileInfo, + FileReadOptions, + FileWriteOptions, + ListDirectoryOptions, + MakeDirectoryOptions, + RemoveOptions, + StatOptions, +} from "#contracts/sandbox_data_contracts.js"; +import { ErrorKind, sandboxError, unsupported } from "#client/errors.js"; +import { awaitWithSignal, operationOptions } from "#client/operation.js"; +import type { Backend, OperationOptions } from "#client/types.js"; + +type FileCall = T & OperationOptions; + +interface FilesystemHost { + readonly providerName: string; + readonly id: string; + readonly backend: Backend; + run( + operation: string, + options: OperationOptions, + body: (signal: AbortSignal | undefined) => Promise, + ): Promise; +} + +/** + * File operations for one sandbox: read, write, copy to or from the caller, + * make directory, list directory, stat, and remove. Paths inside the sandbox + * are absolute. An omitted operation timeout uses the client timeout; explicit + * zero adds no Kit deadline. + */ +export class Filesystem { + constructor(private readonly host: FilesystemHost) {} + + /** Returns the bytes of the file at `path`. */ + readFile( + path: string, + options: FileCall = {}, + ): Promise { + return this.#call("read_file", path, options, (signal) => { + const method = this.host.backend.readFile; + if (!method) unsupported(this.host.providerName, "read_file"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + path, + requestFields(options), + operationOptions(options, signal), + ), + signal, + ); + }); + } + + /** Replaces the file at `path` and creates missing parent directories. */ + writeFile( + path: string, + data: Uint8Array, + options: FileCall = {}, + ): Promise { + return this.#call("write_file", path, options, (signal) => { + const method = this.host.backend.writeFile; + if (!method) unsupported(this.host.providerName, "write_file"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + path, + data, + requestFields(options), + operationOptions(options, signal), + ), + signal, + ); + }); + } + + /** Copies a file from the caller into the sandbox. */ + copyFromLocal( + localPath: string, + remotePath: string, + options: FileCall = {}, + ): Promise { + return this.#copy( + "copy_from_local", + localPath, + remotePath, + options, + (signal) => { + const method = this.host.backend.copyFromLocal; + if (!method) unsupported(this.host.providerName, "copy_from_local"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + localPath, + remotePath, + requestFields(options), + operationOptions(options, signal), + ), + signal, + ); + }, + ); + } + + /** + * Copies a sandbox file onto the caller's disk. + * Missing local parent directories are created. An existing local directory + * is rejected. + */ + copyToLocal( + remotePath: string, + localPath: string, + options: FileCall = {}, + ): Promise { + return this.#copy( + "copy_to_local", + localPath, + remotePath, + options, + (signal) => { + const method = this.host.backend.copyToLocal; + if (!method) unsupported(this.host.providerName, "copy_to_local"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + remotePath, + localPath, + requestFields(options), + operationOptions(options, signal), + ), + signal, + ); + }, + ); + } + + /** + * Creates the directory at `path`. + * An omitted `parents` flag is true: missing parents are created. + * Daytona rejects `false`. + */ + makeDirectory( + path: string, + options: FileCall = {}, + ): Promise { + return this.#call("make_directory", path, options, (signal) => { + const method = this.host.backend.makeDirectory; + if (!method) unsupported(this.host.providerName, "make_directory"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + path, + directoryRequest(options), + operationOptions(options, signal), + ), + signal, + ); + }); + } + + /** Lists the entries in one directory. */ + listDirectory( + path: string, + options: FileCall = {}, + ): Promise { + return this.#call("list_directory", path, options, (signal) => { + const method = this.host.backend.listDirectory; + if (!method) unsupported(this.host.providerName, "list_directory"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + path, + requestFields(options), + operationOptions(options, signal), + ), + signal, + ); + }); + } + + /** Returns metadata for one path. A symlink result describes the symlink. */ + stat(path: string, options: FileCall = {}): Promise { + return this.#call("stat", path, options, (signal) => { + const method = this.host.backend.stat; + if (!method) unsupported(this.host.providerName, "stat"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + path, + requestFields(options), + operationOptions(options, signal), + ), + signal, + ); + }); + } + + /** + * Removes a file, or a directory when `recursive` is set. + * An omitted `recursive` flag removes a file or an empty directory. + */ + remove(path: string, options: FileCall = {}): Promise { + return this.#call("remove", path, options, (signal) => { + const method = this.host.backend.remove; + if (!method) unsupported(this.host.providerName, "remove"); + return awaitWithSignal( + () => + method.call( + this.host.backend, + this.host.id, + path, + removeRequest(options), + operationOptions(options, signal), + ), + signal, + ); + }); + } + + async #call( + operation: string, + path: string, + options: OperationOptions, + body: (signal: AbortSignal | undefined) => Promise, + ): Promise { + absolutePath(this.host.providerName, operation, path); + return this.host.run(operation, options, body); + } + + async #copy( + operation: string, + localPath: string, + remotePath: string, + options: OperationOptions, + body: (signal: AbortSignal | undefined) => Promise, + ): Promise { + absolutePath(this.host.providerName, operation, remotePath); + callerPath(this.host.providerName, operation, localPath); + return this.host.run(operation, options, body); + } +} + +function absolutePath(provider: string, operation: string, path: string): void { + if (!path || !path.startsWith("/") || path.includes("\0")) { + throw sandboxError({ + kind: ErrorKind.InvalidArgument, + provider, + operation, + field: FileFieldPath, + message: "sandbox-kit: sandbox path must be absolute", + }); + } +} + +function callerPath(provider: string, operation: string, path: string): void { + if (!path || path.includes("\0")) { + throw sandboxError({ + kind: ErrorKind.InvalidArgument, + provider, + operation, + field: FileFieldLocalPath, + message: "sandbox-kit: local path is required", + }); + } +} + +function requestFields( + options: T & OperationOptions, +): T { + const request = {} as T; + if (options.timeout !== undefined) request.timeout = options.timeout; + return request; +} + +function directoryRequest( + options: FileCall, +): MakeDirectoryOptions { + return { + ...requestFields(options), + ...(options.parents === undefined ? {} : { parents: options.parents }), + }; +} + +function removeRequest(options: FileCall): RemoveOptions { + return { + ...requestFields(options), + ...(options.recursive === undefined + ? {} + : { recursive: options.recursive }), + }; +} diff --git a/sdks/typescript/sandbox/src/client/sandbox.ts b/sdks/typescript/sandbox/src/client/sandbox.ts index 93ceefad..3d9fc4ee 100644 --- a/sdks/typescript/sandbox/src/client/sandbox.ts +++ b/sdks/typescript/sandbox/src/client/sandbox.ts @@ -1,5 +1,5 @@ -// Sandbox handle runtime behavior is handwritten. Lifecycle methods dispatch -// through optional Backend methods. +// Sandbox handle runtime behavior is handwritten. Lifecycle and filesystem +// methods dispatch through optional Backend methods. import { type ArchiveOptions, @@ -20,6 +20,7 @@ import { operationSignal, publicTimeoutOptions, } from "#client/operation.js"; +import { Filesystem } from "#client/filesystem.js"; import type { Backend, DeleteCallOptions, @@ -41,12 +42,18 @@ export interface SandboxInit { /** * Handle for one cloud sandbox. - * Lifecycle methods change it. `close` leaves it as it is, and you can keep + * Lifecycle methods change it. `filesystem` exposes the shared file + * operations. `close` leaves the cloud sandbox as it is, and you can keep * using the handle. */ export class Sandbox implements AsyncDisposable { readonly #backend: Backend; readonly #timeout: number | undefined; + /** + * File operations for this sandbox: read, write, copy, make directory, list, + * stat, and remove. Paths inside the sandbox are absolute. + */ + readonly filesystem: Filesystem; #info: SandboxInfo; #tail: Promise = Promise.resolve(); constructor(token: typeof sandboxConstructorToken, init: SandboxInit) { @@ -55,6 +62,18 @@ export class Sandbox implements AsyncDisposable { this.#backend = init.backend; this.#info = clone(init.info); this.#timeout = init.timeout; + this.filesystem = new Filesystem({ + providerName: this.providerName, + id: this.id, + backend: this.#backend, + run: (operation, options, body) => + this.#serialized( + operation, + options, + options.timeout ?? this.#timeout, + body, + ), + }); } /** Sandbox identifier. */ get id(): string { @@ -68,11 +87,18 @@ export class Sandbox implements AsyncDisposable { info(): SandboxInfo { return clone(this.#info); } - /** Lifecycle operations this provider implements. */ + /** + * Lifecycle operations this provider implements. + * File operations are not lifecycle capabilities; use {@link filesystem}. + */ capabilities(): readonly LifecycleCapability[] { return providerCapabilities(this.#backend); } - /** Reports whether this provider implements `capability`. */ + /** + * Reports whether this provider implements a lifecycle `capability`. + * File operations are checked by calling {@link filesystem} methods, not + * `supports`. + */ supports(capability: LifecycleCapability): boolean { return this.capabilities().includes(capability); } diff --git a/sdks/typescript/sandbox/src/client/types.ts b/sdks/typescript/sandbox/src/client/types.ts index 431d0949..fae199d2 100644 --- a/sdks/typescript/sandbox/src/client/types.ts +++ b/sdks/typescript/sandbox/src/client/types.ts @@ -1,5 +1,5 @@ // Public client / provider / backend contracts are handwritten facades over -// portable protobuf config and create/lifecycle option types. +// portable protobuf config, create/lifecycle, and filesystem option types. import type { MessageInitShape } from "@bufbuild/protobuf"; import { @@ -16,7 +16,15 @@ import type { CreateResult, DeleteOptions, ExitResult, + FileCopyOptions, + FileInfo, + FileReadOptions, + FileWriteOptions, + ListDirectoryOptions, + MakeDirectoryOptions, PauseOptions, + RemoveOptions, + StatOptions, SandboxInfo, StartOptions, StopOptions, @@ -101,6 +109,57 @@ export interface Backend { request: DeleteOptions, options: OperationOptions, ): Promise; + readFile?( + id: string, + path: string, + request: FileReadOptions, + options: OperationOptions, + ): Promise; + writeFile?( + id: string, + path: string, + data: Uint8Array, + request: FileWriteOptions, + options: OperationOptions, + ): Promise; + copyFromLocal?( + id: string, + localPath: string, + remotePath: string, + request: FileCopyOptions, + options: OperationOptions, + ): Promise; + copyToLocal?( + id: string, + remotePath: string, + localPath: string, + request: FileCopyOptions, + options: OperationOptions, + ): Promise; + makeDirectory?( + id: string, + path: string, + request: MakeDirectoryOptions, + options: OperationOptions, + ): Promise; + listDirectory?( + id: string, + path: string, + request: ListDirectoryOptions, + options: OperationOptions, + ): Promise; + stat?( + id: string, + path: string, + request: StatOptions, + options: OperationOptions, + ): Promise; + remove?( + id: string, + path: string, + request: RemoveOptions, + options: OperationOptions, + ): Promise; close(options: OperationOptions): Promise; closeSandbox(id: string, options: OperationOptions): Promise; } diff --git a/sdks/typescript/sandbox/src/contracts/field_paths.ts b/sdks/typescript/sandbox/src/contracts/field_paths.ts index 7c4bd8b9..e63dabeb 100644 --- a/sdks/typescript/sandbox/src/contracts/field_paths.ts +++ b/sdks/typescript/sandbox/src/contracts/field_paths.ts @@ -1,5 +1,5 @@ -// Field-path constants identify create/info settings in errors. -// Values are canonical protobuf paths (snake_case), matching Go. +// Field-path constants identify create, info, result, and filesystem settings +// in errors. Values are canonical protobuf paths (snake_case), matching Go. // // Example: // @@ -12,31 +12,36 @@ export const CreateFieldName = "name" as const; export const CreateFieldSource = "source" as const; /** Canonical path "source.provider_default". */ -export const CreateFieldSourceProviderDefault = "source.provider_default" as const; +export const CreateFieldSourceProviderDefault = + "source.provider_default" as const; /** Canonical path "source.image". */ export const CreateFieldSourceImage = "source.image" as const; /** Canonical path "source.image.reference". */ -export const CreateFieldSourceImageReference = "source.image.reference" as const; +export const CreateFieldSourceImageReference = + "source.image.reference" as const; /** Canonical path "source.snapshot". */ export const CreateFieldSourceSnapshot = "source.snapshot" as const; /** Canonical path "source.snapshot.reference". */ -export const CreateFieldSourceSnapshotReference = "source.snapshot.reference" as const; +export const CreateFieldSourceSnapshotReference = + "source.snapshot.reference" as const; /** Canonical path "source.snapshot.kind". */ export const CreateFieldSourceSnapshotKind = "source.snapshot.kind" as const; /** Canonical path "source.snapshot.provider_kind". */ -export const CreateFieldSourceSnapshotProviderKind = "source.snapshot.provider_kind" as const; +export const CreateFieldSourceSnapshotProviderKind = + "source.snapshot.provider_kind" as const; /** Canonical path "source.warm_pool". */ export const CreateFieldSourceWarmPool = "source.warm_pool" as const; /** Canonical path "source.warm_pool.reference". */ -export const CreateFieldSourceWarmPoolReference = "source.warm_pool.reference" as const; +export const CreateFieldSourceWarmPoolReference = + "source.warm_pool.reference" as const; /** Canonical path "runtime". */ export const CreateFieldRuntime = "runtime" as const; @@ -51,7 +56,8 @@ export const CreateFieldRuntimeVersion = "runtime.version" as const; export const CreateFieldRuntimeUser = "runtime.user" as const; /** Canonical path "runtime.working_directory". */ -export const CreateFieldRuntimeWorkingDirectory = "runtime.working_directory" as const; +export const CreateFieldRuntimeWorkingDirectory = + "runtime.working_directory" as const; /** Canonical path "runtime.entrypoint". */ export const CreateFieldRuntimeEntrypoint = "runtime.entrypoint" as const; @@ -66,10 +72,12 @@ export const CreateFieldIsolation = "isolation" as const; export const CreateFieldIsolationKind = "isolation.kind" as const; /** Canonical path "isolation.provider_kind". */ -export const CreateFieldIsolationProviderKind = "isolation.provider_kind" as const; +export const CreateFieldIsolationProviderKind = + "isolation.provider_kind" as const; /** Canonical path "isolation.nested_virtualization". */ -export const CreateFieldIsolationNestedVirtualization = "isolation.nested_virtualization" as const; +export const CreateFieldIsolationNestedVirtualization = + "isolation.nested_virtualization" as const; /** Canonical path "resources". */ export const CreateFieldResources = "resources" as const; @@ -78,13 +86,15 @@ export const CreateFieldResources = "resources" as const; export const CreateFieldResourcesCpuCores = "resources.cpu_cores" as const; /** Canonical path "resources.cpu_limit_cores". */ -export const CreateFieldResourcesCpuLimitCores = "resources.cpu_limit_cores" as const; +export const CreateFieldResourcesCpuLimitCores = + "resources.cpu_limit_cores" as const; /** Canonical path "resources.memory_mib". */ export const CreateFieldResourcesMemoryMib = "resources.memory_mib" as const; /** Canonical path "resources.memory_limit_mib". */ -export const CreateFieldResourcesMemoryLimitMib = "resources.memory_limit_mib" as const; +export const CreateFieldResourcesMemoryLimitMib = + "resources.memory_limit_mib" as const; /** Canonical path "resources.disk_mib". */ export const CreateFieldResourcesDiskMib = "resources.disk_mib" as const; @@ -114,34 +124,43 @@ export const CreateFieldNetwork = "network" as const; export const CreateFieldNetworkEgress = "network.egress" as const; /** Canonical path "network.outbound_cidrs". */ -export const CreateFieldNetworkOutboundCidrs = "network.outbound_cidrs" as const; +export const CreateFieldNetworkOutboundCidrs = + "network.outbound_cidrs" as const; /** Canonical path "network.outbound_cidrs.entries". */ -export const CreateFieldNetworkOutboundCidrsEntries = "network.outbound_cidrs.entries" as const; +export const CreateFieldNetworkOutboundCidrsEntries = + "network.outbound_cidrs.entries" as const; /** Canonical path "network.outbound_domains". */ -export const CreateFieldNetworkOutboundDomains = "network.outbound_domains" as const; +export const CreateFieldNetworkOutboundDomains = + "network.outbound_domains" as const; /** Canonical path "network.outbound_domains.entries". */ -export const CreateFieldNetworkOutboundDomainsEntries = "network.outbound_domains.entries" as const; +export const CreateFieldNetworkOutboundDomainsEntries = + "network.outbound_domains.entries" as const; /** Canonical path "network.inbound_cidrs". */ export const CreateFieldNetworkInboundCidrs = "network.inbound_cidrs" as const; /** Canonical path "network.inbound_cidrs.entries". */ -export const CreateFieldNetworkInboundCidrsEntries = "network.inbound_cidrs.entries" as const; +export const CreateFieldNetworkInboundCidrsEntries = + "network.inbound_cidrs.entries" as const; /** Canonical path "network.private_network". */ -export const CreateFieldNetworkPrivateNetwork = "network.private_network" as const; +export const CreateFieldNetworkPrivateNetwork = + "network.private_network" as const; /** Canonical path "network.linked_sandbox". */ -export const CreateFieldNetworkLinkedSandbox = "network.linked_sandbox" as const; +export const CreateFieldNetworkLinkedSandbox = + "network.linked_sandbox" as const; /** Canonical path "network.proxy_reference". */ -export const CreateFieldNetworkProxyReference = "network.proxy_reference" as const; +export const CreateFieldNetworkProxyReference = + "network.proxy_reference" as const; /** Canonical path "network.outbound_proxy_url". */ -export const CreateFieldNetworkOutboundProxyUrl = "network.outbound_proxy_url" as const; +export const CreateFieldNetworkOutboundProxyUrl = + "network.outbound_proxy_url" as const; /** Canonical path "network.custom_domain". */ export const CreateFieldNetworkCustomDomain = "network.custom_domain" as const; @@ -153,82 +172,102 @@ export const CreateFieldNetworkPorts = "network.ports" as const; export const CreateFieldNetworkPortsPort = "network.ports.port" as const; /** Canonical path "network.ports.transport". */ -export const CreateFieldNetworkPortsTransport = "network.ports.transport" as const; +export const CreateFieldNetworkPortsTransport = + "network.ports.transport" as const; /** Canonical path "security". */ export const CreateFieldSecurity = "security" as const; /** Canonical path "security.public_access". */ -export const CreateFieldSecurityPublicAccess = "security.public_access" as const; +export const CreateFieldSecurityPublicAccess = + "security.public_access" as const; /** Canonical path "security.workload_identity". */ -export const CreateFieldSecurityWorkloadIdentity = "security.workload_identity" as const; +export const CreateFieldSecurityWorkloadIdentity = + "security.workload_identity" as const; /** Canonical path "security.secrets". */ export const CreateFieldSecuritySecrets = "security.secrets" as const; /** Canonical path "security.secrets.reference". */ -export const CreateFieldSecuritySecretsReference = "security.secrets.reference" as const; +export const CreateFieldSecuritySecretsReference = + "security.secrets.reference" as const; /** Canonical path "security.secrets.environment_variable". */ -export const CreateFieldSecuritySecretsEnvironmentVariable = "security.secrets.environment_variable" as const; +export const CreateFieldSecuritySecretsEnvironmentVariable = + "security.secrets.environment_variable" as const; /** Canonical path "security.secrets.injection". */ -export const CreateFieldSecuritySecretsInjection = "security.secrets.injection" as const; +export const CreateFieldSecuritySecretsInjection = + "security.secrets.injection" as const; /** Canonical path "lifetime". */ export const CreateFieldLifetime = "lifetime" as const; /** Canonical path "lifetime.maximum_lifetime". */ -export const CreateFieldLifetimeMaximumLifetime = "lifetime.maximum_lifetime" as const; +export const CreateFieldLifetimeMaximumLifetime = + "lifetime.maximum_lifetime" as const; /** Canonical path "lifetime.ephemeral". */ export const CreateFieldLifetimeEphemeral = "lifetime.ephemeral" as const; /** Canonical path "lifetime.idle_terminate". */ -export const CreateFieldLifetimeIdleTerminate = "lifetime.idle_terminate" as const; +export const CreateFieldLifetimeIdleTerminate = + "lifetime.idle_terminate" as const; /** Canonical path "lifetime.idle_terminate.mode". */ -export const CreateFieldLifetimeIdleTerminateMode = "lifetime.idle_terminate.mode" as const; +export const CreateFieldLifetimeIdleTerminateMode = + "lifetime.idle_terminate.mode" as const; /** Canonical path "lifetime.idle_terminate.after". */ -export const CreateFieldLifetimeIdleTerminateAfter = "lifetime.idle_terminate.after" as const; +export const CreateFieldLifetimeIdleTerminateAfter = + "lifetime.idle_terminate.after" as const; /** Canonical path "lifetime.idle_stop". */ export const CreateFieldLifetimeIdleStop = "lifetime.idle_stop" as const; /** Canonical path "lifetime.idle_stop.mode". */ -export const CreateFieldLifetimeIdleStopMode = "lifetime.idle_stop.mode" as const; +export const CreateFieldLifetimeIdleStopMode = + "lifetime.idle_stop.mode" as const; /** Canonical path "lifetime.idle_stop.after". */ -export const CreateFieldLifetimeIdleStopAfter = "lifetime.idle_stop.after" as const; +export const CreateFieldLifetimeIdleStopAfter = + "lifetime.idle_stop.after" as const; /** Canonical path "lifetime.idle_pause". */ export const CreateFieldLifetimeIdlePause = "lifetime.idle_pause" as const; /** Canonical path "lifetime.idle_pause.mode". */ -export const CreateFieldLifetimeIdlePauseMode = "lifetime.idle_pause.mode" as const; +export const CreateFieldLifetimeIdlePauseMode = + "lifetime.idle_pause.mode" as const; /** Canonical path "lifetime.idle_pause.after". */ -export const CreateFieldLifetimeIdlePauseAfter = "lifetime.idle_pause.after" as const; +export const CreateFieldLifetimeIdlePauseAfter = + "lifetime.idle_pause.after" as const; /** Canonical path "lifetime.stopped_archive". */ -export const CreateFieldLifetimeStoppedArchive = "lifetime.stopped_archive" as const; +export const CreateFieldLifetimeStoppedArchive = + "lifetime.stopped_archive" as const; /** Canonical path "lifetime.stopped_archive.mode". */ -export const CreateFieldLifetimeStoppedArchiveMode = "lifetime.stopped_archive.mode" as const; +export const CreateFieldLifetimeStoppedArchiveMode = + "lifetime.stopped_archive.mode" as const; /** Canonical path "lifetime.stopped_archive.after". */ -export const CreateFieldLifetimeStoppedArchiveAfter = "lifetime.stopped_archive.after" as const; +export const CreateFieldLifetimeStoppedArchiveAfter = + "lifetime.stopped_archive.after" as const; /** Canonical path "lifetime.stopped_delete". */ -export const CreateFieldLifetimeStoppedDelete = "lifetime.stopped_delete" as const; +export const CreateFieldLifetimeStoppedDelete = + "lifetime.stopped_delete" as const; /** Canonical path "lifetime.stopped_delete.mode". */ -export const CreateFieldLifetimeStoppedDeleteMode = "lifetime.stopped_delete.mode" as const; +export const CreateFieldLifetimeStoppedDeleteMode = + "lifetime.stopped_delete.mode" as const; /** Canonical path "lifetime.stopped_delete.after". */ -export const CreateFieldLifetimeStoppedDeleteAfter = "lifetime.stopped_delete.after" as const; +export const CreateFieldLifetimeStoppedDeleteAfter = + "lifetime.stopped_delete.after" as const; /** Canonical path "provisioning". */ export const CreateFieldProvisioning = "provisioning" as const; @@ -237,7 +276,8 @@ export const CreateFieldProvisioning = "provisioning" as const; export const CreateFieldProvisioningTimeout = "provisioning.timeout" as const; /** Canonical path "provisioning.queue_timeout". */ -export const CreateFieldProvisioningQueueTimeout = "provisioning.queue_timeout" as const; +export const CreateFieldProvisioningQueueTimeout = + "provisioning.queue_timeout" as const; /** Canonical path "provisioning.wait_for". */ export const CreateFieldProvisioningWaitFor = "provisioning.wait_for" as const; @@ -252,7 +292,8 @@ export const CreateFieldReadinessTcpPort = "readiness.tcp_port" as const; export const CreateFieldReadinessCommand = "readiness.command" as const; /** Canonical path "readiness.command.argv". */ -export const CreateFieldReadinessCommandArgv = "readiness.command.argv" as const; +export const CreateFieldReadinessCommandArgv = + "readiness.command.argv" as const; /** Canonical path "observability". */ export const CreateFieldObservability = "observability" as const; @@ -261,7 +302,8 @@ export const CreateFieldObservability = "observability" as const; export const CreateFieldObservabilityVerbose = "observability.verbose" as const; /** Canonical path "observability.telemetry_endpoint". */ -export const CreateFieldObservabilityTelemetryEndpoint = "observability.telemetry_endpoint" as const; +export const CreateFieldObservabilityTelemetryEndpoint = + "observability.telemetry_endpoint" as const; /** Canonical path "id". */ export const InfoFieldId = "id" as const; @@ -285,10 +327,12 @@ export const InfoFieldIsolation = "isolation" as const; export const InfoFieldIsolationKind = "isolation.kind" as const; /** Canonical path "isolation.provider_kind". */ -export const InfoFieldIsolationProviderKind = "isolation.provider_kind" as const; +export const InfoFieldIsolationProviderKind = + "isolation.provider_kind" as const; /** Canonical path "isolation.nested_virtualization". */ -export const InfoFieldIsolationNestedVirtualization = "isolation.nested_virtualization" as const; +export const InfoFieldIsolationNestedVirtualization = + "isolation.nested_virtualization" as const; /** Canonical path "resources". */ export const InfoFieldResources = "resources" as const; @@ -297,13 +341,15 @@ export const InfoFieldResources = "resources" as const; export const InfoFieldResourcesCpuCores = "resources.cpu_cores" as const; /** Canonical path "resources.cpu_limit_cores". */ -export const InfoFieldResourcesCpuLimitCores = "resources.cpu_limit_cores" as const; +export const InfoFieldResourcesCpuLimitCores = + "resources.cpu_limit_cores" as const; /** Canonical path "resources.memory_mib". */ export const InfoFieldResourcesMemoryMib = "resources.memory_mib" as const; /** Canonical path "resources.memory_limit_mib". */ -export const InfoFieldResourcesMemoryLimitMib = "resources.memory_limit_mib" as const; +export const InfoFieldResourcesMemoryLimitMib = + "resources.memory_limit_mib" as const; /** Canonical path "resources.disk_mib". */ export const InfoFieldResourcesDiskMib = "resources.disk_mib" as const; @@ -325,3 +371,12 @@ export const InfoFieldTerminal = "terminal" as const; /** Canonical path "exit_code" on ExitResult. */ export const ResultFieldExitCode = "exit_code" as const; + +/** Canonical path "path" on a filesystem call. */ +export const FileFieldPath = "path" as const; + +/** Canonical path "local_path" on a copy between the caller and the sandbox. */ +export const FileFieldLocalPath = "local_path" as const; + +/** Canonical path "parents" on MakeDirectoryOptions. */ +export const FileFieldParents = "parents" as const; diff --git a/sdks/typescript/sandbox/src/contracts/sandbox_data_contracts.ts b/sdks/typescript/sandbox/src/contracts/sandbox_data_contracts.ts index 4dc03e01..192dd90d 100644 --- a/sdks/typescript/sandbox/src/contracts/sandbox_data_contracts.ts +++ b/sdks/typescript/sandbox/src/contracts/sandbox_data_contracts.ts @@ -16,6 +16,7 @@ import { PortTransport as ProtoPortTransport, SandboxState as ProtoSandboxState, SecretInjection as ProtoSecretInjection, + FileType as ProtoFileType, SnapshotKind as ProtoSnapshotKind, WaitCondition as ProtoWaitCondition, type ArchiveOptions as ProtoArchiveOptions, @@ -24,6 +25,14 @@ import { type DeleteOptions as ProtoDeleteOptions, type ErrorInfo as ProtoErrorInfo, type ExitResult as ProtoExitResult, + type FileCopyOptions as ProtoFileCopyOptions, + type FileInfo as ProtoFileInfo, + type FileReadOptions as ProtoFileReadOptions, + type FileWriteOptions as ProtoFileWriteOptions, + type ListDirectoryOptions as ProtoListDirectoryOptions, + type MakeDirectoryOptions as ProtoMakeDirectoryOptions, + type RemoveOptions as ProtoRemoveOptions, + type StatOptions as ProtoStatOptions, type IsolationConfig as ProtoIsolationConfig, type MetadataList as ProtoMetadataList, type MetadataObject as ProtoMetadataObject, @@ -80,6 +89,28 @@ export type ArchiveOptions = DurationFieldsToMs< >; export type DeleteOptions = DurationFieldsToMs>; export type ExitResult = StripProto; +export type FileInfo = StripProto; +/** + * Public filesystem call options for `Backend` and provider adapters (ms + * timeouts). Same duration remapping as {@link CreateOptions}. + */ +export type FileReadOptions = DurationFieldsToMs< + StripProto +>; +export type FileWriteOptions = DurationFieldsToMs< + StripProto +>; +export type FileCopyOptions = DurationFieldsToMs< + StripProto +>; +export type MakeDirectoryOptions = DurationFieldsToMs< + StripProto +>; +export type ListDirectoryOptions = DurationFieldsToMs< + StripProto +>; +export type StatOptions = DurationFieldsToMs>; +export type RemoveOptions = DurationFieldsToMs>; export type MetadataValue = StripProto; export type MetadataList = StripProto; export type MetadataObject = StripProto; @@ -171,3 +202,6 @@ export type SandboxState = (typeof SandboxState)[keyof typeof SandboxState]; export const LifecycleCapability = protoEnum(ProtoLifecycleCapability); export type LifecycleCapability = (typeof LifecycleCapability)[keyof typeof LifecycleCapability]; + +export const FileType = protoEnum(ProtoFileType); +export type FileType = (typeof FileType)[keyof typeof FileType]; diff --git a/sdks/typescript/sandbox/tsconfig.json b/sdks/typescript/sandbox/tsconfig.json index 5e62381c..35b5033f 100644 --- a/sdks/typescript/sandbox/tsconfig.json +++ b/sdks/typescript/sandbox/tsconfig.json @@ -4,6 +4,7 @@ "module": "NodeNext", "moduleResolution": "NodeNext", "lib": ["ES2022", "DOM", "ESNext.Disposable"], + "types": ["node"], "declaration": true, "declarationMap": false, "outDir": "dist", diff --git a/sdks/typescript/sandbox/vitest.config.ts b/sdks/typescript/sandbox/vitest.config.ts index fe1a81d7..75a75ead 100644 --- a/sdks/typescript/sandbox/vitest.config.ts +++ b/sdks/typescript/sandbox/vitest.config.ts @@ -1,3 +1,4 @@ +/// import path from "node:path"; import { fileURLToPath } from "node:url"; import { defineConfig } from "vitest/config"; diff --git a/tooling/README.md b/tooling/README.md index f2533022..d22d9489 100644 --- a/tooling/README.md +++ b/tooling/README.md @@ -45,8 +45,9 @@ Use `--repo /absolute/path/to/kit` elsewhere. `--against` to add a breaking-change comparison against a Git or Buf input. `generate contracts-go` / `contracts-typescript` run `buf generate` using the -root `buf.gen.yaml` (Go + TypeScript plugins) and refresh contract packages -under `sdks//contracts/`. Protovalidate options travel with the +root `buf.gen.yaml` (Go + TypeScript plugins). Go contracts land in +`sdks/go/internal/contracts/`; TypeScript contracts land in +`sdks/typescript/contracts/`. Protovalidate options travel with the descriptors; SDKs evaluate create and client-config rules at runtime (`secure_endpoint` stays handwritten). `contracts-typescript` also runs `npm run build` in `sdks/typescript/contracts` so `@sandbox-kit/contracts` @@ -54,8 +55,9 @@ exports compiled descriptors from `dist/` via `@sandbox-kit/contracts/sandbox` and `@sandbox-kit/contracts/client`. `test go` tests the public SDK, tooling, both providers, and every independent -Go example module registered by the command. Example tests use dummy credentials -and local servers; they create no cloud resources. +Go example module registered by the command. It also checks that `go.work.sum` +matches the checksums written by loading those modules' packages. Example tests +use dummy credentials and local servers; they create no cloud resources. `test typescript` builds contracts first, then builds and tests the shared package and both providers, discovers every TypeScript example containing a @@ -72,9 +74,12 @@ verified with its own `go.mod` and local replacements. The root `go.work` is for working across modules in an editor. Run `go version` in the same terminal to confirm Go 1.26.0 or newer; restart the editor's Go language server after upgrading. -`go work sync` can update dependency versions in individual `go.mod` files. -After using it, run `GOWORK=off go mod tidy` inside each affected module to update -its `go.sum`, then run `sandbox-kit test go` again. +Change a module's dependencies inside that module with `GOWORK=off` (`go get`, +then `go mod tidy`). `go work sync` and `go list -m all` read every `go.mod` in +the requirement graph. That downloads `go.mod` files for modules the build does +not import, including test requirements of `google.golang.org/grpc` and the +plot, PDF, font, and example modules those requirements name, and appends their +checksums to `go.work.sum`. `go mod tidy` leaves `go.work.sum` unchanged. ## Layout diff --git a/tooling/internal/commands/commands_test.go b/tooling/internal/commands/commands_test.go index 7371bfa0..258a635a 100644 --- a/tooling/internal/commands/commands_test.go +++ b/tooling/internal/commands/commands_test.go @@ -99,6 +99,55 @@ func TestContractsGenerationSurfacesBufFailure(t *testing.T) { } } +func TestWorkspaceSumCheckSkipsRepoWithoutGoWork(t *testing.T) { + repo := repositoryFixture(t) + if err := checkWorkspaceSum(context.Background(), repo, "go"); err != nil { + t.Fatal(err) + } +} + +func TestWorkspaceModulesReadsUseBlock(t *testing.T) { + repo := repositoryFixture(t) + work := "go 1.26.0\n\nuse (\n\t./sdks/go/sandbox\n\t// comment\n\n\t./tooling\n)\n" + if err := os.WriteFile(filepath.Join(repo, "go.work"), []byte(work), 0o644); err != nil { + t.Fatal(err) + } + modules, err := workspaceModules(filepath.Join(repo, "go.work")) + if err != nil { + t.Fatal(err) + } + want := []string{"sdks/go/sandbox", "tooling"} + if !reflect.DeepEqual(modules, want) { + t.Fatalf("modules = %#v, want %#v", modules, want) + } +} + +func TestWorkspaceSumDriftReportsGraphOnlyChecksums(t *testing.T) { + committed := []byte("cel.dev/expr v0.25.2/go.mod h1:def\ngonum.org/v1/plot v0.16.0/go.mod h1:abc\n") + rebuilt := []byte("cel.dev/expr v0.25.2/go.mod h1:def\n") + extra, missing := workspaceSumDrift(committed, rebuilt) + if len(missing) != 0 || len(extra) != 1 || extra[0] != "gonum.org/v1/plot v0.16.0/go.mod" { + t.Fatalf("extra=%v missing=%v", extra, missing) + } + message := formatWorkspaceSumDrift(extra, missing) + if !strings.Contains(message, "gonum.org/v1/plot v0.16.0/go.mod") || !strings.Contains(message, "go work sync") { + t.Fatalf("drift message = %q", message) + } +} + +func TestWorkspaceSumMatchesPackageLoads(t *testing.T) { + root, err := filepath.Abs(filepath.Join("..", "..", "..")) + if err != nil { + t.Fatal(err) + } + if !isRepository(root) { + t.Fatalf("repository root not found at %s", root) + } + if err := checkWorkspaceSum(context.Background(), root, "go"); err != nil { + t.Fatal(err) + } +} + func TestVerificationIncludesEveryGoModuleAndExample(t *testing.T) { repo := repositoryFixture(t) runner := &recordingRunner{} @@ -144,8 +193,8 @@ func TestProtoVerificationUsesBufAndOptionalBaseline(t *testing.T) { func TestTypeScriptVerificationBuildsBeforeTests(t *testing.T) { repo := repositoryFixture(t) for _, path := range []string{ - "examples/typescript/daytona/create-daytona-sandbox", - "examples/typescript/modal/create-modal-sandbox", + "examples/typescript/daytona/configuration/create-daytona-sandbox", + "examples/typescript/modal/configuration/create-modal-sandbox", } { dir := filepath.Join(repo, filepath.FromSlash(path)) if err := os.MkdirAll(dir, 0o755); err != nil { diff --git a/tooling/internal/commands/test.go b/tooling/internal/commands/test.go index f1981862..69d335a6 100644 --- a/tooling/internal/commands/test.go +++ b/tooling/internal/commands/test.go @@ -11,31 +11,47 @@ import ( var goTestModules = []string{ "sdks/go/sandbox", "tooling", "sdks/go/providers/modal", "sdks/go/providers/daytona", - "examples/go/modal/create-modal-sandbox", "examples/go/daytona/create-daytona-sandbox", - "examples/go/modal/create-modal-with-resources", "examples/go/daytona/create-daytona-with-policies", - "examples/go/daytona/create-daytona-from-snapshot", "examples/go/daytona/create-daytona-from-image", - "examples/go/daytona/create-daytona-with-runtime", - "examples/go/daytona/create-daytona-ephemeral", "examples/go/daytona/create-daytona-linked", - "examples/go/daytona/create-daytona-with-kvm", "examples/go/daytona/create-daytona-with-labels", - "examples/go/daytona/create-daytona-with-network", "examples/go/daytona/create-daytona-with-secrets", - "examples/go/daytona/create-daytona-with-ttl", - "examples/go/modal/create-modal-with-runtime", "examples/go/modal/create-modal-gvisor", - "examples/go/modal/create-modal-linux-vm", "examples/go/modal/create-modal-with-placement", - "examples/go/modal/create-modal-with-labels", "examples/go/modal/create-modal-with-network", - "examples/go/modal/create-modal-idle", "examples/go/modal/create-modal-ready", - "examples/go/modal/create-modal-verbose", "examples/go/modal/create-modal-with-identity", - "examples/go/modal/handle-modal-errors", "examples/go/daytona/handle-daytona-errors", - "examples/go/daytona/stop-daytona-sandbox", "examples/go/modal/terminate-modal-sandbox", - "examples/go/daytona/get-daytona-sandbox", "examples/go/daytona/refresh-daytona-sandbox", - "examples/go/daytona/start-daytona-sandbox", "examples/go/daytona/pause-daytona-sandbox", - "examples/go/daytona/archive-daytona-sandbox", "examples/go/daytona/delete-daytona-sandbox", - "examples/go/daytona/force-stop-daytona-sandbox", "examples/go/daytona/request-daytona-deletion", - "examples/go/daytona/start-daytona-with-timeout", - "examples/go/modal/attach-modal-sandbox", "examples/go/modal/request-modal-termination", - "examples/go/daytona/close-daytona-handle", "examples/go/modal/close-modal-handle", - "examples/go/modal/create-modal-client-timeout", "examples/go/modal/create-modal-tcp-ready", - "examples/go/modal/create-modal-with-allowlists", "examples/go/modal/create-modal-with-ports", - "examples/go/modal/create-modal-with-secrets", "examples/go/modal/terminate-modal-with-timeout", + "examples/go/modal/configuration/create-modal-sandbox", "examples/go/daytona/configuration/create-daytona-sandbox", + "examples/go/modal/configuration/create-modal-with-resources", "examples/go/daytona/configuration/create-daytona-with-policies", + "examples/go/daytona/configuration/create-daytona-from-snapshot", "examples/go/daytona/configuration/create-daytona-from-image", + "examples/go/daytona/configuration/create-daytona-with-runtime", + "examples/go/daytona/configuration/create-daytona-ephemeral", "examples/go/daytona/configuration/create-daytona-linked", + "examples/go/daytona/configuration/create-daytona-with-kvm", "examples/go/daytona/configuration/create-daytona-with-labels", + "examples/go/daytona/configuration/create-daytona-with-network", "examples/go/daytona/configuration/create-daytona-with-secrets", + "examples/go/daytona/configuration/create-daytona-with-ttl", + "examples/go/modal/configuration/create-modal-with-runtime", "examples/go/modal/configuration/create-modal-gvisor", + "examples/go/modal/configuration/create-modal-linux-vm", "examples/go/modal/configuration/create-modal-with-placement", + "examples/go/modal/configuration/create-modal-with-labels", "examples/go/modal/configuration/create-modal-with-network", + "examples/go/modal/configuration/create-modal-idle", "examples/go/modal/configuration/create-modal-ready", + "examples/go/modal/configuration/create-modal-verbose", "examples/go/modal/configuration/create-modal-with-identity", + "examples/go/modal/errors/handle-modal-errors", "examples/go/daytona/errors/handle-daytona-errors", + "examples/go/daytona/lifecycle/stop-daytona-sandbox", "examples/go/modal/lifecycle/terminate-modal-sandbox", + "examples/go/daytona/lifecycle/get-daytona-sandbox", "examples/go/daytona/lifecycle/refresh-daytona-sandbox", + "examples/go/daytona/lifecycle/start-daytona-sandbox", "examples/go/daytona/lifecycle/pause-daytona-sandbox", + "examples/go/daytona/lifecycle/archive-daytona-sandbox", "examples/go/daytona/lifecycle/delete-daytona-sandbox", + "examples/go/daytona/lifecycle/force-stop-daytona-sandbox", "examples/go/daytona/lifecycle/request-daytona-deletion", + "examples/go/daytona/lifecycle/start-daytona-with-timeout", + "examples/go/modal/lifecycle/attach-modal-sandbox", "examples/go/modal/lifecycle/request-modal-termination", + "examples/go/daytona/lifecycle/close-daytona-handle", "examples/go/modal/lifecycle/close-modal-handle", + "examples/go/modal/configuration/create-modal-client-timeout", "examples/go/modal/configuration/create-modal-tcp-ready", + "examples/go/modal/configuration/create-modal-with-allowlists", "examples/go/modal/configuration/create-modal-with-ports", + "examples/go/modal/configuration/create-modal-with-secrets", "examples/go/modal/lifecycle/terminate-modal-with-timeout", + "examples/go/daytona/filesystem/copy-file-from-daytona", + "examples/go/daytona/filesystem/copy-file-into-daytona", + "examples/go/daytona/filesystem/list-daytona-directory", + "examples/go/daytona/filesystem/make-daytona-directory", + "examples/go/daytona/filesystem/read-daytona-file", + "examples/go/daytona/filesystem/remove-daytona-file", + "examples/go/daytona/filesystem/stat-daytona-file", + "examples/go/daytona/filesystem/write-daytona-file", + "examples/go/modal/filesystem/copy-file-from-modal", + "examples/go/modal/filesystem/copy-file-into-modal", + "examples/go/modal/filesystem/list-modal-directory", + "examples/go/modal/filesystem/make-modal-directory", + "examples/go/modal/filesystem/read-modal-file", + "examples/go/modal/filesystem/remove-modal-file", + "examples/go/modal/filesystem/stat-modal-file", + "examples/go/modal/filesystem/write-modal-file", } var typescriptTestModules = []struct { @@ -66,19 +82,28 @@ func typescriptModules(root string) ([]struct { if !provider.IsDir() { continue } - projects, err := os.ReadDir(filepath.Join(examplesRoot, provider.Name())) + areas, err := os.ReadDir(filepath.Join(examplesRoot, provider.Name())) if err != nil { return nil, fmt.Errorf("read TypeScript %s examples: %w", provider.Name(), err) } - for _, project := range projects { - if !project.IsDir() { + for _, area := range areas { + if !area.IsDir() { continue } - manifest := filepath.Join(examplesRoot, provider.Name(), project.Name(), "package.json") - if _, err := os.Stat(manifest); err == nil { - examplePaths = append(examplePaths, filepath.ToSlash(filepath.Join("examples", "typescript", provider.Name(), project.Name()))) - } else if !os.IsNotExist(err) { - return nil, fmt.Errorf("inspect TypeScript example %s: %w", project.Name(), err) + projects, err := os.ReadDir(filepath.Join(examplesRoot, provider.Name(), area.Name())) + if err != nil { + return nil, fmt.Errorf("read TypeScript %s %s examples: %w", provider.Name(), area.Name(), err) + } + for _, project := range projects { + if !project.IsDir() { + continue + } + manifest := filepath.Join(examplesRoot, provider.Name(), area.Name(), project.Name(), "package.json") + if _, err := os.Stat(manifest); err == nil { + examplePaths = append(examplePaths, filepath.ToSlash(filepath.Join("examples", "typescript", provider.Name(), area.Name(), project.Name()))) + } else if !os.IsNotExist(err) { + return nil, fmt.Errorf("inspect TypeScript example %s: %w", project.Name(), err) + } } } } @@ -127,6 +152,9 @@ func newTestCommand(config *settings, runner runner) *cobra.Command { if err != nil { return err } + if err := checkWorkspaceSum(cmd.Context(), root, config.goBinary); err != nil { + return err + } for _, module := range goTestModules { if err := runner.run(cmd.Context(), step{ filepath.Join(root, filepath.FromSlash(module)), config.goBinary, []string{"test", "./..."}, diff --git a/tooling/internal/commands/workspace_sum.go b/tooling/internal/commands/workspace_sum.go new file mode 100644 index 00000000..e1deaf38 --- /dev/null +++ b/tooling/internal/commands/workspace_sum.go @@ -0,0 +1,179 @@ +package commands + +import ( + "bytes" + "context" + "errors" + "fmt" + "io" + "os" + "os/exec" + "path/filepath" + "sort" + "strings" +) + +// checkWorkspaceSum fails when go.work.sum contains checksums that loading the +// workspace packages does not write. go work sync and go list -m all load the +// full requirement graph, fetch go.mod files the build never imports, and +// record those checksums. Module tidy does not remove them. +func checkWorkspaceSum(ctx context.Context, root, goBinary string) (err error) { + workPath := filepath.Join(root, "go.work") + if _, statErr := os.Stat(workPath); statErr != nil { + if os.IsNotExist(statErr) { + return nil + } + return fmt.Errorf("inspect go.work: %w", statErr) + } + sumPath := filepath.Join(root, "go.work.sum") + committed, readErr := os.ReadFile(sumPath) + if readErr != nil { + return fmt.Errorf("read go.work.sum: %w", readErr) + } + modules, parseErr := workspaceModules(workPath) + if parseErr != nil { + return parseErr + } + if removeErr := os.Remove(sumPath); removeErr != nil { + return fmt.Errorf("reset go.work.sum: %w", removeErr) + } + defer func() { + if writeErr := os.WriteFile(sumPath, committed, 0o644); writeErr != nil { + err = errors.Join(err, fmt.Errorf("restore go.work.sum: %w", writeErr)) + } + }() + + rebuilt, loadErr := reloadWorkspaceSum(ctx, root, goBinary, modules) + if loadErr != nil { + return loadErr + } + extra, missing := workspaceSumDrift(committed, rebuilt) + if len(extra) == 0 && len(missing) == 0 { + return nil + } + return errors.New(formatWorkspaceSumDrift(extra, missing)) +} + +func workspaceModules(workPath string) ([]string, error) { + data, err := os.ReadFile(workPath) + if err != nil { + return nil, fmt.Errorf("read go.work: %w", err) + } + var modules []string + inUse := false + for line := range strings.SplitSeq(string(data), "\n") { + trimmed := strings.TrimSpace(line) + if !inUse { + if trimmed == "use (" { + inUse = true + } + continue + } + if trimmed == ")" { + break + } + if trimmed == "" || strings.HasPrefix(trimmed, "//") { + continue + } + modules = append(modules, strings.TrimPrefix(trimmed, "./")) + } + if len(modules) == 0 { + return nil, errors.New("go.work has no use block") + } + return modules, nil +} + +func reloadWorkspaceSum(ctx context.Context, root, goBinary string, modules []string) ([]byte, error) { + env := environWithout("GOWORK") + for _, module := range modules { + cmd := exec.CommandContext(ctx, goBinary, "list", "./...") + cmd.Dir = filepath.Join(root, filepath.FromSlash(module)) + cmd.Env = env + cmd.Stdout = io.Discard + var stderr bytes.Buffer + cmd.Stderr = &stderr + if err := cmd.Run(); err != nil { + detail := strings.TrimSpace(stderr.String()) + if detail == "" { + return nil, fmt.Errorf("load packages in %s: %w", module, err) + } + return nil, fmt.Errorf("load packages in %s: %w\n%s", module, err, detail) + } + } + rebuilt, err := os.ReadFile(filepath.Join(root, "go.work.sum")) + if err != nil { + if os.IsNotExist(err) { + return nil, nil + } + return nil, fmt.Errorf("read rebuilt go.work.sum: %w", err) + } + return rebuilt, nil +} + +func environWithout(key string) []string { + prefix := key + "=" + env := os.Environ() + filtered := make([]string, 0, len(env)) + for _, entry := range env { + if strings.HasPrefix(entry, prefix) { + continue + } + filtered = append(filtered, entry) + } + return filtered +} + +func workspaceSumDrift(committed, rebuilt []byte) (extra, missing []string) { + have := sumEntries(committed) + want := sumEntries(rebuilt) + for entry := range have { + if _, ok := want[entry]; !ok { + extra = append(extra, entry) + } + } + for entry := range want { + if _, ok := have[entry]; !ok { + missing = append(missing, entry) + } + } + sort.Strings(extra) + sort.Strings(missing) + return extra, missing +} + +func sumEntries(data []byte) map[string]struct{} { + entries := make(map[string]struct{}) + for line := range bytes.SplitSeq(data, []byte("\n")) { + fields := bytes.Fields(line) + if len(fields) < 2 { + continue + } + entries[string(fields[0])+" "+string(fields[1])] = struct{}{} + } + return entries +} + +func formatWorkspaceSumDrift(extra, missing []string) string { + var b strings.Builder + if len(extra) > 0 { + b.WriteString("go.work.sum records modules that loading the workspace packages does not fetch:\n") + for _, entry := range extra { + b.WriteString(" ") + b.WriteString(entry) + b.WriteString("\n") + } + b.WriteString("\ngo work sync and go list -m all read the full requirement graph, including test requirements of google.golang.org/grpc and the modules those requirements name. Package loads do not fetch them, and go mod tidy does not remove the checksums. Delete go.work.sum and rerun sandbox-kit test go.\n") + } + if len(missing) > 0 { + if b.Len() > 0 { + b.WriteString("\n") + } + b.WriteString("go.work.sum is missing checksums from loading the workspace packages:\n") + for _, entry := range missing { + b.WriteString(" ") + b.WriteString(entry) + b.WriteString("\n") + } + } + return strings.TrimRight(b.String(), "\n") +} diff --git a/website/content/docs/create.mdx b/website/content/docs/create.mdx index 90df0d1d..e0e7d8cd 100644 --- a/website/content/docs/create.mdx +++ b/website/content/docs/create.mdx @@ -63,7 +63,7 @@ Name a snapshot by its reference, for example `daytona-small`. In TypeScript tha A linked sandbox must be ephemeral. The client rejects the request otherwise. -Idle stop, idle pause, stopped archive, and stopped delete use `PolicyMode` from `@sandbox-kit/sandbox` (`sandbox.PolicyModeAfter` and `sandbox.PolicyModeDisabled` in Go). A positive stop delay and a positive pause delay cannot be combined. Projects for [snapshots](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-from-snapshot), [policies](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-with-policies), [labels](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-with-labels), and [network](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-with-network) are in the repository. Go projects sit beside them under `examples/go/daytona/`. +Idle stop, idle pause, stopped archive, and stopped delete use `PolicyMode` from `@sandbox-kit/sandbox` (`sandbox.PolicyModeAfter` and `sandbox.PolicyModeDisabled` in Go). A positive stop delay and a positive pause delay cannot be combined. Projects for [snapshots](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-from-snapshot), [policies](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-with-policies), [labels](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-with-labels), and [network](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-with-network) are in the repository. Go projects sit beside them under `examples/go/daytona/`. ## Modal @@ -122,10 +122,10 @@ instance, err := client.Create(ctx, &sandbox.CreateOptions{ Set cloud and region on `placement`. A ready wait needs a probe and a positive timeout. -Modal rejects a disk size, an API endpoint, and Daytona stop or archive policies. Projects for [resources](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-with-resources), [idle timeout](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-idle), [placement](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-with-placement), and [readiness](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-ready) are in the repository. Go projects sit beside them under `examples/go/modal/`. +Modal rejects a disk size, an API endpoint, and Daytona stop or archive policies. Projects for [resources](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-with-resources), [idle timeout](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-idle), [placement](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-with-placement), and [readiness](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-ready) are in the repository. Go projects sit beside them under `examples/go/modal/`. ## What you get back `info()` in TypeScript and `Info()` in Go return a copy of the metadata. Editing that copy does not change the sandbox. Reported CPU and memory can differ from the numbers you sent. -This client creates the sandbox and manages its lifetime. Commands inside the sandbox, GPU requests, resizing, extra storage, and browsers are outside it. +This client creates the sandbox, manages its lifetime, and works with files inside it. Commands inside the sandbox, GPU requests, resizing, extra storage, and browsers are outside it. diff --git a/website/content/docs/daytona.mdx b/website/content/docs/daytona.mdx index faf7f02b..8d28bcc1 100644 --- a/website/content/docs/daytona.mdx +++ b/website/content/docs/daytona.mdx @@ -93,12 +93,12 @@ Omit `auth` when the Daytona SDK should use credentials it already finds in the ## Client settings -| Setting | TypeScript | Go | -| --- | --- | --- | -| API URL | `endpoint` | `Config.Endpoint` | -| Target | `region` | `Config.Region` | -| Organization | `scope.organizationId` | `Scope.OrganizationId` | -| Bearer token | `auth.bearerToken.token` | `BearerToken` | +| Setting | TypeScript | Go | +| ------------ | ------------------------ | ---------------------- | +| API URL | `endpoint` | `Config.Endpoint` | +| Target | `region` | `Config.Region` | +| Organization | `scope.organizationId` | `Scope.OrganizationId` | +| Bearer token | `auth.bearerToken.token` | `BearerToken` | The default API URL is `https://app.daytona.io/api`. A remote URL must be HTTPS. HTTP is accepted for localhost and loopback. Sandbox Kit does not read the URL from the environment. A bearer token requires an organization id. @@ -106,9 +106,10 @@ In Go, set an optional string with `sandbox.Value`. Full field rules are on [Con ## Where to go next -| You want to | Open | -| --- | --- | -| An image, a named snapshot, a size, or a lifetime | [Create a sandbox](/docs/create#daytona) | -| Look up, stop, or delete a sandbox | [Manage a sandbox](/docs/lifecycle#open-a-sandbox) | -| A failed call | [Read an error](/docs/errors) | -| A project you can run | [create-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-sandbox) and the [Go project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/create-daytona-sandbox) | +| You want to | Open | +| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| An image, a named snapshot, a size, or a lifetime | [Create a sandbox](/docs/create#daytona) | +| Look up, stop, or delete a sandbox | [Manage a sandbox](/docs/lifecycle#open-a-sandbox) | +| Work with files | [Use files](/docs/filesystem) | +| A failed call | [Read an error](/docs/errors) | +| A project you can run | [create-daytona-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-sandbox) and the [Go project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/configuration/create-daytona-sandbox) | diff --git a/website/content/docs/errors.mdx b/website/content/docs/errors.mdx index 00aeab1c..fb15d577 100644 --- a/website/content/docs/errors.mdx +++ b/website/content/docs/errors.mdx @@ -13,7 +13,7 @@ Branch on the kind. The same list applies to every provider. The kind names a ca | `Unsupported` | This provider does not implement the call or the field | | `Authentication` | The credentials were rejected | | `PermissionDenied` | The account cannot perform this operation | -| `NotFound` | The sandbox was not found | +| `NotFound` | The sandbox or the file path was not found | | `RateLimited` | The provider rate limit was reached | | `ResourceExhausted` | The provider quota or capacity was reached | | `Canceled` | The caller canceled the operation | @@ -46,7 +46,7 @@ try { ); break; case ErrorKind.NotFound: - console.error("The requested sandbox was not found."); + console.error("The sandbox or file path was not found."); break; case ErrorKind.RateLimited: case ErrorKind.ResourceExhausted: @@ -80,7 +80,7 @@ if errors.As(err, &detail) { case sandbox.ErrorKindPermissionDenied: fmt.Println("Your account does not have permission for this operation.") case sandbox.ErrorKindNotFound: - fmt.Println("The requested sandbox was not found.") + fmt.Println("The sandbox or file path was not found.") case sandbox.ErrorKindRateLimited, sandbox.ErrorKindResourceExhausted: fmt.Println("The provider's rate or resource limit was reached.") case sandbox.ErrorKindCanceled: @@ -110,4 +110,4 @@ An error does not prove that no sandbox exists. The provider may have created on On Daytona, look the sandbox up with `get` before you retry. Modal `attach` does not perform that lookup. -Runnable projects: [Daytona errors](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/handle-daytona-errors) and [Modal errors](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/handle-modal-errors). The Go projects sit beside them under `examples/go/`. +Runnable projects: [Daytona errors](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/errors/handle-daytona-errors) and [Modal errors](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/errors/handle-modal-errors). The Go projects sit beside them under `examples/go/`. diff --git a/website/content/docs/examples.mdx b/website/content/docs/examples.mdx index fbfaef94..33e5bb29 100644 --- a/website/content/docs/examples.mdx +++ b/website/content/docs/examples.mdx @@ -5,43 +5,45 @@ description: Run one project for one operation. Each project loads its own envir Each project selects one provider, loads a `.env` file, and performs one operation. Open the project for the call you need. -Creation projects provision a real sandbox. Lifecycle projects use the sandbox id in `.env`. Stop, terminate, archive, and delete can destroy that sandbox. Error projects fail locally and create nothing. +Creation projects provision a real sandbox. Filesystem and lifecycle projects use the sandbox id in `.env`. Stop, terminate, archive, delete, and remove can destroy that sandbox or the path you set. Error projects fail locally and create nothing. -The tables below are the common projects. The repository also has network, labels, secrets, pause, and archive. The full list is the [examples catalog](https://github.com/sandbox-kit/kit/blob/main/examples/README.md). +The tables below are the common projects. The repository also has network, labels, secrets, pause, archive, and a project for each filesystem call (read, write, copy, mkdir, list, stat, remove). The full list is the [examples catalog](https://github.com/sandbox-kit/kit/blob/main/examples/README.md). ## Daytona -| Operation | TypeScript | Go | -| ----------------- | ---------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- | -| Create | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/create-daytona-sandbox) | -| From an image | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-from-image) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/create-daytona-from-image) | -| From a snapshot | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-from-snapshot) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/create-daytona-from-snapshot) | -| Lifetime policies | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/create-daytona-with-policies) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/create-daytona-with-policies) | -| Look up | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/get-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/get-daytona-sandbox) | -| Stop | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/stop-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/stop-daytona-sandbox) | -| Delete | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/delete-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/delete-daytona-sandbox) | -| Errors | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/handle-daytona-errors) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/handle-daytona-errors) | +| Operation | TypeScript | Go | +| ----------------- | ------------------------------------------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------- | +| Create | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/configuration/create-daytona-sandbox) | +| Read a file | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/read-daytona-file) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/read-daytona-file) | +| From an image | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-from-image) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/configuration/create-daytona-from-image) | +| From a snapshot | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-from-snapshot) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/configuration/create-daytona-from-snapshot) | +| Lifetime policies | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/configuration/create-daytona-with-policies) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/configuration/create-daytona-with-policies) | +| Look up | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/lifecycle/get-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/lifecycle/get-daytona-sandbox) | +| Stop | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/lifecycle/stop-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/lifecycle/stop-daytona-sandbox) | +| Delete | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/lifecycle/delete-daytona-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/lifecycle/delete-daytona-sandbox) | +| Errors | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/errors/handle-daytona-errors) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/errors/handle-daytona-errors) | ## Modal -| Operation | TypeScript | Go | -| --------- | ------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------- | -| Create | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/create-modal-sandbox) | -| Resources | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-with-resources) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/create-modal-with-resources) | -| Attach | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/attach-modal-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/attach-modal-sandbox) | -| Terminate | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/terminate-modal-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/terminate-modal-sandbox) | -| Errors | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/handle-modal-errors) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/handle-modal-errors) | +| Operation | TypeScript | Go | +| ----------- | --------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------- | +| Create | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/configuration/create-modal-sandbox) | +| Read a file | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/read-modal-file) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/read-modal-file) | +| Resources | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-with-resources) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/configuration/create-modal-with-resources) | +| Attach | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/lifecycle/attach-modal-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/lifecycle/attach-modal-sandbox) | +| Terminate | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/lifecycle/terminate-modal-sandbox) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/lifecycle/terminate-modal-sandbox) | +| Errors | [project](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/errors/handle-modal-errors) | [project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/errors/handle-modal-errors) | ## Run a project -TypeScript needs Node.js 20, 22, or 24.15+. Go needs Go 1.26.0 or later. Replace the path with the project you opened above. Skip `cp .env.example` when you already have a `.env`. +TypeScript needs Node.js 20, 22, or 24.15+. Go needs Go 1.26.0 or later. `` is `filesystem`, `configuration`, `lifecycle`, or `errors`. Replace the path with the project you opened above. Skip `cp .env.example` when you already have a `.env`. ```sh git clone https://github.com/sandbox-kit/kit.git -cd kit/examples/typescript// +cd kit/examples/typescript/// cp .env.example .env npm install && npm run build && npm start ``` @@ -51,7 +53,7 @@ npm install && npm run build && npm start ```sh git clone https://github.com/sandbox-kit/kit.git -cd kit/examples/go// +cd kit/examples/go/// cp .env.example .env go run . ``` diff --git a/website/content/docs/filesystem.mdx b/website/content/docs/filesystem.mdx new file mode 100644 index 00000000..93b38934 --- /dev/null +++ b/website/content/docs/filesystem.mdx @@ -0,0 +1,272 @@ +--- +title: Use files +description: Read, write, copy, mkdir, list, stat, and remove files inside a sandbox. +--- + +File calls live on the handle you already have. Daytona and Modal implement the same methods. Create the sandbox on the provider page, or open one you already have from [Manage a sandbox](/docs/lifecycle). + +| You want to | Call | +| ----------------------------- | --------------------------------------- | +| Read the bytes of one file | [`readFile`](#read-a-file) | +| Replace one file | [`writeFile`](#write-a-file) | +| Copy a file from your machine | [`copyFromLocal`](#copy-a-file-in) | +| Copy a file onto your machine | [`copyToLocal`](#copy-a-file-out) | +| Create a directory | [`makeDirectory`](#create-a-directory) | +| List one directory | [`listDirectory`](#list-a-directory) | +| Read metadata for one path | [`stat`](#read-metadata) | +| Delete a file or directory | [`remove`](#delete-a-file-or-directory) | + +A path inside the sandbox starts with `/`, such as `/tmp/note.txt`. A relative path, a blank path, or a path that contains a NUL byte is rejected before the provider is called, and the error names the field `path`. A path on your machine may be relative to the process, such as `./note.txt`. It must be non-blank and must not contain a NUL byte. A rejected local path names the field `local_path`. + +`readFile` and `writeFile` move bytes. Encode text before you write it, and decode text after you read it. `copyFromLocal` and `copyToLocal` use files on your disk. + +Leave `timeout` unset to use the client deadline. Set `timeout: 0` when this call should add no deadline of its own. TypeScript records the timeout in milliseconds. Go records it as a `time.Duration`. + +TypeScript Daytona `readFile`, `writeFile`, `copyFromLocal`, and `copyToLocal` pass that duration to Daytona as a whole number of seconds. `2_000` is two seconds. `1_500` is 1.5 seconds, so those four calls reject it. The error field is `timeout`. An omitted timeout, and an explicit zero, on those four calls are passed as `0`. Daytona adds no transfer limit. When the timeout is omitted, the abort signal carries the client deadline. + +`makeDirectory`, `listDirectory`, `stat`, and `remove` use the abort signal. `1_500` ends the call at 1.5 seconds. Every Go file call uses the context as the deadline, so `1500 * time.Millisecond` ends the call at 1.5 seconds. Modal file calls use the context or the abort signal. `1_500` milliseconds ends the call at 1.5 seconds. + + + + +```ts +await sandbox.filesystem.readFile("/tmp/note.txt", { timeout: 2_000 }); +await sandbox.filesystem.listDirectory("/tmp", { timeout: 1_500 }); +``` + + + + +```go +data, err := instance.Filesystem().ReadFile(ctx, "/tmp/note.txt", &sandbox.FileReadOptions{ + Timeout: sandbox.Duration(1500 * time.Millisecond), +}) +``` + + + + +Calls on one handle run one at a time, including lifecycle calls. A second handle for the same sandbox does not wait. + +The snippets below assume you already have `sandbox` or `instance`. Each call also has its own project in the [examples](/docs/examples) catalog. + +## Read a file + +`readFile` returns the bytes of one file. A missing file comes back as not found. A directory path fails at the provider. + + + + +```ts +const data = await sandbox.filesystem.readFile("/tmp/note.txt"); +const text = new TextDecoder().decode(data); +console.log(text); +``` + + + + +```go +data, err := instance.Filesystem().ReadFile(ctx, "/tmp/note.txt", nil) +if err != nil { + return err +} +fmt.Printf("%s\n", data) +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/read-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/read-modal-file). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/read-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/read-modal-file). + +## Write a file + +`writeFile` replaces the file and creates missing parent directories. An existing file at that path is overwritten. + + + + +```ts +const body = new TextEncoder().encode("hello\n"); +await sandbox.filesystem.writeFile("/tmp/kit-files/note.txt", body); +``` + + + + +```go +body := []byte("hello\n") +err := instance.Filesystem().WriteFile(ctx, "/tmp/kit-files/note.txt", body, nil) +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/write-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/write-modal-file). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/write-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/write-modal-file). + +## Copy a file in + +`copyFromLocal` reads a file on your machine and writes it in the sandbox. The local path is the first argument. The remote path is absolute. An existing remote file is replaced, and missing parent directories of that path are created. A missing local file is not found. The error field is `local_path`. A local directory is an invalid argument with the same field. + + + + +```ts +await sandbox.filesystem.copyFromLocal("./note.txt", "/tmp/note.txt"); +``` + + + + +```go +err := instance.Filesystem().CopyFromLocal(ctx, "note.txt", "/tmp/note.txt", nil) +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/copy-file-into-daytona) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/copy-file-into-modal). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/copy-file-into-daytona) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/copy-file-into-modal). + +## Copy a file out + +`copyToLocal` copies a sandbox file onto your disk. The remote path comes first. An existing local file is replaced. A missing local parent directory is created. A local directory is an invalid argument, and the field is `local_path`. + + + + +```ts +await sandbox.filesystem.copyToLocal("/tmp/note.txt", "./note.txt"); +``` + + + + +```go +err := instance.Filesystem().CopyToLocal(ctx, "/tmp/note.txt", "note.txt", nil) +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/copy-file-from-daytona) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/copy-file-from-modal). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/copy-file-from-daytona) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/copy-file-from-modal). + +## Create a directory + +`parents` defaults to true, so the call creates missing parents. Modal accepts a directory that already exists. Daytona returns an error when it already exists. + +Set `parents` to false when the parent directory must already exist. Modal then requires that parent, and returns an error if the new directory is already there. Daytona rejects `false` before the call. The error field is `parents`. + + + + +```ts +await sandbox.filesystem.makeDirectory("/tmp/kit-files"); +await sandbox.filesystem.makeDirectory("/tmp/kit-files/nested", { + parents: false, +}); +``` + + + + +```go +err := instance.Filesystem().MakeDirectory(ctx, "/tmp/kit-files", nil) +err = instance.Filesystem().MakeDirectory(ctx, "/tmp/kit-files/nested", &sandbox.MakeDirectoryOptions{ + Parents: sandbox.Value(false), +}) +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/make-daytona-directory) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/make-modal-directory). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/make-daytona-directory) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/make-modal-directory). + +## List a directory + +`listDirectory` returns the entries in that one directory. It does not walk into subdirectories. `size` is a byte count. In TypeScript it is a `bigint`. + + + + +```ts +const entries = await sandbox.filesystem.listDirectory("/tmp/kit-files"); +for (const entry of entries) console.log(entry.name, entry.size); +``` + + + + +```go +entries, err := instance.Filesystem().ListDirectory(ctx, "/tmp/kit-files", nil) +if err != nil { + return err +} +for _, entry := range entries { + fmt.Println(entry.GetName(), entry.GetSize()) +} +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/list-daytona-directory) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/list-modal-directory). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/list-daytona-directory) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/list-modal-directory). + +## Read metadata + +`stat` returns one path. A symlink result describes the symlink. Modal can report a symlink. Daytona reports a file or a directory. `mode` is an octal string when the provider supplies one, such as `0644`. `permissions`, `owner`, and `group` are set when the provider supplies them. `modifiedAt` is set when the provider supplies a time. + + + + +```ts +const info = await sandbox.filesystem.stat("/tmp/note.txt"); +console.log(info.type, info.size, info.mode); +``` + + + + +```go +info, err := instance.Filesystem().Stat(ctx, "/tmp/note.txt", nil) +if err != nil { + return err +} +fmt.Println(info.GetType(), info.GetSize(), info.GetMode()) +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/stat-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/stat-modal-file). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/stat-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/stat-modal-file). + +## Delete a file or directory + +`remove` deletes a file, or an empty directory. Set `recursive` to delete a directory and its contents. A directory that still has entries fails when you leave the flag unset. A missing path comes back as not found. + + + + +```ts +await sandbox.filesystem.remove("/tmp/note.txt"); +await sandbox.filesystem.remove("/tmp/kit-files", { recursive: true }); +``` + + + + +```go +files := instance.Filesystem() +if err := files.Remove(ctx, "/tmp/note.txt", nil); err != nil { + return err +} +if err := files.Remove(ctx, "/tmp/kit-files", &sandbox.RemoveOptions{ + Recursive: sandbox.Value(true), +}); err != nil { + return err +} +``` + + + + +[Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/daytona/filesystem/remove-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/filesystem/remove-modal-file). Go: [Daytona](https://github.com/sandbox-kit/kit/tree/main/examples/go/daytona/filesystem/remove-daytona-file) · [Modal](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/filesystem/remove-modal-file). diff --git a/website/content/docs/index.mdx b/website/content/docs/index.mdx index 4bd82f6f..567ce25e 100644 --- a/website/content/docs/index.mdx +++ b/website/content/docs/index.mdx @@ -7,21 +7,24 @@ Sandbox Kit is one client for the sandbox provider you pass in. Install the core Open the page that matches the call. You do not need the other pages first. -| You want to | Open | -| --- | --- | -| Install a provider and create a sandbox | [Daytona](/docs/daytona) or [Modal](/docs/modal) | -| Set auth, a timeout, a region, or an app | [Configure the client](/docs/configuration) | -| Choose an image, a size, or a lifetime | [Create a sandbox](/docs/create) | -| Open a sandbox you already have, or finish it | [Manage a sandbox](/docs/lifecycle) | -| Branch on a failed call | [Read an error](/docs/errors) | -| Copy a runnable project | [Examples](/docs/examples) | +| You want to | Open | +| --------------------------------------------- | ------------------------------------------------ | +| Install a provider and create a sandbox | [Daytona](/docs/daytona) or [Modal](/docs/modal) | +| Set auth, a timeout, a region, or an app | [Configure the client](/docs/configuration) | +| Choose an image, a size, or a lifetime | [Create a sandbox](/docs/create) | +| Open a sandbox you already have, or finish it | [Manage a sandbox](/docs/lifecycle) | +| Work with files inside the sandbox | [Use files](/docs/filesystem) | +| Branch on a failed call | [Read an error](/docs/errors) | +| Copy a runnable project | [Examples](/docs/examples) | Code samples have a **TypeScript** tab and a **Go** tab. The choice is saved in this browser. TypeScript needs Node.js 20, 22, or 24.15+. Go needs Go 1.26.0 or later. -`client.close()` and `Client.Close` release the connection in your process. The sandbox keeps running. Finish it from [Manage a sandbox](/docs/lifecycle), or set a lifetime when you [create](/docs/create) it. + `client.close()` and `Client.Close` release the connection in your process. + The sandbox keeps running. Finish it from [Manage a sandbox](/docs/lifecycle), + or set a lifetime when you [create](/docs/create) it. A client that constructs successfully has not checked your credentials. The provider checks them on the first request. diff --git a/website/content/docs/meta.json b/website/content/docs/meta.json index 6f8b767f..1cd42cca 100644 --- a/website/content/docs/meta.json +++ b/website/content/docs/meta.json @@ -8,6 +8,7 @@ "---Use the client---", "create", "lifecycle", + "filesystem", "configuration", "errors", "examples" diff --git a/website/content/docs/modal.mdx b/website/content/docs/modal.mdx index f51cf208..2d483b84 100644 --- a/website/content/docs/modal.mdx +++ b/website/content/docs/modal.mdx @@ -123,9 +123,10 @@ Omit `auth` when the Modal SDK should use credentials it already finds in the en ## Where to go next -| You want to | Open | -| ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| A command, a region, ports, or an idle timeout | [Create a sandbox](/docs/create#modal) | -| Attach to a sandbox and terminate it | [Manage a sandbox](/docs/lifecycle#terminate) | -| A failed call | [Read an error](/docs/errors) | -| A project you can run | [create-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/create-modal-sandbox) and the [Go project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/create-modal-sandbox) | +| You want to | Open | +| ---------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| A command, a region, ports, or an idle timeout | [Create a sandbox](/docs/create#modal) | +| Attach to a sandbox and terminate it | [Manage a sandbox](/docs/lifecycle#terminate) | +| Work with files | [Use files](/docs/filesystem) | +| A failed call | [Read an error](/docs/errors) | +| A project you can run | [create-modal-sandbox](https://github.com/sandbox-kit/kit/tree/main/examples/typescript/modal/configuration/create-modal-sandbox) and the [Go project](https://github.com/sandbox-kit/kit/tree/main/examples/go/modal/configuration/create-modal-sandbox) | diff --git a/website/tsconfig.json b/website/tsconfig.json index 7a46b8f5..715885f9 100644 --- a/website/tsconfig.json +++ b/website/tsconfig.json @@ -7,7 +7,7 @@ "module": "ESNext", "moduleResolution": "Bundler", "lib": ["DOM", "DOM.Iterable", "ES2022"], - "types": ["vite/client"], + "types": ["node", "vite/client"], "isolatedModules": true, "resolveJsonModule": true, "skipLibCheck": true,