@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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smithers-orchestrator/server",
3
- "version": "0.16.9",
3
+ "version": "0.18.0",
4
4
  "description": "HTTP, WebSocket, gateway, cron, webhook, and metrics servers for Smithers",
5
5
  "type": "module",
6
6
  "sideEffects": false,
@@ -22,25 +22,32 @@
22
22
  "dependencies": {
23
23
  "@effect/workflow": "^0.18.0",
24
24
  "cron-parser": "^5.5.0",
25
+ "drizzle-orm": "^0.45.2",
25
26
  "effect": "^3.21.1",
26
27
  "hono": "^4.12.14",
27
28
  "ws": "^8.20.0",
28
- "@smithers-orchestrator/driver": "0.16.9",
29
- "@smithers-orchestrator/db": "0.16.9",
30
- "@smithers-orchestrator/engine": "0.16.9",
31
- "@smithers-orchestrator/errors": "0.16.9",
32
- "@smithers-orchestrator/components": "0.16.9",
33
- "@smithers-orchestrator/scheduler": "0.16.9",
34
- "@smithers-orchestrator/observability": "0.16.9",
35
- "@smithers-orchestrator/time-travel": "0.16.9"
29
+ "@smithers-orchestrator/db": "0.18.0",
30
+ "@smithers-orchestrator/devtools": "0.18.0",
31
+ "@smithers-orchestrator/engine": "0.18.0",
32
+ "@smithers-orchestrator/errors": "0.18.0",
33
+ "@smithers-orchestrator/components": "0.18.0",
34
+ "@smithers-orchestrator/driver": "0.18.0",
35
+ "@smithers-orchestrator/observability": "0.18.0",
36
+ "@smithers-orchestrator/gateway": "0.18.0",
37
+ "@smithers-orchestrator/protocol": "0.18.0",
38
+ "@smithers-orchestrator/scheduler": "0.18.0",
39
+ "@smithers-orchestrator/time-travel": "0.18.0"
36
40
  },
37
41
  "devDependencies": {
38
42
  "@types/bun": "latest",
39
- "typescript": "~5.9.3"
43
+ "react": "^19.2.5",
44
+ "typescript": "~5.9.3",
45
+ "zod": "^4.3.6",
46
+ "@smithers-orchestrator/graph": "0.18.0"
40
47
  },
41
48
  "scripts": {
42
49
  "test": "bun test tests",
43
50
  "typecheck": "tsc -p tsconfig.json --noEmit",
44
- "build": "tsup --dts-only"
51
+ "build": "rm -f src/index.d.ts && node ../../node_modules/tsup/dist/cli-default.js --dts-only"
45
52
  }
46
53
  }
package/src/EventFrame.ts CHANGED
@@ -4,4 +4,5 @@ export type EventFrame = {
4
4
  payload?: unknown;
5
5
  seq: number;
6
6
  stateVersion: number;
7
+ apiVersion?: "v1";
7
8
  };
@@ -1,13 +1,32 @@
1
1
  import type { GatewayAuthConfig } from "./GatewayAuthConfig.js";
2
2
  import type { GatewayDefaults } from "./GatewayDefaults.js";
3
+ import type { GatewayUiConfig } from "./GatewayUiConfig.js";
3
4
 
4
5
  export type GatewayOptions = {
5
6
  protocol?: number;
6
7
  features?: string[];
7
8
  heartbeatMs?: number;
8
9
  auth?: GatewayAuthConfig;
10
+ ui?: GatewayUiConfig;
9
11
  defaults?: GatewayDefaults;
10
12
  maxBodyBytes?: number;
11
13
  maxPayload?: number;
12
14
  maxConnections?: number;
15
+ /**
16
+ * Per-run replay window for Gateway run event streams.
17
+ * @default 10000
18
+ */
19
+ eventWindowSize?: number;
20
+ /**
21
+ * Maximum time (in milliseconds) allowed for the HTTP parser to receive the
22
+ * complete headers of a single request. Helps mitigate slowloris attacks.
23
+ * @default 30000
24
+ */
25
+ headersTimeout?: number;
26
+ /**
27
+ * Maximum time (in milliseconds) allowed for a single request to be received
28
+ * and parsed, including the body. Helps mitigate slowloris attacks.
29
+ * @default 60000
30
+ */
31
+ requestTimeout?: number;
13
32
  };
@@ -0,0 +1,8 @@
1
+ import type { GatewayWebhookConfig } from "./GatewayWebhookConfig.js";
2
+ import type { GatewayUiConfig } from "./GatewayUiConfig.js";
3
+
4
+ export type GatewayRegisterOptions = {
5
+ schedule?: string;
6
+ webhook?: GatewayWebhookConfig;
7
+ ui?: GatewayUiConfig;
8
+ };
@@ -2,4 +2,8 @@ export type GatewayTokenGrant = {
2
2
  role: string;
3
3
  scopes: string[];
4
4
  userId?: string;
5
+ tokenId?: string;
6
+ issuedAtMs?: number;
7
+ expiresAtMs?: number;
8
+ revokedAtMs?: number;
5
9
  };
@@ -0,0 +1,20 @@
1
+ export type GatewayUiConfig = {
2
+ /**
3
+ * Browser entry module for the React app. Smithers bundles this with Bun and
4
+ * serves it from the Gateway origin.
5
+ */
6
+ entry: string;
7
+ /**
8
+ * URL path where the UI is mounted. Gateway-level UI defaults to `/`;
9
+ * workflow-level UI defaults to `/workflows/<workflowKey>`.
10
+ */
11
+ path?: string;
12
+ /**
13
+ * Document title for the generated HTML shell.
14
+ */
15
+ title?: string;
16
+ /**
17
+ * JSON-serializable boot data exposed to the browser.
18
+ */
19
+ props?: Record<string, unknown>;
20
+ };
@@ -2,9 +2,14 @@ export type ResponseFrame = {
2
2
  type: "res";
3
3
  id: string;
4
4
  ok: boolean;
5
+ apiVersion?: "v1";
5
6
  payload?: unknown;
6
7
  error?: {
8
+ version?: "v1";
7
9
  code: string;
8
10
  message: string;
11
+ requiredScope?: string;
12
+ refresh?: string;
13
+ details?: unknown;
9
14
  };
10
15
  };
@@ -5,4 +5,16 @@ export type ServerOptions = {
5
5
  maxBodyBytes?: number;
6
6
  rootDir?: string;
7
7
  allowNetwork?: boolean;
8
+ /**
9
+ * Maximum time (in milliseconds) allowed for the HTTP parser to receive the
10
+ * complete headers of a single request. Helps mitigate slowloris attacks.
11
+ * @default 30000
12
+ */
13
+ headersTimeout?: number;
14
+ /**
15
+ * Maximum time (in milliseconds) allowed for a single request to be received
16
+ * and parsed, including the body. Helps mitigate slowloris attacks.
17
+ * @default 60000
18
+ */
19
+ requestTimeout?: number;
8
20
  };