rivetkit 2.3.0-rc.11 → 2.3.0-rc.13

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 (123) hide show
  1. package/dist/browser/client.d.ts +407 -20
  2. package/dist/browser/client.js +101 -86
  3. package/dist/browser/client.js.map +1 -1
  4. package/dist/browser/inspector/client.js +12 -2
  5. package/dist/browser/inspector/client.js.map +1 -1
  6. package/dist/tsup/actor/errors.d.cts +1 -1
  7. package/dist/tsup/actor/errors.d.ts +1 -1
  8. package/dist/tsup/agent-os/index.cjs +66 -3
  9. package/dist/tsup/agent-os/index.cjs.map +1 -1
  10. package/dist/tsup/agent-os/index.d.cts +404 -17
  11. package/dist/tsup/agent-os/index.d.ts +404 -17
  12. package/dist/tsup/agent-os/index.js +66 -3
  13. package/dist/tsup/agent-os/index.js.map +1 -1
  14. package/dist/tsup/{chunk-WXYWDLJY.js → chunk-33YE6XCI.js} +4 -4
  15. package/dist/tsup/{chunk-2NXFKPRB.cjs → chunk-7OR3CHD5.cjs} +10 -10
  16. package/dist/tsup/{chunk-2NXFKPRB.cjs.map → chunk-7OR3CHD5.cjs.map} +1 -1
  17. package/dist/tsup/{chunk-LW5HNCWD.cjs → chunk-7XQCARVY.cjs} +3 -3
  18. package/dist/tsup/{chunk-LW5HNCWD.cjs.map → chunk-7XQCARVY.cjs.map} +1 -1
  19. package/dist/tsup/{chunk-GX6W4MW3.cjs → chunk-BSPS6NSN.cjs} +5 -5
  20. package/dist/tsup/{chunk-GX6W4MW3.cjs.map → chunk-BSPS6NSN.cjs.map} +1 -1
  21. package/dist/tsup/{chunk-T3VCJ4PV.js → chunk-DPIMKYNB.js} +61 -2
  22. package/dist/tsup/chunk-DPIMKYNB.js.map +1 -0
  23. package/dist/tsup/{chunk-XG25CGSW.cjs → chunk-E5CLYAUZ.cjs} +146 -143
  24. package/dist/tsup/chunk-E5CLYAUZ.cjs.map +1 -0
  25. package/dist/tsup/{chunk-RDBGKI66.cjs → chunk-EBWOJRCC.cjs} +22 -5
  26. package/dist/tsup/chunk-EBWOJRCC.cjs.map +1 -0
  27. package/dist/tsup/{chunk-YRQ4F5CD.js → chunk-HHNYEQD3.js} +6 -6
  28. package/dist/tsup/chunk-HHNYEQD3.js.map +1 -0
  29. package/dist/tsup/{chunk-4FP4FFB5.js → chunk-IOUSQVXI.js} +21 -4
  30. package/dist/tsup/chunk-IOUSQVXI.js.map +1 -0
  31. package/dist/tsup/{chunk-LNP7Q6I6.cjs → chunk-ISDKSSYR.cjs} +4 -4
  32. package/dist/tsup/{chunk-LNP7Q6I6.cjs.map → chunk-ISDKSSYR.cjs.map} +1 -1
  33. package/dist/tsup/{chunk-TTLUIDVH.js → chunk-J72WHUBC.js} +12 -9
  34. package/dist/tsup/chunk-J72WHUBC.js.map +1 -0
  35. package/dist/tsup/{chunk-Y3JBOFBG.cjs → chunk-KWABEUUA.cjs} +10 -10
  36. package/dist/tsup/chunk-KWABEUUA.cjs.map +1 -0
  37. package/dist/tsup/{chunk-XCDCURZ4.cjs → chunk-NIY3RSPX.cjs} +62 -3
  38. package/dist/tsup/chunk-NIY3RSPX.cjs.map +1 -0
  39. package/dist/tsup/{chunk-3P2JUHWJ.js → chunk-T44AVAGW.js} +2 -2
  40. package/dist/tsup/{chunk-GRFBV2U7.js → chunk-TCXEM6PA.js} +2 -2
  41. package/dist/tsup/{chunk-KRC4L3YB.js → chunk-ZI5CNA2Z.js} +2 -2
  42. package/dist/tsup/client/mod.cjs +7 -7
  43. package/dist/tsup/client/mod.cjs.map +1 -1
  44. package/dist/tsup/client/mod.d.cts +3 -3
  45. package/dist/tsup/client/mod.d.ts +3 -3
  46. package/dist/tsup/client/mod.js +6 -6
  47. package/dist/tsup/common/log.cjs +2 -2
  48. package/dist/tsup/common/log.js +1 -1
  49. package/dist/tsup/common/websocket.cjs +3 -3
  50. package/dist/tsup/common/websocket.js +2 -2
  51. package/dist/tsup/{config-De5UVu0V.d.ts → config-BxWAw3iH.d.ts} +476 -20
  52. package/dist/tsup/{config-CTwe3WwC.d.cts → config-CZQQ-mso.d.cts} +476 -20
  53. package/dist/tsup/{context-Dmj477Uh.d.cts → context-Bw7xq8w3.d.cts} +1 -1
  54. package/dist/tsup/{context-DPHISlUi.d.ts → context-D8QA76sV.d.ts} +1 -1
  55. package/dist/tsup/dynamic/mod.cjs +2 -2
  56. package/dist/tsup/dynamic/mod.d.cts +2 -2
  57. package/dist/tsup/dynamic/mod.d.ts +2 -2
  58. package/dist/tsup/dynamic/mod.js +1 -1
  59. package/dist/tsup/inspector/mod.cjs +5 -5
  60. package/dist/tsup/inspector/mod.js +4 -4
  61. package/dist/tsup/inspector-tab/mod.cjs +173 -0
  62. package/dist/tsup/inspector-tab/mod.cjs.map +1 -0
  63. package/dist/tsup/inspector-tab/mod.d.cts +250 -0
  64. package/dist/tsup/inspector-tab/mod.d.ts +250 -0
  65. package/dist/tsup/inspector-tab/mod.js +173 -0
  66. package/dist/tsup/inspector-tab/mod.js.map +1 -0
  67. package/dist/tsup/mod.cjs +341 -138
  68. package/dist/tsup/mod.cjs.map +1 -1
  69. package/dist/tsup/mod.d.cts +4 -4
  70. package/dist/tsup/mod.d.ts +4 -4
  71. package/dist/tsup/mod.js +277 -74
  72. package/dist/tsup/mod.js.map +1 -1
  73. package/dist/tsup/test/mod.cjs +10 -10
  74. package/dist/tsup/test/mod.d.cts +2 -2
  75. package/dist/tsup/test/mod.d.ts +2 -2
  76. package/dist/tsup/test/mod.js +6 -6
  77. package/dist/tsup/{utils-DVekpm4I.d.ts → utils-DQosb24I.d.cts} +1 -1
  78. package/dist/tsup/{utils-DVekpm4I.d.cts → utils-DQosb24I.d.ts} +1 -1
  79. package/dist/tsup/utils.cjs +2 -2
  80. package/dist/tsup/utils.d.cts +1 -1
  81. package/dist/tsup/utils.d.ts +1 -1
  82. package/dist/tsup/utils.js +1 -1
  83. package/dist/tsup/workflow/mod.cjs +11 -11
  84. package/dist/tsup/workflow/mod.cjs.map +1 -1
  85. package/dist/tsup/workflow/mod.d.cts +4 -4
  86. package/dist/tsup/workflow/mod.d.ts +4 -4
  87. package/dist/tsup/workflow/mod.js +5 -5
  88. package/package.json +19 -9
  89. package/src/actor/config.ts +111 -10
  90. package/src/actor/definition.ts +6 -5
  91. package/src/actor/instance/mod.ts +4 -4
  92. package/src/actor/mod.ts +2 -0
  93. package/src/client/actor-common.ts +24 -27
  94. package/src/client/actor-handle.ts +2 -1
  95. package/src/common/engine.ts +28 -1
  96. package/src/common/utils.ts +1 -1
  97. package/src/devtools-loader/index.ts +4 -7
  98. package/src/devtools-loader/serve-devtools.ts +26 -0
  99. package/src/drivers/engine/actor-driver.ts +16 -5
  100. package/src/engine-client/actor-http-client.ts +2 -2
  101. package/src/engine-client/api-endpoints.ts +5 -1
  102. package/src/engine-client/ws-proxy.ts +5 -0
  103. package/src/inspector-tab/mod.ts +315 -0
  104. package/src/registry/config/index.ts +40 -16
  105. package/src/registry/index.ts +143 -62
  106. package/src/registry/napi-runtime.ts +6 -0
  107. package/src/registry/native.ts +170 -27
  108. package/src/registry/process-metrics.ts +16 -4
  109. package/src/registry/runtime.ts +26 -0
  110. package/src/registry/wasm-runtime.ts +16 -1
  111. package/src/utils/env-vars.ts +6 -0
  112. package/dist/tsup/chunk-4FP4FFB5.js.map +0 -1
  113. package/dist/tsup/chunk-RDBGKI66.cjs.map +0 -1
  114. package/dist/tsup/chunk-T3VCJ4PV.js.map +0 -1
  115. package/dist/tsup/chunk-TTLUIDVH.js.map +0 -1
  116. package/dist/tsup/chunk-XCDCURZ4.cjs.map +0 -1
  117. package/dist/tsup/chunk-XG25CGSW.cjs.map +0 -1
  118. package/dist/tsup/chunk-Y3JBOFBG.cjs.map +0 -1
  119. package/dist/tsup/chunk-YRQ4F5CD.js.map +0 -1
  120. /package/dist/tsup/{chunk-WXYWDLJY.js.map → chunk-33YE6XCI.js.map} +0 -0
  121. /package/dist/tsup/{chunk-3P2JUHWJ.js.map → chunk-T44AVAGW.js.map} +0 -0
  122. /package/dist/tsup/{chunk-GRFBV2U7.js.map → chunk-TCXEM6PA.js.map} +0 -0
  123. /package/dist/tsup/{chunk-KRC4L3YB.js.map → chunk-ZI5CNA2Z.js.map} +0 -0
@@ -1,4 +1,4 @@
1
- import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, ae as QueueFilterName, aj as QueueNextOptions, ak as QueueResultMessageForName, ai as QueueNextBatchOptions, bl as InferSchemaMap, aq as Registry, V as Client, u as ActorLogger, bm as InferEventArgs } from './config-De5UVu0V.js';
1
+ import { A as AnyActorDefinition, B as BaseActorDefinition, E as EventSchemaConfig, Q as QueueSchemaConfig, h as RunContext, al as QueueFilterName, aq as QueueNextOptions, ar as QueueResultMessageForName, ap as QueueNextBatchOptions, bt as InferSchemaMap, ax as Registry, _ as Client, w as ActorLogger, bu as InferEventArgs } from './config-BxWAw3iH.js';
2
2
  import { WorkflowContextInterface, StepConfig, TryStepConfig, TryStepResult, TryBlockResult, LoopResult, LoopConfig, BranchConfig, BranchOutput, EntryKindType } from '@rivetkit/workflow-engine';
3
3
  import { A as AnyDatabaseProvider, I as InferDatabaseClient } from './config-D49x8NpL.js';
4
4
 
@@ -1,6 +1,6 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
2
 
3
- var _chunkXCDCURZ4cjs = require('../chunk-XCDCURZ4.cjs');
3
+ var _chunkNIY3RSPXcjs = require('../chunk-NIY3RSPX.cjs');
4
4
 
5
5
  // src/dynamic/internal.ts
6
6
  var DYNAMIC_ACTOR_DEFINITION_SYMBOL = /* @__PURE__ */ Symbol.for(
@@ -9,7 +9,7 @@ var DYNAMIC_ACTOR_DEFINITION_SYMBOL = /* @__PURE__ */ Symbol.for(
9
9
 
10
10
  // src/dynamic/mod.ts
11
11
  function dynamicActor(input) {
12
- const config = _chunkXCDCURZ4cjs.ActorConfigSchema.parse({
12
+ const config = _chunkNIY3RSPXcjs.ActorConfigSchema.parse({
13
13
  actions: {}
14
14
  });
15
15
  return {
@@ -1,4 +1,4 @@
1
- import { A as AnyActorDefinition } from '../config-CTwe3WwC.cjs';
1
+ import { A as AnyActorDefinition } from '../config-CZQQ-mso.cjs';
2
2
  import 'zod/v4';
3
3
  import '../config-D49x8NpL.cjs';
4
4
  import '@rivetkit/rivetkit-wasm';
@@ -8,7 +8,7 @@ import '@rivetkit/virtual-websocket';
8
8
  import '@standard-schema/spec';
9
9
  import 'hono';
10
10
  import '../utils.cjs';
11
- import '../utils-DVekpm4I.cjs';
11
+ import '../utils-DQosb24I.cjs';
12
12
  import 'hono/utils/http-status';
13
13
 
14
14
  declare const DYNAMIC_ACTOR_DEFINITION_SYMBOL: unique symbol;
@@ -1,4 +1,4 @@
1
- import { A as AnyActorDefinition } from '../config-De5UVu0V.js';
1
+ import { A as AnyActorDefinition } from '../config-BxWAw3iH.js';
2
2
  import 'zod/v4';
3
3
  import '../config-D49x8NpL.js';
4
4
  import '@rivetkit/rivetkit-wasm';
@@ -8,7 +8,7 @@ import '@rivetkit/virtual-websocket';
8
8
  import '@standard-schema/spec';
9
9
  import 'hono';
10
10
  import '../utils.js';
11
- import '../utils-DVekpm4I.js';
11
+ import '../utils-DQosb24I.js';
12
12
  import 'hono/utils/http-status';
13
13
 
14
14
  declare const DYNAMIC_ACTOR_DEFINITION_SYMBOL: unique symbol;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ActorConfigSchema
3
- } from "../chunk-T3VCJ4PV.js";
3
+ } from "../chunk-DPIMKYNB.js";
4
4
 
5
5
  // src/dynamic/internal.ts
6
6
  var DYNAMIC_ACTOR_DEFINITION_SYMBOL = /* @__PURE__ */ Symbol.for(
@@ -1,12 +1,12 @@
1
1
  "use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) { newObj[key] = obj[key]; } } } newObj.default = obj; return newObj; } }
2
2
 
3
- var _chunk2NXFKPRBcjs = require('../chunk-2NXFKPRB.cjs');
3
+ var _chunk7OR3CHD5cjs = require('../chunk-7OR3CHD5.cjs');
4
4
 
5
5
 
6
6
 
7
- var _chunkLNP7Q6I6cjs = require('../chunk-LNP7Q6I6.cjs');
8
- require('../chunk-GX6W4MW3.cjs');
9
- require('../chunk-RDBGKI66.cjs');
7
+ var _chunkISDKSSYRcjs = require('../chunk-ISDKSSYR.cjs');
8
+ require('../chunk-BSPS6NSN.cjs');
9
+ require('../chunk-EBWOJRCC.cjs');
10
10
  require('../chunk-KORQB2IR.cjs');
11
11
 
12
12
  // src/common/bare/generated/inspector/v4.ts
@@ -761,5 +761,5 @@ function decodeToClient(bytes) {
761
761
 
762
762
 
763
763
 
764
- exports.createWorkflowInspectorAdapter = _chunk2NXFKPRBcjs.createWorkflowInspectorAdapter; exports.decodeToClient = decodeToClient; exports.decodeToServer = decodeToServer; exports.decodeWorkflowHistoryTransport = _chunkLNP7Q6I6cjs.decodeWorkflowHistoryTransport; exports.encodeToClient = encodeToClient; exports.encodeToServer = encodeToServer; exports.encodeWorkflowHistoryTransport = _chunkLNP7Q6I6cjs.encodeWorkflowHistoryTransport; exports.readActionRequest = readActionRequest; exports.readActionResponse = readActionResponse; exports.readConnection = readConnection; exports.readConnectionsRequest = readConnectionsRequest; exports.readConnectionsResponse = readConnectionsResponse; exports.readConnectionsUpdated = readConnectionsUpdated; exports.readDatabaseSchemaRequest = readDatabaseSchemaRequest; exports.readDatabaseSchemaResponse = readDatabaseSchemaResponse; exports.readDatabaseTableRowsRequest = readDatabaseTableRowsRequest; exports.readDatabaseTableRowsResponse = readDatabaseTableRowsResponse; exports.readError = readError; exports.readInit = readInit; exports.readPatchStateRequest = readPatchStateRequest; exports.readQueueMessageSummary = readQueueMessageSummary; exports.readQueueRequest = readQueueRequest; exports.readQueueResponse = readQueueResponse; exports.readQueueStatus = readQueueStatus; exports.readQueueUpdated = readQueueUpdated; exports.readRpcsListRequest = readRpcsListRequest; exports.readRpcsListResponse = readRpcsListResponse; exports.readState = readState; exports.readStateRequest = readStateRequest; exports.readStateResponse = readStateResponse; exports.readStateUpdated = readStateUpdated; exports.readToClient = readToClient; exports.readToClientBody = readToClientBody; exports.readToServer = readToServer; exports.readToServerBody = readToServerBody; exports.readTraceQueryRequest = readTraceQueryRequest; exports.readTraceQueryResponse = readTraceQueryResponse; exports.readWorkflowHistory = readWorkflowHistory; exports.readWorkflowHistoryRequest = readWorkflowHistoryRequest; exports.readWorkflowHistoryResponse = readWorkflowHistoryResponse; exports.readWorkflowHistoryUpdated = readWorkflowHistoryUpdated; exports.readWorkflowReplayRequest = readWorkflowReplayRequest; exports.readWorkflowReplayResponse = readWorkflowReplayResponse; exports.writeActionRequest = writeActionRequest; exports.writeActionResponse = writeActionResponse; exports.writeConnection = writeConnection; exports.writeConnectionsRequest = writeConnectionsRequest; exports.writeConnectionsResponse = writeConnectionsResponse; exports.writeConnectionsUpdated = writeConnectionsUpdated; exports.writeDatabaseSchemaRequest = writeDatabaseSchemaRequest; exports.writeDatabaseSchemaResponse = writeDatabaseSchemaResponse; exports.writeDatabaseTableRowsRequest = writeDatabaseTableRowsRequest; exports.writeDatabaseTableRowsResponse = writeDatabaseTableRowsResponse; exports.writeError = writeError; exports.writeInit = writeInit; exports.writePatchStateRequest = writePatchStateRequest; exports.writeQueueMessageSummary = writeQueueMessageSummary; exports.writeQueueRequest = writeQueueRequest; exports.writeQueueResponse = writeQueueResponse; exports.writeQueueStatus = writeQueueStatus; exports.writeQueueUpdated = writeQueueUpdated; exports.writeRpcsListRequest = writeRpcsListRequest; exports.writeRpcsListResponse = writeRpcsListResponse; exports.writeState = writeState; exports.writeStateRequest = writeStateRequest; exports.writeStateResponse = writeStateResponse; exports.writeStateUpdated = writeStateUpdated; exports.writeToClient = writeToClient; exports.writeToClientBody = writeToClientBody; exports.writeToServer = writeToServer; exports.writeToServerBody = writeToServerBody; exports.writeTraceQueryRequest = writeTraceQueryRequest; exports.writeTraceQueryResponse = writeTraceQueryResponse; exports.writeWorkflowHistory = writeWorkflowHistory; exports.writeWorkflowHistoryRequest = writeWorkflowHistoryRequest; exports.writeWorkflowHistoryResponse = writeWorkflowHistoryResponse; exports.writeWorkflowHistoryUpdated = writeWorkflowHistoryUpdated; exports.writeWorkflowReplayRequest = writeWorkflowReplayRequest; exports.writeWorkflowReplayResponse = writeWorkflowReplayResponse;
764
+ exports.createWorkflowInspectorAdapter = _chunk7OR3CHD5cjs.createWorkflowInspectorAdapter; exports.decodeToClient = decodeToClient; exports.decodeToServer = decodeToServer; exports.decodeWorkflowHistoryTransport = _chunkISDKSSYRcjs.decodeWorkflowHistoryTransport; exports.encodeToClient = encodeToClient; exports.encodeToServer = encodeToServer; exports.encodeWorkflowHistoryTransport = _chunkISDKSSYRcjs.encodeWorkflowHistoryTransport; exports.readActionRequest = readActionRequest; exports.readActionResponse = readActionResponse; exports.readConnection = readConnection; exports.readConnectionsRequest = readConnectionsRequest; exports.readConnectionsResponse = readConnectionsResponse; exports.readConnectionsUpdated = readConnectionsUpdated; exports.readDatabaseSchemaRequest = readDatabaseSchemaRequest; exports.readDatabaseSchemaResponse = readDatabaseSchemaResponse; exports.readDatabaseTableRowsRequest = readDatabaseTableRowsRequest; exports.readDatabaseTableRowsResponse = readDatabaseTableRowsResponse; exports.readError = readError; exports.readInit = readInit; exports.readPatchStateRequest = readPatchStateRequest; exports.readQueueMessageSummary = readQueueMessageSummary; exports.readQueueRequest = readQueueRequest; exports.readQueueResponse = readQueueResponse; exports.readQueueStatus = readQueueStatus; exports.readQueueUpdated = readQueueUpdated; exports.readRpcsListRequest = readRpcsListRequest; exports.readRpcsListResponse = readRpcsListResponse; exports.readState = readState; exports.readStateRequest = readStateRequest; exports.readStateResponse = readStateResponse; exports.readStateUpdated = readStateUpdated; exports.readToClient = readToClient; exports.readToClientBody = readToClientBody; exports.readToServer = readToServer; exports.readToServerBody = readToServerBody; exports.readTraceQueryRequest = readTraceQueryRequest; exports.readTraceQueryResponse = readTraceQueryResponse; exports.readWorkflowHistory = readWorkflowHistory; exports.readWorkflowHistoryRequest = readWorkflowHistoryRequest; exports.readWorkflowHistoryResponse = readWorkflowHistoryResponse; exports.readWorkflowHistoryUpdated = readWorkflowHistoryUpdated; exports.readWorkflowReplayRequest = readWorkflowReplayRequest; exports.readWorkflowReplayResponse = readWorkflowReplayResponse; exports.writeActionRequest = writeActionRequest; exports.writeActionResponse = writeActionResponse; exports.writeConnection = writeConnection; exports.writeConnectionsRequest = writeConnectionsRequest; exports.writeConnectionsResponse = writeConnectionsResponse; exports.writeConnectionsUpdated = writeConnectionsUpdated; exports.writeDatabaseSchemaRequest = writeDatabaseSchemaRequest; exports.writeDatabaseSchemaResponse = writeDatabaseSchemaResponse; exports.writeDatabaseTableRowsRequest = writeDatabaseTableRowsRequest; exports.writeDatabaseTableRowsResponse = writeDatabaseTableRowsResponse; exports.writeError = writeError; exports.writeInit = writeInit; exports.writePatchStateRequest = writePatchStateRequest; exports.writeQueueMessageSummary = writeQueueMessageSummary; exports.writeQueueRequest = writeQueueRequest; exports.writeQueueResponse = writeQueueResponse; exports.writeQueueStatus = writeQueueStatus; exports.writeQueueUpdated = writeQueueUpdated; exports.writeRpcsListRequest = writeRpcsListRequest; exports.writeRpcsListResponse = writeRpcsListResponse; exports.writeState = writeState; exports.writeStateRequest = writeStateRequest; exports.writeStateResponse = writeStateResponse; exports.writeStateUpdated = writeStateUpdated; exports.writeToClient = writeToClient; exports.writeToClientBody = writeToClientBody; exports.writeToServer = writeToServer; exports.writeToServerBody = writeToServerBody; exports.writeTraceQueryRequest = writeTraceQueryRequest; exports.writeTraceQueryResponse = writeTraceQueryResponse; exports.writeWorkflowHistory = writeWorkflowHistory; exports.writeWorkflowHistoryRequest = writeWorkflowHistoryRequest; exports.writeWorkflowHistoryResponse = writeWorkflowHistoryResponse; exports.writeWorkflowHistoryUpdated = writeWorkflowHistoryUpdated; exports.writeWorkflowReplayRequest = writeWorkflowReplayRequest; exports.writeWorkflowReplayResponse = writeWorkflowReplayResponse;
765
765
  //# sourceMappingURL=mod.cjs.map
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createWorkflowInspectorAdapter
3
- } from "../chunk-WXYWDLJY.js";
3
+ } from "../chunk-33YE6XCI.js";
4
4
  import {
5
5
  decodeWorkflowHistoryTransport,
6
6
  encodeWorkflowHistoryTransport
7
- } from "../chunk-GRFBV2U7.js";
8
- import "../chunk-KRC4L3YB.js";
9
- import "../chunk-4FP4FFB5.js";
7
+ } from "../chunk-TCXEM6PA.js";
8
+ import "../chunk-ZI5CNA2Z.js";
9
+ import "../chunk-IOUSQVXI.js";
10
10
  import "../chunk-BRP62GZC.js";
11
11
 
12
12
  // src/common/bare/generated/inspector/v4.ts
@@ -0,0 +1,173 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkNIY3RSPXcjs = require('../chunk-NIY3RSPX.cjs');
9
+
10
+ // src/inspector-tab/mod.ts
11
+ var _zod = require('zod');
12
+ var InspectorTabDescriptorSchema = _zod.z.object({
13
+ id: _zod.z.string(),
14
+ label: _zod.z.string(),
15
+ icon: _zod.z.string(),
16
+ /**
17
+ * `true` for author-shipped custom tabs; absent or `false` for
18
+ * built-in tabs the SPA renders. Lets the dashboard route the
19
+ * iframe `src` to `/inspector/custom-tabs/<id>/` for custom tabs and
20
+ * `/inspector/ui/` for built-ins without the dashboard needing to
21
+ * know which ids are built-in.
22
+ */
23
+ isCustom: _zod.z.boolean().optional()
24
+ });
25
+ var V1InitSchema = _zod.z.object({
26
+ type: _zod.z.literal("init"),
27
+ v: _zod.z.literal(1),
28
+ /** The actor this tab is mounted for. */
29
+ actorId: _zod.z.string(),
30
+ /**
31
+ * Per-actor inspector bearer token. Tabs include it as
32
+ * `Authorization: Bearer ${authToken}` on every authenticated fetch.
33
+ */
34
+ authToken: _zod.z.string(),
35
+ /**
36
+ * Outer Rivet API token. Optional; not required for inspector HTTP
37
+ * routes but available to tabs that want to call the engine REST API.
38
+ */
39
+ rivetToken: _zod.z.string().optional(),
40
+ /**
41
+ * The tab id the dashboard wants active at mount time. Multi-view
42
+ * tabs may read this to seed their initial route; most tabs ignore it.
43
+ */
44
+ activeTab: _zod.z.string().optional(),
45
+ /**
46
+ * Dashboard's currently active theme. Tabs that use the shared
47
+ * stylesheet (`/inspector/tab.css`) mirror it by toggling the `dark`
48
+ * class on `<html>`. Optional for backwards compatibility — tabs
49
+ * should default to `"dark"` if absent (the dashboard pinned dark
50
+ * mode before this field was added).
51
+ */
52
+ theme: _zod.z.enum(["light", "dark"]).optional()
53
+ });
54
+ var V1SetActiveTabSchema = _zod.z.object({
55
+ type: _zod.z.literal("set-active-tab"),
56
+ v: _zod.z.literal(1),
57
+ tab: _zod.z.string()
58
+ });
59
+ var V1ReadySchema = _zod.z.object({
60
+ type: _zod.z.literal("ready"),
61
+ v: _zod.z.literal(1)
62
+ });
63
+ var V1TokenRefreshNeededSchema = _zod.z.object({
64
+ type: _zod.z.literal("token-refresh-needed"),
65
+ v: _zod.z.literal(1)
66
+ });
67
+ var V1TabsAvailableSchema = _zod.z.object({
68
+ type: _zod.z.literal("tabs-available"),
69
+ v: _zod.z.literal(1),
70
+ tabs: _zod.z.array(InspectorTabDescriptorSchema)
71
+ });
72
+ var ShellToTabMessageSchema = _zod.z.discriminatedUnion("type", [
73
+ V1InitSchema,
74
+ V1SetActiveTabSchema
75
+ ]);
76
+ var TabToShellMessageSchema = _zod.z.discriminatedUnion("type", [
77
+ V1ReadySchema,
78
+ V1TabsAvailableSchema,
79
+ V1TokenRefreshNeededSchema
80
+ ]);
81
+ var POSTMESSAGE_PROTOCOL_VERSION = 1;
82
+ var SHELL_ORIGIN_PARAM = "shellOrigin";
83
+ var ACTOR_ID_PARAM = "actorId";
84
+ var InspectorStateResponseSchema = _zod.z.object({
85
+ /** Current actor state (whatever shape the actor declared). */
86
+ state: _zod.z.unknown(),
87
+ /**
88
+ * `false` when the actor did not declare any state — `state` is then
89
+ * `null` and `PATCH /inspector/state` returns an error.
90
+ */
91
+ isStateEnabled: _zod.z.boolean()
92
+ });
93
+ var InspectorActionRequestSchema = _zod.z.object({
94
+ /** Positional arguments. Mutually exclusive with `properties`. */
95
+ args: _zod.z.array(_zod.z.unknown()).optional(),
96
+ /** Keyed arguments. Mutually exclusive with `args`. */
97
+ properties: _zod.z.record(_zod.z.string(), _zod.z.unknown()).optional()
98
+ }).refine(
99
+ (body) => !(body.args !== void 0 && body.properties !== void 0),
100
+ "Use either `args` or `properties`, not both"
101
+ );
102
+ var InspectorActionResponseSchema = _zod.z.object({
103
+ output: _zod.z.unknown()
104
+ });
105
+ var InspectorRpcsResponseSchema = _zod.z.object({
106
+ rpcs: _zod.z.array(_zod.z.string())
107
+ });
108
+ var InspectorConnectionSchema = _zod.z.object({
109
+ connectionType: _zod.z.string().nullable(),
110
+ id: _zod.z.string(),
111
+ details: _zod.z.object({
112
+ connectionType: _zod.z.string().nullable(),
113
+ params: _zod.z.unknown(),
114
+ stateEnabled: _zod.z.boolean(),
115
+ state: _zod.z.unknown(),
116
+ subscriptions: _zod.z.number(),
117
+ isHibernatable: _zod.z.boolean()
118
+ })
119
+ });
120
+ var InspectorConnectionsResponseSchema = _zod.z.object({
121
+ connections: _zod.z.array(InspectorConnectionSchema)
122
+ });
123
+ var InspectorQueueMessageSchema = _zod.z.object({
124
+ id: _zod.z.string(),
125
+ name: _zod.z.string(),
126
+ createdAtMs: _zod.z.number()
127
+ });
128
+ var InspectorQueueResponseSchema = _zod.z.object({
129
+ size: _zod.z.number(),
130
+ maxSize: _zod.z.number(),
131
+ /** `true` if `?limit=N` truncated the message list below `size`. */
132
+ truncated: _zod.z.boolean(),
133
+ messages: _zod.z.array(InspectorQueueMessageSchema)
134
+ });
135
+ var InspectorTabConfigResponseSchema = _zod.z.object({
136
+ tabs: _zod.z.array(
137
+ _zod.z.object({
138
+ id: _zod.z.string(),
139
+ label: _zod.z.string().optional(),
140
+ icon: _zod.z.string().nullable().optional(),
141
+ hidden: _zod.z.boolean().optional()
142
+ })
143
+ )
144
+ });
145
+
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+
158
+
159
+
160
+
161
+
162
+
163
+
164
+
165
+
166
+
167
+
168
+
169
+
170
+
171
+
172
+ exports.ACTOR_ID_PARAM = ACTOR_ID_PARAM; exports.ActorInspectorConfigSchema = _chunkNIY3RSPXcjs.ActorInspectorConfigSchema; exports.BUILTIN_INSPECTOR_TAB_IDS = _chunkNIY3RSPXcjs.BUILTIN_INSPECTOR_TAB_IDS; exports.BuiltinInspectorTabIdSchema = _chunkNIY3RSPXcjs.BuiltinInspectorTabIdSchema; exports.CustomInspectorTabEntrySchema = _chunkNIY3RSPXcjs.CustomInspectorTabEntrySchema; exports.HideInspectorTabEntrySchema = _chunkNIY3RSPXcjs.HideInspectorTabEntrySchema; exports.InspectorActionRequestSchema = InspectorActionRequestSchema; exports.InspectorActionResponseSchema = InspectorActionResponseSchema; exports.InspectorConnectionSchema = InspectorConnectionSchema; exports.InspectorConnectionsResponseSchema = InspectorConnectionsResponseSchema; exports.InspectorQueueMessageSchema = InspectorQueueMessageSchema; exports.InspectorQueueResponseSchema = InspectorQueueResponseSchema; exports.InspectorRpcsResponseSchema = InspectorRpcsResponseSchema; exports.InspectorStateResponseSchema = InspectorStateResponseSchema; exports.InspectorTabConfigResponseSchema = InspectorTabConfigResponseSchema; exports.InspectorTabDescriptorSchema = InspectorTabDescriptorSchema; exports.InspectorTabEntrySchema = _chunkNIY3RSPXcjs.InspectorTabEntrySchema; exports.POSTMESSAGE_PROTOCOL_VERSION = POSTMESSAGE_PROTOCOL_VERSION; exports.SHELL_ORIGIN_PARAM = SHELL_ORIGIN_PARAM; exports.ShellToTabMessageSchema = ShellToTabMessageSchema; exports.TabToShellMessageSchema = TabToShellMessageSchema; exports.V1InitSchema = V1InitSchema; exports.V1ReadySchema = V1ReadySchema; exports.V1SetActiveTabSchema = V1SetActiveTabSchema; exports.V1TabsAvailableSchema = V1TabsAvailableSchema; exports.V1TokenRefreshNeededSchema = V1TokenRefreshNeededSchema;
173
+ //# sourceMappingURL=mod.cjs.map
@@ -0,0 +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;AAmDX,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,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA;AAAA;AAAA;A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AAE,MAAA,CAAO;AAAA,MACR,EAAA,EAAI,MAAA,CAAE,MAAA,CAAO,CAAA;AAAA,MACb,KAAA,EAAO,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA,MAC3B,IAAA,EAAM,MAAA,CAAE,MAAA,CAAO,CAAA,CAAE,QAAA,CAAS,CAAA,CAAE,QAAA,CAAS,CAAA;AAAA,MACrC,MAAA,EAAQ,MAAA,CAAE,OAAA,CAAQ,CAAA,CAAE,QAAA,CAAS;AAAA,IAC9B,CAAC;AAAA,EACF;AACD,CAAC,CAAA;ADpJD;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;AACA;AACF,+rDAAC","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 {\n\tActorInspectorConfigSchema,\n\tBUILTIN_INSPECTOR_TAB_IDS,\n\tBuiltinInspectorTabIdSchema,\n\tCustomInspectorTabEntrySchema,\n\tHideInspectorTabEntrySchema,\n\tInspectorTabEntrySchema,\n} from \"../actor/config\";\nexport type { ActorInspectorConfig } 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| \"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\n/** `GET /inspector/tab-config` response shape. */\nexport const InspectorTabConfigResponseSchema = z.object({\n\ttabs: z.array(\n\t\tz.object({\n\t\t\tid: z.string(),\n\t\t\tlabel: z.string().optional(),\n\t\t\ticon: z.string().nullable().optional(),\n\t\t\thidden: z.boolean().optional(),\n\t\t}),\n\t),\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>;\nexport type InspectorTabConfigResponse = z.infer<\n\ttypeof InspectorTabConfigResponseSchema\n>;\n"]}
@@ -0,0 +1,250 @@
1
+ import { z } from 'zod';
2
+ import { a0 as CustomInspectorTabEntrySchema, ae as HideInspectorTabEntrySchema, af as InspectorTabEntrySchema } from '../config-CZQQ-mso.cjs';
3
+ export { s as ActorInspectorConfig, t as ActorInspectorConfigSchema, U as BUILTIN_INSPECTOR_TAB_IDS, X as BuiltinInspectorTabIdSchema } from '../config-CZQQ-mso.cjs';
4
+ import 'zod/v4';
5
+ import '../config-D49x8NpL.cjs';
6
+ import '@rivetkit/rivetkit-wasm';
7
+ import 'pino';
8
+ import '@rivetkit/virtual-websocket';
9
+ import '@standard-schema/spec';
10
+ import 'hono';
11
+ import '../utils.cjs';
12
+ import '../utils-DQosb24I.cjs';
13
+ import 'hono/utils/http-status';
14
+
15
+ /**
16
+ * Type and schema declarations for custom Rivet inspector tabs.
17
+ *
18
+ * Everything here is **derived from runtime Zod schemas** that the
19
+ * dashboard and rivetkit itself use, so the published types cannot
20
+ * drift from the wire format. There are three sources of truth:
21
+ *
22
+ * 1. The `inspector.tabs[]` actor-config Zod schemas in
23
+ * `../actor/config.ts` — re-exported below. These validate the
24
+ * authoring surface (`defineActor({ inspector: { tabs: [...] } })`).
25
+ * 2. The dashboard ↔ tab postMessage envelopes defined in this file.
26
+ * The inspector-ui SPA (`frontend/apps/inspector-ui/src/bridge.ts`)
27
+ * imports the same schemas to validate messages at runtime, so any
28
+ * change here lands on both ends in lockstep.
29
+ * 3. The inspector HTTP endpoint response schemas defined in this
30
+ * file. The dashboard parses every response through them; if the
31
+ * Rust handler ever emits a different shape, the dashboard fails
32
+ * loudly at the parse step instead of silently casting `unknown`.
33
+ *
34
+ * Tab bundles import these types for autocomplete and compile-time
35
+ * safety:
36
+ *
37
+ * ```ts
38
+ * import type {
39
+ * ShellToTabMessage,
40
+ * TabToShellMessage,
41
+ * V1Init,
42
+ * InspectorStateResponse,
43
+ * } from "rivetkit/inspector-tab";
44
+ * ```
45
+ */
46
+
47
+ /** One entry in the actor's `inspector.tabs[]` declaration. */
48
+ type ActorInspectorTabEntry = z.input<typeof InspectorTabEntrySchema>;
49
+ /** A custom-tab entry — adds a new tab to the dashboard strip. */
50
+ type ActorCustomInspectorTabEntry = z.input<typeof CustomInspectorTabEntrySchema>;
51
+ /** A hide modifier — removes a built-in tab from the strip. */
52
+ type ActorHideInspectorTabEntry = z.input<typeof HideInspectorTabEntrySchema>;
53
+ /** Union of the six built-in inspector tab ids. */
54
+ type BuiltinInspectorTabId = "workflow" | "database" | "state" | "queue" | "connections" | "console";
55
+ /** Public tab descriptor that crosses the dashboard ↔ inspector-ui bridge. */
56
+ declare const InspectorTabDescriptorSchema: z.ZodObject<{
57
+ id: z.ZodString;
58
+ label: z.ZodString;
59
+ icon: z.ZodString;
60
+ isCustom: z.ZodOptional<z.ZodBoolean>;
61
+ }, z.core.$strip>;
62
+ /**
63
+ * Initial handshake from the dashboard. Sent on first mount and again on
64
+ * every token refresh. Tabs MUST accept late `init` messages and replace
65
+ * the cached token.
66
+ */
67
+ declare const V1InitSchema: z.ZodObject<{
68
+ type: z.ZodLiteral<"init">;
69
+ v: z.ZodLiteral<1>;
70
+ actorId: z.ZodString;
71
+ authToken: z.ZodString;
72
+ rivetToken: z.ZodOptional<z.ZodString>;
73
+ activeTab: z.ZodOptional<z.ZodString>;
74
+ theme: z.ZodOptional<z.ZodEnum<{
75
+ light: "light";
76
+ dark: "dark";
77
+ }>>;
78
+ }, z.core.$strip>;
79
+ /**
80
+ * Dashboard tells the inspector-ui SPA which built-in tab to render. Not
81
+ * sent to custom tabs — when the user activates a custom tab the
82
+ * dashboard navigates the outer iframe to a different `src`.
83
+ */
84
+ declare const V1SetActiveTabSchema: z.ZodObject<{
85
+ type: z.ZodLiteral<"set-active-tab">;
86
+ v: z.ZodLiteral<1>;
87
+ tab: z.ZodString;
88
+ }, z.core.$strip>;
89
+ /**
90
+ * Tab → dashboard. Sent once after the message listener is registered.
91
+ * The dashboard hides the "Connecting to inspector…" overlay on receipt;
92
+ * if it never arrives the overlay times out after 8 s.
93
+ */
94
+ declare const V1ReadySchema: z.ZodObject<{
95
+ type: z.ZodLiteral<"ready">;
96
+ v: z.ZodLiteral<1>;
97
+ }, z.core.$strip>;
98
+ /**
99
+ * Tab → dashboard. Sent when the tab gets a 401 on an inspector data
100
+ * call. The dashboard refreshes the token and re-issues `v1Init`.
101
+ */
102
+ declare const V1TokenRefreshNeededSchema: z.ZodObject<{
103
+ type: z.ZodLiteral<"token-refresh-needed">;
104
+ v: z.ZodLiteral<1>;
105
+ }, z.core.$strip>;
106
+ /**
107
+ * Emitted by the inspector-ui SPA to tell the dashboard which tabs to
108
+ * render in the strip. Custom tab bundles do NOT emit this — only the
109
+ * SPA does.
110
+ */
111
+ declare const V1TabsAvailableSchema: z.ZodObject<{
112
+ type: z.ZodLiteral<"tabs-available">;
113
+ v: z.ZodLiteral<1>;
114
+ tabs: z.ZodArray<z.ZodObject<{
115
+ id: z.ZodString;
116
+ label: z.ZodString;
117
+ icon: z.ZodString;
118
+ isCustom: z.ZodOptional<z.ZodBoolean>;
119
+ }, z.core.$strip>>;
120
+ }, z.core.$strip>;
121
+ /** Discriminated union of messages a tab can RECEIVE from the dashboard. */
122
+ declare const ShellToTabMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
123
+ type: z.ZodLiteral<"init">;
124
+ v: z.ZodLiteral<1>;
125
+ actorId: z.ZodString;
126
+ authToken: z.ZodString;
127
+ rivetToken: z.ZodOptional<z.ZodString>;
128
+ activeTab: z.ZodOptional<z.ZodString>;
129
+ theme: z.ZodOptional<z.ZodEnum<{
130
+ light: "light";
131
+ dark: "dark";
132
+ }>>;
133
+ }, z.core.$strip>, z.ZodObject<{
134
+ type: z.ZodLiteral<"set-active-tab">;
135
+ v: z.ZodLiteral<1>;
136
+ tab: z.ZodString;
137
+ }, z.core.$strip>], "type">;
138
+ /** Discriminated union of messages a tab can SEND to the dashboard. */
139
+ declare const TabToShellMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
140
+ type: z.ZodLiteral<"ready">;
141
+ v: z.ZodLiteral<1>;
142
+ }, z.core.$strip>, z.ZodObject<{
143
+ type: z.ZodLiteral<"tabs-available">;
144
+ v: z.ZodLiteral<1>;
145
+ tabs: z.ZodArray<z.ZodObject<{
146
+ id: z.ZodString;
147
+ label: z.ZodString;
148
+ icon: z.ZodString;
149
+ isCustom: z.ZodOptional<z.ZodBoolean>;
150
+ }, z.core.$strip>>;
151
+ }, z.core.$strip>, z.ZodObject<{
152
+ type: z.ZodLiteral<"token-refresh-needed">;
153
+ v: z.ZodLiteral<1>;
154
+ }, z.core.$strip>], "type">;
155
+ type InspectorTabDescriptor = z.infer<typeof InspectorTabDescriptorSchema>;
156
+ type V1Init = z.infer<typeof V1InitSchema>;
157
+ type V1SetActiveTab = z.infer<typeof V1SetActiveTabSchema>;
158
+ type V1Ready = z.infer<typeof V1ReadySchema>;
159
+ type V1TokenRefreshNeeded = z.infer<typeof V1TokenRefreshNeededSchema>;
160
+ type V1TabsAvailable = z.infer<typeof V1TabsAvailableSchema>;
161
+ type ShellToTabMessage = z.infer<typeof ShellToTabMessageSchema>;
162
+ type TabToShellMessage = z.infer<typeof TabToShellMessageSchema>;
163
+ /** Stable envelope protocol version. Bump only when introducing a v2 shape. */
164
+ declare const POSTMESSAGE_PROTOCOL_VERSION = 1;
165
+ /** URL query parameters the dashboard sets on the tab iframe `src`. */
166
+ declare const SHELL_ORIGIN_PARAM = "shellOrigin";
167
+ declare const ACTOR_ID_PARAM = "actorId";
168
+ /** `GET /inspector/state` response shape. */
169
+ declare const InspectorStateResponseSchema: z.ZodObject<{
170
+ state: z.ZodUnknown;
171
+ isStateEnabled: z.ZodBoolean;
172
+ }, z.core.$strip>;
173
+ /** `POST /inspector/action/<name>` request body. */
174
+ declare const InspectorActionRequestSchema: z.ZodObject<{
175
+ args: z.ZodOptional<z.ZodArray<z.ZodUnknown>>;
176
+ properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
177
+ }, z.core.$strip>;
178
+ /** `POST /inspector/action/<name>` response shape. */
179
+ declare const InspectorActionResponseSchema: z.ZodObject<{
180
+ output: z.ZodUnknown;
181
+ }, z.core.$strip>;
182
+ /** `GET /inspector/rpcs` response shape — the list of action names. */
183
+ declare const InspectorRpcsResponseSchema: z.ZodObject<{
184
+ rpcs: z.ZodArray<z.ZodString>;
185
+ }, z.core.$strip>;
186
+ /** One connection record in `GET /inspector/connections`. */
187
+ declare const InspectorConnectionSchema: z.ZodObject<{
188
+ connectionType: z.ZodNullable<z.ZodString>;
189
+ id: z.ZodString;
190
+ details: z.ZodObject<{
191
+ connectionType: z.ZodNullable<z.ZodString>;
192
+ params: z.ZodUnknown;
193
+ stateEnabled: z.ZodBoolean;
194
+ state: z.ZodUnknown;
195
+ subscriptions: z.ZodNumber;
196
+ isHibernatable: z.ZodBoolean;
197
+ }, z.core.$strip>;
198
+ }, z.core.$strip>;
199
+ /** `GET /inspector/connections` response shape. */
200
+ declare const InspectorConnectionsResponseSchema: z.ZodObject<{
201
+ connections: z.ZodArray<z.ZodObject<{
202
+ connectionType: z.ZodNullable<z.ZodString>;
203
+ id: z.ZodString;
204
+ details: z.ZodObject<{
205
+ connectionType: z.ZodNullable<z.ZodString>;
206
+ params: z.ZodUnknown;
207
+ stateEnabled: z.ZodBoolean;
208
+ state: z.ZodUnknown;
209
+ subscriptions: z.ZodNumber;
210
+ isHibernatable: z.ZodBoolean;
211
+ }, z.core.$strip>;
212
+ }, z.core.$strip>>;
213
+ }, z.core.$strip>;
214
+ /** One queued message in `GET /inspector/queue`. */
215
+ declare const InspectorQueueMessageSchema: z.ZodObject<{
216
+ id: z.ZodString;
217
+ name: z.ZodString;
218
+ createdAtMs: z.ZodNumber;
219
+ }, z.core.$strip>;
220
+ /** `GET /inspector/queue` response shape. */
221
+ declare const InspectorQueueResponseSchema: z.ZodObject<{
222
+ size: z.ZodNumber;
223
+ maxSize: z.ZodNumber;
224
+ truncated: z.ZodBoolean;
225
+ messages: z.ZodArray<z.ZodObject<{
226
+ id: z.ZodString;
227
+ name: z.ZodString;
228
+ createdAtMs: z.ZodNumber;
229
+ }, z.core.$strip>>;
230
+ }, z.core.$strip>;
231
+ /** `GET /inspector/tab-config` response shape. */
232
+ declare const InspectorTabConfigResponseSchema: z.ZodObject<{
233
+ tabs: z.ZodArray<z.ZodObject<{
234
+ id: z.ZodString;
235
+ label: z.ZodOptional<z.ZodString>;
236
+ icon: z.ZodOptional<z.ZodNullable<z.ZodString>>;
237
+ hidden: z.ZodOptional<z.ZodBoolean>;
238
+ }, z.core.$strip>>;
239
+ }, z.core.$strip>;
240
+ type InspectorStateResponse = z.infer<typeof InspectorStateResponseSchema>;
241
+ type InspectorActionRequest = z.infer<typeof InspectorActionRequestSchema>;
242
+ type InspectorActionResponse = z.infer<typeof InspectorActionResponseSchema>;
243
+ type InspectorRpcsResponse = z.infer<typeof InspectorRpcsResponseSchema>;
244
+ type InspectorConnection = z.infer<typeof InspectorConnectionSchema>;
245
+ type InspectorConnectionsResponse = z.infer<typeof InspectorConnectionsResponseSchema>;
246
+ type InspectorQueueMessage = z.infer<typeof InspectorQueueMessageSchema>;
247
+ type InspectorQueueResponse = z.infer<typeof InspectorQueueResponseSchema>;
248
+ type InspectorTabConfigResponse = z.infer<typeof InspectorTabConfigResponseSchema>;
249
+
250
+ export { ACTOR_ID_PARAM, type ActorCustomInspectorTabEntry, type ActorHideInspectorTabEntry, type ActorInspectorTabEntry, type BuiltinInspectorTabId, CustomInspectorTabEntrySchema, HideInspectorTabEntrySchema, type InspectorActionRequest, InspectorActionRequestSchema, type InspectorActionResponse, InspectorActionResponseSchema, type InspectorConnection, InspectorConnectionSchema, type InspectorConnectionsResponse, InspectorConnectionsResponseSchema, type InspectorQueueMessage, InspectorQueueMessageSchema, type InspectorQueueResponse, InspectorQueueResponseSchema, type InspectorRpcsResponse, InspectorRpcsResponseSchema, type InspectorStateResponse, InspectorStateResponseSchema, type InspectorTabConfigResponse, InspectorTabConfigResponseSchema, type InspectorTabDescriptor, InspectorTabDescriptorSchema, InspectorTabEntrySchema, POSTMESSAGE_PROTOCOL_VERSION, SHELL_ORIGIN_PARAM, type ShellToTabMessage, ShellToTabMessageSchema, type TabToShellMessage, TabToShellMessageSchema, type V1Init, V1InitSchema, type V1Ready, V1ReadySchema, type V1SetActiveTab, V1SetActiveTabSchema, type V1TabsAvailable, V1TabsAvailableSchema, type V1TokenRefreshNeeded, V1TokenRefreshNeededSchema };