durable-actors 0.7.16 → 0.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (175) hide show
  1. package/README.md +6 -6
  2. package/bin/durable-actors.js +2 -0
  3. package/dist/actor/actor.d.ts +20 -12
  4. package/dist/actor/actor.d.ts.map +1 -1
  5. package/dist/actor/actor.js +42 -35
  6. package/dist/actor/actor.js.map +1 -1
  7. package/dist/actor/alarm.d.ts +19 -0
  8. package/dist/actor/alarm.d.ts.map +1 -0
  9. package/dist/actor/alarm.js +2 -0
  10. package/dist/actor/alarm.js.map +1 -0
  11. package/dist/actor/context.d.ts +25 -0
  12. package/dist/actor/context.d.ts.map +1 -0
  13. package/dist/actor/context.js +83 -0
  14. package/dist/actor/context.js.map +1 -0
  15. package/dist/actor/database.d.ts +5 -4
  16. package/dist/actor/database.d.ts.map +1 -1
  17. package/dist/actor/database.js +9 -19
  18. package/dist/actor/database.js.map +1 -1
  19. package/dist/actor/decorators.d.ts +7 -2
  20. package/dist/actor/decorators.d.ts.map +1 -1
  21. package/dist/actor/decorators.js +11 -2
  22. package/dist/actor/decorators.js.map +1 -1
  23. package/dist/actor/resource.d.ts +9 -0
  24. package/dist/actor/resource.d.ts.map +1 -0
  25. package/dist/actor/resource.js +2 -0
  26. package/dist/actor/resource.js.map +1 -0
  27. package/dist/actor/schema.d.ts +3 -1
  28. package/dist/actor/schema.d.ts.map +1 -1
  29. package/dist/actor/schema.js.map +1 -1
  30. package/dist/actor/unchecked.d.ts +12 -0
  31. package/dist/actor/unchecked.d.ts.map +1 -0
  32. package/dist/actor/unchecked.js +8 -0
  33. package/dist/actor/unchecked.js.map +1 -0
  34. package/dist/cli/dev.d.ts.map +1 -1
  35. package/dist/cli/dev.js +13 -42
  36. package/dist/cli/dev.js.map +1 -1
  37. package/dist/cli/inspect.d.ts +73 -0
  38. package/dist/cli/inspect.d.ts.map +1 -0
  39. package/dist/cli/inspect.js +132 -0
  40. package/dist/cli/inspect.js.map +1 -0
  41. package/dist/cli/python.d.ts.map +1 -1
  42. package/dist/cli/python.js +0 -1
  43. package/dist/cli/python.js.map +1 -1
  44. package/dist/cli.d.ts +1 -1
  45. package/dist/cli.js +11 -18
  46. package/dist/cli.js.map +1 -1
  47. package/dist/client-runtime/http.d.ts +1 -1
  48. package/dist/client-runtime/http.d.ts.map +1 -1
  49. package/dist/client-runtime/http.js +1 -1
  50. package/dist/client-runtime/http.js.map +1 -1
  51. package/dist/client-runtime/stub.d.ts.map +1 -1
  52. package/dist/client-runtime/stub.js +11 -1
  53. package/dist/client-runtime/stub.js.map +1 -1
  54. package/dist/compiler/actor-compiler.d.ts +4 -2
  55. package/dist/compiler/actor-compiler.d.ts.map +1 -1
  56. package/dist/compiler/actor-compiler.js +48 -13
  57. package/dist/compiler/actor-compiler.js.map +1 -1
  58. package/dist/compiler/declarations.d.ts.map +1 -1
  59. package/dist/compiler/declarations.js +2678 -183
  60. package/dist/compiler/declarations.js.map +7 -1
  61. package/dist/compiler/features/atomicity.d.ts +9 -0
  62. package/dist/compiler/features/atomicity.d.ts.map +1 -0
  63. package/dist/compiler/features/atomicity.js +44 -0
  64. package/dist/compiler/features/atomicity.js.map +1 -0
  65. package/dist/compiler/features/interleave.d.ts +9 -0
  66. package/dist/compiler/features/{reentrancy.d.ts.map → interleave.d.ts.map} +1 -1
  67. package/dist/compiler/features/{reentrancy.js → interleave.js} +13 -13
  68. package/dist/compiler/features/{reentrancy.js.map → interleave.js.map} +1 -1
  69. package/dist/compiler/features/persistence.d.ts +2 -5
  70. package/dist/compiler/features/persistence.d.ts.map +1 -1
  71. package/dist/compiler/features/persistence.js +5 -83
  72. package/dist/compiler/features/persistence.js.map +1 -1
  73. package/dist/compiler/features/resource.d.ts +5 -0
  74. package/dist/compiler/features/resource.d.ts.map +1 -0
  75. package/dist/compiler/features/resource.js +18 -0
  76. package/dist/compiler/features/resource.js.map +1 -0
  77. package/dist/compiler/fieldParsing.d.ts +12 -0
  78. package/dist/compiler/fieldParsing.d.ts.map +1 -0
  79. package/dist/compiler/fieldParsing.js +106 -0
  80. package/dist/compiler/fieldParsing.js.map +1 -0
  81. package/dist/compiler/json-schema.d.ts +2 -2
  82. package/dist/compiler/json-schema.d.ts.map +1 -1
  83. package/dist/compiler/json-schema.js +22 -14
  84. package/dist/compiler/json-schema.js.map +1 -1
  85. package/dist/compiler/rpc-contract.d.ts +1 -1
  86. package/dist/compiler/rpc-contract.d.ts.map +1 -1
  87. package/dist/compiler/rpc-contract.js +21 -11
  88. package/dist/compiler/rpc-contract.js.map +1 -1
  89. package/dist/compiler/socket-contract.d.ts +1 -1
  90. package/dist/compiler/socket-contract.d.ts.map +1 -1
  91. package/dist/compiler/socket-contract.js +3 -3
  92. package/dist/compiler/socket-contract.js.map +1 -1
  93. package/dist/compiler/types.d.ts +13 -3
  94. package/dist/compiler/types.d.ts.map +1 -1
  95. package/dist/compiler/types.js +3 -1
  96. package/dist/compiler/types.js.map +1 -1
  97. package/dist/compiler/validate-public-contract.d.ts.map +1 -1
  98. package/dist/compiler/validate-public-contract.js +12 -1
  99. package/dist/compiler/validate-public-contract.js.map +1 -1
  100. package/dist/generated/client-runtime.d.ts.map +1 -1
  101. package/dist/generated/client-runtime.js +1 -1
  102. package/dist/generated/client-runtime.js.map +1 -1
  103. package/dist/host/actor-host.d.ts.map +1 -1
  104. package/dist/host/actor-host.js +44 -50
  105. package/dist/host/actor-host.js.map +1 -1
  106. package/dist/host/actor-runtime.d.ts +7 -8
  107. package/dist/host/actor-runtime.d.ts.map +1 -1
  108. package/dist/host/actor-runtime.js +80 -79
  109. package/dist/host/actor-runtime.js.map +1 -1
  110. package/dist/host/actor-worker.js +10 -27
  111. package/dist/host/actor-worker.js.map +1 -1
  112. package/dist/host/database-bridge.d.ts +16 -0
  113. package/dist/host/database-bridge.d.ts.map +1 -0
  114. package/dist/host/database-bridge.js +29 -0
  115. package/dist/host/database-bridge.js.map +1 -0
  116. package/dist/host/database.d.ts +86 -0
  117. package/dist/host/database.d.ts.map +1 -0
  118. package/dist/host/database.js +87 -0
  119. package/dist/host/database.js.map +1 -0
  120. package/dist/host/generic-host.js +1 -1
  121. package/dist/host/persisted-fields.d.ts +7 -0
  122. package/dist/host/persisted-fields.d.ts.map +1 -0
  123. package/dist/host/persisted-fields.js +29 -0
  124. package/dist/host/persisted-fields.js.map +1 -0
  125. package/dist/host/protocol.d.ts +55 -131
  126. package/dist/host/protocol.d.ts.map +1 -1
  127. package/dist/host/protocol.js +28 -28
  128. package/dist/host/protocol.js.map +1 -1
  129. package/dist/host/types.d.ts +8 -9
  130. package/dist/host/types.d.ts.map +1 -1
  131. package/dist/host/worker-supervisor.d.ts +32 -30
  132. package/dist/host/worker-supervisor.d.ts.map +1 -1
  133. package/dist/host/worker-supervisor.js +246 -230
  134. package/dist/host/worker-supervisor.js.map +1 -1
  135. package/dist/index.d.ts +5 -2
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/index.js +2 -1
  138. package/dist/index.js.map +1 -1
  139. package/dist/projectSdk.js +1 -1
  140. package/dist/projectSdk.js.map +1 -1
  141. package/dist/templates/actor/README.md +7 -9
  142. package/dist/templates/actor/bunfig +2 -0
  143. package/dist/templates/actor/package.json +6 -3
  144. package/dist/templates/ai-chat/README.md +8 -8
  145. package/dist/templates/ai-chat/bunfig +2 -0
  146. package/dist/templates/ai-chat/package.json +7 -5
  147. package/dist/templates/ai-chat/src/actors.ts +1 -1
  148. package/dist/templates/chat/README.md +8 -8
  149. package/dist/templates/chat/bunfig +2 -0
  150. package/dist/templates/chat/package.json +7 -5
  151. package/dist/templates/chat/src/actors.ts +1 -1
  152. package/dist/templates/documents/README.md +8 -8
  153. package/dist/templates/documents/bunfig +2 -0
  154. package/dist/templates/documents/package.json +7 -5
  155. package/dist/templates/documents/src/actors.ts +1 -1
  156. package/package.json +110 -108
  157. package/dist/cli/actor-source-watcher.d.ts +0 -25
  158. package/dist/cli/actor-source-watcher.d.ts.map +0 -1
  159. package/dist/cli/actor-source-watcher.js +0 -129
  160. package/dist/cli/actor-source-watcher.js.map +0 -1
  161. package/dist/compiler/features/reentrancy.d.ts +0 -9
  162. package/dist/host/sqlite.d.ts +0 -49
  163. package/dist/host/sqlite.d.ts.map +0 -1
  164. package/dist/host/sqlite.js +0 -159
  165. package/dist/host/sqlite.js.map +0 -1
  166. package/dist/templates/actor/pnpm-workspace.yaml +0 -2
  167. package/dist/templates/ai-chat/pnpm-workspace.yaml +0 -2
  168. package/dist/templates/chat/pnpm-workspace.yaml +0 -2
  169. package/dist/templates/documents/pnpm-workspace.yaml +0 -2
  170. package/dist/templates/python/README.md +0 -7
  171. package/dist/templates/python/gitignore +0 -6
  172. package/dist/templates/python/package.json +0 -11
  173. package/dist/templates/python/pnpm-workspace.yaml +0 -2
  174. package/dist/templates/python/pyproject.toml +0 -8
  175. package/dist/templates/python/src/actors.py +0 -9
@@ -1,25 +1,23 @@
1
1
  # Actors
2
2
 
3
- Requires Node.js 22.19.0+, pnpm, and Bun 1.3.9+ on your PATH.
3
+ Requires Bun 1.4.2+ on your PATH.
4
4
 
5
5
  ```sh
6
- pnpm install
7
- # Or with npm:
8
- npm install
9
- npx durable-actors dev
6
+ bun install
7
+ bunx durable-actors dev
10
8
  ```
11
9
 
12
10
  Define your actors in `src/actors.ts`. The starter contains a counter with persisted state and `read()` and `increment()` methods. Each counter ID has its own saved value.
13
11
 
14
- `npx durable-actors dev` watches your actor source and stores local state in `.durable-actors/`. It defaults to project ID `local`; choose another with `DURABLE_ACTORS_PROJECT_ID=my-project npx durable-actors dev`.
12
+ `bunx durable-actors dev` watches your actor source and stores local state in `.durable-actors/`. It defaults to project ID `local`; choose another with `DURABLE_ACTORS_PROJECT_ID=my-project bunx durable-actors dev`.
15
13
 
16
14
  ## Connect your application
17
15
 
18
16
  In your separate application project's directory:
19
17
 
20
- 1. Run `pnpm install --save-dev durable-actors` or `npm install --save-dev durable-actors`.
18
+ 1. Run `bun add --dev durable-actors`.
21
19
  2. Use the local defaults: project `local`, URL `http://127.0.0.1:7100`, and no secret. If you configure a different project, port, or optional secret on the actor server, put matching settings in your application’s `.env` or `.env.local` file.
22
- 3. Run `npx durable-actors generate`; the CLI loads both environment files automatically. Exported environment variables take precedence over `.env.local`, which takes precedence over `.env`.
20
+ 3. Run `bunx durable-actors generate`; the CLI loads both environment files automatically. Exported environment variables take precedence over `.env.local`, which takes precedence over `.env`.
23
21
 
24
22
  Your application backend can then use the generated client:
25
23
 
@@ -30,4 +28,4 @@ const counter = actors.Counter.get("example")
30
28
  console.log(await counter.increment())
31
29
  ```
32
30
 
33
- Use `pnpm check` to check types. Production deployment integrations register actor images through `PUT /v1/projects/{project_id}/deployment`; see the [HTTP API](https://github.com/TerseAI/durable-actors/blob/main/docs/reference/openapi.yaml).
31
+ Use `bun run --bun check` to check types. Production deployment integrations register actor images through `PUT /v1/projects/{project_id}/deployment`; see the [HTTP API](https://github.com/TerseAI/durable-actors/blob/main/docs/reference/openapi.yaml).
@@ -0,0 +1,2 @@
1
+ [run]
2
+ bun = true
@@ -3,17 +3,20 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "engines": {
6
- "node": ">=22.19.0"
6
+ "bun": ">=1.4.2"
7
7
  },
8
8
  "scripts": {
9
9
  "dev": "durable-actors dev",
10
10
  "check": "tsc --noEmit"
11
11
  },
12
12
  "dependencies": {
13
- "durable-actors": "0.7.16"
13
+ "durable-actors": "0.8.1"
14
14
  },
15
15
  "devDependencies": {
16
16
  "@types/node": "^22.0.0",
17
17
  "typescript": "~5.9.3"
18
- }
18
+ },
19
+ "trustedDependencies": [
20
+ "esbuild"
21
+ ]
19
22
  }
@@ -4,25 +4,25 @@ An Express + React app that streams replies with the Vercel AI SDK and saves con
4
4
 
5
5
  ## Run locally
6
6
 
7
- Requires Node.js 22.19+, Bun 1.3.9+, and an OpenAI API key.
7
+ Requires Bun 1.4.2+ and an OpenAI API key.
8
8
 
9
9
  ```sh
10
- npx durable-actors init ai-chat-example --template ai-chat
10
+ bunx durable-actors init ai-chat-example --template ai-chat
11
11
  cd ai-chat-example
12
- npm install
12
+ bun install
13
13
  cp .env.example .env
14
14
  ```
15
15
 
16
- Already in the example directory? Start at `npm install`. Add `OPENAI_API_KEY` to `.env`, then start the actors:
16
+ Already in the example directory? Start at `bun install`. Add `OPENAI_API_KEY` to `.env`, then start the actors:
17
17
 
18
18
  ```sh
19
- npm run dev:actors
19
+ bun run dev:actors
20
20
  ```
21
21
 
22
22
  Wait for `Ready`. In another terminal in the same directory:
23
23
 
24
24
  ```sh
25
- npm run dev
25
+ bun run dev
26
26
  ```
27
27
 
28
28
  Open [localhost:3000](http://127.0.0.1:3000), send a message, and reload after the reply finishes. The conversation survives server restarts.
@@ -37,6 +37,6 @@ The lobby is shared and has no authentication. Add authentication and chat owner
37
37
 
38
38
  ## Development
39
39
 
40
- Both processes read `.env`; actor state lives in `.durable-actors/`. Actor code reloads automatically; restart `npm run dev` after editing the actor class imported by the backend. For multiple examples, set distinct `PORT`, `DURABLE_ACTORS_PORT`, and matching control-plane URLs; see [Run the examples together](https://github.com/TerseAI/durable-actors/tree/main/examples#run-the-examples-together).
40
+ Both processes read `.env`; actor state lives in `.durable-actors/`. Actor code reloads automatically; restart `bun run dev` after editing the actor class imported by the backend. For multiple examples, set distinct `PORT`, `DURABLE_ACTORS_PORT`, and matching control-plane URLs; see [Run the examples together](https://github.com/TerseAI/durable-actors/tree/main/examples#run-the-examples-together).
41
41
 
42
- `npm run build` checks TypeScript and builds the frontend.
42
+ `bun run build` checks TypeScript and builds the frontend.
@@ -0,0 +1,2 @@
1
+ [run]
2
+ bun = true
@@ -3,10 +3,10 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "engines": {
6
- "node": ">=22.19.0"
6
+ "bun": ">=1.4.2"
7
7
  },
8
8
  "scripts": {
9
- "dev": "tsx --env-file=.env src/backend.ts",
9
+ "dev": "bun src/backend.ts",
10
10
  "dev:actors": "durable-actors dev",
11
11
  "build": "tsc --noEmit && vite build"
12
12
  },
@@ -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.7.16",
18
+ "durable-actors": "0.8.1",
19
19
  "react": "^19.3.0",
20
20
  "react-dom": "^19.3.0"
21
21
  },
@@ -24,8 +24,10 @@
24
24
  "@types/node": "^22.0.0",
25
25
  "@types/react": "^19.0.0",
26
26
  "@types/react-dom": "^19.0.0",
27
- "tsx": "^4.0.0",
28
27
  "typescript": "~5.9.3",
29
28
  "vite": "^8.3.0"
30
- }
29
+ },
30
+ "trustedDependencies": [
31
+ "esbuild"
32
+ ]
31
33
  }
@@ -9,6 +9,6 @@ export class ChatHistory extends Actor {
9
9
  }
10
10
 
11
11
  async append(...messages: UIMessage[]) {
12
- this.messages.push(...messages)
12
+ this.messages = [...this.messages, ...messages]
13
13
  }
14
14
  }
@@ -6,22 +6,22 @@ An Express + React chatroom with shared messages and persistent history.
6
6
 
7
7
  ## Run locally
8
8
 
9
- Requires Node.js 22.19+ and Bun 1.3.9+.
9
+ Requires Bun 1.4.2+.
10
10
 
11
11
  ```sh
12
- npx durable-actors init chat-example --template chat
12
+ bunx durable-actors init chat-example --template chat
13
13
  cd chat-example
14
- npm install
14
+ bun install
15
15
  cp .env.example .env
16
- npm run dev:actors
16
+ bun run dev:actors
17
17
  ```
18
18
 
19
- Already in the example directory? Start at `npm install`.
19
+ Already in the example directory? Start at `bun install`.
20
20
 
21
21
  Wait for `Ready`. In another terminal in the same directory:
22
22
 
23
23
  ```sh
24
- npm run dev
24
+ bun run dev
25
25
  ```
26
26
 
27
27
  Open [localhost:3000](http://127.0.0.1:3000) in two tabs; messages stay saved after an actor server restart.
@@ -69,8 +69,8 @@ The demo joins as a guest; add authentication and room access checks before issu
69
69
 
70
70
  ## Development
71
71
 
72
- Actors reload automatically; restart `npm run dev` after changing public actor types. See [port settings](../README.md#run-the-examples-together) to run multiple examples.
72
+ Actors reload automatically; restart `bun run dev` after changing public actor types. See [port settings](../README.md#run-the-examples-together) to run multiple examples.
73
73
 
74
74
  ```sh
75
- npm run build
75
+ bun run build
76
76
  ```
@@ -0,0 +1,2 @@
1
+ [run]
2
+ bun = true
@@ -3,16 +3,16 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "engines": {
6
- "node": ">=22.19.0"
6
+ "bun": ">=1.4.2"
7
7
  },
8
8
  "scripts": {
9
- "dev": "durable-actors generate && tsx --env-file=.env src/backend.ts",
9
+ "dev": "durable-actors generate && bun src/backend.ts",
10
10
  "dev:actors": "durable-actors dev",
11
11
  "build": "durable-actors generate src/actors.ts && tsc --noEmit && vite build"
12
12
  },
13
13
  "dependencies": {
14
14
  "express": "^5.2.1",
15
- "durable-actors": "0.7.16",
15
+ "durable-actors": "0.8.1",
16
16
  "react": "^19.3.0",
17
17
  "react-dom": "^19.3.0"
18
18
  },
@@ -21,8 +21,10 @@
21
21
  "@types/node": "^22.0.0",
22
22
  "@types/react": "^19.0.0",
23
23
  "@types/react-dom": "^19.0.0",
24
- "tsx": "^4.0.0",
25
24
  "typescript": "~5.9.3",
26
25
  "vite": "^8.3.0"
27
- }
26
+ },
27
+ "trustedDependencies": [
28
+ "esbuild"
29
+ ]
28
30
  }
@@ -9,7 +9,7 @@ export class ChatRoom extends Actor<Member, string, ChatMessage[]> {
9
9
  }
10
10
 
11
11
  async onMessage(socket: ActorSocket<Member, ChatMessage[]>, text: string) {
12
- this.history.push({ name: socket.metadata.name, text })
12
+ this.history = [...this.history, { name: socket.metadata.name, text }]
13
13
  this.broadcast(this.history)
14
14
  }
15
15
  }
@@ -4,22 +4,22 @@ A Tiptap editor with Yjs for concurrent edits and durable actors for saved docum
4
4
 
5
5
  ## Run locally
6
6
 
7
- Requires Node.js 22.19+ and Bun 1.3.9+.
7
+ Requires Bun 1.4.2+.
8
8
 
9
9
  ```sh
10
- npx durable-actors init documents-example --template documents
10
+ bunx durable-actors init documents-example --template documents
11
11
  cd documents-example
12
- npm install
12
+ bun install
13
13
  cp .env.example .env
14
- npm run dev:actors
14
+ bun run dev:actors
15
15
  ```
16
16
 
17
- Already in the example directory? Start at `npm install`.
17
+ Already in the example directory? Start at `bun install`.
18
18
 
19
19
  Wait for `Ready`. In another terminal in the same directory:
20
20
 
21
21
  ```sh
22
- npm run dev
22
+ bun run dev
23
23
  ```
24
24
 
25
25
  Open [localhost:3000](http://127.0.0.1:3000) in two tabs. Edit **Welcome** from both, add another document, and switch between them. Restart the servers and reload to restore saved documents.
@@ -48,6 +48,6 @@ Editing pauses while disconnected. Reload to reconnect; unsaved edits are not st
48
48
 
49
49
  ## Development
50
50
 
51
- Both processes read `.env`; saved state lives in `.durable-actors/`. Actor code reloads automatically. After changing public actor types, restart `npm run dev` to regenerate the client. For multiple examples, set distinct `PORT`, `DURABLE_ACTORS_PORT`, and matching control-plane URLs; see [Run the examples together](https://github.com/TerseAI/durable-actors/tree/main/examples#run-the-examples-together).
51
+ Both processes read `.env`; saved state lives in `.durable-actors/`. Actor code reloads automatically. After changing public actor types, restart `bun run dev` to regenerate the client. For multiple examples, set distinct `PORT`, `DURABLE_ACTORS_PORT`, and matching control-plane URLs; see [Run the examples together](https://github.com/TerseAI/durable-actors/tree/main/examples#run-the-examples-together).
52
52
 
53
- `npm run build` generates clients, checks TypeScript, and builds the frontend.
53
+ `bun run build` generates clients, checks TypeScript, and builds the frontend.
@@ -0,0 +1,2 @@
1
+ [run]
2
+ bun = true
@@ -3,10 +3,10 @@
3
3
  "private": true,
4
4
  "type": "module",
5
5
  "engines": {
6
- "node": ">=22.19.0"
6
+ "bun": ">=1.4.2"
7
7
  },
8
8
  "scripts": {
9
- "dev": "durable-actors generate && tsx --env-file=.env src/backend.ts",
9
+ "dev": "durable-actors generate && bun src/backend.ts",
10
10
  "dev:actors": "durable-actors dev",
11
11
  "build": "durable-actors generate src/actors.ts && tsc --noEmit && vite build"
12
12
  },
@@ -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.7.16",
22
+ "durable-actors": "0.8.1",
23
23
  "react": "^19.3.0",
24
24
  "react-dom": "^19.3.0",
25
25
  "yjs": "^13.6.32"
@@ -29,8 +29,10 @@
29
29
  "@types/node": "^22.0.0",
30
30
  "@types/react": "^19.0.0",
31
31
  "@types/react-dom": "^19.0.0",
32
- "tsx": "^4.0.0",
33
32
  "typescript": "~5.9.3",
34
33
  "vite": "^8.3.0"
35
- }
34
+ },
35
+ "trustedDependencies": [
36
+ "esbuild"
37
+ ]
36
38
  }
@@ -11,7 +11,7 @@ export class Workspace extends Actor<null, DocumentInfo, DocumentInfo[]> {
11
11
  }
12
12
 
13
13
  async onMessage(_socket: ActorSocket<null, DocumentInfo[]>, document: DocumentInfo) {
14
- if (!this.documents.some(item => item.id === document.id)) this.documents.push(document)
14
+ if (!this.documents.some(item => item.id === document.id)) this.documents = [...this.documents, document]
15
15
  this.broadcast(this.documents)
16
16
  }
17
17
  }
package/package.json CHANGED
@@ -1,116 +1,118 @@
1
1
  {
2
- "name": "durable-actors",
3
- "version": "0.7.16",
4
- "description": "Provider-neutral actors for sandbox compute",
5
- "type": "module",
6
- "license": "MIT",
7
- "sideEffects": false,
8
- "engines": {
9
- "node": "^20.19.0 || >=22.12.0"
10
- },
11
- "keywords": [
12
- "actors",
13
- "distributed-systems",
14
- "durable-actors",
15
- "kubernetes",
16
- "serverless"
17
- ],
18
- "repository": {
19
- "type": "git",
20
- "url": "git+https://github.com/TerseAI/durable-actors.git",
21
- "directory": "sdk"
22
- },
23
- "homepage": "https://github.com/TerseAI/durable-actors#readme",
24
- "bugs": {
25
- "url": "https://github.com/TerseAI/durable-actors/issues"
26
- },
27
- "publishConfig": {
28
- "access": "public"
29
- },
30
- "main": "dist/index.js",
31
- "types": "dist/index.d.ts",
32
- "bin": {
33
- "durable-actors": "dist/cli.js"
34
- },
35
- "exports": {
36
- "./backend": {
37
- "types": "./dist/backend.d.ts",
38
- "import": "./dist/backend.js",
39
- "default": "./dist/backend.js"
2
+ "name": "durable-actors",
3
+ "version": "0.8.1",
4
+ "description": "Provider-neutral actors for sandbox compute",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "sideEffects": false,
8
+ "engines": {
9
+ "bun": ">=1.4.2"
40
10
  },
41
- "./dev": {
42
- "types": "./dist/localRuntime.d.ts",
43
- "import": "./dist/localRuntime.js",
44
- "default": "./dist/localRuntime.js"
11
+ "packageManager": "bun@1.4.2",
12
+ "keywords": [
13
+ "actors",
14
+ "distributed-systems",
15
+ "durable-actors",
16
+ "kubernetes",
17
+ "serverless"
18
+ ],
19
+ "repository": {
20
+ "type": "git",
21
+ "url": "git+https://github.com/TerseAI/durable-actors.git",
22
+ "directory": "sdk"
45
23
  },
46
- "./proxy": {
47
- "types": "./dist/proxy.d.ts",
48
- "import": "./dist/proxy.js",
49
- "default": "./dist/proxy.js"
24
+ "homepage": "https://github.com/TerseAI/durable-actors#readme",
25
+ "bugs": {
26
+ "url": "https://github.com/TerseAI/durable-actors/issues"
50
27
  },
51
- ".": {
52
- "types": "./dist/index.d.ts",
53
- "import": "./dist/index.js",
54
- "default": "./dist/index.js"
28
+ "publishConfig": {
29
+ "access": "public"
55
30
  },
56
- "./host": {
57
- "types": "./dist/host.d.ts",
58
- "import": "./dist/host.js",
59
- "default": "./dist/host.js"
31
+ "main": "dist/index.js",
32
+ "types": "dist/index.d.ts",
33
+ "bin": {
34
+ "durable-actors": "bin/durable-actors.js"
60
35
  },
61
- "./compiler": {
62
- "types": "./dist/compiler/actor-compiler.d.ts",
63
- "import": "./dist/compiler/actor-compiler.js",
64
- "default": "./dist/compiler/actor-compiler.js"
36
+ "exports": {
37
+ "./backend": {
38
+ "types": "./dist/backend.d.ts",
39
+ "import": "./dist/backend.js",
40
+ "default": "./dist/backend.js"
41
+ },
42
+ "./dev": {
43
+ "types": "./dist/localRuntime.d.ts",
44
+ "import": "./dist/localRuntime.js",
45
+ "default": "./dist/localRuntime.js"
46
+ },
47
+ "./proxy": {
48
+ "types": "./dist/proxy.d.ts",
49
+ "import": "./dist/proxy.js",
50
+ "default": "./dist/proxy.js"
51
+ },
52
+ ".": {
53
+ "types": "./dist/index.d.ts",
54
+ "import": "./dist/index.js",
55
+ "default": "./dist/index.js"
56
+ },
57
+ "./host": {
58
+ "types": "./dist/host.d.ts",
59
+ "import": "./dist/host.js",
60
+ "default": "./dist/host.js"
61
+ },
62
+ "./compiler": {
63
+ "types": "./dist/compiler/actor-compiler.d.ts",
64
+ "import": "./dist/compiler/actor-compiler.js",
65
+ "default": "./dist/compiler/actor-compiler.js"
66
+ },
67
+ "./codegen": {
68
+ "types": "./dist/compiler/generators/client-artifacts.d.ts",
69
+ "import": "./dist/compiler/generators/client-artifacts.js",
70
+ "default": "./dist/compiler/generators/client-artifacts.js"
71
+ }
65
72
  },
66
- "./codegen": {
67
- "types": "./dist/compiler/generators/client-artifacts.d.ts",
68
- "import": "./dist/compiler/generators/client-artifacts.js",
69
- "default": "./dist/compiler/generators/client-artifacts.js"
73
+ "files": [
74
+ "bin",
75
+ "dist",
76
+ "README.md",
77
+ "LICENSE.md"
78
+ ],
79
+ "scripts": {
80
+ "build": "bun run --bun build:observer && bun run --bun build:client && tsc -p tsconfig.build.json && bun run --bun build:declarations && bun scripts/build-template.mjs",
81
+ "check": "bun run --bun format:check && bun run --bun test && bun run --bun package:check",
82
+ "clean": "rm -rf dist .test-dist",
83
+ "package:check": "bun test --timeout 60000 tests/scripts/codegen-api.test.mjs tests/scripts/build-artifact.test.mjs tests/scripts/standalone-client.test.mjs tests/scripts/host-runtime.test.mjs",
84
+ "prepack": "bun run --bun clean && bun run --bun build && bun run --bun package:check",
85
+ "test": "bun run --bun clean && bun run --bun build && bun tests/prepare.mjs && tsc -p tsconfig.test.json && bun test --parallel=1 --timeout 60000 ./.test-dist/tests",
86
+ "format": "prettier --config ../.prettierrc --write \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/*.mjs\" \"tests/**/*.mjs\"",
87
+ "format:check": "prettier --config ../.prettierrc --check \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/*.mjs\" \"tests/**/*.mjs\"",
88
+ "build:observer": "bun run --bun --cwd ../packages/observer-ui build",
89
+ "docs": "typedoc --options typedoc.json",
90
+ "build:client": "bun scripts/build-client-runtime.mjs",
91
+ "build:declarations": "bun scripts/build-declaration-compiler.mjs"
92
+ },
93
+ "dependencies": {
94
+ "@types/json-schema": "^7.0.15",
95
+ "ajv": "^8.20.0",
96
+ "commander": "^14.0.3",
97
+ "durable-actors-observer": "0.8.1",
98
+ "esbuild": "^0.28.2",
99
+ "import-meta-resolve": "^4.2.0",
100
+ "open": "^10.2.0",
101
+ "prettier": "^3.9.6",
102
+ "tar": "^7.5.22",
103
+ "typescript": "~5.9.3",
104
+ "typescript-json-schema": "^0.68.0",
105
+ "validate-npm-package-name": "^6.0.2",
106
+ "vite": "^8.3.0",
107
+ "ws": "^8.18.3",
108
+ "zod": "^4.3.6"
109
+ },
110
+ "devDependencies": {
111
+ "@types/node": "^22.0.0",
112
+ "@types/validate-npm-package-name": "^4.0.2",
113
+ "@types/ws": "^8.18.1",
114
+ "dts-bundle-generator": "9.5.1",
115
+ "typedoc": "^0.28.20",
116
+ "typedoc-plugin-missing-exports": "^4.1.4"
70
117
  }
71
- },
72
- "files": [
73
- "dist",
74
- "README.md",
75
- "LICENSE.md"
76
- ],
77
- "dependencies": {
78
- "@types/json-schema": "^7.0.15",
79
- "ajv": "^8.20.0",
80
- "chokidar": "^4.0.3",
81
- "commander": "^14.0.3",
82
- "dotenv": "^18.0.0",
83
- "dts-bundle-generator": "9.5.1",
84
- "esbuild": "^0.28.2",
85
- "import-meta-resolve": "^4.2.0",
86
- "open": "^10.2.0",
87
- "prettier": "^3.9.6",
88
- "tar": "^7.5.22",
89
- "typescript": "~5.9.3",
90
- "typescript-json-schema": "^0.68.0",
91
- "validate-npm-package-name": "^6.0.2",
92
- "vite": "^8.3.0",
93
- "ws": "^8.18.3",
94
- "zod": "^4.3.6",
95
- "durable-actors-observer": "0.7.16"
96
- },
97
- "devDependencies": {
98
- "@types/node": "^22.0.0",
99
- "@types/validate-npm-package-name": "^4.0.2",
100
- "@types/ws": "^8.18.1",
101
- "typedoc": "^0.28.20",
102
- "typedoc-plugin-missing-exports": "^4.1.4"
103
- },
104
- "scripts": {
105
- "build": "pnpm run build:observer && pnpm run build:client && tsc -p tsconfig.build.json && node scripts/build-template.mjs && pnpm --dir .. install --offline --frozen-lockfile --ignore-scripts",
106
- "check": "pnpm run format:check && pnpm run test && pnpm run package:check",
107
- "clean": "rm -rf dist .test-dist",
108
- "package:check": "node --test tests/scripts/codegen-api.test.mjs tests/scripts/build-artifact.test.mjs tests/scripts/standalone-client.test.mjs",
109
- "test": "pnpm run clean && pnpm run build && node tests/prepare.mjs && tsc -p tsconfig.test.json && node scripts/test.mjs",
110
- "format": "prettier --config ../.prettierrc --write \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/*.mjs\" \"tests/**/*.mjs\"",
111
- "format:check": "prettier --config ../.prettierrc --check \"src/**/*.ts\" \"tests/**/*.ts\" \"scripts/*.mjs\" \"tests/**/*.mjs\"",
112
- "build:observer": "pnpm --filter durable-actors-observer build",
113
- "docs": "typedoc --options typedoc.json",
114
- "build:client": "node scripts/build-client-runtime.mjs"
115
- }
116
- }
118
+ }
@@ -1,25 +0,0 @@
1
- import { watch } from "chokidar";
2
- interface ActorSourceWatcherOptions {
3
- projectDirectory: string;
4
- dataDirectory?: string;
5
- }
6
- declare function watchActorSources(options: ActorSourceWatcherOptions, refresh: () => Promise<void>): Promise<ActorSourceWatcher>;
7
- declare class ActorSourceWatcher {
8
- private readonly options;
9
- private readonly refresh;
10
- private readonly createWatcher;
11
- private readonly warn;
12
- private watcher?;
13
- private timer?;
14
- private updates;
15
- private closing?;
16
- private disabled;
17
- constructor(options: ActorSourceWatcherOptions, refresh: () => Promise<void>, createWatcher: typeof watch, warn: (message: string) => void);
18
- start(): Promise<void>;
19
- close(): Promise<void>;
20
- private scheduleRefresh;
21
- private waitUntilReady;
22
- private disable;
23
- }
24
- export { ActorSourceWatcher, watchActorSources };
25
- //# sourceMappingURL=actor-source-watcher.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"actor-source-watcher.d.ts","sourceRoot":"","sources":["../../src/cli/actor-source-watcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,EAAE,MAAM,UAAU,CAAA;AAIhD,UAAU,yBAAyB;IAC/B,gBAAgB,EAAE,MAAM,CAAA;IACxB,aAAa,CAAC,EAAE,MAAM,CAAA;CACzB;AAED,iBAAe,iBAAiB,CAC5B,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,GAC7B,OAAO,CAAC,kBAAkB,CAAC,CAI7B;AAED,cAAM,kBAAkB;IAQhB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAC9B,OAAO,CAAC,QAAQ,CAAC,IAAI;IAVzB,OAAO,CAAC,OAAO,CAAC,CAAW;IAC3B,OAAO,CAAC,KAAK,CAAC,CAA+B;IAC7C,OAAO,CAAC,OAAO,CAAoB;IACnC,OAAO,CAAC,OAAO,CAAC,CAAe;IAC/B,OAAO,CAAC,QAAQ,CAAQ;gBAGH,OAAO,EAAE,yBAAyB,EAClC,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,EAC5B,aAAa,EAAE,OAAO,KAAK,EAC3B,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI;IAG9C,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBtB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAY5B,OAAO,CAAC,eAAe;IAQvB,OAAO,CAAC,cAAc;YAgBR,OAAO;CAUxB;AA0CD,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,CAAA"}