The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 24, 14:00 UTC
fix(contracts): accept CLI event origins (#8905)
Yukun Shan committed
Sep 1, 2026 at 01:21 UTC
2921050c698fb195e2f5590b7cfab8fdfe0ec729
2 files changed
+7
-3
apps/server/src/persistence/Layers/OrchestrationEventStore.test.ts
+5
-1
@@ -17,7 +17,7 @@ const layer = it.layer(
17
);
18
19
layer("OrchestrationEventStore", (it) => {
20
- it.effect("stores json columns as strings and replays decoded events", () =>
20
+ it.effect("stores json columns as strings and replays CLI-origin events", () =>
21
Effect.gen(function* () {
22
const eventStore = yield* OrchestrationEventStore;
23
const sql = yield* SqlClient.SqlClient;
@@ -34,6 +34,9 @@ layer("OrchestrationEventStore", (it) => {
34
correlationId: CommandId.make("cmd-store-roundtrip"),
35
metadata: {
36
adapterKey: "codex",
37
+ origin: {
38
+ surface: "cli",
39
+ },
40
},
41
payload: {
42
projectId: ProjectId.make("project-roundtrip"),
@@ -66,6 +69,7 @@ layer("OrchestrationEventStore", (it) => {
69
assert.equal(replayed.length, 1);
70
assert.equal(replayed[0]?.type, "project.created");
71
assert.equal(replayed[0]?.metadata.adapterKey, "codex");
72
+ assert.deepEqual(replayed[0]?.metadata.origin, { surface: "cli" });
73
}),
74
);
75
packages/contracts/src/baseSchemas.ts
+2
-2
@@ -86,12 +86,12 @@ export const RpcClientId = NonNegativeInt.pipe(Schema.brand("RpcClientId"));
86
export type RpcClientId = typeof RpcClientId.Type;
87
88
/**
89
- * Which client app a connection comes from. Unlike
89
+ * Which client surface a connection or command comes from. Unlike
90
* `AuthClientMetadataDeviceType` (a UA-style device class where web and
91
* desktop are both "desktop"), this names the actual product surface.
92
* Optional everywhere it appears: old clients never send it.
93
*/
94
-export const ClientSurface = Schema.Literals(["web", "desktop", "mobile"]);
94
+export const ClientSurface = Schema.Literals(["web", "desktop", "mobile", "cli"]);
95
export type ClientSurface = typeof ClientSurface.Type;
96
97
export const ClientOs = Schema.Literals([