Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

Commit 4513f33

Browse files
committed
feat(engine): add engine driver
1 parent 0433897 commit 4513f33

30 files changed

+1404
-311
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@
77

88
*.png binary
99
*.jpg binary
10+
*.tgz binary
1011

NEW_SPEC.md

Lines changed: 0 additions & 177 deletions
This file was deleted.

NEW_SPEC2.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

packages/core/package.json

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,20 +158,21 @@
158158
},
159159
"dependencies": {
160160
"@hono/standard-validator": "^0.1.3",
161-
"cbor-x": "^1.6.0",
161+
"@hono/zod-openapi": "^0.19.10",
162162
"@rivetkit/fast-json-patch": "^3.1.2",
163+
"cbor-x": "^1.6.0",
164+
"hono": "^4.7.0",
163165
"invariant": "^2.2.4",
164166
"nanoevents": "^9.1.0",
165167
"on-change": "^5.0.1",
166168
"p-retry": "^6.2.1",
167-
"zod": "^3.25.76",
168-
"@hono/zod-openapi": "^0.19.10",
169-
"hono": "^4.7.0"
169+
"zod": "^3.25.76"
170170
},
171171
"devDependencies": {
172-
"@hono/node-server": "^1.14.0",
172+
"@hono/node-server": "^1.18.2",
173173
"@hono/node-ws": "^1.1.1",
174174
"@rivet-gg/actor-core": "^25.1.0",
175+
"@rivetkit/engine-runner": "https://pkg.pr.new/rivet-gg/engine/@rivetkit/engine-runner@435",
175176
"@types/invariant": "^2",
176177
"@types/node": "^22.13.1",
177178
"@types/ws": "^8",

packages/core/src/client/actor-handle.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,25 @@ export class ActorHandleRaw {
149149
"getOrCreateForKey" in this.#actorQuery
150150
) {
151151
// TODO:
152+
let name: string;
153+
if ("getForKey" in this.#actorQuery) {
154+
name = this.#actorQuery.getForKey.name;
155+
} else if ("getOrCreateForKey" in this.#actorQuery) {
156+
name = this.#actorQuery.getOrCreateForKey.name;
157+
} else {
158+
assertUnreachable(this.#actorQuery);
159+
}
160+
152161
const actorId = await this.#driver.resolveActorId(
153162
undefined,
154163
this.#actorQuery,
155164
this.#encodingKind,
156165
this.#params,
157166
signal ? { signal } : undefined,
158167
);
159-
this.#actorQuery = { getForId: { actorId } };
168+
169+
this.#actorQuery = { getForId: { actorId, name } };
170+
160171
return actorId;
161172
} else if ("getForId" in this.#actorQuery) {
162173
// SKip since it's already resolved

packages/core/src/client/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,9 @@ export class ClientRaw {
268268
params: opts?.params,
269269
});
270270

271-
const actorQuery = {
271+
const actorQuery: ActorQuery = {
272272
getForId: {
273+
name,
273274
actorId,
274275
},
275276
};
@@ -400,6 +401,7 @@ export class ClientRaw {
400401
// Create handle with actor ID
401402
const getForIdQuery = {
402403
getForId: {
404+
name,
403405
actorId,
404406
},
405407
} satisfies ActorQuery;

packages/core/src/drivers/default.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
import { UserError } from "@/actor/errors";
12
import { logger } from "@/actor/log";
23
import { createFileSystemOrMemoryDriver } from "@/drivers/file-system/mod";
3-
import { type DriverConfig, UserError } from "@/mod";
4+
import type { DriverConfig } from "@/registry/run-config";
45
import { getEnvUniversal } from "@/utils";
56

67
/**

0 commit comments

Comments
 (0)