durable-actors 0.4.3 → 0.4.5

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.
@@ -13,6 +13,8 @@ declare class ControlPlaneClient {
13
13
  listActors(): Promise<unknown>;
14
14
  openActorStream(signal: AbortSignal): Promise<Response>;
15
15
  openRequestStream(signal: AbortSignal, after?: string): Promise<Response>;
16
+ getState(query: URLSearchParams, signal?: AbortSignal): Promise<unknown>;
17
+ listStateHistory(query: URLSearchParams, signal?: AbortSignal): Promise<unknown>;
16
18
  listRequests(query: URLSearchParams, signal?: AbortSignal): Promise<unknown>;
17
19
  getMetrics(query: URLSearchParams, signal?: AbortSignal): Promise<unknown>;
18
20
  listQueueWaits(query: URLSearchParams, signal?: AbortSignal): Promise<unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"control-plane.d.ts","sourceRoot":"","sources":["../../src/cli/control-plane.ts"],"names":[],"mappings":"AAKA,UAAU,sBAAsB;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,UAAU,EAAE,MAAM,GAAG,SAAS,CAAA;CACjC;AAED,cAAM,kBAAkB;IAEhB,QAAQ,CAAC,UAAU,EAAE,sBAAsB;IAC3C,OAAO,CAAC,QAAQ,CAAC,OAAO;gBADf,UAAU,EAAE,sBAAsB,EAC1B,OAAO,EAAE,OAAO,KAAK;IAGpC,eAAe,IAAI,OAAO,CAAC,IAAI,CAAC;IAItC,kBAAkB,CAAC,UAAU,EAAE,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IAIzD,WAAW,IAAI,OAAO,CAAC,OAAO,CAAC;IAI/B,UAAU,IAAI,OAAO,CAAC,OAAO,CAAC;IAIxB,eAAe,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIvD,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ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Ae,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,QAAQ,CAAC;IAIvD,iBAAiB,CAAC,MAAM,EAAE,WAAW,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAK/E,QAAQ,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAIxE,gBAAgB,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAUhF,YAAY,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAU5E,UAAU,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAU1E,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAU9E,cAAc,CAAC,KAAK,EAAE,eAAe,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;YAUhE,UAAU;IAaxB,OAAO,CAAC,WAAW;YAIL,WAAW;CAwB5B;AAED,iBAAS,wBAAwB,CAAC,GAAG,EAAE,MAAM,CAAC,UAAU,EAAE,OAAO,EAAE,OAAO,KAAK,GAAG,kBAAkB,CAEnG;AA0BD,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,CAAA;AACvD,YAAY,EAAE,sBAAsB,EAAE,CAAA"}
@@ -27,6 +27,12 @@ class ControlPlaneClient {
27
27
  const query = after ? `?${new URLSearchParams({ after })}` : "";
28
28
  return this.openStream(`${this.projectPath()}/observe/requests/events${query}`, signal);
29
29
  }
30
+ getState(query, signal) {
31
+ return this.requestJson("GET", `${this.projectPath()}/observe/state?${query}`, undefined, 30_000, signal);
32
+ }
33
+ listStateHistory(query, signal) {
34
+ return this.requestJson("GET", `${this.projectPath()}/observe/state/history?${query}`, undefined, 30_000, signal);
35
+ }
30
36
  listRequests(query, signal) {
31
37
  return this.requestJson("GET", `${this.projectPath()}/observe/requests${query.size ? `?${query}` : ""}`, undefined, 30_000, signal);
32
38
  }
@@ -1 +1 @@
1
- {"version":3,"file":"control-plane.js","sourceRoot":"","sources":["../../src/cli/control-plane.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AAElE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAQ5C,MAAM,kBAAkB;IAEP;IACQ;IAFrB,YACa,UAAkC,EAC1B,OAAqB;QAD7B,eAAU,GAAV,UAAU,CAAwB;QAC1B,YAAO,GAAP,OAAO,CAAc;IACvC,CAAC;IAEJ,KAAK,CAAC,eAAe;QACjB,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,CAAC,CAAA;IAC5F,CAAC;IAED,kBAAkB,CAAC,UAAmB;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,aAAa,EAAE,UAAU,EAAE,OAAO,CAAC,CAAA;IAC3F,CAAC;IAED,WAAW;QACP,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAA;IAC/E,CAAC;IAED,UAAU;QACN,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,GAAG,IAAI,CAAC,WAAW,EAAE,iBAAiB,CAAC,CAAA;IAC1E,CAAC;IAED,KAAK,CAAC,eAAe,CAAC,MAAmB;QACrC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,WAAW,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B,CAAC,CAAC,CAAA;IACF,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;QACf,MAAM,IAAI,GACN,QAAQ,CAAC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,sBAAsB,CAAC;YAC3D,CAAC,CAAC,qJAAqJ;YACvJ,CAAC,CAAC,EAAE,CAAA;QACZ,MAAM,IAAI,KAAK,CACX,sCAAsC,QAAQ,CAAC,MAAM,MAAM,YAAY,CAAC,MAAM,CAAC,IAAI,QAAQ,CAAC,UAAU,KAAK,MAAM,IAAI,GAAG,GAAG,IAAI,EAAE,CACpI,CAAA;IACL,CAAC;IACD,OAAO,MAAM,CAAA;AACjB,CAAC;AAED,SAAS,YAAY,CAAC,MAAe;IACjC,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,CAAC,CAAC,OAAO,IAAI,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IACnF,MAAM,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;IAC1B,IAAI,CAAC,KAAK,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,CAAC,CAAC,SAAS,IAAI,KAAK,CAAC;QAAE,OAAO,SAAS,CAAA;IAClF,OAAO,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS,CAAA;AACxE,CAAC;AAED,OAAO,EAAE,kBAAkB,EAAE,wBAAwB,EAAE,CAAA"}
@@ -6,7 +6,7 @@ declare class Observer {
6
6
  private readonly openBrowser;
7
7
  private readonly assetDirectory;
8
8
  private server;
9
- constructor(client: Pick<ControlPlaneClient, "checkConnection" | "listActors" | "getMetrics" | "listQueueWaits" | "listWebSockets"> & Partial<Pick<ControlPlaneClient, "openActorStream" | "openRequestStream" | "listRequests">>, openBrowser: (url: string) => Promise<unknown>, assetDirectory?: URL);
9
+ constructor(client: Pick<ControlPlaneClient, "checkConnection" | "listActors" | "getMetrics" | "listQueueWaits" | "listWebSockets" | "getState" | "listStateHistory"> & Partial<Pick<ControlPlaneClient, "openActorStream" | "openRequestStream" | "listRequests">>, openBrowser: (url: string) => Promise<unknown>, assetDirectory?: URL);
10
10
  start(launchBrowser?: boolean): Promise<{
11
11
  url: string;
12
12
  browserOpened: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../src/cli/observe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,OAAO,EAAE,kBAAkB,EAA4B,MAAM,oBAAoB,CAAA;AAEjF,iBAAS,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuBtD;AAED,cAAM,QAAQ;IAIN,OAAO,CAAC,QAAQ,CAAC,MAAM;IAKvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IATnC,OAAO,CAAC,MAAM,CAA2B;gBAGpB,MAAM,EAAE,IAAI,CACzB,kBAAkB,EAClB,iBAAiB,GAAG,YAAY,GAAG,YAAY,GAAG,gBAAgB,GAAG,gBAAgB,CACxF,GACG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,cAAc,CAAC,CAAC,EAC9E,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAC9C,cAAc,MAG9B;IAGC,KAAK,CAAC,aAAa,UAAO,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;IAa7E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAKd,WAAW;YA4BX,OAAO;YA6DP,WAAW;YAgDX,cAAc;YAuBd,cAAc;YAad,gBAAgB;CAYjC;AAED,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAA"}
1
+ {"version":3,"file":"observe.d.ts","sourceRoot":"","sources":["../../src/cli/observe.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AASnC,OAAO,EAAE,kBAAkB,EAA4B,MAAM,oBAAoB,CAAA;AAEjF,iBAAS,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAuBtD;AAED,cAAM,QAAQ;IAIN,OAAO,CAAC,QAAQ,CAAC,MAAM;IAWvB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAC5B,OAAO,CAAC,QAAQ,CAAC,cAAc;IAfnC,OAAO,CAAC,MAAM,CAA2B;gBAGpB,MAAM,EAAE,IAAI,CACzB,kBAAkB,EAChB,iBAAiB,GACjB,YAAY,GACZ,YAAY,GACZ,gBAAgB,GAChB,gBAAgB,GAChB,UAAU,GACV,kBAAkB,CACvB,GACG,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,iBAAiB,GAAG,mBAAmB,GAAG,cAAc,CAAC,CAAC,EAC9E,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,EAC9C,cAAc,MAG9B;IAGC,KAAK,CAAC,aAAa,UAAO,GAAG,OAAO,CAAC;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,OAAO,CAAA;KAAE,CAAC;IAa7E,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;YAKd,WAAW;YA4BX,OAAO;YA+DP,WAAW;YAgDX,cAAc;YAuBd,cAAc;YAad,gBAAgB;CAYjC;AAED,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAA"}
@@ -107,6 +107,8 @@ class Observer {
107
107
  return;
108
108
  }
109
109
  const history = {
110
+ "/api/observe/state": this.client.getState,
111
+ "/api/observe/state/history": this.client.listStateHistory,
110
112
  "/api/observe/requests": this.client.listRequests,
111
113
  "/api/observe/metrics": this.client.getMetrics,
112
114
  "/api/observe/queue-waits": this.client.list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O,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAChF,CAAC;IAEO,KAAK,CAAC,gBAAgB,CAAC,OAAwB,EAAE,QAAwB;QAC7E,IAAI,MAAM,GAAG,GAAG,CAAA;QAChB,IAAI,MAAM,GAAY,EAAE,SAAS,EAAE,IAAI,EAAE,CAAA;QACzC,IAAI,CAAC;YACD,MAAM,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAA;QACvC,CAAC;QAAC,MAAM,CAAC;YACL,MAAM,GAAG,GAAG,CAAA;YACZ,MAAM,GAAG,EAAE,KAAK,EAAE,iCAAiC,EAAE,CAAA;QACzD,CAAC;QACD,QAAQ,CAAC,SAAS,CAAC,MAAM,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,CAAC,CAAA;QAClE,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,KAAK,MAAM,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAA;IAChF,CAAC;CACJ;AAED,OAAO,EAAE,QAAQ,EAAE,sBAAsB,EAAE,CAAA"}
@@ -4,6 +4,7 @@ export declare class HttpActorHostTransport implements ActorHostTransport {
4
4
  constructor(fetchRequest?: typeof globalThis.fetch);
5
5
  invoke(target: ActorHostTarget, invocation: DirectActorInvocation): Promise<ActorHostReply>;
6
6
  publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;
7
+ private ping;
7
8
  private post;
8
9
  }
9
10
  export declare function responseDocument(response: Response): Promise<unknown>;
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/client-runtime/http.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,WAAW,CAAA;AAG1C,qBAAa,sBAAuB,YAAW,kBAAkB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AE,OAAO,EAAE,SAAS,OAAO,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;CACpG"}
@@ -6,6 +6,10 @@ export class HttpActorHostTransport {
6
6
  this.fetchRequest = fetchRequest;
7
7
  }
8
8
  async invoke(target, invocation) {
9
+ // TODO: Replace this extra round trip with durable idempotency keys for safe invocation retries.
10
+ const readiness = await this.ping(target, invocation);
11
+ if (readiness !== "ready")
12
+ return { type: readiness };
9
13
  let response;
10
14
  try {
11
15
  response = await this.post(target, invocation, "invoke", {
@@ -44,6 +48,22 @@ export class HttpActorHostTransport {
44
48
  if (!response.ok)
45
49
  throw new Error(`socket effects returned HTTP ${response.status}`);
46
50
  }
51
+ async ping(target, actor) {
52
+ try {
53
+ const response = await this.fetchRequest(`${validateOrigin(target.route)}${projectActorPath(actor.projectId, actor.actorName, actor.actorId)}/invoke`, {
54
+ method: "HEAD",
55
+ redirect: "error",
56
+ headers: { authorization: `Bearer ${target.token}` },
57
+ signal: AbortSignal.timeout(5_000)
58
+ });
59
+ if (response.status === 401)
60
+ return "unauthenticated";
61
+ return response.status === 204 ? "ready" : "not_dispatched";
62
+ }
63
+ catch {
64
+ return "not_dispatched";
65
+ }
66
+ }
47
67
  post(target, actor, endpoint, body) {
48
68
  return this.fetchRequest(`${validateOrigin(target.route)}${projectActorPath(actor.projectId, actor.actorName, actor.actorId)}/${endpoint}`, {
49
69
  method: "POST",
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/client-runtime/http.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAEhD,OAAO,EAAE,gBAAgB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAEhE,MAAM,OAAO,sBAAsB;IACF;IAA7B,YAA6B,eAAwC,UAAU,CAAC,KAAK;QAAxD,iBAAY,GAAZ,YAAY,CAA4C;IAAG,CAAC;IAEzF,KAAK,CAAC,MAAM,CAAC,MAAuB,EAAE,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E,MAAM,CAAmtsC,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,CAAsouC,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. */\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}\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, 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. */\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}\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, 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_dispatched\" };\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 const reply = await responseDocument(response);\n if (isRecord(reply)) {\n if (reply.type === \"completed\" && Object.hasOwn(reply, \"result\"))\n return { type: \"completed\", result: reply.result };\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 };\n if (reply.type === \"reroute\")\n return { type: \"reroute\" };\n }\n throw new ActorProtocolError(\"actor host response did not contain a valid outcome\");\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: \"error\",\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}\nfunction 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: DirectActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n private post;\n}\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 DirectActorInvocation extends ActorAddress {\n readonly requestId: string;\n readonly method: string;\n readonly args: readonly JsonValue[];\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: \"reroute\";\n} | {\n readonly type: \"unauthenticated\";\n} | {\n readonly type: \"not_dispatched\";\n};\nexport interface ActorHostTransport {\n invoke(target: ActorHostTarget, invocation: DirectActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n}\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, isRecord, 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 beforeInvoke;\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.beforeInvoke = dependencies.beforeInvoke ?? (() => { });\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 this.beforeInvoke(requestId);\n const invocation = this.invocation(requestId, actorName, actorId, method, args);\n timeline.mark(\"invocation_built\");\n const target = await this.target(invocation, timeline);\n timeline.mark(\"target_resolved\");\n const result = await this.direct(target, 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 direct(target, invocation, retryAvailable, timeline) {\n try {\n const reply = await this.actorHost.invoke(target, invocation);\n timeline.mark(\"host_rpc_completed\");\n if (reply.type === \"completed\") {\n timeline.mark(\"socket_effects_completed\");\n return reply.result;\n }\n if (reply.type === \"failed\")\n throw new ActorInvocationError(reply.code, invocation.requestId, reply.message);\n this.invalidateTarget(invocation, target);\n if (reply.type === \"unauthenticated\" && !retryAvailable) {\n throw new ActorInvocationError(\"unauthenticated\", invocation.requestId, \"actor host rejected the refreshed invocation ticket\");\n }\n if (!retryAvailable)\n throw new ActorInvocationError(\"unavailable\", invocation.requestId, reply.type === \"not_dispatched\"\n ? \"actor host could not be reached before execution\"\n : \"actor ownership changed repeatedly before execution\");\n const rerouted = await this.target(invocation, timeline);\n return this.direct(rerouted, invocation, false, timeline);\n }\n catch (error) {\n if (error instanceof ActorInvocationError || error instanceof ActorProtocolError)\n throw error;\n this.invalidateTarget(invocation, target);\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 invalidateTarget(invocation, target) {\n const key = actorKey(invocation.actorName, invocation.actorId);\n const current = this.targets.get(key);\n if (current?.target === target)\n this.targets.delete(key);\n }\n async target(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 const target = await current.promise;\n if (this.targets.get(key) !== current)\n return this.target(invocation, timeline);\n if (target.expiresAtMs > this.now() + TARGET_EXPIRATION_SAFETY_MS)\n return target;\n this.targets.delete(key);\n }\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: \"error\",\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 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 }\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 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, DirectActorInvocation } 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 readonly beforeInvoke;\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 direct;\n private invalidateTarget;\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<DirectActorInvocation, \"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 readonly beforeInvoke?: (requestId: string) => void;\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: \"error\",\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 > 64 * 1024)\n throw new ActorValidationError(\"socket metadata exceeds 65536 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/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 SocketProxy = class {\n constructor() {\n throw new Error(\"ActorProxy must be used on the server\");\n }\n};\nexport { createActorStub, createActorTransport, SocketProxy };\nexport { ActorInvocationError } from \"./errors.js\";\n", "runtime/index.browser.d.ts": "import type { SocketProxy as ServerProxy } from \"./proxy.js\";\nimport type { createActorStub as ServerStub, createActorTransport as ServerTransport } from \"./stub.js\";\ndeclare const createActorStub: typeof ServerStub;\ndeclare const createActorTransport: typeof ServerTransport;\ndeclare const SocketProxy: typeof ServerProxy;\nexport { createActorStub, createActorTransport, SocketProxy };\nexport { ActorInvocationError } from \"./errors.js\";\n", "runtime/index.js": "export { createActorStub, createActorTransport } from \"./stub.js\";\nexport { ActorInvocationError } from \"./errors.js\";\nexport { SocketProxy } from \"./proxy.js\";\n", "runtime/index.d.ts": "export { createActorStub, createActorTransport } from \"./stub.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. */\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}\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, 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. */\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}\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, 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 // TODO: Replace this extra round trip with durable idempotency keys for safe invocation retries.\n const readiness = await this.ping(target, invocation);\n if (readiness !== \"ready\")\n return { type: readiness };\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_dispatched\" };\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 const reply = await responseDocument(response);\n if (isRecord(reply)) {\n if (reply.type === \"completed\" && Object.hasOwn(reply, \"result\"))\n return { type: \"completed\", result: reply.result };\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 };\n if (reply.type === \"reroute\")\n return { type: \"reroute\" };\n }\n throw new ActorProtocolError(\"actor host response did not contain a valid outcome\");\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 async ping(target, actor) {\n try {\n const response = await this.fetchRequest(`${validateOrigin(target.route)}${projectActorPath(actor.projectId, actor.actorName, actor.actorId)}/invoke`, {\n method: \"HEAD\",\n redirect: \"error\",\n headers: { authorization: `Bearer ${target.token}` },\n signal: AbortSignal.timeout(5_000)\n });\n if (response.status === 401)\n return \"unauthenticated\";\n return response.status === 204 ? \"ready\" : \"not_dispatched\";\n }\n catch {\n return \"not_dispatched\";\n }\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: \"error\",\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}\nfunction 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: DirectActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n private ping;\n private post;\n}\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 DirectActorInvocation extends ActorAddress {\n readonly requestId: string;\n readonly method: string;\n readonly args: readonly JsonValue[];\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: \"reroute\";\n} | {\n readonly type: \"unauthenticated\";\n} | {\n readonly type: \"not_dispatched\";\n};\nexport interface ActorHostTransport {\n invoke(target: ActorHostTarget, invocation: DirectActorInvocation): Promise<ActorHostReply>;\n publish(target: ActorHostTarget, actor: ActorAddress, effects: readonly unknown[]): Promise<void>;\n}\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, isRecord, 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 beforeInvoke;\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.beforeInvoke = dependencies.beforeInvoke ?? (() => { });\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 this.beforeInvoke(requestId);\n const invocation = this.invocation(requestId, actorName, actorId, method, args);\n timeline.mark(\"invocation_built\");\n const target = await this.target(invocation, timeline);\n timeline.mark(\"target_resolved\");\n const result = await this.direct(target, 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 direct(target, invocation, retryAvailable, timeline) {\n try {\n const reply = await this.actorHost.invoke(target, invocation);\n timeline.mark(\"host_rpc_completed\");\n if (reply.type === \"completed\") {\n timeline.mark(\"socket_effects_completed\");\n return reply.result;\n }\n if (reply.type === \"failed\")\n throw new ActorInvocationError(reply.code, invocation.requestId, reply.message);\n this.invalidateTarget(invocation, target);\n if (reply.type === \"unauthenticated\" && !retryAvailable) {\n throw new ActorInvocationError(\"unauthenticated\", invocation.requestId, \"actor host rejected the refreshed invocation ticket\");\n }\n if (!retryAvailable)\n throw new ActorInvocationError(\"unavailable\", invocation.requestId, reply.type === \"not_dispatched\"\n ? \"actor host could not be reached before execution\"\n : \"actor ownership changed repeatedly before execution\");\n const rerouted = await this.target(invocation, timeline);\n return this.direct(rerouted, invocation, false, timeline);\n }\n catch (error) {\n if (error instanceof ActorInvocationError || error instanceof ActorProtocolError)\n throw error;\n this.invalidateTarget(invocation, target);\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 invalidateTarget(invocation, target) {\n const key = actorKey(invocation.actorName, invocation.actorId);\n const current = this.targets.get(key);\n if (current?.target === target)\n this.targets.delete(key);\n }\n async target(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 const target = await current.promise;\n if (this.targets.get(key) !== current)\n return this.target(invocation, timeline);\n if (target.expiresAtMs > this.now() + TARGET_EXPIRATION_SAFETY_MS)\n return target;\n this.targets.delete(key);\n }\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: \"error\",\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 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 }\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 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, DirectActorInvocation } 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 readonly beforeInvoke;\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 direct;\n private invalidateTarget;\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<DirectActorInvocation, \"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 readonly beforeInvoke?: (requestId: string) => void;\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: \"error\",\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 > 64 * 1024)\n throw new ActorValidationError(\"socket metadata exceeds 65536 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/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 SocketProxy = class {\n constructor() {\n throw new Error(\"ActorProxy must be used on the server\");\n }\n};\nexport { createActorStub, createActorTransport, SocketProxy };\nexport { ActorInvocationError } from \"./errors.js\";\n", "runtime/index.browser.d.ts": "import type { SocketProxy as ServerProxy } from \"./proxy.js\";\nimport type { createActorStub as ServerStub, createActorTransport as ServerTransport } from \"./stub.js\";\ndeclare const createActorStub: typeof ServerStub;\ndeclare const createActorTransport: typeof ServerTransport;\ndeclare const SocketProxy: typeof ServerProxy;\nexport { createActorStub, createActorTransport, SocketProxy };\nexport { ActorInvocationError } from \"./errors.js\";\n", "runtime/index.js": "export { createActorStub, createActorTransport } from \"./stub.js\";\nexport { ActorInvocationError } from \"./errors.js\";\nexport { SocketProxy } from \"./proxy.js\";\n", "runtime/index.d.ts": "export { createActorStub, createActorTransport } from \"./stub.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,8xDAA8xD,EAAC,qBAAqB,EAAC,wzCAAwzC,EAAC,iBAAiB,EAAC,4iBAA4iB,EAAC,mBAAmB,EAAC,0TAA0T,EAAC,qBAAqB,EAAC,suGAAsuG,EAAC,uBAAuB,EAAC,08BAA08B,EAAC,iBAAiB,EAAC,gjHAAgjH,EAAC,mBAAmB,EAAC,2nDAA2nD,EAAC,sBAAsB,EAAC,ycAAyc,EAAC,wBAAwB,EAAC,+bAA+b,EAAC,mBAAmB,EAAC,+4SAA+4S,EAAC,qBAAqB,EAAC,gmEAAgmE,EAAC,kBAAkB,EAAC,s1JAAs1J,EAAC,oBAAoB,EAAC,w7DAAw7D,EAAC,iBAAiB,EAAC,o9DAAo9D,EAAC,mBAAmB,EAAC,0wBAA0wB,EAAC,0BAA0B,EAAC,ocAAoc,EAAC,4BAA4B,EAAC,scAAsc,EAAC,kBAAkB,EAAC,4KAA4K,EAAC,oBAAoB,EAAC,0WAA0W,EAAC,sBAAsB,EAAC,qJAAqJ,EAAC,oBAAoB,EAAC,ijCAAijC,EAAC,CAAA"}
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,8xDAA8xD,EAAC,qBAAqB,EAAC,wzCAAwzC,EAAC,iBAAiB,EAAC,4iBAA4iB,EAAC,mBAAmB,EAAC,0TAA0T,EAAC,qBAAqB,EAAC,suGAAsuG,EAAC,uBAAuB,EAAC,08BAA08B,EAAC,iBAAiB,EAAC,g9IAAg9I,EAAC,mBAAmB,EAAC,8oDAA8oD,EAAC,sBAAsB,EAAC,ycAAyc,EAAC,wBAAwB,EAAC,+bAA+b,EAAC,mBAAmB,EAAC,+4SAA+4S,EAAC,qBAAqB,EAAC,gmEAAgmE,EAAC,kBAAkB,EAAC,s1JAAs1J,EAAC,oBAAoB,EAAC,w7DAAw7D,EAAC,iBAAiB,EAAC,o9DAAo9D,EAAC,mBAAmB,EAAC,0wBAA0wB,EAAC,0BAA0B,EAAC,ocAAoc,EAAC,4BAA4B,EAAC,scAAsc,EAAC,kBAAkB,EAAC,4KAA4K,EAAC,oBAAoB,EAAC,0WAA0W,EAAC,sBAAsB,EAAC,qJAAqJ,EAAC,oBAAoB,EAAC,ijCAAijC,EAAC,CAAA"}
@@ -10,7 +10,7 @@
10
10
  "check": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "durable-actors": "0.4.3"
13
+ "durable-actors": "0.4.5"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^22.0.0",
@@ -15,7 +15,7 @@
15
15
  "@ai-sdk/react": "^4.0.100",
16
16
  "ai": "^7.0.97",
17
17
  "express": "^5.2.1",
18
- "durable-actors": "0.4.3",
18
+ "durable-actors": "0.4.5",
19
19
  "react": "^19.3.0",
20
20
  "react-dom": "^19.3.0"
21
21
  },
@@ -12,7 +12,7 @@
12
12
  },
13
13
  "dependencies": {
14
14
  "express": "^5.2.1",
15
- "durable-actors": "0.4.3",
15
+ "durable-actors": "0.4.5",
16
16
  "react": "^19.3.0",
17
17
  "react-dom": "^19.3.0"
18
18
  },
@@ -19,7 +19,7 @@
19
19
  "@tiptap/y-tiptap": "^3.0.7",
20
20
  "express": "^5.2.1",
21
21
  "lib0": "^0.2.117",
22
- "durable-actors": "0.4.3",
22
+ "durable-actors": "0.4.5",
23
23
  "react": "^19.3.0",
24
24
  "react-dom": "^19.3.0",
25
25
  "yjs": "^13.6.32"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "durable-actors",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Provider-neutral actors for sandbox compute",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -93,7 +93,7 @@
93
93
  "vite": "^8.3.0",
94
94
  "ws": "^8.18.3",
95
95
  "zod": "^4.3.6",
96
- "durable-actors-observer": "0.4.3"
96
+ "durable-actors-observer": "0.4.5"
97
97
  },
98
98
  "devDependencies": {
99
99
  "@types/node": "^22.0.0",