durable-actors 0.7.15 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. package/README.md +5 -5
  2. package/bin/durable-actors.js +2 -0
  3. package/dist/actor/actor.d.ts +2 -2
  4. package/dist/actor/actor.d.ts.map +1 -1
  5. package/dist/actor/actor.js +5 -3
  6. package/dist/actor/actor.js.map +1 -1
  7. package/dist/actor/database.d.ts +3 -2
  8. package/dist/actor/database.d.ts.map +1 -1
  9. package/dist/actor/database.js +21 -3
  10. package/dist/actor/database.js.map +1 -1
  11. package/dist/cli/dev.d.ts.map +1 -1
  12. package/dist/cli/dev.js +13 -42
  13. package/dist/cli/dev.js.map +1 -1
  14. package/dist/cli/python.d.ts.map +1 -1
  15. package/dist/cli/python.js +0 -1
  16. package/dist/cli/python.js.map +1 -1
  17. package/dist/cli.d.ts +1 -1
  18. package/dist/cli.js +9 -18
  19. package/dist/cli.js.map +1 -1
  20. package/dist/client-runtime/proxy.d.ts +1 -3
  21. package/dist/client-runtime/proxy.d.ts.map +1 -1
  22. package/dist/client-runtime/proxy.js +3 -10
  23. package/dist/client-runtime/proxy.js.map +1 -1
  24. package/dist/compiler/declarations.js +2648 -183
  25. package/dist/compiler/declarations.js.map +7 -1
  26. package/dist/compiler/generators/client-artifacts.d.ts.map +1 -1
  27. package/dist/compiler/generators/client-artifacts.js +0 -1
  28. package/dist/compiler/generators/client-artifacts.js.map +1 -1
  29. package/dist/generated/client-runtime.d.ts.map +1 -1
  30. package/dist/generated/client-runtime.js +1 -1
  31. package/dist/generated/client-runtime.js.map +1 -1
  32. package/dist/host/actor-runtime.d.ts.map +1 -1
  33. package/dist/host/actor-runtime.js +2 -3
  34. package/dist/host/actor-runtime.js.map +1 -1
  35. package/dist/host/sqlite.d.ts.map +1 -1
  36. package/dist/host/sqlite.js +2 -0
  37. package/dist/host/sqlite.js.map +1 -1
  38. package/dist/projectSdk.js +1 -1
  39. package/dist/projectSdk.js.map +1 -1
  40. package/dist/templates/actor/README.md +7 -9
  41. package/dist/templates/actor/bunfig +2 -0
  42. package/dist/templates/actor/package.json +6 -3
  43. package/dist/templates/ai-chat/README.md +8 -8
  44. package/dist/templates/ai-chat/bunfig +2 -0
  45. package/dist/templates/ai-chat/package.json +7 -5
  46. package/dist/templates/chat/README.md +8 -8
  47. package/dist/templates/chat/bunfig +2 -0
  48. package/dist/templates/chat/package.json +7 -5
  49. package/dist/templates/documents/README.md +8 -8
  50. package/dist/templates/documents/bunfig +2 -0
  51. package/dist/templates/documents/package.json +7 -5
  52. package/package.json +110 -108
  53. package/dist/cli/actor-source-watcher.d.ts +0 -25
  54. package/dist/cli/actor-source-watcher.d.ts.map +0 -1
  55. package/dist/cli/actor-source-watcher.js +0 -129
  56. package/dist/cli/actor-source-watcher.js.map +0 -1
  57. package/dist/templates/actor/pnpm-workspace.yaml +0 -2
  58. package/dist/templates/ai-chat/pnpm-workspace.yaml +0 -2
  59. package/dist/templates/chat/pnpm-workspace.yaml +0 -2
  60. package/dist/templates/documents/pnpm-workspace.yaml +0 -2
  61. package/dist/templates/python/README.md +0 -7
  62. package/dist/templates/python/gitignore +0 -6
  63. package/dist/templates/python/package.json +0 -11
  64. package/dist/templates/python/pnpm-workspace.yaml +0 -2
  65. package/dist/templates/python/pyproject.toml +0 -8
  66. package/dist/templates/python/src/actors.py +0 -9
@@ -1 +1 @@
1
- {"version":3,"file":"client-artifacts.d.ts","sourceRoot":"","sources":["../../../src/compiler/generators/client-artifacts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAMxE,+HAA+H;AAC/H,iBAAe,uBAAuB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAoBvG;AA+ED,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAClC,YAAY,EAAE,mBAAmB,EAAE,CAAA"}
1
+ {"version":3,"file":"client-artifacts.d.ts","sourceRoot":"","sources":["../../../src/compiler/generators/client-artifacts.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAA;AAMxE,+HAA+H;AAC/H,iBAAe,uBAAuB,CAAC,KAAK,EAAE,mBAAmB,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAoBvG;AA8ED,OAAO,EAAE,uBAAuB,EAAE,CAAA;AAClC,YAAY,EAAE,mBAAmB,EAAE,CAAA"}
@@ -60,7 +60,6 @@ export interface Authorization {
60
60
  actorId: string
61
61
  metadata: Metadata
62
62
  clientLocation?: { latitude: number; longitude: number }
63
- authorizationLifetimeMs?: number
64
63
  }
65
64
  }`;
66
65
  }
@@ -1 +1 @@
1
- {"version":3,"file":"client-artifacts.js","sourceRoot":"","sources":["../../../src/compiler/generators/client-artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAA;AACjC,OAAO,EAAE,MAAM,YAAY,CAAA;AAE3B,OAAO,EAAE,YAAY,EAAE,MAAM,mCAAmC,CAAA;AAGhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAA;AAEpE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAEjD,+HAA+H;AAC/H,KAAK,UAAU,uBAAuB,CAAC,KAA0B;IAC7D,MAAM,QAAQ,GAAG,mBAAmB,CAAC,KAAK,CAAC,CAAA;IAC3C,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC,CAAA;IAC5D,MAAM,YAAY,GAAG,SAAS,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,iBAAiB,CAAC,QAAQ,CAA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AAI,CAAC,SAAS,CAAC,QAAQ,CAAC,SAAS,CAAC;;;;;EAKjD,CAAA;AACF,CAAC;AAED,SAAS,WAAW,CAAC,SAAoC;IACrD,MAAM,MAAM,GAAG,SAAS;SACnB,GAAG,CACA,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CACd,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,2DAA2D,SAAS,YAAY,CACpH;SACA,IAAI,CAAC,IAAI,CAAC,CAAA;IACf,MAAM,aAAa,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,UAAU,SAAS,gBAAgB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,OAAO,CAAA;IAClH,MAAM,YAAY,GAAG,SAAS,CAAC,CAAC,CAAC,EAAE,SAAS,CAAA;IAC5C,OAAO,GAAG,YAAY,CAAC,4DAA4D,EAAE,YAAY,IAAI,0DAA0D,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,mCAAmC,CAAC;mCAChM,aAAa;;EAE9C,YAAY,CAAC,0EAA0E,EAAE,YAAY,IAAI,sDAAsD,IAAI,CAAC,SAAS,CAAC,YAAY,CAAC,oCAAoC,CAAC;;EAEhO,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC,IAAI,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC,qDAAqD,SAAS,YAAY,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC;;;kBAGpI,MAAM;;;;;;;;;;;CAWvB,CAAA;AACD,CAAC;AAED,OAAO,EAAE,uBAAuB,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"client-runtime.d.ts","sourceRoot":"","sources":["../../src/generated/client-runtime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA+zjD,CAAA"}
1
+ {"version":3,"file":"client-runtime.d.ts","sourceRoot":"","sources":["../../src/generated/client-runtime.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAA0wiD,CAAA"}
@@ -1,2 +1,2 @@
1
- export const runtimeFiles = { "runtime/errors.js": "class ActorConfigurationError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorConfigurationError\";\n }\n}\nclass ActorDefinitionError extends Error {\n constructor(message) {\n super(message);\n this.name = \"ActorDefinitionError\";\n }\n}\n/** Remote failure. Retrying an `outcome_unknown` operation may run it twice; `unavailable` never ran. */\nclass ActorInvocationError extends Error {\n /** Error category, such as `actor_error` or `outcome_unknown`. New codes may be added. */\n code;\n /** Identifies this caller attempt; it is not an application idempotency key. */\n requestId;\n constructor(code, requestId, message) {\n super(message);\n this.name = \"ActorInvocationError\";\n this.code = code;\n this.requestId = requestId;\n }\n}\n/** Signals that the authorization service explicitly revoked or denied access. */\nclass ActorSessionRejectedError extends Error {\n name = \"ActorSessionRejectedError\";\n}\nclass ActorSessionError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorSessionError\";\n }\n}\nclass ActorProtocolError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorProtocolError\";\n }\n}\nclass ActorSerializationError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorSerializationError\";\n }\n}\nclass ActorValidationError extends Error {\n constructor(message) {\n super(message);\n this.name = \"ActorValidationError\";\n }\n}\nexport { ActorConfigurationError, ActorDefinitionError, ActorInvocationError, ActorProtocolError, ActorSerializationError, ActorSessionError, ActorSessionRejectedError, ActorValidationError };\nfunction errorMessage(error) {\n return error instanceof Error ? error.message : String(error);\n}\nexport { errorMessage };\n", "runtime/errors.d.ts": "declare class ActorConfigurationError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorDefinitionError extends Error {\n constructor(message: string);\n}\n/** Remote failure. Retrying an `outcome_unknown` operation may run it twice; `unavailable` never ran. */\ndeclare class ActorInvocationError extends Error {\n /** Error category, such as `actor_error` or `outcome_unknown`. New codes may be added. */\n readonly code: string;\n /** Identifies this caller attempt; it is not an application idempotency key. */\n readonly requestId: string;\n constructor(code: string, requestId: string, message: string);\n}\n/** Signals that the authorization service explicitly revoked or denied access. */\ndeclare class ActorSessionRejectedError extends Error {\n readonly name = \"ActorSessionRejectedError\";\n}\ndeclare class ActorSessionError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorProtocolError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorSerializationError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorValidationError extends Error {\n constructor(message: string);\n}\nexport { ActorConfigurationError, ActorDefinitionError, ActorInvocationError, ActorProtocolError, ActorSerializationError, ActorSessionError, ActorSessionRejectedError, ActorValidationError };\ndeclare function errorMessage(error: unknown): string;\nexport { errorMessage };\n", "runtime/json.js": "import { ActorSerializationError } from \"./errors.js\";\nfunction cloneJson(value, label) {\n try {\n const encoded = JSON.stringify(value);\n if (encoded === undefined)\n throw new ActorSerializationError(`${label} must be JSON serializable`);\n return JSON.parse(encoded);\n }\n catch (error) {\n if (error instanceof ActorSerializationError)\n throw error;\n throw new ActorSerializationError(`${label} must be JSON serializable`, { cause: error });\n }\n}\nexport { cloneJson };\n", "runtime/json.d.ts": "type JsonPrimitive = string | number | boolean | null;\ntype JsonObject = {\n readonly [key: string]: JsonValue;\n};\ntype JsonValue = JsonPrimitive | JsonObject | readonly JsonValue[];\ndeclare function cloneJson(value: unknown, label: string): JsonValue;\nexport { cloneJson };\nexport type { JsonValue };\n", "runtime/settings.js": "import { ActorConfigurationError, ActorValidationError } from \"./errors.js\";\nexport function configuredSettings(value) {\n if (typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value) ||\n Object.keys(value).some(key => ![\"projectId\", \"apiKey\", \"homeRegion\", \"controlPlaneUrl\"].includes(key)))\n throw new ActorConfigurationError(\"durable-actors client settings are invalid\");\n const options = value;\n const controlPlaneUrl = validateOrigin(options.controlPlaneUrl);\n const local = [\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(new URL(controlPlaneUrl).hostname);\n const projectId = options.projectId ?? (local ? \"local\" : undefined);\n if (typeof projectId !== \"string\" || !/^[A-Za-z0-9._-]{1,64}$/u.test(projectId) || [\".\", \"..\"].includes(projectId))\n throw new ActorConfigurationError(\"durable-actors client settings are invalid: a valid projectId is required for remote connections\");\n if (options.apiKey !== undefined && (typeof options.apiKey !== \"string\" || !options.apiKey.trim()))\n throw new ActorConfigurationError(\"durable-actors client settings are invalid: apiKey must not be empty\");\n if (options.homeRegion !== undefined)\n validateActorComponent(\"home region\", options.homeRegion);\n return { projectId, credential: options.apiKey?.trim(), homeRegion: options.homeRegion, controlPlaneUrl };\n}\nexport function environmentSettings(environment = runtimeEnvironment()) {\n return {\n projectId: environment.DURABLE_ACTORS_PROJECT_ID,\n apiKey: environment.DURABLE_ACTORS_SECRET ?? environment.DURABLE_ACTORS_API_KEY,\n homeRegion: environment.DURABLE_ACTORS_HOME_REGION,\n controlPlaneUrl: environment.DURABLE_ACTORS_CONTROL_PLANE_URL ?? \"http://127.0.0.1:7100\"\n };\n}\nexport function runtimeEnvironment() {\n return globalThis.process?.env ?? {};\n}\nexport function validateOrigin(origin) {\n let url;\n try {\n url = new URL(origin);\n }\n catch (error) {\n throw new ActorConfigurationError(`actor HTTP origin is invalid: ${origin}`, { cause: error });\n }\n if (!/^https?:$/u.test(url.protocol) ||\n !url.hostname ||\n url.username ||\n url.password ||\n url.pathname !== \"/\" ||\n url.search ||\n url.hash)\n throw new ActorConfigurationError(`actor URL must be an HTTP or HTTPS origin: ${origin}`);\n return url.origin;\n}\nexport function validateActorComponent(name, value) {\n if (typeof value !== \"string\" || !/^[A-Za-z0-9._-]+$/u.test(value) || value === \".\" || value === \"..\")\n throw new ActorValidationError(`${name} may contain only ASCII letters, digits, '.', '-', and '_' and must not be a path segment`);\n return value;\n}\nexport function projectActorPath(projectId, actorName, actorId) {\n return `/v1/projects/${encodeURIComponent(validateActorComponent(\"project ID\", projectId))}/actors/${encodeURIComponent(validateActorComponent(\"actor name\", actorName))}/${encodeURIComponent(validateActorComponent(\"actor ID\", actorId))}`;\n}\nexport function authorizationHeaders(credential) {\n return credential === undefined ? {} : { authorization: `Bearer ${credential}` };\n}\n", "runtime/settings.d.ts": "export interface DurableActorsClientOptions {\n readonly projectId?: string;\n readonly apiKey?: string;\n readonly homeRegion?: string;\n readonly controlPlaneUrl: string;\n}\nexport type Environment = Record<string, string | undefined>;\nexport declare function configuredSettings(value: unknown): {\n projectId: string;\n credential: string | undefined;\n homeRegion: string | undefined;\n controlPlaneUrl: string;\n};\nexport declare function environmentSettings(environment?: Environment): DurableActorsClientOptions;\nexport declare function runtimeEnvironment(): Environment;\nexport declare function validateOrigin(origin: string): string;\nexport declare function validateActorComponent(name: string, value: string): string;\nexport declare function projectActorPath(projectId: string, actorName: string, actorId: string): string;\nexport declare function authorizationHeaders(credential: string | undefined): Record<string, string>;\n", "runtime/http.js": "import { ActorProtocolError } from \"./errors.js\";\nimport { projectActorPath, validateOrigin } from \"./settings.js\";\nexport class HttpActorHostTransport {\n fetchRequest;\n constructor(fetchRequest = globalThis.fetch) {\n this.fetchRequest = fetchRequest;\n }\n async invoke(target, invocation) {\n let response;\n try {\n response = await this.post(target, invocation, \"invoke\", {\n requestId: invocation.requestId,\n ownerEpoch: target.ownerEpoch,\n method: invocation.method,\n args: invocation.args\n });\n }\n catch (error) {\n if (connectionRefused(error))\n return { type: \"not_executed\", reason: \"upstream_not_reached\" };\n throw error;\n }\n // A 401 is issued before dispatch, so refreshing this ticket cannot repeat actor code.\n if (response.status === 401)\n return { type: \"unauthenticated\" };\n if (!response.ok)\n throw new Error(`actor host returned HTTP ${response.status}`);\n return parseActorHostReply(await responseDocument(response));\n }\n async publish(target, actor, effects) {\n const response = await this.post(target, actor, \"socket-effects\", { ownerEpoch: target.ownerEpoch, effects });\n if (!response.ok)\n throw new Error(`socket effects returned HTTP ${response.status}`);\n }\n post(target, actor, endpoint, body) {\n return this.fetchRequest(`${validateOrigin(target.route)}${projectActorPath(actor.projectId, actor.actorName, actor.actorId)}/${endpoint}`, {\n method: \"POST\",\n redirect: \"manual\",\n headers: {\n authorization: `Bearer ${target.token}`,\n \"content-type\": \"application/json\",\n accept: \"application/json\"\n },\n body: JSON.stringify(body)\n });\n }\n}\nexport function parseActorHostReply(reply) {\n if (isRecord(reply)) {\n const metadata = parseMetadata(reply);\n if (reply.type === \"completed\" && Object.hasOwn(reply, \"result\"))\n return { type: \"completed\", result: reply.result, ...metadata };\n if (reply.type === \"failed\" &&\n typeof reply.code === \"string\" &&\n reply.code.length > 0 &&\n typeof reply.message === \"string\")\n return { type: \"failed\", code: reply.code, message: reply.message, ...metadata };\n if (reply.type === \"not_executed\" && rejectionReason(reply.reason))\n return { type: \"not_executed\", reason: reply.reason, ...metadata };\n }\n throw new ActorProtocolError(\"actor host response did not contain a valid outcome\");\n}\nfunction parseMetadata(reply) {\n if (!Object.hasOwn(reply, \"metadata\"))\n return {};\n const metadata = reply.metadata;\n if (!isRecord(metadata) ||\n !nonnegativeFiniteNumber(metadata.routingMs) ||\n !nonnegativeFiniteNumber(metadata.durationMs) ||\n (metadata.queueWaitMs !== null &&\n (!nonnegativeFiniteNumber(metadata.queueWaitMs) || metadata.queueWaitMs > metadata.durationMs)) ||\n (metadata.hostState !== \"cold\" && metadata.hostState !== \"warm\"))\n throw new ActorProtocolError(\"actor host response contained invalid latency metadata\");\n return {\n metadata: {\n routingMs: metadata.routingMs,\n durationMs: metadata.durationMs,\n queueWaitMs: metadata.queueWaitMs,\n hostState: metadata.hostState\n }\n };\n}\nfunction nonnegativeFiniteNumber(value) {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0;\n}\nfunction rejectionReason(value) {\n return value === \"stale_owner\" || value === \"host_unavailable\" || value === \"upstream_not_reached\";\n}\nexport function connectionRefused(error, ancestors = new Set()) {\n if (!isRecord(error) || ancestors.has(error))\n return false;\n const visited = new Set(ancestors).add(error);\n if (error.code !== undefined && error.code !== \"ECONNREFUSED\")\n return false;\n if (error.errors !== undefined)\n return (Array.isArray(error.errors) &&\n error.errors.length > 0 &&\n error.errors.every(cause => connectionRefused(cause, visited)));\n if (error.code === \"ECONNREFUSED\")\n return error.syscall === \"connect\";\n return connectionRefused(error.cause, visited);\n}\nexport async function responseDocument(response) {\n try {\n return await response.json();\n }\n catch (error) {\n throw new ActorProtocolError(`HTTP ${response.status} response was not valid JSON`, { cause: error });\n }\n}\nexport function isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n", "runtime/http.d.ts": "import type { JsonValue } from \"./json.js\";\nexport declare class HttpActorHostTransport implements ActorHostTransport {\n private readonly fetchRequest;\n constructor(fetchRequest?: typeof globalThis.fetch);\n invoke(target: ActorHostTarget, invocation: ActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n private post;\n}\nexport declare function parseActorHostReply(reply: unknown): ActorHostReply;\nexport declare function connectionRefused(error: unknown, ancestors?: Set<unknown>): boolean;\nexport declare function responseDocument(response: Response): Promise<unknown>;\nexport declare function isRecord(value: unknown): value is Record<string, unknown>;\nexport interface ActorAddress {\n readonly projectId: string;\n readonly actorName: string;\n readonly actorId: string;\n}\nexport interface ActorHostTarget {\n readonly route: string;\n readonly token: string;\n readonly ownerEpoch: number;\n readonly expiresAtMs: number;\n}\nexport interface ActorInvocation extends ActorAddress {\n readonly requestId: string;\n readonly method: string;\n readonly args: readonly JsonValue[];\n}\ntype ActorRejectionReason = \"stale_owner\" | \"host_unavailable\" | \"upstream_not_reached\";\nexport interface ActorResponseMetadata {\n readonly routingMs: number;\n readonly durationMs: number;\n readonly queueWaitMs: number | null;\n readonly hostState: \"cold\" | \"warm\";\n}\nexport type ActorHostReply = ({\n readonly type: \"completed\";\n readonly result: unknown;\n} | {\n readonly type: \"failed\";\n readonly code: string;\n readonly message: string;\n} | {\n readonly type: \"unauthenticated\";\n} | {\n readonly type: \"not_executed\";\n readonly reason: ActorRejectionReason;\n}) & {\n readonly metadata?: ActorResponseMetadata;\n};\nexport interface ActorHostTransport {\n invoke(target: ActorHostTarget, invocation: ActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n}\nexport {};\n", "runtime/telemetry.js": "class LatencyTimeline {\n now;\n origin;\n milestones = { started_at_ms: 0 };\n constructor(now = () => performance.now()) {\n this.now = now;\n this.origin = this.now();\n }\n mark(name) {\n this.milestones[`${name}_at_ms`] = Math.max(0, Math.round(this.now() - this.origin));\n }\n finish() {\n this.mark(\"completed\");\n return { ...this.milestones };\n }\n}\nexport { LatencyTimeline };\n", "runtime/telemetry.d.ts": "type TelemetryEvent = Record<string, boolean | number | string | undefined>;\ntype TelemetrySink = (event: TelemetryEvent) => void;\ndeclare class LatencyTimeline {\n private readonly now;\n private readonly origin;\n private readonly milestones;\n constructor(now?: () => number);\n mark(name: string): void;\n finish(): Record<string, number>;\n}\nexport { LatencyTimeline };\nexport type { TelemetryEvent, TelemetrySink };\n", "runtime/client.js": "import { ActorInvocationError, ActorProtocolError } from \"./errors.js\";\nimport { HttpActorHostTransport, connectionRefused, isRecord, parseActorHostReply, responseDocument } from \"./http.js\";\nimport { cloneJson } from \"./json.js\";\nimport { authorizationHeaders, configuredSettings, environmentSettings, projectActorPath, runtimeEnvironment, validateActorComponent, validateOrigin } from \"./settings.js\";\nimport { LatencyTimeline } from \"./telemetry.js\";\nconst TARGET_EXPIRATION_SAFETY_MS = 5_000;\nexport class HttpActorClient {\n settingsValue;\n environment;\n fetchRequest;\n requestId;\n actorHost;\n now;\n monotonicNow;\n telemetry;\n targets = new Map();\n constructor(options, dependencies = {}) {\n this.environment = dependencies.environment ?? runtimeEnvironment();\n this.fetchRequest = dependencies.fetch ?? globalThis.fetch;\n this.requestId = dependencies.requestId ?? (() => globalThis.crypto.randomUUID());\n this.actorHost = dependencies.actorHost ?? new HttpActorHostTransport(this.fetchRequest);\n // Workflow runtimes can replace Date.now with replayable logical time.\n this.now = dependencies.now ?? (() => performance.timeOrigin + performance.now());\n this.monotonicNow = dependencies.monotonicNow ?? (() => performance.now());\n this.telemetry = dependencies.telemetry ?? (() => { });\n this.settingsValue = options === undefined ? undefined : configuredSettings(options);\n }\n async invoke(actorName, actorId, method, args) {\n const requestId = validateActorComponent(\"request ID\", this.requestId());\n const timeline = new LatencyTimeline(this.monotonicNow);\n let outcome = \"failed\";\n try {\n const invocation = this.invocation(requestId, actorName, actorId, method, args);\n timeline.mark(\"invocation_built\");\n const result = await this.invokeAttempt(invocation, true, timeline);\n outcome = \"completed\";\n return result;\n }\n finally {\n this.telemetry({\n event: \"actor_client_invocation\",\n request_id: requestId,\n actor_name: actorName,\n actor_id: actorId,\n method,\n ...timeline.finish(),\n outcome\n });\n }\n }\n async invokeAttempt(invocation, retryAvailable, timeline) {\n let target = await this.cachedTarget(invocation, timeline);\n let reply;\n if (target) {\n reply = await this.direct(target, invocation);\n timeline.mark(\"host_rpc_completed\");\n }\n else {\n const key = actorKey(invocation.actorName, invocation.actorId);\n const current = this.targets.get(key);\n const resolved = await this.resolveAndInvoke(invocation);\n target = resolved.target;\n reply = resolved.reply;\n if ((reply.type === \"completed\" || reply.type === \"failed\") && this.targets.get(key) === current) {\n this.targets.set(key, { promise: Promise.resolve(target), target });\n }\n timeline.mark(\"control_plane_invocation_completed\");\n }\n if (reply.type === \"completed\")\n return reply.result;\n if (reply.type === \"failed\")\n throw new ActorInvocationError(reply.code, invocation.requestId, reply.message);\n this.invalidateTarget(invocation, target);\n if (!retryAvailable)\n throw new ActorInvocationError(reply.type === \"unauthenticated\" ? \"unauthenticated\" : \"unavailable\", invocation.requestId, \"actor host rejected the invocation before execution after recovery\");\n return this.invokeAttempt(invocation, false, timeline);\n }\n async direct(target, invocation) {\n try {\n return await this.actorHost.invoke(target, invocation);\n }\n catch (error) {\n this.invalidateTarget(invocation, target);\n if (error instanceof ActorInvocationError || error instanceof ActorProtocolError)\n throw error;\n const message = error instanceof Error ? error.message : String(error);\n throw new ActorInvocationError(\"outcome_unknown\", invocation.requestId, `actor-host HTTP request failed after dispatch: ${message}`);\n }\n }\n async resolveAndInvoke(invocation) {\n let response;\n try {\n response = await this.fetchRequest(`${this.settings.controlPlaneUrl}${projectActorPath(this.settings.projectId, invocation.actorName, invocation.actorId)}/invoke`, {\n method: \"POST\",\n redirect: \"manual\",\n headers: {\n accept: \"application/json\",\n ...authorizationHeaders(this.settings.credential),\n \"x-request-id\": invocation.requestId,\n \"content-type\": \"application/json\"\n },\n body: JSON.stringify({\n requestId: invocation.requestId,\n method: invocation.method,\n args: invocation.args,\n homeRegion: this.settings.homeRegion\n })\n });\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (connectionRefused(error))\n throw new ActorInvocationError(\"unavailable\", invocation.requestId, `could not connect to ${this.settings.controlPlaneUrl}: ${message}`);\n throw new ActorInvocationError(\"outcome_unknown\", invocation.requestId, `control-plane invocation failed after it may have been dispatched: ${message}`);\n }\n const document = await responseDocument(response);\n if (!response.ok)\n this.throwResponseFailure(response, document, invocation.requestId);\n if (!isRecord(document))\n throw new ActorProtocolError(\"control-plane response did not contain an invocation outcome and target\");\n const target = parseTarget(document.target);\n const reply = isRecord(document.outcome) && document.outcome.type === \"unauthenticated\"\n ? { type: \"unauthenticated\" }\n : parseActorHostReply(document.outcome);\n return { target, reply };\n }\n invalidateTarget(invocation, target) {\n const key = actorKey(invocation.actorName, invocation.actorId);\n if (this.targets.get(key)?.target === target)\n this.targets.delete(key);\n }\n async cachedTarget(invocation, timeline) {\n const key = actorKey(invocation.actorName, invocation.actorId);\n const current = this.targets.get(key);\n timeline.mark(\"target_cache_checked\");\n if (!current)\n return undefined;\n const target = await current.promise;\n if (this.targets.get(key) !== current)\n return this.cachedTarget(invocation, timeline);\n if (target.expiresAtMs > this.now() + TARGET_EXPIRATION_SAFETY_MS)\n return target;\n this.targets.delete(key);\n return undefined;\n }\n async target(invocation, timeline) {\n const cached = await this.cachedTarget(invocation, timeline);\n if (cached)\n return cached;\n const key = actorKey(invocation.actorName, invocation.actorId);\n if (this.targets.has(key))\n return this.target(invocation, timeline);\n const resolving = {\n promise: this.resolveTarget(invocation)\n .then(target => {\n resolving.target = target;\n return target;\n })\n .catch(error => {\n if (this.targets.get(key) === resolving)\n this.targets.delete(key);\n throw error;\n })\n };\n this.targets.set(key, resolving);\n return resolving.promise;\n }\n async resolveTarget(invocation) {\n let response;\n try {\n response = await this.fetchRequest(targetUrl(this.settings, invocation.actorName, invocation.actorId), {\n method: \"POST\",\n redirect: \"manual\",\n headers: {\n accept: \"application/json\",\n ...authorizationHeaders(this.settings.credential),\n \"x-request-id\": invocation.requestId,\n \"content-type\": \"application/json\"\n },\n body: JSON.stringify({ homeRegion: this.settings.homeRegion })\n });\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new ActorInvocationError(\"unavailable\", invocation.requestId, `control-plane HTTP request failed before dispatch: ${message}`);\n }\n const document = await responseDocument(response);\n if (!response.ok)\n this.throwResponseFailure(response, document, invocation.requestId);\n return parseTarget(document);\n }\n throwResponseFailure(response, document, requestId) {\n if (response.status === 401 || response.status === 403)\n throw new ActorInvocationError(\"unauthenticated\", requestId, \"the durable-actors application credential was rejected\");\n const failure = isRecord(document) ? document.error : undefined;\n if (!isRecord(failure) ||\n typeof failure.code !== \"string\" ||\n !failure.code ||\n typeof failure.message !== \"string\")\n throw new ActorProtocolError(`control-plane HTTP ${response.status} response did not contain a valid error`);\n throw new ActorInvocationError(failure.code, typeof failure.requestId === \"string\" ? failure.requestId : requestId, failure.message);\n }\n invocation(requestId, actorName, actorId, method, args) {\n return {\n requestId,\n projectId: this.settings.projectId,\n actorName: validateActorComponent(\"actor name\", actorName),\n actorId: validateActorComponent(\"actor ID\", actorId),\n method: validateActorComponent(\"actor method\", method),\n args: this.jsonArguments(args)\n };\n }\n get settings() {\n if (this.settingsValue !== undefined)\n return this.settingsValue;\n this.settingsValue = configuredSettings(environmentSettings(this.environment));\n return this.settingsValue;\n }\n jsonArguments(args) {\n const value = cloneJson(args, \"actor arguments\");\n if (!Array.isArray(value))\n throw new ActorProtocolError(\"actor arguments must be a JSON array\");\n return value;\n }\n}\nfunction parseTarget(document) {\n if (!isRecord(document) ||\n typeof document.route !== \"string\" ||\n typeof document.token !== \"string\" ||\n !document.token.trim() ||\n !positiveInteger(document.ownerEpoch) ||\n !positiveInteger(document.expiresAtMs))\n throw new ActorProtocolError(\"control-plane response did not contain a valid actor host target\");\n validateOrigin(document.route);\n return {\n route: document.route,\n token: document.token,\n ownerEpoch: document.ownerEpoch,\n expiresAtMs: document.expiresAtMs\n };\n}\nfunction targetUrl(settings, actorName, actorId) {\n const actor = validateActorComponent(\"actor name\", actorName);\n const id = validateActorComponent(\"actor ID\", actorId);\n return `${settings.controlPlaneUrl}${projectActorPath(settings.projectId, actor, id)}/find-actor`;\n}\nfunction actorKey(actorName, actorId) {\n return `${actorName}\\u001f${actorId}`;\n}\nfunction positiveInteger(value) {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value > 0;\n}\n", "runtime/client.d.ts": "import type { ActorHostTarget, ActorHostTransport, ActorInvocation } from \"./http.js\";\nimport { configuredSettings } from \"./settings.js\";\nimport type { DurableActorsClientOptions, Environment } from \"./settings.js\";\nimport { LatencyTimeline } from \"./telemetry.js\";\nimport type { TelemetrySink } from \"./telemetry.js\";\nexport declare class HttpActorClient {\n private settingsValue;\n protected readonly environment: Environment;\n protected readonly fetchRequest: typeof globalThis.fetch;\n protected readonly requestId: () => string;\n protected readonly actorHost: ActorHostTransport;\n protected readonly now: () => number;\n protected readonly monotonicNow: () => number;\n protected readonly telemetry: TelemetrySink;\n protected readonly targets: Map<string, TargetResolution>;\n constructor(options?: DurableActorsClientOptions, dependencies?: HttpActorClientDependencies);\n invoke(actorName: string, actorId: string, method: string, args: readonly unknown[]): Promise<unknown>;\n private invokeAttempt;\n private direct;\n private resolveAndInvoke;\n private invalidateTarget;\n private cachedTarget;\n protected target(invocation: ActorAddress, timeline: LatencyTimeline): Promise<ActorHostTarget>;\n private resolveTarget;\n private throwResponseFailure;\n private invocation;\n protected get settings(): RemoteActorSettings;\n private jsonArguments;\n}\ntype ActorAddress = Pick<ActorInvocation, \"requestId\" | \"projectId\" | \"actorName\" | \"actorId\">;\ninterface TargetResolution {\n readonly promise: Promise<ActorHostTarget>;\n target?: ActorHostTarget;\n}\ntype RemoteActorSettings = ReturnType<typeof configuredSettings>;\nexport interface HttpActorClientDependencies {\n readonly environment?: Environment;\n readonly fetch?: typeof globalThis.fetch;\n readonly requestId?: () => string;\n readonly actorHost?: ActorHostTransport;\n readonly now?: () => number;\n readonly monotonicNow?: () => number;\n readonly telemetry?: TelemetrySink;\n}\nexport type { DurableActorsClientOptions };\n", "runtime/proxy.js": "import { ActorProtocolError, ActorSerializationError, ActorValidationError } from \"./errors.js\";\nimport { isRecord } from \"./http.js\";\nimport { authorizationHeaders, configuredSettings, environmentSettings, projectActorPath, validateActorComponent } from \"./settings.js\";\n/** Issues browser connection URLs from your backend. */\nclass SocketProxy {\n actors;\n projectId;\n origin;\n apiKey;\n setupTimeoutMs;\n fetchRequest;\n constructor(actors, options = {}, dependencies = {}) {\n this.actors = actors;\n this.setupTimeoutMs = options.setupTimeoutMs ?? 180000;\n if (!Number.isSafeInteger(this.setupTimeoutMs) || this.setupTimeoutMs < 1000 || this.setupTimeoutMs > 600000)\n throw new Error(\"Socket setup timeout must be between one second and ten minutes\");\n const settings = configuredSettings(proxySettings(options));\n this.origin = settings.controlPlaneUrl;\n this.apiKey = settings.credential;\n this.projectId = settings.projectId;\n this.fetchRequest = dependencies.fetch ?? globalThis.fetch;\n }\n /**\n * Call after authenticating the user and checking actor access.\n * Pass `websocketUrl` to the browser's `new WebSocket()`.\n */\n async handle(authorization) {\n const actorName = validateActorComponent(\"actor name\", authorization.actorName);\n const actorId = validateActorComponent(\"actor ID\", authorization.actorId);\n if (!Object.hasOwn(this.actors, actorName))\n throw new Error(`Unknown actor name: ${actorName}`);\n const metadata = socketMetadata(authorization.metadata);\n const authorizationLifetimeMs = authorization.authorizationLifetimeMs ?? 900000;\n if (!Number.isSafeInteger(authorizationLifetimeMs) ||\n authorizationLifetimeMs < 1000 ||\n authorizationLifetimeMs > 86400000)\n throw new Error(\"Socket authorization lifetime must be between one second and one day\");\n const homeRegion = authorization.homeRegion === undefined\n ? undefined\n : validateActorComponent(\"home region\", authorization.homeRegion);\n const response = await this.fetchRequest(`${this.origin}${projectActorPath(this.projectId, actorName, actorId)}/find-websocket`, {\n method: \"POST\",\n redirect: \"manual\",\n headers: { ...authorizationHeaders(this.apiKey), \"content-type\": \"application/json\" },\n body: JSON.stringify({ metadata, authorizationLifetimeMs, homeRegion }),\n signal: AbortSignal.timeout(this.setupTimeoutMs)\n });\n if (!response.ok)\n throw new Error(`WebSocket authorization could not be issued (HTTP ${response.status})`);\n return socketGrant(await response.json());\n }\n}\nfunction proxySettings(options) {\n const environment = environmentSettings();\n const controlPlaneUrl = options.controlPlaneUrl ?? environment.controlPlaneUrl;\n const apiKey = options.apiKey ?? environment.apiKey;\n return {\n projectId: options.projectId ?? environment.projectId,\n controlPlaneUrl: controlPlaneUrl ?? \"http://127.0.0.1:7100\",\n apiKey\n };\n}\nexport { SocketProxy };\nfunction socketGrant(value) {\n if (!isRecord(value) ||\n typeof value.websocketUrl !== \"string\" ||\n !URL.canParse(value.websocketUrl) ||\n !/^wss?:$/u.test(new URL(value.websocketUrl).protocol) ||\n typeof value.homeRegion !== \"string\" ||\n !value.homeRegion ||\n !Number.isSafeInteger(value.connectByMs) ||\n !Number.isSafeInteger(value.authorizedUntilMs))\n throw new ActorProtocolError(\"invalid WebSocket authorization response\");\n return {\n websocketUrl: value.websocketUrl,\n homeRegion: value.homeRegion,\n connectByMs: value.connectByMs,\n authorizedUntilMs: value.authorizedUntilMs\n };\n}\nfunction socketMetadata(value) {\n let encoded;\n try {\n encoded = JSON.stringify(value);\n if (!isJsonValue(value))\n throw new Error(\"invalid JSON value\");\n }\n catch (error) {\n throw new ActorSerializationError(\"socket metadata must be a JSON value\", { cause: error });\n }\n if (new TextEncoder().encode(encoded).length > 16 * 1024)\n throw new ActorValidationError(\"socket metadata exceeds 16384 bytes\");\n return value;\n}\nfunction isJsonValue(value) {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\")\n return true;\n if (typeof value === \"number\")\n return Number.isFinite(value);\n if (Array.isArray(value))\n return Array.from(value).every(isJsonValue);\n return (isRecord(value) &&\n [Object.prototype, null].includes(Object.getPrototypeOf(value)) &&\n Object.values(value).every(isJsonValue));\n}\n", "runtime/proxy.d.ts": "/** Overrides for the backend's DURABLE_ACTORS environment settings. */\ninterface SocketProxyOptions {\n readonly projectId?: string;\n readonly controlPlaneUrl?: string;\n readonly apiKey?: string;\n /** Defaults to 180000 ms; accepts 1000–600000 ms. */\n readonly setupTimeoutMs?: number;\n}\ninterface SocketProxyDependencies {\n readonly fetch?: typeof globalThis.fetch;\n}\ninterface ProxyActor<Metadata = unknown> {\n readonly types?: Metadata;\n}\n/** Actor access your backend has already authorized. */\ntype SocketAuthorization<Actors extends Record<string, ProxyActor>> = {\n [Name in keyof Actors & string]: {\n readonly actorName: Name;\n readonly actorId: string;\n readonly metadata: Actors[Name] extends ProxyActor<infer Metadata> ? Metadata : never;\n readonly homeRegion?: string;\n readonly authorizationLifetimeMs?: number;\n };\n}[keyof Actors & string];\n/** Browser connection URL and deadlines in Unix milliseconds. Treat the URL as a credential. */\ninterface SocketGrant {\n websocketUrl: string;\n homeRegion: string;\n connectByMs: number;\n authorizedUntilMs: number;\n}\n/** Issues browser connection URLs from your backend. */\ndeclare class SocketProxy<Actors extends Record<string, ProxyActor>> {\n private readonly actors;\n private readonly projectId;\n private readonly origin;\n private readonly apiKey;\n private readonly setupTimeoutMs;\n private readonly fetchRequest;\n constructor(actors: Actors, options?: SocketProxyOptions, dependencies?: SocketProxyDependencies);\n /**\n * Call after authenticating the user and checking actor access.\n * Pass `websocketUrl` to the browser's `new WebSocket()`.\n */\n handle(authorization: SocketAuthorization<Actors>): Promise<SocketGrant>;\n}\nexport { SocketProxy };\nexport type { ProxyActor, SocketAuthorization, SocketGrant, SocketProxyDependencies, SocketProxyOptions };\n", "runtime/stub.js": "import { HttpActorClient } from \"./client.js\";\nimport { ActorDefinitionError, ActorSerializationError } from \"./errors.js\";\nimport { validateActorComponent } from \"./settings.js\";\n/** Creates a backend client from generated method definitions. */\nfunction createActorStub(actorName, actorId, methods, transport) {\n validateActorComponent(\"actor name\", actorName);\n validateActorComponent(\"actor ID\", actorId);\n const stub = Object.create(null);\n for (const method of methods) {\n validateActorComponent(\"actor method\", method.name);\n if ([\"then\", \"connect\", \"broadcast\", \"onConnect\", \"onMessage\", \"onDisconnect\"].includes(method.name))\n throw new ActorDefinitionError(`actor method ${actorName}.${method.name} is reserved`);\n if (Object.hasOwn(stub, method.name))\n throw new ActorDefinitionError(`duplicate actor method ${actorName}.${method.name}`);\n Object.defineProperty(stub, method.name, {\n enumerable: true,\n value: async (...args) => {\n const parameters = invocationArguments(args);\n const client = transport ?? defaultTransport();\n const result = await client.invoke(actorName, actorId, method.name, parameters);\n return method.result === \"void\" ? undefined : result;\n }\n });\n }\n return stub;\n}\nexport { createActorStub };\nlet shared;\nexport function createActorTransport(options) {\n return new HttpActorClient(options);\n}\nfunction defaultTransport() {\n return (shared ??= new HttpActorClient());\n}\nfunction invocationArguments(args) {\n let end = args.length;\n while (end > 0 && args[end - 1] === undefined)\n end--;\n const parameters = args.slice(0, end);\n if (parameters.includes(undefined))\n throw new ActorSerializationError(\"undefined cannot precede a supplied RPC argument in JSON transport\");\n return parameters;\n}\n", "runtime/stub.d.ts": "import type { DurableActorsClientOptions } from \"./settings.js\";\ninterface ActorRpcTransport {\n invoke(actorName: string, actorId: string, method: string, args: readonly unknown[]): Promise<unknown>;\n}\ninterface ActorRpcMethod {\n readonly name: string;\n readonly result: \"void\" | \"value\";\n}\n/** Creates a backend client from generated method definitions. */\ndeclare function createActorStub<Stub extends object>(actorName: string, actorId: string, methods: readonly ActorRpcMethod[], transport?: ActorRpcTransport): Stub;\nexport { createActorStub };\nexport type { ActorRpcMethod, ActorRpcTransport };\nexport declare function createActorTransport(options: DurableActorsClientOptions): ActorRpcTransport;\nexport type { DurableActorsClientOptions };\n", "runtime/session.js": "import { HttpActorClient } from \"./client.js\";\nimport { ActorSessionRejectedError } from \"./errors.js\";\nimport { validateActorComponent, validateOrigin } from \"./settings.js\";\nexport { ActorSessionRejectedError } from \"./errors.js\";\n/**\n * Reuses actor targets and renews runtime-issued sessions through a trusted backend.\n * Sessions require an HTTPS origin (except localhost) and at most five minutes of validity.\n * Renewal stops after a minute without invocations; dispose cancels it immediately.\n */\nexport class ActorSessionTransport {\n options;\n transport;\n expiresAtMs = 0;\n lastUsedAt = 0;\n pending;\n cancel;\n closed = false;\n now;\n createTransport;\n schedule;\n constructor(options, dependencies = {}) {\n this.options = options;\n validateActorComponent(\"project ID\", options.projectId);\n this.now = dependencies.now ?? (() => performance.timeOrigin + performance.now());\n this.createTransport = dependencies.createTransport ?? (settings => new HttpActorClient(settings));\n this.schedule = dependencies.schedule ?? scheduleRefresh;\n }\n async invoke(actorName, actorId, method, args) {\n if (this.closed)\n throw new Error(\"Actor session transport is disposed\");\n this.lastUsedAt = this.now();\n const transport = this.transport && this.expiresAtMs > this.now() + 5_000 ? this.transport : await this.refresh();\n return transport.invoke(actorName, actorId, method, args);\n }\n dispose() {\n this.closed = true;\n this.cancel?.();\n this.transport = undefined;\n }\n refresh() {\n if (this.pending)\n return this.pending;\n this.cancel?.();\n this.pending = this.exchange().finally(() => {\n this.pending = undefined;\n });\n return this.pending;\n }\n async exchange() {\n let session;\n try {\n session = await this.options.getSession();\n }\n catch (error) {\n if (error instanceof ActorSessionRejectedError) {\n this.transport = undefined;\n this.expiresAtMs = 0;\n }\n throw error;\n }\n const remaining = this.validateSession(session);\n if (this.closed)\n throw new Error(\"Actor session transport is disposed\");\n const transport = this.createTransport({\n projectId: session.projectId,\n controlPlaneUrl: session.controlPlaneUrl,\n apiKey: session.token\n });\n this.transport = transport;\n this.expiresAtMs = session.expiresAtMs;\n this.scheduleRenewal(remaining * (0.75 + Math.random() * 0.05));\n return transport;\n }\n validateSession(session) {\n if (!session ||\n session.projectId !== this.options.projectId ||\n typeof session.token !== \"string\" ||\n !session.token.trim() ||\n !Number.isSafeInteger(session.expiresAtMs))\n throw new Error(\"Invalid actor session\");\n const origin = new URL(validateOrigin(session.controlPlaneUrl));\n if (origin.protocol !== \"https:\" && ![\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(origin.hostname))\n throw new Error(\"Actor sessions require HTTPS outside localhost\");\n const remaining = session.expiresAtMs - this.now();\n if (remaining <= 5_000 || remaining > 305_000)\n throw new Error(\"Actor session is expired or invalid\");\n return remaining;\n }\n scheduleRenewal(delayMs) {\n this.cancel = this.schedule(() => {\n if (this.closed || this.now() - this.lastUsedAt >= 60_000)\n return;\n void this.refresh().catch(() => {\n if (!this.closed && this.expiresAtMs > this.now() + 5_000)\n this.scheduleRenewal(5_000);\n });\n }, delayMs);\n }\n}\nexport function createActorSessionTransport(options) {\n return new ActorSessionTransport(options);\n}\nfunction scheduleRefresh(callback, delayMs) {\n const timer = setTimeout(callback, delayMs);\n timer.unref?.();\n return () => clearTimeout(timer);\n}\n", "runtime/session.d.ts": "import type { DurableActorsClientOptions } from \"./settings.js\";\nimport type { ActorRpcTransport } from \"./stub.js\";\nexport interface ActorSession {\n readonly projectId: string;\n readonly controlPlaneUrl: string;\n readonly token: string;\n readonly expiresAtMs: number;\n}\nexport interface ActorSessionTransportOptions {\n readonly projectId: string;\n /** Reauthenticate with your application backend. Throw ActorSessionRejectedError on an explicit denial. */\n readonly getSession: () => Promise<ActorSession>;\n}\nexport interface ActorSessionTransportDependencies {\n readonly now?: () => number;\n readonly createTransport?: (options: DurableActorsClientOptions) => ActorRpcTransport;\n readonly schedule?: (callback: () => void, delayMs: number) => () => void;\n}\nexport { ActorSessionRejectedError } from \"./errors.js\";\n/**\n * Reuses actor targets and renews runtime-issued sessions through a trusted backend.\n * Sessions require an HTTPS origin (except localhost) and at most five minutes of validity.\n * Renewal stops after a minute without invocations; dispose cancels it immediately.\n */\nexport declare class ActorSessionTransport implements ActorRpcTransport {\n private readonly options;\n private transport;\n private expiresAtMs;\n private lastUsedAt;\n private pending;\n private cancel;\n private closed;\n private readonly now;\n private readonly createTransport;\n private readonly schedule;\n constructor(options: ActorSessionTransportOptions, dependencies?: ActorSessionTransportDependencies);\n invoke(actorName: string, actorId: string, method: string, args: readonly unknown[]): Promise<unknown>;\n dispose(): void;\n private refresh;\n private exchange;\n private validateSession;\n private scheduleRenewal;\n}\nexport declare function createActorSessionTransport(options: ActorSessionTransportOptions): ActorSessionTransport;\n", "runtime/index.browser.js": "const createActorStub = () => {\n throw new Error(\"actors must be used on the server\");\n};\nconst createActorTransport = () => {\n throw new Error(\"actors must be used on the server\");\n};\nconst createActorSessionTransport = () => {\n throw new Error(\"actors must be used on the server\");\n};\nconst SocketProxy = class {\n constructor() {\n throw new Error(\"ActorProxy must be used on the server\");\n }\n};\nexport { createActorStub, createActorTransport, createActorSessionTransport, SocketProxy };\nexport { ActorInvocationError, ActorSessionRejectedError } from \"./errors.js\";\n", "runtime/index.browser.d.ts": "import type { SocketProxy as ServerProxy } from \"./proxy.js\";\nimport type { createActorSessionTransport as ServerSessionTransport } from \"./session.js\";\nimport type { createActorStub as ServerStub, createActorTransport as ServerTransport } from \"./stub.js\";\ndeclare const createActorStub: typeof ServerStub;\ndeclare const createActorTransport: typeof ServerTransport;\ndeclare const createActorSessionTransport: typeof ServerSessionTransport;\ndeclare const SocketProxy: typeof ServerProxy;\nexport { createActorStub, createActorTransport, createActorSessionTransport, SocketProxy };\nexport { ActorInvocationError, ActorSessionRejectedError } from \"./errors.js\";\nexport type { ActorSession, ActorSessionTransportOptions, ActorSessionTransport } from \"./session.js\";\n", "runtime/index.js": "export { createActorStub, createActorTransport } from \"./stub.js\";\nexport { createActorSessionTransport, ActorSessionRejectedError } from \"./session.js\";\nexport { ActorInvocationError } from \"./errors.js\";\nexport { SocketProxy } from \"./proxy.js\";\n", "runtime/index.d.ts": "export { createActorStub, createActorTransport } from \"./stub.js\";\nexport { createActorSessionTransport, ActorSessionRejectedError } from \"./session.js\";\nexport type { ActorSession, ActorSessionTransportOptions, ActorSessionTransport } from \"./session.js\";\nexport type { ActorRpcTransport, DurableActorsClientOptions } from \"./stub.js\";\nexport { ActorInvocationError } from \"./errors.js\";\nexport { SocketProxy } from \"./proxy.js\";\nexport type { ProxyActor, SocketGrant, SocketProxyDependencies, SocketProxyOptions } from \"./proxy.js\";\n", "runtime/package.json": "{\n \"private\": true,\n \"type\": \"module\",\n \"sideEffects\": false,\n \"browser\": {\n \"./index.js\": \"./index.browser.js\"\n }\n}\n", "runtime/LICENSE.md": "MIT License\n\nCopyright (c) 2026 Terse\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n" };
1
+ export const runtimeFiles = { "runtime/errors.js": "class ActorConfigurationError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorConfigurationError\";\n }\n}\nclass ActorDefinitionError extends Error {\n constructor(message) {\n super(message);\n this.name = \"ActorDefinitionError\";\n }\n}\n/** Remote failure. Retrying an `outcome_unknown` operation may run it twice; `unavailable` never ran. */\nclass ActorInvocationError extends Error {\n /** Error category, such as `actor_error` or `outcome_unknown`. New codes may be added. */\n code;\n /** Identifies this caller attempt; it is not an application idempotency key. */\n requestId;\n constructor(code, requestId, message) {\n super(message);\n this.name = \"ActorInvocationError\";\n this.code = code;\n this.requestId = requestId;\n }\n}\n/** Signals that the authorization service explicitly revoked or denied access. */\nclass ActorSessionRejectedError extends Error {\n name = \"ActorSessionRejectedError\";\n}\nclass ActorSessionError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorSessionError\";\n }\n}\nclass ActorProtocolError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorProtocolError\";\n }\n}\nclass ActorSerializationError extends Error {\n constructor(message, options) {\n super(message, options);\n this.name = \"ActorSerializationError\";\n }\n}\nclass ActorValidationError extends Error {\n constructor(message) {\n super(message);\n this.name = \"ActorValidationError\";\n }\n}\nexport { ActorConfigurationError, ActorDefinitionError, ActorInvocationError, ActorProtocolError, ActorSerializationError, ActorSessionError, ActorSessionRejectedError, ActorValidationError };\nfunction errorMessage(error) {\n return error instanceof Error ? error.message : String(error);\n}\nexport { errorMessage };\n", "runtime/errors.d.ts": "declare class ActorConfigurationError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorDefinitionError extends Error {\n constructor(message: string);\n}\n/** Remote failure. Retrying an `outcome_unknown` operation may run it twice; `unavailable` never ran. */\ndeclare class ActorInvocationError extends Error {\n /** Error category, such as `actor_error` or `outcome_unknown`. New codes may be added. */\n readonly code: string;\n /** Identifies this caller attempt; it is not an application idempotency key. */\n readonly requestId: string;\n constructor(code: string, requestId: string, message: string);\n}\n/** Signals that the authorization service explicitly revoked or denied access. */\ndeclare class ActorSessionRejectedError extends Error {\n readonly name = \"ActorSessionRejectedError\";\n}\ndeclare class ActorSessionError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorProtocolError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorSerializationError extends Error {\n constructor(message: string, options?: ErrorOptions);\n}\ndeclare class ActorValidationError extends Error {\n constructor(message: string);\n}\nexport { ActorConfigurationError, ActorDefinitionError, ActorInvocationError, ActorProtocolError, ActorSerializationError, ActorSessionError, ActorSessionRejectedError, ActorValidationError };\ndeclare function errorMessage(error: unknown): string;\nexport { errorMessage };\n", "runtime/json.js": "import { ActorSerializationError } from \"./errors.js\";\nfunction cloneJson(value, label) {\n try {\n const encoded = JSON.stringify(value);\n if (encoded === undefined)\n throw new ActorSerializationError(`${label} must be JSON serializable`);\n return JSON.parse(encoded);\n }\n catch (error) {\n if (error instanceof ActorSerializationError)\n throw error;\n throw new ActorSerializationError(`${label} must be JSON serializable`, { cause: error });\n }\n}\nexport { cloneJson };\n", "runtime/json.d.ts": "type JsonPrimitive = string | number | boolean | null;\ntype JsonObject = {\n readonly [key: string]: JsonValue;\n};\ntype JsonValue = JsonPrimitive | JsonObject | readonly JsonValue[];\ndeclare function cloneJson(value: unknown, label: string): JsonValue;\nexport { cloneJson };\nexport type { JsonValue };\n", "runtime/settings.js": "import { ActorConfigurationError, ActorValidationError } from \"./errors.js\";\nexport function configuredSettings(value) {\n if (typeof value !== \"object\" ||\n value === null ||\n Array.isArray(value) ||\n Object.keys(value).some(key => ![\"projectId\", \"apiKey\", \"homeRegion\", \"controlPlaneUrl\"].includes(key)))\n throw new ActorConfigurationError(\"durable-actors client settings are invalid\");\n const options = value;\n const controlPlaneUrl = validateOrigin(options.controlPlaneUrl);\n const local = [\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(new URL(controlPlaneUrl).hostname);\n const projectId = options.projectId ?? (local ? \"local\" : undefined);\n if (typeof projectId !== \"string\" || !/^[A-Za-z0-9._-]{1,64}$/u.test(projectId) || [\".\", \"..\"].includes(projectId))\n throw new ActorConfigurationError(\"durable-actors client settings are invalid: a valid projectId is required for remote connections\");\n if (options.apiKey !== undefined && (typeof options.apiKey !== \"string\" || !options.apiKey.trim()))\n throw new ActorConfigurationError(\"durable-actors client settings are invalid: apiKey must not be empty\");\n if (options.homeRegion !== undefined)\n validateActorComponent(\"home region\", options.homeRegion);\n return { projectId, credential: options.apiKey?.trim(), homeRegion: options.homeRegion, controlPlaneUrl };\n}\nexport function environmentSettings(environment = runtimeEnvironment()) {\n return {\n projectId: environment.DURABLE_ACTORS_PROJECT_ID,\n apiKey: environment.DURABLE_ACTORS_SECRET ?? environment.DURABLE_ACTORS_API_KEY,\n homeRegion: environment.DURABLE_ACTORS_HOME_REGION,\n controlPlaneUrl: environment.DURABLE_ACTORS_CONTROL_PLANE_URL ?? \"http://127.0.0.1:7100\"\n };\n}\nexport function runtimeEnvironment() {\n return globalThis.process?.env ?? {};\n}\nexport function validateOrigin(origin) {\n let url;\n try {\n url = new URL(origin);\n }\n catch (error) {\n throw new ActorConfigurationError(`actor HTTP origin is invalid: ${origin}`, { cause: error });\n }\n if (!/^https?:$/u.test(url.protocol) ||\n !url.hostname ||\n url.username ||\n url.password ||\n url.pathname !== \"/\" ||\n url.search ||\n url.hash)\n throw new ActorConfigurationError(`actor URL must be an HTTP or HTTPS origin: ${origin}`);\n return url.origin;\n}\nexport function validateActorComponent(name, value) {\n if (typeof value !== \"string\" || !/^[A-Za-z0-9._-]+$/u.test(value) || value === \".\" || value === \"..\")\n throw new ActorValidationError(`${name} may contain only ASCII letters, digits, '.', '-', and '_' and must not be a path segment`);\n return value;\n}\nexport function projectActorPath(projectId, actorName, actorId) {\n return `/v1/projects/${encodeURIComponent(validateActorComponent(\"project ID\", projectId))}/actors/${encodeURIComponent(validateActorComponent(\"actor name\", actorName))}/${encodeURIComponent(validateActorComponent(\"actor ID\", actorId))}`;\n}\nexport function authorizationHeaders(credential) {\n return credential === undefined ? {} : { authorization: `Bearer ${credential}` };\n}\n", "runtime/settings.d.ts": "export interface DurableActorsClientOptions {\n readonly projectId?: string;\n readonly apiKey?: string;\n readonly homeRegion?: string;\n readonly controlPlaneUrl: string;\n}\nexport type Environment = Record<string, string | undefined>;\nexport declare function configuredSettings(value: unknown): {\n projectId: string;\n credential: string | undefined;\n homeRegion: string | undefined;\n controlPlaneUrl: string;\n};\nexport declare function environmentSettings(environment?: Environment): DurableActorsClientOptions;\nexport declare function runtimeEnvironment(): Environment;\nexport declare function validateOrigin(origin: string): string;\nexport declare function validateActorComponent(name: string, value: string): string;\nexport declare function projectActorPath(projectId: string, actorName: string, actorId: string): string;\nexport declare function authorizationHeaders(credential: string | undefined): Record<string, string>;\n", "runtime/http.js": "import { ActorProtocolError } from \"./errors.js\";\nimport { projectActorPath, validateOrigin } from \"./settings.js\";\nexport class HttpActorHostTransport {\n fetchRequest;\n constructor(fetchRequest = globalThis.fetch) {\n this.fetchRequest = fetchRequest;\n }\n async invoke(target, invocation) {\n let response;\n try {\n response = await this.post(target, invocation, \"invoke\", {\n requestId: invocation.requestId,\n ownerEpoch: target.ownerEpoch,\n method: invocation.method,\n args: invocation.args\n });\n }\n catch (error) {\n if (connectionRefused(error))\n return { type: \"not_executed\", reason: \"upstream_not_reached\" };\n throw error;\n }\n // A 401 is issued before dispatch, so refreshing this ticket cannot repeat actor code.\n if (response.status === 401)\n return { type: \"unauthenticated\" };\n if (!response.ok)\n throw new Error(`actor host returned HTTP ${response.status}`);\n return parseActorHostReply(await responseDocument(response));\n }\n async publish(target, actor, effects) {\n const response = await this.post(target, actor, \"socket-effects\", { ownerEpoch: target.ownerEpoch, effects });\n if (!response.ok)\n throw new Error(`socket effects returned HTTP ${response.status}`);\n }\n post(target, actor, endpoint, body) {\n return this.fetchRequest(`${validateOrigin(target.route)}${projectActorPath(actor.projectId, actor.actorName, actor.actorId)}/${endpoint}`, {\n method: \"POST\",\n redirect: \"manual\",\n headers: {\n authorization: `Bearer ${target.token}`,\n \"content-type\": \"application/json\",\n accept: \"application/json\"\n },\n body: JSON.stringify(body)\n });\n }\n}\nexport function parseActorHostReply(reply) {\n if (isRecord(reply)) {\n const metadata = parseMetadata(reply);\n if (reply.type === \"completed\" && Object.hasOwn(reply, \"result\"))\n return { type: \"completed\", result: reply.result, ...metadata };\n if (reply.type === \"failed\" &&\n typeof reply.code === \"string\" &&\n reply.code.length > 0 &&\n typeof reply.message === \"string\")\n return { type: \"failed\", code: reply.code, message: reply.message, ...metadata };\n if (reply.type === \"not_executed\" && rejectionReason(reply.reason))\n return { type: \"not_executed\", reason: reply.reason, ...metadata };\n }\n throw new ActorProtocolError(\"actor host response did not contain a valid outcome\");\n}\nfunction parseMetadata(reply) {\n if (!Object.hasOwn(reply, \"metadata\"))\n return {};\n const metadata = reply.metadata;\n if (!isRecord(metadata) ||\n !nonnegativeFiniteNumber(metadata.routingMs) ||\n !nonnegativeFiniteNumber(metadata.durationMs) ||\n (metadata.queueWaitMs !== null &&\n (!nonnegativeFiniteNumber(metadata.queueWaitMs) || metadata.queueWaitMs > metadata.durationMs)) ||\n (metadata.hostState !== \"cold\" && metadata.hostState !== \"warm\"))\n throw new ActorProtocolError(\"actor host response contained invalid latency metadata\");\n return {\n metadata: {\n routingMs: metadata.routingMs,\n durationMs: metadata.durationMs,\n queueWaitMs: metadata.queueWaitMs,\n hostState: metadata.hostState\n }\n };\n}\nfunction nonnegativeFiniteNumber(value) {\n return typeof value === \"number\" && Number.isFinite(value) && value >= 0;\n}\nfunction rejectionReason(value) {\n return value === \"stale_owner\" || value === \"host_unavailable\" || value === \"upstream_not_reached\";\n}\nexport function connectionRefused(error, ancestors = new Set()) {\n if (!isRecord(error) || ancestors.has(error))\n return false;\n const visited = new Set(ancestors).add(error);\n if (error.code !== undefined && error.code !== \"ECONNREFUSED\")\n return false;\n if (error.errors !== undefined)\n return (Array.isArray(error.errors) &&\n error.errors.length > 0 &&\n error.errors.every(cause => connectionRefused(cause, visited)));\n if (error.code === \"ECONNREFUSED\")\n return error.syscall === \"connect\";\n return connectionRefused(error.cause, visited);\n}\nexport async function responseDocument(response) {\n try {\n return await response.json();\n }\n catch (error) {\n throw new ActorProtocolError(`HTTP ${response.status} response was not valid JSON`, { cause: error });\n }\n}\nexport function isRecord(value) {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n", "runtime/http.d.ts": "import type { JsonValue } from \"./json.js\";\nexport declare class HttpActorHostTransport implements ActorHostTransport {\n private readonly fetchRequest;\n constructor(fetchRequest?: typeof globalThis.fetch);\n invoke(target: ActorHostTarget, invocation: ActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n private post;\n}\nexport declare function parseActorHostReply(reply: unknown): ActorHostReply;\nexport declare function connectionRefused(error: unknown, ancestors?: Set<unknown>): boolean;\nexport declare function responseDocument(response: Response): Promise<unknown>;\nexport declare function isRecord(value: unknown): value is Record<string, unknown>;\nexport interface ActorAddress {\n readonly projectId: string;\n readonly actorName: string;\n readonly actorId: string;\n}\nexport interface ActorHostTarget {\n readonly route: string;\n readonly token: string;\n readonly ownerEpoch: number;\n readonly expiresAtMs: number;\n}\nexport interface ActorInvocation extends ActorAddress {\n readonly requestId: string;\n readonly method: string;\n readonly args: readonly JsonValue[];\n}\ntype ActorRejectionReason = \"stale_owner\" | \"host_unavailable\" | \"upstream_not_reached\";\nexport interface ActorResponseMetadata {\n readonly routingMs: number;\n readonly durationMs: number;\n readonly queueWaitMs: number | null;\n readonly hostState: \"cold\" | \"warm\";\n}\nexport type ActorHostReply = ({\n readonly type: \"completed\";\n readonly result: unknown;\n} | {\n readonly type: \"failed\";\n readonly code: string;\n readonly message: string;\n} | {\n readonly type: \"unauthenticated\";\n} | {\n readonly type: \"not_executed\";\n readonly reason: ActorRejectionReason;\n}) & {\n readonly metadata?: ActorResponseMetadata;\n};\nexport interface ActorHostTransport {\n invoke(target: ActorHostTarget, invocation: ActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n}\nexport {};\n", "runtime/telemetry.js": "class LatencyTimeline {\n now;\n origin;\n milestones = { started_at_ms: 0 };\n constructor(now = () => performance.now()) {\n this.now = now;\n this.origin = this.now();\n }\n mark(name) {\n this.milestones[`${name}_at_ms`] = Math.max(0, Math.round(this.now() - this.origin));\n }\n finish() {\n this.mark(\"completed\");\n return { ...this.milestones };\n }\n}\nexport { LatencyTimeline };\n", "runtime/telemetry.d.ts": "type TelemetryEvent = Record<string, boolean | number | string | undefined>;\ntype TelemetrySink = (event: TelemetryEvent) => void;\ndeclare class LatencyTimeline {\n private readonly now;\n private readonly origin;\n private readonly milestones;\n constructor(now?: () => number);\n mark(name: string): void;\n finish(): Record<string, number>;\n}\nexport { LatencyTimeline };\nexport type { TelemetryEvent, TelemetrySink };\n", "runtime/client.js": "import { ActorInvocationError, ActorProtocolError } from \"./errors.js\";\nimport { HttpActorHostTransport, connectionRefused, isRecord, parseActorHostReply, responseDocument } from \"./http.js\";\nimport { cloneJson } from \"./json.js\";\nimport { authorizationHeaders, configuredSettings, environmentSettings, projectActorPath, runtimeEnvironment, validateActorComponent, validateOrigin } from \"./settings.js\";\nimport { LatencyTimeline } from \"./telemetry.js\";\nconst TARGET_EXPIRATION_SAFETY_MS = 5_000;\nexport class HttpActorClient {\n settingsValue;\n environment;\n fetchRequest;\n requestId;\n actorHost;\n now;\n monotonicNow;\n telemetry;\n targets = new Map();\n constructor(options, dependencies = {}) {\n this.environment = dependencies.environment ?? runtimeEnvironment();\n this.fetchRequest = dependencies.fetch ?? globalThis.fetch;\n this.requestId = dependencies.requestId ?? (() => globalThis.crypto.randomUUID());\n this.actorHost = dependencies.actorHost ?? new HttpActorHostTransport(this.fetchRequest);\n // Workflow runtimes can replace Date.now with replayable logical time.\n this.now = dependencies.now ?? (() => performance.timeOrigin + performance.now());\n this.monotonicNow = dependencies.monotonicNow ?? (() => performance.now());\n this.telemetry = dependencies.telemetry ?? (() => { });\n this.settingsValue = options === undefined ? undefined : configuredSettings(options);\n }\n async invoke(actorName, actorId, method, args) {\n const requestId = validateActorComponent(\"request ID\", this.requestId());\n const timeline = new LatencyTimeline(this.monotonicNow);\n let outcome = \"failed\";\n try {\n const invocation = this.invocation(requestId, actorName, actorId, method, args);\n timeline.mark(\"invocation_built\");\n const result = await this.invokeAttempt(invocation, true, timeline);\n outcome = \"completed\";\n return result;\n }\n finally {\n this.telemetry({\n event: \"actor_client_invocation\",\n request_id: requestId,\n actor_name: actorName,\n actor_id: actorId,\n method,\n ...timeline.finish(),\n outcome\n });\n }\n }\n async invokeAttempt(invocation, retryAvailable, timeline) {\n let target = await this.cachedTarget(invocation, timeline);\n let reply;\n if (target) {\n reply = await this.direct(target, invocation);\n timeline.mark(\"host_rpc_completed\");\n }\n else {\n const key = actorKey(invocation.actorName, invocation.actorId);\n const current = this.targets.get(key);\n const resolved = await this.resolveAndInvoke(invocation);\n target = resolved.target;\n reply = resolved.reply;\n if ((reply.type === \"completed\" || reply.type === \"failed\") && this.targets.get(key) === current) {\n this.targets.set(key, { promise: Promise.resolve(target), target });\n }\n timeline.mark(\"control_plane_invocation_completed\");\n }\n if (reply.type === \"completed\")\n return reply.result;\n if (reply.type === \"failed\")\n throw new ActorInvocationError(reply.code, invocation.requestId, reply.message);\n this.invalidateTarget(invocation, target);\n if (!retryAvailable)\n throw new ActorInvocationError(reply.type === \"unauthenticated\" ? \"unauthenticated\" : \"unavailable\", invocation.requestId, \"actor host rejected the invocation before execution after recovery\");\n return this.invokeAttempt(invocation, false, timeline);\n }\n async direct(target, invocation) {\n try {\n return await this.actorHost.invoke(target, invocation);\n }\n catch (error) {\n this.invalidateTarget(invocation, target);\n if (error instanceof ActorInvocationError || error instanceof ActorProtocolError)\n throw error;\n const message = error instanceof Error ? error.message : String(error);\n throw new ActorInvocationError(\"outcome_unknown\", invocation.requestId, `actor-host HTTP request failed after dispatch: ${message}`);\n }\n }\n async resolveAndInvoke(invocation) {\n let response;\n try {\n response = await this.fetchRequest(`${this.settings.controlPlaneUrl}${projectActorPath(this.settings.projectId, invocation.actorName, invocation.actorId)}/invoke`, {\n method: \"POST\",\n redirect: \"manual\",\n headers: {\n accept: \"application/json\",\n ...authorizationHeaders(this.settings.credential),\n \"x-request-id\": invocation.requestId,\n \"content-type\": \"application/json\"\n },\n body: JSON.stringify({\n requestId: invocation.requestId,\n method: invocation.method,\n args: invocation.args,\n homeRegion: this.settings.homeRegion\n })\n });\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n if (connectionRefused(error))\n throw new ActorInvocationError(\"unavailable\", invocation.requestId, `could not connect to ${this.settings.controlPlaneUrl}: ${message}`);\n throw new ActorInvocationError(\"outcome_unknown\", invocation.requestId, `control-plane invocation failed after it may have been dispatched: ${message}`);\n }\n const document = await responseDocument(response);\n if (!response.ok)\n this.throwResponseFailure(response, document, invocation.requestId);\n if (!isRecord(document))\n throw new ActorProtocolError(\"control-plane response did not contain an invocation outcome and target\");\n const target = parseTarget(document.target);\n const reply = isRecord(document.outcome) && document.outcome.type === \"unauthenticated\"\n ? { type: \"unauthenticated\" }\n : parseActorHostReply(document.outcome);\n return { target, reply };\n }\n invalidateTarget(invocation, target) {\n const key = actorKey(invocation.actorName, invocation.actorId);\n if (this.targets.get(key)?.target === target)\n this.targets.delete(key);\n }\n async cachedTarget(invocation, timeline) {\n const key = actorKey(invocation.actorName, invocation.actorId);\n const current = this.targets.get(key);\n timeline.mark(\"target_cache_checked\");\n if (!current)\n return undefined;\n const target = await current.promise;\n if (this.targets.get(key) !== current)\n return this.cachedTarget(invocation, timeline);\n if (target.expiresAtMs > this.now() + TARGET_EXPIRATION_SAFETY_MS)\n return target;\n this.targets.delete(key);\n return undefined;\n }\n async target(invocation, timeline) {\n const cached = await this.cachedTarget(invocation, timeline);\n if (cached)\n return cached;\n const key = actorKey(invocation.actorName, invocation.actorId);\n if (this.targets.has(key))\n return this.target(invocation, timeline);\n const resolving = {\n promise: this.resolveTarget(invocation)\n .then(target => {\n resolving.target = target;\n return target;\n })\n .catch(error => {\n if (this.targets.get(key) === resolving)\n this.targets.delete(key);\n throw error;\n })\n };\n this.targets.set(key, resolving);\n return resolving.promise;\n }\n async resolveTarget(invocation) {\n let response;\n try {\n response = await this.fetchRequest(targetUrl(this.settings, invocation.actorName, invocation.actorId), {\n method: \"POST\",\n redirect: \"manual\",\n headers: {\n accept: \"application/json\",\n ...authorizationHeaders(this.settings.credential),\n \"x-request-id\": invocation.requestId,\n \"content-type\": \"application/json\"\n },\n body: JSON.stringify({ homeRegion: this.settings.homeRegion })\n });\n }\n catch (error) {\n const message = error instanceof Error ? error.message : String(error);\n throw new ActorInvocationError(\"unavailable\", invocation.requestId, `control-plane HTTP request failed before dispatch: ${message}`);\n }\n const document = await responseDocument(response);\n if (!response.ok)\n this.throwResponseFailure(response, document, invocation.requestId);\n return parseTarget(document);\n }\n throwResponseFailure(response, document, requestId) {\n if (response.status === 401 || response.status === 403)\n throw new ActorInvocationError(\"unauthenticated\", requestId, \"the durable-actors application credential was rejected\");\n const failure = isRecord(document) ? document.error : undefined;\n if (!isRecord(failure) ||\n typeof failure.code !== \"string\" ||\n !failure.code ||\n typeof failure.message !== \"string\")\n throw new ActorProtocolError(`control-plane HTTP ${response.status} response did not contain a valid error`);\n throw new ActorInvocationError(failure.code, typeof failure.requestId === \"string\" ? failure.requestId : requestId, failure.message);\n }\n invocation(requestId, actorName, actorId, method, args) {\n return {\n requestId,\n projectId: this.settings.projectId,\n actorName: validateActorComponent(\"actor name\", actorName),\n actorId: validateActorComponent(\"actor ID\", actorId),\n method: validateActorComponent(\"actor method\", method),\n args: this.jsonArguments(args)\n };\n }\n get settings() {\n if (this.settingsValue !== undefined)\n return this.settingsValue;\n this.settingsValue = configuredSettings(environmentSettings(this.environment));\n return this.settingsValue;\n }\n jsonArguments(args) {\n const value = cloneJson(args, \"actor arguments\");\n if (!Array.isArray(value))\n throw new ActorProtocolError(\"actor arguments must be a JSON array\");\n return value;\n }\n}\nfunction parseTarget(document) {\n if (!isRecord(document) ||\n typeof document.route !== \"string\" ||\n typeof document.token !== \"string\" ||\n !document.token.trim() ||\n !positiveInteger(document.ownerEpoch) ||\n !positiveInteger(document.expiresAtMs))\n throw new ActorProtocolError(\"control-plane response did not contain a valid actor host target\");\n validateOrigin(document.route);\n return {\n route: document.route,\n token: document.token,\n ownerEpoch: document.ownerEpoch,\n expiresAtMs: document.expiresAtMs\n };\n}\nfunction targetUrl(settings, actorName, actorId) {\n const actor = validateActorComponent(\"actor name\", actorName);\n const id = validateActorComponent(\"actor ID\", actorId);\n return `${settings.controlPlaneUrl}${projectActorPath(settings.projectId, actor, id)}/find-actor`;\n}\nfunction actorKey(actorName, actorId) {\n return `${actorName}\\u001f${actorId}`;\n}\nfunction positiveInteger(value) {\n return typeof value === \"number\" && Number.isSafeInteger(value) && value > 0;\n}\n", "runtime/client.d.ts": "import type { ActorHostTarget, ActorHostTransport, ActorInvocation } from \"./http.js\";\nimport { configuredSettings } from \"./settings.js\";\nimport type { DurableActorsClientOptions, Environment } from \"./settings.js\";\nimport { LatencyTimeline } from \"./telemetry.js\";\nimport type { TelemetrySink } from \"./telemetry.js\";\nexport declare class HttpActorClient {\n private settingsValue;\n protected readonly environment: Environment;\n protected readonly fetchRequest: typeof globalThis.fetch;\n protected readonly requestId: () => string;\n protected readonly actorHost: ActorHostTransport;\n protected readonly now: () => number;\n protected readonly monotonicNow: () => number;\n protected readonly telemetry: TelemetrySink;\n protected readonly targets: Map<string, TargetResolution>;\n constructor(options?: DurableActorsClientOptions, dependencies?: HttpActorClientDependencies);\n invoke(actorName: string, actorId: string, method: string, args: readonly unknown[]): Promise<unknown>;\n private invokeAttempt;\n private direct;\n private resolveAndInvoke;\n private invalidateTarget;\n private cachedTarget;\n protected target(invocation: ActorAddress, timeline: LatencyTimeline): Promise<ActorHostTarget>;\n private resolveTarget;\n private throwResponseFailure;\n private invocation;\n protected get settings(): RemoteActorSettings;\n private jsonArguments;\n}\ntype ActorAddress = Pick<ActorInvocation, \"requestId\" | \"projectId\" | \"actorName\" | \"actorId\">;\ninterface TargetResolution {\n readonly promise: Promise<ActorHostTarget>;\n target?: ActorHostTarget;\n}\ntype RemoteActorSettings = ReturnType<typeof configuredSettings>;\nexport interface HttpActorClientDependencies {\n readonly environment?: Environment;\n readonly fetch?: typeof globalThis.fetch;\n readonly requestId?: () => string;\n readonly actorHost?: ActorHostTransport;\n readonly now?: () => number;\n readonly monotonicNow?: () => number;\n readonly telemetry?: TelemetrySink;\n}\nexport type { DurableActorsClientOptions };\n", "runtime/proxy.js": "import { ActorProtocolError, ActorSerializationError, ActorValidationError } from \"./errors.js\";\nimport { isRecord } from \"./http.js\";\nimport { authorizationHeaders, configuredSettings, environmentSettings, projectActorPath, validateActorComponent } from \"./settings.js\";\n/** Issues browser connection URLs from your backend. */\nclass SocketProxy {\n actors;\n projectId;\n origin;\n apiKey;\n setupTimeoutMs;\n fetchRequest;\n constructor(actors, options = {}, dependencies = {}) {\n this.actors = actors;\n this.setupTimeoutMs = options.setupTimeoutMs ?? 180000;\n if (!Number.isSafeInteger(this.setupTimeoutMs) || this.setupTimeoutMs < 1000 || this.setupTimeoutMs > 600000)\n throw new Error(\"Socket setup timeout must be between one second and ten minutes\");\n const settings = configuredSettings(proxySettings(options));\n this.origin = settings.controlPlaneUrl;\n this.apiKey = settings.credential;\n this.projectId = settings.projectId;\n this.fetchRequest = dependencies.fetch ?? globalThis.fetch;\n }\n /**\n * Call after authenticating the user and checking actor access.\n * Pass `websocketUrl` to the browser's `new WebSocket()`.\n */\n async handle(authorization) {\n const actorName = validateActorComponent(\"actor name\", authorization.actorName);\n const actorId = validateActorComponent(\"actor ID\", authorization.actorId);\n if (!Object.hasOwn(this.actors, actorName))\n throw new Error(`Unknown actor name: ${actorName}`);\n const metadata = socketMetadata(authorization.metadata);\n const homeRegion = authorization.homeRegion === undefined\n ? undefined\n : validateActorComponent(\"home region\", authorization.homeRegion);\n const response = await this.fetchRequest(`${this.origin}${projectActorPath(this.projectId, actorName, actorId)}/find-websocket`, {\n method: \"POST\",\n redirect: \"manual\",\n headers: { ...authorizationHeaders(this.apiKey), \"content-type\": \"application/json\" },\n body: JSON.stringify({ metadata, homeRegion }),\n signal: AbortSignal.timeout(this.setupTimeoutMs)\n });\n if (!response.ok)\n throw new Error(`WebSocket authorization could not be issued (HTTP ${response.status})`);\n return socketGrant(await response.json());\n }\n}\nfunction proxySettings(options) {\n const environment = environmentSettings();\n const controlPlaneUrl = options.controlPlaneUrl ?? environment.controlPlaneUrl;\n const apiKey = options.apiKey ?? environment.apiKey;\n return {\n projectId: options.projectId ?? environment.projectId,\n controlPlaneUrl: controlPlaneUrl ?? \"http://127.0.0.1:7100\",\n apiKey\n };\n}\nexport { SocketProxy };\nfunction socketGrant(value) {\n if (!isRecord(value) ||\n typeof value.websocketUrl !== \"string\" ||\n !URL.canParse(value.websocketUrl) ||\n !/^wss?:$/u.test(new URL(value.websocketUrl).protocol) ||\n typeof value.homeRegion !== \"string\" ||\n !value.homeRegion ||\n !Number.isSafeInteger(value.connectByMs))\n throw new ActorProtocolError(\"invalid WebSocket authorization response\");\n return {\n websocketUrl: value.websocketUrl,\n homeRegion: value.homeRegion,\n connectByMs: value.connectByMs\n };\n}\nfunction socketMetadata(value) {\n let encoded;\n try {\n encoded = JSON.stringify(value);\n if (!isJsonValue(value))\n throw new Error(\"invalid JSON value\");\n }\n catch (error) {\n throw new ActorSerializationError(\"socket metadata must be a JSON value\", { cause: error });\n }\n if (new TextEncoder().encode(encoded).length > 16 * 1024)\n throw new ActorValidationError(\"socket metadata exceeds 16384 bytes\");\n return value;\n}\nfunction isJsonValue(value) {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\")\n return true;\n if (typeof value === \"number\")\n return Number.isFinite(value);\n if (Array.isArray(value))\n return Array.from(value).every(isJsonValue);\n return (isRecord(value) &&\n [Object.prototype, null].includes(Object.getPrototypeOf(value)) &&\n Object.values(value).every(isJsonValue));\n}\n", "runtime/proxy.d.ts": "/** Overrides for the backend's DURABLE_ACTORS environment settings. */\ninterface SocketProxyOptions {\n readonly projectId?: string;\n readonly controlPlaneUrl?: string;\n readonly apiKey?: string;\n /** Defaults to 180000 ms; accepts 1000–600000 ms. */\n readonly setupTimeoutMs?: number;\n}\ninterface SocketProxyDependencies {\n readonly fetch?: typeof globalThis.fetch;\n}\ninterface ProxyActor<Metadata = unknown> {\n readonly types?: Metadata;\n}\n/** Actor access your backend has already authorized. */\ntype SocketAuthorization<Actors extends Record<string, ProxyActor>> = {\n [Name in keyof Actors & string]: {\n readonly actorName: Name;\n readonly actorId: string;\n readonly metadata: Actors[Name] extends ProxyActor<infer Metadata> ? Metadata : never;\n readonly homeRegion?: string;\n };\n}[keyof Actors & string];\n/** Browser connection URL and admission deadline in Unix milliseconds. Treat the URL as a credential. */\ninterface SocketGrant {\n websocketUrl: string;\n homeRegion: string;\n connectByMs: number;\n}\n/** Issues browser connection URLs from your backend. */\ndeclare class SocketProxy<Actors extends Record<string, ProxyActor>> {\n private readonly actors;\n private readonly projectId;\n private readonly origin;\n private readonly apiKey;\n private readonly setupTimeoutMs;\n private readonly fetchRequest;\n constructor(actors: Actors, options?: SocketProxyOptions, dependencies?: SocketProxyDependencies);\n /**\n * Call after authenticating the user and checking actor access.\n * Pass `websocketUrl` to the browser's `new WebSocket()`.\n */\n handle(authorization: SocketAuthorization<Actors>): Promise<SocketGrant>;\n}\nexport { SocketProxy };\nexport type { ProxyActor, SocketAuthorization, SocketGrant, SocketProxyDependencies, SocketProxyOptions };\n", "runtime/stub.js": "import { HttpActorClient } from \"./client.js\";\nimport { ActorDefinitionError, ActorSerializationError } from \"./errors.js\";\nimport { validateActorComponent } from \"./settings.js\";\n/** Creates a backend client from generated method definitions. */\nfunction createActorStub(actorName, actorId, methods, transport) {\n validateActorComponent(\"actor name\", actorName);\n validateActorComponent(\"actor ID\", actorId);\n const stub = Object.create(null);\n for (const method of methods) {\n validateActorComponent(\"actor method\", method.name);\n if ([\"then\", \"connect\", \"broadcast\", \"onConnect\", \"onMessage\", \"onDisconnect\"].includes(method.name))\n throw new ActorDefinitionError(`actor method ${actorName}.${method.name} is reserved`);\n if (Object.hasOwn(stub, method.name))\n throw new ActorDefinitionError(`duplicate actor method ${actorName}.${method.name}`);\n Object.defineProperty(stub, method.name, {\n enumerable: true,\n value: async (...args) => {\n const parameters = invocationArguments(args);\n const client = transport ?? defaultTransport();\n const result = await client.invoke(actorName, actorId, method.name, parameters);\n return method.result === \"void\" ? undefined : result;\n }\n });\n }\n return stub;\n}\nexport { createActorStub };\nlet shared;\nexport function createActorTransport(options) {\n return new HttpActorClient(options);\n}\nfunction defaultTransport() {\n return (shared ??= new HttpActorClient());\n}\nfunction invocationArguments(args) {\n let end = args.length;\n while (end > 0 && args[end - 1] === undefined)\n end--;\n const parameters = args.slice(0, end);\n if (parameters.includes(undefined))\n throw new ActorSerializationError(\"undefined cannot precede a supplied RPC argument in JSON transport\");\n return parameters;\n}\n", "runtime/stub.d.ts": "import type { DurableActorsClientOptions } from \"./settings.js\";\ninterface ActorRpcTransport {\n invoke(actorName: string, actorId: string, method: string, args: readonly unknown[]): Promise<unknown>;\n}\ninterface ActorRpcMethod {\n readonly name: string;\n readonly result: \"void\" | \"value\";\n}\n/** Creates a backend client from generated method definitions. */\ndeclare function createActorStub<Stub extends object>(actorName: string, actorId: string, methods: readonly ActorRpcMethod[], transport?: ActorRpcTransport): Stub;\nexport { createActorStub };\nexport type { ActorRpcMethod, ActorRpcTransport };\nexport declare function createActorTransport(options: DurableActorsClientOptions): ActorRpcTransport;\nexport type { DurableActorsClientOptions };\n", "runtime/session.js": "import { HttpActorClient } from \"./client.js\";\nimport { ActorSessionRejectedError } from \"./errors.js\";\nimport { validateActorComponent, validateOrigin } from \"./settings.js\";\nexport { ActorSessionRejectedError } from \"./errors.js\";\n/**\n * Reuses actor targets and renews runtime-issued sessions through a trusted backend.\n * Sessions require an HTTPS origin (except localhost) and at most five minutes of validity.\n * Renewal stops after a minute without invocations; dispose cancels it immediately.\n */\nexport class ActorSessionTransport {\n options;\n transport;\n expiresAtMs = 0;\n lastUsedAt = 0;\n pending;\n cancel;\n closed = false;\n now;\n createTransport;\n schedule;\n constructor(options, dependencies = {}) {\n this.options = options;\n validateActorComponent(\"project ID\", options.projectId);\n this.now = dependencies.now ?? (() => performance.timeOrigin + performance.now());\n this.createTransport = dependencies.createTransport ?? (settings => new HttpActorClient(settings));\n this.schedule = dependencies.schedule ?? scheduleRefresh;\n }\n async invoke(actorName, actorId, method, args) {\n if (this.closed)\n throw new Error(\"Actor session transport is disposed\");\n this.lastUsedAt = this.now();\n const transport = this.transport && this.expiresAtMs > this.now() + 5_000 ? this.transport : await this.refresh();\n return transport.invoke(actorName, actorId, method, args);\n }\n dispose() {\n this.closed = true;\n this.cancel?.();\n this.transport = undefined;\n }\n refresh() {\n if (this.pending)\n return this.pending;\n this.cancel?.();\n this.pending = this.exchange().finally(() => {\n this.pending = undefined;\n });\n return this.pending;\n }\n async exchange() {\n let session;\n try {\n session = await this.options.getSession();\n }\n catch (error) {\n if (error instanceof ActorSessionRejectedError) {\n this.transport = undefined;\n this.expiresAtMs = 0;\n }\n throw error;\n }\n const remaining = this.validateSession(session);\n if (this.closed)\n throw new Error(\"Actor session transport is disposed\");\n const transport = this.createTransport({\n projectId: session.projectId,\n controlPlaneUrl: session.controlPlaneUrl,\n apiKey: session.token\n });\n this.transport = transport;\n this.expiresAtMs = session.expiresAtMs;\n this.scheduleRenewal(remaining * (0.75 + Math.random() * 0.05));\n return transport;\n }\n validateSession(session) {\n if (!session ||\n session.projectId !== this.options.projectId ||\n typeof session.token !== \"string\" ||\n !session.token.trim() ||\n !Number.isSafeInteger(session.expiresAtMs))\n throw new Error(\"Invalid actor session\");\n const origin = new URL(validateOrigin(session.controlPlaneUrl));\n if (origin.protocol !== \"https:\" && ![\"localhost\", \"127.0.0.1\", \"[::1]\"].includes(origin.hostname))\n throw new Error(\"Actor sessions require HTTPS outside localhost\");\n const remaining = session.expiresAtMs - this.now();\n if (remaining <= 5_000 || remaining > 305_000)\n throw new Error(\"Actor session is expired or invalid\");\n return remaining;\n }\n scheduleRenewal(delayMs) {\n this.cancel = this.schedule(() => {\n if (this.closed || this.now() - this.lastUsedAt >= 60_000)\n return;\n void this.refresh().catch(() => {\n if (!this.closed && this.expiresAtMs > this.now() + 5_000)\n this.scheduleRenewal(5_000);\n });\n }, delayMs);\n }\n}\nexport function createActorSessionTransport(options) {\n return new ActorSessionTransport(options);\n}\nfunction scheduleRefresh(callback, delayMs) {\n const timer = setTimeout(callback, delayMs);\n timer.unref?.();\n return () => clearTimeout(timer);\n}\n", "runtime/session.d.ts": "import type { DurableActorsClientOptions } from \"./settings.js\";\nimport type { ActorRpcTransport } from \"./stub.js\";\nexport interface ActorSession {\n readonly projectId: string;\n readonly controlPlaneUrl: string;\n readonly token: string;\n readonly expiresAtMs: number;\n}\nexport interface ActorSessionTransportOptions {\n readonly projectId: string;\n /** Reauthenticate with your application backend. Throw ActorSessionRejectedError on an explicit denial. */\n readonly getSession: () => Promise<ActorSession>;\n}\nexport interface ActorSessionTransportDependencies {\n readonly now?: () => number;\n readonly createTransport?: (options: DurableActorsClientOptions) => ActorRpcTransport;\n readonly schedule?: (callback: () => void, delayMs: number) => () => void;\n}\nexport { ActorSessionRejectedError } from \"./errors.js\";\n/**\n * Reuses actor targets and renews runtime-issued sessions through a trusted backend.\n * Sessions require an HTTPS origin (except localhost) and at most five minutes of validity.\n * Renewal stops after a minute without invocations; dispose cancels it immediately.\n */\nexport declare class ActorSessionTransport implements ActorRpcTransport {\n private readonly options;\n private transport;\n private expiresAtMs;\n private lastUsedAt;\n private pending;\n private cancel;\n private closed;\n private readonly now;\n private readonly createTransport;\n private readonly schedule;\n constructor(options: ActorSessionTransportOptions, dependencies?: ActorSessionTransportDependencies);\n invoke(actorName: string, actorId: string, method: string, args: readonly unknown[]): Promise<unknown>;\n dispose(): void;\n private refresh;\n private exchange;\n private validateSession;\n private scheduleRenewal;\n}\nexport declare function createActorSessionTransport(options: ActorSessionTransportOptions): ActorSessionTransport;\n", "runtime/index.browser.js": "const createActorStub = () => {\n throw new Error(\"actors must be used on the server\");\n};\nconst createActorTransport = () => {\n throw new Error(\"actors must be used on the server\");\n};\nconst createActorSessionTransport = () => {\n throw new Error(\"actors must be used on the server\");\n};\nconst SocketProxy = class {\n constructor() {\n throw new Error(\"ActorProxy must be used on the server\");\n }\n};\nexport { createActorStub, createActorTransport, createActorSessionTransport, SocketProxy };\nexport { ActorInvocationError, ActorSessionRejectedError } from \"./errors.js\";\n", "runtime/index.browser.d.ts": "import type { SocketProxy as ServerProxy } from \"./proxy.js\";\nimport type { createActorSessionTransport as ServerSessionTransport } from \"./session.js\";\nimport type { createActorStub as ServerStub, createActorTransport as ServerTransport } from \"./stub.js\";\ndeclare const createActorStub: typeof ServerStub;\ndeclare const createActorTransport: typeof ServerTransport;\ndeclare const createActorSessionTransport: typeof ServerSessionTransport;\ndeclare const SocketProxy: typeof ServerProxy;\nexport { createActorStub, createActorTransport, createActorSessionTransport, SocketProxy };\nexport { ActorInvocationError, ActorSessionRejectedError } from \"./errors.js\";\nexport type { ActorSession, ActorSessionTransportOptions, ActorSessionTransport } from \"./session.js\";\n", "runtime/index.js": "export { createActorStub, createActorTransport } from \"./stub.js\";\nexport { createActorSessionTransport, ActorSessionRejectedError } from \"./session.js\";\nexport { ActorInvocationError } from \"./errors.js\";\nexport { SocketProxy } from \"./proxy.js\";\n", "runtime/index.d.ts": "export { createActorStub, createActorTransport } from \"./stub.js\";\nexport { createActorSessionTransport, ActorSessionRejectedError } from \"./session.js\";\nexport type { ActorSession, ActorSessionTransportOptions, ActorSessionTransport } from \"./session.js\";\nexport type { ActorRpcTransport, DurableActorsClientOptions } from \"./stub.js\";\nexport { ActorInvocationError } from \"./errors.js\";\nexport { SocketProxy } from \"./proxy.js\";\nexport type { ProxyActor, SocketGrant, SocketProxyDependencies, SocketProxyOptions } from \"./proxy.js\";\n", "runtime/package.json": "{\n \"private\": true,\n \"type\": \"module\",\n \"sideEffects\": false,\n \"browser\": {\n \"./index.js\": \"./index.browser.js\"\n }\n}\n", "runtime/LICENSE.md": "MIT License\n\nCopyright (c) 2026 Terse\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n" };
2
2
  //# sourceMappingURL=client-runtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client-runtime.js","sourceRoot":"","sources":["../../src/generated/client-runtime.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,YAAY,GAA2B,EAAC,mBAAmB,EAAC,qgEAAqgE,EAAC,qBAAqB,EAAC,gjDAAgjD,EAAC,iBAAiB,EAAC,4iBAA4iB,EAAC,mBAAmB,EAAC,0TAA0T,EAAC,qBAAqB,EAAC,suGAAsuG,EAAC,uBAAuB,EAAC,08BAA08B,EAAC,iBAAiB,EAAC,02JAA02J,EAAC,mBAAmB,EAAC,qoEAAqoE,EAAC,sBAAsB,EAAC,ycAAyc,EAAC,wBAAwB,EAAC,+bAA+b,EAAC,mBAAmB,EAAC,80XAA80X,EAAC,qBAA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entity } from "../actor/actor.js";
3
- import { bindActorDatabase, runWithActorDatabase } from "../actor/database.js";
3
+ import { constructWithActorDatabase, runWithActorDatabase } from "../actor/database.js";
4
4
  import { actorKey } from "../actor/identity.js";
5
5
  import { Persistence } from "../actor/schema.js";
6
6
  import { decodeSocketMessage, runWithActorSockets } from "../actor/socket.js";
@@ -205,9 +205,8 @@ class ActorRuntime {
205
205
  this.identity = undefined;
206
206
  }
207
207
  createInstance(identity, state) {
208
- const instance = Reflect.construct(this.definition.actorClass, []);
208
+ const instance = constructWithActorDatabase(this.database, () => Reflect.construct(this.definition.actorClass, []));
209
209
  bindActorIdentity(instance, identity.actor_id);
210
- bindActorDatabase(instance, this.database);
211
210
  validateActorState(instance, this.definition.state);
212
211
  if (state !== null)
213
212
  hydrateActorState(instance, persistedState(state), this.definition.state);
@@ -1 +1 @@
1
- {"version":3,"file":"actor-runtime.js","sourceRoot":"","sources":["../../src/host/actor-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAA;AAG7C,OAAO,EAAE,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC5D,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC9E,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAE/C,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAG7E,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAC9G,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAGrE,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAE3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIh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AAI,CAAI;IAChB,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAgC;gBAG1B,MAAM,EAAE,eAAe,EACvB,OAAO,GAAE,CAAC,IAAI,EAAE,MAAM,KAAK,gBAA6B;IAG7E,IAAI,CAAC,GAAG,SAAS,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,QAAQ,EAAE,WAAW,EAAE,GAAG,GAAG,EAAE;IASxE,MAAM,IAAI,UAAU;IAQpB,aAAa,CAAC,MAAM,EAAE,UAAU,GAAG,IAAI;IAWvC,OAAO,CAAC,KAAK,EAAE,WAAW,GAAG,SAAS,GAAG,IAAI;IASvC,QAAQ,IAAI,OAAO,CAAC,WAAW,CAAC;IAkBtC,QAAQ,IAAI,IAAI;IAKhB,KAAK,IAAI,IAAI;IAWb,OAAO,CAAC,WAAW;IASnB,OAAO,CAAC,aAAa;IASrB,OAAO,CAAC,IAAI;CAYf;AAED,UAAU,gBAAgB;IACtB,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAA;IAC/B,IAAI,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG;QAClB,GAAG,CAAC,GAAG,QAAQ,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,CAAA;QACzC,GAAG,IAAI,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,SAAS,CAAA;KACjD,CAAA;IACD,KAAK,IAAI,IAAI,CAAA;CAChB;AA8DD,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAA;AAClD,YAAY,EAAE,oBAAoB,EAAE,WAAW,EAAE,eAAe,EAAE,CAAA"}
@@ -71,6 +71,8 @@ class SqliteActorDatabase {
71
71
  }
72
72
  close() {
73
73
  try {
74
+ if (this.connection?.isTransaction)
75
+ this.connection.exec("ROLLBACK");
74
76
  this.connection?.close();
75
77
  }
76
78
  finally {
@@ -1 +1 @@
1
- {"version":3,"file":"s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O,GAAG,CAAC,OAAO,CAAC,8CAA8C,EAAE,EAAE,CAAC,CAAC,IAAI,EAAE,CAAA;AACjF,CAAC;AAED,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,CAAA"}
@@ -10,7 +10,7 @@ export async function projectSdkModule(project, entrypoint, caller, sdkResolveFr
10
10
  target = await realpath(fileURLToPath(new URL(entrypoint, host)));
11
11
  }
12
12
  catch (cause) {
13
- throw new Error(`Cannot load the durable-actors SDK in ${project}. Run pnpm install in the actor project.`, {
13
+ throw new Error(`Cannot load the durable-actors SDK in ${project}. Run bun install in the actor project.`, {
14
14
  cause
15
15
  });
16
16
  }
@@ -1 +1 @@
1
- {"version":3,"file":"projectSdk.js","sourceRoot":"","sources":["../src/projectSdk.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAEvD,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAClC,OAAe,EACf,UAAkB,EAClB,MAAc,EACd,cAAuB;IAEvB,IAAI,MAAc,CAAA;IAClB,IAAI,CAAC;QACD,MAAM,MAAM,GAAG,cAAc,IAAI,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC,IAAI,CAAA;QAC1F,MAAM,IAAI,GAAG,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAA;QACnD,MAAM,GAAG,MAAM,QAAQ,CAAC,aAAa,CAAC,IAAI,GAAG,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;IACrE,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,yCAAyC,OAAO,0CAA0C,EAAE;YACxG,KAAK;S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}
@@ -1,25 +1,23 @@
1
1
  # Actors
2
2
 
3
- Requires Node.js 22.19.0+, pnpm, and Bun 1.3.9+ on your PATH.
3
+ Requires Bun 1.4.2+ on your PATH.
4
4
 
5
5
  ```sh
6
- pnpm install
7
- # Or with npm:
8
- npm install
9
- npx durable-actors dev
6
+ bun install
7
+ bunx durable-actors dev
10
8
  ```
11
9
 
12
10
  Define your actors in `src/actors.ts`. The starter contains a counter with persisted state and `read()` and `increment()` methods. Each counter ID has its own saved value.
13
11
 
14
- `npx durable-actors dev` watches your actor source and stores local state in `.durable-actors/`. It defaults to project ID `local`; choose another with `DURABLE_ACTORS_PROJECT_ID=my-project npx durable-actors dev`.
12
+ `bunx durable-actors dev` watches your actor source and stores local state in `.durable-actors/`. It defaults to project ID `local`; choose another with `DURABLE_ACTORS_PROJECT_ID=my-project bunx durable-actors dev`.
15
13
 
16
14
  ## Connect your application
17
15
 
18
16
  In your separate application project's directory:
19
17
 
20
- 1. Run `pnpm install --save-dev durable-actors` or `npm install --save-dev durable-actors`.
18
+ 1. Run `bun add --dev durable-actors`.
21
19
  2. Use the local defaults: project `local`, URL `http://127.0.0.1:7100`, and no secret. If you configure a different project, port, or optional secret on the actor server, put matching settings in your application’s `.env` or `.env.local` file.
22
- 3. Run `npx durable-actors generate`; the CLI loads both environment files automatically. Exported environment variables take precedence over `.env.local`, which takes precedence over `.env`.
20
+ 3. Run `bunx durable-actors generate`; the CLI loads both environment files automatically. Exported environment variables take precedence over `.env.local`, which takes precedence over `.env`.
23
21
 
24
22
  Your application backend can then use the generated client:
25
23
 
@@ -30,4 +28,4 @@ const counter = actors.Counter.get("example")
30
28
  console.log(await counter.increment())
31
29
  ```
32
30
 
33
- Use `pnpm check` to check types. Production deployment integrations register actor images through `PUT /v1/projects/{project_id}/deployment`; see the [HTTP API](https://github.com/TerseAI/durable-actors/blob/main/docs/reference/openapi.yaml).
31
+ Use `bun run --bun check` to check types. Production deployment integrations register actor images through `PUT /v1/projects/{project_id}/deployment`; see the [HTTP API](https://github.com/TerseAI/durable-actors/blob/main/docs/reference/openapi.yaml).
@@ -0,0 +1,2 @@
1
+ [run]
2
+ bun = true
@@ -3,17 +3,20 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "engines": {
6
- "node": ">=22.19.0"
6
+ "bun": ">=1.4.2"
7
7
  },
8
8
  "scripts": {
9
9
  "dev": "durable-actors dev",
10
10
  "check": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "durable-actors": "0.7.15"
13
+ "durable-actors": "0.8.0"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^22.0.0",
17
17
  "typescript": "~5.9.3"
18
- }
18
+ },
19
+ "trustedDependencies": [
20
+ "esbuild"
21
+ ]
19
22
  }
@@ -4,25 +4,25 @@ An Express + React app that streams replies with the Vercel AI SDK and saves con
4
4
 
5
5
  ## Run locally
6
6
 
7
- Requires Node.js 22.19+, Bun 1.3.9+, and an OpenAI API key.
7
+ Requires Bun 1.4.2+ and an OpenAI API key.
8
8
 
9
9
  ```sh
10
- npx durable-actors init ai-chat-example --template ai-chat
10
+ bunx durable-actors init ai-chat-example --template ai-chat
11
11
  cd ai-chat-example
12
- npm install
12
+ bun install
13
13
  cp .env.example .env
14
14
  ```
15
15
 
16
- Already in the example directory? Start at `npm install`. Add `OPENAI_API_KEY` to `.env`, then start the actors:
16
+ Already in the example directory? Start at `bun install`. Add `OPENAI_API_KEY` to `.env`, then start the actors:
17
17
 
18
18
  ```sh
19
- npm run dev:actors
19
+ bun run dev:actors
20
20
  ```
21
21
 
22
22
  Wait for `Ready`. In another terminal in the same directory:
23
23
 
24
24
  ```sh
25
- npm run dev
25
+ bun run dev
26
26
  ```
27
27
 
28
28
  Open [localhost:3000](http://127.0.0.1:3000), send a message, and reload after the reply finishes. The conversation survives server restarts.
@@ -37,6 +37,6 @@ The lobby is shared and has no authentication. Add authentication and chat owner
37
37
 
38
38
  ## Development
39
39
 
40
- Both processes read `.env`; actor state lives in `.durable-actors/`. Actor code reloads automatically; restart `npm run dev` after editing the actor class imported by the backend. For multiple examples, set distinct `PORT`, `DURABLE_ACTORS_PORT`, and matching control-plane URLs; see [Run the examples together](https://github.com/TerseAI/durable-actors/tree/main/examples#run-the-examples-together).
40
+ Both processes read `.env`; actor state lives in `.durable-actors/`. Actor code reloads automatically; restart `bun run dev` after editing the actor class imported by the backend. For multiple examples, set distinct `PORT`, `DURABLE_ACTORS_PORT`, and matching control-plane URLs; see [Run the examples together](https://github.com/TerseAI/durable-actors/tree/main/examples#run-the-examples-together).
41
41
 
42
- `npm run build` checks TypeScript and builds the frontend.
42
+ `bun run build` checks TypeScript and builds the frontend.
@@ -0,0 +1,2 @@
1
+ [run]
2
+ bun = true