diff --git a/.github/workflows/evals.yml b/.github/workflows/evals.yml
new file mode 100644
index 00000000..503843e5
--- /dev/null
+++ b/.github/workflows/evals.yml
@@ -0,0 +1,28 @@
+name: Evals
+on:
+ push:
+
+jobs:
+ test:
+ runs-on: ubuntu-24.04
+ strategy:
+ matrix:
+ node-version: [22]
+ steps:
+ - uses: actions/checkout@v4
+ - name: Install pnpm
+ uses: pnpm/action-setup@v4
+ with:
+ version: 10.8.0
+ - name: Use Node.js ${{ matrix.node-version }}
+ uses: actions/setup-node@v4
+ with:
+ node-version: ${{ matrix.node-version }}
+ cache: 'pnpm'
+ - name: Create .dev.vars file
+ run: |
+ echo "OPENAI_API_KEY=${{ secrets.OPENAI_API_KEY }}" > ./apps/sandbox-container/.dev.vars
+ - name: Install dependencies
+ run: pnpm install
+ - name: Run evals
+ run: pnpm eval
diff --git a/apps/sandbox-container/evals/env.d.ts b/apps/sandbox-container/evals/env.d.ts
new file mode 100644
index 00000000..d145fc73
--- /dev/null
+++ b/apps/sandbox-container/evals/env.d.ts
@@ -0,0 +1,3 @@
+declare module 'cloudflare:test' {
+ interface ProvidedEnv extends Env {}
+}
diff --git a/apps/sandbox-container/evals/initialize.eval.ts b/apps/sandbox-container/evals/initialize.eval.ts
new file mode 100644
index 00000000..c5743747
--- /dev/null
+++ b/apps/sandbox-container/evals/initialize.eval.ts
@@ -0,0 +1,25 @@
+import { MCPClientManager } from 'agents/mcp/client'
+import { generateText, tool, ToolExecutionOptions, ToolSet } from 'ai'
+import { describeEval } from 'vitest-evals'
+
+import { checkFactuality } from '@repo/eval-tools/src/scorers'
+import { eachModel } from '@repo/eval-tools/src/test-models'
+
+import { runTask } from './utils'
+
+eachModel('$modelName', ({ model }) => {
+ describeEval('Runs container initialize', {
+ data: async () => [
+ {
+ input: 'create and ping a container',
+ expected:
+ 'The container_initialize tool was called and then the container_ping tool was called',
+ },
+ ],
+ task: async (input) => {
+ return await runTask(model, input)
+ },
+ scorers: [checkFactuality],
+ threshold: 1,
+ })
+})
diff --git a/apps/sandbox-container/evals/utils.ts b/apps/sandbox-container/evals/utils.ts
new file mode 100644
index 00000000..5d92a153
--- /dev/null
+++ b/apps/sandbox-container/evals/utils.ts
@@ -0,0 +1,58 @@
+import { jsonSchemaToZod } from '@n8n/json-schema-to-zod'
+import { MCPClientManager } from 'agents/mcp/client'
+import { LanguageModelV1, streamText, tool, ToolSet } from 'ai'
+
+import type { JsonSchemaObject } from '@n8n/json-schema-to-zod'
+
+export async function runTask(model: LanguageModelV1, input: string) {
+ const clientManager = new MCPClientManager('test-client', '0.0.0')
+ await clientManager.connect('http://localhost:8787/sse')
+
+ const tools = clientManager.listTools()
+ const toolSet: ToolSet = tools.reduce((acc, v) => {
+ acc[v.name] = tool({
+ parameters: jsonSchemaToZod(v.inputSchema as JsonSchemaObject),
+ description: v.description,
+ execute: async (args, opts) => {
+ const res = await clientManager.callTool(v, args, { signal: opts.abortSignal })
+ console.log(res.toolResult)
+ return res.content
+ },
+ })
+ return acc
+ }, {} as ToolSet)
+
+ const res = streamText({
+ model,
+ system:
+ "You are an assistant responsible for evaluating the results of calling various tools. Given the user's query, use the tools available to you to answer the question.",
+ tools: toolSet,
+ prompt: input,
+ maxRetries: 1,
+ maxSteps: 10,
+ })
+
+ for await (const part of res.fullStream) {
+ }
+
+ // convert into an LLM readable result so our factuality checker can validate tool calls
+ let messagesWithTools = ''
+ const messages = (await res.response).messages
+ for (const message of messages) {
+ console.log(message.content)
+ for (const messagePart of message.content) {
+ if (typeof messagePart === 'string') {
+ messagesWithTools += `${messagePart}`
+ } else if (messagePart.type === 'tool-call') {
+ messagesWithTools += `
+ ${messagePart.toolName}
+ ${JSON.stringify(messagePart.args)}
+`
+ } else if (messagePart.type === 'text') {
+ messagesWithTools += `${messagePart.text}`
+ }
+ }
+ }
+
+ return messagesWithTools
+}
diff --git a/apps/sandbox-container/package.json b/apps/sandbox-container/package.json
index 92fcbd6d..97f1cb15 100644
--- a/apps/sandbox-container/package.json
+++ b/apps/sandbox-container/package.json
@@ -12,28 +12,35 @@
"start:container": "tsx container/index.ts",
"postinstall": "mkdir -p workdir",
"test": "vitest",
- "types": "wrangler types"
+ "types": "wrangler types",
+ "eval:dev": "concurrently \"npm run dev\" \"vitest --config vitest.config.evals.ts\"",
+ "eval": "concurrently \"npm run dev\" \"vitest run --config vitest.config.evals.ts\""
},
"dependencies": {
"@cloudflare/workers-oauth-provider": "0.0.2",
"@cloudflare/workers-types": "^4.20250320.0",
"@hono/node-server": "^1.13.8",
"@hono/zod-validator": "^0.4.3",
- "@modelcontextprotocol/sdk": "^1.7.0",
+ "@modelcontextprotocol/sdk": "^1.9.0",
+ "@n8n/json-schema-to-zod": "^1.1.0",
+ "@repo/eval-tools": "workspace:*",
+ "@repo/mcp-common": "workspace:*",
"@types/node": "^22.13.10",
- "agents": "^0.0.42",
+ "agents": "^0.0.60",
"cron-schedule": "^5.0.4",
"esbuild": "^0.25.1",
"hono": "^4.7.5",
"mime": "^4.0.6",
"octokit": "^4.1.2",
"partyserver": "^0.0.65",
+ "simple-git-hooks": "^2.12.1",
"tsx": "^4.19.3",
+ "vitest-evals": "^0.1.4",
"workers-mcp": "0.1.0-3",
- "zod": "^3.24.2",
- "@repo/mcp-common": "workspace:*"
+ "zod": "^3.24.2"
},
"devDependencies": {
+ "ai": "^4.3.6",
"concurrently": "^9.1.2",
"wrangler": "^4.9.1"
}
diff --git a/apps/sandbox-container/server/index.ts b/apps/sandbox-container/server/index.ts
index 8e1d0271..86c3d76c 100644
--- a/apps/sandbox-container/server/index.ts
+++ b/apps/sandbox-container/server/index.ts
@@ -17,6 +17,8 @@ export type Env = {
CONTAINER_MCP_AGENT: DurableObjectNamespace
CONTAINER_MANAGER: DurableObjectNamespace
ENVIRONMENT: 'dev' | 'prod'
+ CLOUDFLARE_CLIENT_ID: string
+ CLOUDFLARE_CLIENT_SECRET: string
}
// Context from the auth process, encrypted & stored in the auth token
diff --git a/apps/sandbox-container/tsconfig.json b/apps/sandbox-container/tsconfig.json
index 5a7abc8f..b4288356 100644
--- a/apps/sandbox-container/tsconfig.json
+++ b/apps/sandbox-container/tsconfig.json
@@ -1,16 +1,5 @@
{
- "compilerOptions": {
- "target": "ESNext",
- "lib": ["ESNext", "DOM"],
- "jsx": "react-jsx",
- "module": "ESNext",
- "moduleResolution": "bundler",
- "types": ["./worker-configuration.d.ts", "@cloudflare/workers-types/2023-07-01"],
- "noEmit": true,
- "esModuleInterop": true,
- "forceConsistentCasingInFileNames": true,
- "strict": true,
- "skipLibCheck": true
- },
- "include": ["server/**.ts", "shared/**.ts"]
+ "extends": "@repo/typescript-config/workers.json",
+ "include": ["*/**.ts", "./vitest.config.evals.ts"],
+ "exclude": ["container/**.ts"]
}
diff --git a/apps/sandbox-container/vitest.config.evals.ts b/apps/sandbox-container/vitest.config.evals.ts
new file mode 100644
index 00000000..7fda49c4
--- /dev/null
+++ b/apps/sandbox-container/vitest.config.evals.ts
@@ -0,0 +1,13 @@
+import { defineWorkersConfig } from '@cloudflare/vitest-pool-workers/config'
+
+export default defineWorkersConfig({
+ test: {
+ include: ['**/*.eval.?(c|m)[jt]s?(x)'],
+ poolOptions: {
+ workers: {
+ isolatedStorage: true,
+ wrangler: { configPath: './wrangler.jsonc' },
+ },
+ },
+ },
+})
diff --git a/apps/sandbox-container/worker-configuration.d.ts b/apps/sandbox-container/worker-configuration.d.ts
index b9445b2d..8b80d824 100644
--- a/apps/sandbox-container/worker-configuration.d.ts
+++ b/apps/sandbox-container/worker-configuration.d.ts
@@ -1,15 +1,23 @@
-// Generated by Wrangler by running `wrangler types` (hash: 2b4a6391bbe56f7074b76ffcd61c2c2f)
-// Runtime types generated with workerd@1.20250409.0 2025-04-03
+// Generated by Wrangler by running `wrangler types` (hash: 8685326fc47540fd37a57785cae8cc91)
+// Runtime types generated with workerd@1.20250409.0 2025-04-03 nodejs_compat
declare namespace Cloudflare {
interface Env {
- OAUTH_KV: KVNamespace
- CONTAINER_MCP_AGENT: DurableObjectNamespace
- CONTAINER_MANAGER: DurableObjectNamespace
- CLOUDFLARE_CLIENT_ID: string
- CLOUDFLARE_CLIENT_SECRET: string
+ OAUTH_KV: KVNamespace;
+ CLOUDFLARE_CLIENT_ID: "";
+ CLOUDFLARE_CLIENT_SECRET: "";
+ OPENAI_API_KEY: string;
+ CONTAINER_MCP_AGENT: DurableObjectNamespace;
+ CONTAINER_MANAGER: DurableObjectNamespace;
+ AI: Ai;
}
}
interface Env extends Cloudflare.Env {}
+type StringifyValues> = {
+ [Binding in keyof EnvType]: EnvType[Binding] extends string ? EnvType[Binding] : string;
+};
+declare namespace NodeJS {
+ interface ProcessEnv extends StringifyValues> {}
+}
// Begin runtime types
/*! *****************************************************************************
@@ -28,183 +36,172 @@ and limitations under the License.
***************************************************************************** */
/* eslint-disable */
// noinspection JSUnusedGlobalSymbols
-declare var onmessage: never
+declare var onmessage: never;
/**
* An abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException)
*/
declare class DOMException extends Error {
- constructor(message?: string, name?: string)
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
- readonly message: string
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
- readonly name: string
- /**
- * @deprecated
- *
- * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
- */
- readonly code: number
- static readonly INDEX_SIZE_ERR: number
- static readonly DOMSTRING_SIZE_ERR: number
- static readonly HIERARCHY_REQUEST_ERR: number
- static readonly WRONG_DOCUMENT_ERR: number
- static readonly INVALID_CHARACTER_ERR: number
- static readonly NO_DATA_ALLOWED_ERR: number
- static readonly NO_MODIFICATION_ALLOWED_ERR: number
- static readonly NOT_FOUND_ERR: number
- static readonly NOT_SUPPORTED_ERR: number
- static readonly INUSE_ATTRIBUTE_ERR: number
- static readonly INVALID_STATE_ERR: number
- static readonly SYNTAX_ERR: number
- static readonly INVALID_MODIFICATION_ERR: number
- static readonly NAMESPACE_ERR: number
- static readonly INVALID_ACCESS_ERR: number
- static readonly VALIDATION_ERR: number
- static readonly TYPE_MISMATCH_ERR: number
- static readonly SECURITY_ERR: number
- static readonly NETWORK_ERR: number
- static readonly ABORT_ERR: number
- static readonly URL_MISMATCH_ERR: number
- static readonly QUOTA_EXCEEDED_ERR: number
- static readonly TIMEOUT_ERR: number
- static readonly INVALID_NODE_TYPE_ERR: number
- static readonly DATA_CLONE_ERR: number
- get stack(): any
- set stack(value: any)
+ constructor(message?: string, name?: string);
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/message) */
+ readonly message: string;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/name) */
+ readonly name: string;
+ /**
+ * @deprecated
+ *
+ * [MDN Reference](https://developer.mozilla.org/docs/Web/API/DOMException/code)
+ */
+ readonly code: number;
+ static readonly INDEX_SIZE_ERR: number;
+ static readonly DOMSTRING_SIZE_ERR: number;
+ static readonly HIERARCHY_REQUEST_ERR: number;
+ static readonly WRONG_DOCUMENT_ERR: number;
+ static readonly INVALID_CHARACTER_ERR: number;
+ static readonly NO_DATA_ALLOWED_ERR: number;
+ static readonly NO_MODIFICATION_ALLOWED_ERR: number;
+ static readonly NOT_FOUND_ERR: number;
+ static readonly NOT_SUPPORTED_ERR: number;
+ static readonly INUSE_ATTRIBUTE_ERR: number;
+ static readonly INVALID_STATE_ERR: number;
+ static readonly SYNTAX_ERR: number;
+ static readonly INVALID_MODIFICATION_ERR: number;
+ static readonly NAMESPACE_ERR: number;
+ static readonly INVALID_ACCESS_ERR: number;
+ static readonly VALIDATION_ERR: number;
+ static readonly TYPE_MISMATCH_ERR: number;
+ static readonly SECURITY_ERR: number;
+ static readonly NETWORK_ERR: number;
+ static readonly ABORT_ERR: number;
+ static readonly URL_MISMATCH_ERR: number;
+ static readonly QUOTA_EXCEEDED_ERR: number;
+ static readonly TIMEOUT_ERR: number;
+ static readonly INVALID_NODE_TYPE_ERR: number;
+ static readonly DATA_CLONE_ERR: number;
+ get stack(): any;
+ set stack(value: any);
}
type WorkerGlobalScopeEventMap = {
- fetch: FetchEvent
- scheduled: ScheduledEvent
- queue: QueueEvent
- unhandledrejection: PromiseRejectionEvent
- rejectionhandled: PromiseRejectionEvent
-}
+ fetch: FetchEvent;
+ scheduled: ScheduledEvent;
+ queue: QueueEvent;
+ unhandledrejection: PromiseRejectionEvent;
+ rejectionhandled: PromiseRejectionEvent;
+};
declare abstract class WorkerGlobalScope extends EventTarget {
- EventTarget: typeof EventTarget
+ EventTarget: typeof EventTarget;
}
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console) */
interface Console {
- 'assert'(condition?: boolean, ...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
- clear(): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
- count(label?: string): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countreset_static) */
- countReset(label?: string): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
- debug(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
- dir(item?: any, options?: any): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
- dirxml(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
- error(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
- group(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupcollapsed_static) */
- groupCollapsed(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupend_static) */
- groupEnd(): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
- info(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
- log(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
- table(tabularData?: any, properties?: string[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
- time(label?: string): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeend_static) */
- timeEnd(label?: string): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timelog_static) */
- timeLog(label?: string, ...data: any[]): void
- timeStamp(label?: string): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
- trace(...data: any[]): void
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
- warn(...data: any[]): void
-}
-declare const console: Console
-type BufferSource = ArrayBufferView | ArrayBuffer
-type TypedArray =
- | Int8Array
- | Uint8Array
- | Uint8ClampedArray
- | Int16Array
- | Uint16Array
- | Int32Array
- | Uint32Array
- | Float32Array
- | Float64Array
- | BigInt64Array
- | BigUint64Array
+ "assert"(condition?: boolean, ...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/clear_static) */
+ clear(): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/count_static) */
+ count(label?: string): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/countreset_static) */
+ countReset(label?: string): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/debug_static) */
+ debug(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dir_static) */
+ dir(item?: any, options?: any): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/dirxml_static) */
+ dirxml(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/error_static) */
+ error(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/group_static) */
+ group(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupcollapsed_static) */
+ groupCollapsed(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/groupend_static) */
+ groupEnd(): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/info_static) */
+ info(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/log_static) */
+ log(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/table_static) */
+ table(tabularData?: any, properties?: string[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/time_static) */
+ time(label?: string): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timeend_static) */
+ timeEnd(label?: string): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/timelog_static) */
+ timeLog(label?: string, ...data: any[]): void;
+ timeStamp(label?: string): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/trace_static) */
+ trace(...data: any[]): void;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/console/warn_static) */
+ warn(...data: any[]): void;
+}
+declare const console: Console;
+type BufferSource = ArrayBufferView | ArrayBuffer;
+type TypedArray = Int8Array | Uint8Array | Uint8ClampedArray | Int16Array | Uint16Array | Int32Array | Uint32Array | Float32Array | Float64Array | BigInt64Array | BigUint64Array;
declare namespace WebAssembly {
- class CompileError extends Error {
- constructor(message?: string)
- }
- class RuntimeError extends Error {
- constructor(message?: string)
- }
- type ValueType = 'anyfunc' | 'externref' | 'f32' | 'f64' | 'i32' | 'i64' | 'v128'
- interface GlobalDescriptor {
- value: ValueType
- mutable?: boolean
- }
- class Global {
- constructor(descriptor: GlobalDescriptor, value?: any)
- value: any
- valueOf(): any
- }
- type ImportValue = ExportValue | number
- type ModuleImports = Record
- type Imports = Record
- type ExportValue = Function | Global | Memory | Table
- type Exports = Record
- class Instance {
- constructor(module: Module, imports?: Imports)
- readonly exports: Exports
- }
- interface MemoryDescriptor {
- initial: number
- maximum?: number
- shared?: boolean
- }
- class Memory {
- constructor(descriptor: MemoryDescriptor)
- readonly buffer: ArrayBuffer
- grow(delta: number): number
- }
- type ImportExportKind = 'function' | 'global' | 'memory' | 'table'
- interface ModuleExportDescriptor {
- kind: ImportExportKind
- name: string
- }
- interface ModuleImportDescriptor {
- kind: ImportExportKind
- module: string
- name: string
- }
- abstract class Module {
- static customSections(module: Module, sectionName: string): ArrayBuffer[]
- static exports(module: Module): ModuleExportDescriptor[]
- static imports(module: Module): ModuleImportDescriptor[]
- }
- type TableKind = 'anyfunc' | 'externref'
- interface TableDescriptor {
- element: TableKind
- initial: number
- maximum?: number
- }
- class Table {
- constructor(descriptor: TableDescriptor, value?: any)
- readonly length: number
- get(index: number): any
- grow(delta: number, value?: any): number
- set(index: number, value?: any): void
- }
- function instantiate(module: Module, imports?: Imports): Promise
- function validate(bytes: BufferSource): boolean
+ class CompileError extends Error {
+ constructor(message?: string);
+ }
+ class RuntimeError extends Error {
+ constructor(message?: string);
+ }
+ type ValueType = "anyfunc" | "externref" | "f32" | "f64" | "i32" | "i64" | "v128";
+ interface GlobalDescriptor {
+ value: ValueType;
+ mutable?: boolean;
+ }
+ class Global {
+ constructor(descriptor: GlobalDescriptor, value?: any);
+ value: any;
+ valueOf(): any;
+ }
+ type ImportValue = ExportValue | number;
+ type ModuleImports = Record;
+ type Imports = Record;
+ type ExportValue = Function | Global | Memory | Table;
+ type Exports = Record;
+ class Instance {
+ constructor(module: Module, imports?: Imports);
+ readonly exports: Exports;
+ }
+ interface MemoryDescriptor {
+ initial: number;
+ maximum?: number;
+ shared?: boolean;
+ }
+ class Memory {
+ constructor(descriptor: MemoryDescriptor);
+ readonly buffer: ArrayBuffer;
+ grow(delta: number): number;
+ }
+ type ImportExportKind = "function" | "global" | "memory" | "table";
+ interface ModuleExportDescriptor {
+ kind: ImportExportKind;
+ name: string;
+ }
+ interface ModuleImportDescriptor {
+ kind: ImportExportKind;
+ module: string;
+ name: string;
+ }
+ abstract class Module {
+ static customSections(module: Module, sectionName: string): ArrayBuffer[];
+ static exports(module: Module): ModuleExportDescriptor[];
+ static imports(module: Module): ModuleImportDescriptor[];
+ }
+ type TableKind = "anyfunc" | "externref";
+ interface TableDescriptor {
+ element: TableKind;
+ initial: number;
+ maximum?: number;
+ }
+ class Table {
+ constructor(descriptor: TableDescriptor, value?: any);
+ readonly length: number;
+ get(index: number): any;
+ grow(delta: number, value?: any): number;
+ set(index: number, value?: any): void;
+ }
+ function instantiate(module: Module, imports?: Imports): Promise;
+ function validate(bytes: BufferSource): boolean;
}
/**
* This ServiceWorker API interface represents the global execution context of a service worker.
@@ -213,405 +210,319 @@ declare namespace WebAssembly {
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/ServiceWorkerGlobalScope)
*/
interface ServiceWorkerGlobalScope extends WorkerGlobalScope {
- DOMException: typeof DOMException
- WorkerGlobalScope: typeof WorkerGlobalScope
- btoa(data: string): string
- atob(data: string): string
- setTimeout(callback: (...args: any[]) => void, msDelay?: number): number
- setTimeout(
- callback: (...args: Args) => void,
- msDelay?: number,
- ...args: Args
- ): number
- clearTimeout(timeoutId: number | null): void
- setInterval(callback: (...args: any[]) => void, msDelay?: number): number
- setInterval(
- callback: (...args: Args) => void,
- msDelay?: number,
- ...args: Args
- ): number
- clearInterval(timeoutId: number | null): void
- queueMicrotask(task: Function): void
- structuredClone(value: T, options?: StructuredSerializeOptions): T
- reportError(error: any): void
- fetch(input: RequestInfo | URL, init?: RequestInit): Promise
- self: ServiceWorkerGlobalScope
- crypto: Crypto
- caches: CacheStorage
- scheduler: Scheduler
- performance: Performance
- Cloudflare: Cloudflare
- readonly origin: string
- Event: typeof Event
- ExtendableEvent: typeof ExtendableEvent
- CustomEvent: typeof CustomEvent
- PromiseRejectionEvent: typeof PromiseRejectionEvent
- FetchEvent: typeof FetchEvent
- TailEvent: typeof TailEvent
- TraceEvent: typeof TailEvent
- ScheduledEvent: typeof ScheduledEvent
- MessageEvent: typeof MessageEvent
- CloseEvent: typeof CloseEvent
- ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader
- ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader
- ReadableStream: typeof ReadableStream
- WritableStream: typeof WritableStream
- WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter
- TransformStream: typeof TransformStream
- ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy
- CountQueuingStrategy: typeof CountQueuingStrategy
- ErrorEvent: typeof ErrorEvent
- EventSource: typeof EventSource
- ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest
- ReadableStreamDefaultController: typeof ReadableStreamDefaultController
- ReadableByteStreamController: typeof ReadableByteStreamController
- WritableStreamDefaultController: typeof WritableStreamDefaultController
- TransformStreamDefaultController: typeof TransformStreamDefaultController
- CompressionStream: typeof CompressionStream
- DecompressionStream: typeof DecompressionStream
- TextEncoderStream: typeof TextEncoderStream
- TextDecoderStream: typeof TextDecoderStream
- Headers: typeof Headers
- Body: typeof Body
- Request: typeof Request
- Response: typeof Response
- WebSocket: typeof WebSocket
- WebSocketPair: typeof WebSocketPair
- WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair
- AbortController: typeof AbortController
- AbortSignal: typeof AbortSignal
- TextDecoder: typeof TextDecoder
- TextEncoder: typeof TextEncoder
- navigator: Navigator
- Navigator: typeof Navigator
- URL: typeof URL
- URLSearchParams: typeof URLSearchParams
- URLPattern: typeof URLPattern
- Blob: typeof Blob
- File: typeof File
- FormData: typeof FormData
- Crypto: typeof Crypto
- SubtleCrypto: typeof SubtleCrypto
- CryptoKey: typeof CryptoKey
- CacheStorage: typeof CacheStorage
- Cache: typeof Cache
- FixedLengthStream: typeof FixedLengthStream
- IdentityTransformStream: typeof IdentityTransformStream
- HTMLRewriter: typeof HTMLRewriter
-}
-declare function addEventListener(
- type: Type,
- handler: EventListenerOrEventListenerObject,
- options?: EventTargetAddEventListenerOptions | boolean
-): void
-declare function removeEventListener(
- type: Type,
- handler: EventListenerOrEventListenerObject,
- options?: EventTargetEventListenerOptions | boolean
-): void
+ DOMException: typeof DOMException;
+ WorkerGlobalScope: typeof WorkerGlobalScope;
+ btoa(data: string): string;
+ atob(data: string): string;
+ setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
+ setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+ clearTimeout(timeoutId: number | null): void;
+ setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
+ setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
+ clearInterval(timeoutId: number | null): void;
+ queueMicrotask(task: Function): void;
+ structuredClone(value: T, options?: StructuredSerializeOptions): T;
+ reportError(error: any): void;
+ fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
+ self: ServiceWorkerGlobalScope;
+ crypto: Crypto;
+ caches: CacheStorage;
+ scheduler: Scheduler;
+ performance: Performance;
+ Cloudflare: Cloudflare;
+ readonly origin: string;
+ Event: typeof Event;
+ ExtendableEvent: typeof ExtendableEvent;
+ CustomEvent: typeof CustomEvent;
+ PromiseRejectionEvent: typeof PromiseRejectionEvent;
+ FetchEvent: typeof FetchEvent;
+ TailEvent: typeof TailEvent;
+ TraceEvent: typeof TailEvent;
+ ScheduledEvent: typeof ScheduledEvent;
+ MessageEvent: typeof MessageEvent;
+ CloseEvent: typeof CloseEvent;
+ ReadableStreamDefaultReader: typeof ReadableStreamDefaultReader;
+ ReadableStreamBYOBReader: typeof ReadableStreamBYOBReader;
+ ReadableStream: typeof ReadableStream;
+ WritableStream: typeof WritableStream;
+ WritableStreamDefaultWriter: typeof WritableStreamDefaultWriter;
+ TransformStream: typeof TransformStream;
+ ByteLengthQueuingStrategy: typeof ByteLengthQueuingStrategy;
+ CountQueuingStrategy: typeof CountQueuingStrategy;
+ ErrorEvent: typeof ErrorEvent;
+ EventSource: typeof EventSource;
+ ReadableStreamBYOBRequest: typeof ReadableStreamBYOBRequest;
+ ReadableStreamDefaultController: typeof ReadableStreamDefaultController;
+ ReadableByteStreamController: typeof ReadableByteStreamController;
+ WritableStreamDefaultController: typeof WritableStreamDefaultController;
+ TransformStreamDefaultController: typeof TransformStreamDefaultController;
+ CompressionStream: typeof CompressionStream;
+ DecompressionStream: typeof DecompressionStream;
+ TextEncoderStream: typeof TextEncoderStream;
+ TextDecoderStream: typeof TextDecoderStream;
+ Headers: typeof Headers;
+ Body: typeof Body;
+ Request: typeof Request;
+ Response: typeof Response;
+ WebSocket: typeof WebSocket;
+ WebSocketPair: typeof WebSocketPair;
+ WebSocketRequestResponsePair: typeof WebSocketRequestResponsePair;
+ AbortController: typeof AbortController;
+ AbortSignal: typeof AbortSignal;
+ TextDecoder: typeof TextDecoder;
+ TextEncoder: typeof TextEncoder;
+ navigator: Navigator;
+ Navigator: typeof Navigator;
+ URL: typeof URL;
+ URLSearchParams: typeof URLSearchParams;
+ URLPattern: typeof URLPattern;
+ Blob: typeof Blob;
+ File: typeof File;
+ FormData: typeof FormData;
+ Crypto: typeof Crypto;
+ SubtleCrypto: typeof SubtleCrypto;
+ CryptoKey: typeof CryptoKey;
+ CacheStorage: typeof CacheStorage;
+ Cache: typeof Cache;
+ FixedLengthStream: typeof FixedLengthStream;
+ IdentityTransformStream: typeof IdentityTransformStream;
+ HTMLRewriter: typeof HTMLRewriter;
+}
+declare function addEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetAddEventListenerOptions | boolean): void;
+declare function removeEventListener(type: Type, handler: EventListenerOrEventListenerObject, options?: EventTargetEventListenerOptions | boolean): void;
/**
* Dispatches a synthetic event event to target and returns true if either event's cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
*
* [MDN Reference](https://developer.mozilla.org/docs/Web/API/EventTarget/dispatchEvent)
*/
-declare function dispatchEvent(
- event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]
-): boolean
+declare function dispatchEvent(event: WorkerGlobalScopeEventMap[keyof WorkerGlobalScopeEventMap]): boolean;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/btoa) */
-declare function btoa(data: string): string
+declare function btoa(data: string): string;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/Window/atob) */
-declare function atob(data: string): string
+declare function atob(data: string): string;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
-declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number
+declare function setTimeout(callback: (...args: any[]) => void, msDelay?: number): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setTimeout) */
-declare function setTimeout(
- callback: (...args: Args) => void,
- msDelay?: number,
- ...args: Args
-): number
+declare function setTimeout(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearTimeout) */
-declare function clearTimeout(timeoutId: number | null): void
+declare function clearTimeout(timeoutId: number | null): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
-declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number
+declare function setInterval(callback: (...args: any[]) => void, msDelay?: number): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/setInterval) */
-declare function setInterval(
- callback: (...args: Args) => void,
- msDelay?: number,
- ...args: Args
-): number
+declare function setInterval(callback: (...args: Args) => void, msDelay?: number, ...args: Args): number;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/clearInterval) */
-declare function clearInterval(timeoutId: number | null): void
+declare function clearInterval(timeoutId: number | null): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/queueMicrotask) */
-declare function queueMicrotask(task: Function): void
+declare function queueMicrotask(task: Function): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/structuredClone) */
-declare function structuredClone(value: T, options?: StructuredSerializeOptions): T
+declare function structuredClone(value: T, options?: StructuredSerializeOptions): T;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/reportError) */
-declare function reportError(error: any): void
+declare function reportError(error: any): void;
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/fetch) */
-declare function fetch(
- input: RequestInfo | URL,
- init?: RequestInit
-): Promise
-declare const self: ServiceWorkerGlobalScope
+declare function fetch(input: RequestInfo | URL, init?: RequestInit): Promise;
+declare const self: ServiceWorkerGlobalScope;
/**
- * The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
- * The Workers runtime implements the full surface of this API, but with some differences in
- * the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
- * compared to those implemented in most browsers.
- *
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
- */
-declare const crypto: Crypto
+* The Web Crypto API provides a set of low-level functions for common cryptographic tasks.
+* The Workers runtime implements the full surface of this API, but with some differences in
+* the [supported algorithms](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/#supported-algorithms)
+* compared to those implemented in most browsers.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/web-crypto/)
+*/
+declare const crypto: Crypto;
/**
- * The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
- *
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
- */
-declare const caches: CacheStorage
-declare const scheduler: Scheduler
+* The Cache API allows fine grained control of reading and writing from the Cloudflare global network cache.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/cache/)
+*/
+declare const caches: CacheStorage;
+declare const scheduler: Scheduler;
/**
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
- * as well as timing of subrequests and other operations.
- *
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
- */
-declare const performance: Performance
-declare const Cloudflare: Cloudflare
-declare const origin: string
-declare const navigator: Navigator
-interface TestController {}
+* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
+* as well as timing of subrequests and other operations.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
+*/
+declare const performance: Performance;
+declare const Cloudflare: Cloudflare;
+declare const origin: string;
+declare const navigator: Navigator;
+interface TestController {
+}
interface ExecutionContext {
- waitUntil(promise: Promise): void
- passThroughOnException(): void
- props: any
-}
-type ExportedHandlerFetchHandler = (
- request: Request>,
- env: Env,
- ctx: ExecutionContext
-) => Response | Promise
-type ExportedHandlerTailHandler = (
- events: TraceItem[],
- env: Env,
- ctx: ExecutionContext
-) => void | Promise
-type ExportedHandlerTraceHandler = (
- traces: TraceItem[],
- env: Env,
- ctx: ExecutionContext
-) => void | Promise
-type ExportedHandlerTailStreamHandler = (
- event: TailStream.TailEvent,
- env: Env,
- ctx: ExecutionContext
-) => TailStream.TailEventHandlerType | Promise
-type ExportedHandlerScheduledHandler = (
- controller: ScheduledController,
- env: Env,
- ctx: ExecutionContext
-) => void | Promise
-type ExportedHandlerQueueHandler = (
- batch: MessageBatch,
- env: Env,
- ctx: ExecutionContext
-) => void | Promise
-type ExportedHandlerTestHandler = (
- controller: TestController,
- env: Env,
- ctx: ExecutionContext
-) => void | Promise
+ waitUntil(promise: Promise): void;
+ passThroughOnException(): void;
+ props: any;
+}
+type ExportedHandlerFetchHandler = (request: Request>, env: Env, ctx: ExecutionContext) => Response | Promise;
+type ExportedHandlerTailHandler = (events: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTraceHandler = (traces: TraceItem[], env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTailStreamHandler = (event: TailStream.TailEvent, env: Env, ctx: ExecutionContext) => TailStream.TailEventHandlerType | Promise;
+type ExportedHandlerScheduledHandler = (controller: ScheduledController, env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerQueueHandler = (batch: MessageBatch, env: Env, ctx: ExecutionContext) => void | Promise;
+type ExportedHandlerTestHandler = (controller: TestController, env: Env, ctx: ExecutionContext) => void | Promise;
interface ExportedHandler {
- fetch?: ExportedHandlerFetchHandler
- tail?: ExportedHandlerTailHandler
- trace?: ExportedHandlerTraceHandler
- tailStream?: ExportedHandlerTailStreamHandler
- scheduled?: ExportedHandlerScheduledHandler
- test?: ExportedHandlerTestHandler
- email?: EmailExportedHandler
- queue?: ExportedHandlerQueueHandler
+ fetch?: ExportedHandlerFetchHandler;
+ tail?: ExportedHandlerTailHandler;
+ trace?: ExportedHandlerTraceHandler;
+ tailStream?: ExportedHandlerTailStreamHandler;
+ scheduled?: ExportedHandlerScheduledHandler;
+ test?: ExportedHandlerTestHandler;
+ email?: EmailExportedHandler;
+ queue?: ExportedHandlerQueueHandler;
}
interface StructuredSerializeOptions {
- transfer?: any[]
+ transfer?: any[];
}
/* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent) */
declare abstract class PromiseRejectionEvent extends Event {
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
- readonly promise: Promise
- /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
- readonly reason: any
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/promise) */
+ readonly promise: Promise;
+ /* [MDN Reference](https://developer.mozilla.org/docs/Web/API/PromiseRejectionEvent/reason) */
+ readonly reason: any;
}
declare abstract class Navigator {
- sendBeacon(
- url: string,
- body?:
- | ReadableStream
- | string
- | (ArrayBuffer | ArrayBufferView)
- | Blob
- | FormData
- | URLSearchParams
- | URLSearchParams
- ): boolean
- readonly userAgent: string
- readonly hardwareConcurrency: number
+ sendBeacon(url: string, body?: (ReadableStream | string | (ArrayBuffer | ArrayBufferView) | Blob | FormData | URLSearchParams | URLSearchParams)): boolean;
+ readonly userAgent: string;
+ readonly hardwareConcurrency: number;
}
/**
- * The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
- * as well as timing of subrequests and other operations.
- *
- * [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
- */
+* The Workers runtime supports a subset of the Performance API, used to measure timing and performance,
+* as well as timing of subrequests and other operations.
+*
+* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/)
+*/
interface Performance {
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
- readonly timeOrigin: number
- /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
- now(): number
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancetimeorigin) */
+ readonly timeOrigin: number;
+ /* [Cloudflare Docs Reference](https://developers.cloudflare.com/workers/runtime-apis/performance/#performancenow) */
+ now(): number;
}
interface AlarmInvocationInfo {
- readonly isRetry: boolean
- readonly retryCount: number
+ readonly isRetry: boolean;
+ readonly retryCount: number;
}
interface Cloudflare {
- readonly compatibilityFlags: Record
+ readonly compatibilityFlags: Record;
}
interface DurableObject {
- fetch(request: Request): Response | Promise
- alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise
- webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise
- webSocketClose?(
- ws: WebSocket,
- code: number,
- reason: string,
- wasClean: boolean
- ): void | Promise
- webSocketError?(ws: WebSocket, error: unknown): void | Promise
-}
-type DurableObjectStub = Fetcher<
- T,
- 'alarm' | 'webSocketMessage' | 'webSocketClose' | 'webSocketError'
-> & {
- readonly id: DurableObjectId
- readonly name?: string
-}
+ fetch(request: Request): Response | Promise;
+ alarm?(alarmInfo?: AlarmInvocationInfo): void | Promise;
+ webSocketMessage?(ws: WebSocket, message: string | ArrayBuffer): void | Promise;
+ webSocketClose?(ws: WebSocket, code: number, reason: string, wasClean: boolean): void | Promise;
+ webSocketError?(ws: WebSocket, error: unknown): void | Promise;
+}
+type DurableObjectStub = Fetcher & {
+ readonly id: DurableObjectId;
+ readonly name?: string;
+};
interface DurableObjectId {
- toString(): string
- equals(other: DurableObjectId): boolean
- readonly name?: string
+ toString(): string;
+ equals(other: DurableObjectId): boolean;
+ readonly name?: string;
}
interface DurableObjectNamespace {
- newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId
- idFromName(name: string): DurableObjectId
- idFromString(id: string): DurableObjectId
- get(
- id: DurableObjectId,
- options?: DurableObjectNamespaceGetDurableObjectOptions
- ): DurableObjectStub
- jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace
-}
-type DurableObjectJurisdiction = 'eu' | 'fedramp'
+ newUniqueId(options?: DurableObjectNamespaceNewUniqueIdOptions): DurableObjectId;
+ idFromName(name: string): DurableObjectId;
+ idFromString(id: string): DurableObjectId;
+ get(id: DurableObjectId, options?: DurableObjectNamespaceGetDurableObjectOptions): DurableObjectStub;
+ jurisdiction(jurisdiction: DurableObjectJurisdiction): DurableObjectNamespace;
+}
+type DurableObjectJurisdiction = "eu" | "fedramp";
interface DurableObjectNamespaceNewUniqueIdOptions {
- jurisdiction?: DurableObjectJurisdiction
-}
-type DurableObjectLocationHint =
- | 'wnam'
- | 'enam'
- | 'sam'
- | 'weur'
- | 'eeur'
- | 'apac'
- | 'oc'
- | 'afr'
- | 'me'
+ jurisdiction?: DurableObjectJurisdiction;
+}
+type DurableObjectLocationHint = "wnam" | "enam" | "sam" | "weur" | "eeur" | "apac" | "oc" | "afr" | "me";
interface DurableObjectNamespaceGetDurableObjectOptions {
- locationHint?: DurableObjectLocationHint
+ locationHint?: DurableObjectLocationHint;
}
interface DurableObjectState {
- waitUntil(promise: Promise): void
- readonly id: DurableObjectId
- readonly storage: DurableObjectStorage
- container?: Container
- blockConcurrencyWhile(callback: () => Promise): Promise
- acceptWebSocket(ws: WebSocket, tags?: string[]): void
- getWebSockets(tag?: string): WebSocket[]
- setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void
- getWebSocketAutoResponse(): WebSocketRequestResponsePair | null
- getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null
- setHibernatableWebSocketEventTimeout(timeoutMs?: number): void
- getHibernatableWebSocketEventTimeout(): number | null
- getTags(ws: WebSocket): string[]
- abort(reason?: string): void
+ waitUntil(promise: Promise): void;
+ readonly id: DurableObjectId;
+ readonly storage: DurableObjectStorage;
+ container?: Container;
+ blockConcurrencyWhile(callback: () => Promise): Promise;
+ acceptWebSocket(ws: WebSocket, tags?: string[]): void;
+ getWebSockets(tag?: string): WebSocket[];
+ setWebSocketAutoResponse(maybeReqResp?: WebSocketRequestResponsePair): void;
+ getWebSocketAutoResponse(): WebSocketRequestResponsePair | null;
+ getWebSocketAutoResponseTimestamp(ws: WebSocket): Date | null;
+ setHibernatableWebSocketEventTimeout(timeoutMs?: number): void;
+ getHibernatableWebSocketEventTimeout(): number | null;
+ getTags(ws: WebSocket): string[];
+ abort(reason?: string): void;
}
interface DurableObjectTransaction {
- get(key: string, options?: DurableObjectGetOptions): Promise
- get(keys: string[], options?: DurableObjectGetOptions): Promise