durable-actors 0.2.4 → 0.2.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.
@@ -4,8 +4,8 @@ function runtimeEnvironment(executable) {
4
4
  return {
5
5
  ...process.env,
6
6
  PATH: `${path.dirname(executable)}${path.delimiter}${process.env.PATH ?? ""}`,
7
- DURABLE_OBJECT_PROCESS_ROLE: process.env.DURABLE_OBJECT_PROCESS_ROLE ?? "control_plane",
8
- DURABLE_OBJECT_PARENT_LIFETIME_STDIN: "1"
7
+ DURABLE_ACTORS_PROCESS_ROLE: process.env.DURABLE_ACTORS_PROCESS_ROLE ?? "control_plane",
8
+ DURABLE_ACTORS_PARENT_LIFETIME_STDIN: "1"
9
9
  };
10
10
  }
11
11
  // This subprocess exists solely to run the native Rust control plane.
@@ -20,7 +20,7 @@ function startRustRuntime(command, args, env, parentLifetime, readiness = false)
20
20
  const parentClosed = () => child.stdin?.end();
21
21
  process.on("SIGINT", interrupt);
22
22
  process.on("SIGTERM", terminate);
23
- if (parentLifetime && process.env.DURABLE_OBJECT_PARENT_LIFETIME_STDIN) {
23
+ if (parentLifetime && process.env.DURABLE_ACTORS_PARENT_LIFETIME_STDIN) {
24
24
  process.stdin.resume();
25
25
  process.stdin.on("end", parentClosed);
26
26
  }
@@ -16,7 +16,7 @@ class LatencyTimeline {
16
16
  }
17
17
  }
18
18
  const stderrTelemetry = event => {
19
- if (process.env.DURABLE_OBJECT_TELEMETRY !== "0")
19
+ if (process.env.DURABLE_ACTORS_TELEMETRY !== "0")
20
20
  process.stderr.write(`${JSON.stringify(event)}\n`);
21
21
  };
22
22
  export { LatencyTimeline, stderrTelemetry };
@@ -1 +1 @@
1
- {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAgBlF"}
1
+ {"version":3,"file":"environment.d.ts","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAQlF"}
@@ -1,18 +1,10 @@
1
1
  export function actorEnvironment(environment) {
2
2
  const resolved = { ...environment };
3
- for (const [name, value] of Object.entries(environment)) {
4
- if (name.startsWith("DURABLE_OBJECT_") && value !== undefined)
5
- resolved[name.replace("DURABLE_OBJECT_", "DURABLE_ACTORS_")] ??= value;
6
- }
7
3
  const secret = resolved.DURABLE_ACTORS_SECRET ?? resolved.DURABLE_ACTORS_API_KEY;
8
4
  if (secret !== undefined) {
9
5
  resolved.DURABLE_ACTORS_SECRET = secret;
10
6
  resolved.DURABLE_ACTORS_API_KEY = secret;
11
7
  }
12
- for (const [name, value] of Object.entries(resolved)) {
13
- if (name.startsWith("DURABLE_ACTORS_") && value !== undefined)
14
- resolved[name.replace("DURABLE_ACTORS_", "DURABLE_OBJECT_")] = value;
15
- }
16
8
  return resolved;
17
9
  }
18
10
  //# sourceMappingURL=environment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,WAA8B;IAC3D,MAAM,QAAQ,GAAG,EAAE,GAAG,WAAW,EAAE,CAAA;IACnC,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACtD,IAAI,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,KAAK,KAAK,SAAS;YACzD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,KAAK,KAAK,CAAA;IAC9E,CAAC;IACD,MAAM,MAAM,GAAG,QAAQ,CAAC,qBAAqB,IAAI,QAAQ,CAAC,sBAAsB,CAAA;IAChF,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,QAAQ,CAAC,qBAAqB,GAAG,MAAM,CAAA;QACvC,QAAQ,CAAC,sBAAsB,GAAG,MAAM,CAAA;IAC5C,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;QACnD,IAAI,IAAI,CAAC,UAAU,CAAC,iBAAiB,CAAC,IAAI,KAAK,KAAK,SAAS;YACzD,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,iBAAiB,EAAE,iBAAiB,CAAC,CAAC,GAAG,KAAK,CAAA;IAC5E,CAAC;IACD,OAAO,QAAQ,CAAA;AACnB,CAAC"}
1
+ {"version":3,"file":"environment.js","sourceRoot":"","sources":["../src/environment.ts"],"names":[],"mappings":"AAAA,MAAM,UAAU,gBAAgB,CAAC,WAA8B;IAC3D,MAAM,QAAQ,GAAG,EAAE,GAAG,WAAW,EAAE,CAAA;IACnC,MAAM,MAAM,GAAG,QAAQ,CAAC,qBAAqB,IAAI,QAAQ,CAAC,sBAAsB,CAAA;IAChF,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;QACvB,QAAQ,CAAC,qBAAqB,GAAG,MAAM,CAAA;QACvC,QAAQ,CAAC,sBAAsB,GAAG,MAAM,CAAA;IAC5C,CAAC;IACD,OAAO,QAAQ,CAAA;AACnB,CAAC"}
@@ -358,10 +358,10 @@ function parseHostSettings(environment) {
358
358
  if (!result.success)
359
359
  throw new ActorConfigurationError(`actor-host session settings are invalid: ${result.error.message}`);
360
360
  return {
361
- socketPath: result.data.DURABLE_OBJECT_EXECUTOR_SOCKET,
362
- actorEntrypoint: result.data.DURABLE_OBJECT_ENTRYPOINT,
363
- startupTimeoutMs: parseStartupTimeout(environment.DURABLE_OBJECT_HOST_STARTUP_MS),
364
- actorIdleTimeoutMs: parseActorIdleTimeout(environment.DURABLE_OBJECT_ACTOR_IDLE_TIMEOUT_SECONDS)
361
+ socketPath: result.data.DURABLE_ACTORS_EXECUTOR_SOCKET,
362
+ actorEntrypoint: result.data.DURABLE_ACTORS_ENTRYPOINT,
363
+ startupTimeoutMs: parseStartupTimeout(environment.DURABLE_ACTORS_HOST_STARTUP_MS),
364
+ actorIdleTimeoutMs: parseActorIdleTimeout(environment.DURABLE_ACTORS_ACTOR_IDLE_TIMEOUT_SECONDS)
365
365
  };
366
366
  }
367
367
  function parseStartupTimeout(value) {
@@ -369,7 +369,7 @@ function parseStartupTimeout(value) {
369
369
  return DEFAULT_ACTOR_STARTUP_TIMEOUT_MS;
370
370
  const parsed = Number(value);
371
371
  if (!Number.isInteger(parsed) || parsed <= 0)
372
- throw new ActorConfigurationError("DURABLE_OBJECT_HOST_STARTUP_MS must be a positive integer");
372
+ throw new ActorConfigurationError("DURABLE_ACTORS_HOST_STARTUP_MS must be a positive integer");
373
373
  return parsed;
374
374
  }
375
375
  function parseActorIdleTimeout(value) {
@@ -377,15 +377,15 @@ function parseActorIdleTimeout(value) {
377
377
  return DEFAULT_ACTOR_IDLE_TIMEOUT_MS;
378
378
  const parsed = Number(value);
379
379
  if (!Number.isInteger(parsed) || parsed <= 0 || parsed > MAX_ACTOR_IDLE_TIMEOUT_SECONDS) {
380
- throw new ActorConfigurationError(`DURABLE_OBJECT_ACTOR_IDLE_TIMEOUT_SECONDS must be an integer between 1 and ${MAX_ACTOR_IDLE_TIMEOUT_SECONDS}`);
380
+ throw new ActorConfigurationError(`DURABLE_ACTORS_ACTOR_IDLE_TIMEOUT_SECONDS must be an integer between 1 and ${MAX_ACTOR_IDLE_TIMEOUT_SECONDS}`);
381
381
  }
382
382
  return parsed * 1_000;
383
383
  }
384
384
  const DEFAULT_ACTOR_STARTUP_TIMEOUT_MS = 10_000;
385
385
  const MAX_ACTOR_IDLE_TIMEOUT_SECONDS = 86_400;
386
386
  const actorSessionSettingsSchema = z.object({
387
- DURABLE_OBJECT_EXECUTOR_SOCKET: z.string().trim().min(1),
388
- DURABLE_OBJECT_ENTRYPOINT: z.string().trim().min(1).optional()
387
+ DURABLE_ACTORS_EXECUTOR_SOCKET: z.string().trim().min(1),
388
+ DURABLE_ACTORS_ENTRYPOINT: z.string().trim().min(1).optional()
389
389
  });
390
390
  const DEFAULT_ACTOR_ENTRYPOINT = "dist/actors.mjs";
391
391
  export { ActorSession, connectSocket, parseHostSettings, prepareActorEntrypoint, resolveActorEntrypoint, runActorHost, serializeWithinBytes };
@@ -50,8 +50,8 @@ function launch(executable, options) {
50
50
  env: {
51
51
  ...actorEnvironment(process.env),
52
52
  PATH: `${path.dirname(process.execPath)}${path.delimiter}${path.dirname(executable)}${path.delimiter}${process.env.PATH ?? ""}`,
53
- DURABLE_OBJECT_PROCESS_ROLE: "control_plane",
54
- DURABLE_OBJECT_PARENT_LIFETIME_STDIN: "1"
53
+ DURABLE_ACTORS_PROCESS_ROLE: "control_plane",
54
+ DURABLE_ACTORS_PARENT_LIFETIME_STDIN: "1"
55
55
  },
56
56
  stdio: ["pipe", options.quiet ? "ignore" : "inherit", options.quiet ? "ignore" : "inherit", "pipe"]
57
57
  });
@@ -11,7 +11,7 @@
11
11
  "check": "tsc --noEmit"
12
12
  },
13
13
  "dependencies": {
14
- "durable-actors": "0.2.4"
14
+ "durable-actors": "0.2.5"
15
15
  },
16
16
  "devDependencies": {
17
17
  "@types/node": "^22.0.0",
@@ -14,7 +14,7 @@
14
14
  "@ai-sdk/react": "^4.0.100",
15
15
  "ai": "^7.0.97",
16
16
  "express": "^5.2.1",
17
- "durable-actors": "0.2.4",
17
+ "durable-actors": "0.2.5",
18
18
  "react": "^19.3.0",
19
19
  "react-dom": "^19.3.0"
20
20
  },
@@ -11,7 +11,7 @@
11
11
  },
12
12
  "dependencies": {
13
13
  "express": "^5.2.1",
14
- "durable-actors": "0.2.4",
14
+ "durable-actors": "0.2.5",
15
15
  "react": "^19.3.0",
16
16
  "react-dom": "^19.3.0"
17
17
  },
@@ -18,7 +18,7 @@
18
18
  "@tiptap/y-tiptap": "^3.0.7",
19
19
  "express": "^5.2.1",
20
20
  "lib0": "^0.2.117",
21
- "durable-actors": "0.2.4",
21
+ "durable-actors": "0.2.5",
22
22
  "react": "^19.3.0",
23
23
  "react-dom": "^19.3.0",
24
24
  "yjs": "^13.6.32"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "durable-actors",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Provider-neutral actors for sandbox compute",
5
5
  "type": "module",
6
6
  "license": "MIT",