@smithers-orchestrator/server 0.16.9 → 0.18.0

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.
@@ -273,9 +273,9 @@ export async function getNodeDiffRoute({
273
273
  emitEffect = (effect) => runPromise(effect),
274
274
  computeDiffBundleImpl,
275
275
  computeDiffBundleBetweenRefsImpl,
276
- getCurrentPointerImpl,
276
+ getCurrentPointerImpl: _getCurrentPointerImpl,
277
277
  resolveCommitPointerImpl = resolveCommitPointer,
278
- restorePointerImpl,
278
+ restorePointerImpl: _restorePointerImpl,
279
279
  nowMs = () => Date.now(),
280
280
  // stat: true → return summary only ({ files, filesChanged, added,
281
281
  // removed }). Bypasses the cache and the full-bundle JSON size guard
@@ -292,7 +292,6 @@ export async function getNodeDiffRoute({
292
292
  ? async (baseRef, _targetRef, cwd, seq) => computeDiffBundleImpl(baseRef, cwd, seq)
293
293
  : computeDiffBundleBetweenRefs);
294
294
  let resultLabel = "error";
295
- let cacheResultLabel = "miss";
296
295
  let sizeBytes = 0;
297
296
  let computeDurationMs = 0;
298
297
  const rootSpanAttrs = {
@@ -380,7 +379,6 @@ export async function getNodeDiffRoute({
380
379
  const recordCacheResult = async (cacheResult, bytes) => {
381
380
  sizeBytes = bytes;
382
381
  resultLabel = cacheResult;
383
- cacheResultLabel = cacheResult;
384
382
  rootSpanAttrs.cacheResult = cacheResult;
385
383
  await swallow(() => emitEffect(Effect.all([
386
384
  Metric.increment(taggedMetric(nodeDiffCacheTotal, { result: cacheResult })),
@@ -0,0 +1,47 @@
1
+ import { Hono } from "hono";
2
+
3
+ /**
4
+ * @typedef {{
5
+ * pathname: string;
6
+ * mountPath: string;
7
+ * assetPath: string | null;
8
+ * config: Record<string, unknown>;
9
+ * }} GatewayUiMatch
10
+ */
11
+
12
+ /**
13
+ * @param {{
14
+ * resolveMatch: (pathname: string) => GatewayUiMatch | null;
15
+ * renderIndex: (match: GatewayUiMatch) => string;
16
+ * renderAsset: (match: GatewayUiMatch) => Promise<{ body: string; contentType: string } | null>;
17
+ * }} options
18
+ */
19
+ export function createGatewayUiApp(options) {
20
+ const app = new Hono();
21
+ app.get("*", async (c) => {
22
+ const url = new URL(c.req.url);
23
+ const match = options.resolveMatch(url.pathname);
24
+ if (!match) {
25
+ return new Response("Not Found", {
26
+ status: 404,
27
+ headers: { "x-smithers-ui-miss": "1" },
28
+ });
29
+ }
30
+ if (match.assetPath) {
31
+ const asset = await options.renderAsset(match);
32
+ if (!asset) {
33
+ return c.text("Not Found", 404);
34
+ }
35
+ return c.body(asset.body, 200, {
36
+ "Content-Type": asset.contentType,
37
+ "Cache-Control": "no-store",
38
+ "X-Content-Type-Options": "nosniff",
39
+ });
40
+ }
41
+ return c.html(options.renderIndex(match), 200, {
42
+ "Cache-Control": "no-store",
43
+ "X-Content-Type-Options": "nosniff",
44
+ });
45
+ });
46
+ return app;
47
+ }
package/src/index.d.ts CHANGED
@@ -1,22 +1,22 @@
1
- import * as _smithers_db_adapter_RunRow from '@smithers-orchestrator/db/adapter/RunRow';
1
+ import * as _smithers_orchestrator_db_adapter_RunRow from '@smithers-orchestrator/db/adapter/RunRow';
2
2
  import * as node_http from 'node:http';
3
- import { IncomingMessage as IncomingMessage$1, ServerResponse as ServerResponse$1 } from 'node:http';
4
- import * as _smithers_observability_SmithersEvent from '@smithers-orchestrator/observability/SmithersEvent';
5
- import * as _smithers_components_SmithersWorkflow from '@smithers-orchestrator/components/SmithersWorkflow';
3
+ import * as _smithers_orchestrator_observability_SmithersEvent from '@smithers-orchestrator/observability/SmithersEvent';
4
+ import * as _smithers_orchestrator_components_SmithersWorkflow from '@smithers-orchestrator/components/SmithersWorkflow';
6
5
  import { SmithersWorkflow as SmithersWorkflow$1 } from '@smithers-orchestrator/components/SmithersWorkflow';
6
+ import * as hono from 'hono';
7
+ import { Hono } from 'hono';
8
+ import * as hono_types from 'hono/types';
7
9
  import { Effect } from 'effect';
8
- import * as _smithers_db_adapter from '@smithers-orchestrator/db/adapter';
10
+ import * as _smithers_orchestrator_db_adapter from '@smithers-orchestrator/db/adapter';
9
11
  import { SmithersDb as SmithersDb$4 } from '@smithers-orchestrator/db/adapter';
10
- import * as hono_types from 'hono/types';
11
- import { Hono } from 'hono';
12
12
  import * as effect_Fiber from 'effect/Fiber';
13
- import * as _smithers_protocol_errors from '@smithers-orchestrator/protocol/errors';
14
- import * as _smithers_devtools_snapshotSerializer from '@smithers-orchestrator/devtools/snapshotSerializer';
15
- import * as _smithers_protocol_devtools from '@smithers-orchestrator/protocol/devtools';
16
- import * as _smithers_engine_effect_DiffBundle from '@smithers-orchestrator/engine/effect/DiffBundle';
13
+ import * as _smithers_orchestrator_protocol_errors from '@smithers-orchestrator/protocol/errors';
14
+ import * as _smithers_orchestrator_devtools_snapshotSerializer from '@smithers-orchestrator/devtools/snapshotSerializer';
15
+ import * as _smithers_orchestrator_protocol_devtools from '@smithers-orchestrator/protocol/devtools';
16
+ import * as _smithers_orchestrator_engine_effect_DiffBundle from '@smithers-orchestrator/engine/effect/DiffBundle';
17
17
  import { DiffBundle } from '@smithers-orchestrator/engine/effect/DiffBundle';
18
18
  import { selectOutputRow } from '@smithers-orchestrator/db/output';
19
- import * as _smithers_time_travel_jumpToFrame from '@smithers-orchestrator/time-travel/jumpToFrame';
19
+ import * as _smithers_orchestrator_time_travel_jumpToFrame from '@smithers-orchestrator/time-travel/jumpToFrame';
20
20
  export { JumpToFrameError } from '@smithers-orchestrator/time-travel/jumpToFrame';
21
21
 
22
22
  type ServerOptions$1 = {
@@ -26,16 +26,33 @@ type ServerOptions$1 = {
26
26
  maxBodyBytes?: number;
27
27
  rootDir?: string;
28
28
  allowNetwork?: boolean;
29
+ /**
30
+ * Maximum time (in milliseconds) allowed for the HTTP parser to receive the
31
+ * complete headers of a single request. Helps mitigate slowloris attacks.
32
+ * @default 30000
33
+ */
34
+ headersTimeout?: number;
35
+ /**
36
+ * Maximum time (in milliseconds) allowed for a single request to be received
37
+ * and parsed, including the body. Helps mitigate slowloris attacks.
38
+ * @default 60000
39
+ */
40
+ requestTimeout?: number;
29
41
  };
30
42
 
31
43
  type ResponseFrame$1 = {
32
44
  type: "res";
33
45
  id: string;
34
46
  ok: boolean;
47
+ apiVersion?: "v1";
35
48
  payload?: unknown;
36
49
  error?: {
50
+ version?: "v1";
37
51
  code: string;
38
52
  message: string;
53
+ requiredScope?: string;
54
+ refresh?: string;
55
+ details?: unknown;
39
56
  };
40
57
  };
41
58
 
@@ -70,6 +87,10 @@ type GatewayTokenGrant$1 = {
70
87
  role: string;
71
88
  scopes: string[];
72
89
  userId?: string;
90
+ tokenId?: string;
91
+ issuedAtMs?: number;
92
+ expiresAtMs?: number;
93
+ revokedAtMs?: number;
73
94
  };
74
95
 
75
96
  type GatewayAuthConfig$1 = {
@@ -98,15 +119,54 @@ type GatewayDefaults$1 = {
98
119
  cliAgentTools?: "all" | "explicit-only";
99
120
  };
100
121
 
122
+ type GatewayUiConfig$1 = {
123
+ /**
124
+ * Browser entry module for the React app. Smithers bundles this with Bun and
125
+ * serves it from the Gateway origin.
126
+ */
127
+ entry: string;
128
+ /**
129
+ * URL path where the UI is mounted. Gateway-level UI defaults to `/`;
130
+ * workflow-level UI defaults to `/workflows/<workflowKey>`.
131
+ */
132
+ path?: string;
133
+ /**
134
+ * Document title for the generated HTML shell.
135
+ */
136
+ title?: string;
137
+ /**
138
+ * JSON-serializable boot data exposed to the browser.
139
+ */
140
+ props?: Record<string, unknown>;
141
+ };
142
+
101
143
  type GatewayOptions$1 = {
102
144
  protocol?: number;
103
145
  features?: string[];
104
146
  heartbeatMs?: number;
105
147
  auth?: GatewayAuthConfig$1;
148
+ ui?: GatewayUiConfig$1;
106
149
  defaults?: GatewayDefaults$1;
107
150
  maxBodyBytes?: number;
108
151
  maxPayload?: number;
109
152
  maxConnections?: number;
153
+ /**
154
+ * Per-run replay window for Gateway run event streams.
155
+ * @default 10000
156
+ */
157
+ eventWindowSize?: number;
158
+ /**
159
+ * Maximum time (in milliseconds) allowed for the HTTP parser to receive the
160
+ * complete headers of a single request. Helps mitigate slowloris attacks.
161
+ * @default 30000
162
+ */
163
+ headersTimeout?: number;
164
+ /**
165
+ * Maximum time (in milliseconds) allowed for a single request to be received
166
+ * and parsed, including the body. Helps mitigate slowloris attacks.
167
+ * @default 60000
168
+ */
169
+ requestTimeout?: number;
110
170
  };
111
171
 
112
172
  type ConnectRequest$1 = {
@@ -144,12 +204,19 @@ type HelloResponse$1 = {
144
204
  };
145
205
  };
146
206
 
207
+ type GatewayRegisterOptions$1 = {
208
+ schedule?: string;
209
+ webhook?: GatewayWebhookConfig$1;
210
+ ui?: GatewayUiConfig$1;
211
+ };
212
+
147
213
  type EventFrame$1 = {
148
214
  type: "event";
149
215
  event: string;
150
216
  payload?: unknown;
151
217
  seq: number;
152
218
  stateVersion: number;
219
+ apiVersion?: "v1";
153
220
  };
154
221
 
155
222
  /**
@@ -175,7 +242,7 @@ declare function assertGatewayInputDepthWithinBounds(value: unknown, maxDepth?:
175
242
  /**
176
243
  * @param {string | undefined} code
177
244
  */
178
- declare function statusForRpcError(code: string | undefined): 401 | 403 | 404 | 400 | 409 | 413 | 429 | 501 | 500;
245
+ declare function statusForRpcError(code: string | undefined): 400 | 401 | 403 | 404 | 409 | 429 | 413 | 501 | 500;
179
246
  declare const GATEWAY_RPC_MAX_PAYLOAD_BYTES: 1048576;
180
247
  declare const GATEWAY_RPC_MAX_DEPTH: 32;
181
248
  declare const GATEWAY_RPC_MAX_ARRAY_LENGTH: 256;
@@ -195,7 +262,12 @@ declare class Gateway {
195
262
  maxBodyBytes: number;
196
263
  maxPayload: number;
197
264
  maxConnections: number;
265
+ eventWindowSize: number;
266
+ headersTimeout: number;
267
+ requestTimeout: number;
198
268
  auth: GatewayAuthConfig$1 | undefined;
269
+ ui: ResolvedGatewayUiConfig | null;
270
+ uiApp: hono.Hono<hono_types.BlankEnv, hono_types.BlankSchema, "/">;
199
271
  defaults: GatewayDefaults$1 | undefined;
200
272
  workflows: Map<any, any>;
201
273
  connections: Set<any>;
@@ -203,15 +275,95 @@ declare class Gateway {
203
275
  activeRuns: Map<any, any>;
204
276
  inflightRuns: Map<any, any>;
205
277
  devtoolsSubscribers: Map<any, any>;
278
+ runEventWindows: Map<any, any>;
206
279
  /** Absolute active subscriber count per runId (gauge source of truth). */
207
280
  devtoolsSubscriberCounts: Map<any, any>;
208
281
  /** Flagged subscriber IDs that should force a snapshot on their next emit. */
209
282
  devtoolsInvalidateFlags: Set<any>;
283
+ uiAssetCache: Map<any, any>;
210
284
  server: null;
211
285
  wsServer: null;
212
286
  schedulerTimer: null;
213
287
  stateVersion: number;
214
288
  startedAtMs: number;
289
+ /**
290
+ * @returns {GatewayUiMount[]}
291
+ */
292
+ getUiMounts(): GatewayUiMount[];
293
+ /**
294
+ * @param {string} pathname
295
+ * @returns {GatewayUiMount | null}
296
+ */
297
+ findUiMount(pathname: string): GatewayUiMount | null;
298
+ /**
299
+ * @param {string} pathname
300
+ */
301
+ resolveUiMatch(pathname: string): {
302
+ pathname: string;
303
+ mountPath: string;
304
+ assetPath: string | null;
305
+ config: GatewayUiMount;
306
+ } | null;
307
+ /**
308
+ * @param {GatewayUiMount} mount
309
+ */
310
+ uiBootConfig(mount: GatewayUiMount): {
311
+ apiVersion: "v1";
312
+ kind: "workflow" | "gateway";
313
+ workflowKey: string | null;
314
+ mountPath: string;
315
+ rpcPath: string;
316
+ wsPath: string;
317
+ assetBasePath: string;
318
+ props: Record<string, unknown>;
319
+ };
320
+ /**
321
+ * @param {{ config: GatewayUiMount }} match
322
+ */
323
+ renderUiIndex(match: {
324
+ config: GatewayUiMount;
325
+ }): string;
326
+ /**
327
+ * @param {{ config: GatewayUiMount; assetPath: string | null }} match
328
+ */
329
+ renderUiAsset(match: {
330
+ config: GatewayUiMount;
331
+ assetPath: string | null;
332
+ }): Promise<{
333
+ body: string;
334
+ contentType: string;
335
+ } | null>;
336
+ /**
337
+ * @param {ResolvedGatewayUiConfig} config
338
+ * @returns {Promise<string>}
339
+ */
340
+ bundleUiEntry(config: ResolvedGatewayUiConfig): Promise<string>;
341
+ /**
342
+ * @param {IncomingMessage} req
343
+ * @param {ServerResponse} res
344
+ */
345
+ handleUiHttp(req: IncomingMessage, res: ServerResponse$1): Promise<boolean>;
346
+ /**
347
+ * @param {string} key
348
+ * @param {RegisteredWorkflow} entry
349
+ */
350
+ workflowSummary(key: string, entry: RegisteredWorkflow): {
351
+ hasUi: boolean;
352
+ uiPath: string | null;
353
+ description?: string | undefined;
354
+ readableName?: string | undefined;
355
+ key: string;
356
+ };
357
+ /**
358
+ * @param {boolean | undefined} hasUi
359
+ */
360
+ listWorkflowSummaries(hasUi: boolean | undefined): {
361
+ hasUi: boolean;
362
+ uiPath: string | null;
363
+ description?: string | undefined;
364
+ readableName?: string | undefined;
365
+ key: string;
366
+ }[];
215
367
  authModeLabel(): string;
216
368
  /**
217
369
  * @param {string} [runId]
@@ -269,6 +421,61 @@ declare class Gateway {
269
421
  */
270
422
  cleanupDevToolsSubscribers(connection: ConnectionState): void;
271
423
  /**
424
+ * @param {string} runId
425
+ * @returns {{ nextSeq: number; window: Array<Record<string, unknown>> }}
426
+ */
427
+ getRunEventWindow(runId: string): {
428
+ nextSeq: number;
429
+ window: Array<Record<string, unknown>>;
430
+ };
431
+ /**
432
+ * @param {string} event
433
+ * @param {unknown} payload
434
+ * @param {number} stateVersion
435
+ * @returns {Record<string, unknown> | null}
436
+ */
437
+ appendRunEventWindow(event: string, payload: unknown, stateVersion: number): Record<string, unknown> | null;
438
+ /**
439
+ * @param {string} runId
440
+ * @returns {number}
441
+ */
442
+ getRunEventCurrentSeq(runId: string): number;
443
+ /**
444
+ * @param {ConnectionState} connection
445
+ * @param {string} streamId
446
+ * @param {string} runId
447
+ * @returns {() => void}
448
+ */
449
+ registerRunEventSubscriber(connection: ConnectionState, streamId: string, runId: string): () => void;
450
+ /**
451
+ * @param {ConnectionState} connection
452
+ * @param {string} streamId
453
+ */
454
+ unregisterRunEventSubscriber(connection: ConnectionState, streamId: string): void;
455
+ /**
456
+ * @param {ConnectionState} connection
457
+ */
458
+ cleanupRunEventSubscribers(connection: ConnectionState): void;
459
+ /**
460
+ * @param {ConnectionState} connection
461
+ * @param {string} streamId
462
+ * @param {Record<string, unknown>} frame
463
+ */
464
+ sendRunEventStreamFrame(connection: ConnectionState, streamId: string, frame: Record<string, unknown>): void;
465
+ /**
466
+ * @param {ConnectionState} connection
467
+ * @param {string} streamId
468
+ * @param {string} runId
469
+ * @param {number} fromSeq
470
+ * @param {number} toSeq
471
+ * @param {unknown} snapshot
472
+ */
473
+ sendRunGapResync(connection: ConnectionState, streamId: string, runId: string, fromSeq: number, toSeq: number, snapshot: unknown): void;
474
+ /**
475
+ * @param {string} runId
476
+ */
477
+ buildRunSnapshot(runId: string): Promise<any>;
478
+ /**
272
479
  * @param {GatewayTransport} transport
273
480
  * @param {string} frameType
274
481
  * @param {GatewayMetricLabels} [labels]
@@ -307,7 +514,7 @@ declare class Gateway {
307
514
  * @param {number} status
308
515
  * @param {ResponseFrame} response
309
516
  */
310
- sendHttpRpcResponse(res: ServerResponse, status: number, response: ResponseFrame): void;
517
+ sendHttpRpcResponse(res: ServerResponse$1, status: number, response: ResponseFrame): void;
311
518
  /**
312
519
  * @param {SmithersDb} adapter
313
520
  * @param {string} runId
@@ -327,17 +534,14 @@ declare class Gateway {
327
534
  * @param {ServerResponse} res
328
535
  * @param {string} workflowKey
329
536
  */
330
- handleWebhook(req: IncomingMessage, res: ServerResponse, workflowKey: string): Promise<void>;
537
+ handleWebhook(req: IncomingMessage, res: ServerResponse$1, workflowKey: string): Promise<void>;
331
538
  /**
332
539
  * @param {string} key
333
540
  * @param {SmithersWorkflow} workflow
334
- * @param {{ schedule?: string; webhook?: GatewayWebhookConfig }} [options]
541
+ * @param {GatewayRegisterOptions} [options]
335
542
  * @returns {this}
336
543
  */
337
- register(key: string, workflow: SmithersWorkflow, options?: {
338
- schedule?: string;
339
- webhook?: GatewayWebhookConfig;
340
- }): this;
544
+ register(key: string, workflow: SmithersWorkflow, options?: GatewayRegisterOptions): this;
341
545
  /**
342
546
  * @param {{ port?: number; host?: string }} [options]
343
547
  */
@@ -419,8 +623,9 @@ declare class Gateway {
419
623
  /**
420
624
  * @param {IncomingMessage} req
421
625
  * @param {ServerResponse} res
626
+ * @param {string} [forcedMethod]
422
627
  */
423
- handleHttpRpc(req: IncomingMessage, res: ServerResponse): Promise<void>;
628
+ handleHttpRpc(req: IncomingMessage, res: ServerResponse$1, forcedMethod?: string): Promise<void>;
424
629
  /**
425
630
  * @param {ConnectionState} connection
426
631
  * @param {ResponseFrame} frame
@@ -441,6 +646,7 @@ declare class Gateway {
441
646
  runs: any[];
442
647
  approvals: {
443
648
  runId: any;
649
+ workflowKey: any;
444
650
  nodeId: any;
445
651
  iteration: any;
446
652
  requestTitle: any;
@@ -465,6 +671,7 @@ declare class Gateway {
465
671
  listRunsAcrossWorkflows(limit?: number, status?: string): Promise<any[]>;
466
672
  listPendingApprovals(): Promise<{
467
673
  runId: any;
674
+ workflowKey: any;
468
675
  nodeId: any;
469
676
  iteration: any;
470
677
  requestTitle: any;
@@ -511,7 +718,9 @@ declare class Gateway {
511
718
  }
512
719
  type EventFrame = EventFrame$1;
513
720
  type GatewayDefaults = GatewayDefaults$1;
721
+ type GatewayRegisterOptions = GatewayRegisterOptions$1;
514
722
  type GatewayTokenGrant = GatewayTokenGrant$1;
723
+ type GatewayUiConfig = GatewayUiConfig$1;
515
724
  type HelloResponse = HelloResponse$1;
516
725
  type GatewayWebhookRunConfig = GatewayWebhookRunConfig$1;
517
726
  type GatewayWebhookSignalConfig = GatewayWebhookSignalConfig$1;
@@ -522,9 +731,9 @@ type GatewayWebhookConfig = GatewayWebhookConfig$1;
522
731
  type IncomingMessage = node_http.IncomingMessage;
523
732
  type RequestFrame = RequestFrame$1;
524
733
  type ResponseFrame = ResponseFrame$1;
525
- type ServerResponse = node_http.ServerResponse;
526
- type SmithersWorkflow = _smithers_components_SmithersWorkflow.SmithersWorkflow<unknown>;
527
- type SmithersEvent$1 = _smithers_observability_SmithersEvent.SmithersEvent;
734
+ type ServerResponse$1 = node_http.ServerResponse;
735
+ type SmithersWorkflow = _smithers_orchestrator_components_SmithersWorkflow.SmithersWorkflow<unknown>;
736
+ type SmithersEvent$1 = _smithers_orchestrator_observability_SmithersEvent.SmithersEvent;
528
737
  type GatewayMetricLabels = Record<string, string | number | null | undefined>;
529
738
  type GatewayTransport = "ws" | "http";
530
739
  type GatewayRequestContext = {
@@ -532,6 +741,7 @@ type GatewayRequestContext = {
532
741
  role?: string;
533
742
  scopes?: string[];
534
743
  userId?: string | null;
744
+ tokenId?: string | null;
535
745
  origin?: string;
536
746
  transport?: GatewayTransport;
537
747
  };
@@ -550,6 +760,7 @@ type RunStartAuthContext = {
550
760
  role: string;
551
761
  scopes: string[];
552
762
  userId?: string | null;
763
+ tokenId?: string | null;
553
764
  connectionId?: string;
554
765
  };
555
766
  type RegisteredWorkflow = {
@@ -558,6 +769,7 @@ type RegisteredWorkflow = {
558
769
  key: string;
559
770
  schedule?: string;
560
771
  webhook?: GatewayWebhookConfig;
772
+ ui?: ResolvedGatewayUiConfig | null;
561
773
  };
562
774
  type ResolvedRun = {
563
775
  runId: string;
@@ -565,6 +777,17 @@ type ResolvedRun = {
565
777
  workflow: SmithersWorkflow;
566
778
  adapter: SmithersDb$4;
567
779
  };
780
+ type ResolvedGatewayUiConfig = {
781
+ entry: string;
782
+ path: string;
783
+ title?: string;
784
+ props?: Record<string, unknown>;
785
+ };
786
+ type GatewayUiMount = {
787
+ kind: "gateway" | "workflow";
788
+ workflowKey: string | null;
789
+ config: ResolvedGatewayUiConfig;
790
+ };
568
791
 
569
792
  type ServeOptions$1 = {
570
793
  workflow: SmithersWorkflow$1<unknown>;
@@ -614,7 +837,7 @@ declare class NodeOutputRouteError extends Error {
614
837
  /** @type {NodeOutputErrorCode} */
615
838
  code: NodeOutputErrorCode;
616
839
  }
617
- type NodeOutputErrorCode = _smithers_protocol_errors.NodeOutputErrorCode;
840
+ type NodeOutputErrorCode = _smithers_orchestrator_protocol_errors.NodeOutputErrorCode;
618
841
 
619
842
  /**
620
843
  * @returns {DevToolsNode}
@@ -701,11 +924,11 @@ declare class DevToolsRouteError extends Error {
701
924
  hint: string | undefined;
702
925
  }
703
926
  declare const DEVTOOLS_EMPTY_ROOT_ID: 0;
704
- type SmithersDb$3 = _smithers_db_adapter.SmithersDb;
705
- type DevToolsNode = _smithers_protocol_devtools.DevToolsNode;
706
- type DevToolsSnapshot = _smithers_protocol_devtools.DevToolsSnapshot;
707
- type DevToolsNodeType = _smithers_protocol_devtools.DevToolsNodeType;
708
- type SnapshotSerializerWarning$1 = _smithers_devtools_snapshotSerializer.SnapshotSerializerWarning;
927
+ type SmithersDb$3 = _smithers_orchestrator_db_adapter.SmithersDb;
928
+ type DevToolsNode = _smithers_orchestrator_protocol_devtools.DevToolsNode;
929
+ type DevToolsSnapshot = _smithers_orchestrator_protocol_devtools.DevToolsSnapshot;
930
+ type DevToolsNodeType = _smithers_orchestrator_protocol_devtools.DevToolsNodeType;
931
+ type SnapshotSerializerWarning$1 = _smithers_orchestrator_devtools_snapshotSerializer.SnapshotSerializerWarning;
709
932
 
710
933
  type DiffSummary$1 = {
711
934
  filesChanged: number;
@@ -752,7 +975,7 @@ type GetNodeDiffRouteResult$1 = {
752
975
  * }} opts
753
976
  * @returns {Promise<GetNodeDiffRouteResult>}
754
977
  */
755
- declare function getNodeDiffRoute({ runId: rawRunId, nodeId: rawNodeId, iteration: rawIteration, resolveRun, emitEffect, computeDiffBundleImpl, computeDiffBundleBetweenRefsImpl, getCurrentPointerImpl, resolveCommitPointerImpl, restorePointerImpl, nowMs, stat, }: {
978
+ declare function getNodeDiffRoute({ runId: rawRunId, nodeId: rawNodeId, iteration: rawIteration, resolveRun, emitEffect, computeDiffBundleImpl, computeDiffBundleBetweenRefsImpl, getCurrentPointerImpl: _getCurrentPointerImpl, resolveCommitPointerImpl, restorePointerImpl: _restorePointerImpl, nowMs, stat, }: {
756
979
  runId: unknown;
757
980
  nodeId: unknown;
758
981
  iteration: unknown;
@@ -760,8 +983,8 @@ declare function getNodeDiffRoute({ runId: rawRunId, nodeId: rawNodeId, iteratio
760
983
  adapter: SmithersDb$2;
761
984
  } | null>;
762
985
  emitEffect?: (effect: Effect.Effect<void>) => Promise<unknown>;
763
- computeDiffBundleImpl?: (baseRef: string, cwd: string, seq?: number) => Promise<_smithers_engine_effect_DiffBundle.DiffBundle>;
764
- computeDiffBundleBetweenRefsImpl?: (baseRef: string, targetRef: string, cwd: string, seq?: number) => Promise<_smithers_engine_effect_DiffBundle.DiffBundle>;
986
+ computeDiffBundleImpl?: (baseRef: string, cwd: string, seq?: number) => Promise<_smithers_orchestrator_engine_effect_DiffBundle.DiffBundle>;
987
+ computeDiffBundleBetweenRefsImpl?: (baseRef: string, targetRef: string, cwd: string, seq?: number) => Promise<_smithers_orchestrator_engine_effect_DiffBundle.DiffBundle>;
765
988
  getCurrentPointerImpl?: (cwd: string) => Promise<string | null>;
766
989
  resolveCommitPointerImpl?: (pointer: string, cwd: string) => Promise<string | null>;
767
990
  restorePointerImpl?: (pointer: string, cwd: string) => Promise<{
@@ -771,8 +994,8 @@ declare function getNodeDiffRoute({ runId: rawRunId, nodeId: rawNodeId, iteratio
771
994
  nowMs?: () => number;
772
995
  stat?: boolean;
773
996
  }): Promise<GetNodeDiffRouteResult>;
774
- type SmithersDb$2 = _smithers_db_adapter.SmithersDb;
775
- type AttemptRow = _smithers_db_adapter.AttemptRow;
997
+ type SmithersDb$2 = _smithers_orchestrator_db_adapter.SmithersDb;
998
+ type AttemptRow = _smithers_orchestrator_db_adapter.AttemptRow;
776
999
  type GetNodeDiffRouteResult = GetNodeDiffRouteResult$1;
777
1000
  type DiffSummary = DiffSummary$1;
778
1001
 
@@ -832,8 +1055,8 @@ declare function getNodeOutputRoute(params: {
832
1055
  nodeId: unknown;
833
1056
  iteration: unknown;
834
1057
  resolveRun: (runId: string) => Promise<{
835
- workflow: _smithers_components_SmithersWorkflow.SmithersWorkflow<unknown>;
836
- adapter: _smithers_db_adapter.SmithersDb;
1058
+ workflow: _smithers_orchestrator_components_SmithersWorkflow.SmithersWorkflow<unknown>;
1059
+ adapter: _smithers_orchestrator_db_adapter.SmithersDb;
837
1060
  } | null>;
838
1061
  selectOutputRowImpl?: typeof selectOutputRow;
839
1062
  emitEffect?: (effect: Effect.Effect<void>) => Promise<unknown>;
@@ -883,9 +1106,9 @@ declare function jumpToFrameRoute(input: {
883
1106
  onLog?: (level: "info" | "warn" | "error", message: string, fields?: Record<string, unknown>) => Promise<void> | void;
884
1107
  }): Promise<JumpResult>;
885
1108
 
886
- type SmithersDb$1 = _smithers_db_adapter.SmithersDb;
887
- type SmithersEvent = _smithers_observability_SmithersEvent.SmithersEvent;
888
- type JumpResult = _smithers_time_travel_jumpToFrame.JumpResult;
1109
+ type SmithersDb$1 = _smithers_orchestrator_db_adapter.SmithersDb;
1110
+ type SmithersEvent = _smithers_orchestrator_observability_SmithersEvent.SmithersEvent;
1111
+ type JumpResult = _smithers_orchestrator_time_travel_jumpToFrame.JumpResult;
889
1112
 
890
1113
  /**
891
1114
  * @param {{
@@ -934,20 +1157,21 @@ declare function streamDevToolsRoute(input: {
934
1157
  declare const DEVTOOLS_REBASELINE_INTERVAL: 50;
935
1158
  declare const DEVTOOLS_BACKPRESSURE_LIMIT: 1000;
936
1159
  declare const DEVTOOLS_POLL_INTERVAL_MS: 25;
937
- type SmithersDb = _smithers_db_adapter.SmithersDb;
938
- type DevToolsEvent = _smithers_protocol_devtools.DevToolsEvent;
939
- type SnapshotSerializerWarning = _smithers_devtools_snapshotSerializer.SnapshotSerializerWarning;
1160
+ type SmithersDb = _smithers_orchestrator_db_adapter.SmithersDb;
1161
+ type DevToolsEvent = _smithers_orchestrator_protocol_devtools.DevToolsEvent;
1162
+ type SnapshotSerializerWarning = _smithers_orchestrator_devtools_snapshotSerializer.SnapshotSerializerWarning;
940
1163
 
941
1164
  /**
942
1165
  * @param {ServerOptions} [opts]
943
1166
  */
944
- declare function startServerEffect(opts?: ServerOptions): Effect.Effect<node_http.Server<typeof IncomingMessage$1, typeof ServerResponse$1>, never, never>;
1167
+ declare function startServerEffect(opts?: ServerOptions): Effect.Effect<node_http.Server<typeof node_http.IncomingMessage, typeof node_http.ServerResponse>, never, never>;
945
1168
  /**
946
1169
  * @param {ServerOptions} [opts]
947
1170
  */
948
- declare function startServer(opts?: ServerOptions): node_http.Server<typeof IncomingMessage$1, typeof ServerResponse$1>;
1171
+ declare function startServer(opts?: ServerOptions): node_http.Server<typeof node_http.IncomingMessage, typeof node_http.ServerResponse>;
949
1172
 
950
- type RunRow = _smithers_db_adapter_RunRow.RunRow;
1173
+ type RunRow = _smithers_orchestrator_db_adapter_RunRow.RunRow;
1174
+ type ServerResponse = node_http.ServerResponse;
951
1175
  type ServerOptions = ServerOptions$1;
952
1176
 
953
- export { type AttemptRow, type ConnectRequest, type ConnectionState, DEVTOOLS_BACKPRESSURE_LIMIT, DEVTOOLS_EMPTY_ROOT_ID, DEVTOOLS_MAX_FRAME_NO, DEVTOOLS_POLL_INTERVAL_MS, DEVTOOLS_REBASELINE_INTERVAL, DEVTOOLS_RUN_ID_PATTERN, DEVTOOLS_TREE_MAX_DEPTH, type DevToolsEvent, type DevToolsNode, type DevToolsNodeType, DevToolsRouteError, type DiffSummary, type EventFrame, GATEWAY_FRAME_ID_MAX_LENGTH, GATEWAY_METHOD_NAME_MAX_LENGTH, GATEWAY_RPC_INPUT_MAX_BYTES, GATEWAY_RPC_INPUT_MAX_DEPTH, GATEWAY_RPC_MAX_ARRAY_LENGTH, GATEWAY_RPC_MAX_DEPTH, GATEWAY_RPC_MAX_PAYLOAD_BYTES, GATEWAY_RPC_MAX_STRING_LENGTH, Gateway, type GatewayAuthConfig, type GatewayDefaults, type GatewayMetricLabels, type GatewayOptions, type GatewayRequestContext, type GatewayTokenGrant, type GatewayTransport, type GatewayWebhookConfig, type GatewayWebhookRunConfig, type GatewayWebhookSignalConfig, type GetNodeDiffRouteResult, type HelloResponse, ITERATION_MAX, type IncomingMessage, type JumpResult, NODE_ID_PATTERN, NODE_OUTPUT_MAX_BYTES, NODE_OUTPUT_WARN_BYTES, type NodeOutputErrorCode, type NodeOutputResponse, NodeOutputRouteError, RUN_ID_PATTERN, type RegisteredWorkflow, type RequestFrame, type ResolvedRun, type ResponseFrame, type RunRow, type RunStartAuthContext, type ServeOptions, type ServerOptions, type ServerResponse, type SmithersWorkflow, assertGatewayInputDepthWithinBounds, createServeApp, emptyDevToolsRoot, getDevToolsSnapshotRoute, getGatewayInputDepth, getNodeDiffRoute, getNodeOutputRoute, jumpToFrameRoute, parseGatewayRequestFrame, parseXmlToDevToolsRoot, runFork, runPromise, runSync, snapshotFromFrameRow, startServer, startServerEffect, statusForRpcError, streamDevToolsRoute, summarizeBundle, validateFrameNoInput, validateFromSeqInput, validateGatewayMethodName, validateRequestedFrameNo, validateRunId };
1177
+ export { type AttemptRow, type ConnectRequest, type ConnectionState, DEVTOOLS_BACKPRESSURE_LIMIT, DEVTOOLS_EMPTY_ROOT_ID, DEVTOOLS_MAX_FRAME_NO, DEVTOOLS_POLL_INTERVAL_MS, DEVTOOLS_REBASELINE_INTERVAL, DEVTOOLS_RUN_ID_PATTERN, DEVTOOLS_TREE_MAX_DEPTH, type DevToolsEvent, type DevToolsNode, type DevToolsNodeType, DevToolsRouteError, type DiffSummary, type EventFrame, GATEWAY_FRAME_ID_MAX_LENGTH, GATEWAY_METHOD_NAME_MAX_LENGTH, GATEWAY_RPC_INPUT_MAX_BYTES, GATEWAY_RPC_INPUT_MAX_DEPTH, GATEWAY_RPC_MAX_ARRAY_LENGTH, GATEWAY_RPC_MAX_DEPTH, GATEWAY_RPC_MAX_PAYLOAD_BYTES, GATEWAY_RPC_MAX_STRING_LENGTH, Gateway, type GatewayAuthConfig, type GatewayDefaults, type GatewayMetricLabels, type GatewayOptions, type GatewayRegisterOptions, type GatewayRequestContext, type GatewayTokenGrant, type GatewayTransport, type GatewayUiConfig, type GatewayUiMount, type GatewayWebhookConfig, type GatewayWebhookRunConfig, type GatewayWebhookSignalConfig, type GetNodeDiffRouteResult, type HelloResponse, ITERATION_MAX, type IncomingMessage, type JumpResult, NODE_ID_PATTERN, NODE_OUTPUT_MAX_BYTES, NODE_OUTPUT_WARN_BYTES, type NodeOutputErrorCode, type NodeOutputResponse, NodeOutputRouteError, RUN_ID_PATTERN, type RegisteredWorkflow, type RequestFrame, type ResolvedGatewayUiConfig, type ResolvedRun, type ResponseFrame, type RunRow, type RunStartAuthContext, type ServeOptions, type ServerOptions, type ServerResponse, type SmithersWorkflow, assertGatewayInputDepthWithinBounds, createServeApp, emptyDevToolsRoot, getDevToolsSnapshotRoute, getGatewayInputDepth, getNodeDiffRoute, getNodeOutputRoute, jumpToFrameRoute, parseGatewayRequestFrame, parseXmlToDevToolsRoot, runFork, runPromise, runSync, snapshotFromFrameRow, startServer, startServerEffect, statusForRpcError, streamDevToolsRoute, summarizeBundle, validateFrameNoInput, validateFromSeqInput, validateGatewayMethodName, validateRequestedFrameNo, validateRunId };