rivetkit 2.3.11-rc.4 → 2.3.11-rc.6
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/dist/browser/client.js +1 -1
- package/dist/browser/client.js.map +1 -1
- package/dist/browser/inspector/client.d.ts +5 -1
- package/dist/browser/inspector/client.js +4 -2
- package/dist/browser/inspector/client.js.map +1 -1
- package/dist/tsup/actor/errors.cjs.map +1 -1
- package/dist/tsup/agent-os/index.cjs +1 -1
- package/dist/tsup/agent-os/index.cjs.map +1 -1
- package/dist/tsup/agent-os/index.js +1 -1
- package/dist/tsup/agent-os/index.js.map +1 -1
- package/dist/tsup/chunk-4FC7TVS6.cjs.map +1 -1
- package/dist/tsup/{chunk-5KLTIO35.js → chunk-6IZF6OM2.js} +6 -6
- package/dist/tsup/{chunk-3WCNDXDU.cjs → chunk-AKUYP7I4.cjs} +6 -4
- package/dist/tsup/chunk-AKUYP7I4.cjs.map +1 -0
- package/dist/tsup/{chunk-RRVTP46R.cjs → chunk-CUQ73NBJ.cjs} +9 -9
- package/dist/tsup/chunk-CUQ73NBJ.cjs.map +1 -0
- package/dist/tsup/{chunk-3BQTLF6T.cjs → chunk-DXYOITKV.cjs} +139 -139
- package/dist/tsup/chunk-DXYOITKV.cjs.map +1 -0
- package/dist/tsup/{chunk-TP5MGPLS.js → chunk-F34M5L2C.js} +3 -3
- package/dist/tsup/chunk-F34M5L2C.js.map +1 -0
- package/dist/tsup/chunk-HNHLBM3Y.cjs.map +1 -1
- package/dist/tsup/{chunk-S26YGW4T.js → chunk-J6E7BTKN.js} +2 -2
- package/dist/tsup/{chunk-DD4HSOMO.cjs → chunk-MCN5VBXX.cjs} +2 -2
- package/dist/tsup/chunk-MCN5VBXX.cjs.map +1 -0
- package/dist/tsup/chunk-MYWZCDML.cjs.map +1 -1
- package/dist/tsup/{chunk-G66RAENX.cjs → chunk-OASP62X2.cjs} +3 -3
- package/dist/tsup/chunk-OASP62X2.cjs.map +1 -0
- package/dist/tsup/{chunk-I3OXZILZ.js → chunk-PTBC6LFA.js} +5 -3
- package/dist/tsup/{chunk-I3OXZILZ.js.map → chunk-PTBC6LFA.js.map} +1 -1
- package/dist/tsup/chunk-UEULFXUI.cjs.map +1 -1
- package/dist/tsup/{chunk-7N4PSYCJ.js → chunk-Y7JRYLOM.js} +2 -2
- package/dist/tsup/{chunk-7N4PSYCJ.js.map → chunk-Y7JRYLOM.js.map} +1 -1
- package/dist/tsup/{chunk-VAG7L6N3.cjs → chunk-YNK7OLSV.cjs} +7 -7
- package/dist/tsup/chunk-YNK7OLSV.cjs.map +1 -0
- package/dist/tsup/{chunk-ZI6TSSI4.js → chunk-YTOYKXNW.js} +3 -3
- package/dist/tsup/client/mod.cjs +5 -5
- package/dist/tsup/client/mod.cjs.map +1 -1
- package/dist/tsup/client/mod.js +4 -4
- package/dist/tsup/common/log.cjs +2 -2
- package/dist/tsup/common/log.cjs.map +1 -1
- package/dist/tsup/common/log.js +1 -1
- package/dist/tsup/common/websocket.cjs +3 -3
- package/dist/tsup/common/websocket.cjs.map +1 -1
- package/dist/tsup/common/websocket.js +2 -2
- package/dist/tsup/db/drizzle.cjs +2 -2
- package/dist/tsup/db/drizzle.cjs.map +1 -1
- package/dist/tsup/db/drizzle.js +1 -1
- package/dist/tsup/db/mod.cjs +2 -2
- package/dist/tsup/db/mod.cjs.map +1 -1
- package/dist/tsup/db/mod.js +1 -1
- package/dist/tsup/dynamic/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.cjs +4 -4
- package/dist/tsup/inspector/mod.cjs.map +1 -1
- package/dist/tsup/inspector/mod.d.cts +19 -17
- package/dist/tsup/inspector/mod.d.ts +19 -17
- package/dist/tsup/inspector/mod.js +3 -3
- package/dist/tsup/inspector-tab/mod.cjs.map +1 -1
- package/dist/tsup/mod.cjs +67 -67
- package/dist/tsup/mod.cjs.map +1 -1
- package/dist/tsup/mod.js +6 -6
- package/dist/tsup/mod.js.map +1 -1
- package/dist/tsup/test/mod.cjs +6 -6
- package/dist/tsup/test/mod.cjs.map +1 -1
- package/dist/tsup/test/mod.js +4 -4
- package/dist/tsup/unstable/migrations.cjs.map +1 -1
- package/dist/tsup/utils.cjs +2 -2
- package/dist/tsup/utils.cjs.map +1 -1
- package/dist/tsup/utils.js +1 -1
- package/dist/tsup/workflow/mod.cjs +6 -6
- package/dist/tsup/workflow/mod.cjs.map +1 -1
- package/dist/tsup/workflow/mod.js +3 -3
- package/package.json +14 -9
- package/src/common/inspector-transport.ts +12 -2
- package/src/registry/native.ts +20 -8
- package/src/workflow/inspector.ts +9 -13
- package/dist/tsup/chunk-3BQTLF6T.cjs.map +0 -1
- package/dist/tsup/chunk-3WCNDXDU.cjs.map +0 -1
- package/dist/tsup/chunk-DD4HSOMO.cjs.map +0 -1
- package/dist/tsup/chunk-G66RAENX.cjs.map +0 -1
- package/dist/tsup/chunk-RRVTP46R.cjs.map +0 -1
- package/dist/tsup/chunk-TP5MGPLS.js.map +0 -1
- package/dist/tsup/chunk-VAG7L6N3.cjs.map +0 -1
- /package/dist/tsup/{chunk-5KLTIO35.js.map → chunk-6IZF6OM2.js.map} +0 -0
- /package/dist/tsup/{chunk-S26YGW4T.js.map → chunk-J6E7BTKN.js.map} +0 -0
- /package/dist/tsup/{chunk-ZI6TSSI4.js.map → chunk-YTOYKXNW.js.map} +0 -0
|
@@ -5,9 +5,9 @@ type uint = bigint;
|
|
|
5
5
|
type State = ArrayBuffer;
|
|
6
6
|
declare function readState(bc: bare.ByteCursor): State;
|
|
7
7
|
declare function writeState(bc: bare.ByteCursor, x: State): void;
|
|
8
|
-
type WorkflowHistory$
|
|
9
|
-
declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory$
|
|
10
|
-
declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory$
|
|
8
|
+
type WorkflowHistory$1 = ArrayBuffer;
|
|
9
|
+
declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory$1;
|
|
10
|
+
declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory$1): void;
|
|
11
11
|
type PatchStateRequest = {
|
|
12
12
|
readonly state: ArrayBuffer;
|
|
13
13
|
};
|
|
@@ -141,7 +141,7 @@ type Init = {
|
|
|
141
141
|
readonly rpcs: readonly string[];
|
|
142
142
|
readonly isDatabaseEnabled: boolean;
|
|
143
143
|
readonly queueSize: uint;
|
|
144
|
-
readonly workflowHistory: WorkflowHistory$
|
|
144
|
+
readonly workflowHistory: WorkflowHistory$1 | null;
|
|
145
145
|
readonly isWorkflowEnabled: boolean;
|
|
146
146
|
readonly tabConfig: readonly TabConfigEntry[];
|
|
147
147
|
};
|
|
@@ -195,14 +195,14 @@ declare function readQueueResponse(bc: bare.ByteCursor): QueueResponse;
|
|
|
195
195
|
declare function writeQueueResponse(bc: bare.ByteCursor, x: QueueResponse): void;
|
|
196
196
|
type WorkflowHistoryResponse = {
|
|
197
197
|
readonly rid: uint;
|
|
198
|
-
readonly history: WorkflowHistory$
|
|
198
|
+
readonly history: WorkflowHistory$1 | null;
|
|
199
199
|
readonly isWorkflowEnabled: boolean;
|
|
200
200
|
};
|
|
201
201
|
declare function readWorkflowHistoryResponse(bc: bare.ByteCursor): WorkflowHistoryResponse;
|
|
202
202
|
declare function writeWorkflowHistoryResponse(bc: bare.ByteCursor, x: WorkflowHistoryResponse): void;
|
|
203
203
|
type WorkflowReplayResponse = {
|
|
204
204
|
readonly rid: uint;
|
|
205
|
-
readonly history: WorkflowHistory$
|
|
205
|
+
readonly history: WorkflowHistory$1 | null;
|
|
206
206
|
readonly isWorkflowEnabled: boolean;
|
|
207
207
|
};
|
|
208
208
|
declare function readWorkflowReplayResponse(bc: bare.ByteCursor): WorkflowReplayResponse;
|
|
@@ -230,7 +230,7 @@ type QueueUpdated = {
|
|
|
230
230
|
declare function readQueueUpdated(bc: bare.ByteCursor): QueueUpdated;
|
|
231
231
|
declare function writeQueueUpdated(bc: bare.ByteCursor, x: QueueUpdated): void;
|
|
232
232
|
type WorkflowHistoryUpdated = {
|
|
233
|
-
readonly history: WorkflowHistory$
|
|
233
|
+
readonly history: WorkflowHistory$1;
|
|
234
234
|
};
|
|
235
235
|
declare function readWorkflowHistoryUpdated(bc: bare.ByteCursor): WorkflowHistoryUpdated;
|
|
236
236
|
declare function writeWorkflowHistoryUpdated(bc: bare.ByteCursor, x: WorkflowHistoryUpdated): void;
|
|
@@ -427,28 +427,30 @@ type WorkflowEntryMetadata = {
|
|
|
427
427
|
readonly rollbackCompletedAt: u64 | null;
|
|
428
428
|
readonly rollbackError: string | null;
|
|
429
429
|
};
|
|
430
|
-
type WorkflowHistory
|
|
430
|
+
type WorkflowHistory = {
|
|
431
431
|
readonly nameRegistry: readonly string[];
|
|
432
432
|
readonly entries: readonly WorkflowEntry[];
|
|
433
433
|
readonly entryMetadata: ReadonlyMap<string, WorkflowEntryMetadata>;
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
-
declare
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
436
|
+
declare const workflowHistoryBare: unique symbol;
|
|
437
|
+
type WorkflowHistoryBytes = ArrayBuffer & {
|
|
438
|
+
readonly [workflowHistoryBare]: true;
|
|
439
|
+
};
|
|
440
|
+
declare function encodeWorkflowHistoryTransport(history: WorkflowHistory): WorkflowHistoryBytes;
|
|
441
|
+
declare function decodeWorkflowHistoryTransport(data: ArrayBuffer | ArrayBufferView): WorkflowHistory;
|
|
440
442
|
|
|
441
443
|
interface WorkflowInspectorAdapter {
|
|
442
|
-
getHistory: () =>
|
|
444
|
+
getHistory: () => WorkflowHistoryBytes | null;
|
|
443
445
|
getState: () => Promise<WorkflowState | null>;
|
|
444
|
-
onHistoryUpdated: (listener: (history:
|
|
445
|
-
replayFromStep: (entryId?: string) => Promise<
|
|
446
|
+
onHistoryUpdated: (listener: (history: WorkflowHistoryBytes) => void) => () => void;
|
|
447
|
+
replayFromStep: (entryId?: string) => Promise<WorkflowHistoryBytes | null>;
|
|
446
448
|
}
|
|
447
449
|
declare function createWorkflowInspectorAdapter(): {
|
|
448
450
|
adapter: WorkflowInspectorAdapter;
|
|
449
451
|
update: (snapshot: WorkflowHistorySnapshot) => void;
|
|
450
452
|
setGetState: (fn: () => Promise<WorkflowState | null>) => void;
|
|
451
|
-
setReplayFromStep: (fn: (entryId?: string) => Promise<
|
|
453
|
+
setReplayFromStep: (fn: (entryId?: string) => Promise<WorkflowHistoryBytes | null>) => void;
|
|
452
454
|
};
|
|
453
455
|
|
|
454
|
-
export { type ActionRequest, type ActionResponse, type Connection, type ConnectionsRequest, type ConnectionsResponse, type ConnectionsUpdated, type DatabaseSchemaRequest, type DatabaseSchemaResponse, type DatabaseTableRowsRequest, type DatabaseTableRowsResponse, type Error, type Init, type PatchStateRequest, type QueueMessageSummary, type QueueRequest, type QueueResponse, type QueueStatus, type QueueUpdated, type RpcsListRequest, type RpcsListResponse, type State, type StateRequest, type StateResponse, type StateUpdated, type TabConfigEntry, type ToClient, type ToClientBody, type ToServer, type ToServerBody, type TraceQueryRequest, type TraceQueryResponse, type WorkflowHistory
|
|
456
|
+
export { type ActionRequest, type ActionResponse, type Connection, type ConnectionsRequest, type ConnectionsResponse, type ConnectionsUpdated, type DatabaseSchemaRequest, type DatabaseSchemaResponse, type DatabaseTableRowsRequest, type DatabaseTableRowsResponse, type Error, type Init, type PatchStateRequest, type QueueMessageSummary, type QueueRequest, type QueueResponse, type QueueStatus, type QueueUpdated, type RpcsListRequest, type RpcsListResponse, type State, type StateRequest, type StateResponse, type StateUpdated, type TabConfigEntry, type ToClient, type ToClientBody, type ToServer, type ToServerBody, type TraceQueryRequest, type TraceQueryResponse, type WorkflowHistory as TransportWorkflowHistory, type WorkflowHistory$1 as WorkflowHistory, type WorkflowHistoryRequest, type WorkflowHistoryResponse, type WorkflowHistoryUpdated, type WorkflowInspectorAdapter, type WorkflowReplayRequest, type WorkflowReplayResponse, createWorkflowInspectorAdapter, decodeToClient, decodeToServer, decodeWorkflowHistoryTransport, encodeToClient, encodeToServer, encodeWorkflowHistoryTransport, readActionRequest, readActionResponse, readConnection, readConnectionsRequest, readConnectionsResponse, readConnectionsUpdated, readDatabaseSchemaRequest, readDatabaseSchemaResponse, readDatabaseTableRowsRequest, readDatabaseTableRowsResponse, readError, readInit, readPatchStateRequest, readQueueMessageSummary, readQueueRequest, readQueueResponse, readQueueStatus, readQueueUpdated, readRpcsListRequest, readRpcsListResponse, readState, readStateRequest, readStateResponse, readStateUpdated, readTabConfigEntry, readToClient, readToClientBody, readToServer, readToServerBody, readTraceQueryRequest, readTraceQueryResponse, readWorkflowHistory, readWorkflowHistoryRequest, readWorkflowHistoryResponse, readWorkflowHistoryUpdated, readWorkflowReplayRequest, readWorkflowReplayResponse, type uint, writeActionRequest, writeActionResponse, writeConnection, writeConnectionsRequest, writeConnectionsResponse, writeConnectionsUpdated, writeDatabaseSchemaRequest, writeDatabaseSchemaResponse, writeDatabaseTableRowsRequest, writeDatabaseTableRowsResponse, writeError, writeInit, writePatchStateRequest, writeQueueMessageSummary, writeQueueRequest, writeQueueResponse, writeQueueStatus, writeQueueUpdated, writeRpcsListRequest, writeRpcsListResponse, writeState, writeStateRequest, writeStateResponse, writeStateUpdated, writeTabConfigEntry, writeToClient, writeToClientBody, writeToServer, writeToServerBody, writeTraceQueryRequest, writeTraceQueryResponse, writeWorkflowHistory, writeWorkflowHistoryRequest, writeWorkflowHistoryResponse, writeWorkflowHistoryUpdated, writeWorkflowReplayRequest, writeWorkflowReplayResponse };
|
|
@@ -5,9 +5,9 @@ type uint = bigint;
|
|
|
5
5
|
type State = ArrayBuffer;
|
|
6
6
|
declare function readState(bc: bare.ByteCursor): State;
|
|
7
7
|
declare function writeState(bc: bare.ByteCursor, x: State): void;
|
|
8
|
-
type WorkflowHistory$
|
|
9
|
-
declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory$
|
|
10
|
-
declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory$
|
|
8
|
+
type WorkflowHistory$1 = ArrayBuffer;
|
|
9
|
+
declare function readWorkflowHistory(bc: bare.ByteCursor): WorkflowHistory$1;
|
|
10
|
+
declare function writeWorkflowHistory(bc: bare.ByteCursor, x: WorkflowHistory$1): void;
|
|
11
11
|
type PatchStateRequest = {
|
|
12
12
|
readonly state: ArrayBuffer;
|
|
13
13
|
};
|
|
@@ -141,7 +141,7 @@ type Init = {
|
|
|
141
141
|
readonly rpcs: readonly string[];
|
|
142
142
|
readonly isDatabaseEnabled: boolean;
|
|
143
143
|
readonly queueSize: uint;
|
|
144
|
-
readonly workflowHistory: WorkflowHistory$
|
|
144
|
+
readonly workflowHistory: WorkflowHistory$1 | null;
|
|
145
145
|
readonly isWorkflowEnabled: boolean;
|
|
146
146
|
readonly tabConfig: readonly TabConfigEntry[];
|
|
147
147
|
};
|
|
@@ -195,14 +195,14 @@ declare function readQueueResponse(bc: bare.ByteCursor): QueueResponse;
|
|
|
195
195
|
declare function writeQueueResponse(bc: bare.ByteCursor, x: QueueResponse): void;
|
|
196
196
|
type WorkflowHistoryResponse = {
|
|
197
197
|
readonly rid: uint;
|
|
198
|
-
readonly history: WorkflowHistory$
|
|
198
|
+
readonly history: WorkflowHistory$1 | null;
|
|
199
199
|
readonly isWorkflowEnabled: boolean;
|
|
200
200
|
};
|
|
201
201
|
declare function readWorkflowHistoryResponse(bc: bare.ByteCursor): WorkflowHistoryResponse;
|
|
202
202
|
declare function writeWorkflowHistoryResponse(bc: bare.ByteCursor, x: WorkflowHistoryResponse): void;
|
|
203
203
|
type WorkflowReplayResponse = {
|
|
204
204
|
readonly rid: uint;
|
|
205
|
-
readonly history: WorkflowHistory$
|
|
205
|
+
readonly history: WorkflowHistory$1 | null;
|
|
206
206
|
readonly isWorkflowEnabled: boolean;
|
|
207
207
|
};
|
|
208
208
|
declare function readWorkflowReplayResponse(bc: bare.ByteCursor): WorkflowReplayResponse;
|
|
@@ -230,7 +230,7 @@ type QueueUpdated = {
|
|
|
230
230
|
declare function readQueueUpdated(bc: bare.ByteCursor): QueueUpdated;
|
|
231
231
|
declare function writeQueueUpdated(bc: bare.ByteCursor, x: QueueUpdated): void;
|
|
232
232
|
type WorkflowHistoryUpdated = {
|
|
233
|
-
readonly history: WorkflowHistory$
|
|
233
|
+
readonly history: WorkflowHistory$1;
|
|
234
234
|
};
|
|
235
235
|
declare function readWorkflowHistoryUpdated(bc: bare.ByteCursor): WorkflowHistoryUpdated;
|
|
236
236
|
declare function writeWorkflowHistoryUpdated(bc: bare.ByteCursor, x: WorkflowHistoryUpdated): void;
|
|
@@ -427,28 +427,30 @@ type WorkflowEntryMetadata = {
|
|
|
427
427
|
readonly rollbackCompletedAt: u64 | null;
|
|
428
428
|
readonly rollbackError: string | null;
|
|
429
429
|
};
|
|
430
|
-
type WorkflowHistory
|
|
430
|
+
type WorkflowHistory = {
|
|
431
431
|
readonly nameRegistry: readonly string[];
|
|
432
432
|
readonly entries: readonly WorkflowEntry[];
|
|
433
433
|
readonly entryMetadata: ReadonlyMap<string, WorkflowEntryMetadata>;
|
|
434
434
|
};
|
|
435
435
|
|
|
436
|
-
declare
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
436
|
+
declare const workflowHistoryBare: unique symbol;
|
|
437
|
+
type WorkflowHistoryBytes = ArrayBuffer & {
|
|
438
|
+
readonly [workflowHistoryBare]: true;
|
|
439
|
+
};
|
|
440
|
+
declare function encodeWorkflowHistoryTransport(history: WorkflowHistory): WorkflowHistoryBytes;
|
|
441
|
+
declare function decodeWorkflowHistoryTransport(data: ArrayBuffer | ArrayBufferView): WorkflowHistory;
|
|
440
442
|
|
|
441
443
|
interface WorkflowInspectorAdapter {
|
|
442
|
-
getHistory: () =>
|
|
444
|
+
getHistory: () => WorkflowHistoryBytes | null;
|
|
443
445
|
getState: () => Promise<WorkflowState | null>;
|
|
444
|
-
onHistoryUpdated: (listener: (history:
|
|
445
|
-
replayFromStep: (entryId?: string) => Promise<
|
|
446
|
+
onHistoryUpdated: (listener: (history: WorkflowHistoryBytes) => void) => () => void;
|
|
447
|
+
replayFromStep: (entryId?: string) => Promise<WorkflowHistoryBytes | null>;
|
|
446
448
|
}
|
|
447
449
|
declare function createWorkflowInspectorAdapter(): {
|
|
448
450
|
adapter: WorkflowInspectorAdapter;
|
|
449
451
|
update: (snapshot: WorkflowHistorySnapshot) => void;
|
|
450
452
|
setGetState: (fn: () => Promise<WorkflowState | null>) => void;
|
|
451
|
-
setReplayFromStep: (fn: (entryId?: string) => Promise<
|
|
453
|
+
setReplayFromStep: (fn: (entryId?: string) => Promise<WorkflowHistoryBytes | null>) => void;
|
|
452
454
|
};
|
|
453
455
|
|
|
454
|
-
export { type ActionRequest, type ActionResponse, type Connection, type ConnectionsRequest, type ConnectionsResponse, type ConnectionsUpdated, type DatabaseSchemaRequest, type DatabaseSchemaResponse, type DatabaseTableRowsRequest, type DatabaseTableRowsResponse, type Error, type Init, type PatchStateRequest, type QueueMessageSummary, type QueueRequest, type QueueResponse, type QueueStatus, type QueueUpdated, type RpcsListRequest, type RpcsListResponse, type State, type StateRequest, type StateResponse, type StateUpdated, type TabConfigEntry, type ToClient, type ToClientBody, type ToServer, type ToServerBody, type TraceQueryRequest, type TraceQueryResponse, type WorkflowHistory
|
|
456
|
+
export { type ActionRequest, type ActionResponse, type Connection, type ConnectionsRequest, type ConnectionsResponse, type ConnectionsUpdated, type DatabaseSchemaRequest, type DatabaseSchemaResponse, type DatabaseTableRowsRequest, type DatabaseTableRowsResponse, type Error, type Init, type PatchStateRequest, type QueueMessageSummary, type QueueRequest, type QueueResponse, type QueueStatus, type QueueUpdated, type RpcsListRequest, type RpcsListResponse, type State, type StateRequest, type StateResponse, type StateUpdated, type TabConfigEntry, type ToClient, type ToClientBody, type ToServer, type ToServerBody, type TraceQueryRequest, type TraceQueryResponse, type WorkflowHistory as TransportWorkflowHistory, type WorkflowHistory$1 as WorkflowHistory, type WorkflowHistoryRequest, type WorkflowHistoryResponse, type WorkflowHistoryUpdated, type WorkflowInspectorAdapter, type WorkflowReplayRequest, type WorkflowReplayResponse, createWorkflowInspectorAdapter, decodeToClient, decodeToServer, decodeWorkflowHistoryTransport, encodeToClient, encodeToServer, encodeWorkflowHistoryTransport, readActionRequest, readActionResponse, readConnection, readConnectionsRequest, readConnectionsResponse, readConnectionsUpdated, readDatabaseSchemaRequest, readDatabaseSchemaResponse, readDatabaseTableRowsRequest, readDatabaseTableRowsResponse, readError, readInit, readPatchStateRequest, readQueueMessageSummary, readQueueRequest, readQueueResponse, readQueueStatus, readQueueUpdated, readRpcsListRequest, readRpcsListResponse, readState, readStateRequest, readStateResponse, readStateUpdated, readTabConfigEntry, readToClient, readToClientBody, readToServer, readToServerBody, readTraceQueryRequest, readTraceQueryResponse, readWorkflowHistory, readWorkflowHistoryRequest, readWorkflowHistoryResponse, readWorkflowHistoryUpdated, readWorkflowReplayRequest, readWorkflowReplayResponse, type uint, writeActionRequest, writeActionResponse, writeConnection, writeConnectionsRequest, writeConnectionsResponse, writeConnectionsUpdated, writeDatabaseSchemaRequest, writeDatabaseSchemaResponse, writeDatabaseTableRowsRequest, writeDatabaseTableRowsResponse, writeError, writeInit, writePatchStateRequest, writeQueueMessageSummary, writeQueueRequest, writeQueueResponse, writeQueueStatus, writeQueueUpdated, writeRpcsListRequest, writeRpcsListResponse, writeState, writeStateRequest, writeStateResponse, writeStateUpdated, writeTabConfigEntry, writeToClient, writeToClientBody, writeToServer, writeToServerBody, writeTraceQueryRequest, writeTraceQueryResponse, writeWorkflowHistory, writeWorkflowHistoryRequest, writeWorkflowHistoryResponse, writeWorkflowHistoryUpdated, writeWorkflowReplayRequest, writeWorkflowReplayResponse };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createWorkflowInspectorAdapter
|
|
3
|
-
} from "../chunk-
|
|
3
|
+
} from "../chunk-F34M5L2C.js";
|
|
4
4
|
import {
|
|
5
5
|
decodeWorkflowHistoryTransport,
|
|
6
6
|
encodeWorkflowHistoryTransport
|
|
7
|
-
} from "../chunk-
|
|
8
|
-
import "../chunk-
|
|
7
|
+
} from "../chunk-PTBC6LFA.js";
|
|
8
|
+
import "../chunk-Y7JRYLOM.js";
|
|
9
9
|
import "../chunk-ZZ3WBRPD.js";
|
|
10
10
|
|
|
11
11
|
// src/common/bare/generated/inspector/v5.ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/inspector-tab/mod.cjs","../../../src/inspector-tab/mod.ts"],"names":[],"mappings":"AAAA;AACE;AACA;AACA;AACA;AACA;AACA;AACF,yDAA8B;AAC9B;AACA;ACuBA,0BAAkB;AAoDX,IAAM,6BAAA,EAA+B,MAAA,CAAE,MAAA,CAAO;AAAA,EACpD,EAAA,EAAI,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EACb,KAAA,EAAO,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EAChB,IAAA,EAAM,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQf,QAAA,EAAU,MAAA,CAAE,OAAA,CAAQ,CAAA,CAAE,QAAA,CAAS;AAChC,CAAC,CAAA;AAOM,IAAM,aAAA,EAAe,MAAA,CAAE,MAAA,CAAO;AAAA,EACpC,IAAA,EAAM,MAAA,CAAE,OAAA,CAAQ,MAAM,CAAA;AAAA,EACtB,CAAA,EAAG,MAAA,CAAE,OAAA,CAAQ,CAAC,CAAA;AAAA;AAAA,EAEd,OAAA,EAAS,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKlB,SAAA,EAAW,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKpB,UAAA,EAAY,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAKhC,SAAA,EAAW,MAAA,CAAE,MAAA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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,knDAAC","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/rivetkit/dist/tsup/inspector-tab/mod.cjs","sourcesContent":[null,"/**\n * Type and schema declarations for custom Rivet inspector tabs.\n *\n * Everything here is **derived from runtime Zod schemas** that the\n * dashboard and rivetkit itself use, so the published types cannot\n * drift from the wire format. There are three sources of truth:\n *\n * 1. The `inspector.tabs[]` actor-config Zod schemas in\n * `../actor/config.ts` — re-exported below. These validate the\n * authoring surface (`defineActor({ inspector: { tabs: [...] } })`).\n * 2. The dashboard ↔ tab postMessage envelopes defined in this file.\n * The inspector-ui SPA (`frontend/apps/inspector-ui/src/bridge.ts`)\n * imports the same schemas to validate messages at runtime, so any\n * change here lands on both ends in lockstep.\n * 3. The inspector HTTP endpoint response schemas defined in this\n * file. The dashboard parses every response through them; if the\n * Rust handler ever emits a different shape, the dashboard fails\n * loudly at the parse step instead of silently casting `unknown`.\n *\n * Tab bundles import these types for autocomplete and compile-time\n * safety:\n *\n * ```ts\n * import type {\n * ShellToTabMessage,\n * TabToShellMessage,\n * V1Init,\n * InspectorStateResponse,\n * } from \"rivetkit/inspector-tab\";\n * ```\n */\n\nimport { z } from \"zod\";\n\n// ============================================================================\n// Re-exported from `../actor/config.ts` — the authoring schema for\n// `defineActor({ inspector: { tabs: [...] } })`.\n// ============================================================================\n\nexport type { ActorInspectorConfig } from \"../actor/config\";\nexport {\n\tActorInspectorConfigSchema,\n\tBUILTIN_INSPECTOR_TAB_IDS,\n\tBuiltinInspectorTabIdSchema,\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\n\nimport type {\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\n\n/** One entry in the actor's `inspector.tabs[]` declaration. */\nexport type ActorInspectorTabEntry = z.input<typeof InspectorTabEntrySchema>;\n/** A custom-tab entry — adds a new tab to the dashboard strip. */\nexport type ActorCustomInspectorTabEntry = z.input<\n\ttypeof CustomInspectorTabEntrySchema\n>;\n/** A hide modifier — removes a built-in tab from the strip. */\nexport type ActorHideInspectorTabEntry = z.input<\n\ttypeof HideInspectorTabEntrySchema\n>;\n/** Union of the six built-in inspector tab ids. */\nexport type BuiltinInspectorTabId =\n\t| \"workflow\"\n\t| \"database\"\n\t| \"state\"\n\t| \"queue\"\n\t| \"schedules\"\n\t| \"connections\"\n\t| \"console\";\n\n// ============================================================================\n// Dashboard ↔ tab postMessage envelope (source of truth).\n//\n// These Zod schemas are imported by `frontend/apps/inspector-ui/src/bridge.ts`\n// and used to validate inbound messages at runtime. Changes here flow to\n// both sides in a single commit.\n// ============================================================================\n\n/** Public tab descriptor that crosses the dashboard ↔ inspector-ui bridge. */\nexport const InspectorTabDescriptorSchema = z.object({\n\tid: z.string(),\n\tlabel: z.string(),\n\ticon: z.string(),\n\t/**\n\t * `true` for author-shipped custom tabs; absent or `false` for\n\t * built-in tabs the SPA renders. Lets the dashboard route the\n\t * iframe `src` to `/inspector/custom-tabs/<id>/` for custom tabs and\n\t * `/inspector/ui/` for built-ins without the dashboard needing to\n\t * know which ids are built-in.\n\t */\n\tisCustom: z.boolean().optional(),\n});\n\n/**\n * Initial handshake from the dashboard. Sent on first mount and again on\n * every token refresh. Tabs MUST accept late `init` messages and replace\n * the cached token.\n */\nexport const V1InitSchema = z.object({\n\ttype: z.literal(\"init\"),\n\tv: z.literal(1),\n\t/** The actor this tab is mounted for. */\n\tactorId: z.string(),\n\t/**\n\t * Per-actor inspector bearer token. Tabs include it as\n\t * `Authorization: Bearer ${authToken}` on every authenticated fetch.\n\t */\n\tauthToken: z.string(),\n\t/**\n\t * Outer Rivet API token. Optional; not required for inspector HTTP\n\t * routes but available to tabs that want to call the engine REST API.\n\t */\n\trivetToken: z.string().optional(),\n\t/**\n\t * The tab id the dashboard wants active at mount time. Multi-view\n\t * tabs may read this to seed their initial route; most tabs ignore it.\n\t */\n\tactiveTab: z.string().optional(),\n\t/**\n\t * Dashboard's currently active theme. Tabs that use the shared\n\t * stylesheet (`/inspector/tab.css`) mirror it by toggling the `dark`\n\t * class on `<html>`. Optional for backwards compatibility — tabs\n\t * should default to `\"dark\"` if absent (the dashboard pinned dark\n\t * mode before this field was added).\n\t */\n\ttheme: z.enum([\"light\", \"dark\"]).optional(),\n});\n\n/**\n * Dashboard tells the inspector-ui SPA which built-in tab to render. Not\n * sent to custom tabs — when the user activates a custom tab the\n * dashboard navigates the outer iframe to a different `src`.\n */\nexport const V1SetActiveTabSchema = z.object({\n\ttype: z.literal(\"set-active-tab\"),\n\tv: z.literal(1),\n\ttab: z.string(),\n});\n\n/**\n * Tab → dashboard. Sent once after the message listener is registered.\n * The dashboard hides the \"Connecting to inspector…\" overlay on receipt;\n * if it never arrives the overlay times out after 8 s.\n */\nexport const V1ReadySchema = z.object({\n\ttype: z.literal(\"ready\"),\n\tv: z.literal(1),\n});\n\n/**\n * Tab → dashboard. Sent when the tab gets a 401 on an inspector data\n * call. The dashboard refreshes the token and re-issues `v1Init`.\n */\nexport const V1TokenRefreshNeededSchema = z.object({\n\ttype: z.literal(\"token-refresh-needed\"),\n\tv: z.literal(1),\n});\n\n/**\n * Emitted by the inspector-ui SPA to tell the dashboard which tabs to\n * render in the strip. Custom tab bundles do NOT emit this — only the\n * SPA does.\n */\nexport const V1TabsAvailableSchema = z.object({\n\ttype: z.literal(\"tabs-available\"),\n\tv: z.literal(1),\n\ttabs: z.array(InspectorTabDescriptorSchema),\n});\n\n/** Discriminated union of messages a tab can RECEIVE from the dashboard. */\nexport const ShellToTabMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1InitSchema,\n\tV1SetActiveTabSchema,\n]);\n\n/** Discriminated union of messages a tab can SEND to the dashboard. */\nexport const TabToShellMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1ReadySchema,\n\tV1TabsAvailableSchema,\n\tV1TokenRefreshNeededSchema,\n]);\n\nexport type InspectorTabDescriptor = z.infer<\n\ttypeof InspectorTabDescriptorSchema\n>;\nexport type V1Init = z.infer<typeof V1InitSchema>;\nexport type V1SetActiveTab = z.infer<typeof V1SetActiveTabSchema>;\nexport type V1Ready = z.infer<typeof V1ReadySchema>;\nexport type V1TokenRefreshNeeded = z.infer<typeof V1TokenRefreshNeededSchema>;\nexport type V1TabsAvailable = z.infer<typeof V1TabsAvailableSchema>;\nexport type ShellToTabMessage = z.infer<typeof ShellToTabMessageSchema>;\nexport type TabToShellMessage = z.infer<typeof TabToShellMessageSchema>;\n\n/** Stable envelope protocol version. Bump only when introducing a v2 shape. */\nexport const POSTMESSAGE_PROTOCOL_VERSION = 1;\n\n/** URL query parameters the dashboard sets on the tab iframe `src`. */\nexport const SHELL_ORIGIN_PARAM = \"shellOrigin\";\nexport const ACTOR_ID_PARAM = \"actorId\";\n\n// ============================================================================\n// Inspector HTTP endpoint response schemas (source of truth).\n//\n// The dashboard parses every authenticated inspector response through\n// these schemas (`frontend/src/components/actors/actor-inspector-context.tsx`).\n// If the Rust handler emits a different shape the parse fails and the\n// dashboard surfaces an error — drift is loud.\n// ============================================================================\n\n/** `GET /inspector/state` response shape. */\nexport const InspectorStateResponseSchema = z.object({\n\t/** Current actor state (whatever shape the actor declared). */\n\tstate: z.unknown(),\n\t/**\n\t * `false` when the actor did not declare any state — `state` is then\n\t * `null` and `PATCH /inspector/state` returns an error.\n\t */\n\tisStateEnabled: z.boolean(),\n});\n\n/** `POST /inspector/action/<name>` request body. */\nexport const InspectorActionRequestSchema = z\n\t.object({\n\t\t/** Positional arguments. Mutually exclusive with `properties`. */\n\t\targs: z.array(z.unknown()).optional(),\n\t\t/** Keyed arguments. Mutually exclusive with `args`. */\n\t\tproperties: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.refine(\n\t\t(body) => !(body.args !== undefined && body.properties !== undefined),\n\t\t\"Use either `args` or `properties`, not both\",\n\t);\n\n/** `POST /inspector/action/<name>` response shape. */\nexport const InspectorActionResponseSchema = z.object({\n\toutput: z.unknown(),\n});\n\n/** `GET /inspector/rpcs` response shape — the list of action names. */\nexport const InspectorRpcsResponseSchema = z.object({\n\trpcs: z.array(z.string()),\n});\n\n/** One connection record in `GET /inspector/connections`. */\nexport const InspectorConnectionSchema = z.object({\n\tconnectionType: z.string().nullable(),\n\tid: z.string(),\n\tdetails: z.object({\n\t\tconnectionType: z.string().nullable(),\n\t\tparams: z.unknown(),\n\t\tstateEnabled: z.boolean(),\n\t\tstate: z.unknown(),\n\t\tsubscriptions: z.number(),\n\t\tisHibernatable: z.boolean(),\n\t}),\n});\n\n/** `GET /inspector/connections` response shape. */\nexport const InspectorConnectionsResponseSchema = z.object({\n\tconnections: z.array(InspectorConnectionSchema),\n});\n\n/** One queued message in `GET /inspector/queue`. */\nexport const InspectorQueueMessageSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtMs: z.number(),\n});\n\n/** `GET /inspector/queue` response shape. */\nexport const InspectorQueueResponseSchema = z.object({\n\tsize: z.number(),\n\tmaxSize: z.number(),\n\t/** `true` if `?limit=N` truncated the message list below `size`. */\n\ttruncated: z.boolean(),\n\tmessages: z.array(InspectorQueueMessageSchema),\n});\n\nexport type InspectorStateResponse = z.infer<\n\ttypeof InspectorStateResponseSchema\n>;\nexport type InspectorActionRequest = z.infer<\n\ttypeof InspectorActionRequestSchema\n>;\nexport type InspectorActionResponse = z.infer<\n\ttypeof InspectorActionResponseSchema\n>;\nexport type InspectorRpcsResponse = z.infer<typeof InspectorRpcsResponseSchema>;\nexport type InspectorConnection = z.infer<typeof InspectorConnectionSchema>;\nexport type InspectorConnectionsResponse = z.infer<\n\ttypeof InspectorConnectionsResponseSchema\n>;\nexport type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;\nexport type InspectorQueueResponse = z.infer<\n\ttypeof InspectorQueueResponseSchema\n>;\n"]}
|
|
1
|
+
{"version":3,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A;AAAA,IACpC,MAAA,EAAQ,MAAA,CAAE,OAAA,CAAQ,CAAA;AAAA,IAClB,YAAA,EAAc,MAAA,CAAE,OAAA,CAAQ,CAAA;AAAA,IACxB,KAAA,EAAO,MAAA,CAAE,OAAA,CAAQ,CAAA;AAAA,IACjB,aAAA,EAAe,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,IACxB,cAAA,EAAgB,MAAA,CAAE,OAAA,CAAQ;AAAA,EAC3B,CAAC;AACF,CAAC,CAAA;AAGM,IAAM,mCAAA,EAAqC,MAAA,CAAE,MAAA,CAAO;AAAA,EAC1D,WAAA,EAAa,MAAA,CAAE,KAAA,CAAM,yBAAyB;AAC/C,CAAC,CAAA;AAGM,IAAM,4BAAA,EAA8B,MAAA,CAAE,MAAA,CAAO;AAAA,EACnD,EAAA,EAAI,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EACb,IAAA,EAAM,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EACf,WAAA,EAAa,MAAA,CAAE,MAAA,CAAO;AACvB,CAAC,CAAA;AAGM,IAAM,6BAAA,EAA+B,MAAA,CAAE,MAAA,CAAO;AAAA,EACpD,IAAA,EAAM,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,EACf,OAAA,EAAS,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA;AAAA,EAElB,SAAA,EAAW,MAAA,CAAE,OAAA,CAAQ,CAAA;AAAA,EACrB,QAAA,EAAU,MAAA,CAAE,KAAA,CAAM,2BAA2B;AAC9C,CAAC,CAAA;ADnJD;AACE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACF,knDAAC","file":"/home/runner/work/actors/actors/rivetkit-typescript/packages/rivetkit/dist/tsup/inspector-tab/mod.cjs","sourcesContent":[null,"/**\n * Type and schema declarations for custom Rivet inspector tabs.\n *\n * Everything here is **derived from runtime Zod schemas** that the\n * dashboard and rivetkit itself use, so the published types cannot\n * drift from the wire format. There are three sources of truth:\n *\n * 1. The `inspector.tabs[]` actor-config Zod schemas in\n * `../actor/config.ts` — re-exported below. These validate the\n * authoring surface (`defineActor({ inspector: { tabs: [...] } })`).\n * 2. The dashboard ↔ tab postMessage envelopes defined in this file.\n * The inspector-ui SPA (`frontend/apps/inspector-ui/src/bridge.ts`)\n * imports the same schemas to validate messages at runtime, so any\n * change here lands on both ends in lockstep.\n * 3. The inspector HTTP endpoint response schemas defined in this\n * file. The dashboard parses every response through them; if the\n * Rust handler ever emits a different shape, the dashboard fails\n * loudly at the parse step instead of silently casting `unknown`.\n *\n * Tab bundles import these types for autocomplete and compile-time\n * safety:\n *\n * ```ts\n * import type {\n * ShellToTabMessage,\n * TabToShellMessage,\n * V1Init,\n * InspectorStateResponse,\n * } from \"rivetkit/inspector-tab\";\n * ```\n */\n\nimport { z } from \"zod\";\n\n// ============================================================================\n// Re-exported from `../actor/config.ts` — the authoring schema for\n// `defineActor({ inspector: { tabs: [...] } })`.\n// ============================================================================\n\nexport type { ActorInspectorConfig } from \"../actor/config\";\nexport {\n\tActorInspectorConfigSchema,\n\tBUILTIN_INSPECTOR_TAB_IDS,\n\tBuiltinInspectorTabIdSchema,\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\n\nimport type {\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\n\n/** One entry in the actor's `inspector.tabs[]` declaration. */\nexport type ActorInspectorTabEntry = z.input<typeof InspectorTabEntrySchema>;\n/** A custom-tab entry — adds a new tab to the dashboard strip. */\nexport type ActorCustomInspectorTabEntry = z.input<\n\ttypeof CustomInspectorTabEntrySchema\n>;\n/** A hide modifier — removes a built-in tab from the strip. */\nexport type ActorHideInspectorTabEntry = z.input<\n\ttypeof HideInspectorTabEntrySchema\n>;\n/** Union of the six built-in inspector tab ids. */\nexport type BuiltinInspectorTabId =\n\t| \"workflow\"\n\t| \"database\"\n\t| \"state\"\n\t| \"queue\"\n\t| \"schedules\"\n\t| \"connections\"\n\t| \"console\";\n\n// ============================================================================\n// Dashboard ↔ tab postMessage envelope (source of truth).\n//\n// These Zod schemas are imported by `frontend/apps/inspector-ui/src/bridge.ts`\n// and used to validate inbound messages at runtime. Changes here flow to\n// both sides in a single commit.\n// ============================================================================\n\n/** Public tab descriptor that crosses the dashboard ↔ inspector-ui bridge. */\nexport const InspectorTabDescriptorSchema = z.object({\n\tid: z.string(),\n\tlabel: z.string(),\n\ticon: z.string(),\n\t/**\n\t * `true` for author-shipped custom tabs; absent or `false` for\n\t * built-in tabs the SPA renders. Lets the dashboard route the\n\t * iframe `src` to `/inspector/custom-tabs/<id>/` for custom tabs and\n\t * `/inspector/ui/` for built-ins without the dashboard needing to\n\t * know which ids are built-in.\n\t */\n\tisCustom: z.boolean().optional(),\n});\n\n/**\n * Initial handshake from the dashboard. Sent on first mount and again on\n * every token refresh. Tabs MUST accept late `init` messages and replace\n * the cached token.\n */\nexport const V1InitSchema = z.object({\n\ttype: z.literal(\"init\"),\n\tv: z.literal(1),\n\t/** The actor this tab is mounted for. */\n\tactorId: z.string(),\n\t/**\n\t * Per-actor inspector bearer token. Tabs include it as\n\t * `Authorization: Bearer ${authToken}` on every authenticated fetch.\n\t */\n\tauthToken: z.string(),\n\t/**\n\t * Outer Rivet API token. Optional; not required for inspector HTTP\n\t * routes but available to tabs that want to call the engine REST API.\n\t */\n\trivetToken: z.string().optional(),\n\t/**\n\t * The tab id the dashboard wants active at mount time. Multi-view\n\t * tabs may read this to seed their initial route; most tabs ignore it.\n\t */\n\tactiveTab: z.string().optional(),\n\t/**\n\t * Dashboard's currently active theme. Tabs that use the shared\n\t * stylesheet (`/inspector/tab.css`) mirror it by toggling the `dark`\n\t * class on `<html>`. Optional for backwards compatibility — tabs\n\t * should default to `\"dark\"` if absent (the dashboard pinned dark\n\t * mode before this field was added).\n\t */\n\ttheme: z.enum([\"light\", \"dark\"]).optional(),\n});\n\n/**\n * Dashboard tells the inspector-ui SPA which built-in tab to render. Not\n * sent to custom tabs — when the user activates a custom tab the\n * dashboard navigates the outer iframe to a different `src`.\n */\nexport const V1SetActiveTabSchema = z.object({\n\ttype: z.literal(\"set-active-tab\"),\n\tv: z.literal(1),\n\ttab: z.string(),\n});\n\n/**\n * Tab → dashboard. Sent once after the message listener is registered.\n * The dashboard hides the \"Connecting to inspector…\" overlay on receipt;\n * if it never arrives the overlay times out after 8 s.\n */\nexport const V1ReadySchema = z.object({\n\ttype: z.literal(\"ready\"),\n\tv: z.literal(1),\n});\n\n/**\n * Tab → dashboard. Sent when the tab gets a 401 on an inspector data\n * call. The dashboard refreshes the token and re-issues `v1Init`.\n */\nexport const V1TokenRefreshNeededSchema = z.object({\n\ttype: z.literal(\"token-refresh-needed\"),\n\tv: z.literal(1),\n});\n\n/**\n * Emitted by the inspector-ui SPA to tell the dashboard which tabs to\n * render in the strip. Custom tab bundles do NOT emit this — only the\n * SPA does.\n */\nexport const V1TabsAvailableSchema = z.object({\n\ttype: z.literal(\"tabs-available\"),\n\tv: z.literal(1),\n\ttabs: z.array(InspectorTabDescriptorSchema),\n});\n\n/** Discriminated union of messages a tab can RECEIVE from the dashboard. */\nexport const ShellToTabMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1InitSchema,\n\tV1SetActiveTabSchema,\n]);\n\n/** Discriminated union of messages a tab can SEND to the dashboard. */\nexport const TabToShellMessageSchema = z.discriminatedUnion(\"type\", [\n\tV1ReadySchema,\n\tV1TabsAvailableSchema,\n\tV1TokenRefreshNeededSchema,\n]);\n\nexport type InspectorTabDescriptor = z.infer<\n\ttypeof InspectorTabDescriptorSchema\n>;\nexport type V1Init = z.infer<typeof V1InitSchema>;\nexport type V1SetActiveTab = z.infer<typeof V1SetActiveTabSchema>;\nexport type V1Ready = z.infer<typeof V1ReadySchema>;\nexport type V1TokenRefreshNeeded = z.infer<typeof V1TokenRefreshNeededSchema>;\nexport type V1TabsAvailable = z.infer<typeof V1TabsAvailableSchema>;\nexport type ShellToTabMessage = z.infer<typeof ShellToTabMessageSchema>;\nexport type TabToShellMessage = z.infer<typeof TabToShellMessageSchema>;\n\n/** Stable envelope protocol version. Bump only when introducing a v2 shape. */\nexport const POSTMESSAGE_PROTOCOL_VERSION = 1;\n\n/** URL query parameters the dashboard sets on the tab iframe `src`. */\nexport const SHELL_ORIGIN_PARAM = \"shellOrigin\";\nexport const ACTOR_ID_PARAM = \"actorId\";\n\n// ============================================================================\n// Inspector HTTP endpoint response schemas (source of truth).\n//\n// The dashboard parses every authenticated inspector response through\n// these schemas (`frontend/src/components/actors/actor-inspector-context.tsx`).\n// If the Rust handler emits a different shape the parse fails and the\n// dashboard surfaces an error — drift is loud.\n// ============================================================================\n\n/** `GET /inspector/state` response shape. */\nexport const InspectorStateResponseSchema = z.object({\n\t/** Current actor state (whatever shape the actor declared). */\n\tstate: z.unknown(),\n\t/**\n\t * `false` when the actor did not declare any state — `state` is then\n\t * `null` and `PATCH /inspector/state` returns an error.\n\t */\n\tisStateEnabled: z.boolean(),\n});\n\n/** `POST /inspector/action/<name>` request body. */\nexport const InspectorActionRequestSchema = z\n\t.object({\n\t\t/** Positional arguments. Mutually exclusive with `properties`. */\n\t\targs: z.array(z.unknown()).optional(),\n\t\t/** Keyed arguments. Mutually exclusive with `args`. */\n\t\tproperties: z.record(z.string(), z.unknown()).optional(),\n\t})\n\t.refine(\n\t\t(body) => !(body.args !== undefined && body.properties !== undefined),\n\t\t\"Use either `args` or `properties`, not both\",\n\t);\n\n/** `POST /inspector/action/<name>` response shape. */\nexport const InspectorActionResponseSchema = z.object({\n\toutput: z.unknown(),\n});\n\n/** `GET /inspector/rpcs` response shape — the list of action names. */\nexport const InspectorRpcsResponseSchema = z.object({\n\trpcs: z.array(z.string()),\n});\n\n/** One connection record in `GET /inspector/connections`. */\nexport const InspectorConnectionSchema = z.object({\n\tconnectionType: z.string().nullable(),\n\tid: z.string(),\n\tdetails: z.object({\n\t\tconnectionType: z.string().nullable(),\n\t\tparams: z.unknown(),\n\t\tstateEnabled: z.boolean(),\n\t\tstate: z.unknown(),\n\t\tsubscriptions: z.number(),\n\t\tisHibernatable: z.boolean(),\n\t}),\n});\n\n/** `GET /inspector/connections` response shape. */\nexport const InspectorConnectionsResponseSchema = z.object({\n\tconnections: z.array(InspectorConnectionSchema),\n});\n\n/** One queued message in `GET /inspector/queue`. */\nexport const InspectorQueueMessageSchema = z.object({\n\tid: z.string(),\n\tname: z.string(),\n\tcreatedAtMs: z.number(),\n});\n\n/** `GET /inspector/queue` response shape. */\nexport const InspectorQueueResponseSchema = z.object({\n\tsize: z.number(),\n\tmaxSize: z.number(),\n\t/** `true` if `?limit=N` truncated the message list below `size`. */\n\ttruncated: z.boolean(),\n\tmessages: z.array(InspectorQueueMessageSchema),\n});\n\nexport type InspectorStateResponse = z.infer<\n\ttypeof InspectorStateResponseSchema\n>;\nexport type InspectorActionRequest = z.infer<\n\ttypeof InspectorActionRequestSchema\n>;\nexport type InspectorActionResponse = z.infer<\n\ttypeof InspectorActionResponseSchema\n>;\nexport type InspectorRpcsResponse = z.infer<typeof InspectorRpcsResponseSchema>;\nexport type InspectorConnection = z.infer<typeof InspectorConnectionSchema>;\nexport type InspectorConnectionsResponse = z.infer<\n\ttypeof InspectorConnectionsResponseSchema\n>;\nexport type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;\nexport type InspectorQueueResponse = z.infer<\n\ttypeof InspectorQueueResponseSchema\n>;\n"]}
|