graff — a fast agentic coding harness in Zig: multi-provider, MCP, workflows, DGM evolution loop, TS/Python SDKs
Python
Add managed and Worker-native SDK execution paths
justrach826cfd6fd2c4
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex bf590733..bf24d951 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -10,6 +10,14 @@ The release workflow uses a tag's section here as its release notes (ahand-written `docs/releases/<tag>.md` wins if present), so keeping this filecurrent is part of cutting a release.+## v0.302.44++- Adds an experimental Worker-native Zig/Wasm chat step with explicit host tools and remote sandbox cleanup.+- Adds managed-device SDK sessions with persisted receipts, bounded reconnect and device event replay; prompt submissions are never automatically retried.+- Adds a shared opt-in, metadata-only OTLP exporter for managed and Worker-native execution.+- Ships SDK 0.5.0 with managed, tracing, Worker and sandbox entry points. Worker-native conversations do not yet have durable checkpoints; managed trace storage requires a separately deployed collector.+- Retains all changes from v0.302.43.+## v0.302.43- Uses the updated subscription context default instead of the older blanket cap, avoiding premature compaction.diff --git a/build.zig b/build.zigindex 87a0c2ff..aee1d528 100644--- a/build.zig+++ b/build.zig@@ -307,4 +307,20 @@ pub fn build(b: *std.Build) void {wasm.rdynamic = true;const wasm_step = b.step("wasm-core", "Build graff-core.wasm (in-process ACP)");wasm_step.dependOn(&b.addInstallArtifact(wasm, .{}).step);++ // Experimental JSPI host: shared chat step, with model/tools supplied by+ // the Worker. No native Agent I/O or the echo-only ACP embedding surface.+ const worker = b.addExecutable(.{+ .name = "graff-worker",+ .root_module = b.createModule(.{+ .root_source_file = b.path("src/wasm_worker_main.zig"),+ .target = b.resolveTargetQuery(.{ .cpu_arch = .wasm32, .os_tag = .freestanding }),+ .optimize = if (optimize == .debug) .small else optimize,+ .strip = true,+ }),+ });+ worker.entry = .disabled;+ worker.rdynamic = true;+ const worker_step = b.step("wasm-worker", "Build the experimental Worker-native Graff core");+ worker_step.dependOn(&b.addInstallArtifact(worker, .{}).step);}diff --git a/docs/adr/0295-worker-native-turns-share-the-chat-step.md b/docs/adr/0295-worker-native-turns-share-the-chat-step.mdnew file mode 100644index 00000000..532f735f--- /dev/null+++ b/docs/adr/0295-worker-native-turns-share-the-chat-step.md@@ -0,0 +1,36 @@+# 0295. Worker-native turns share the native chat step++Status: experimental++## Context++Workers can instantiate bundled Zig WebAssembly and suspend asynchronous host+imports through JSPI. A local workerd experiment with fx completed a model/tool+cycle. Graff's existing same-process surface is only an echo ACP core (0038);+its native Agent also owns process, filesystem, HTTP and threading dependencies.+Forwarding prompts to a native server would not be a Worker-native port, and a+second JavaScript agent loop would drift from Graff's engine.++## Decision++Add an explicitly experimental `wasm-worker` target and `@codegraff/sdk/worker`+host. Extract `agent_chat_step.zig` from the existing native step: REPL, ACP and+Worker hosts share assistant history, executable-call parsing, tool-result+replay and the continue/final decision. Native provider repair, checkpointing,+events and completion hooks stay in a native adapter. Do not replace the full+native turn policy with the experimental host's smaller policy.++The JS host supplies bounded model HTTP and registered tools through a suspending+import. Credentials remain outside Wasm. The Wasm module is statically bundled;+mutable instances belong to one request/session, not concurrent requests. Both+sides enforce budgets and reject unregistered or malformed tool execution. A+failed turn cannot implicitly replay uncertain effects.++## Consequences++The first slice supports nonstreaming Chat Completions and host tools, verified+by the real workerd cycle in `examples/workers-engine/runtime.test.mjs`. It does+not provide native shell tools, durable sessions, compaction, goals or full CLI+parity. Worker storage and an external shell sandbox are later capabilities,+not a reason to proxy the agent loop or silently run a different engine. Local+runtime proof and `cf deploy --dry-run` are not hosted deployment proof.diff --git a/docs/adr/0296-worker-tasks-own-remote-sandbox-cleanup.md b/docs/adr/0296-worker-tasks-own-remote-sandbox-cleanup.mdnew file mode 100644index 00000000..139b857f--- /dev/null+++ b/docs/adr/0296-worker-tasks-own-remote-sandbox-cleanup.md@@ -0,0 +1,30 @@+# 0296. Worker tasks own remote sandbox cleanup++Status: experimental++## Context++A Durable Object can own the Worker-native agent's task state and await model+and tool calls, but it cannot spawn a Linux shell. Existing Codegraff cloud VMs+already provide that capability. The local MCP `run_task` endpoint is a distinct+service and can deny execution; it is not evidence about the hosted sandbox API.++## Decision++Keep orchestration and the shared Zig/Wasm chat step in the Worker. Register a+bounded host tool backed by Codegraff's public sandbox HTTP API. The DO owns one+disposable VM per task, records its ID before work, and schedules backup cleanup.+Use finally-based deletion with an independent deadline, an alarm for interrupted+requests, and a bounded lease. Do not retry create/exec implicitly: uncertain+effects are not safe to replay. Never inject the gateway credential into Wasm,+VM commands, or the VM environment. Refuse redirects rather than forwarding auth.++## Consequences++The opt-in `examples/workers-sandbox/live.test.mjs` exercises a real model and+VM and independently checks a synthetic code repair and resource cleanup. A+model's success claim alone does not pass. Local tests run workerd with an actual+DO, but are not proof of a hosted deployment or an adversarial isolation audit.+DO storage currently owns cleanup only, not a resumable model conversation.+Aborting HTTP stops waiting; VM deletion is the execution boundary. Future+long-running jobs need explicit job handles and recovery, not longer blind waits.diff --git a/docs/adr/0297-sdk-managed-replay-reuses-the-relay.md b/docs/adr/0297-sdk-managed-replay-reuses-the-relay.mdnew file mode 100644index 00000000..0a29ce8d--- /dev/null+++ b/docs/adr/0297-sdk-managed-replay-reuses-the-relay.md@@ -0,0 +1,31 @@+# 0297: SDK managed replay reuses the existing relay++Status: Accepted (experimental client and local collector integration)++The fetch-only SDK uses the existing account remote-control protocol rather than+creating a second TypeScript agent engine or treating synced transcripts as+execution checkpoints. Native devices retain provider selection, tool execution,+completed conversation checkpoints and event tapes. This relay transport hosts+its client in a Worker; execution remains native on the registered device. The+separate Worker-native Zig/Wasm chat-step experiment is a distinct transport,+not a duplicate engine to reimplement here.++A submit receipt means queued acceptance. Replay is cursor-based and GET failures+may retry; a prompt POST is never implicitly retried because lost responses are+ambiguous and the current engine message-id ledger is bounded/in-memory. Caller+storage owns receipts and atomically committed cursors/effects. One writer per+session is required; receipts are not fencing tokens. Device/disk loss and+exactly-once external effects remain outside this guarantee.++Telemetry is an explicit observer, not an execution dependency. A restricted+OTLP profile carries only random correlation IDs, fixed lifecycle names, numeric+usage/counts, timing and status. It never exports prompt/tool/error bodies or+account/session/model labels. Export queues and deadlines are bounded, with+visible drop counts. Account-authenticated storage is separate from anonymous+product telemetry; installing the SDK cannot imply that a collector was deployed.++Reusing the relay avoids introducing another scheduler/checkpoint format. The+Worker-native sandbox experiment retains cleanup ownership, not resumable+conversation checkpoints; neither it nor this client implies a crash-safe+exactly-once command journal. A shared optional OTLP exporter can observe either+transport without changing its execution or durability semantics.diff --git a/docs/adr/README.md b/docs/adr/README.mdindex e660513b..4fa549d2 100644--- a/docs/adr/README.md+++ b/docs/adr/README.md@@ -312,6 +312,10 @@ record only when you need the evidence or the edge cases.| [0293](0293-ci-reuses-checksum-pinned-tool-binaries.md) | Restore pinned CI executables from optional object storage only after checking a reviewed SHA-256; unavailable artifacts retain the pinned-source fallback. || [0294](0294-release-task-reuse-is-explicitly-host-portable.md) | Only audited fixed-target/baseline-CPU release tasks opt into platform host identity; identical compiler/manifest/package snapshots avoid redundant native fetch preparation. |+| [0295](0295-worker-native-turns-share-the-chat-step.md) | Experimental Worker-native turns share the native chat step; JSPI supplies bounded host I/O, not a proxy or a second agent loop. |+| [0296](0296-worker-tasks-own-remote-sandbox-cleanup.md) | Worker/DO tasks retain the agent loop and delegate Linux execution to remote sandboxes with explicit ownership, deletion and bounded leases. |+| [0297](0297-sdk-managed-replay-reuses-the-relay.md) | The fetch-only managed SDK reuses account relay/device tapes; prompt retries are explicit, durability limits are stated, and content-free OTLP export remains opt-in and observational. |+## When to write oneWrite an ADR when a decision is load-bearing and non-obvious: it was reacheddiff --git a/docs/embedding.md b/docs/embedding.mdindex 1a226d00..1e0aeb68 100644--- a/docs/embedding.md+++ b/docs/embedding.md@@ -1,8 +1,9 @@# Embedding graff-graff is a subprocess a host spawns, not a library you link and not a WASM-runtime. Two stdio APIs cover a hosted agent. Pick one; do not speak both on-the same child.+Graff supports native subprocess hosting and an experimental Worker-native+Zig/Wasm host. Two stdio APIs cover a native hosted agent. Pick one; do not+speak both on the same child. The Worker-native host is described separately+below and does not provide full native CLI parity.| Host API | Wire | When ||---|---|---|@@ -166,7 +167,8 @@ zig build libgraff # zig-out/lib/libgraff.so (C ABI)`createGraffAgent()` is the JS host. The first-slice turn is `echo:` —protocol + handshake in-process. Live tools / TLS / bash still go through-`graff acp` (above). A host-imported model turn is the next slice.+`graff acp` (above). The experimental Worker host below adds model/tool turns+through a separate ABI; this ACP surface remains echo-only.C ABI (wasm exports and the shared library):@@ -177,8 +179,50 @@ C ABI (wasm exports and the shared library):| `graff_acp_feed(len)` | dispatch || `graff_acp_out_ptr` / `out_len` / `out_consume` | read newline-framed replies |+## Experimental Worker-native turns++`zig build wasm-worker` builds `zig-out/bin/graff-worker.wasm`.+`@codegraff/sdk/worker` provides a fetch-only JSPI host for a statically bundled+`WebAssembly.Module`. Zig owns conversation history and executes the same chat+step as the native REPL and ACP paths; JavaScript supplies HTTP and registered,+input-validated tools. Credentials stay outside Wasm. No native proxy is used.++The first slice supports nonstreaming Chat Completions and host tools. It is+not the complete native `Agent`: native shell/git, persistent sessions,+compaction, goals and other CLI features are not yet portable. Create one+instance per request or serialize a session's turns; recreate after failures+rather than replaying uncertain effects.++See [the cf/workerd example](../examples/workers-engine/README.md) for setup,+the real model/tool/model runtime test, authentication and deployment dry-run.+The Wasm artifact is built separately; it is not fetched or compiled dynamically+inside Workers, and is not included in the existing `core.wasm` package export.++### Existing Codegraff sandboxes++`@codegraff/sdk/worker-sandbox` is a fetch-only client for Codegraff's hosted VMs.+The [Durable Object sandbox example](../examples/workers-sandbox/README.md)+keeps the agent in Zig/Wasm and delegates shell execution to a disposable VM.+Its opt-in live test uses real inference, independently checks a Python repair,+and requires VM deletion. A DO records cleanup ownership and coordinates the+task; it does not itself become a Linux process environment. Credentials remain+outside Wasm and the VM. This is separate from the local `graff mcp serve`+`run_task` endpoint, which may not have sandbox execution permission.++## Durability and shared observability++The [managed SDK](../sdk/ts/MANAGED.md) is a separate native-device transport:+its receipt/cursor reconnects replay the device's event tape and completed+conversation checkpoints. The Worker-native sandbox example instead persists+cleanup ownership; it does not yet checkpoint or resume a conversation.++Both SDK hosts accept the same optional metadata-only observer from+`@codegraff/sdk/otel`. Export is explicitly flushed by the host, and observer+failure cannot fail or hold execution open. Tracing is not a checkpoint or an+exactly-once guarantee. Custom integrations: **[email protected]**.+## Not this-No full-agent `fx-core.wasm` (HTTP + bash + git inside the isolate). No-Node-API addon yet — `libgraff` is a C ABI, not a `.node`. Those stay a-later slice on this continuation branch.+No full CLI with bash + git inside the isolate, and no Node-API addon yet —+`libgraff` is a C ABI, not a `.node`. The existing subprocess and remote-bridge+recipes remain distinct from the experimental Worker-native host.diff --git a/docs/releases/v0.302.44.md b/docs/releases/v0.302.44.mdnew file mode 100644index 00000000..e8ded0b3--- /dev/null+++ b/docs/releases/v0.302.44.md@@ -0,0 +1,15 @@+# v0.302.44++This release adds two experimental SDK execution paths without replacing native Graff sessions.++- **Managed devices:** attach to an existing registered execution device, persist a submission receipt and cursor, and reconnect using device event replay. Prompt submissions are never automatically retried.+- **Worker-native execution:** run the shared Zig chat step through Wasm/JSPI with explicitly supplied host tools. The sandbox adapter tracks cleanup ownership separately from conversation state.+- **Optional tracing:** both paths use one metadata-only OTLP exporter. Prompts, generated text, tool payloads and credentials are excluded from exported spans.++## npm++Install the matching SDK with `npm install @codegraff/[email protected]`. The package adds `/managed`, `/otel`, `/worker` and `/worker-sandbox` entry points alongside the existing native, remote and ACP clients. Supported native platform packages remain optional dependencies.++## Boundaries++Worker-native execution is not full native-engine parity and does not yet checkpoint conversations. Managed recovery depends on the execution device and retained event tape; it does not guarantee exactly-once tool effects or migration after device loss. Installing the SDK does not deploy the optional managed trace collector. Existing native session behavior and authentication remain unchanged.diff --git a/examples/workers-engine/.gitignore b/examples/workers-engine/.gitignorenew file mode 100644index 00000000..05590edd--- /dev/null+++ b/examples/workers-engine/.gitignore@@ -0,0 +1,5 @@+node_modules/+.cloudflare/+dist/+.dev.vars*+.env*diff --git a/examples/workers-engine/README.md b/examples/workers-engine/README.mdnew file mode 100644index 00000000..4ca3d6ca--- /dev/null+++ b/examples/workers-engine/README.md@@ -0,0 +1,104 @@+# Graff inside a Worker++Experimental Worker-native execution, not a proxy to `graff serve` and not the+older echo-only ACP embedding. Zig owns the conversation and runs the same chat+step used by Graff's native REPL and ACP engine. JavaScript supplies asynchronous+model HTTP and explicitly registered tools through WebAssembly JSPI.++## Run locally++Requires Zig 0.17.0 and Node 22 or later. From the repository root:++```sh+zig build wasm-worker+cd examples/workers-engine+npm ci+npm run typecheck+npm test+npm run dev+```++Open the local URL printed by `cf dev`. The default mode is a credential-free+synthetic integration: model tool call → asynchronous `lookup` → model receives+the result → final answer. No real model endpoint is called. The runtime test+starts and stops its own cf/workerd server.++```sh+npx cf deploy --dry-run+```++This builds and checks the deployable bundle without uploading it. Local tests+and a dry run do not establish hosted production behavior. `cf` comes from+Cloudflare's `cloudflare/cf` project; its Vite plugin uses the Workers SDK's+workerd runtime.++## Real model mode++Set `MODE` to `real` and configure `MODEL_ENDPOINT` (a full HTTPS chat-completions+URL) and `MODEL_NAME` in `cloudflare.config.ts`. Supply `MODEL_TOKEN` and+`INGRESS_TOKEN` as Cloudflare secrets; never put their values in source. Deploy+with `npx cf deploy` after configuring the account and reviewing the bindings.++Send `POST` with a UTF-8 prompt body and `Authorization: Bearer <INGRESS_TOKEN>`.+Authentication is checked before agent creation or model spending. Keep that+credential on your backend, not in public browser code. The example is a small+integration surface, not a production multi-tenant gateway.++Credentials stay in the JS HTTP host and are never written into Wasm. The model+endpoint is configured by the host, never by the incoming request or model.+Tools are host-registered, must explicitly validate inputs, and receive an+`AbortSignal`. There is no native shell or arbitrary filesystem access.++## SDK boundary++`createWorkerAgent()` lives in `@codegraff/sdk/worker`; the example imports its+source to exercise this checkout. The module is supplied separately by the host:++```ts+import { createWorkerAgent } from "@codegraff/sdk/worker";+import core from "./graff-worker.wasm?module";++const agent = await createWorkerAgent(core, {+ endpoint: env.MODEL_ENDPOINT,+ token: env.MODEL_TOKEN,+ model: env.MODEL_NAME,+ tools: [],+});+const result = await agent.prompt("Hello", { signal: request.signal });+```++For optional metadata-only tracing, pass `observe: exporter.observe` from the+same `createOtlpExporter` in `@codegraff/sdk/otel` used by the managed relay, then+explicitly `await exporter.flush()`. Worker turns emit only random IDs, timing,+status and the numeric `graff.api_calls` count; no prompt, tool, error or model+content. Observer failures (or an observer that never settles) cannot change+execution. The runtime fixture exercises this with an in-isolate synthetic+collector; it sends no telemetry to a network collector.++Build `graff-worker.wasm` using `zig build wasm-worker` and bundle it at build+time. Runtime compilation of fetched Wasm bytes is not supported by ordinary+Workers. Do not import the Node-only ACP embed loader here. Instantiate a fresh+agent per request, as this example does, or serialize access to one agent within+a session owner. Overlapping prompts on one instance are refused. A failed or+cancelled turn poisons that session: create a new agent rather than replaying an+uncertain tool effect.++## First-milestone limits++- Chat Completions JSON only (`stream: false`); no Responses, Messages or+ Interactions transport yet.+- The native and Worker paths share `agent_chat_step.zig`: assistant history,+ tool-call argument validation, result replay, and tool/continue/final decisions.+ Native checkpointing and provider-specific repair stay in the native adapter.+- Bounded model steps, tool batches, input/output buffers and session memory.+ Undeclared and malformed calls cannot execute; tool failures return to the+ model as tool errors. Truncated output and exhausted limits fail explicitly.+- Cancellation reaches model fetch and host tools. Tools must honor their signal;+ aborting a request cannot undo an external effect already performed.+- No durable sessions, R2 checkpoints, compaction, goals, peer mail, delegation,+ native shell/git/compiler tools, or full CLI feature parity. Storage and an+ external execution sandbox are subsequent milestones, not implicit fallbacks.++The existing `wasm-core` target and `@codegraff/sdk/embed` remain a separate,+echo-only ACP protocol surface. This Worker ABI does not turn that stub into the+full native `Agent`.diff --git a/examples/workers-engine/cloudflare.config.ts b/examples/workers-engine/cloudflare.config.tsnew file mode 100644index 00000000..78db282b--- /dev/null+++ b/examples/workers-engine/cloudflare.config.ts@@ -0,0 +1,18 @@+import { bindings, defineConfig } from "cf/config";+import * as entrypoint from "./src/index.ts" with { type: "cf-worker" };++export default defineConfig({+ worker: {+ name: "graff-workers-engine-example",+ compatibilityDate: "2026-10-06",+ entrypoint,+ env: {+ MODE: bindings.text("mock"),+ MODEL_ENDPOINT: bindings.text(""),+ MODEL_NAME: bindings.text(""),+ // Required only for MODE=real. Supply secrets through cf, never source.+ MODEL_TOKEN: bindings.secret(),+ INGRESS_TOKEN: bindings.secret(),+ },+ },+});diff --git a/examples/workers-engine/package-lock.json b/examples/workers-engine/package-lock.jsonnew file mode 100644index 00000000..14cd000b--- /dev/null+++ b/examples/workers-engine/package-lock.json@@ -0,0 +1,2229 @@+{+ "name": "graff-workers-engine-example",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "graff-workers-engine-example",+ "devDependencies": {+ "@cloudflare/vite-plugin": "beta",+ "cf": "1.0.0-beta.18",+ "typescript": "^7.0.2",+ "vite": "^8.3.0"+ }+ },+ "node_modules/@cloudflare/build-output-utils": {+ "version": "0.9.3",+ "resolved": "https://registry.npmjs.org/@cloudflare/build-output-utils/-/build-output-utils-0.9.3.tgz",+ "integrity": "sha512-0MgvIq6UxbRWLwB2QJU7qjLqpPkfygOebN3UiENhdp+z6zpRKrNnwkms2ynadmxCOh3sL2v+SI0/pNXxgXdteA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@cloudflare/config": "0.27.0"+ }+ },+ "node_modules/@cloudflare/config": {+ "version": "0.27.0",+ "resolved": "https://registry.npmjs.org/@cloudflare/config/-/config-0.27.0.tgz",+ "integrity": "sha512-wNnL0z4lj5Gm2fze5qXTOvRPbUOi4jlMmwPk7ArCUakI5oVxgjfl3Rhnfd/Mmzo3g86x/ofH75yPIhsa5msqdQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "zod": "4.6.5"+ }+ },+ "node_modules/@cloudflare/runtime-types": {+ "version": "0.1.12",+ "resolved": "https://registry.npmjs.org/@cloudflare/runtime-types/-/runtime-types-0.1.12.tgz",+ "integrity": "sha512-eYF5teHQ+Jss4sbSVINM5tNPHxo/kJ2gKcMs7omyy7gO9PEkgUbGPZCYl06SxbBWTcJFF2vrX4epB775QTE4BQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "miniflare": "5.20261012.1-beta",+ "workerd": "1.20261012.1"+ }+ },+ "node_modules/@cloudflare/unenv-preset": {+ "version": "2.16.2",+ "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.2.tgz",+ "integrity": "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==",+ "dev": true,+ "license": "MIT OR Apache-2.0",+ "peerDependencies": {+ "unenv": "2.0.0-rc.24",+ "workerd": ">1.20260305.0 <2.0.0-0"+ },+ "peerDependenciesMeta": {+ "workerd": {+ "optional": true+ }+ }+ },+ "node_modules/@cloudflare/vite-plugin": {+ "version": "2.0.0-beta.v.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/vite-plugin/-/vite-plugin-2.0.0-beta.v.1.tgz",+ "integrity": "sha512-gyxplbx5mImicE5bcMO3t3kAy5V9ad6X7Hk/K1DRINUv7n9vgjYcfmhiH0kOiXSOck/WT8R6e/HgNbBaVbhuaw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@cloudflare/build-output-utils": "0.9.3",+ "@cloudflare/config": "0.27.0",+ "@cloudflare/runtime-types": "0.1.12",+ "@cloudflare/unenv-preset": "2.16.2",+ "miniflare": "5.20261012.1-beta",+ "unenv": "2.0.0-rc.24",+ "ws": "8.21.0"+ },+ "bin": {+ "cf-vite": "bin/cf-vite"+ },+ "peerDependencies": {+ "vite": "^7.0.0 || ^8.0.0"+ }+ },+ "node_modules/@cloudflare/workerd-darwin-64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261012.1.tgz",+ "integrity": "sha512-dkTL9aY3V4D40b+jBpGPCistWUPFQ/M61wlWi6i1o8MvHFFgEw7EQkcaYEv6Yd3bkPDD/3TFT4hRsMb2xVZSwQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-darwin-arm64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261012.1.tgz",+ "integrity": "sha512-2/nVGcKXjNNI+DhxKSepTKvFng9H7aN2WXv6Zu67iqgI6JrxypNt5kTPv4ZHosxrcfyKMci/2RfN7GIrN0BitQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-linux-64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261012.1.tgz",+ "integrity": "sha512-uMe7ONHnLxStD1Ye0YFHBO36uj4cStv5P53rW+5GVWXFT8BRjqVixlH0IqCAHe1Pmcwyd1+7fVoGde89MZSCJg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-linux-arm64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261012.1.tgz",+ "integrity": "sha512-I0VMdcXk7ygG5vYDce0ePTBFdnBXC0i9WiBY5mWiv0iTinbfea6/rHqSQ7B1UMpjgrYVs9E0m4bZ9ufsk5GCFA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-windows-64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261012.1.tgz",+ "integrity": "sha512-c5hQvNx574UEoknaCFvMa/NdLrrYiALNbe6sx1okW8uOiRYWxrFuA8WpXFnBJ5XJypm0TEAHYaUTGv3rRLpY7Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cspotcode/source-map-support": {+ "version": "0.8.1",+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/trace-mapping": "0.3.9"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@emnapi/runtime": {+ "version": "1.11.3",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",+ "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@img/colour": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",+ "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@img/sharp-darwin-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz",+ "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-arm64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-darwin-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz",+ "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-x64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-freebsd-wasm32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz",+ "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==",+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "dependencies": {+ "@img/sharp-wasm32": "0.35.5"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-arm64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz",+ "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-x64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz",+ "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz",+ "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz",+ "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-ppc64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz",+ "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-riscv64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz",+ "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-s390x": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz",+ "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-x64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz",+ "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz",+ "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz",+ "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-linux-arm": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz",+ "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz",+ "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-ppc64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz",+ "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-ppc64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-riscv64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz",+ "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-riscv64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-s390x": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz",+ "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-s390x": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz",+ "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-x64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz",+ "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz",+ "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-x64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-wasm32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz",+ "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==",+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/runtime": "^1.11.3"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-webcontainers-wasm32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz",+ "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==",+ "cpu": [+ "wasm32"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "@img/sharp-wasm32": "0.35.5"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz",+ "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-ia32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz",+ "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz",+ "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.9",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.0.3",+ "@jridgewell/sourcemap-codec": "^1.4.10"+ }+ },+ "node_modules/@oxc-project/types": {+ "version": "0.154.0",+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz",+ "integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/oxc-project"+ }+ },+ "node_modules/@poppinss/colors": {+ "version": "4.1.6",+ "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz",+ "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "kleur": "^4.1.5"+ }+ },+ "node_modules/@poppinss/dumper": {+ "version": "0.6.5",+ "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz",+ "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@poppinss/colors": "^4.1.5",+ "@sindresorhus/is": "^7.0.2",+ "supports-color": "^10.0.0"+ }+ },+ "node_modules/@poppinss/exception": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz",+ "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@rolldown/binding-android-arm-eabi": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.14.tgz",+ "integrity": "sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-android-arm64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.14.tgz",+ "integrity": "sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-arm64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.14.tgz",+ "integrity": "sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-x64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.14.tgz",+ "integrity": "sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-freebsd-x64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.14.tgz",+ "integrity": "sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm-gnueabihf": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.14.tgz",+ "integrity": "sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.14.tgz",+ "integrity": "sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-musl": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.14.tgz",+ "integrity": "sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-ppc64-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.14.tgz",+ "integrity": "sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-s390x-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.14.tgz",+ "integrity": "sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.14.tgz",+ "integrity": "sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-musl": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.14.tgz",+ "integrity": "sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-openharmony-arm64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.14.tgz",+ "integrity": "sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-arm64-msvc": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.14.tgz",+ "integrity": "sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-x64-msvc": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.14.tgz",+ "integrity": "sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",+ "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@sindresorhus/is": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz",+ "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/is?sponsor=1"+ }+ },+ "node_modules/@speed-highlight/core": {+ "version": "1.2.24",+ "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.24.tgz",+ "integrity": "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw==",+ "dev": true,+ "license": "CC0-1.0"+ },+ "node_modules/@typescript/typescript-aix-ppc64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz",+ "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-darwin-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz",+ "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-darwin-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz",+ "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-freebsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz",+ "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-freebsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz",+ "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-arm": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz",+ "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz",+ "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-loong64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz",+ "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-mips64el": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz",+ "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-ppc64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz",+ "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-riscv64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz",+ "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-s390x": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz",+ "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz",+ "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-netbsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz",+ "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-netbsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz",+ "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-openbsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz",+ "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-openbsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz",+ "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-sunos-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz",+ "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-win32-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz",+ "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-win32-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz",+ "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/blake3-wasm": {+ "version": "2.1.5",+ "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz",+ "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/cf": {+ "version": "1.0.0-beta.18",+ "resolved": "https://registry.npmjs.org/cf/-/cf-1.0.0-beta.18.tgz",+ "integrity": "sha512-SG9NqB6xEZf/WZm6+E2v0OIY5JA0b9DUgl1VOOlF0D5Y+Nk5PyhHonJOd6K2/g6f261h+Z0FwTEK69c9bfIq4g==",+ "dev": true,+ "license": "MIT OR Apache-2.0",+ "dependencies": {+ "@cloudflare/build-output-utils": "0.9.3",+ "@cloudflare/config": "0.27.0",+ "@cloudflare/runtime-types": "0.1.12",+ "blake3-wasm": "2.1.5",+ "miniflare": "5.20261012.1-beta"+ },+ "bin": {+ "cf": "bin/cf",+ "cloudflare": "bin/cf"+ },+ "engines": {+ "node": ">=22"+ }+ },+ "node_modules/cookie": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/detect-libc": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/error-stack-parser-es": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz",+ "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/antfu"+ }+ },+ "node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/kleur": {+ "version": "4.1.5",+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/lightningcss": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",+ "dev": true,+ "license": "MPL-2.0",+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.33.0",+ "lightningcss-darwin-arm64": "1.33.0",+ "lightningcss-darwin-x64": "1.33.0",+ "lightningcss-freebsd-x64": "1.33.0",+ "lightningcss-linux-arm-gnueabihf": "1.33.0",+ "lightningcss-linux-arm64-gnu": "1.33.0",+ "lightningcss-linux-arm64-musl": "1.33.0",+ "lightningcss-linux-x64-gnu": "1.33.0",+ "lightningcss-linux-x64-musl": "1.33.0",+ "lightningcss-win32-arm64-msvc": "1.33.0",+ "lightningcss-win32-x64-msvc": "1.33.0"+ }+ },+ "node_modules/lightningcss-android-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-freebsd-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/miniflare": {+ "version": "5.20261012.1-beta",+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261012.1-beta.tgz",+ "integrity": "sha512-8Canhy6g9+vAhqMc0o80YphqYIwpiA3aAp8aX+uDXU7J/qbUeoZzcII9c2V1P4uT/eHD4SB93qet1o1bRY3BuQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@cspotcode/source-map-support": "0.8.1",+ "sharp": "0.35.5",+ "undici": "7.29.1",+ "workerd": "1.20261012.1",+ "ws": "8.21.0",+ "youch": "4.1.0-beta.10"+ },+ "engines": {+ "node": ">=22.0.0"+ }+ },+ "node_modules/nanoid": {+ "version": "3.3.20",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",+ "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/pathe": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "4.0.7",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.30",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.30.tgz",+ "integrity": "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.20",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.2"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/rolldown": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.14.tgz",+ "integrity": "sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@oxc-project/types": "=0.154.0",+ "@rolldown/pluginutils": "^1.0.0"+ },+ "bin": {+ "rolldown": "bin/cli.mjs"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "optionalDependencies": {+ "@rolldown/binding-android-arm-eabi": "1.2.14",+ "@rolldown/binding-android-arm64": "1.2.14",+ "@rolldown/binding-darwin-arm64": "1.2.14",+ "@rolldown/binding-darwin-x64": "1.2.14",+ "@rolldown/binding-freebsd-x64": "1.2.14",+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.14",+ "@rolldown/binding-linux-arm64-gnu": "1.2.14",+ "@rolldown/binding-linux-arm64-musl": "1.2.14",+ "@rolldown/binding-linux-ppc64-gnu": "1.2.14",+ "@rolldown/binding-linux-s390x-gnu": "1.2.14",+ "@rolldown/binding-linux-x64-gnu": "1.2.14",+ "@rolldown/binding-linux-x64-musl": "1.2.14",+ "@rolldown/binding-openharmony-arm64": "1.2.14",+ "@rolldown/binding-win32-arm64-msvc": "1.2.14",+ "@rolldown/binding-win32-x64-msvc": "1.2.14"+ }+ },+ "node_modules/semver": {+ "version": "7.8.5",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/sharp": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz",+ "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@img/colour": "^1.1.0",+ "detect-libc": "^2.1.2",+ "semver": "^7.8.5"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-darwin-arm64": "0.35.5",+ "@img/sharp-darwin-x64": "0.35.5",+ "@img/sharp-freebsd-wasm32": "0.35.5",+ "@img/sharp-libvips-darwin-arm64": "1.3.4",+ "@img/sharp-libvips-darwin-x64": "1.3.4",+ "@img/sharp-libvips-linux-arm": "1.3.4",+ "@img/sharp-libvips-linux-arm64": "1.3.4",+ "@img/sharp-libvips-linux-ppc64": "1.3.4",+ "@img/sharp-libvips-linux-riscv64": "1.3.4",+ "@img/sharp-libvips-linux-s390x": "1.3.4",+ "@img/sharp-libvips-linux-x64": "1.3.4",+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.4",+ "@img/sharp-libvips-linuxmusl-x64": "1.3.4",+ "@img/sharp-linux-arm": "0.35.5",+ "@img/sharp-linux-arm64": "0.35.5",+ "@img/sharp-linux-ppc64": "0.35.5",+ "@img/sharp-linux-riscv64": "0.35.5",+ "@img/sharp-linux-s390x": "0.35.5",+ "@img/sharp-linux-x64": "0.35.5",+ "@img/sharp-linuxmusl-arm64": "0.35.5",+ "@img/sharp-linuxmusl-x64": "0.35.5",+ "@img/sharp-webcontainers-wasm32": "0.35.5",+ "@img/sharp-win32-arm64": "0.35.5",+ "@img/sharp-win32-ia32": "0.35.5",+ "@img/sharp-win32-x64": "0.35.5"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",+ "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/supports-color": {+ "version": "10.2.2",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/chalk/supports-color?sponsor=1"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.17",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.4"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tslib": {+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "dev": true,+ "license": "0BSD",+ "optional": true+ },+ "node_modules/typescript": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz",+ "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc"+ },+ "engines": {+ "node": ">=16.20.0"+ },+ "optionalDependencies": {+ "@typescript/typescript-aix-ppc64": "7.0.2",+ "@typescript/typescript-darwin-arm64": "7.0.2",+ "@typescript/typescript-darwin-x64": "7.0.2",+ "@typescript/typescript-freebsd-arm64": "7.0.2",+ "@typescript/typescript-freebsd-x64": "7.0.2",+ "@typescript/typescript-linux-arm": "7.0.2",+ "@typescript/typescript-linux-arm64": "7.0.2",+ "@typescript/typescript-linux-loong64": "7.0.2",+ "@typescript/typescript-linux-mips64el": "7.0.2",+ "@typescript/typescript-linux-ppc64": "7.0.2",+ "@typescript/typescript-linux-riscv64": "7.0.2",+ "@typescript/typescript-linux-s390x": "7.0.2",+ "@typescript/typescript-linux-x64": "7.0.2",+ "@typescript/typescript-netbsd-arm64": "7.0.2",+ "@typescript/typescript-netbsd-x64": "7.0.2",+ "@typescript/typescript-openbsd-arm64": "7.0.2",+ "@typescript/typescript-openbsd-x64": "7.0.2",+ "@typescript/typescript-sunos-x64": "7.0.2",+ "@typescript/typescript-win32-arm64": "7.0.2",+ "@typescript/typescript-win32-x64": "7.0.2"+ }+ },+ "node_modules/undici": {+ "version": "7.29.1",+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.1.tgz",+ "integrity": "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=20.18.1"+ }+ },+ "node_modules/unenv": {+ "version": "2.0.0-rc.24",+ "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz",+ "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "pathe": "^2.0.3"+ }+ },+ "node_modules/vite": {+ "version": "8.3.4",+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz",+ "integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "lightningcss": "^1.33.0",+ "picomatch": "^4.0.7",+ "postcss": "^8.5.29",+ "rolldown": "~1.2.12",+ "tinyglobby": "^0.2.17"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^20.19.0 || >=22.12.0",+ "@vitejs/devtools": "^0.7.1",+ "esbuild": "^0.27.0 || ^0.28.0",+ "jiti": ">=1.21.0",+ "less": "^4.0.0",+ "sass": "^1.70.0",+ "sass-embedded": "^1.70.0",+ "stylus": ">=0.54.8",+ "sugarss": "^5.0.0",+ "terser": "^5.16.0",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "@vitejs/devtools": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "jiti": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ },+ "node_modules/workerd": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261012.1.tgz",+ "integrity": "sha512-tEHoMPsMga0seVjxfsR8Pd3f8IRqYwkq++dTUKI5Gdgj6zuSDluYwisydq+dn90SsIACwBquJUQ1nBpcOqaWTA==",+ "dev": true,+ "hasInstallScript": true,+ "license": "Apache-2.0",+ "peer": true,+ "bin": {+ "workerd": "bin/workerd"+ },+ "engines": {+ "node": ">=16"+ },+ "optionalDependencies": {+ "@cloudflare/workerd-darwin-64": "1.20261012.1",+ "@cloudflare/workerd-darwin-arm64": "1.20261012.1",+ "@cloudflare/workerd-linux-64": "1.20261012.1",+ "@cloudflare/workerd-linux-arm64": "1.20261012.1",+ "@cloudflare/workerd-windows-64": "1.20261012.1"+ }+ },+ "node_modules/ws": {+ "version": "8.21.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",+ "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ },+ "peerDependencies": {+ "bufferutil": "^4.0.1",+ "utf-8-validate": ">=5.0.2"+ },+ "peerDependenciesMeta": {+ "bufferutil": {+ "optional": true+ },+ "utf-8-validate": {+ "optional": true+ }+ }+ },+ "node_modules/youch": {+ "version": "4.1.0-beta.10",+ "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz",+ "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@poppinss/colors": "^4.1.5",+ "@poppinss/dumper": "^0.6.4",+ "@speed-highlight/core": "^1.2.7",+ "cookie": "^1.0.2",+ "youch-core": "^0.3.3"+ }+ },+ "node_modules/youch-core": {+ "version": "0.3.3",+ "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz",+ "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@poppinss/exception": "^1.2.2",+ "error-stack-parser-es": "^1.0.5"+ }+ },+ "node_modules/zod": {+ "version": "4.6.5",+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz",+ "integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }+ }+ }+}diff --git a/examples/workers-engine/package.json b/examples/workers-engine/package.jsonnew file mode 100644index 00000000..0066bf1c--- /dev/null+++ b/examples/workers-engine/package.json@@ -0,0 +1,17 @@+{+ "name": "graff-workers-engine-example",+ "private": true,+ "type": "module",+ "scripts": {+ "dev": "cf dev",+ "build": "cf build",+ "typecheck": "cf workers types && tsc",+ "test": "node --test runtime.test.mjs"+ },+ "devDependencies": {+ "@cloudflare/vite-plugin": "beta",+ "cf": "1.0.0-beta.18",+ "typescript": "^7.0.2",+ "vite": "^8.3.0"+ }+}diff --git a/examples/workers-engine/runtime.test.mjs b/examples/workers-engine/runtime.test.mjsnew file mode 100644index 00000000..abdb553b--- /dev/null+++ b/examples/workers-engine/runtime.test.mjs@@ -0,0 +1,175 @@+// Runs real workerd through cf; no substitute Wasm or native proxy.+import assert from "node:assert/strict";+import { spawn } from "node:child_process";+import { once } from "node:events";+import { existsSync } from "node:fs";+import test from "node:test";+import { fileURLToPath } from "node:url";++const cwd = fileURLToPath(new URL(".", import.meta.url));+const wasm = new URL("../../zig-out/bin/graff-worker.wasm", import.meta.url);+async function start() {+ assert.ok(existsSync(wasm), "Build the actual engine first: zig build wasm-worker");+ const child = spawn(process.execPath, ["node_modules/cf/bin/cf", "dev"], {+ cwd, detached: true, stdio: ["ignore", "pipe", "pipe"],+ env: { ...process.env, NO_COLOR: "1", CF_SEND_TELEMETRY: "false", WRANGLER_SEND_METRICS: "false" },+ });+ let output = "";+ const stop = async () => {+ if (child.exitCode !== null || child.signalCode !== null) return;+ const exited = once(child, "exit");+ try { process.kill(-child.pid, "SIGTERM"); } catch { return; }+ const timer = setTimeout(() => { try { process.kill(-child.pid, "SIGKILL"); } catch {} }, 3000);+ timer.unref();+ await exited;+ clearTimeout(timer);+ };+ try {+ const url = await new Promise((resolve, reject) => {+ const timeout = setTimeout(() => reject(new Error(`cf dev was not ready within 60s\n${output}`)), 60_000);+ const fail = error => { clearTimeout(timeout); reject(error); };+ child.once("error", fail);+ child.once("exit", code => fail(new Error(`cf dev exited (${code}) before ready\n${output}`)));+ const collect = data => {+ output = (output + data.toString().replace(/\x1b\[[0-9;]*m/g, "")).slice(-16_384);+ const local = output.match(/https?:\/\/(?:localhost|127\.0\.0\.1|\[::1\]):\d+\/?/);+ // Wait for the dev server's readiness announcement, not a polling GET.+ if (local && /ready|listening/i.test(output)) {+ clearTimeout(timeout);+ resolve(local[0]);+ }+ };+ child.stdout.on("data", collect);+ child.stderr.on("data", collect);+ });+ return { url, stop };+ } catch (error) { await stop(); throw error; }+}++test("isolate-native model → host tool → model", { timeout: 90_000 }, async t => {+ const server = await start();+ t.after(server.stop);+ async function run(scenario, query = "") {+ const response = await fetch(new URL(`?scenario=${scenario}${query}`, server.url), { signal: AbortSignal.timeout(10_000) });+ return { response, body: await response.json() };+ }+ await t.test("async tool result returns to the model and produces the final answer", async () => {+ const { response, body } = await run("normal");+ assert.equal(response.status, 200, JSON.stringify(body));+ assert.equal(body.ok, true);+ assert.equal(body.telemetry, undefined, "telemetry is opt-in");+ assert.equal(body.text, "Found value:alpha");+ assert.equal(body.modelCalls, 2);+ assert.equal(body.toolCalls, 1);+ assert.deepEqual(body.observed, { modelCalls: 2, executed: 1, events: ["model", "tool", "model"] });+ });+ for (const scenario of ["unknown", "malformed", "bad-json"]) {+ await t.test(`${scenario} tool call never executes and is returned as a tool error`, async () => {+ const { response, body } = await run(scenario);+ assert.equal(response.status, 200, JSON.stringify(body));+ assert.equal(body.ok, true);+ assert.equal(body.text, "Tool rejected safely");+ assert.equal(body.modelCalls, 2);+ assert.deepEqual(body.observed, { modelCalls: 2, executed: 0, events: ["model", "model"] });+ });+ }+ await t.test("cancellation reaches an asynchronous host tool", async () => {+ const { response, body } = await run("cancel");+ assert.equal(response.status, 200, JSON.stringify(body));+ assert.equal(body.cancelled, true);+ assert.equal(body.toolAborted, true);+ assert.deepEqual(body.observed, { modelCalls: 1, executed: 1, events: ["model", "tool"] });+ });+ function traceSpans(body, codes, dropped = 0) {+ const { telemetry } = body;+ assert.equal(telemetry.dropped, dropped);+ assert.equal(telemetry.payloads.length, 1);+ const payload = telemetry.payloads[0];+ assert.deepEqual(payload.resourceSpans[0].resource.attributes,+ [{ key: "service.name", value: { stringValue: "codegraff-sdk" } }]);+ const spans = payload.resourceSpans[0].scopeSpans[0].spans;+ assert.equal(spans.length, codes.length);+ assert.equal(telemetry.spans.length, codes.length);+ for (const [i, span] of spans.entries()) {+ assert.equal(span.name, "graff.turn");+ assert.match(span.traceId, /^[0-9a-f]{32}$/);+ assert.match(span.spanId, /^[0-9a-f]{16}$/);+ assert.notEqual(BigInt(`0x${span.traceId}`), 0n);+ assert.notEqual(BigInt(`0x${span.spanId}`), 0n);+ assert.match(span.startTimeUnixNano, /^\d+$/);+ assert.match(span.endTimeUnixNano, /^\d+$/);+ assert.ok(BigInt(span.startTimeUnixNano) > 1_000_000_000_000_000_000n);+ assert.ok(BigInt(span.endTimeUnixNano) >= BigInt(span.startTimeUnixNano));+ assert.deepEqual(span.status, { code: codes[i] });+ const keys = ["traceId", "spanId", "name", "startTimeUnixNano", "endTimeUnixNano", "status"];+ const success = codes[i] === 1;+ if (success) keys.push("attributes");+ assert.deepEqual(Object.keys(span).sort(), keys.sort());+ assert.deepEqual(Object.keys(telemetry.spans[i]).sort(), keys.sort());+ if (success) {+ assert.deepEqual(span.attributes, [{ key: "graff.api_calls", value: { intValue: "2" } }]);+ assert.deepEqual(telemetry.spans[i].attributes, { "graff.api_calls": 2 });+ }+ }+ const encoded = JSON.stringify({ payloads: telemetry.payloads, spans: telemetry.spans });+ for (const excluded of ["Look up alpha", "Found value:alpha", "lookup", "lookup_1", "alpha",+ "mock-model", "mock.invalid", "collector.invalid", "synthetic-model-token", "synthetic-collector-token",+ "synthetic-observer-error", "Agent request failed", "Worker engine failed", "Agent cancelled",+ "synthetic-concurrent-prompt", "synthetic-poisoned-prompt", "Use lookup when a value is requested"]) {+ assert.equal(encoded.includes(excluded), false, `trace contains excluded content: ${excluded}`);+ }+ assert.equal(new Set(spans.map(span => span.traceId)).size, spans.length);+ assert.equal(new Set(spans.map(span => span.spanId)).size, spans.length);+ return spans;+ }+ await t.test("shared OTLP exporter observes a content-free turn without changing execution", async () => {+ const first = await run("normal", "&observe=export");+ assert.equal(first.response.status, 200);+ assert.equal(first.body.text, "Found value:alpha");+ assert.equal(first.body.modelCalls, 2);+ assert.equal(first.body.toolCalls, 1);+ assert.deepEqual(first.body.observed, { modelCalls: 2, executed: 1, events: ["model", "tool", "model"] });+ const [span] = traceSpans(first.body, [1]);+ const second = await run("normal", "&observe=export&probe=concurrent");+ assert.equal(second.response.status, 200);+ assert.equal(second.body.text, first.body.text);+ assert.deepEqual(second.body.observed, first.body.observed);+ assert.equal(second.body.telemetry.concurrentRejected, true);+ const [next] = traceSpans(second.body, [1]); // rejected concurrent prompt must not create a span+ assert.notEqual(next.traceId, span.traceId);+ assert.notEqual(next.spanId, span.spanId);+ });+ for (const observation of ["throw", "reject", "pending", "collector-fail"]) {+ await t.test(`${observation} observer/collector cannot change or block a completed turn`, async () => {+ const { response, body } = await run("normal", `&observe=${observation}`);+ assert.equal(response.status, 200);+ assert.equal(body.text, "Found value:alpha");+ assert.deepEqual(body.observed, { modelCalls: 2, executed: 1, events: ["model", "tool", "model"] });+ traceSpans(body, [1], observation === "collector-fail" ? 1 : 0);+ });+ }+ await t.test("failed and cancelled turns stay failed/poisoned with observational spans", async () => {+ for (const observation of ["throw", "reject", "pending"]) {+ for (const scenario of ["oversize", "cancel"]) {+ const { response, body } = await run(scenario, `&observe=${observation}&probe=poison`);+ assert.equal(response.status, scenario === "cancel" ? 200 : 500);+ assert.equal(body.ok, scenario === "cancel");+ assert.equal(body.telemetry.poisonedRejected, true);+ assert.deepEqual(body.observed, scenario === "cancel"+ ? { modelCalls: 1, executed: 1, events: ["model", "tool"] }+ : { modelCalls: 1, executed: 0, events: ["model"] });+ if (scenario === "cancel") {+ assert.equal(body.cancelled, true);+ assert.equal(body.toolAborted, true);+ }+ traceSpans(body, [2, 2]);+ }+ }+ });+ await t.test("model body is bounded without trusting Content-Length", async () => {+ const { response, body } = await run("oversize");+ assert.equal(response.status, 500);+ assert.equal(body.ok, false);+ assert.deepEqual(body.observed, { modelCalls: 1, executed: 0, events: ["model"] });+ });+});diff --git a/examples/workers-engine/src/index.ts b/examples/workers-engine/src/index.tsnew file mode 100644index 00000000..daab4779--- /dev/null+++ b/examples/workers-engine/src/index.ts@@ -0,0 +1,159 @@+import { createWorkerAgent, type WorkerAgent, type WorkerTool } from "../../../sdk/ts/worker.ts";+import { createOtlpExporter, type SpanObserver } from "../../../sdk/ts/otel.ts";+import module from "../../../zig-out/bin/graff-worker.wasm?module";++type Env = { MODE?: string; MODEL_ENDPOINT?: string; MODEL_NAME?: string; MODEL_TOKEN?: string; INGRESS_TOKEN?: string };+function check(value: unknown, message: string): asserts value {+ if (!value) throw new Error(message);+}+async function promptBody(request: Request): Promise<string> {+ if (!request.body) throw new Error("Missing prompt");+ const reader = request.body.getReader();+ const chunks: Uint8Array[] = [];+ let size = 0;+ try {+ while (true) {+ const { value, done } = await reader.read();+ if (done) break;+ size += value.length;+ if (size > 60 * 1024) { await reader.cancel(); throw new Error("Prompt too large"); }+ chunks.push(value);+ }+ } finally { reader.releaseLock(); }+ const bytes = new Uint8Array(size);+ let offset = 0;+ for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.length; }+ return new TextDecoder("utf-8", { fatal: true, ignoreBOM: false }).decode(bytes);+}+export default {+ async fetch(request: Request, env: Env): Promise<Response> {+ const real = env.MODE === "real";+ // Authenticate BEFORE instantiating an agent, reading a body, or spending.+ if (real && (!env.INGRESS_TOKEN || request.headers.get("authorization") !== `Bearer ${env.INGRESS_TOKEN}`)) {+ return new Response("Unauthorized", { status: 401 });+ }+ if (real && (!env.MODEL_ENDPOINT || !env.MODEL_NAME || !env.MODEL_TOKEN)) {+ return new Response("Model bindings are not configured", { status: 503 });+ }+ if (real && request.method !== "POST") return new Response("Use POST with a UTF-8 prompt", { status: 405 });+ const query = new URL(request.url).searchParams;+ const scenario = real ? "normal" : query.get("scenario") ?? "normal";+ if (!["normal", "unknown", "malformed", "bad-json", "cancel", "oversize"].includes(scenario)) {+ return new Response("Unknown scenario", { status: 400 });+ }+ // Synthetic collector only: fixture telemetry never leaves this isolate.+ const observation = real ? null : query.get("observe");+ const payloads: unknown[] = [];+ const spans: unknown[] = [];+ const exporter = observation ? createOtlpExporter({+ url: "https://collector.invalid/v1/traces", apiKey: "synthetic-collector-token",+ fetch: async (_url, init) => {+ payloads.push(JSON.parse(String(init?.body)));+ return new Response(null, { status: observation === "collector-fail" ? 503 : 200 });+ },+ }) : undefined;+ const observe: SpanObserver | undefined = exporter ? span => {+ spans.push(span);+ exporter.observe(span);+ if (observation === "throw") throw new Error("synthetic-observer-error");+ if (observation === "reject") return Promise.reject(new Error("synthetic-observer-error"));+ if (observation === "pending") return new Promise<void>(() => {});+ } : undefined;+ let concurrentRejected = false;+ let poisonedRejected = false;+ const telemetry = async () => {+ if (!exporter) return undefined;+ await exporter.flush();+ return { payloads, spans, dropped: exporter.dropped, concurrentRejected, poisonedRejected };+ };+ const controller = new AbortController();+ const abort = () => controller.abort();+ request.signal.addEventListener("abort", abort, { once: true });+ if (request.signal.aborted) abort();+ const events: string[] = [];+ let modelCalls = 0;+ let executed = 0;+ let toolAborted = false;+ const tool: WorkerTool = {+ name: "lookup", description: "Look up a public example value by key.",+ parameters: { type: "object", properties: { key: { type: "string" } }, required: ["key"], additionalProperties: false },+ validate: input => !!input && typeof input === "object" && !Array.isArray(input) &&+ Object.keys(input).length === 1 && typeof (input as { key?: unknown }).key === "string",+ async execute(input, { signal }) {+ executed++;+ events.push("tool");+ if (scenario === "cancel") {+ await new Promise<void>((_resolve, reject) => {+ signal.addEventListener("abort", () => { toolAborted = true; reject(new Error("Cancelled")); }, { once: true });+ setTimeout(abort, 10);+ });+ }+ await new Promise(resolve => setTimeout(resolve, 1));+ check(!signal.aborted, "Tool was aborted");+ return `value:${(input as { key: string }).key}`;+ },+ };+ const mockFetch: typeof fetch = async (_url, init) => {+ modelCalls++;+ events.push("model");+ check(init?.signal && !init.signal.aborted, "Missing model signal");+ const body = JSON.parse(String(init.body));+ check(body.model === "mock-model" && body.stream === false, "Wrong chat request");+ check(body.messages.some((m: { role: string }) => m.role === "user"), "Missing user prompt");+ if (scenario === "oversize") {+ // No Content-Length: the SDK must bound the actual stream.+ return new Response(new ReadableStream({ start(c) { c.enqueue(new Uint8Array(1024 * 1024 + 1)); c.close(); } }));+ }+ check(modelCalls <= 2, "Unexpected extra model call");+ if (modelCalls === 1) {+ check(body.tools?.some((t: { function?: { name: string } }) => t.function?.name === "lookup"), "Missing tool schema");+ await new Promise(resolve => setTimeout(resolve, 1));+ return Response.json({ choices: [{ message: { role: "assistant", content: null, tool_calls: [{+ id: "lookup_1", type: "function", function: {+ name: scenario === "unknown" ? "not_registered" : "lookup",+ arguments: scenario === "bad-json" ? "{" : JSON.stringify({ key: scenario === "malformed" ? 42 : "alpha" }),+ },+ }] }, finish_reason: "tool_calls" }] });+ }+ const result = body.messages.findLast((m: { role: string }) => m.role === "tool");+ check(result?.tool_call_id === "lookup_1", "Missing matching tool result");+ const invalid = ["unknown", "malformed", "bad-json"].includes(scenario);+ check(invalid ? executed === 0 && typeof result.content === "string" && result.content.length > 0+ : executed === 1 && result.content.includes("value:alpha"), "Host tool result was not fed to model");+ return Response.json({ choices: [{ message: { role: "assistant", content: invalid ? "Tool rejected safely" : "Found value:alpha" }, finish_reason: "stop" }] });+ };+ let agent: WorkerAgent | undefined;+ try {+ // A fresh instance for every request; no credentials are sent into Wasm.+ agent = await createWorkerAgent(module, {+ model: real ? env.MODEL_NAME! : "mock-model",+ endpoint: real ? env.MODEL_ENDPOINT! : "https://mock.invalid/v1/chat/completions",+ token: real ? env.MODEL_TOKEN : "synthetic-model-token",+ fetch: real ? fetch : mockFetch,+ instructions: "Use lookup when a value is requested. Do not invent values.",+ tools: [tool], maxSteps: 4, observe,+ });+ const pending = agent.prompt(real ? await promptBody(request) : "Look up alpha", { signal: controller.signal });+ if (!real && query.get("probe") === "concurrent") {+ try { await agent.prompt("synthetic-concurrent-prompt"); }+ catch (error) { concurrentRejected = error instanceof Error && error.message === "Agent prompt is already running"; }+ check(concurrentRejected, "Concurrent prompt was not rejected");+ }+ const result = await pending;+ return Response.json({ ok: true, ...result, observed: real ? undefined : { modelCalls, executed, events },+ telemetry: await telemetry() });+ } catch (error) {+ if (!real && agent && query.get("probe") === "poison") {+ try { await agent.prompt("synthetic-poisoned-prompt"); }+ catch { poisonedRejected = true; }+ }+ if (!real && scenario === "cancel" && controller.signal.aborted && toolAborted && error instanceof DOMException && error.name === "AbortError") {+ return Response.json({ ok: true, cancelled: true, toolAborted, observed: { modelCalls, executed, events },+ telemetry: await telemetry() });+ }+ // Engine/host details and credentials do not belong in ingress responses.+ return Response.json({ ok: false, error: "Agent request failed", observed: real ? undefined : { modelCalls, executed, events },+ telemetry: await telemetry() }, { status: 500 });+ } finally { request.signal.removeEventListener("abort", abort); }+ },+};diff --git a/examples/workers-engine/src/wasm.d.ts b/examples/workers-engine/src/wasm.d.tsnew file mode 100644index 00000000..2abf2d40--- /dev/null+++ b/examples/workers-engine/src/wasm.d.ts@@ -0,0 +1,4 @@+declare module "*.wasm?module" {+ const module: WebAssembly.Module;+ export default module;+}diff --git a/examples/workers-engine/tsconfig.json b/examples/workers-engine/tsconfig.jsonnew file mode 100644index 00000000..4691cd9b--- /dev/null+++ b/examples/workers-engine/tsconfig.json@@ -0,0 +1,16 @@+{+ "compilerOptions": {+ "target": "es2024",+ "lib": ["es2024"],+ "module": "preserve",+ "moduleResolution": "bundler",+ "types": [],+ "strict": true,+ "noEmit": true,+ "allowImportingTsExtensions": true,+ "isolatedModules": true,+ "verbatimModuleSyntax": true,+ "skipLibCheck": true+ },+ "include": ["src", "cloudflare.config.ts", "vite.config.ts", ".cloudflare/types", "../../sdk/ts/worker.ts"]+}diff --git a/examples/workers-engine/vite.config.ts b/examples/workers-engine/vite.config.tsnew file mode 100644index 00000000..14b709d8--- /dev/null+++ b/examples/workers-engine/vite.config.ts@@ -0,0 +1,4 @@+import { cloudflare } from "@cloudflare/vite-plugin";+import { defineConfig } from "vite";++export default defineConfig({ plugins: [cloudflare()], build: { sourcemap: false } });diff --git a/examples/workers-sandbox/.gitignore b/examples/workers-sandbox/.gitignorenew file mode 100644index 00000000..05590edd--- /dev/null+++ b/examples/workers-sandbox/.gitignore@@ -0,0 +1,5 @@+node_modules/+.cloudflare/+dist/+.dev.vars*+.env*diff --git a/examples/workers-sandbox/README.md b/examples/workers-sandbox/README.mdnew file mode 100644index 00000000..85695ceb--- /dev/null+++ b/examples/workers-sandbox/README.md@@ -0,0 +1,78 @@+# Worker-native Graff with Codegraff sandboxes++A Durable Object owns a task, Graff's Zig/Wasm chat step owns the model/tool loop,+and an existing Codegraff cloud VM executes shell commands. This does not move+the agent into the VM or require a new Docker/Cloudflare Container installation.++A DO can coordinate difficult tasks, retain state, and await model and tool+calls. It cannot itself spawn Linux processes. That execution capability is+provided here by Codegraff's documented sandbox HTTP API.++## Live coding test++This is an **opt-in, billed integration test**: real inference and a real,+disposable fleet sandbox. It sends only a synthetic Python repair task, never+local repository files or user data.++```sh+# Repository root; Zig 0.17.0 and Node 22+.+zig build wasm-worker+cd examples/workers-sandbox+npm ci+npm run typecheck+# Set CODEGRAFF_API_KEY securely in the environment, then:+npm run test:live+```++The example defaults to `ultramarine-1-flash` (Ultramarine 1 Flash). The live test asserts that every outgoing+model request uses that exact configured alias; it never substitutes another+model. Set `GRAFF_SANDBOX_TEST_MODEL` explicitly to test a different configured+model.++The test starts cf/workerd and an authenticated loopback bridge. The real key+stays in the bridge process's memory; it is removed from cf's child environment+and never written to configuration, Wasm memory or the sandbox. No secret file+is created. The bridge allows only model calls and operations on VMs this test+created, and stops when the test ends.++The Durable Object:++1. Creates an isolated Codegraff fleet VM with a bounded lease.+2. Uploads a deliberately broken interval-subtraction module and independent tests.+3. Confirms the original implementation fails and that model/ingress credentials+ are absent from the VM environment.+4. Runs the real model through Graff's WASM core. `sandbox_exec` lets it inspect,+ edit and test the module in the VM.+5. Independently verifies unchanged tests, a changed implementation, named edge+ cases and 2,000 deterministic randomized comparisons against an integer-set+ oracle. A model's claim of success is not sufficient.+6. Deletes the VM. A recorded VM ID and DO alarm provide backup cleanup if the+ request is interrupted; the short VM lease is a further bound.++Output contains the synthetic result, verification and aggregate call counts,+not credentials or sandbox identifiers. No hosted Worker is deployed by the test.++## Hosting the example++Supply `CODEGRAFF_API_KEY` and `INGRESS_TOKEN` using Cloudflare secrets, choose+`MODEL_NAME`, and use `cf deploy --dry-run` before deploying. Do not set+`GRAFF_SANDBOX_TEST_BRIDGE` outside the local test. Ingress requires an authenticated+POST before allocating a task or spending credits. The endpoint runs the fixed+repair fixture; it is not a general-purpose unauthenticated command service.++`SandboxTask` is an actual Durable Object. Its storage currently records only+cleanup ownership, not a resumable conversation. Every request receives a new+task/VM; overlapping callers cannot share workspaces. Codegraff API credentials+remain in the Worker host; the VM is never given those credentials.++The fetch-only client is `@codegraff/sdk/worker-sandbox`. It uses the public+[Codegraff sandbox API](https://codegraff.com/docs/sandboxes), bounds request+and response sizes, has no automatic effect retries, and supports independent+cleanup after task cancellation. Aborting HTTP does not prove a remote command+stopped; VM destruction is the execution boundary. The test is not an adversarial+audit of the VM provider's isolation.++This builds on the experimental Worker-native core's current limitations:+nonstreaming Chat Completions, bounded host tools, and no full native CLI parity.+Long-lived sessions, workspace snapshots, resumable turns and longer asynchronous+sandbox jobs remain separate capabilities.diff --git a/examples/workers-sandbox/cloudflare.config.ts b/examples/workers-sandbox/cloudflare.config.tsnew file mode 100644index 00000000..7d9006cc--- /dev/null+++ b/examples/workers-sandbox/cloudflare.config.ts@@ -0,0 +1,22 @@+import { bindings, defineConfig, exports as configExports } from "cf/config";+import * as entrypoint from "./src/index.ts" with { type: "cf-worker" };++// Local live-test bridge holds the real key in a Node process, not build output.+const bridge = process.env.GRAFF_SANDBOX_TEST_BRIDGE ?? "";+if (bridge && !/^http:\/\/127\.0\.0\.1:\d+$/.test(bridge)) throw new Error("Test bridge must be loopback");+const workerName = "graff-workers-sandbox-example";+export default defineConfig({+ worker: {+ name: workerName,+ compatibilityDate: "2026-10-06",+ entrypoint,+ exports: { SandboxTask: configExports.durableObject({ storage: "sqlite" }) },+ env: {+ TASKS: bindings.durableObject({ worker: workerName, exportName: "SandboxTask" }),+ CODEGRAFF_API_KEY: bindings.secret(),+ INGRESS_TOKEN: bindings.secret(),+ MODEL_NAME: bindings.text(process.env.GRAFF_SANDBOX_TEST_MODEL ?? "ultramarine-1-flash"),+ TEST_BRIDGE: bindings.text(bridge),+ },+ },+});diff --git a/examples/workers-sandbox/live.test.mjs b/examples/workers-sandbox/live.test.mjsnew file mode 100644index 00000000..b1dd053e--- /dev/null+++ b/examples/workers-sandbox/live.test.mjs@@ -0,0 +1,140 @@+// Opt-in real inference + real hosted VM. Never writes the API key to disk.+import assert from "node:assert/strict";+import { spawn } from "node:child_process";+import { once } from "node:events";+import { createServer } from "node:http";+import { existsSync } from "node:fs";+import { fileURLToPath } from "node:url";++const expectedModel = process.env.GRAFF_SANDBOX_TEST_MODEL ?? "ultramarine-1-flash";+const requestedModels = new Set();+const token = process.env.CODEGRAFF_API_KEY;+if (!token) throw new Error("Set CODEGRAFF_API_KEY to opt into billed sandbox/model execution");+const cwd = fileURLToPath(new URL(".", import.meta.url));+assert.ok(existsSync(new URL("../../zig-out/bin/graff-worker.wasm", import.meta.url)), "Build zig build wasm-worker first");+const gateway = "https://gateway.codegraff.com";+const owned = new Set();+const errors = [];+const calls = { model: 0, create: 0, exec: 0, upload: 0, download: 0, destroy: 0 };+let child;+let childOutput = "";+async function bodyBytes(stream, cap) {+ let size = 0;+ const chunks = [];+ for await (const chunk of stream) {+ size += chunk.length;+ if (size > cap) throw new Error("Bridge response/request exceeded limit");+ chunks.push(chunk);+ }+ return Buffer.concat(chunks);+}+const bridge = createServer(async (request, response) => {+ try {+ const path = request.url ?? "";+ const model = request.method === "POST" && path === "/v1/chat/completions";+ const create = request.method === "POST" && path === "/v1/sandboxes";+ const operation = /^\/v1\/sandboxes\/([^/]+)(?:\/(exec|upload|download))?$/.exec(path);+ if (!model && !create && (!operation || !owned.has(decodeURIComponent(operation[1])) ||+ (operation[2] ? request.method !== "POST" : request.method !== "DELETE"))) {+ response.writeHead(403); response.end(); return;+ }+ let bytes = await bodyBytes(request, 128 * 1024);+ if (model) {+ if (++calls.model > 8) throw new Error("Live model-call budget exceeded");+ const payload = JSON.parse(bytes.toString());+ assert.equal(payload.model, expectedModel, "Worker requested an unexpected model");+ requestedModels.add(payload.model);+ payload.max_tokens = 8192;+ bytes = Buffer.from(JSON.stringify(payload));+ } else if (create) {+ const payload = JSON.parse(bytes.toString());+ assert.equal(payload.provider, "fleet");+ assert.equal(payload.autoStopMinutes, 5);+ calls.create++;+ } else if (operation[2]) calls[operation[2]]++;+ const result = await fetch(gateway + path, {+ method: request.method, redirect: "error",+ headers: { authorization: `Bearer ${token}`, "content-type": "application/json" },+ body: request.method === "DELETE" ? undefined : bytes,+ signal: AbortSignal.timeout(create ? 100_000 : 65_000),+ });+ const data = await bodyBytes(result.body, 2 * 1024 * 1024);+ let json;+ try { json = JSON.parse(data.toString()); } catch { /* retain the protocol response */ }+ if (create) {+ const id = json?.id ?? json?.error?.sandboxId;+ if (typeof id === "string") owned.add(id);+ }+ if (operation && !operation[2] && result.ok) { owned.delete(decodeURIComponent(operation[1])); calls.destroy++; }+ if (!result.ok) {+ const code = json?.error?.type;+ errors.push({ route: model ? "model" : create ? "create" : operation?.[2] ?? "destroy", status: result.status,+ code: typeof code === "string" && /^[a-z0-9_]{1,80}$/.test(code) ? code : "upstream_error" });+ }+ response.writeHead(result.status, { "content-type": result.headers.get("content-type") ?? "application/json" });+ response.end(data);+ } catch {+ errors.push({ route: "bridge", code: "transport_error" });+ response.writeHead(502); response.end('{"error":{"type":"bridge_transport_error"}}');+ }+});++async function stopChild() {+ if (!child || child.exitCode !== null || child.signalCode !== null) return;+ const exited = once(child, "exit");+ try { process.kill(-child.pid, "SIGTERM"); } catch { return; }+ const timer = setTimeout(() => { try { process.kill(-child.pid, "SIGKILL"); } catch {} }, 3000);+ timer.unref();+ await exited;+ clearTimeout(timer);+}++try {+ await new Promise(resolve => bridge.listen(0, "127.0.0.1", resolve));+ const env = { ...process.env, NO_COLOR: "1", CF_SEND_TELEMETRY: "false", WRANGLER_SEND_METRICS: "false",+ GRAFF_SANDBOX_TEST_BRIDGE: `http://127.0.0.1:${bridge.address().port}` };+ // The real credential exists only in this bridge process, not cf/Vite/Wasm/VM.+ delete env.CODEGRAFF_API_KEY;+ delete env.NODE_DEBUG;+ delete env.NODE_DEBUG_NATIVE;+ child = spawn(process.execPath, ["node_modules/cf/bin/cf", "dev"], { cwd, detached: true, stdio: ["ignore", "pipe", "pipe"], env });+ const local = await new Promise((resolve, reject) => {+ const timer = setTimeout(() => reject(new Error("cf dev readiness timed out")), 60_000);+ child.once("error", error => { clearTimeout(timer); reject(error); });+ child.once("exit", code => { clearTimeout(timer); reject(new Error(`cf dev exited before ready (${code})`)); });+ const collect = data => {+ childOutput = (childOutput + data.toString().replace(/\x1b\[[0-9;]*m/g, "")).slice(-16_384);+ const match = childOutput.match(/https?:\/\/(?:localhost|127\.0\.0\.1|\[::1\]):\d+\/?/);+ if (match && /ready|listening/i.test(childOutput)) { clearTimeout(timer); resolve(match[0]); }+ };+ child.stdout.on("data", collect); child.stderr.on("data", collect);+ });+ const response = await fetch(local, { method: "POST", signal: AbortSignal.timeout(220_000) });+ const result = await response.json();+ // Report only synthetic task results and aggregate calls, never IDs/credentials.+ console.log(JSON.stringify({ status: response.status, result, requestedModels: [...requestedModels], calls, upstreamErrors: errors }, null, 2));+ assert.equal(response.status, 200, "Worker sandbox task failed");+ assert.equal(result.ok, true);+ assert.equal(result.model, expectedModel);+ assert.deepEqual([...requestedModels], [expectedModel]);+ assert.equal(result.baselineFailed, true);+ assert.equal(result.testsUnchanged, true);+ assert.equal(result.credentialIsolation, true);+ assert.equal(result.sandboxDestroyed, true);+ assert.equal(result.verification.exitCode, 0);+ assert.match(result.verification.result, /RANDOMIZED_CASES=2000/);+ assert.ok(result.sandboxToolCalls > 0 && calls.model >= 2 && calls.create === 1 && calls.destroy === 1);+ assert.equal(owned.size, 0);+ console.log("PASS: workerd Durable Object → Zig/Wasm → real model → Codegraff VM → verified repair; VM destroyed");+} finally {+ await stopChild();+ // Last-resort cleanup of ONLY VMs created by this live test, not other tasks.+ for (const id of owned) {+ const response = await fetch(`${gateway}/v1/sandboxes/${encodeURIComponent(id)}`, {+ method: "DELETE", redirect: "error", headers: { authorization: `Bearer ${token}` }, signal: AbortSignal.timeout(20_000),+ });+ if (!response.ok) throw new Error("Live test VM cleanup failed; its five-minute lease remains the fallback");+ owned.delete(id);+ }+ await new Promise(resolve => bridge.close(resolve));+}diff --git a/examples/workers-sandbox/package-lock.json b/examples/workers-sandbox/package-lock.jsonnew file mode 100644index 00000000..4dc7663d--- /dev/null+++ b/examples/workers-sandbox/package-lock.json@@ -0,0 +1,2229 @@+{+ "name": "graff-workers-sandbox-example",+ "lockfileVersion": 3,+ "requires": true,+ "packages": {+ "": {+ "name": "graff-workers-sandbox-example",+ "devDependencies": {+ "@cloudflare/vite-plugin": "beta",+ "cf": "1.0.0-beta.18",+ "typescript": "^7.0.2",+ "vite": "^8.3.0"+ }+ },+ "node_modules/@cloudflare/build-output-utils": {+ "version": "0.9.3",+ "resolved": "https://registry.npmjs.org/@cloudflare/build-output-utils/-/build-output-utils-0.9.3.tgz",+ "integrity": "sha512-0MgvIq6UxbRWLwB2QJU7qjLqpPkfygOebN3UiENhdp+z6zpRKrNnwkms2ynadmxCOh3sL2v+SI0/pNXxgXdteA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@cloudflare/config": "0.27.0"+ }+ },+ "node_modules/@cloudflare/config": {+ "version": "0.27.0",+ "resolved": "https://registry.npmjs.org/@cloudflare/config/-/config-0.27.0.tgz",+ "integrity": "sha512-wNnL0z4lj5Gm2fze5qXTOvRPbUOi4jlMmwPk7ArCUakI5oVxgjfl3Rhnfd/Mmzo3g86x/ofH75yPIhsa5msqdQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "zod": "4.6.5"+ }+ },+ "node_modules/@cloudflare/runtime-types": {+ "version": "0.1.12",+ "resolved": "https://registry.npmjs.org/@cloudflare/runtime-types/-/runtime-types-0.1.12.tgz",+ "integrity": "sha512-eYF5teHQ+Jss4sbSVINM5tNPHxo/kJ2gKcMs7omyy7gO9PEkgUbGPZCYl06SxbBWTcJFF2vrX4epB775QTE4BQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "miniflare": "5.20261012.1-beta",+ "workerd": "1.20261012.1"+ }+ },+ "node_modules/@cloudflare/unenv-preset": {+ "version": "2.16.2",+ "resolved": "https://registry.npmjs.org/@cloudflare/unenv-preset/-/unenv-preset-2.16.2.tgz",+ "integrity": "sha512-JBP1+Z7ZSNG/d4mRP+y8VC5dka3tZVMLEZRvS+rzQ4DGV1EoxRFQckcJTTkXbHSQiTj0DtNI01Zwb/V2fX0mvQ==",+ "dev": true,+ "license": "MIT OR Apache-2.0",+ "peerDependencies": {+ "unenv": "2.0.0-rc.24",+ "workerd": ">1.20260305.0 <2.0.0-0"+ },+ "peerDependenciesMeta": {+ "workerd": {+ "optional": true+ }+ }+ },+ "node_modules/@cloudflare/vite-plugin": {+ "version": "2.0.0-beta.v.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/vite-plugin/-/vite-plugin-2.0.0-beta.v.1.tgz",+ "integrity": "sha512-gyxplbx5mImicE5bcMO3t3kAy5V9ad6X7Hk/K1DRINUv7n9vgjYcfmhiH0kOiXSOck/WT8R6e/HgNbBaVbhuaw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@cloudflare/build-output-utils": "0.9.3",+ "@cloudflare/config": "0.27.0",+ "@cloudflare/runtime-types": "0.1.12",+ "@cloudflare/unenv-preset": "2.16.2",+ "miniflare": "5.20261012.1-beta",+ "unenv": "2.0.0-rc.24",+ "ws": "8.21.0"+ },+ "bin": {+ "cf-vite": "bin/cf-vite"+ },+ "peerDependencies": {+ "vite": "^7.0.0 || ^8.0.0"+ }+ },+ "node_modules/@cloudflare/workerd-darwin-64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20261012.1.tgz",+ "integrity": "sha512-dkTL9aY3V4D40b+jBpGPCistWUPFQ/M61wlWi6i1o8MvHFFgEw7EQkcaYEv6Yd3bkPDD/3TFT4hRsMb2xVZSwQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-darwin-arm64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20261012.1.tgz",+ "integrity": "sha512-2/nVGcKXjNNI+DhxKSepTKvFng9H7aN2WXv6Zu67iqgI6JrxypNt5kTPv4ZHosxrcfyKMci/2RfN7GIrN0BitQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-linux-64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20261012.1.tgz",+ "integrity": "sha512-uMe7ONHnLxStD1Ye0YFHBO36uj4cStv5P53rW+5GVWXFT8BRjqVixlH0IqCAHe1Pmcwyd1+7fVoGde89MZSCJg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-linux-arm64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20261012.1.tgz",+ "integrity": "sha512-I0VMdcXk7ygG5vYDce0ePTBFdnBXC0i9WiBY5mWiv0iTinbfea6/rHqSQ7B1UMpjgrYVs9E0m4bZ9ufsk5GCFA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cloudflare/workerd-windows-64": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20261012.1.tgz",+ "integrity": "sha512-c5hQvNx574UEoknaCFvMa/NdLrrYiALNbe6sx1okW8uOiRYWxrFuA8WpXFnBJ5XJypm0TEAHYaUTGv3rRLpY7Q==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16"+ }+ },+ "node_modules/@cspotcode/source-map-support": {+ "version": "0.8.1",+ "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz",+ "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/trace-mapping": "0.3.9"+ },+ "engines": {+ "node": ">=12"+ }+ },+ "node_modules/@emnapi/runtime": {+ "version": "1.11.3",+ "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.3.tgz",+ "integrity": "sha512-Xz4Tpyki7XyrpbUK1jR1AhdAdaXyhhY4lZ3neLodmhpuWfy2PAQN5B46sAiU4liOXGLkHypn/qU+jvfWSCYYLA==",+ "dev": true,+ "license": "MIT",+ "optional": true,+ "dependencies": {+ "tslib": "^2.4.0"+ }+ },+ "node_modules/@img/colour": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/@img/colour/-/colour-1.1.0.tgz",+ "integrity": "sha512-Td76q7j57o/tLVdgS746cYARfSyxk8iEfRxewL9h4OMzYhbW4TAcppl0mT4eyqXddh6L/jwoM75mo7ixa/pCeQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/@img/sharp-darwin-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.35.5.tgz",+ "integrity": "sha512-QRUlFQ0WxvdWyqqG/WtI3iupfD5rBzmCHXSdPsY91sAtVtTo7Q4cb6zOccZ3gqEqkr0f1As1ehLqmEpDsRf+lg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-arm64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-darwin-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.35.5.tgz",+ "integrity": "sha512-+BR255RhDlpygUpOc/Jdt1nT6DQ3XG/ERo5wbcdOf5Q320dKtPCKPLR1LJs9VGXRaMa8l1uUa0tkCNOXiAxZUw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-darwin-x64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-freebsd-wasm32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-freebsd-wasm32/-/sharp-freebsd-wasm32-0.35.5.tgz",+ "integrity": "sha512-Y/z91nEZ4uIBX5X3nfTovjU9lHNKFYbL2lpHCLVNmXQK03VIZvXBBt0KxbPGp2SdGSF+2mQU4e+hQaWOt86iAw==",+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "dependencies": {+ "@img/sharp-wasm32": "0.35.5"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-arm64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.3.4.tgz",+ "integrity": "sha512-5R89nBYiRdUlSWJxPhO+GVtaXzXSxKnRu/xqMn3KTA3L9EB9Oy/P+Nn2f2vlhPuUdy/Zusb2DarbyTpGCfEDuw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-darwin-x64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.3.4.tgz",+ "integrity": "sha512-iR2OKH80yi0U+dUplyh3/xdpFvps6YkCwsXenIJxqxR1v9o+xtKTGbS9H7cps+2Vxjc8B1j96p75NmTGjIhtpQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "darwin"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.3.4.tgz",+ "integrity": "sha512-LmRtTsOHuvM2+wlO2Db37dx5MiZhB0FvSunciw48YjdOkZz9KAiRbm8ujeMOA1INqmei5NapFxYEK1D1ZSidmw==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-arm64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.3.4.tgz",+ "integrity": "sha512-Y3dgX/6lE2QhQb+Gxy0WZxfg9MEm/JBjamZpS2IklP7xIQoKN4hzAm7KcMVGtaVDt3neE9OKBC7vAfonA/Lr1A==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-ppc64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-ppc64/-/sharp-libvips-linux-ppc64-1.3.4.tgz",+ "integrity": "sha512-Le6boB8Tai0Nis+gIxIpKx68UDVVIqdR8Tin5Yf1z2LJJQLDJvCDRqRu+jC2qCoD+eIomonmOwB4smBRxfVpYQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-riscv64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-riscv64/-/sharp-libvips-linux-riscv64-1.3.4.tgz",+ "integrity": "sha512-aHkkIEHPRdQEegJN20MLmGtxYD9R2wQr3Cwpddnu5+YKMt6Uzax7S9h5gpZTo8wyrGuZSlfQ63OevL5mTyOC7Q==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-s390x": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.3.4.tgz",+ "integrity": "sha512-ra/mB6MikESDUO7Yg+Mi95bFBb9GsObURuhnOv3OqknjGe9sZrG8tCe9q0xSIGrtLgvgw0gKnFWcK4blSgQOuQ==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linux-x64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.3.4.tgz",+ "integrity": "sha512-GJ//SSXbnwSDes02umB3nDJLFcQzw8a18V8fyhqr6tV515tOEMdImjjxj1AoafMRz56F3PHgftnj1QEKSU1zkw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-arm64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.3.4.tgz",+ "integrity": "sha512-hvulFwtjUcagsis6BBxHwGFwWoNZjgYmULGVrZcyfNbjA8hKILbRxGg15/7w5HDyXHXUos/j6baAWqnCyQ2DWA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-libvips-linuxmusl-x64": {+ "version": "1.3.4",+ "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.3.4.tgz",+ "integrity": "sha512-6zXKeE/p39I1AmA3cJG35eyBGNqNddLnUXjhwBnsGjFPWqf5VKkDBEqaEkPDoTEtkxwi2vv8Tcr2mDyP4So7Fg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "linux"+ ],+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-linux-arm": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.35.5.tgz",+ "integrity": "sha512-LEaXK2WdXVK5ykcw0buWyPMsmLLL2vpHLD6yrNSW+JGEL3BZPA4tpKN6iaMc4AxTTAoaX/sU1rOL51lcIz48ZQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.35.5.tgz",+ "integrity": "sha512-LYVx5JTsOM2CBzmxreh+nl64/3H6Xb09iSLknqH47z2T2DFFxDeFLP5y4dJwe6H7uGQlHPyEEtIqyo3DYsRwdQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-arm64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-ppc64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-ppc64/-/sharp-linux-ppc64-0.35.5.tgz",+ "integrity": "sha512-QVxAAq8evVRI9ia2vqgwrmWucn5Dfv+JdWzj75pD8omHLPSP7f8p20O8jxzjCcuCEQEOtYOZUmX1hkiZ0kdevA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-ppc64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-riscv64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-riscv64/-/sharp-linux-riscv64-0.35.5.tgz",+ "integrity": "sha512-LtdreXguaavKODPIfzJ4kffx7UNt1omwtK0rch4EBbbSTXPnxWmYSayXdLJw0fJzQ97kHt1gL/yh4tvU+nCyRQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-riscv64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-s390x": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.35.5.tgz",+ "integrity": "sha512-UZasTOFiYzotTsGOCu42BfUzP6Tu6Do/947iRm1RsLKvlllxwGcn4RN27LibGWceix4Y+Pmw3jsnTcCQIgWjqA==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-s390x": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linux-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.35.5.tgz",+ "integrity": "sha512-SxFtLTeJInhAA9Q836kux2vZNeOBQEx658qvbboZScr0wIARym3IcGmW7KpVD5sbVg0Ojy+udFQdayYIZyoNog==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linux-x64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.35.5.tgz",+ "integrity": "sha512-9HbMclmI1zlNkFRs3z9/eBtDjfD0sGlrX1z6b1qwmiFY5ElDLh4BC0LPBdVp7z1DXFiKlIcznf+ZlsuZzLxQqg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-linuxmusl-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.35.5.tgz",+ "integrity": "sha512-4KOphqB035HrVdqLZfCgMzzERrQkkzOwRhl4OAkRO1YCldbaFjySXMaK534Mo0V+LndnlJk+sbUyLeU0ULyD1A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-libvips-linuxmusl-x64": "1.3.4"+ }+ },+ "node_modules/@img/sharp-wasm32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.35.5.tgz",+ "integrity": "sha512-Ptsga1su4tQx+LLF1ECS9U6nz5kmrXKo6XVbtR48Ke3ZRxxgaWBu7IDtEe1quo8hiupwm6WFqxVlXaSf7IINGQ==",+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT",+ "optional": true,+ "dependencies": {+ "@emnapi/runtime": "^1.11.3"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-webcontainers-wasm32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-webcontainers-wasm32/-/sharp-webcontainers-wasm32-0.35.5.tgz",+ "integrity": "sha512-hfhF/FmoQyTUkA0bIKFOtw536BQSeBMe6BF6QyWlrPxT754+TFLaZ7sKKTfvvM0yJgKgaYTwnFCIZ/GuDw5SUA==",+ "cpu": [+ "wasm32"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "dependencies": {+ "@img/sharp-wasm32": "0.35.5"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-arm64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-arm64/-/sharp-win32-arm64-0.35.5.tgz",+ "integrity": "sha512-X4t7g+7ZA5DKblCBEXGjUqqemj4vczING/5viFwAL8h4N3qYeyjwdCvRLHi4EdOUI+2Z7UFlp1VM+p/AuEtm6Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-ia32": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.35.5.tgz",+ "integrity": "sha512-5Zm82LoBc43nhwNybZlG7Y1KO//Zhsn306fQl29ZOuStHLGTo3BWL83q3cznX0poxSAMuYL1On/BHBxkBeKr6A==",+ "cpu": [+ "ia32"+ ],+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@img/sharp-win32-x64": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.35.5.tgz",+ "integrity": "sha512-x76eH0vEiHlcMQu8Y8IenntaACtddpT6W0wmXtWrnKcnKI7ME5DdgqhAD6SEWOEl1v2zDvkZDhFA9KnURwpfqg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0 AND LGPL-3.0-or-later",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ }+ },+ "node_modules/@jridgewell/resolve-uri": {+ "version": "3.1.2",+ "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz",+ "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6.0.0"+ }+ },+ "node_modules/@jridgewell/sourcemap-codec": {+ "version": "1.6.0",+ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz",+ "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@jridgewell/trace-mapping": {+ "version": "0.3.9",+ "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz",+ "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@jridgewell/resolve-uri": "^3.0.3",+ "@jridgewell/sourcemap-codec": "^1.4.10"+ }+ },+ "node_modules/@oxc-project/types": {+ "version": "0.154.0",+ "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz",+ "integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/oxc-project"+ }+ },+ "node_modules/@poppinss/colors": {+ "version": "4.1.6",+ "resolved": "https://registry.npmjs.org/@poppinss/colors/-/colors-4.1.6.tgz",+ "integrity": "sha512-H9xkIdFswbS8n1d6vmRd8+c10t2Qe+rZITbbDHHkQixH5+2x1FDGmi/0K+WgWiqQFKPSlIYB7jlH6Kpfn6Fleg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "kleur": "^4.1.5"+ }+ },+ "node_modules/@poppinss/dumper": {+ "version": "0.6.5",+ "resolved": "https://registry.npmjs.org/@poppinss/dumper/-/dumper-0.6.5.tgz",+ "integrity": "sha512-NBdYIb90J7LfOI32dOewKI1r7wnkiH6m920puQ3qHUeZkxNkQiFnXVWoE6YtFSv6QOiPPf7ys6i+HWWecDz7sw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@poppinss/colors": "^4.1.5",+ "@sindresorhus/is": "^7.0.2",+ "supports-color": "^10.0.0"+ }+ },+ "node_modules/@poppinss/exception": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/@poppinss/exception/-/exception-1.2.3.tgz",+ "integrity": "sha512-dCED+QRChTVatE9ibtoaxc+WkdzOSjYTKi/+uacHWIsfodVfpsueo3+DKpgU5Px8qXjgmXkSvhXvSCz3fnP9lw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@rolldown/binding-android-arm-eabi": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm-eabi/-/binding-android-arm-eabi-1.2.14.tgz",+ "integrity": "sha512-aWR+XKH9+rW7m5fWq/5360J3mHycrx/o6xZM2DQFdJnTMdyP7/WzxPjhtLbVWdKo2y612/4U1bWqb3HQhiF7vg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-android-arm64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-android-arm64/-/binding-android-arm64-1.2.14.tgz",+ "integrity": "sha512-QiVxHofl6A8lQU7WAtOUY4QMVZXohxwz7WJJoeh8NBEUyKfIkMRKhYyq8az/1RypNiIXzNTtiS6KwHz0erxYRQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-arm64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-arm64/-/binding-darwin-arm64-1.2.14.tgz",+ "integrity": "sha512-lTQOzHuBIooh3jIr5XINQkjPGEuGy+Dsy0meXDr6Sjty0b99kYgGh4uBC/8mJX1T0kC8d6S0aPP1Y+bHkh6aBw==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-darwin-x64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-darwin-x64/-/binding-darwin-x64-1.2.14.tgz",+ "integrity": "sha512-hyMKEGatjmBYCs/Q4sbIcL/GqpFEqsX3wc+HYVQ/85A4rxc1o7rPm4DUI4GV4k/h0ITddwFSGpqQunI14GXjTA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-freebsd-x64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-freebsd-x64/-/binding-freebsd-x64-1.2.14.tgz",+ "integrity": "sha512-u371GbXoVXrEgP20PwzoGNOdAOqAMhzo19JzzY+V4YmmnC+DTOoqdbMu+O+54emM59Mik/UdrtWgcuEDKWRPKA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm-gnueabihf": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-1.2.14.tgz",+ "integrity": "sha512-BqwKsdZQf6EqVWr8fv2MrDYzAvOZ7+NYFSJESRGs87fkseEhs0TU9TXgRJTkZoRRkxTizyEg1LKUXfU3/78uqg==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-1.2.14.tgz",+ "integrity": "sha512-SD9kY8M009x/7s57Z1dgUVlP5+uYBgKQK0Tkr1WIWngrtUJmRCW1RJFMY7QDla2khXhmg2i5Io7MUjcmZNZ/KQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-arm64-musl": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-arm64-musl/-/binding-linux-arm64-musl-1.2.14.tgz",+ "integrity": "sha512-BJ2CL19M6uuWesMgnqJzgxoI+N+eV7b0A9O9vLV42y+gitC41fNa8KElau1tHVzuLWX5GzEuxMPhAO0tQXQMkg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-ppc64-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-1.2.14.tgz",+ "integrity": "sha512-4+Kl8daPV8NDHaD7mfCcc1pRM+Qg7ab8DyMm5FG5WoZgv4h2i3KFN1CybYBNbQqmuYm7ftJLvmMI1eHYJ22S/Q==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-s390x-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-1.2.14.tgz",+ "integrity": "sha512-V/h8ePq1fKDrmtFMz6xcCN3DKvuvMRrwwD1q0PkBeeo4DpK64biaKvqWGVxqCeYKqeRk7gE7/iKPxLCn08O97A==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-gnu": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-gnu/-/binding-linux-x64-gnu-1.2.14.tgz",+ "integrity": "sha512-WxalXzgrLVpKC93xfpaJ3gCXUWzeCr+FRCbDVD2mUAy4L6Vo3lNVz0epUEUpxPWJkLNYUwM4OSIikv36OJ9mLg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-linux-x64-musl": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-linux-x64-musl/-/binding-linux-x64-musl-1.2.14.tgz",+ "integrity": "sha512-3G3tnAmTpdk9jO3GQtyHXqeFD2SlecfTws/Y3M2mmj9nMBwwuLT4kur8sZKeu7ENUHSpVO3cIsm5A52LEWWwlg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-openharmony-arm64": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-openharmony-arm64/-/binding-openharmony-arm64-1.2.14.tgz",+ "integrity": "sha512-qyr5XiNGxm2ytx17vvtcJ9nXn6v1gENETi503bJx3OGwZ1tSonj7BosxbMa/xeAfSl5iS9X6KjEWYXLu6v1L7Q==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "openharmony"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-arm64-msvc": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.2.14.tgz",+ "integrity": "sha512-oA4o5o0S2yB199YyYXDzKUv1Z56Rc+mgOjwm7Z/vJ9Z8igiDPYvoOuDyo6g7AK/ZaF09nPhDKVnGBcYHO11GXA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/binding-win32-x64-msvc": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/@rolldown/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.2.14.tgz",+ "integrity": "sha512-9mE94bf2GZUaR/fUSXCMpBoWkctu421Mi0ORpm4zqfbkjKep7RxzPFa5etcGs5h+2KApoWBOA/hAJa/7saGgEQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ }+ },+ "node_modules/@rolldown/pluginutils": {+ "version": "1.0.1",+ "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz",+ "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/@sindresorhus/is": {+ "version": "7.2.0",+ "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-7.2.0.tgz",+ "integrity": "sha512-P1Cz1dWaFfR4IR+U13mqqiGsLFf1KbayybWwdd2vfctdV6hDpUkgCY0nKOLLTMSoRd/jJNjtbqzf13K8DCCXQw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sindresorhus/is?sponsor=1"+ }+ },+ "node_modules/@speed-highlight/core": {+ "version": "1.2.24",+ "resolved": "https://registry.npmjs.org/@speed-highlight/core/-/core-1.2.24.tgz",+ "integrity": "sha512-qeW2e1l78afw8VhRPfPQ1Gjj+KU5XFQ/OFV5ti6eTa9bruO7mJyZtA4vw0ofqmA3tKCkROE9xLk3VZoeRc98nw==",+ "dev": true,+ "license": "CC0-1.0"+ },+ "node_modules/@typescript/typescript-aix-ppc64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-aix-ppc64/-/typescript-aix-ppc64-7.0.2.tgz",+ "integrity": "sha512-MTKKkWB7p/0E9xi1d1tHtZ5PiLkGEMIq88pK2CubZjOsLtYTLqhgIgi6zepFa+9GHZ6h05NMCkQxGKiPXMxXtQ==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "aix"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-darwin-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-arm64/-/typescript-darwin-arm64-7.0.2.tgz",+ "integrity": "sha512-gowzar9MwS/aRWp6f3a4KUqzRjAZjOsmGNCM6LcTgXum+dBfgsBVMN+AgvOCCbguXyick6LJhpBszxMebJ8syA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-darwin-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-darwin-x64/-/typescript-darwin-x64-7.0.2.tgz",+ "integrity": "sha512-SZ9xZInqApNlNGc9s0W1VSsktYSOe9cFqNOIqmN1Gs8SmkjKZYFt017G4VwPxASInODuAdbTW7sXiFUf893RgA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-freebsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-arm64/-/typescript-freebsd-arm64-7.0.2.tgz",+ "integrity": "sha512-W5NH4y/J0plIIS5b2xvTEkU7JFxyqdMAOgf+Ilhl0vHQXKO5dZoxd+C/jEtq56c4F3wk71RB4BMRQ2XdI+bwYQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-freebsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-freebsd-x64/-/typescript-freebsd-x64-7.0.2.tgz",+ "integrity": "sha512-UMGDx5sTpzNw3WiPebH7l90IWfJggEd+egHt/q6p7/Cm3zqoV7VxkGXt+3DxPIw8CcmvAB0j3sVVfbhX+M4Tpw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-arm": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm/-/typescript-linux-arm-7.0.2.tgz",+ "integrity": "sha512-gffT3xPz9sR7j/YJExkyPntrI0P2EP9XbOyWzth2/Gs0RstK+90RBcO0ncXoXy/beYll1SXw846Nf2zdnEz0QQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-arm64/-/typescript-linux-arm64-7.0.2.tgz",+ "integrity": "sha512-Qh4eU4/y3yDjnfjjyPYihMj5/ODIlmt+Bzu17OI+fiSRDW57QmU5SiN63exPRNJPKUzcc1INa1NXdrJ+MqHjUQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-loong64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-loong64/-/typescript-linux-loong64-7.0.2.tgz",+ "integrity": "sha512-uEHck9i8hoAzXPiYRib1O7miOnz23SxIeVl6F4LXox+qov1K35jHcEW6VHKvZI+pyvl7fZEP4MCU5LYvIq1GuQ==",+ "cpu": [+ "loong64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-mips64el": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-mips64el/-/typescript-linux-mips64el-7.0.2.tgz",+ "integrity": "sha512-R4KvAMnE43W5Qeqb0Ly56O3mWMWIAgsMyz36DCaycd5nbg/9kzm0liw3JocfRqyJY0KPmzFjbswozXyW0DnIYA==",+ "cpu": [+ "mips64el"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-ppc64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-ppc64/-/typescript-linux-ppc64-7.0.2.tgz",+ "integrity": "sha512-DORx5b3sd/4S7eayxm4FQv+A7CrkUIGRaHiwI8oiHTAI1fAPWhF4J0vAlkC8biAlHSVVwxMQ3tjZ2/DVbnQiiA==",+ "cpu": [+ "ppc64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-riscv64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-riscv64/-/typescript-linux-riscv64-7.0.2.tgz",+ "integrity": "sha512-wf0jqEDOjrPRnKwYRyyJDRo11KMbvMFrU+q4zqKyChODBzvlkbhNQfKvLxQCcwTpdDaXSHZTVuh0JoCrKCUMHQ==",+ "cpu": [+ "riscv64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-s390x": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-s390x/-/typescript-linux-s390x-7.0.2.tgz",+ "integrity": "sha512-IkwJc3L7yhytWd/ewjyxNDfOmswCm9GWMJT/ue/dU4aZNbwZeYAetq42VyLmsmSjvoX7z74X6ZaYCtzAr0EuGw==",+ "cpu": [+ "s390x"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-linux-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-linux-x64/-/typescript-linux-x64-7.0.2.tgz",+ "integrity": "sha512-EYdf2cNg7rgCWJnxCdJ+F3V39O8ihb37eHAu1LK8oAFizgTQbPOK7zHHXbPt8rX24COqODXeI3sIf0fCXG7H/A==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-netbsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-arm64/-/typescript-netbsd-arm64-7.0.2.tgz",+ "integrity": "sha512-+polYF4MF04aPpO5FTkHran9yUQDSXqy5GiSDKpsll5jy3l3+g9QLhpf39T+ePtefhXLOGrLl0QIjkQP6VnelA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-netbsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-netbsd-x64/-/typescript-netbsd-x64-7.0.2.tgz",+ "integrity": "sha512-8YIT0EHM/3dq10ZOVF/A7pc/YSMtbcecct4rWtexrnSCHOPcpC2KTLXfTCR6vDpnSiY12heNb1GiN/wu+T/FyA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "netbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-openbsd-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-arm64/-/typescript-openbsd-arm64-7.0.2.tgz",+ "integrity": "sha512-APT8+ClYnuYm1u9+kgGXoMj2VzWzcymwh2gNSQVySHfkRDGOTVkoWLjCmOQSaO+PoqQ57B0flRp9SA+7GnnkzQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-openbsd-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-openbsd-x64/-/typescript-openbsd-x64-7.0.2.tgz",+ "integrity": "sha512-yX7s+Q0Dln0Dt9tEzZsAjXXR/+ytBM7AlglaqyeMPxQszJ1JhlJdZ6jLA+IzldHtflX81em7lDao1xXu+aRRkg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "openbsd"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-sunos-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-sunos-x64/-/typescript-sunos-x64-7.0.2.tgz",+ "integrity": "sha512-dLJDGaLZ1D4HPQn62u1n8mBDkJREwMsAkCdkwd4Ieqw+x3TUyTsqY0YiBCtE6H6OzzgGk3iuZ3vFWRS+E8/d1g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "sunos"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-win32-arm64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-arm64/-/typescript-win32-arm64-7.0.2.tgz",+ "integrity": "sha512-Gyl1Vy6OsWesLzmq+EP0Fb7b4Nid5232AvcA2SFcdYreldpNtYFFofPjnt62y9hQy7VTaZp65ICJjuAQRaVcIQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/@typescript/typescript-win32-x64": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/@typescript/typescript-win32-x64/-/typescript-win32-x64-7.0.2.tgz",+ "integrity": "sha512-0BQ3HkAHHlKLSp1qRvf3SUhGpGsDuhB/jgFw75guyqbxJqEaS0Cw/VFO8i2nHglJUzQCRtMMR/IBAKE3ETMC4g==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "Apache-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">=16.20.0"+ }+ },+ "node_modules/blake3-wasm": {+ "version": "2.1.5",+ "resolved": "https://registry.npmjs.org/blake3-wasm/-/blake3-wasm-2.1.5.tgz",+ "integrity": "sha512-F1+K8EbfOZE49dtoPtmxUQrpXaBIl3ICvasLh+nJta0xkz+9kF/7uet9fLnwKqhDrmj6g+6K3Tw9yQPUg2ka5g==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/cf": {+ "version": "1.0.0-beta.18",+ "resolved": "https://registry.npmjs.org/cf/-/cf-1.0.0-beta.18.tgz",+ "integrity": "sha512-SG9NqB6xEZf/WZm6+E2v0OIY5JA0b9DUgl1VOOlF0D5Y+Nk5PyhHonJOd6K2/g6f261h+Z0FwTEK69c9bfIq4g==",+ "dev": true,+ "license": "MIT OR Apache-2.0",+ "dependencies": {+ "@cloudflare/build-output-utils": "0.9.3",+ "@cloudflare/config": "0.27.0",+ "@cloudflare/runtime-types": "0.1.12",+ "blake3-wasm": "2.1.5",+ "miniflare": "5.20261012.1-beta"+ },+ "bin": {+ "cf": "bin/cf",+ "cloudflare": "bin/cf"+ },+ "engines": {+ "node": ">=22"+ }+ },+ "node_modules/cookie": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-1.1.1.tgz",+ "integrity": "sha512-ei8Aos7ja0weRpFzJnEA9UHJ/7XQmqglbRwnf2ATjcB9Wq874VKH9kfjjirM6UhU2/E5fFYadylyhFldcqSidQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/detect-libc": {+ "version": "2.1.2",+ "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.1.2.tgz",+ "integrity": "sha512-Btj2BOOO83o3WyH59e8MgXsxEQVcarkUOpEYrubB0urwnN10yQ364rsiByU11nZlqWYZm05i/of7io4mzihBtQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": ">=8"+ }+ },+ "node_modules/error-stack-parser-es": {+ "version": "1.0.5",+ "resolved": "https://registry.npmjs.org/error-stack-parser-es/-/error-stack-parser-es-1.0.5.tgz",+ "integrity": "sha512-5qucVt2XcuGMcEGgWI7i+yZpmpByQ8J1lHhcL7PwqCwu9FPP3VUXzT4ltHe5i2z9dePwEHcDVOAfSnHsOlCXRA==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/antfu"+ }+ },+ "node_modules/fdir": {+ "version": "6.5.0",+ "resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",+ "integrity": "sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=12.0.0"+ },+ "peerDependencies": {+ "picomatch": "^3 || ^4"+ },+ "peerDependenciesMeta": {+ "picomatch": {+ "optional": true+ }+ }+ },+ "node_modules/fsevents": {+ "version": "2.3.3",+ "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz",+ "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==",+ "dev": true,+ "hasInstallScript": true,+ "license": "MIT",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": "^8.16.0 || ^10.6.0 || >=11.0.0"+ }+ },+ "node_modules/kleur": {+ "version": "4.1.5",+ "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz",+ "integrity": "sha512-o+NO+8WrRiQEE4/7nwRJhN1HWpVmJm511pBHUxPLtp0BUISzlBplORYSmTclCnJvQq2tKu/sgl3xVpkc7ZWuQQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=6"+ }+ },+ "node_modules/lightningcss": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss/-/lightningcss-1.33.0.tgz",+ "integrity": "sha512-WkUDrojuJs0xkgGf2udWxa3yGBRxPtxUkB79i6aCZLRgc7PM8fZe9TosfPDcvEpQZbuFASnHYmRLBLUbmLOIIA==",+ "dev": true,+ "license": "MPL-2.0",+ "dependencies": {+ "detect-libc": "^2.0.3"+ },+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ },+ "optionalDependencies": {+ "lightningcss-android-arm64": "1.33.0",+ "lightningcss-darwin-arm64": "1.33.0",+ "lightningcss-darwin-x64": "1.33.0",+ "lightningcss-freebsd-x64": "1.33.0",+ "lightningcss-linux-arm-gnueabihf": "1.33.0",+ "lightningcss-linux-arm64-gnu": "1.33.0",+ "lightningcss-linux-arm64-musl": "1.33.0",+ "lightningcss-linux-x64-gnu": "1.33.0",+ "lightningcss-linux-x64-musl": "1.33.0",+ "lightningcss-win32-arm64-msvc": "1.33.0",+ "lightningcss-win32-x64-msvc": "1.33.0"+ }+ },+ "node_modules/lightningcss-android-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-android-arm64/-/lightningcss-android-arm64-1.33.0.tgz",+ "integrity": "sha512-gEpRTalKdosp4Bb8qWtc2iOgE5SeIHlpS1up9bFq2wAyYhl1UdTObYiHe98zEM9SQvSoqQZ1IQD0JNpg3Ml5pg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "android"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-arm64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-arm64/-/lightningcss-darwin-arm64-1.33.0.tgz",+ "integrity": "sha512-Sciaz8eenNTKn9b3t7+xr0ipTp9YxKQY4npwQ3mrRuL0BAVHBLyZxofhaKBAVtzmtRZ/zTyo0/to4B1uWG/Djg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-darwin-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-darwin-x64/-/lightningcss-darwin-x64-1.33.0.tgz",+ "integrity": "sha512-Z5UPAxzrjlWNNyGy6i65cJzzvgJ5D3T6wMvs+gWpY9d7qRhANrxqAp6LhxIgZhWEw18RfJTGcRxjuLIBr+m8XQ==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "darwin"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-freebsd-x64": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-freebsd-x64/-/lightningcss-freebsd-x64-1.33.0.tgz",+ "integrity": "sha512-QQM/Ti/hQajJwCY+RiWuCZ9sdtI/XQk7nDK5vC8kkdwixezOlDgvDx7+RT+QjK6FcFT4MpsuoBnHIo/O3StRRg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "freebsd"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm-gnueabihf": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm-gnueabihf/-/lightningcss-linux-arm-gnueabihf-1.33.0.tgz",+ "integrity": "sha512-N7FVBe6iS24MlM6R/4RBTxGhQheZGs7tiQ9U32UtF75NzP5Q7xWPRqLBCKxlRQRk3rY1jCIPLzx7WzOhuUIRLQ==",+ "cpu": [+ "arm"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-gnu/-/lightningcss-linux-arm64-gnu-1.33.0.tgz",+ "integrity": "sha512-j2v/itmy4HlNxlc6voKXYgBqNi0Ng2LShg4z7GufpEgs05P+2suBVyi9I6YHq5uoVFx9ETin3eCEhLVyXGQnKg==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-arm64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-arm64-musl/-/lightningcss-linux-arm64-musl-1.33.0.tgz",+ "integrity": "sha512-yiO5ROMuYQgXbC60yjZU5CYSFZGKXL0HFATXt9mHJn1+zW55oCtMI9NfcVhYLMFDL7gV7oBPon/EmMMGg2OvtQ==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-gnu": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-gnu/-/lightningcss-linux-x64-gnu-1.33.0.tgz",+ "integrity": "sha512-ar+Ju7LmcN0Jo4FpL4hpFybwNG9/3A/Br5KW2n2jyODg3MEZXaDYADdemoNS+BDNfMgKvylJLj4S5tyRActuAg==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-linux-x64-musl": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-linux-x64-musl/-/lightningcss-linux-x64-musl-1.33.0.tgz",+ "integrity": "sha512-RYiYbkokw0trfKqqzfF55lginwEPrD3OJDfTuJzFs1MK6iFnDenaz1fqLLtX4ITG3OktJQXOeTaw1awrBAlZPw==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "linux"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-arm64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-arm64-msvc/-/lightningcss-win32-arm64-msvc-1.33.0.tgz",+ "integrity": "sha512-1K+MPfLSFVpphzpdbfkhlWk6wBrTObBzS2T6db10PNOZgR9GoVsAWzwNyuhUYYbTp23j+4RrncfujZ4uAzXvwA==",+ "cpu": [+ "arm64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/lightningcss-win32-x64-msvc": {+ "version": "1.33.0",+ "resolved": "https://registry.npmjs.org/lightningcss-win32-x64-msvc/-/lightningcss-win32-x64-msvc-1.33.0.tgz",+ "integrity": "sha512-OlEICDx/Xl0FqSp4bry8zFnCvGpig3Gl4gCquvYwHuqJKEC1+n9NgDniFvqHGmMv1ZkqDJrDqKKSykTDX+ehuA==",+ "cpu": [+ "x64"+ ],+ "dev": true,+ "license": "MPL-2.0",+ "optional": true,+ "os": [+ "win32"+ ],+ "engines": {+ "node": ">= 12.0.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/parcel"+ }+ },+ "node_modules/miniflare": {+ "version": "5.20261012.1-beta",+ "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-5.20261012.1-beta.tgz",+ "integrity": "sha512-8Canhy6g9+vAhqMc0o80YphqYIwpiA3aAp8aX+uDXU7J/qbUeoZzcII9c2V1P4uT/eHD4SB93qet1o1bRY3BuQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@cspotcode/source-map-support": "0.8.1",+ "sharp": "0.35.5",+ "undici": "7.29.1",+ "workerd": "1.20261012.1",+ "ws": "8.21.0",+ "youch": "4.1.0-beta.10"+ },+ "engines": {+ "node": ">=22.0.0"+ }+ },+ "node_modules/nanoid": {+ "version": "3.3.20",+ "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.20.tgz",+ "integrity": "sha512-uKdg2G3GNCKQn9byYOpxbGqrT2fGO5KRt5J/8b3pok8rT6qxGWF6hxMyJiEYtAf+FVyYuD9hRaDqX5uPFYJ4ZQ==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "bin": {+ "nanoid": "bin/nanoid.cjs"+ },+ "engines": {+ "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"+ }+ },+ "node_modules/pathe": {+ "version": "2.0.3",+ "resolved": "https://registry.npmjs.org/pathe/-/pathe-2.0.3.tgz",+ "integrity": "sha512-WUjGcAqP1gQacoQe+OBJsFA7Ld4DyXuUIjZ5cc75cLHvJ7dtNsTugphxIADwspS+AraAUePCKrSVtPLFj/F88w==",+ "dev": true,+ "license": "MIT"+ },+ "node_modules/picocolors": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz",+ "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==",+ "dev": true,+ "license": "ISC"+ },+ "node_modules/picomatch": {+ "version": "4.0.7",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.7.tgz",+ "integrity": "sha512-qcJu88Q2IWqJsDD529JKMdwGm/dvInW4HvQnRwiH9JtihJvzGOscDtHE3x1pBKeUOTysQ8kVmLnJ2kJu7yhcGA==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "engines": {+ "node": ">=12"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },+ "node_modules/postcss": {+ "version": "8.5.30",+ "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.30.tgz",+ "integrity": "sha512-zkd+e9S1AQHhmaBKye9zlFHWjOwVgqXl1q3ECYy8561K7qxR2cREf/STLskulBFd78k6AOFeA+ff1TtEzk9bAA==",+ "dev": true,+ "funding": [+ {+ "type": "opencollective",+ "url": "https://opencollective.com/postcss/"+ },+ {+ "type": "tidelift",+ "url": "https://tidelift.com/funding/github/npm/postcss"+ },+ {+ "type": "github",+ "url": "https://github.com/sponsors/ai"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "nanoid": "^3.3.20",+ "picocolors": "^1.1.1",+ "source-map-js": "^1.2.2"+ },+ "engines": {+ "node": "^10 || ^12 || >=14"+ }+ },+ "node_modules/rolldown": {+ "version": "1.2.14",+ "resolved": "https://registry.npmjs.org/rolldown/-/rolldown-1.2.14.tgz",+ "integrity": "sha512-eTBTTqMR6uHKLgcUqpJP8ntzDI6V4LYA8negAMBEI7gkgVvOdrx6VsvS2Ym+83KhOPdLCHWJu0w7UQFJZhHKNw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@oxc-project/types": "=0.154.0",+ "@rolldown/pluginutils": "^1.0.0"+ },+ "bin": {+ "rolldown": "bin/cli.mjs"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "optionalDependencies": {+ "@rolldown/binding-android-arm-eabi": "1.2.14",+ "@rolldown/binding-android-arm64": "1.2.14",+ "@rolldown/binding-darwin-arm64": "1.2.14",+ "@rolldown/binding-darwin-x64": "1.2.14",+ "@rolldown/binding-freebsd-x64": "1.2.14",+ "@rolldown/binding-linux-arm-gnueabihf": "1.2.14",+ "@rolldown/binding-linux-arm64-gnu": "1.2.14",+ "@rolldown/binding-linux-arm64-musl": "1.2.14",+ "@rolldown/binding-linux-ppc64-gnu": "1.2.14",+ "@rolldown/binding-linux-s390x-gnu": "1.2.14",+ "@rolldown/binding-linux-x64-gnu": "1.2.14",+ "@rolldown/binding-linux-x64-musl": "1.2.14",+ "@rolldown/binding-openharmony-arm64": "1.2.14",+ "@rolldown/binding-win32-arm64-msvc": "1.2.14",+ "@rolldown/binding-win32-x64-msvc": "1.2.14"+ }+ },+ "node_modules/semver": {+ "version": "7.8.5",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",+ "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/sharp": {+ "version": "0.35.5",+ "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.35.5.tgz",+ "integrity": "sha512-Ywn4OnzGukp7CDMrp08RQ50YKmuwG47brZgIVPTvBaaAfQlRlygrRqSrxdCiL9M+LlzLBiJ68IR1QqvzHyjC7g==",+ "dev": true,+ "license": "Apache-2.0",+ "dependencies": {+ "@img/colour": "^1.1.0",+ "detect-libc": "^2.1.2",+ "semver": "^7.8.5"+ },+ "engines": {+ "node": ">=20.9.0"+ },+ "funding": {+ "url": "https://opencollective.com/libvips"+ },+ "optionalDependencies": {+ "@img/sharp-darwin-arm64": "0.35.5",+ "@img/sharp-darwin-x64": "0.35.5",+ "@img/sharp-freebsd-wasm32": "0.35.5",+ "@img/sharp-libvips-darwin-arm64": "1.3.4",+ "@img/sharp-libvips-darwin-x64": "1.3.4",+ "@img/sharp-libvips-linux-arm": "1.3.4",+ "@img/sharp-libvips-linux-arm64": "1.3.4",+ "@img/sharp-libvips-linux-ppc64": "1.3.4",+ "@img/sharp-libvips-linux-riscv64": "1.3.4",+ "@img/sharp-libvips-linux-s390x": "1.3.4",+ "@img/sharp-libvips-linux-x64": "1.3.4",+ "@img/sharp-libvips-linuxmusl-arm64": "1.3.4",+ "@img/sharp-libvips-linuxmusl-x64": "1.3.4",+ "@img/sharp-linux-arm": "0.35.5",+ "@img/sharp-linux-arm64": "0.35.5",+ "@img/sharp-linux-ppc64": "0.35.5",+ "@img/sharp-linux-riscv64": "0.35.5",+ "@img/sharp-linux-s390x": "0.35.5",+ "@img/sharp-linux-x64": "0.35.5",+ "@img/sharp-linuxmusl-arm64": "0.35.5",+ "@img/sharp-linuxmusl-x64": "0.35.5",+ "@img/sharp-webcontainers-wasm32": "0.35.5",+ "@img/sharp-win32-arm64": "0.35.5",+ "@img/sharp-win32-ia32": "0.35.5",+ "@img/sharp-win32-x64": "0.35.5"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ }+ }+ },+ "node_modules/source-map-js": {+ "version": "1.2.2",+ "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz",+ "integrity": "sha512-KGj/8Y43x35aZVDtt+J4mK1hoLGHULMYfSkODJNQjNDC3oW1PqPoxMwo0pLUsWM/UEGzON/NxeHywEfNXNP3Vw==",+ "dev": true,+ "license": "BSD-3-Clause",+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/supports-color": {+ "version": "10.2.2",+ "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-10.2.2.tgz",+ "integrity": "sha512-SS+jx45GF1QjgEXQx4NJZV9ImqmO2NPz5FNsIHrsDjh2YsHnawpan7SNQ1o8NuhrbHZy9AZhIoCUiCeaW/C80g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/chalk/supports-color?sponsor=1"+ }+ },+ "node_modules/tinyglobby": {+ "version": "0.2.17",+ "resolved": "https://registry.npmjs.org/tinyglobby/-/tinyglobby-0.2.17.tgz",+ "integrity": "sha512-wXR/dYpcqKmfWpEdZjiKJOwCNFndD0DMnrW/cYjVGttEkBfVgcLFHoNrlj47mjOVic9yyNu65alsgF4NQyTa2g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fdir": "^6.5.0",+ "picomatch": "^4.0.4"+ },+ "engines": {+ "node": ">=12.0.0"+ },+ "funding": {+ "url": "https://github.com/sponsors/SuperchupuDev"+ }+ },+ "node_modules/tslib": {+ "version": "2.8.1",+ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz",+ "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==",+ "dev": true,+ "license": "0BSD",+ "optional": true+ },+ "node_modules/typescript": {+ "version": "7.0.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-7.0.2.tgz",+ "integrity": "sha512-8FYau96o3NKOhbjKi/qNvG/W5jhzxkbdm5sj9AbZ/5T5sWqn3hJgLfGx27sRKZWTvyzCP8dLRBTf5tBTSRVUNA==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc"+ },+ "engines": {+ "node": ">=16.20.0"+ },+ "optionalDependencies": {+ "@typescript/typescript-aix-ppc64": "7.0.2",+ "@typescript/typescript-darwin-arm64": "7.0.2",+ "@typescript/typescript-darwin-x64": "7.0.2",+ "@typescript/typescript-freebsd-arm64": "7.0.2",+ "@typescript/typescript-freebsd-x64": "7.0.2",+ "@typescript/typescript-linux-arm": "7.0.2",+ "@typescript/typescript-linux-arm64": "7.0.2",+ "@typescript/typescript-linux-loong64": "7.0.2",+ "@typescript/typescript-linux-mips64el": "7.0.2",+ "@typescript/typescript-linux-ppc64": "7.0.2",+ "@typescript/typescript-linux-riscv64": "7.0.2",+ "@typescript/typescript-linux-s390x": "7.0.2",+ "@typescript/typescript-linux-x64": "7.0.2",+ "@typescript/typescript-netbsd-arm64": "7.0.2",+ "@typescript/typescript-netbsd-x64": "7.0.2",+ "@typescript/typescript-openbsd-arm64": "7.0.2",+ "@typescript/typescript-openbsd-x64": "7.0.2",+ "@typescript/typescript-sunos-x64": "7.0.2",+ "@typescript/typescript-win32-arm64": "7.0.2",+ "@typescript/typescript-win32-x64": "7.0.2"+ }+ },+ "node_modules/undici": {+ "version": "7.29.1",+ "resolved": "https://registry.npmjs.org/undici/-/undici-7.29.1.tgz",+ "integrity": "sha512-RYONW2MeafgYlkVOKYKkA/Ag7BmXqgIWCa8t1m0JcxrQg9pI9lEqRhAOruOBCbAohOa/gkCF+iPi9hrgvTzu6Q==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=20.18.1"+ }+ },+ "node_modules/unenv": {+ "version": "2.0.0-rc.24",+ "resolved": "https://registry.npmjs.org/unenv/-/unenv-2.0.0-rc.24.tgz",+ "integrity": "sha512-i7qRCmY42zmCwnYlh9H2SvLEypEFGye5iRmEMKjcGi7zk9UquigRjFtTLz0TYqr0ZGLZhaMHl/foy1bZR+Cwlw==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "pathe": "^2.0.3"+ }+ },+ "node_modules/vite": {+ "version": "8.3.4",+ "resolved": "https://registry.npmjs.org/vite/-/vite-8.3.4.tgz",+ "integrity": "sha512-IftLE8phJhdNRIGNEV4JCCvfNScoZQVfcXaN8TQropWGJtOHcu+iAB9pHcuGvmEb/kddw0LBe/jS8ztdC6xdiQ==",+ "dev": true,+ "license": "MIT",+ "peer": true,+ "dependencies": {+ "lightningcss": "^1.33.0",+ "picomatch": "^4.0.7",+ "postcss": "^8.5.29",+ "rolldown": "~1.2.12",+ "tinyglobby": "^0.2.17"+ },+ "bin": {+ "vite": "bin/vite.js"+ },+ "engines": {+ "node": "^20.19.0 || >=22.12.0"+ },+ "funding": {+ "url": "https://github.com/vitejs/vite?sponsor=1"+ },+ "optionalDependencies": {+ "fsevents": "~2.3.3"+ },+ "peerDependencies": {+ "@types/node": "^20.19.0 || >=22.12.0",+ "@vitejs/devtools": "^0.7.1",+ "esbuild": "^0.27.0 || ^0.28.0",+ "jiti": ">=1.21.0",+ "less": "^4.0.0",+ "sass": "^1.70.0",+ "sass-embedded": "^1.70.0",+ "stylus": ">=0.54.8",+ "sugarss": "^5.0.0",+ "terser": "^5.16.0",+ "tsx": "^4.8.1",+ "yaml": "^2.4.2"+ },+ "peerDependenciesMeta": {+ "@types/node": {+ "optional": true+ },+ "@vitejs/devtools": {+ "optional": true+ },+ "esbuild": {+ "optional": true+ },+ "jiti": {+ "optional": true+ },+ "less": {+ "optional": true+ },+ "sass": {+ "optional": true+ },+ "sass-embedded": {+ "optional": true+ },+ "stylus": {+ "optional": true+ },+ "sugarss": {+ "optional": true+ },+ "terser": {+ "optional": true+ },+ "tsx": {+ "optional": true+ },+ "yaml": {+ "optional": true+ }+ }+ },+ "node_modules/workerd": {+ "version": "1.20261012.1",+ "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20261012.1.tgz",+ "integrity": "sha512-tEHoMPsMga0seVjxfsR8Pd3f8IRqYwkq++dTUKI5Gdgj6zuSDluYwisydq+dn90SsIACwBquJUQ1nBpcOqaWTA==",+ "dev": true,+ "hasInstallScript": true,+ "license": "Apache-2.0",+ "peer": true,+ "bin": {+ "workerd": "bin/workerd"+ },+ "engines": {+ "node": ">=16"+ },+ "optionalDependencies": {+ "@cloudflare/workerd-darwin-64": "1.20261012.1",+ "@cloudflare/workerd-darwin-arm64": "1.20261012.1",+ "@cloudflare/workerd-linux-64": "1.20261012.1",+ "@cloudflare/workerd-linux-arm64": "1.20261012.1",+ "@cloudflare/workerd-windows-64": "1.20261012.1"+ }+ },+ "node_modules/ws": {+ "version": "8.21.0",+ "resolved": "https://registry.npmjs.org/ws/-/ws-8.21.0.tgz",+ "integrity": "sha512-Vsp28b7DRcimFQvrqu2Wek3z1iYxDCWqHYB8Qsnk/S4RfaCQzPGPyBNuVjJV3cd6UiKtUtp6sNM77gWvzcCH+g==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=10.0.0"+ },+ "peerDependencies": {+ "bufferutil": "^4.0.1",+ "utf-8-validate": ">=5.0.2"+ },+ "peerDependenciesMeta": {+ "bufferutil": {+ "optional": true+ },+ "utf-8-validate": {+ "optional": true+ }+ }+ },+ "node_modules/youch": {+ "version": "4.1.0-beta.10",+ "resolved": "https://registry.npmjs.org/youch/-/youch-4.1.0-beta.10.tgz",+ "integrity": "sha512-rLfVLB4FgQneDr0dv1oddCVZmKjcJ6yX6mS4pU82Mq/Dt9a3cLZQ62pDBL4AUO+uVrCvtWz3ZFUL2HFAFJ/BXQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@poppinss/colors": "^4.1.5",+ "@poppinss/dumper": "^0.6.4",+ "@speed-highlight/core": "^1.2.7",+ "cookie": "^1.0.2",+ "youch-core": "^0.3.3"+ }+ },+ "node_modules/youch-core": {+ "version": "0.3.3",+ "resolved": "https://registry.npmjs.org/youch-core/-/youch-core-0.3.3.tgz",+ "integrity": "sha512-ho7XuGjLaJ2hWHoK8yFnsUGy2Y5uDpqSTq1FkHLK4/oqKtyUU1AFbOOxY4IpC9f0fTLjwYbslUz0Po5BpD1wrA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@poppinss/exception": "^1.2.2",+ "error-stack-parser-es": "^1.0.5"+ }+ },+ "node_modules/zod": {+ "version": "4.6.5",+ "resolved": "https://registry.npmjs.org/zod/-/zod-4.6.5.tgz",+ "integrity": "sha512-v5l/aFXZQeai4awLbOpSoHecE9UiMrnfx75tEXLjNonXVARxQ5mOeipTjROUchszUNCqnE+hqAMujRsRHsut2Q==",+ "dev": true,+ "license": "MIT",+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }+ }+ }+}diff --git a/examples/workers-sandbox/package.json b/examples/workers-sandbox/package.jsonnew file mode 100644index 00000000..0d6b5854--- /dev/null+++ b/examples/workers-sandbox/package.json@@ -0,0 +1,17 @@+{+ "name": "graff-workers-sandbox-example",+ "private": true,+ "type": "module",+ "scripts": {+ "dev": "cf dev",+ "build": "cf build",+ "typecheck": "cf workers types && tsc",+ "test:live": "node live.test.mjs"+ },+ "devDependencies": {+ "@cloudflare/vite-plugin": "beta",+ "cf": "1.0.0-beta.18",+ "typescript": "^7.0.2",+ "vite": "^8.3.0"+ }+}diff --git a/examples/workers-sandbox/src/fixture.ts b/examples/workers-sandbox/src/fixture.tsnew file mode 100644index 00000000..8446e377--- /dev/null+++ b/examples/workers-sandbox/src/fixture.ts@@ -0,0 +1,78 @@+// Synthetic task only: no local repository or user data enters the sandbox.+export const implementation = String.raw`def subtract_intervals(allowed, blocked):+ allowed.sort()+ return [(a, b) for a, b in allowed+ if a != b and not any(a <= start < b for start, end in blocked)]+`;++export const tests = String.raw`import copy+import random+import unittest+from intervals import subtract_intervals+++def oracle(allowed, blocked):+ points = {x for start, end in allowed for x in range(start, end)}+ points -= {x for start, end in blocked for x in range(start, end)}+ result = []+ for x in sorted(points):+ if result and result[-1][1] == x:+ result[-1] = (result[-1][0], x + 1)+ else:+ result.append((x, x + 1))+ return result+++class IntervalTests(unittest.TestCase):+ def check_case(self, allowed, blocked, expected=None):+ before = copy.deepcopy((allowed, blocked))+ answer = subtract_intervals(allowed, blocked)+ self.assertEqual(answer, oracle(*before) if expected is None else expected)+ self.assertEqual((allowed, blocked), before, 'inputs were mutated')+ self.assertTrue(all(a < b for a, b in answer))+ self.assertTrue(all(answer[i][1] < answer[i + 1][0]+ for i in range(len(answer) - 1)))++ def test_empty(self):+ self.check_case([], [])+ self.check_case([], [(1, 3)])+ self.check_case([(1, 1)], [(2, 2)])++ def test_partial_and_nested(self):+ self.check_case([(0, 10)], [(3, 7)], [(0, 3), (7, 10)])+ self.check_case([(0, 10)], [(2, 3), (7, 8), (1, 9)], [(0, 1), (9, 10)])+ self.check_case([(0, 10)], [(-1, 20)], [])++ def test_normalization(self):+ self.check_case([(4, 10), (0, 4), (2, 8)], [(8, 9), (3, 5), (4, 7)])+ self.check_case([(4, 6), (-9, -2), (1, 5)], [(-5, 2), (3, 4)])++ def test_touching_boundaries(self):+ self.check_case([(0, 5)], [(-4, 0), (5, 8)], [(0, 5)])+ self.check_case([(0, 3), (3, 6)], [(2, 3), (3, 4)], [(0, 2), (4, 6)])++ def test_invalid_input(self):+ for allowed, blocked in [([(4, 1)], []), ([], [(3, -1)]), ([(0, 9)], [(8, 2)])]:+ with self.assertRaises(ValueError):+ subtract_intervals(allowed, blocked)++ def test_no_mutation(self):+ self.check_case([(8, 12), (0, 10)], [(4, 9), (1, 2)])++ def test_randomized(self):+ rng = random.Random(462)+ for case in range(2000):+ def intervals():+ return [tuple(sorted((rng.randrange(-25, 26), rng.randrange(-25, 26))))+ for _ in range(rng.randrange(10))]+ self.check_case(intervals(), intervals())+++if __name__ == '__main__':+ import sys+ result = unittest.TextTestRunner(verbosity=1).run(unittest.defaultTestLoader.loadTestsFromTestCase(IntervalTests))+ print('RANDOMIZED_CASES=2000' if result.wasSuccessful() else 'BASELINE_OR_REPAIR_FAILED')+ sys.exit(0 if result.wasSuccessful() else 1)+`;++export const task = `Repair intervals.py in /tmp/graff-task. Implement subtract_intervals(allowed, blocked) for half-open integer intervals: normalize unsorted, overlapping and touching input intervals, subtract the union of blockers, and return sorted disjoint nonempty intervals. Ignore empty intervals, reject reversed intervals with ValueError, and never mutate inputs. Use sandbox_exec to inspect files, run tests, edit intervals.py, and rerun python3 test_intervals.py. Do not modify tests or install dependencies. You have at most 8 model steps, commands must complete within 30 seconds, and output must stay concise. Finish only after the existing tests pass, then summarize the fix. The workspace is disposable; no credentials are available inside it.`;diff --git a/examples/workers-sandbox/src/index.ts b/examples/workers-sandbox/src/index.tsnew file mode 100644index 00000000..41b108fb--- /dev/null+++ b/examples/workers-sandbox/src/index.ts@@ -0,0 +1,116 @@+import { DurableObject } from "cloudflare:workers";+import { createWorkerAgent, type WorkerTool } from "../../../sdk/ts/worker.ts";+import { createCodegraffSandbox, attachCodegraffSandbox, SandboxError } from "../../../sdk/ts/worker-sandbox.ts";+import module from "../../../zig-out/bin/graff-worker.wasm?module";+import { implementation, tests, task } from "./fixture.ts";++type Env = {+ TASKS: DurableObjectNamespace<SandboxTask>;+ CODEGRAFF_API_KEY?: string;+ INGRESS_TOKEN?: string;+ MODEL_NAME: string;+ TEST_BRIDGE: string;+};+const gateway = "https://gateway.codegraff.com";+const workspace = "/tmp/graff-task";+function capabilities(env: Env) {+ const bridge = env.TEST_BRIDGE;+ if (bridge && !/^http:\/\/127\.0\.0\.1:\d+$/.test(bridge)) throw new Error("Invalid test bridge");+ const transport: typeof fetch = bridge ? (input, init) => {+ const url = new URL(typeof input === "string" ? input : input instanceof URL ? input.href : input.url);+ if (url.origin !== gateway) throw new Error("Unexpected upstream");+ return fetch(`${bridge}${url.pathname}${url.search}`, init);+ } : fetch;+ return { token: bridge ? "cg_sk_local_live_test_placeholder" : env.CODEGRAFF_API_KEY ?? "", fetch: transport };+}+function safeError(error: unknown): string {+ // Only locally defined error class names, never provider bodies or headers.+ return error instanceof Error && /^[A-Za-z][A-Za-z0-9]{0,60}$/.test(error.name) ? error.name : "TaskFailed";+}++/** DO owns task coordination; the WASM core makes decisions; the VM runs code. */+export class SandboxTask extends DurableObject<Env> {+ async alarm() {+ const id = await this.ctx.storage.get<string>("sandboxId");+ if (id) await attachCodegraffSandbox(id, capabilities(this.env)).destroy();+ await this.ctx.storage.deleteAll();+ }++ override async fetch(request: Request): Promise<Response> {+ const signal = AbortSignal.any([request.signal, AbortSignal.timeout(180_000)]);+ let sandbox: Awaited<ReturnType<typeof createCodegraffSandbox>> | undefined;+ let phase = "create";+ let report: Record<string, unknown> = { ok: false };+ let cleaned = false;+ try {+ sandbox = await createCodegraffSandbox({ ...capabilities(this.env), signal, autoStopMinutes: 5 });+ await this.ctx.storage.put("sandboxId", sandbox.id);+ // Backup after a disconnected/terminated request; lease is a second bound.+ await this.ctx.storage.setAlarm(Date.now() + 240_000);+ phase = "bootstrap";+ const mkdir = await sandbox.exec(`mkdir -p ${workspace}`, { signal });+ if (mkdir.exitCode !== 0) throw new Error("Workspace initialization failed");+ await sandbox.upload(`${workspace}/intervals.py`, implementation, { signal });+ await sandbox.upload(`${workspace}/test_intervals.py`, tests, { signal });+ const secrets = await sandbox.exec("python3 -c 'import os; assert not any(os.environ.get(k) for k in (\"CODEGRAFF_API_KEY\", \"MODEL_TOKEN\", \"INGRESS_TOKEN\")); print(\"credentials absent\")'", { signal });+ if (secrets.exitCode !== 0) throw new Error("Credential isolation failed");+ phase = "baseline";+ const baseline = await sandbox.exec("python3 test_intervals.py", { cwd: workspace, signal });+ if (baseline.exitCode === 0) throw new Error("Fixture was not initially broken");+ let dispatched = 0;+ const tool: WorkerTool = {+ name: "sandbox_exec",+ description: "Execute a shell command in the task's isolated Codegraff VM at /tmp/graff-task. Returns exitCode and result; timeout 30 seconds. No host filesystem or credentials.",+ parameters: { type: "object", properties: { command: { type: "string", maxLength: 8192 } }, required: ["command"], additionalProperties: false },+ validate: input => !!input && typeof input === "object" && !Array.isArray(input) && Object.keys(input).length === 1 &&+ typeof (input as { command?: unknown }).command === "string" && (input as { command: string }).command.length > 0 && (input as { command: string }).command.length <= 8192,+ async execute(input, { signal: toolSignal }) {+ dispatched++;+ return JSON.stringify(await sandbox!.exec((input as { command: string }).command, { cwd: workspace, signal: toolSignal, timeoutSeconds: 30 }));+ },+ };+ phase = "agent";+ const host = capabilities(this.env);+ const agent = await createWorkerAgent(module, {+ endpoint: `${gateway}/v1/chat/completions`, model: this.env.MODEL_NAME,+ token: host.token, fetch: host.fetch, maxSteps: 8, tools: [tool],+ instructions: "Repair the provided synthetic Python module using sandbox_exec. Treat nonzero exits as failures to diagnose. Never modify the tests. Run the tests successfully before your final answer. Keep commands and output short.",+ });+ const result = await agent.prompt(task, { signal });+ phase = "verify";+ const unchanged = await sandbox.download(`${workspace}/test_intervals.py`, { signal }) === tests;+ const verification = await sandbox.exec("python3 test_intervals.py", { cwd: workspace, signal });+ const repaired = await sandbox.download(`${workspace}/intervals.py`, { signal });+ const passed = dispatched > 0 && unchanged && verification.exitCode === 0 && verification.result.includes("RANDOMIZED_CASES=2000") && repaired !== implementation;+ report = { ok: passed, model: this.env.MODEL_NAME, ...result, sandboxToolCalls: dispatched, baselineFailed: true, testsUnchanged: unchanged,+ verification: { exitCode: verification.exitCode, result: verification.result }, credentialIsolation: true, implementation: repaired };+ } catch (error) {+ report = { ok: false, phase, error: safeError(error),+ code: error instanceof SandboxError ? error.code : undefined,+ status: error instanceof SandboxError ? error.status : undefined };+ } finally {+ if (sandbox) {+ try {+ // Independent deadline: cleanup must still work after task cancellation.+ await sandbox.destroy();+ cleaned = true;+ await this.ctx.storage.deleteAlarm();+ await this.ctx.storage.deleteAll();+ } catch { /* Durable alarm retries cleanup; idle lease also bounds billing. */ }+ }+ }+ return Response.json({ ...report, sandboxDestroyed: cleaned }, { status: report.ok && cleaned ? 200 : 500 });+ }+}++export default {+ async fetch(request: Request, env: Env): Promise<Response> {+ if (request.method !== "POST") return new Response("Use POST", { status: 405 });+ if (!env.TEST_BRIDGE) {+ if (!env.INGRESS_TOKEN || request.headers.get("authorization") !== `Bearer ${env.INGRESS_TOKEN}`) return new Response("Unauthorized", { status: 401 });+ if (!env.CODEGRAFF_API_KEY) return new Response("Sandbox key is not configured", { status: 503 });+ }+ // Fresh task identity: requests never share a workspace or uncertain effects.+ return env.TASKS.get(env.TASKS.idFromName(crypto.randomUUID())).fetch(request);+ },+} satisfies ExportedHandler<Env>;diff --git a/examples/workers-sandbox/src/wasm.d.ts b/examples/workers-sandbox/src/wasm.d.tsnew file mode 100644index 00000000..2abf2d40--- /dev/null+++ b/examples/workers-sandbox/src/wasm.d.ts@@ -0,0 +1,4 @@+declare module "*.wasm?module" {+ const module: WebAssembly.Module;+ export default module;+}diff --git a/examples/workers-sandbox/tsconfig.json b/examples/workers-sandbox/tsconfig.jsonnew file mode 100644index 00000000..f996a336--- /dev/null+++ b/examples/workers-sandbox/tsconfig.json@@ -0,0 +1,16 @@+{+ "compilerOptions": {+ "target": "es2024",+ "lib": ["es2024"],+ "module": "preserve",+ "moduleResolution": "bundler",+ "types": [],+ "strict": true,+ "noEmit": true,+ "allowImportingTsExtensions": true,+ "isolatedModules": true,+ "verbatimModuleSyntax": true,+ "skipLibCheck": true+ },+ "include": ["src", "cloudflare.config.ts", "vite.config.ts", ".cloudflare/types", "../../sdk/ts/worker.ts", "../../sdk/ts/worker-sandbox.ts"]+}diff --git a/examples/workers-sandbox/vite.config.ts b/examples/workers-sandbox/vite.config.tsnew file mode 100644index 00000000..629dc765--- /dev/null+++ b/examples/workers-sandbox/vite.config.ts@@ -0,0 +1,3 @@+import { cloudflare } from "@cloudflare/vite-plugin";+import { defineConfig } from "vite";+export default defineConfig({ plugins: [cloudflare()], build: { sourcemap: false } });diff --git a/scripts/eval/tier1-manifest.json b/scripts/eval/tier1-manifest.jsonindex 2f001a7a..c00850f2 100644--- a/scripts/eval/tier1-manifest.json+++ b/scripts/eval/tier1-manifest.json@@ -14,7 +14,7 @@"src/main.zig","src/repl.zig"],- "test_count_baseline": 3390,+ "test_count_baseline": 3391,"test_count_slack": 25,"required_invariants": [{diff --git a/sdk/py/pyproject.toml b/sdk/py/pyproject.tomlindex 3b85867f..3adee56a 100644--- a/sdk/py/pyproject.toml+++ b/sdk/py/pyproject.toml@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"[project]name = "codegraff"-version = "0.3.1"+version = "0.5.0"readme = "README.md"description = "Python client for the codegraff agent — drives `graff --json` over stdio. Constants auto-generated from `graff --schema`."requires-python = ">=3.8"diff --git a/sdk/ts/MANAGED.md b/sdk/ts/MANAGED.mdnew file mode 100644index 00000000..601e86d4--- /dev/null+++ b/sdk/ts/MANAGED.md@@ -0,0 +1,67 @@+# Managed sessions and opt-in traces++The experimental `@codegraff/sdk/managed` client uses the existing account remote-control relay. It runs the **same native Graff engine** on an explicitly selected registered device: all of that engine's configured providers remain available. It does not introduce another agent loop or provision a machine.++The client uses only fetch/Web APIs. It can run in Node, Bun or a Worker; **this relay transport** keeps the agent and tools on the device, not inside the Worker isolate. The separate experimental `@codegraff/sdk/worker` path hosts Graff's Zig/Wasm chat step inside the Worker, with `@codegraff/sdk/worker-sandbox` providing remote shell execution. That experiment is not a resumable conversation service: its sandbox example currently retains cleanup ownership, not conversation checkpoints. These are distinct execution transports, not two competing agent engines or interchangeable durability guarantees.++Use server-side secrets, never a public browser bundle. The account key must have the `remote` scope; a model-only API key cannot access devices or their sessions.++```ts+import { ManagedHarness } from "@codegraff/sdk/managed";+import { createOtlpExporter } from "@codegraff/sdk/otel";++// Set this to your managed relay's HTTPS origin.+const url = process.env.CODEGRAFF_MANAGED_URL!;+const apiKey = process.env.CODEGRAFF_API_KEY!;++// Optional: enable only when this origin has the SDK trace collector deployed.+const traces = createOtlpExporter({ url: `${url}/v1/traces`, apiKey });+const client = new ManagedHarness({ url, apiKey, observe: traces.observe });+const devices = await client.devices();+const device = devices.find(d => d.online);+if (!device) throw new Error("Register an execution device first");+const session = await client.session({+ deviceId: device.agent_id,+ session: "sdk-example",+ maxModelCalls: 2,+});++// Choose an application-stable id. A POST is not automatically retried.+const receipt = await session.submit("Reply with a short greeting; do not use tools", {+ messageId: "greeting-1",+});+// Persist receipt in YOUR application's durable store before watching.+// It includes no prompt or key. Keep a cursor alongside it.+let next = receipt.from;+try {+ for await (const event of session.watch(receipt, { from: next })) {+ // Commit the event/application effect and next cursor atomically when needed.+ if (event.type === "text") process.stdout.write(event.text);+ next = event.seq + 1;+ }+} finally {+ await traces.flush(); // Worker callers must await this or use ctx.waitUntil.+}+console.log({ traceId: receipt.traceId, droppedSpans: traces.dropped });+```++A replacement SDK process can call `client.attach(receipt.sessionId).watch(receipt, { from: next })`. Transient reads retry within a bound, event-window gaps request replay from the device tape, and reconnect never submits a second prompt. To inspect execution, call `session.status()`; to stop it, call `session.cancel()`. Stopping iteration or aborting `watch` detaches the viewer without stopping remote work. `session.close()` explicitly closes the execution session.++## Durability boundaries++- A successful submit acknowledges the relay's queued command, not a completed turn or a model-start receipt. A lost POST response is ambiguous. Inspect/reconnect rather than blindly resubmitting.+- Use one active writer/turn per session. Receipts do not fence concurrent writers or identify a per-command event range; the event tape is session-scoped.+- Event replay and completed conversation checkpoints live with the native execution device/workspace. Replacing the relay/client is not the same as losing the device or its disk. A dead device is not automatically migrated or a half-completed tool re-executed.+- Current message-id deduplication is bounded and in memory. It is **not crash-safe exactly-once delivery**; command dispatch also has failure windows. Do not automatically retry externally visible effects without application idempotency keys.+- Receipts and cursors are caller-owned. The SDK does not silently write prompts or application data into a cloud store. Replayed events may repeat application effects unless your cursor/effect commits are atomic.+- The relay may replace oversized events with stubs. The SDK fails explicitly instead of silently treating a truncated event as complete.++## Traces, not transcripts++Tracing is opt-in. The default turn span includes random trace/span IDs, timing, status and numeric usage/event/reconnect counts. Prompts, assistant text, reasoning, tool arguments/results, error bodies, model/provider/account/device/session labels and credentials are excluded. Keys travel only in the authorization header. Exports are bounded and time out; a collector failure does not fail the agent turn. `dropped` makes best-effort loss visible.++The managed collector accepts this **restricted SDK OTLP/HTTP JSON profile**, not arbitrary third-party spans. It reconstructs an allowlisted envelope and stores it privately per authenticated account. With that collector deployed, `GET /v1/traces/<traceId>` retrieves OTLP JSON and `DELETE /v1/traces/<traceId>` deletes it, using the same remote-scoped authorization header. Limits are 64 spans per request/trace and 128 recent traces per account; traces expire after seven idle days. There is no hosted trace UI in this change. A standard OTLP collector can also receive the SDK export by setting its HTTPS URL explicitly.++This is a local integration path until the managed collector is deployed; installing a Node package does not deploy a backend or grant a model-only key remote-control access.++For custom deployments, retention, exporters or durability requirements, email **[email protected]**.diff --git a/sdk/ts/README.md b/sdk/ts/README.mdindex 079f7246..6abd84ec 100644--- a/sdk/ts/README.md+++ b/sdk/ts/README.md@@ -1,8 +1,20 @@# @codegraff/sdk-TypeScript / Node SDK for the [codegraff](https://github.com/justrach/codegraff)-agent. It drives the `graff` binary over its `--json` stdio protocol, and the-types are auto-generated from `graff --schema`.+TypeScript SDK for the [codegraff](https://github.com/justrach/codegraff)+agent: native subprocesses, managed-device replay, and experimental Worker-native+execution. Native protocol types are auto-generated from `graff --schema`.++## Choose an execution path++| Import | Where the agent runs | Tools and persistence |+|---|---|---|+| `@codegraff/sdk` / `@codegraff/sdk/acp` | Native child process | Native capabilities and saved conversations |+| `@codegraff/sdk/remote` / `@codegraff/sdk/managed` | Existing native execution device | Device-owned checkpoints and event replay; managed uses the account relay |+| `@codegraff/sdk/worker` | Shared Zig chat step inside a Worker via Wasm/JSPI | Explicit host tools; no durable conversation checkpoints or full CLI parity |+| `@codegraff/sdk/worker-sandbox` | HTTP client for remote OS execution | Adds sandbox capabilities to the Worker host; not another agent engine |++`@codegraff/sdk/otel` is the shared optional metadata-only trace exporter. Tracing+and sandbox cleanup do not add conversation durability to the Worker-native path.## Install@@ -116,6 +128,21 @@ await h.close();They work on local `Harness` and edge-safe `RemoteHarness` turns and arevalidated against the selected model and the 16-image/3.7 MB-per-image limits.+## Managed sessions and opt-in traces++The experimental `@codegraff/sdk/managed` client drives existing registered+execution devices through the account relay, with receipt/cursor-based replay+from another SDK process. `@codegraff/sdk/otel` adds optional content-free OTLP+export. See [the managed-session guide](./MANAGED.md) for a short example,+authentication, deployment requirements and explicit durability limits.++Both `ManagedHarness` and `createWorkerAgent()` accept `observe: exporter.observe`+from the same `createOtlpExporter()`. Flush explicitly after the turn (await it or+use the Worker's `ctx.waitUntil`). Observer failures cannot fail or hold a turn+open; no prompt, tool content or error body is exported.++For custom deployments or integrations, email **[email protected]**.+## Orchestration (#276): agent()/parallel()/pipeline(), budgets, resumable runs`@codegraff/sdk/orchestrate` is a deterministic scripting layer on top of the@@ -186,6 +213,19 @@ names, `--no-local-tools`, and license: [Embedding graff](../../docs/embedding.mSame-process (no child): `@codegraff/sdk/embed` `createGraffAgent()` loads`graff-core.wasm` (`zig build wasm-core`). First-slice turn is `echo:`.+Experimental Worker-native model/tool turns: `@codegraff/sdk/worker`+`createWorkerAgent()` accepts a statically bundled `graff-worker.wasm`+(`zig build wasm-worker`). It shares Graff's native chat step and uses JSPI for+host HTTP/tools, without a native proxy. Chat Completions only; no shell,+durable sessions or full CLI parity yet. See the+[cf/workerd example](../../examples/workers-engine/README.md).++Remote shell capability: `@codegraff/sdk/worker-sandbox` accesses existing+Codegraff cloud VMs without Node APIs. The+[Durable Object sandbox example](../../examples/workers-sandbox/README.md)+keeps model/tool orchestration in the Worker and verifies a repair inside a+disposable VM. Its live test is opt-in and incurs model/sandbox charges.+## Links- Repository: <https://github.com/justrach/codegraff>diff --git a/sdk/ts/managed.test.ts b/sdk/ts/managed.test.tsnew file mode 100644index 00000000..b5ac0175--- /dev/null+++ b/sdk/ts/managed.test.ts@@ -0,0 +1,161 @@+import { describe, expect, test } from "bun:test";+import { ManagedHarness, ManagedRequestError } from "./managed.ts";+import type { ManagedReceipt } from "./managed.ts";+import type { TraceSpan } from "./otel.ts";++const sid = "sdk-smoke";+const device = "1234567890abcdef";+const receipt: ManagedReceipt = { sessionId: sid, commandId: "command", messageId: "message", from: 1,+ traceId: "a".repeat(32), spanId: "b".repeat(16), startedUnixNano: "1790000000000000000" };+const turn = { seq: 3, type: "turn", text: "sensitive answer", input_tokens: 12, output_tokens: 2, api_calls: 1 };+function fake(fn: (path: string, init: RequestInit) => Response | Promise<Response>): typeof fetch {+ return (async (url: string | URL | Request, init: RequestInit = {}) => fn(String(url), init)) as typeof fetch;+}+const page = (events: unknown[], extra = {}) => Response.json({ events: events.map(x => JSON.stringify(x)), in_flight: false, gap: false, next_from: 4, ...extra });++describe("managed relay SDK", () => {+ test("creation uses an explicit device; keys stay in auth headers", async () => {+ const requests: string[] = [];+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake((url, init) => {+ expect((init.headers as Record<string, string>).Authorization).toBe("Bearer test-key");+ expect(init.redirect).toBe("manual");+ expect(url).not.toContain("test-key");+ expect(String(init.body)).not.toContain("test-key");+ requests.push(url);+ if (url.endsWith(`/agents/${device}/sessions`)) {+ expect(JSON.parse(String(init.body))).toEqual({ session: sid, model: "example", max_model_calls: 2 });+ return Response.json({ session_id: sid });+ }+ return Response.json({ sessions: [{ session_id: sid, online: true }] });+ }) });+ const session = await h.session({ deviceId: device, session: sid, model: "example", maxModelCalls: 2 });+ expect((await session.status())?.online).toBe(true);+ expect(requests).toHaveLength(2);+ });++ test("a new SDK process reattaches with receipt/cursor; GET failure never resends a prompt", async () => {+ let reads = 0; let prompts = 0;+ const observed: TraceSpan[] = [];+ const fetcher = fake((_url, init) => {+ if (init.method === "POST") {+ prompts++;+ expect(JSON.parse(String(init.body)).message_id).toBe("my-id");+ return Response.json({ command_id: "accepted", from: 1 }, { status: 202 });+ }+ if (++reads === 1) throw new TypeError("connection dropped");+ return page([{ seq: 1, type: "text", text: "private prompt/tool text" }, turn]);+ });+ const first = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fetcher });+ const accepted = await first.attach(sid).submit("sensitive prompt", { messageId: "my-id" });+ const persisted = JSON.parse(JSON.stringify(accepted)) as ManagedReceipt;+ const second = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fetcher,+ observe: s => { observed.push(s); } });+ const events = [];+ for await (const ev of second.attach(sid).watch(persisted)) events.push(ev);+ expect(events.map(e => e.seq)).toEqual([1, 3]);+ expect(prompts).toBe(1);+ expect(reads).toBe(2);+ expect(observed).toHaveLength(1);+ expect(JSON.stringify(observed)).not.toMatch(/sensitive|private|test-key|my-id|accepted/);+ expect(observed[0]?.attributes?.["graff.reconnects"]).toBe(1);+ });++ test("gap recovery discards incomplete window, requests device replay, and removes old duplicates", async () => {+ let reads = 0; let replays = 0;+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake((_url, init) => {+ if (init.method === "POST") {+ replays++;+ expect(JSON.parse(String(init.body))).toEqual({ type: "reattach", resume_from: 2 });+ return Response.json({ ok: true });+ }+ if (++reads === 1) return page([turn], { gap: true });+ return page([{ seq: 1, type: "text", text: "already committed" }, { seq: 2, type: "text", text: "new" }, turn]);+ }) });+ const events = [];+ for await (const e of h.attach(sid).watch(receipt, { from: 2 })) events.push(e.seq);+ expect(events).toEqual([2, 3]);+ expect(replays).toBe(1);+ });++ test("empty idle window after relay restart requests tape rather than inventing completion", async () => {+ let reads = 0; let replays = 0;+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake((_url, init) => {+ if (init.method === "POST") { replays++; return Response.json({}); }+ return ++reads === 1 ? page([]) : page([turn]);+ }) });+ for await (const _event of h.attach(sid).watch(receipt)) { /* drain */ }+ expect(replays).toBe(1);+ });++ test("ambiguous submission is not retried; auth failures are terminal and sanitized", async () => {+ let calls = 0;+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake(() => {+ calls++; return Response.json({ secret: "must not appear" }, { status: 403 });+ }) });+ await expect(h.attach(sid).submit("prompt", { messageId: "id" })).rejects.toBeInstanceOf(ManagedRequestError);+ expect(calls).toBe(1);+ await expect((async () => { for await (const _e of h.attach(sid).watch(receipt)) { /* drain */ } })()).rejects.toThrow("HTTP 403");+ expect(calls).toBe(2);+ });++ test("truncated events fail without silently advancing a cursor", async () => {+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake(() => page([{ seq: 1, type: "text", truncated: true }])) });+ await expect((async () => { for await (const _e of h.attach(sid).watch(receipt)) { /* drain */ } })()).rejects.toThrow("device tape");+ });++ test("cancel and answer bypass watch; aborting a watch does not stop remote work", async () => {+ const types: string[] = [];+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake((_url, init) => {+ types.push(JSON.parse(String(init.body)).type); return Response.json({});+ }) });+ const session = h.attach(sid);+ await session.cancel(); await session.answer("continue", "call");+ const ac = new AbortController(); ac.abort();+ await expect((async () => { for await (const _e of session.watch(receipt, { signal: ac.signal })) { /* drain */ } })()).rejects.toThrow();+ expect(types).toEqual(["cancel", "answer"]);+ });++ test("throwing, rejecting and stalled observers cannot hold a completed turn open", async () => {+ for (const observe of [+ () => { throw new Error("export failed"); },+ () => Promise.reject(new Error("export rejected")),+ () => new Promise<void>(() => {}),+ ]) {+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake(() => page([turn])), observe });+ const types = [];+ for await (const e of h.attach(sid).watch(receipt)) types.push(e.type);+ expect(types).toEqual(["turn"]);+ }+ });++ test("native fetch keeps the global receiver required by Workers", async () => {+ const original = globalThis.fetch;+ globalThis.fetch = (function (this: unknown) {+ expect(this).toBe(globalThis);+ return Promise.resolve(Response.json({ sessions: [] }));+ }) as unknown as typeof fetch;+ try {+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key" });+ expect(await h.sessions()).toEqual([]);+ } finally { globalThis.fetch = original; }+ });++ test("manual redirects fail without following the location or retrying", async () => {+ let calls = 0;+ const h = new ManagedHarness({ url: "https://relay.example", apiKey: "test-key", fetch: fake((_url, init) => {+ calls++;+ expect(init.redirect).toBe("manual");+ return new Response(null, { status: 302, headers: { location: "https://must-not-follow.example" } });+ }) });+ await expect(h.sessions()).rejects.toThrow("HTTP 302");+ expect(calls).toBe(1);+ });++ test("rejects credential-bearing, insecure and malformed URLs/identifiers", () => {+ for (const url of ["http://remote.example", "https://user:[email protected]", "https://relay.example?key=secret", "https://relay.example/#x"]) {+ expect(() => new ManagedHarness({ url, apiKey: "test-key" })).toThrow();+ }+ const h = new ManagedHarness({ url: "http://127.0.0.1:8080", apiKey: "test-key" });+ expect(() => h.attach("../bad")).toThrow();+ });+});diff --git a/sdk/ts/managed.ts b/sdk/ts/managed.tsnew file mode 100644index 00000000..85281112--- /dev/null+++ b/sdk/ts/managed.ts@@ -0,0 +1,219 @@+/** Fetch-only client for an account's existing remote-control relay.+ * Execution/checkpoints remain on the registered device, not in this client.+ */+import type { Event } from "./remote.ts";+import type { SpanObserver, TraceSpan } from "./otel.ts";++export interface ManagedOptions {+ url: string;+ /** Requires the remote-control scope; never put a key in a browser bundle. */+ apiKey: string;+ fetch?: typeof fetch;+ observe?: SpanObserver;+ /** Network GET retries only. Prompt submission is NEVER automatically retried. */+ reconnectAttempts?: number;+}++export interface ManagedSessionInfo {+ session_id: string;+ agent_id: string;+ state: "idle" | "busy";+ last_seq: number;+ online: boolean;+}++/** Persist this receipt in your own durable storage; it contains no key/prompt.+ * `from` is inclusive. Advance it only after your application commits an event.+ */+export interface ManagedReceipt {+ sessionId: string;+ commandId: string;+ messageId: string;+ from: number;+ traceId: string;+ spanId: string;+ startedUnixNano: string;+}++export class ManagedRequestError extends Error {+ constructor(readonly status: number) {+ super(`Managed request failed (HTTP ${status}); no request was automatically retried`);+ }+}++const SESSION = /^[A-Za-z0-9_][A-Za-z0-9._-]{0,63}$/;+const DEVICE = /^[a-f0-9]{16,32}$/;+const integer = (n: unknown): n is number => Number.isSafeInteger(n) && Number(n) >= 1;+const nano = () => (BigInt(Date.now()) * 1_000_000n).toString();+const hex = (bytes: number) => Array.from(crypto.getRandomValues(new Uint8Array(bytes)), x => x.toString(16).padStart(2, "0")).join("");++/** Managed relay client. Creating a session never provisions or bills a device. */+export class ManagedHarness {+ private readonly base: string;+ private readonly fetcher: typeof fetch;+ private readonly retries: number;++ constructor(private readonly options: ManagedOptions) {+ const url = new URL(options.url);+ const local = ["localhost", "127.0.0.1", "[::1]"].includes(url.hostname);+ if ((url.protocol !== "https:" && !(local && url.protocol === "http:")) ||+ url.username || url.password || url.search || url.hash || url.pathname !== "/") {+ throw new Error("Managed URL must be an HTTPS origin (HTTP allowed on loopback only)");+ }+ if (!options.apiKey || /[\r\n]/.test(options.apiKey)) throw new Error("An API key is required");+ this.base = url.origin;+ // Native Worker fetch rejects a ManagedHarness instance as its receiver.+ this.fetcher = options.fetch ?? globalThis.fetch.bind(globalThis);+ this.retries = options.reconnectAttempts ?? 3;+ if (!Number.isInteger(this.retries) || this.retries < 0 || this.retries > 10) throw new Error("reconnectAttempts must be 0..10");+ }++ private async request<T>(method: string, path: string, body?: unknown, signal?: AbortSignal): Promise<T> {+ const response = await this.fetcher(this.base + path, {+ // Workers supports manual redirects; reject non-2xx without forwarding keys.+ method, redirect: "manual", signal: signal ?? AbortSignal.timeout(35_000),+ headers: { Authorization: `Bearer ${this.options.apiKey}`, "content-type": "application/json" },+ ...(body === undefined ? {} : { body: JSON.stringify(body) }),+ });+ if (!response.ok) {+ await response.body?.cancel();+ throw new ManagedRequestError(response.status);+ }+ return await response.json() as T;+ }++ async devices(): Promise<{ agent_id: string; online: boolean }[]> {+ const result = await this.request<{ agents: { agent_id: string; online: boolean }[] }>("GET", "/v1/remote/agents");+ return result.agents;+ }++ async sessions(): Promise<ManagedSessionInfo[]> {+ return (await this.request<{ sessions: ManagedSessionInfo[] }>("GET", "/v1/remote/sessions")).sessions;+ }++ /** Create or resume a named session on an explicitly selected online device. */+ async session(options: { deviceId: string; session: string; model?: string; maxModelCalls?: number }): Promise<ManagedSession> {+ if (!DEVICE.test(options.deviceId) || !SESSION.test(options.session)) throw new Error("Invalid device/session identifier");+ const result = await this.request<{ session_id: string }>("POST", `/v1/remote/agents/${options.deviceId}/sessions`, {+ session: options.session,+ ...(options.model ? { model: options.model } : {}),+ ...(options.maxModelCalls === undefined ? {} : { max_model_calls: options.maxModelCalls }),+ });+ return this.attach(result.session_id);+ }++ /** Attach without creating a device, replacing a process or changing its model. */+ attach(sessionId: string): ManagedSession {+ if (!SESSION.test(sessionId)) throw new Error("Invalid session identifier");+ return new ManagedSession(sessionId, this.request.bind(this), this.options.observe, this.retries);+ }+}++type Request = <T>(method: string, path: string, body?: unknown, signal?: AbortSignal) => Promise<T>;+type Page = { events: string[]; next_from: number; in_flight: boolean; gap: boolean };++export class ManagedSession {+ constructor(readonly sessionId: string, private readonly request: Request,+ private readonly observe: SpanObserver | undefined, private readonly retries: number) {}++ async status(): Promise<ManagedSessionInfo | null> {+ const result = await this.request<{ sessions: ManagedSessionInfo[] }>("GET", "/v1/remote/sessions");+ return result.sessions.find(s => s.session_id === this.sessionId) ?? null;+ }++ /** A 202 acknowledges durable relay enqueue, NOT a completed model turn.+ * A lost POST response is ambiguous: do not blindly submit again. The engine's+ * recent message-id dedupe is bounded/in-memory, not crash-safe exactly-once.+ */+ async submit(prompt: string, options: { messageId: string }): Promise<ManagedReceipt> {+ if (!options.messageId || options.messageId.length > 128) throw new Error("messageId must contain 1..128 characters");+ const startedUnixNano = nano();+ const result = await this.request<{ command_id: string; from: number }>("POST", `/v1/remote/sessions/${this.sessionId}`, {+ type: "user", text: prompt, message_id: options.messageId,+ });+ if (!integer(result.from) || typeof result.command_id !== "string") throw new Error("Invalid managed submission receipt");+ return { sessionId: this.sessionId, commandId: result.command_id, messageId: options.messageId,+ from: result.from, traceId: hex(16), spanId: hex(8), startedUnixNano };+ }++ /** Replay then follow a previously accepted turn, including in a new process.+ * Resumes reads only; a socket failure never resends the prompt. Aborting a+ * watch detaches the viewer; call cancel() separately to stop execution.+ * One active prompt per session is required; receipts do not fence writers.+ */+ async *watch(receipt: ManagedReceipt, options: { from?: number; signal?: AbortSignal } = {}): AsyncGenerator<Event> {+ if (receipt.sessionId !== this.sessionId) throw new Error("Receipt belongs to another session");+ let from = options.from ?? receipt.from;+ if (!integer(from)) throw new Error("Invalid replay cursor");+ let failures = 0;+ let gaps = 0;+ let count = 0;+ let reconnects = 0;+ while (true) {+ options.signal?.throwIfAborted();+ let page: Page;+ try {+ page = await this.request<Page>("GET", `/v1/remote/sessions/${this.sessionId}/events?from=${from}&wait=25000`, undefined, options.signal);+ } catch (error) {+ options.signal?.throwIfAborted();+ if (error instanceof ManagedRequestError && error.status < 500 && error.status !== 429) throw error;+ if (failures++ >= this.retries) throw error;+ reconnects++;+ continue;+ }+ if (page.gap) {+ if (++gaps > 3) throw new Error("Event tape gap could not be recovered; cursor was not advanced");+ await this.request("POST", `/v1/remote/sessions/${this.sessionId}`, { type: "reattach", resume_from: from }, options.signal);+ reconnects++;+ continue;+ }+ if (!Array.isArray(page.events)) throw new Error("Invalid managed event page");+ for (const line of page.events) {+ const event = JSON.parse(line) as Event & { truncated?: boolean };+ if (!integer(event.seq) || typeof event.type !== "string") throw new Error("Invalid managed event envelope");+ if (event.seq < from) continue;+ if (event.truncated) throw new Error("Event exceeds relay window limit; use the device tape to retrieve it");+ from = event.seq + 1;+ count++;+ failures = 0;+ if (event.type === "turn" || event.type === "error") {+ const attributes: Record<string, number> = { "graff.events": count, "graff.reconnects": reconnects };+ if (event.type === "turn") {+ for (const [key, value] of [+ ["gen_ai.usage.input_tokens", event.input_tokens], ["gen_ai.usage.output_tokens", event.output_tokens],+ ["gen_ai.usage.cache_read_tokens", event.cache_read_tokens], ["graff.api_calls", event.api_calls],+ ] as const) if (typeof value === "number" && Number.isFinite(value)) attributes[key] = value;+ }+ const span: TraceSpan = { traceId: receipt.traceId, spanId: receipt.spanId, name: "graff.turn",+ startTimeUnixNano: receipt.startedUnixNano, endTimeUnixNano: nano(),+ status: { code: event.type === "error" ? 2 : 1 }, attributes };+ // Observers cannot fail or hold completion open; flush exporters separately.+ try { void Promise.resolve(this.observe?.(span)).catch(() => {}); } catch { /* content-free best effort */ }+ yield event;+ return;+ }+ yield event;+ }+ if (!page.in_flight && page.events.length === 0) {+ // Ring state is volatile across a relay restart. Ask the device for its+ // tape once rather than treating an idle/empty window as completion.+ if (++gaps > 3) throw new Error("No terminal event on the device tape; execution state is unknown");+ await this.request("POST", `/v1/remote/sessions/${this.sessionId}`, { type: "reattach", resume_from: from }, options.signal);+ reconnects++;+ }+ }+ }++ async cancel(): Promise<void> {+ await this.request("POST", `/v1/remote/sessions/${this.sessionId}`, { type: "cancel" });+ }++ async answer(text: string, callId?: string): Promise<void> {+ await this.request("POST", `/v1/remote/sessions/${this.sessionId}`, { type: "answer", text, ...(callId ? { call_id: callId } : {}) });+ }++ /** Explicitly stop/close the remote session, not just the local watcher. */+ async close(): Promise<void> {+ await this.request("DELETE", `/v1/remote/sessions/${this.sessionId}`);+ }+}diff --git a/sdk/ts/otel.test.ts b/sdk/ts/otel.test.tsnew file mode 100644index 00000000..997697e2--- /dev/null+++ b/sdk/ts/otel.test.ts@@ -0,0 +1,330 @@+import { describe, expect, spyOn, test } from "bun:test";+import { createOtlpExporter, type TraceSpan } from "./otel.ts";++const url = "https://collector.test/v1/traces";+const apiKey = "synthetic-secret-key";+const span = (overrides: Partial<TraceSpan> = {}): TraceSpan => ({+ traceId: "abcdef0123456789abcdef0123456789",+ spanId: "0123456789abcdef",+ name: "graff.turn",+ startTimeUnixNano: "1700000000000000000",+ endTimeUnixNano: "1700000001000000000",+ ...overrides,+});++type Capture = { url: string; init: RequestInit; payload: any };+function collector() {+ const calls: Capture[] = [];+ const fetcher = (async (input, init) => {+ calls.push({ url: String(input), init: init!, payload: JSON.parse(String(init!.body)) });+ return new Response(null, { status: 200 });+ }) as typeof fetch;+ return { calls, fetcher };+}+const spans = (call: Capture): any[] => call.payload.resourceSpans[0].scopeSpans[0].spans;+const deferred = <T>() => {+ let resolve!: (value: T) => void;+ let reject!: (reason: unknown) => void;+ const promise = new Promise<T>((res, rej) => { resolve = res; reject = rej; });+ return { promise, resolve, reject };+};++async function fetchStarted() {+ // flush and the fetch adapter each defer one microtask.+ for (let i = 0; i < 5; i++) await Promise.resolve();+}++describe("metadata-only OTLP exporter", () => {+ test("is opt-in and emits OTLP JSON, fixed service and typed numeric/boolean attributes", async () => {+ const { calls, fetcher } = collector();+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ await exporter.flush();+ expect(calls).toHaveLength(0);+ exporter.observe(span({+ parentSpanId: "FEDCBA9876543210",+ status: { code: 1 },+ attributes: {+ "graff.events": 12,+ "graff.reconnects": true,+ "gen_ai.usage.input_tokens": 23,+ "gen_ai.usage.output_tokens": 4,+ "gen_ai.usage.cache_read_tokens": 2,+ "graff.api_calls": 1.5,+ },+ }));+ expect(calls).toHaveLength(0);+ await exporter.flush();+ expect(calls).toHaveLength(1);+ const call = calls[0]!;+ expect(call.url).toBe(url);+ expect(call.init.method).toBe("POST");+ expect(call.init.headers).toEqual({+ "Content-Type": "application/json", Authorization: `Bearer ${apiKey}`,+ });+ expect(call.init.redirect).toBe("manual");+ expect(call.init.credentials).toBe("omit");+ expect(call.init.referrerPolicy).toBe("no-referrer");+ expect(call.payload.resourceSpans).toHaveLength(1);+ expect(call.payload.resourceSpans[0].resource).toEqual({ attributes: [+ { key: "service.name", value: { stringValue: "codegraff-sdk" } },+ ] });+ expect(spans(call)).toEqual([{+ ...span(), parentSpanId: "fedcba9876543210", status: { code: 1 },+ attributes: [+ { key: "graff.events", value: { intValue: "12" } },+ { key: "graff.reconnects", value: { boolValue: true } },+ { key: "gen_ai.usage.input_tokens", value: { intValue: "23" } },+ { key: "gen_ai.usage.output_tokens", value: { intValue: "4" } },+ { key: "gen_ai.usage.cache_read_tokens", value: { intValue: "2" } },+ { key: "graff.api_calls", value: { doubleValue: 1.5 } },+ ],+ }]);+ expect(exporter.dropped).toBe(0);+ await exporter.flush();+ expect(calls).toHaveLength(1);+ });++ test("rebuilds a snapshot and excludes content, model/tool/session/resource names and API key", async () => {+ const { calls, fetcher } = collector();+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ const original = Object.assign(span({ attributes: {+ "graff.events": 3,+ "gen_ai.usage.input_tokens": "forbidden-input" as any,+ "gen_ai.usage.output_tokens": NaN,+ "gen_ai.usage.cache_read_tokens": Infinity,+ "graff.api_calls": { toJSON: () => "forbidden-value" } as any,+ "custom.attribute": 123,+ "session.id": 456,+ "gen_ai.request.model": 789,+ } }), {+ content: "forbidden-content", model: "forbidden-model", tool: "forbidden-tool",+ session_id: "forbidden-session", resource: { name: "forbidden-resource" },+ apiKey, toJSON: () => ({ content: "forbidden-toJSON" }),+ });+ exporter.observe(original);+ original.name = "graff.tool";+ original.attributes!["graff.events"] = 999;+ await exporter.flush();+ const body = String(calls[0]!.init.body);+ for (const forbidden of ["forbidden", apiKey, "custom.attribute", "session.id", "gen_ai.request.model"])+ expect(body).not.toContain(forbidden);+ expect(spans(calls[0]!)[0].name).toBe("graff.turn");+ expect(spans(calls[0]!)[0].attributes).toEqual([+ { key: "graff.events", value: { intValue: "3" } },+ ]);+ });++ test("ignores attribute accessors/inherited values and isolates throwing input", async () => {+ const { calls, fetcher } = collector();+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ const attributes = Object.create({ "graff.api_calls": 7 });+ Object.defineProperty(attributes, "graff.events", { get() { throw new Error("private"); } });+ exporter.observe(span({ attributes }));+ expect(() => exporter.observe(new Proxy(span(), {+ get() { throw new Error("private"); },+ }))).not.toThrow();+ expect(() => exporter.observe(null as any)).not.toThrow();+ await exporter.flush();+ expect(spans(calls[0]!)[0].attributes).toBeUndefined();+ expect(exporter.dropped).toBe(2);+ });++ test("rejects invalid IDs, names, uint64 timestamps, reversed time and status", async () => {+ const { calls, fetcher } = collector();+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ const bad: Partial<TraceSpan>[] = [+ { traceId: "0".repeat(32) }, { traceId: "a".repeat(31) },+ { traceId: "g".repeat(32) }, { traceId: 4 as any },+ { spanId: "0".repeat(16) }, { spanId: "a".repeat(17) },+ { parentSpanId: "0".repeat(16) }, { parentSpanId: "private" },+ { name: "private-tool-name" as any },+ { startTimeUnixNano: "-1" }, { startTimeUnixNano: "1.5" },+ { startTimeUnixNano: "01" }, { startTimeUnixNano: "1e9" },+ { startTimeUnixNano: 123 as any }, { endTimeUnixNano: "" },+ { endTimeUnixNano: "18446744073709551616" },+ { endTimeUnixNano: "1" }, { status: { code: 3 } as any },+ ];+ for (const overrides of bad) exporter.observe(span(overrides));+ await exporter.flush();+ expect(calls).toHaveLength(0);+ expect(exporter.dropped).toBe(bad.length);+ exporter.observe(span({+ traceId: "ABCDEF0123456789ABCDEF0123456789",+ startTimeUnixNano: "0", endTimeUnixNano: "18446744073709551615",+ status: { code: 0 },+ }));+ await exporter.flush();+ expect(spans(calls[0]!)[0].traceId).toBe(span().traceId);+ expect(exporter.dropped).toBe(bad.length);+ });++ test("supports only the four lifecycle names and strips status descriptions", async () => {+ const { calls, fetcher } = collector();+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ for (const name of ["graff.turn", "graff.model", "graff.tool", "graff.reconnect"] as const)+ exporter.observe(span({ name, status: { code: 2, message: "private" } as any }));+ await exporter.flush();+ expect(spans(calls[0]!).map((s) => s.name)).toEqual([+ "graff.turn", "graff.model", "graff.tool", "graff.reconnect",+ ]);+ expect(String(calls[0]!.init.body)).not.toContain("private");+ });++ test("validates endpoint and configuration without reflecting sensitive input", () => {+ const { fetcher } = collector();+ for (const invalid of [+ "http://collector.test", "ftp://localhost", "https://user:[email protected]",+ "https://@collector.test", `${url}?key=private`, `${url}#private`,+ `${url}?`, `${url}#`, "http://localhost.collector.test", "http://128.0.0.1",+ "not-a-url-private", "https:\\\\@collector.test", "https://\[email protected]",+ ]) {+ expect(() => createOtlpExporter({ url: invalid, apiKey, fetch: fetcher }))+ .toThrow("Invalid OTLP endpoint");+ try { createOtlpExporter({ url: invalid, apiKey, fetch: fetcher }); }+ catch (error) { expect(String(error)).not.toContain("private"); }+ }+ for (const valid of [url, "http://localhost:4318/v1/traces", "http://127.0.0.1",+ "http://127.42.0.2", "http://[::1]:4318/v1/traces"])+ expect(() => createOtlpExporter({ url: valid, apiKey, fetch: fetcher })).not.toThrow();+ for (const timeoutMs of [0, -1, NaN, Infinity])+ expect(() => createOtlpExporter({ url, apiKey, timeoutMs })).toThrow("Invalid OTLP timeout");+ for (const key of ["", " ", "private\r\nHeader: value"])+ expect(() => createOtlpExporter({ url, apiKey: key })).toThrow("Invalid OTLP authorization");+ });++ test("bounds pending spans and payload bytes with all allowed attributes populated", async () => {+ const { calls, fetcher } = collector();+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ const full = span({ parentSpanId: "a".repeat(16), status: { code: 2 }, attributes: {+ "graff.events": -Number.MAX_VALUE, "graff.reconnects": Number.MAX_SAFE_INTEGER,+ "gen_ai.usage.input_tokens": Number.MIN_VALUE,+ "gen_ai.usage.output_tokens": -Number.MAX_SAFE_INTEGER,+ "gen_ai.usage.cache_read_tokens": Number.MAX_VALUE, "graff.api_calls": false,+ } });+ for (let i = 0; i < 1000; i++) exporter.observe(full);+ await exporter.flush();+ const accepted = calls.reduce((n, call) => n + spans(call).length, 0);+ expect(accepted).toBeGreaterThan(0);+ expect(accepted).toBeLessThanOrEqual(64);+ expect(exporter.dropped).toBe(1000 - accepted);+ for (const call of calls) expect(new TextEncoder().encode(String(call.init.body)).length)+ .toBeLessThanOrEqual(64 * 1024);+ exporter.observe(span());+ await exporter.flush();+ expect(spans(calls.at(-1)!)).toHaveLength(1);+ });++ test("concurrent/reentrant flushes share a drain, retain new observations and bound in-flight spans", async () => {+ const first = deferred<Response>();+ const calls: string[] = [];+ let exporter: ReturnType<typeof createOtlpExporter>;+ let reentrant: Promise<void> | undefined;+ const fetcher = (() => {+ calls.push("request");+ reentrant = exporter.flush();+ return calls.length === 1 ? first.promise : Promise.resolve(new Response(null));+ }) as unknown as typeof fetch;+ exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ exporter.observe(span());+ const flush = exporter.flush();+ expect(exporter.flush()).toBe(flush);+ await fetchStarted();+ expect(reentrant).toBe(flush);+ for (let i = 0; i < 64; i++) exporter.observe(span());+ expect(exporter.dropped).toBe(1); // one in-flight plus 63 queued+ expect(calls).toHaveLength(1);+ first.resolve(new Response(null));+ await Promise.all([flush, exporter.flush(), exporter.flush()]);+ expect(calls).toHaveLength(2);+ expect(exporter.dropped).toBe(1);+ await exporter.flush();+ expect(calls).toHaveLength(2);+ });++ test("does not strand observations arriving at the drain completion boundary", async () => {+ for (let delay = 0; delay < 20; delay++) {+ const { calls, fetcher } = collector();+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ exporter.observe(span());+ const first = exporter.flush();+ for (let tick = 0; tick < delay; tick++) await Promise.resolve();+ exporter.observe(span());+ await Promise.all([first, exporter.flush()]);+ expect(calls.reduce((n, call) => n + spans(call).length, 0)).toBe(2);+ expect(exporter.dropped).toBe(0);+ }+ });++ test("isolates network, synchronous fetch, HTTP and redirect failures without reading bodies or retrying", async () => {+ for (const mode of ["reject", "throw", "http", "redirect"] as const) {+ let calls = 0;+ let reads = 0;+ let cancels = 0;+ const fetcher = (() => {+ calls++;+ if (mode === "throw") throw new Error(apiKey);+ if (mode === "reject") return Promise.reject(new Error(apiKey));+ return Promise.resolve({+ ok: false, status: mode === "http" ? 503 : 302,+ text() { reads++; throw new Error(apiKey); },+ json() { reads++; throw new Error(apiKey); },+ body: { cancel() { cancels++; return Promise.reject(new Error(apiKey)); } },+ } as unknown as Response);+ }) as unknown as typeof fetch;+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher });+ exporter.observe(span());+ exporter.observe(span());+ await expect(exporter.flush()).resolves.toBeUndefined();+ await exporter.flush();+ expect(exporter.dropped).toBe(2);+ expect(calls).toBe(1);+ expect(reads).toBe(0);+ expect(cancels).toBe(mode === "http" || mode === "redirect" ? 1 : 0);+ }+ });++ test("times out abort-ignoring fetch, consumes late rejection, and can export again", async () => {+ const late = deferred<Response>();+ let signal: AbortSignal | undefined;+ let calls = 0;+ const fetcher = ((_input, init) => {+ calls++;+ signal = init!.signal!;+ return calls === 1 ? late.promise : Promise.resolve(new Response(null));+ }) as typeof fetch;+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher, timeoutMs: 5 });+ exporter.observe(span());+ await expect(exporter.flush()).resolves.toBeUndefined();+ expect(signal?.aborted).toBe(true);+ expect(exporter.dropped).toBe(1);+ late.reject(new Error(apiKey));+ exporter.observe(span());+ await exporter.flush();+ expect(calls).toBe(2);+ expect(exporter.dropped).toBe(1);+ });++ test("uses a 5s default, caps timeouts at 30s and clears timers after flush", async () => {+ const originalTimeout = globalThis.setTimeout;+ const delays: number[] = [];+ const timeoutSpy = spyOn(globalThis, "setTimeout").mockImplementation(((handler: () => void, delay?: number) => {+ delays.push(delay!);+ return originalTimeout(handler, 1);+ }) as typeof setTimeout);+ const clearSpy = spyOn(globalThis, "clearTimeout");+ try {+ for (const timeoutMs of [undefined, 60000, 15]) {+ const fetcher = (() => new Promise<Response>(() => {})) as unknown as typeof fetch;+ const exporter = createOtlpExporter({ url, apiKey, fetch: fetcher, timeoutMs });+ exporter.observe(span());+ await exporter.flush();+ expect(exporter.dropped).toBe(1);+ }+ expect(delays).toEqual([5000, 30000, 15]);+ expect(clearSpy).toHaveBeenCalledTimes(3);+ } finally {+ timeoutSpy.mockRestore();+ clearSpy.mockRestore();+ }+ });+});diff --git a/sdk/ts/otel.ts b/sdk/ts/otel.tsnew file mode 100644index 00000000..d5442500--- /dev/null+++ b/sdk/ts/otel.ts@@ -0,0 +1,215 @@+/** Opt-in, metadata-only OTLP/HTTP JSON export; no background work or retries. */+export type TraceSpan = {+ traceId: string;+ spanId: string;+ parentSpanId?: string;+ name: "graff.turn" | "graff.model" | "graff.tool" | "graff.reconnect";+ startTimeUnixNano: string;+ endTimeUnixNano: string;+ status?: { code: 0 | 1 | 2 };+ attributes?: Record<string, number | boolean>;+};++export type SpanObserver = (span: TraceSpan) => void | Promise<void>;++type Options = {+ url: string;+ apiKey: string;+ fetch?: typeof fetch;+ timeoutMs?: number;+};++type Attribute = {+ key: string;+ value: { boolValue: boolean } | { intValue: string } | { doubleValue: number };+};++const ATTRIBUTE_KEYS = [+ "graff.events",+ "graff.reconnects",+ "gen_ai.usage.input_tokens",+ "gen_ai.usage.output_tokens",+ "gen_ai.usage.cache_read_tokens",+ "graff.api_calls",+] as const;+const NAMES = new Set(["graff.turn", "graff.model", "graff.tool", "graff.reconnect"]);+const MAX_SPANS = 64;+const MAX_BYTES = 64 * 1024;+const PREFIX = '{"resourceSpans":[{"resource":{"attributes":[{"key":"service.name","value":{"stringValue":"codegraff-sdk"}}]},"scopeSpans":[{"spans":[';+const SUFFIX = ']}]}]}';++function endpoint(input: string): string {+ try {+ if (typeof input !== "string" || !/^https?:\/\//i.test(input)+ || /[\u0000-\u0020\\]/.test(input)) throw new Error();+ const url = new URL(input);+ const loopback = url.hostname === "localhost" || url.hostname === "[::1]"+ || /^127\.\d+\.\d+\.\d+$/.test(url.hostname);+ // Check the serialized URL too: URL.search/hash hide empty '?' and '#'.+ const authority = url.href.slice(url.protocol.length + 2).split("/")[0]!;+ if ((url.protocol !== "https:" && !(url.protocol === "http:" && loopback))+ || url.username || url.password || authority.includes("@")+ || url.href.includes("?") || url.href.includes("#")) throw new Error();+ // URL normalizes empty userinfo away, so reject it in the input as well.+ if (/^[^:]+:\/\/[^/]*@/.test(input.trim())) throw new Error();+ return url.href;+ } catch {+ throw new TypeError("Invalid OTLP endpoint: HTTPS (or loopback HTTP) without userinfo, query or fragment required");+ }+}++function id(value: unknown, length: number): value is string {+ return typeof value === "string" && value.length === length+ && /^[0-9a-f]+$/i.test(value) && !/^0+$/.test(value);+}++function timestamp(value: unknown): value is string {+ return typeof value === "string" && /^(0|[1-9]\d{0,19})$/.test(value)+ && BigInt(value) <= 18446744073709551615n;+}++/** Reconstruct from primitives, never serialize caller objects or their toJSON. */+function serialize(span: TraceSpan): string | undefined {+ const { traceId, spanId, parentSpanId, name, startTimeUnixNano, endTimeUnixNano } = span;+ if (!id(traceId, 32) || !id(spanId, 16)+ || (parentSpanId !== undefined && !id(parentSpanId, 16))+ || !NAMES.has(name) || typeof name !== "string"+ || !timestamp(startTimeUnixNano) || !timestamp(endTimeUnixNano)+ || BigInt(endTimeUnixNano) < BigInt(startTimeUnixNano)) return;+ const attributes: Attribute[] = [];+ const source = span.attributes;+ if (source && typeof source === "object") {+ for (const key of ATTRIBUTE_KEYS) {+ // Accessors and inherited properties are not lifecycle metadata.+ const value: unknown = Object.getOwnPropertyDescriptor(source, key)?.value;+ if (typeof value === "boolean") attributes.push({ key, value: { boolValue: value } });+ else if (typeof value === "number" && Number.isFinite(value)) {+ attributes.push({ key, value: Number.isSafeInteger(value)+ ? { intValue: String(value) } : { doubleValue: value } });+ }+ }+ }+ const status = span.status;+ const code = status?.code;+ if (status !== undefined && code !== 0 && code !== 1 && code !== 2) return;+ return JSON.stringify({+ traceId: traceId.toLowerCase(),+ spanId: spanId.toLowerCase(),+ ...(parentSpanId === undefined ? {} : { parentSpanId: parentSpanId.toLowerCase() }),+ name,+ startTimeUnixNano,+ endTimeUnixNano,+ ...(status === undefined ? {} : { status: { code } }),+ ...(attributes.length ? { attributes } : {}),+ });+}++/**+ * observe never throws; flush never rejects. Invalid, excess and failed spans+ * increment dropped. At most 64 spans (including in-flight) are retained and+ * each JSON payload is at most 64 KiB. Call flush explicitly to export.+ */+export function createOtlpExporter(options: Options): {+ observe: SpanObserver;+ flush(): Promise<void>;+ readonly dropped: number;+} {+ const url = endpoint(options.url);+ const apiKey = options.apiKey;+ if (typeof apiKey !== "string" || !apiKey.trim() || /[\r\n]/.test(apiKey)) {+ throw new TypeError("Invalid OTLP authorization configuration");+ }+ const configuredTimeout = options.timeoutMs ?? 5000;+ if (!Number.isFinite(configuredTimeout) || configuredTimeout <= 0) {+ throw new TypeError("Invalid OTLP timeout");+ }+ const timeoutMs = Math.max(1, Math.min(30000, configuredTimeout));+ const send = options.fetch ?? globalThis.fetch;+ let queue: string[] = [];+ let queueBytes = PREFIX.length + SUFFIX.length;+ let pending = 0;+ let dropped = 0;+ let active: Promise<void> | undefined;++ const observe: SpanObserver = (span) => {+ try {+ if (pending >= MAX_SPANS) { dropped++; return; }+ const encoded = serialize(span);+ // All serialized fields are ASCII, so string length is UTF-8 byte size.+ const bytes = encoded === undefined ? 0 : encoded.length + (queue.length ? 1 : 0);+ if (encoded === undefined || queueBytes + bytes > MAX_BYTES) { dropped++; return; }+ queue.push(encoded);+ queueBytes += bytes;+ pending++;+ } catch {+ // Malformed JS callers (including throwing getters) cannot break a turn.+ dropped++;+ }+ };++ async function request(body: string): Promise<boolean> {+ const controller = new AbortController();+ let timer: ReturnType<typeof setTimeout> | undefined;+ const timeout = new Promise<boolean>((resolve) => {+ timer = setTimeout(() => {+ resolve(false);+ controller.abort();+ }, timeoutMs);+ });+ // Keep browser privacy hints without requiring Workers' narrower RequestInit+ // declaration to expose them; workerd ignores these browser-only fields.+ const init: RequestInit & { credentials: "omit"; referrerPolicy: "no-referrer" } = {+ method: "POST",+ headers: { "Content-Type": "application/json", Authorization: `Bearer ${apiKey}` },+ body,+ signal: controller.signal,+ redirect: "manual",+ credentials: "omit",+ referrerPolicy: "no-referrer",+ };+ // Both settlement paths are consumed even if a supplied fetch ignores abort+ // and rejects later. Never read/log collector bodies (including errors).+ const sent = Promise.resolve().then(() => send(url, init)).then((response) => {+ // Dispose of the body without waiting for an untrusted response stream.+ if (response.body) void response.body.cancel().catch(() => {});+ return response.ok;+ }).catch(() => false);+ try {+ return await Promise.race([sent, timeout]);+ } finally {+ clearTimeout(timer);+ }+ }++ async function drain(): Promise<void> {+ try {+ while (queue.length) {+ const batch = queue;+ queue = [];+ queueBytes = PREFIX.length + SUFFIX.length;+ try {+ if (!await request(PREFIX + batch.join(",") + SUFFIX)) dropped += batch.length;+ } catch {+ dropped += batch.length;+ } finally {+ pending -= batch.length;+ }+ }+ } finally {+ // Clear synchronously with the empty-queue check, not in a later promise+ // reaction where a new observe/flush could join an already-finished drain.+ active = undefined;+ }+ }++ function flush(): Promise<void> {+ if (active) return active;+ if (!queue.length) return Promise.resolve();+ // Defer drain so reentrant/concurrent flushes see the same promise before+ // even a synchronously executing supplied fetch can run.+ active = Promise.resolve().then(drain);+ return active;+ }++ return { observe, flush, get dropped() { return dropped; } };+}diff --git a/sdk/ts/package.json b/sdk/ts/package.jsonindex 99f289ca..cc30f315 100644--- a/sdk/ts/package.json+++ b/sdk/ts/package.json@@ -1,7 +1,7 @@{"name": "@codegraff/sdk",- "version": "0.4.4",- "description": "TypeScript / Node SDK for the codegraff agent — drives `graff --json` over stdio. Types auto-generated from `graff --schema`.",+ "version": "0.5.0",+ "description": "TypeScript SDK for native, managed-device, and experimental Worker-native Graff agents.","type": "module","main": "dist/harness.js","types": "dist/harness.d.ts",@@ -16,6 +16,16 @@"import": "./dist/remote.js","default": "./dist/remote.js"},+ "./managed": {+ "types": "./dist/managed.d.ts",+ "import": "./dist/managed.js",+ "default": "./dist/managed.js"+ },+ "./otel": {+ "types": "./dist/otel.d.ts",+ "import": "./dist/otel.js",+ "default": "./dist/otel.js"+ },"./orchestrate": {"types": "./dist/orchestrate.d.ts","import": "./dist/orchestrate.js",@@ -31,6 +41,16 @@"import": "./dist/embed.js","default": "./dist/embed.js"},+ "./worker": {+ "types": "./dist/worker.d.ts",+ "import": "./dist/worker.js",+ "default": "./dist/worker.js"+ },+ "./worker-sandbox": {+ "types": "./dist/worker-sandbox.d.ts",+ "import": "./dist/worker-sandbox.js",+ "default": "./dist/worker-sandbox.js"+ },"./package.json": "./package.json","./core.wasm": "./graff-core.wasm"},@@ -51,19 +71,20 @@"files": ["dist","graff-core.wasm",- "README.md"+ "README.md",+ "MANAGED.md"],"engines": {"node": ">=18"},"license": "Apache-2.0","optionalDependencies": {- "@codegraff/graff-darwin-arm64": "0.4.4",- "@codegraff/graff-darwin-x64": "0.4.4",- "@codegraff/graff-linux-arm64": "0.4.4",- "@codegraff/graff-linux-x64": "0.4.4",- "@codegraff/graff-win32-arm64": "0.4.4",- "@codegraff/graff-win32-x64": "0.4.4"+ "@codegraff/graff-darwin-arm64": "0.5.0",+ "@codegraff/graff-darwin-x64": "0.5.0",+ "@codegraff/graff-linux-arm64": "0.5.0",+ "@codegraff/graff-linux-x64": "0.5.0",+ "@codegraff/graff-win32-arm64": "0.5.0",+ "@codegraff/graff-win32-x64": "0.5.0"},"scripts": {"build": "node -e \"require('node:fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",diff --git a/sdk/ts/scripts/test-packed-install.mjs b/sdk/ts/scripts/test-packed-install.mjsindex 29627262..b6322ea7 100644--- a/sdk/ts/scripts/test-packed-install.mjs+++ b/sdk/ts/scripts/test-packed-install.mjs@@ -99,6 +99,12 @@ try {const smoke = `import { Harness } from "@codegraff/sdk";+import { ManagedHarness } from "@codegraff/sdk/managed";+import { createOtlpExporter } from "@codegraff/sdk/otel";+import { createWorkerAgent } from "@codegraff/sdk/worker";+import * as sandbox from "@codegraff/sdk/worker-sandbox";+if ([ManagedHarness, createOtlpExporter, createWorkerAgent].some(value => typeof value !== "function") ||+ Object.keys(sandbox).length === 0) throw new Error("missing packed SDK execution exports");const harness = Harness.init({ env: { ...process.env, PATH: process.env.CLEAN_PATH, Path: process.env.CLEAN_PATH, GRAFF_NO_TELEMETRY: "1" } });try {${suppliedBinary ? "await harness.setEffort(\"low\");" : "const text = await harness.ask(\"out-of-box\"); if (text !== \"user:out-of-box\") throw new Error(`unexpected reply: \${text}`);"}diff --git a/sdk/ts/tsconfig.build.json b/sdk/ts/tsconfig.build.jsonindex 9e6590f8..c2fd6c23 100644--- a/sdk/ts/tsconfig.build.json+++ b/sdk/ts/tsconfig.build.json@@ -9,6 +9,6 @@"rootDir": ".","rewriteRelativeImportExtensions": true},- "include": ["harness.ts", "remote.ts", "orchestrate.ts", "acp.ts", "embed.ts"],+ "include": ["harness.ts", "remote.ts", "orchestrate.ts", "acp.ts", "embed.ts", "managed.ts", "otel.ts", "worker.ts", "worker-sandbox.ts"],"exclude": ["*.test.ts"]}diff --git a/sdk/ts/worker-sandbox.ts b/sdk/ts/worker-sandbox.tsnew file mode 100644index 00000000..81814bcb--- /dev/null+++ b/sdk/ts/worker-sandbox.ts@@ -0,0 +1,264 @@+// Fetch-only access to existing Codegraff Fleet sandboxes; no local processes.+export interface SandboxExecResult { exitCode: number; result: string }+export interface SandboxRequestOptions { signal?: AbortSignal }+export interface SandboxExecOptions extends SandboxRequestOptions { timeoutSeconds?: number; cwd?: string }+export interface CodegraffSandboxAttachOptions {+ /** A cg_sk_ key, sent only in the gateway Authorization header. */+ token: string;+ /** May bridge requests locally; this client still constructs only gateway HTTPS URLs. */+ fetch?: typeof fetch;+}+export interface CodegraffSandboxOptions extends CodegraffSandboxAttachOptions, SandboxRequestOptions {+ autoStopMinutes?: number;+}+export interface CodegraffSandbox {+ readonly id: string;+ /** Aborting stops HTTP waiting, not the remote command. Destroy the VM to stop it. */+ exec(command: string, options?: SandboxExecOptions): Promise<SandboxExecResult>;+ upload(path: string, text: string, options?: SandboxRequestOptions): Promise<void>;+ /** Downloads UTF-8 text; binary files are rejected. */+ download(path: string, options?: SandboxRequestOptions): Promise<string>;+ /** Independent of create/operation signals. Call in finally to end billing. */+ destroy(): Promise<void>;+}+export type SandboxErrorCode = "invalid_argument" | "http" | "network" | "invalid_response" |+ "response_too_large" | "output_too_large" | "file_too_large" | "aborted" | "timeout" | "destroyed";+/** Deliberately excludes request data, response bodies, URLs, IDs, and error causes. */+export class SandboxError extends Error {+ readonly name = "SandboxError";+ constructor(+ readonly code: SandboxErrorCode,+ readonly status?: number,+ /** An attach failure exposed an ID, but its best-effort DELETE failed. */+ readonly cleanupFailed = false,+ ) {+ super(`Sandbox error: ${code}${status === undefined ? "" : ` (${status})`}`);+ }+}+const ORIGIN = "https://gateway.codegraff.com";+const COMMAND_LIMIT = 8 * 1024;+const FILE_LIMIT = 64 * 1024;+const OUTPUT_LIMIT = 64 * 1024;+const RESPONSE_LIMIT = 128 * 1024;+const REQUEST_MS = 45_000;+const CREATE_MS = 90_000;+const CLEANUP_MS = 5_000;+const encoder = new TextEncoder();+const object = (value: unknown): value is Record<string, unknown> =>+ value !== null && typeof value === "object" && !Array.isArray(value);+const validId = (value: unknown): value is string =>+ typeof value === "string" && /^[a-zA-Z0-9_-]{1,256}$/.test(value);+function fail(code: SandboxErrorCode): never { throw new SandboxError(code); }+function integer(value: number, minimum: number, maximum: number): number {+ if (!Number.isInteger(value) || value < minimum || value > maximum) fail("invalid_argument");+ return value;+}+function textBytes(value: string, limit: number, code: SandboxErrorCode): Uint8Array {+ // Check code units first so an oversized input is not copied just to reject it.+ if (typeof value !== "string" || value.length > limit) fail(code);+ const bytes = encoder.encode(value);+ if (bytes.length > limit) fail(code);+ return bytes;+}+function validPath(path: string): void {+ textBytes(path, 4096, "invalid_argument");+ if (!path || /[\x00-\x1f\x7f]/.test(path)) fail("invalid_argument");+}+function base64(bytes: Uint8Array): string {+ let binary = "";+ for (let i = 0; i < bytes.length; i += 8192) {+ binary += String.fromCharCode(...bytes.subarray(i, i + 8192));+ }+ return btoa(binary);+}+function fromBase64(value: unknown): string {+ if (typeof value !== "string") fail("invalid_response");+ if (value.length > 4 * Math.ceil(FILE_LIMIT / 3)) fail("file_too_large");+ if (!/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(value)) {+ fail("invalid_response");+ }+ let binary: string;+ try { binary = atob(value); } catch { return fail("invalid_response"); }+ if (binary.length > FILE_LIMIT) fail("file_too_large");+ const bytes = new Uint8Array(binary.length);+ for (let i = 0; i < binary.length; i++) bytes[i] = binary.charCodeAt(i);+ try { return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(bytes); }+ catch { return fail("invalid_response"); }+}+function abortable<T>(work: Promise<T>, signal: AbortSignal, reason: () => SandboxError): Promise<T> {+ return new Promise((resolve, reject) => {+ const abort = () => { signal.removeEventListener("abort", abort); reject(reason()); };+ signal.addEventListener("abort", abort, { once: true });+ if (signal.aborted) abort();+ work.then(+ value => { signal.removeEventListener("abort", abort); resolve(value); },+ () => { signal.removeEventListener("abort", abort); reject(signal.aborted ? reason() : new SandboxError("network")); },+ );+ });+}+async function responseBytes(response: Response, signal: AbortSignal, reason: () => SandboxError): Promise<Uint8Array> {+ if (!response.body) return new Uint8Array(0);+ const reader = response.body.getReader();+ const chunks: Uint8Array[] = [];+ let length = 0;+ try {+ while (true) {+ const part = await abortable(reader.read(), signal, reason);+ if (part.done) break;+ length += part.value.byteLength;+ if (length > RESPONSE_LIMIT) fail("response_too_large");+ chunks.push(part.value);+ }+ } catch (error) {+ void reader.cancel().catch(() => {});+ throw error;+ } finally {+ reader.releaseLock();+ }+ const bytes = new Uint8Array(length);+ let offset = 0;+ for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.length; }+ return bytes;+}+interface Reply { status: number; ok: boolean; payload: unknown; empty: boolean }+const endpoint = (id: string) => `/${encodeURIComponent(id)}`;+const check = (reply: Reply) => { if (!reply.ok) throw new SandboxError("http", reply.status); };+function transport(options: CodegraffSandboxAttachOptions) {+ if (!options || typeof options.token !== "string" || options.token.length > 4096 ||+ !/^cg_sk_[A-Za-z0-9_-]+$/.test(options.token) ||+ (options.fetch !== undefined && typeof options.fetch !== "function")) fail("invalid_argument");+ const token = options.token;+ const fetcher = options.fetch ?? globalThis.fetch;+ async function request(+ method: "POST" | "DELETE", path: string, body?: Record<string, unknown>,+ signal?: AbortSignal, milliseconds = REQUEST_MS,+ ): Promise<Reply> {+ if (signal?.aborted) fail("aborted");+ const controller = new AbortController();+ let timedOut = false;+ const reason = () => new SandboxError(timedOut ? "timeout" : "aborted");+ const abort = () => controller.abort();+ signal?.addEventListener("abort", abort, { once: true });+ if (signal?.aborted) abort();+ const timer = setTimeout(() => { timedOut = true; controller.abort(); }, milliseconds);+ try {+ if (controller.signal.aborted) throw reason();+ const headers = new Headers({ authorization: `Bearer ${token}` });+ if (body !== undefined) headers.set("content-type", "application/json");+ // Workers supports manual redirects, not the browser's error mode.+ // Non-2xx replies fail below; bearer credentials never follow redirects.+ const init = {+ method, headers, body: body === undefined ? undefined : JSON.stringify(body),+ signal: controller.signal, redirect: "manual" as const,+ };+ const pending = fetcher(`${ORIGIN}/v1/sandboxes${path}`, init);+ // An injected fetch may ignore abort. Stop waiting anyway and discard late bodies.+ void pending.then(response => {+ if (controller.signal.aborted) void response.body?.cancel().catch(() => {});+ }, () => {});+ const response = await abortable(pending, controller.signal, reason);+ const bytes = await responseBytes(response, controller.signal, reason);+ if (controller.signal.aborted) throw reason();+ let payload: unknown;+ try { payload = JSON.parse(new TextDecoder("utf-8", { fatal: true, ignoreBOM: false }).decode(bytes)); }+ catch { payload = undefined; }+ return { status: response.status, ok: response.ok, payload, empty: bytes.length === 0 };+ } catch (error) {+ if (controller.signal.aborted) throw reason();+ if (error instanceof SandboxError) throw error;+ throw new SandboxError("network");+ } finally {+ clearTimeout(timer);+ signal?.removeEventListener("abort", abort);+ }+ }+ async function remove(id: string, milliseconds = REQUEST_MS): Promise<void> {+ const reply = await request("DELETE", endpoint(id), undefined, undefined, milliseconds);+ if (reply.status !== 404) check(reply);+ }+ return { request, remove };+}+/**+ * Uses only the fixed public HTTPS gateway, with redirects disabled and no retries.+ * The create signal applies only to creation; later calls have their own signals.+ * Requests wait at most 45s (creation 90s, independent cleanup 5s). An exec may+ * keep running after that HTTP deadline; always destroy in a caller-owned finally.+ * Commands: 8 KiB UTF-8; files/output: 64 KiB; streamed response bodies: 128 KiB.+ */+export async function createCodegraffSandbox(options: CodegraffSandboxOptions): Promise<CodegraffSandbox> {+ const api = transport(options);+ const autoStopMinutes = integer(options.autoStopMinutes ?? 5, 1, 30);+ const created = await api.request("POST", "", { provider: "fleet", autoStopMinutes }, options.signal, CREATE_MS);+ const payload = created.payload;+ const id = object(payload) && validId(payload.id) ? payload.id : undefined;+ const attachedId = object(payload) && object(payload.error) && validId(payload.error.sandboxId)+ ? payload.error.sandboxId : undefined;+ const createError = !created.ok ? new SandboxError("http", created.status)+ : !id || (object(payload) && "error" in payload) ? new SandboxError("invalid_response")+ : options.signal?.aborted ? new SandboxError("aborted") : undefined;+ if (createError) {+ // Fleet may allocate successfully and then fail attachment. Never leave that ID+ // billed just because the caller aborted: this DELETE has its own deadline.+ const cleanupId = attachedId ?? id;+ let cleanupFailed = false;+ if (cleanupId) {+ try { await api.remove(cleanupId, CLEANUP_MS); } catch { cleanupFailed = true; }+ }+ throw new SandboxError(createError.code, createError.status, cleanupFailed);+ }+ // The successful create branch above guarantees a validated, path-safe ID.+ return sandboxClient(id as string, api);+}+/** Reattach without HTTP or allocation, e.g. to destroy a stored ID from an alarm. */+export function attachCodegraffSandbox(id: string, options: CodegraffSandboxAttachOptions): CodegraffSandbox {+ if (!validId(id)) fail("invalid_argument");+ return sandboxClient(id, transport(options));+}+function sandboxClient(sandboxId: string, { request, remove }: ReturnType<typeof transport>): CodegraffSandbox {+ let destroyed = false;+ let destroying: Promise<void> | undefined;+ const live = () => { if (destroyed || destroying) fail("destroyed"); };+ return {+ id: sandboxId,+ async exec(command, { signal, timeoutSeconds = 30, cwd = "/tmp" } = {}) {+ live();+ validPath(cwd);+ textBytes(command, COMMAND_LIMIT, "invalid_argument");+ if (!command.trim()) fail("invalid_argument");+ integer(timeoutSeconds, 1, 60);+ const reply = await request("POST", `${endpoint(sandboxId)}/exec`, {+ command, cwd, timeoutSeconds,+ }, signal);+ check(reply);+ const result = reply.payload;+ if (!object(result) || typeof result.exitCode !== "number" || !Number.isSafeInteger(result.exitCode) ||+ typeof result.result !== "string") fail("invalid_response");+ textBytes(result.result, OUTPUT_LIMIT, "output_too_large");+ return { exitCode: result.exitCode, result: result.result };+ },+ async upload(path, text, { signal } = {}) {+ live();+ validPath(path);+ const bytes = textBytes(text, FILE_LIMIT, "file_too_large");+ const reply = await request("POST", `${endpoint(sandboxId)}/upload`, {+ path, contentBase64: base64(bytes),+ }, signal);+ check(reply);+ if (!reply.empty && (!object(reply.payload) || "error" in reply.payload)) fail("invalid_response");+ },+ async download(path, { signal } = {}) {+ live();+ validPath(path);+ const reply = await request("POST", `${endpoint(sandboxId)}/download`, { path }, signal);+ check(reply);+ if (!object(reply.payload)) fail("invalid_response");+ return fromBase64(reply.payload.contentBase64);+ },+ async destroy() {+ if (destroyed) return;+ if (destroying) return destroying;+ destroying = remove(sandboxId).then(() => { destroyed = true; });+ try { await destroying; } finally { destroying = undefined; }+ },+ };+}diff --git a/sdk/ts/worker.ts b/sdk/ts/worker.tsnew file mode 100644index 00000000..d68c74a6--- /dev/null+++ b/sdk/ts/worker.ts@@ -0,0 +1,221 @@+// Experimental isolate-native host. Pass a statically imported WebAssembly.Module.+import type { SpanObserver, TraceSpan } from "./otel.ts";+export interface WorkerTool {+ name: string;+ description: string;+ parameters: Record<string, unknown>;+ /** Must reject malformed/untrusted inputs before execute is called. */+ validate(input: unknown): boolean;+ execute(input: unknown, context: { signal: AbortSignal }): string | Promise<string>;+}+export interface WorkerAgentOptions {+ model: string;+ instructions?: string;+ maxSteps?: number;+ tools?: readonly WorkerTool[];+ /** Full chat-completions URL; HTTPS except explicitly opted-in loopback tests. */+ endpoint: string;+ token?: string;+ fetch?: typeof fetch;+ allowLoopbackHttp?: boolean;+ /** Optional content-free lifecycle observer; never awaited by execution. */+ observe?: SpanObserver;+}+export interface WorkerResult { text: string; modelCalls: number; toolCalls: number }+export interface WorkerAgent {+ prompt(text: string, options?: { signal?: AbortSignal }): Promise<WorkerResult>;+ cancel(): void;+}+type Core = {+ memory: WebAssembly.Memory;+ graff_worker_in_ptr(): number;+ graff_worker_in_cap(): number;+ graff_worker_out_ptr(): number;+ graff_worker_out_len(): number;+ graff_worker_create(len: number): number;+ graff_worker_prompt(len: number): number;+ graff_worker_cancel(): void;+};+type HostCall = (kind: number, ptr: number, len: number, reply: number, cap: number) => Promise<number>;+type Jspi = {+ Suspending: new (fn: HostCall) => NonNullable<Parameters<typeof WebAssembly.instantiate>[1]>[string][string];+ promising(fn: Core["graff_worker_prompt"]): (len: number) => Promise<number>;+};+const encoder = new TextEncoder();+const decoder = new TextDecoder("utf-8", { fatal: true, ignoreBOM: false });+const LIMIT = 1024 * 1024;+const object = (v: unknown): v is Record<string, unknown> => v !== null && typeof v === "object" && !Array.isArray(v);+const aborted = () => new DOMException("Agent cancelled", "AbortError");+function abortable<T>(work: Promise<T>, signal: AbortSignal): Promise<T> {+ return new Promise((resolve, reject) => {+ const abort = () => reject(aborted());+ signal.addEventListener("abort", abort, { once: true });+ if (signal.aborted) abort();+ work.then(resolve, reject).finally(() => signal.removeEventListener("abort", abort));+ });+}+async function responseBytes(response: Response, signal: AbortSignal): Promise<Uint8Array> {+ if (!response.body) throw new Error("Model response has no body");+ const reader = response.body.getReader();+ const chunks: Uint8Array[] = [];+ let length = 0;+ try {+ while (true) {+ const part = await abortable(reader.read(), signal);+ if (part.done) break;+ length += part.value.byteLength;+ if (length > LIMIT) throw new Error("Model response exceeds 1 MiB");+ chunks.push(part.value);+ }+ } catch (error) {+ void reader.cancel().catch(() => {});+ throw error;+ } finally {+ reader.releaseLock();+ }+ const bytes = new Uint8Array(length);+ let offset = 0;+ for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.length; }+ return bytes;+}++/** No native process, filesystem, dynamic compilation, or credential enters Wasm. */+export async function createWorkerAgent(module: WebAssembly.Module, options: WorkerAgentOptions): Promise<WorkerAgent> {+ const jspi = WebAssembly as unknown as Jspi;+ if (typeof jspi.Suspending !== "function" || typeof jspi.promising !== "function") {+ throw new Error("Worker runtime requires WebAssembly JSPI");+ }+ const endpoint = new URL(options.endpoint);+ const loopback = ["localhost", "127.0.0.1", "[::1]"].includes(endpoint.hostname);+ if (endpoint.username || endpoint.password || endpoint.hash ||+ (endpoint.protocol !== "https:" && !(options.allowLoopbackHttp && loopback && endpoint.protocol === "http:"))) {+ throw new Error("Use an explicit HTTPS model endpoint (loopback HTTP requires opt-in)");+ }+ if (!options.model || (options.maxSteps !== undefined &&+ (!Number.isInteger(options.maxSteps) || options.maxSteps < 1 || options.maxSteps > 64))) {+ throw new Error("Model and maxSteps (1..64) are required to be valid");+ }+ const tools = new Map<string, WorkerTool>();+ for (const tool of options.tools ?? []) {+ if (!/^[a-zA-Z0-9_-]{1,64}$/.test(tool.name) || tools.has(tool.name) ||+ typeof tool.validate !== "function" || typeof tool.execute !== "function") throw new Error("Invalid or duplicate tool");+ tools.set(tool.name, tool);+ }+ let core: Core;+ let active: AbortController | undefined;+ let busy = false;+ const host: HostCall = async (kind, ptr, len, reply, cap) => {+ try {+ const signal = active?.signal;+ if (!signal || signal.aborted || len > LIMIT || cap > LIMIT) return -1;+ const raw = decoder.decode(new Uint8Array(core.memory.buffer, ptr, len));+ const request: unknown = JSON.parse(raw);+ let bytes: Uint8Array;+ if (kind === 1) {+ if (!object(request) || request.stream !== false) return -1;+ const headers = new Headers({ "content-type": "application/json" });+ if (options.token) headers.set("authorization", `Bearer ${options.token}`);+ const response = await abortable((options.fetch ?? fetch)(endpoint.href, {+ method: "POST", headers, body: raw, signal, redirect: "manual",+ }), signal);+ if (!response.ok) { void response.body?.cancel().catch(() => {}); return -1; }+ bytes = await responseBytes(response, signal);+ } else if (kind === 2) {+ let result = { text: "Unknown or malformed tool call", is_error: true };+ const tool = object(request) && typeof request.name === "string" ? tools.get(request.name) : undefined;+ if (tool && object(request) && typeof request.id === "string") {+ try {+ if (tool.validate(request.input)) {+ const text = await abortable(Promise.resolve().then(() => {+ if (signal.aborted) throw aborted();+ return tool.execute(request.input, { signal });+ }), signal);+ result = typeof text === "string" ? { text, is_error: false } : { text: "Tool must return text", is_error: true };+ }+ } catch { result = { text: "Tool execution failed", is_error: true }; }+ }+ bytes = encoder.encode(JSON.stringify(result));+ if (bytes.length > LIMIT || bytes.length > cap) {+ bytes = encoder.encode(JSON.stringify({ text: "Tool response exceeds limit", is_error: true }));+ }+ } else return -1;+ if (signal.aborted || bytes.length > cap || bytes.length > LIMIT) return -1;+ // Awaited work may grow Wasm memory: always reacquire the current buffer.+ new Uint8Array(core.memory.buffer, reply, bytes.length).set(bytes);+ return bytes.length;+ } catch { return -1; }+ };+ const instance = await WebAssembly.instantiate(module, { env: { graff_host_call: new jspi.Suspending(host) } });+ core = instance.exports as unknown as Core;+ if (!(core.memory instanceof WebAssembly.Memory) || ["graff_worker_in_ptr", "graff_worker_in_cap",+ "graff_worker_out_ptr", "graff_worker_out_len", "graff_worker_create", "graff_worker_prompt",+ "graff_worker_cancel"].some(name => typeof instance.exports[name] !== "function")) {+ throw new Error("Missing experimental worker ABI exports");+ }+ const write = (text: string) => {+ const bytes = encoder.encode(text);+ if (bytes.length > core.graff_worker_in_cap()) throw new Error("Agent input exceeds Wasm input capacity");+ new Uint8Array(core.memory.buffer, core.graff_worker_in_ptr(), bytes.length).set(bytes);+ return bytes.length;+ };+ const output = (status: number): unknown => {+ const length = core.graff_worker_out_len();+ if (length > LIMIT) throw new Error("Agent output exceeds limit");+ const result: unknown = JSON.parse(decoder.decode(new Uint8Array(core.memory.buffer, core.graff_worker_out_ptr(), length)));+ if (status !== 0 || (object(result) && "error" in result)) throw new Error("Worker engine failed");+ return result;+ };+ const status = core.graff_worker_create(write(JSON.stringify({+ model: options.model, instructions: options.instructions, maxSteps: options.maxSteps ?? 16,+ tools: [...tools.values()].map(tool => ({ type: "function", function: {+ name: tool.name, description: tool.description, parameters: tool.parameters,+ } })),+ })));+ if (status !== 0) throw new Error("Worker engine configuration failed");+ const prompt = jspi.promising(core.graff_worker_prompt);+ const cancel = () => { if (active && !active.signal.aborted) { active.abort(); core.graff_worker_cancel(); } };+ return {+ cancel,+ async prompt(text, { signal } = {}) {+ if (busy) throw new Error("Agent prompt is already running");+ if (signal?.aborted) throw aborted();+ busy = true;+ active = new AbortController();+ signal?.addEventListener("abort", cancel, { once: true });+ let span: TraceSpan | undefined;+ try {+ if (options.observe) {+ try {+ const hex = (bytes: number) => Array.from(crypto.getRandomValues(new Uint8Array(bytes)),+ value => value.toString(16).padStart(2, "0")).join("");+ span = { traceId: hex(16), spanId: hex(8), name: "graff.turn",+ startTimeUnixNano: (BigInt(Date.now()) * 1_000_000n).toString(), endTimeUnixNano: "0",+ status: { code: 2 } };+ } catch { /* Observability cannot prevent a turn. */ }+ }+ const code = await prompt(write(text));+ if (active.signal.aborted) throw aborted();+ const result = output(code);+ if (!object(result) || typeof result.text !== "string" || !Number.isInteger(result.modelCalls) ||+ !Number.isInteger(result.toolCalls)) throw new Error("Malformed engine output");+ if (span) {+ span.status = { code: 1 };+ span.attributes = { "graff.api_calls": result.modelCalls as number };+ }+ return result as unknown as WorkerResult;+ } finally {+ signal?.removeEventListener("abort", cancel);+ active = undefined;+ busy = false;+ if (span) {+ try {+ const end = BigInt(Date.now()) * 1_000_000n;+ span.endTimeUnixNano = (end < BigInt(span.startTimeUnixNano) ? BigInt(span.startTimeUnixNano) : end).toString();+ // Consume rejected observers without awaiting slow or stuck observers.+ void Promise.resolve(options.observe?.(span)).catch(() => {});+ } catch { /* No errors or execution content enter telemetry. */ }+ }+ }+ },+ };+}diff --git a/src/agent_chat_native.zig b/src/agent_chat_native.zignew file mode 100644index 00000000..d2fc55a8--- /dev/null+++ b/src/agent_chat_native.zig@@ -0,0 +1,45 @@+//! Native capabilities around the shared chat step. REPL and ACP both use this+//! adapter through Agent.stepOpenAI; the Worker supplies a capability-only host.+const std = @import("std");+const Agent = @import("agent.zig").Agent;+const ToolCall = @import("tools.zig").ToolCall;+const steps = @import("agent_steps.zig");+const repair_calls = @import("tool_call_repair.zig");+const eval_control = @import("agent_eval_control.zig");++pub fn apiError(self: *Agent, message: []const u8) !void {+ try self.sayApiError("{s}", .{message});+}++pub fn repair(self: *Agent, message: *std.json.Value, limited: bool) !void {+ // Never reconstruct executable arguments from a reply cut mid-output.+ if (limited) return;+ if (@import("effort_route.zig").mimoRoute(self.provider.id, self.provider.model))+ _ = try repair_calls.repairCalls(self.arena, self.scratchAlloc(), message, self.toolsJson());+ if (@import("additional_tools.zig").active(self.provider))+ _ = try repair_calls.retypeArgs(self.arena, self.scratchAlloc(), message, self.toolsJson());+ _ = try repair_calls.recoverInlineCalls(self.arena, self.scratchAlloc(), message, self.toolsJson());+}++pub fn surfaceText(self: *Agent, text: []const u8) !void {+ try steps.surfaceUnstreamedText(self, text);+}++pub fn afterTools(self: *Agent, calls: []const ToolCall, stuck: bool) !?[]const u8 {+ try @import("turn_checkpoint.zig").afterToolBatch(self);+ if (stuck) {+ try self.say("{s}\n", .{repair_calls.loop_stop_text});+ return repair_calls.loop_stop_text;+ }+ if (eval_control.shouldStopAfterBatch(calls, self.eval_repair_pending)) {+ if (try steps.grantRepairTurn(self)) return null;+ return eval_control.verifier_hard_stop;+ }+ if (self.yielded) |handoff| return handoff;+ if (self.completed) |result| return result;+ return null;+}++pub fn stopped(self: *Agent, reason: []const u8) !void {+ try self.say("[stopped: {s}]\n", .{reason});+}diff --git a/src/agent_chat_step.zig b/src/agent_chat_step.zignew file mode 100644index 00000000..0006db78--- /dev/null+++ b/src/agent_chat_step.zig@@ -0,0 +1,116 @@+//! Shared chat-completions step for the native Agent and capability-backed hosts.+//! Host adapters own I/O, repair policy, checkpointing and surface events; message+//! replay, executable-call parsing and the tool/continue decision stay here.+const std = @import("std");+const ToolCall = @import("tools.zig").ToolCall;+const tool_call_args = @import("tool_call_args.zig");+const tool_call_repair = @import("tool_call_repair.zig");++pub fn limited(root: std.json.ObjectMap) bool {+ const choices = root.get("choices") orelse return false;+ if (choices != .array or choices.array.items.len == 0 or choices.array.items[0] != .object) return false;+ const finish = choices.array.items[0].object.get("finish_reason") orelse return false;+ return finish == .string and std.mem.eql(u8, finish.string, "length");+}++fn callCut(gpa: std.mem.Allocator, response_limited: bool, object: std.json.ObjectMap, raw: []const u8) bool {+ const status = object.get("status");+ return (if (status) |v| v == .string and std.mem.eql(u8, v.string, "incomplete") else false) or+ (response_limited and !tool_call_args.isObjectString(gpa, raw));+}++pub fn stripEosSuffix(text: []const u8) []const u8 {+ var t = std.mem.trimEnd(u8, text, " \t\r\n");+ for ([_][]const u8{ "<|eos|>", "<|eot|>", "<|endoftext|>" }) |marker| {+ if (std.mem.endsWith(u8, t, marker)) {+ t = std.mem.trimEnd(u8, t[0 .. t.len - marker.len], " \t\r\n");+ break;+ }+ }+ return t;+}++pub fn step(comptime Host: type, self: anytype, root: std.json.ObjectMap) !?[]const u8 {+ const choices = root.get("choices");+ // #287/#299: same as the anthropic step — the parent only ever sees what+ // sayApiError records, so these three shapes must name themselves.+ if (choices == null or choices.? != .array or choices.?.array.items.len == 0 or choices.?.array.items[0] != .object) {+ try Host.apiError(self, "api error: response had no choices");+ return error.ApiError;+ }+ const choice = choices.?.array.items[0].object;+ var message = choice.get("message") orelse {+ try Host.apiError(self, "api error: choice had no message");+ return error.ApiError;+ };+ try Host.repair(self, &message, limited(root));+ const msg_obj = (if (message == .object) message.object else null) orelse {+ try Host.apiError(self, "api error: choice message was not an object");+ return error.ApiError;+ };+ // A length stop may spend its entire budget reasoning. Chat rejects+ // replaying an assistant with neither content nor tool calls (#1646).+ // Keep real partial answers and tool-call reasoning verbatim; only this+ // empty reply stays out of history, including on budget/cancel exits.+ const has_content = if (msg_obj.get("content")) |c| switch (c) {+ .string => std.mem.trim(u8, c.string, " \t\r\n").len > 0,+ .array => c.array.items.len > 0,+ else => false,+ } else false;+ const has_calls = if (msg_obj.get("tool_calls")) |t| t == .array and t.array.items.len > 0 else false;+ if (limited(root) and !has_content and !has_calls) {+ self.pairContextMeterWithCurrentLocal();+ return "";+ }+ try self.messages.append(message); // echo verbatim (content may be null)++ var final_text: []const u8 = "";+ if (msg_obj.get("content")) |c| if (c == .string and c.string.len > 0) {+ // grok-4.6 structured outputs (response_format) leak a literal+ // sampler end marker after the JSON on the chat wire (#502) — a+ // trailing `<|eos|>` is never legitimate answer text.+ final_text = stripEosSuffix(c.string);+ try Host.surfaceText(self, final_text);+ };++ var calls: std.ArrayList(ToolCall) = .empty;+ defer calls.deinit(self.gpa);+ if (msg_obj.get("tool_calls")) |tcs| if (tcs == .array) {+ for (tcs.array.items) |*tc| { // by pointer: the cut marker is removed in place+ if (tc.* != .object) continue;+ const why = tool_call_args.takeInvalidMark(&tc.object);+ const function = tc.object.get("function") orelse continue;+ if (function != .object) continue;+ const args_str = if (function.object.get("arguments")) |a| (if (a == .string) a.string else "") else "";+ const parsed = tool_call_args.parse(self.scratchAlloc(), args_str); // #124: execution-only tree+ const name = if (function.object.get("name")) |n| (if (n == .string) n.string else "") else "";+ if (name.len == 0) continue; // can't dispatch a nameless call+ const id = if (tc.object.get("id")) |x| (if (x == .string) x.string else "") else "";+ const cut = why == .cut or callCut(self.gpa, limited(root), tc.object, args_str);+ try calls.append(self.gpa, .{ .id = id, .name = name, .input = parsed.input, .args_ok = parsed.valid and why == .none and !cut, .cut = cut });+ }+ };+ tool_call_args.repairMessage(self.gpa, self.arena, &self.messages.items[self.messages.items.len - 1]);+ self.pairContextMeterWithCurrentLocal();++ if (calls.items.len > 0) {+ const results = try self.runTools(calls.items);+ for (calls.items, results) |call, r| {+ const tool_msg = try @import("chat_message.zig").toolResult(self.arena, call.id, r.text, r.is_error);+ try self.messages.append(tool_msg);+ }+ // Judged before the checkpoint, which may append queued images.+ const stuck = tool_call_repair.brokenCallLoop(self.messages.items);+ return Host.afterTools(self, calls.items, stuck);+ }++ // finish_reason is optional on raw provider JSON — some gateways omit it,+ // and the non-streaming subagent path runs stepOpenAI on that raw JSON+ // (the reassembled stream always fills it in, but a subagent/plain body may+ // not). An unconditional `.?` here panicked the whole harness on that input;+ // null-guard it like every other field read in this file (#134 audit P0).+ if (choice.get("finish_reason")) |finish| {+ if (finish == .string and !std.mem.eql(u8, finish.string, "stop") and !limited(root)) try Host.stopped(self, finish.string);+ }+ return final_text;+}diff --git a/src/agent_length.zig b/src/agent_length.zigindex a254f53c..9539ad39 100644--- a/src/agent_length.zig+++ b/src/agent_length.zig@@ -19,11 +19,7 @@ fn str(object: std.json.ObjectMap, key: []const u8) []const u8 {pub fn limited(kind: Kind, root: std.json.ObjectMap) bool {return switch (kind) {.anthropic => std.mem.eql(u8, str(root, "stop_reason"), "max_tokens"),- .openai => blk: {- const choices = root.get("choices") orelse break :blk false;- if (choices != .array or choices.array.items.len == 0 or choices.array.items[0] != .object) break :blk false;- break :blk std.mem.eql(u8, str(choices.array.items[0].object, "finish_reason"), "length");- },+ .openai => @import("agent_chat_step.zig").limited(root),.responses => blk: {// Do not retry content filters or an interrupted stream merely// because they too are marked incomplete.diff --git a/src/agent_steps.zig b/src/agent_steps.zigindex b3d27b5c..2676afd2 100644--- a/src/agent_steps.zig+++ b/src/agent_steps.zig@@ -245,17 +245,7 @@ pub fn stepAnthropic(self: *Agent, root: std.json.ObjectMap) !?[]const u8 {/// Trailing sampler markers some models leak into chat content (grok-4.6/// emits `<|eos|>` after strict-schema JSON — caught by graff-evals).-pub fn stripEosSuffix(text: []const u8) []const u8 {- var t = std.mem.trimEnd(u8, text, " \t\r\n");- for ([_][]const u8{ "<|eos|>", "<|eot|>", "<|endoftext|>" }) |marker| {- if (std.mem.endsWith(u8, t, marker)) {- t = std.mem.trimEnd(u8, t[0 .. t.len - marker.len], " \t\r\n");- break;- }- }- return t;-}-+pub const stripEosSuffix = @import("agent_chat_step.zig").stripEosSuffix;test "stripEosSuffix drops a leaked trailing sampler marker, nothing else" {try std.testing.expectEqualStrings("{\"a\":1}", stripEosSuffix("{\"a\":1}<|eos|>"));try std.testing.expectEqualStrings("{\"a\":1}", stripEosSuffix("{\"a\":1}<|eos|>\n"));@@ -264,110 +254,7 @@ test "stripEosSuffix drops a leaked trailing sampler marker, nothing else" {}pub fn stepOpenAI(self: *Agent, root: std.json.ObjectMap) !?[]const u8 {- const choices = root.get("choices");- // #287/#299: same as the anthropic step — the parent only ever sees what- // sayApiError records, so these three shapes must name themselves.- if (choices == null or choices.? != .array or choices.?.array.items.len == 0 or choices.?.array.items[0] != .object) {- try self.sayApiError("api error: response had no choices", .{});- return error.ApiError;- }- const choice = choices.?.array.items[0].object;- var message = choice.get("message") orelse {- try self.sayApiError("api error: choice had no message", .{});- return error.ApiError;- };- // Never reconstruct executable arguments from a reply cut mid-output.- if (!length.limited(.openai, root)) {- // Lost arguments rebuilt from the reply's own tool-call markup (MiMo only).- if (@import("effort_route.zig").mimoRoute(self.provider.id, self.provider.model))- _ = try tool_call_repair.repairCalls(self.arena, self.scratchAlloc(), &message, self.toolsJson());- // Announced tools come back untyped where the wire types only declared ones (MiMo, Claude).- if (@import("additional_tools.zig").active(self.provider))- _ = try tool_call_repair.retypeArgs(self.arena, self.scratchAlloc(), &message, self.toolsJson());- // #1247: calls the server's parser left in `content` as markup.- _ = try tool_call_repair.recoverInlineCalls(self.arena, self.scratchAlloc(), &message, self.toolsJson());- }- const msg_obj = tools_mod.json_args.object(message) orelse {- try self.sayApiError("api error: choice message was not an object", .{});- return error.ApiError;- };- // A length stop may spend its entire budget reasoning. Chat rejects- // replaying an assistant with neither content nor tool calls (#1646).- // Keep real partial answers and tool-call reasoning verbatim; only this- // empty reply stays out of history, including on budget/cancel exits.- const has_content = if (msg_obj.get("content")) |c| switch (c) {- .string => std.mem.trim(u8, c.string, " \t\r\n").len > 0,- .array => c.array.items.len > 0,- else => false,- } else false;- const has_calls = if (msg_obj.get("tool_calls")) |t| t == .array and t.array.items.len > 0 else false;- if (length.limited(.openai, root) and !has_content and !has_calls) {- self.pairContextMeterWithCurrentLocal();- return "";- }- try self.messages.append(message); // echo verbatim (content may be null)-- var final_text: []const u8 = "";- if (msg_obj.get("content")) |c| if (c == .string and c.string.len > 0) {- // grok-4.6 structured outputs (response_format) leak a literal- // sampler end marker after the JSON on the chat wire (#502) — a- // trailing `<|eos|>` is never legitimate answer text.- final_text = stripEosSuffix(c.string);- try surfaceUnstreamedText(self, final_text);- };-- var calls: std.ArrayList(ToolCall) = .empty;- defer calls.deinit(self.gpa);- if (msg_obj.get("tool_calls")) |tcs| if (tcs == .array) {- for (tcs.array.items) |*tc| { // by pointer: the cut marker is removed in place- if (tc.* != .object) continue;- const why = tool_call_args.takeInvalidMark(&tc.object);- const function = tc.object.get("function") orelse continue;- if (function != .object) continue;- const args_str = if (function.object.get("arguments")) |a| (if (a == .string) a.string else "") else "";- const parsed = tool_call_args.parse(self.scratchAlloc(), args_str); // #124: execution-only tree- const name = if (function.object.get("name")) |n| (if (n == .string) n.string else "") else "";- if (name.len == 0) continue; // can't dispatch a nameless call- const id = if (tc.object.get("id")) |x| (if (x == .string) x.string else "") else "";- const cut = why == .cut or length.callCut(self.gpa, length.limited(.openai, root), tc.object, args_str);- try calls.append(self.gpa, .{ .id = id, .name = name, .input = parsed.input, .args_ok = parsed.valid and why == .none and !cut, .cut = cut });- }- };- tool_call_args.repairMessage(self.gpa, self.arena, &self.messages.items[self.messages.items.len - 1]);- self.pairContextMeterWithCurrentLocal();-- if (calls.items.len > 0) {- const results = try self.runTools(calls.items);- for (calls.items, results) |call, r| {- const tool_msg = try toolResultMessage(self.arena, .openai, call.id, r.text, r.is_error);- try self.messages.append(tool_msg);- }- // Judged before the checkpoint, which may append queued images.- const stuck = tool_call_repair.brokenCallLoop(self.messages.items);- try turn_checkpoint.afterToolBatch(self);- // runTurn returns this text as-is (isLoopStop): no nudge re-opens it.- if (stuck) {- try self.say("{s}\n", .{tool_call_repair.loop_stop_text});- return tool_call_repair.loop_stop_text;- }- if (eval_control.shouldStopAfterBatch(calls.items, self.eval_repair_pending)) {- if (try grantRepairTurn(self)) return null;- return eval_control.verifier_hard_stop;- }- if (self.yielded) |handoff| return handoff;- if (self.completed) |result| return result;- return null;- }-- // finish_reason is optional on raw provider JSON — some gateways omit it,- // and the non-streaming subagent path runs stepOpenAI on that raw JSON- // (the reassembled stream always fills it in, but a subagent/plain body may- // not). An unconditional `.?` here panicked the whole harness on that input;- // null-guard it like every other field read in this file (#134 audit P0).- if (choice.get("finish_reason")) |finish| {- if (finish == .string and !std.mem.eql(u8, finish.string, "stop") and !length.limited(.openai, root)) try self.say("[stopped: {s}]\n", .{finish.string});- }- return final_text;+ return @import("agent_chat_step.zig").step(@import("agent_chat_native.zig"), self, root);}/// One turn's response, handed to the step function for this wire.diff --git a/src/chat_message.zig b/src/chat_message.zignew file mode 100644index 00000000..fb0b2db2--- /dev/null+++ b/src/chat_message.zig@@ -0,0 +1,13 @@+//! Chat tool-result construction shared by the native and capability-backed core.+const std = @import("std");++pub fn toolResult(arena: std.mem.Allocator, call_id: []const u8, raw: []const u8, is_error: bool) !std.json.Value {+ const messages = @import("messages.zig");+ const text = if (raw.len == 0) messages.empty_result else messages.sanitizeUtf8(arena, raw);+ var obj: std.json.ObjectMap = .empty;+ try obj.put(arena, "role", .{ .string = "tool" });+ try obj.put(arena, "tool_call_id", .{ .string = call_id });+ const body = if (is_error) try std.fmt.allocPrint(arena, "[error] {s}", .{text}) else text;+ try obj.put(arena, "content", .{ .string = body });+ return .{ .object = obj };+}diff --git a/src/messages.zig b/src/messages.zigindex f8a5d0aa..304107c5 100644--- a/src/messages.zig+++ b/src/messages.zig@@ -98,15 +98,7 @@ pub fn toolResultMessage(arena: Allocator, kind: Provider.Kind, call_id: []consttry obj.put(arena, "content", .{ .string = text });if (is_error) try obj.put(arena, "is_error", .{ .bool = true });},- .openai => {- try obj.put(arena, "role", .{ .string = "tool" });- try obj.put(arena, "tool_call_id", .{ .string = call_id });- const body = if (is_error)- try std.fmt.allocPrint(arena, "[error] {s}", .{text})- else- text;- try obj.put(arena, "content", .{ .string = body });- },+ .openai => return @import("chat_message.zig").toolResult(arena, call_id, text, is_error),.responses => {try obj.put(arena, "type", .{ .string = "function_call_output" });try obj.put(arena, "call_id", .{ .string = call_id });diff --git a/src/tool_call_repair_tests.zig b/src/tool_call_repair_tests.zigindex 718782b2..c4263e91 100644--- a/src/tool_call_repair_tests.zig+++ b/src/tool_call_repair_tests.zig@@ -260,7 +260,13 @@ test "brokenCallLoop: three all-unusable batches in a row, not two or a mixed ontest "brokenCallLoop stop runs the batch checkpoint, then ends the turn past every nudge" {const steps = @embedFile("agent_steps.zig");const step = steps[std.mem.indexOf(u8, steps, "pub fn stepOpenAI").?..];- try std.testing.expect(std.mem.indexOf(u8, step, "turn_checkpoint.afterToolBatch(self)").? < std.mem.indexOf(u8, step, "return tool_call_repair.loop_stop_text").?);+ try std.testing.expect(std.mem.indexOf(u8, step, "step(@import(\"agent_chat_native.zig\"), self, root)") != null);+ const shared = @embedFile("agent_chat_step.zig");+ try std.testing.expect(std.mem.indexOf(u8, shared, "Host.afterTools(self, calls.items, stuck)") != null);+ const native = @embedFile("agent_chat_native.zig");+ const checkpoint = std.mem.indexOf(u8, native, "@import(\"turn_checkpoint.zig\").afterToolBatch(self)") orelse return error.TestUnexpectedResult;+ const stop = std.mem.indexOf(u8, native, "return repair_calls.loop_stop_text") orelse return error.TestUnexpectedResult;+ try std.testing.expect(checkpoint < stop);const agent = @embedFile("agent_turn.zig");const loop = agent[std.mem.indexOf(u8, agent, "pub fn run(").?..];try std.testing.expect(std.mem.indexOf(u8, loop, "endsTurn(").? < std.mem.indexOf(u8, loop, "bounced_answer.retry(").?);diff --git a/src/wasm_worker_main.zig b/src/wasm_worker_main.zignew file mode 100644index 00000000..17b9fefe--- /dev/null+++ b/src/wasm_worker_main.zig@@ -0,0 +1,101 @@+//! JSPI capability ABI for a Worker-native Graff chat turn.+//! Build: zig build wasm-worker. Deliberately separate from the echo ACP ABI.+const std = @import("std");+const core = @import("worker_agent.zig");++const input_cap = 64 * 1024;+const output_cap = 1024 * 1024;+const heap_cap = 16 * 1024 * 1024;+var input: [input_cap]u8 = undefined;+var output: [output_cap]u8 = undefined;+var output_len: usize = 0;+var reply: [output_cap]u8 = undefined;+var heap: [heap_cap]u8 = undefined;+var fba = std.heap.FixedBufferAllocator.init(&heap);+var agent: ?core.Agent = null;+var cancelled = false;+var busy = false;+var failed = false;++extern "env" fn graff_host_call(kind: u32, ptr: [*]const u8, len: usize, out: [*]u8, cap: usize) i32;++pub fn panic(_: []const u8, _: ?*std.builtin.StackTrace, _: ?usize) noreturn {+ @trap();+}++fn hostCall(kind: u32, request: []const u8) ![]const u8 {+ if (cancelled) return error.Interrupted;+ if (request.len > output_cap) return error.RequestTooLarge;+ const n = graff_host_call(kind, request.ptr, request.len, &reply, reply.len);+ if (cancelled) return error.Interrupted;+ if (n < 0) return error.HostCallFailed;+ if (n > reply.len) return error.ResponseTooLarge;+ return reply[0..@intCast(n)];+}++fn report(value: anytype) i32 {+ var writer: std.Io.Writer = .fixed(&output);+ std.json.Stringify.value(value, .{}, &writer) catch {+ const fallback = "{\"error\":\"OutputTooLarge\"}";+ @memcpy(output[0..fallback.len], fallback);+ output_len = fallback.len;+ return -1;+ };+ output_len = writer.buffered().len;+ return 0;+}++fn failure(err: anyerror) i32 {+ _ = report(.{ .@"error" = @errorName(err) });+ return -1;+}++export fn graff_worker_in_ptr() [*]u8 {+ return &input;+}+export fn graff_worker_in_cap() usize {+ return input.len;+}+export fn graff_worker_out_ptr() [*]const u8 {+ return &output;+}+export fn graff_worker_out_len() usize {+ return output_len;+}+export fn graff_worker_cancel() void {+ cancelled = true;+}++export fn graff_worker_create(len: usize) i32 {+ if (busy) return failure(error.Busy);+ agent = null;+ failed = false;+ cancelled = false;+ output_len = 0;+ fba.reset();+ if (len > input.len) return failure(error.InputTooLarge);+ const a = fba.allocator();+ const config = std.json.parseFromSliceLeaky(std.json.Value, a, input[0..len], .{ .allocate = .alloc_always }) catch |err| return failure(err);+ agent = core.Agent.init(a, config, hostCall, &cancelled) catch |err| return failure(err);+ return 0;+}++export fn graff_worker_prompt(len: usize) i32 {+ if (busy) return failure(error.Busy);+ if (failed) return failure(error.SessionFailed);+ if (len > input.len) return failure(error.InputTooLarge);+ if (agent) |*a| {+ busy = true;+ defer busy = false;+ const result = a.prompt(input[0..len]) catch |err| {+ // Partial tool batches must never be replayed implicitly after an+ // uncertain transport failure. A fresh create starts a new session.+ failed = true;+ return failure(err);+ };+ const status = report(result);+ if (status != 0) failed = true;+ return status;+ }+ return failure(error.NotInitialized);+}diff --git a/src/worker_agent.zig b/src/worker_agent.zignew file mode 100644index 00000000..74f6c805--- /dev/null+++ b/src/worker_agent.zig@@ -0,0 +1,170 @@+//! Experimental capability-backed host for Graff's shared chat step.+//! No sockets, files, processes or threads: the embedding host supplies model+//! and tool I/O, while Zig owns history, call validation and loop progression.+const std = @import("std");+const Value = std.json.Value;+const Allocator = std.mem.Allocator;+const chat = @import("agent_chat_step.zig");+const args = @import("tool_call_args.zig");+const ToolCall = @import("tools.zig").ToolCall;++pub const HostCall = *const fn (kind: u32, request: []const u8) anyerror![]const u8;+pub const Result = struct { text: []const u8, modelCalls: u32, toolCalls: u32 };+const ToolResult = struct { text: []const u8, is_error: bool };++pub const Agent = struct {+ gpa: Allocator,+ arena: Allocator,+ messages: std.json.Array,+ model: []const u8,+ tools: Value,+ max_steps: u32,+ host_call: HostCall,+ cancelled: *bool,+ model_calls: u32 = 0,+ tool_calls: u32 = 0,++ pub fn init(a: Allocator, config: Value, host_call: HostCall, cancelled: *bool) !Agent {+ if (config != .object) return error.InvalidConfig;+ const model = string(config, "model") orelse return error.InvalidModel;+ if (model.len == 0 or model.len > 256) return error.InvalidModel;+ const tools = config.object.get("tools") orelse Value{ .array = std.json.Array.init(a) };+ if (tools != .array or tools.array.items.len > 64) return error.InvalidTools;+ for (tools.array.items, 0..) |tool, i| {+ const function = field(tool, "function") orelse return error.InvalidTools;+ const name = string(function, "name") orelse return error.InvalidTools;+ const typ = string(tool, "type") orelse return error.InvalidTools;+ if (!std.mem.eql(u8, typ, "function") or name.len == 0 or name.len > 128) return error.InvalidTools;+ const parameters = field(function, "parameters") orelse return error.InvalidTools;+ if (parameters != .object) return error.InvalidTools;+ for (tools.array.items[0..i]) |prior| {+ if (std.mem.eql(u8, string(field(prior, "function").?, "name").?, name)) return error.DuplicateTool;+ }+ }+ var max_steps: u32 = 16;+ if (config.object.get("maxSteps")) |v| {+ if (v != .integer or v.integer < 1 or v.integer > 64) return error.InvalidStepLimit;+ max_steps = @intCast(v.integer);+ }+ var messages = std.json.Array.init(a);+ if (config.object.get("instructions")) |v| {+ if (v != .string) return error.InvalidInstructions;+ if (v.string.len > 0) try messages.append(try @import("messages.zig").textMessage(a, "system", v.string));+ }+ return .{ .gpa = a, .arena = a, .messages = messages, .model = model, .tools = tools, .max_steps = max_steps, .host_call = host_call, .cancelled = cancelled };+ }++ pub fn prompt(self: *Agent, text: []const u8) !Result {+ if (text.len == 0 or !std.unicode.utf8ValidateSlice(text)) return error.InvalidPrompt;+ const models_before = self.model_calls;+ const tools_before = self.tool_calls;+ try self.messages.append(try @import("messages.zig").textMessage(self.arena, "user", text));+ for (0..self.max_steps) |_| {+ try self.checkCancelled();+ const request = try std.json.Stringify.valueAlloc(self.arena, .{+ .model = self.model,+ .messages = self.messages.items,+ .tools = self.tools,+ .stream = false,+ }, .{});+ self.model_calls += 1;+ const raw = try self.host_call(1, request);+ try self.checkCancelled();+ const root = try std.json.parseFromSliceLeaky(Value, self.arena, raw, .{ .allocate = .alloc_always });+ if (root != .object or root.object.contains("error")) return error.ModelError;+ // A bounded first slice: never call a partial completion successful.+ // Native length continuations remain in Agent.runTurn; until those+ // are host-independent, report this boundary rather than fake parity.+ if (chat.limited(root.object)) return error.OutputLengthExceeded;+ const choices = root.object.get("choices") orelse return error.InvalidModelResponse;+ if (choices != .array or choices.array.items.len == 0) return error.InvalidModelResponse;+ const choice = choices.array.items[0];+ const finish = string(choice, "finish_reason") orelse return error.IncompleteResponse;+ const message = field(choice, "message") orelse return error.InvalidModelResponse;+ const role = string(message, "role") orelse return error.InvalidModelResponse;+ if (!std.mem.eql(u8, role, "assistant")) return error.InvalidModelResponse;+ if (!std.mem.eql(u8, finish, "stop") and !std.mem.eql(u8, finish, "tool_calls")) return error.IncompleteResponse;+ if (std.mem.eql(u8, finish, "tool_calls")) {+ const calls = field(message, "tool_calls") orelse return error.InvalidModelResponse;+ if (calls != .array or calls.array.items.len == 0) return error.InvalidModelResponse;+ }+ const done = try chat.step(Host, self, root.object);+ if (done) |final_text| {+ if (std.mem.trim(u8, final_text, " \t\r\n").len == 0) return error.EmptyCompletion;+ return .{ .text = final_text, .modelCalls = self.model_calls - models_before, .toolCalls = self.tool_calls - tools_before };+ }+ }+ return error.StepLimitExceeded;+ }++ pub fn scratchAlloc(self: *Agent) Allocator {+ return self.arena;+ }++ pub fn pairContextMeterWithCurrentLocal(_: *Agent) void {}++ pub fn checkCancelled(self: *Agent) !void {+ if (self.cancelled.*) return error.Interrupted;+ }++ fn declared(self: *Agent, name: []const u8) bool {+ for (self.tools.array.items) |tool| {+ const function = field(tool, "function").?;+ if (std.mem.eql(u8, string(function, "name").?, name)) return true;+ }+ return false;+ }++ pub fn runTools(self: *Agent, calls: []const ToolCall) ![]ToolResult {+ if (calls.len > 32 or self.tool_calls + calls.len > 128) return error.ToolLimitExceeded;+ // Validate the entire batch before any effect, including call identity.+ for (calls, 0..) |call, i| {+ if (call.id.len == 0 or call.id.len > 256) return error.InvalidCallId;+ for (calls[0..i]) |prior| if (std.mem.eql(u8, call.id, prior.id)) return error.DuplicateCallId;+ }+ const results = try self.arena.alloc(ToolResult, calls.len);+ for (calls, results) |call, *result| {+ try self.checkCancelled();+ if (!call.args_ok) {+ result.* = .{ .text = if (call.cut) args.cut_exec_message else args.invalid_exec_message, .is_error = true };+ continue;+ }+ if (!self.declared(call.name)) {+ result.* = .{ .text = "tool is not registered by this host", .is_error = true };+ continue;+ }+ const request = try std.json.Stringify.valueAlloc(self.arena, .{ .id = call.id, .name = call.name, .input = call.input }, .{});+ self.tool_calls += 1;+ const raw = try self.host_call(2, request);+ try self.checkCancelled();+ const value = try std.json.parseFromSliceLeaky(Value, self.arena, raw, .{ .allocate = .alloc_always });+ const text = string(value, "text") orelse return error.InvalidToolResult;+ const is_error = field(value, "is_error") orelse return error.InvalidToolResult;+ if (is_error != .bool) return error.InvalidToolResult;+ result.* = .{ .text = text, .is_error = is_error.bool };+ }+ return results;+ }+};++fn field(value: Value, key: []const u8) ?Value {+ return if (value == .object) value.object.get(key) else null;+}++fn string(value: Value, key: []const u8) ?[]const u8 {+ const v = field(value, key) orelse return null;+ return if (v == .string) v.string else null;+}++const Host = struct {+ pub fn apiError(_: *Agent, _: []const u8) !void {}+ pub fn repair(_: *Agent, _: *Value, _: bool) !void {}+ pub fn surfaceText(_: *Agent, _: []const u8) !void {}+ pub fn afterTools(_: *Agent, _: []const ToolCall, stuck: bool) !?[]const u8 {+ if (stuck) return error.BrokenCallLoop;+ return null;+ }+ pub fn stopped(_: *Agent, _: []const u8) !void {+ return error.IncompleteResponse;+ }+};