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.
- package/README.md +6 -6
- package/bin/durable-actors.js +2 -0
- package/dist/actor/actor.d.ts +20 -12
- package/dist/actor/actor.d.ts.map +1 -1
- package/dist/actor/actor.js +42 -35
- package/dist/actor/actor.js.map +1 -1
- package/dist/actor/alarm.d.ts +19 -0
- package/dist/actor/alarm.d.ts.map +1 -0
- package/dist/actor/alarm.js +2 -0
- package/dist/actor/alarm.js.map +1 -0
- package/dist/actor/context.d.ts +25 -0
- package/dist/actor/context.d.ts.map +1 -0
- package/dist/actor/context.js +83 -0
- package/dist/actor/context.js.map +1 -0
- package/dist/actor/database.d.ts +5 -4
- package/dist/actor/database.d.ts.map +1 -1
- package/dist/actor/database.js +9 -19
- package/dist/actor/database.js.map +1 -1
- package/dist/actor/decorators.d.ts +7 -2
- package/dist/actor/decorators.d.ts.map +1 -1
- package/dist/actor/decorators.js +11 -2
- package/dist/actor/decorators.js.map +1 -1
- package/dist/actor/resource.d.ts +9 -0
- package/dist/actor/resource.d.ts.map +1 -0
- package/dist/actor/resource.js +2 -0
- package/dist/actor/resource.js.map +1 -0
- package/dist/actor/schema.d.ts +3 -1
- package/dist/actor/schema.d.ts.map +1 -1
- package/dist/actor/schema.js.map +1 -1
- package/dist/actor/unchecked.d.ts +12 -0
- package/dist/actor/unchecked.d.ts.map +1 -0
- package/dist/actor/unchecked.js +8 -0
- package/dist/actor/unchecked.js.map +1 -0
- package/dist/cli/dev.d.ts.map +1 -1
- package/dist/cli/dev.js +13 -42
- package/dist/cli/dev.js.map +1 -1
- package/dist/cli/inspect.d.ts +73 -0
- package/dist/cli/inspect.d.ts.map +1 -0
- package/dist/cli/inspect.js +132 -0
- package/dist/cli/inspect.js.map +1 -0
- package/dist/cli/python.d.ts.map +1 -1
- package/dist/cli/python.js +0 -1
- package/dist/cli/python.js.map +1 -1
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +11 -18
- package/dist/cli.js.map +1 -1
- package/dist/client-runtime/http.d.ts +1 -1
- package/dist/client-runtime/http.d.ts.map +1 -1
- package/dist/client-runtime/http.js +1 -1
- package/dist/client-runtime/http.js.map +1 -1
- package/dist/client-runtime/stub.d.ts.map +1 -1
- package/dist/client-runtime/stub.js +11 -1
- package/dist/client-runtime/stub.js.map +1 -1
- package/dist/compiler/actor-compiler.d.ts +4 -2
- package/dist/compiler/actor-compiler.d.ts.map +1 -1
- package/dist/compiler/actor-compiler.js +48 -13
- package/dist/compiler/actor-compiler.js.map +1 -1
- package/dist/compiler/declarations.d.ts.map +1 -1
- package/dist/compiler/declarations.js +2678 -183
- package/dist/compiler/declarations.js.map +7 -1
- package/dist/compiler/features/atomicity.d.ts +9 -0
- package/dist/compiler/features/atomicity.d.ts.map +1 -0
- package/dist/compiler/features/atomicity.js +44 -0
- package/dist/compiler/features/atomicity.js.map +1 -0
- package/dist/compiler/features/interleave.d.ts +9 -0
- package/dist/compiler/features/{reentrancy.d.ts.map → interleave.d.ts.map} +1 -1
- package/dist/compiler/features/{reentrancy.js → interleave.js} +13 -13
- package/dist/compiler/features/{reentrancy.js.map → interleave.js.map} +1 -1
- package/dist/compiler/features/persistence.d.ts +2 -5
- package/dist/compiler/features/persistence.d.ts.map +1 -1
- package/dist/compiler/features/persistence.js +5 -83
- package/dist/compiler/features/persistence.js.map +1 -1
- package/dist/compiler/features/resource.d.ts +5 -0
- package/dist/compiler/features/resource.d.ts.map +1 -0
- package/dist/compiler/features/resource.js +18 -0
- package/dist/compiler/features/resource.js.map +1 -0
- package/dist/compiler/fieldParsing.d.ts +12 -0
- package/dist/compiler/fieldParsing.d.ts.map +1 -0
- package/dist/compiler/fieldParsing.js +106 -0
- package/dist/compiler/fieldParsing.js.map +1 -0
- package/dist/compiler/json-schema.d.ts +2 -2
- package/dist/compiler/json-schema.d.ts.map +1 -1
- package/dist/compiler/json-schema.js +22 -14
- package/dist/compiler/json-schema.js.map +1 -1
- package/dist/compiler/rpc-contract.d.ts +1 -1
- package/dist/compiler/rpc-contract.d.ts.map +1 -1
- package/dist/compiler/rpc-contract.js +21 -11
- package/dist/compiler/rpc-contract.js.map +1 -1
- package/dist/compiler/socket-contract.d.ts +1 -1
- package/dist/compiler/socket-contract.d.ts.map +1 -1
- package/dist/compiler/socket-contract.js +3 -3
- package/dist/compiler/socket-contract.js.map +1 -1
- package/dist/compiler/types.d.ts +13 -3
- package/dist/compiler/types.d.ts.map +1 -1
- package/dist/compiler/types.js +3 -1
- package/dist/compiler/types.js.map +1 -1
- package/dist/compiler/validate-public-contract.d.ts.map +1 -1
- package/dist/compiler/validate-public-contract.js +12 -1
- package/dist/compiler/validate-public-contract.js.map +1 -1
- package/dist/generated/client-runtime.d.ts.map +1 -1
- package/dist/generated/client-runtime.js +1 -1
- package/dist/generated/client-runtime.js.map +1 -1
- package/dist/host/actor-host.d.ts.map +1 -1
- package/dist/host/actor-host.js +44 -50
- package/dist/host/actor-host.js.map +1 -1
- package/dist/host/actor-runtime.d.ts +7 -8
- package/dist/host/actor-runtime.d.ts.map +1 -1
- package/dist/host/actor-runtime.js +80 -79
- package/dist/host/actor-runtime.js.map +1 -1
- package/dist/host/actor-worker.js +10 -27
- package/dist/host/actor-worker.js.map +1 -1
- package/dist/host/database-bridge.d.ts +16 -0
- package/dist/host/database-bridge.d.ts.map +1 -0
- package/dist/host/database-bridge.js +29 -0
- package/dist/host/database-bridge.js.map +1 -0
- package/dist/host/database.d.ts +86 -0
- package/dist/host/database.d.ts.map +1 -0
- package/dist/host/database.js +87 -0
- package/dist/host/database.js.map +1 -0
- package/dist/host/generic-host.js +1 -1
- package/dist/host/persisted-fields.d.ts +7 -0
- package/dist/host/persisted-fields.d.ts.map +1 -0
- package/dist/host/persisted-fields.js +29 -0
- package/dist/host/persisted-fields.js.map +1 -0
- package/dist/host/protocol.d.ts +55 -131
- package/dist/host/protocol.d.ts.map +1 -1
- package/dist/host/protocol.js +28 -28
- package/dist/host/protocol.js.map +1 -1
- package/dist/host/types.d.ts +8 -9
- package/dist/host/types.d.ts.map +1 -1
- package/dist/host/worker-supervisor.d.ts +32 -30
- package/dist/host/worker-supervisor.d.ts.map +1 -1
- package/dist/host/worker-supervisor.js +246 -230
- package/dist/host/worker-supervisor.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/projectSdk.js +1 -1
- package/dist/projectSdk.js.map +1 -1
- package/dist/templates/actor/README.md +7 -9
- package/dist/templates/actor/bunfig +2 -0
- package/dist/templates/actor/package.json +6 -3
- package/dist/templates/ai-chat/README.md +8 -8
- package/dist/templates/ai-chat/bunfig +2 -0
- package/dist/templates/ai-chat/package.json +7 -5
- package/dist/templates/ai-chat/src/actors.ts +1 -1
- package/dist/templates/chat/README.md +8 -8
- package/dist/templates/chat/bunfig +2 -0
- package/dist/templates/chat/package.json +7 -5
- package/dist/templates/chat/src/actors.ts +1 -1
- package/dist/templates/documents/README.md +8 -8
- package/dist/templates/documents/bunfig +2 -0
- package/dist/templates/documents/package.json +7 -5
- package/dist/templates/documents/src/actors.ts +1 -1
- package/package.json +110 -108
- package/dist/cli/actor-source-watcher.d.ts +0 -25
- package/dist/cli/actor-source-watcher.d.ts.map +0 -1
- package/dist/cli/actor-source-watcher.js +0 -129
- package/dist/cli/actor-source-watcher.js.map +0 -1
- package/dist/compiler/features/reentrancy.d.ts +0 -9
- package/dist/host/sqlite.d.ts +0 -49
- package/dist/host/sqlite.d.ts.map +0 -1
- package/dist/host/sqlite.js +0 -159
- package/dist/host/sqlite.js.map +0 -1
- package/dist/templates/actor/pnpm-workspace.yaml +0 -2
- package/dist/templates/ai-chat/pnpm-workspace.yaml +0 -2
- package/dist/templates/chat/pnpm-workspace.yaml +0 -2
- package/dist/templates/documents/pnpm-workspace.yaml +0 -2
- package/dist/templates/python/README.md +0 -7
- package/dist/templates/python/gitignore +0 -6
- package/dist/templates/python/package.json +0 -11
- package/dist/templates/python/pnpm-workspace.yaml +0 -2
- package/dist/templates/python/pyproject.toml +0 -8
- package/dist/templates/python/src/actors.py +0 -9
|
@@ -1,25 +1,23 @@
|
|
|
1
1
|
# Actors
|
|
2
2
|
|
|
3
|
-
Requires
|
|
3
|
+
Requires Bun 1.4.2+ on your PATH.
|
|
4
4
|
|
|
5
5
|
```sh
|
|
6
|
-
|
|
7
|
-
|
|
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
|
-
`
|
|
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 `
|
|
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 `
|
|
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 `
|
|
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).
|
|
@@ -3,17 +3,20 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
|
-
"
|
|
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.
|
|
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
|
|
7
|
+
Requires Bun 1.4.2+ and an OpenAI API key.
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
|
|
10
|
+
bunx durable-actors init ai-chat-example --template ai-chat
|
|
11
11
|
cd ai-chat-example
|
|
12
|
-
|
|
12
|
+
bun install
|
|
13
13
|
cp .env.example .env
|
|
14
14
|
```
|
|
15
15
|
|
|
16
|
-
Already in the example directory? Start at `
|
|
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
|
-
|
|
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
|
-
|
|
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 `
|
|
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
|
-
`
|
|
42
|
+
`bun run build` checks TypeScript and builds the frontend.
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
|
-
"
|
|
6
|
+
"bun": ">=1.4.2"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"dev": "
|
|
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.
|
|
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
|
}
|
|
@@ -6,22 +6,22 @@ An Express + React chatroom with shared messages and persistent history.
|
|
|
6
6
|
|
|
7
7
|
## Run locally
|
|
8
8
|
|
|
9
|
-
Requires
|
|
9
|
+
Requires Bun 1.4.2+.
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
|
|
12
|
+
bunx durable-actors init chat-example --template chat
|
|
13
13
|
cd chat-example
|
|
14
|
-
|
|
14
|
+
bun install
|
|
15
15
|
cp .env.example .env
|
|
16
|
-
|
|
16
|
+
bun run dev:actors
|
|
17
17
|
```
|
|
18
18
|
|
|
19
|
-
Already in the example directory? Start at `
|
|
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
|
-
|
|
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 `
|
|
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
|
-
|
|
75
|
+
bun run build
|
|
76
76
|
```
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
|
-
"
|
|
6
|
+
"bun": ">=1.4.2"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"dev": "durable-actors generate &&
|
|
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.
|
|
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.
|
|
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
|
|
7
|
+
Requires Bun 1.4.2+.
|
|
8
8
|
|
|
9
9
|
```sh
|
|
10
|
-
|
|
10
|
+
bunx durable-actors init documents-example --template documents
|
|
11
11
|
cd documents-example
|
|
12
|
-
|
|
12
|
+
bun install
|
|
13
13
|
cp .env.example .env
|
|
14
|
-
|
|
14
|
+
bun run dev:actors
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
Already in the example directory? Start at `
|
|
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
|
-
|
|
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 `
|
|
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
|
-
`
|
|
53
|
+
`bun run build` generates clients, checks TypeScript, and builds the frontend.
|
|
@@ -3,10 +3,10 @@
|
|
|
3
3
|
"private": true,
|
|
4
4
|
"type": "module",
|
|
5
5
|
"engines": {
|
|
6
|
-
"
|
|
6
|
+
"bun": ">=1.4.2"
|
|
7
7
|
},
|
|
8
8
|
"scripts": {
|
|
9
|
-
"dev": "durable-actors generate &&
|
|
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.
|
|
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.
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
"
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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
|
-
"
|
|
47
|
-
|
|
48
|
-
|
|
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
|
-
|
|
53
|
-
"import": "./dist/index.js",
|
|
54
|
-
"default": "./dist/index.js"
|
|
28
|
+
"publishConfig": {
|
|
29
|
+
"access": "public"
|
|
55
30
|
},
|
|
56
|
-
"
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
31
|
+
"main": "dist/index.js",
|
|
32
|
+
"types": "dist/index.d.ts",
|
|
33
|
+
"bin": {
|
|
34
|
+
"durable-actors": "bin/durable-actors.js"
|
|
60
35
|
},
|
|
61
|
-
"
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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"}
|