@voyantjs/workflows-orchestrator-node 0.107.5 → 0.107.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.
Files changed (69) hide show
  1. package/dist/dashboard-chunks.d.ts +17 -0
  2. package/dist/dashboard-chunks.d.ts.map +1 -0
  3. package/dist/dashboard-chunks.js +19 -0
  4. package/dist/dashboard-http-server.d.ts +6 -0
  5. package/dist/dashboard-http-server.d.ts.map +1 -0
  6. package/dist/dashboard-http-server.js +99 -0
  7. package/dist/dashboard-metrics.d.ts +3 -0
  8. package/dist/dashboard-metrics.d.ts.map +1 -0
  9. package/dist/dashboard-metrics.js +26 -0
  10. package/dist/dashboard-request.d.ts +7 -0
  11. package/dist/dashboard-request.d.ts.map +1 -0
  12. package/dist/dashboard-request.js +436 -0
  13. package/dist/dashboard-server.d.ts +9 -171
  14. package/dist/dashboard-server.d.ts.map +1 -1
  15. package/dist/dashboard-server.js +7 -1229
  16. package/dist/dashboard-sse.d.ts +7 -0
  17. package/dist/dashboard-sse.d.ts.map +1 -0
  18. package/dist/dashboard-sse.js +134 -0
  19. package/dist/dashboard-static.d.ts +7 -0
  20. package/dist/dashboard-static.d.ts.map +1 -0
  21. package/dist/dashboard-static.js +89 -0
  22. package/dist/dashboard-types.d.ts +134 -0
  23. package/dist/dashboard-types.d.ts.map +1 -0
  24. package/dist/dashboard-types.js +1 -0
  25. package/dist/node-selfhost-defaults.d.ts +7 -0
  26. package/dist/node-selfhost-defaults.d.ts.map +1 -0
  27. package/dist/node-selfhost-defaults.js +8 -0
  28. package/dist/node-selfhost-deps.d.ts +4 -0
  29. package/dist/node-selfhost-deps.d.ts.map +1 -0
  30. package/dist/node-selfhost-deps.js +403 -0
  31. package/dist/node-selfhost-resume-input.d.ts +4 -0
  32. package/dist/node-selfhost-resume-input.d.ts.map +1 -0
  33. package/dist/node-selfhost-resume-input.js +20 -0
  34. package/dist/node-standalone-driver.d.ts.map +1 -1
  35. package/dist/node-standalone-driver.js +40 -3
  36. package/dist/node-step-runner.d.ts +3 -0
  37. package/dist/node-step-runner.d.ts.map +1 -0
  38. package/dist/node-step-runner.js +26 -0
  39. package/dist/postgres-manifest-store.d.ts.map +1 -1
  40. package/dist/postgres-manifest-store.js +6 -2
  41. package/dist/postgres-run-record-store.js +1 -1
  42. package/dist/postgres-schema.d.ts.map +1 -1
  43. package/dist/postgres-schema.js +2 -0
  44. package/dist/sleep-alarm-manager.d.ts.map +1 -1
  45. package/dist/sleep-alarm-manager.js +9 -1
  46. package/dist/store-stream.d.ts.map +1 -1
  47. package/dist/store-stream.js +9 -1
  48. package/dist/wakeup-poller.d.ts.map +1 -1
  49. package/dist/wakeup-poller.js +9 -1
  50. package/package.json +3 -3
  51. package/src/dashboard-chunks.ts +35 -0
  52. package/src/dashboard-http-server.ts +118 -0
  53. package/src/dashboard-metrics.ts +39 -0
  54. package/src/dashboard-request.ts +488 -0
  55. package/src/dashboard-server.ts +17 -1535
  56. package/src/dashboard-sse.ts +150 -0
  57. package/src/dashboard-static.ts +88 -0
  58. package/src/dashboard-types.ts +106 -0
  59. package/src/node-selfhost-defaults.ts +9 -0
  60. package/src/node-selfhost-deps.ts +495 -0
  61. package/src/node-selfhost-resume-input.ts +27 -0
  62. package/src/node-standalone-driver.ts +59 -3
  63. package/src/node-step-runner.ts +28 -0
  64. package/src/postgres-manifest-store.ts +2 -0
  65. package/src/postgres-run-record-store.ts +1 -1
  66. package/src/postgres-schema.ts +2 -0
  67. package/src/sleep-alarm-manager.ts +12 -1
  68. package/src/store-stream.ts +12 -1
  69. package/src/wakeup-poller.ts +12 -1
@@ -0,0 +1,7 @@
1
+ import type { ServerResponse } from "node:http";
2
+ import type { ChunkBus } from "./dashboard-chunks.js";
3
+ import type { SnapshotRunStore } from "./snapshot-run-store.js";
4
+ import type { StoreStream } from "./store-stream.js";
5
+ export declare function handleSseStream(res: ServerResponse, stream: StoreStream, chunkBus?: ChunkBus): void;
6
+ export declare function handleRunSseStream(res: ServerResponse, runId: string, stream: StoreStream, chunkBus: ChunkBus | undefined, store: SnapshotRunStore): void;
7
+ //# sourceMappingURL=dashboard-sse.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-sse.d.ts","sourceRoot":"","sources":["../src/dashboard-sse.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,KAAK,EAAE,QAAQ,EAAc,MAAM,uBAAuB,CAAA;AACjE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAC/D,OAAO,KAAK,EAAc,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAahE,wBAAgB,eAAe,CAC7B,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,WAAW,EACnB,QAAQ,CAAC,EAAE,QAAQ,GAClB,IAAI,CAyCN;AAUD,wBAAgB,kBAAkB,CAChC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,WAAW,EACnB,QAAQ,EAAE,QAAQ,GAAG,SAAS,EAC9B,KAAK,EAAE,gBAAgB,GACtB,IAAI,CAwEN"}
@@ -0,0 +1,134 @@
1
+ function unrefTimer(timer) {
2
+ if (typeof timer === "object" &&
3
+ timer !== null &&
4
+ "unref" in timer &&
5
+ typeof timer.unref === "function") {
6
+ timer.unref();
7
+ }
8
+ }
9
+ export function handleSseStream(res, stream, chunkBus) {
10
+ res.writeHead(200, {
11
+ "content-type": "text/event-stream",
12
+ "cache-control": "no-store",
13
+ connection: "keep-alive",
14
+ "access-control-allow-origin": "*",
15
+ });
16
+ res.write("retry: 3000\n\n");
17
+ const writeEvent = (event) => {
18
+ try {
19
+ res.write(`event: ${event.kind}\ndata: ${JSON.stringify(event)}\n\n`);
20
+ }
21
+ catch {
22
+ // Ignore write errors on closed sockets.
23
+ }
24
+ };
25
+ const writeChunk = (event) => {
26
+ try {
27
+ res.write(`event: stream.chunk\ndata: ${JSON.stringify(event)}\n\n`);
28
+ }
29
+ catch {
30
+ // Ignore write errors on closed sockets.
31
+ }
32
+ };
33
+ const unsubscribeStore = stream.subscribe(writeEvent);
34
+ const unsubscribeChunk = chunkBus ? chunkBus.subscribe(writeChunk) : () => { };
35
+ const ping = setInterval(() => {
36
+ try {
37
+ res.write(`: ping ${Date.now()}\n\n`);
38
+ }
39
+ catch {
40
+ // Ignore write errors on closed sockets.
41
+ }
42
+ }, 25_000);
43
+ unrefTimer(ping);
44
+ res.on("close", () => {
45
+ clearInterval(ping);
46
+ unsubscribeStore();
47
+ unsubscribeChunk();
48
+ });
49
+ }
50
+ const TERMINAL_STATUSES = new Set([
51
+ "completed",
52
+ "failed",
53
+ "cancelled",
54
+ "compensated",
55
+ "compensation_failed",
56
+ ]);
57
+ export function handleRunSseStream(res, runId, stream, chunkBus, store) {
58
+ res.writeHead(200, {
59
+ "content-type": "text/event-stream",
60
+ "cache-control": "no-store",
61
+ connection: "keep-alive",
62
+ "access-control-allow-origin": "*",
63
+ });
64
+ res.write("retry: 3000\n\n");
65
+ let closed = false;
66
+ const close = () => {
67
+ if (closed)
68
+ return;
69
+ closed = true;
70
+ try {
71
+ res.end();
72
+ }
73
+ catch {
74
+ // Ignore close failures.
75
+ }
76
+ };
77
+ const writeEvent = (kind, data) => {
78
+ if (closed)
79
+ return;
80
+ try {
81
+ res.write(`event: ${kind}\ndata: ${JSON.stringify(data)}\n\n`);
82
+ }
83
+ catch {
84
+ // Ignore write errors on closed sockets.
85
+ }
86
+ };
87
+ void store.get(runId).then((run) => {
88
+ if (run) {
89
+ writeEvent("hello", { run });
90
+ if (TERMINAL_STATUSES.has(run.status))
91
+ close();
92
+ }
93
+ else {
94
+ writeEvent("hello", { run: null });
95
+ }
96
+ });
97
+ const unsubscribeStore = stream.subscribe((event) => {
98
+ if (event.kind === "added" || event.kind === "updated") {
99
+ if (event.run.id !== runId)
100
+ return;
101
+ writeEvent(event.kind, event);
102
+ if (TERMINAL_STATUSES.has(event.run.status))
103
+ close();
104
+ }
105
+ else if (event.kind === "removed") {
106
+ if (event.runId !== runId)
107
+ return;
108
+ writeEvent(event.kind, event);
109
+ close();
110
+ }
111
+ });
112
+ const unsubscribeChunk = chunkBus
113
+ ? chunkBus.subscribe((event) => {
114
+ if (event.runId !== runId)
115
+ return;
116
+ writeEvent("stream.chunk", event);
117
+ })
118
+ : () => { };
119
+ const ping = setInterval(() => {
120
+ try {
121
+ res.write(`: ping ${Date.now()}\n\n`);
122
+ }
123
+ catch {
124
+ // Ignore write errors on closed sockets.
125
+ }
126
+ }, 25_000);
127
+ unrefTimer(ping);
128
+ res.on("close", () => {
129
+ closed = true;
130
+ clearInterval(ping);
131
+ unsubscribeStore();
132
+ unsubscribeChunk();
133
+ });
134
+ }
@@ -0,0 +1,7 @@
1
+ export declare function createStaticReader(rootDir: string): (path: string) => Promise<Uint8Array | null>;
2
+ export declare function findDashboardDir(startFrom: string): Promise<string | undefined>;
3
+ export declare function assertReadableFile(path: string, label: string): Promise<void>;
4
+ export declare function assertReadableDirectory(path: string, label: string): Promise<void>;
5
+ export declare function mimeFor(path: string): string;
6
+ export declare function urlPath(raw: string): string;
7
+ //# sourceMappingURL=dashboard-static.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-static.d.ts","sourceRoot":"","sources":["../src/dashboard-static.ts"],"names":[],"mappings":"AAGA,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC,UAAU,GAAG,IAAI,CAAC,CAWhG;AAED,wBAAsB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAgBrF;AAED,wBAAsB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUnF;AAED,wBAAsB,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAUxF;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAqB5C;AAED,wBAAgB,OAAO,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAM3C"}
@@ -0,0 +1,89 @@
1
+ import { readFile, stat } from "node:fs/promises";
2
+ import { extname, join, resolve as resolvePath } from "node:path";
3
+ export function createStaticReader(rootDir) {
4
+ const root = resolvePath(rootDir);
5
+ return async (path) => {
6
+ const absolute = resolvePath(root, path);
7
+ if (!absolute.startsWith(`${root}/`) && absolute !== root)
8
+ return null;
9
+ try {
10
+ return await readFile(absolute);
11
+ }
12
+ catch {
13
+ return null;
14
+ }
15
+ };
16
+ }
17
+ export async function findDashboardDir(startFrom) {
18
+ const candidates = [
19
+ join(startFrom, "apps/workflows-local-dashboard/dist"),
20
+ join(startFrom, "../local-dashboard/dist"),
21
+ join(startFrom, "../../apps/workflows-local-dashboard/dist"),
22
+ join(startFrom, "../../../apps/workflows-local-dashboard/dist"),
23
+ ];
24
+ for (const candidate of candidates) {
25
+ try {
26
+ const entry = await stat(join(candidate, "index.html"));
27
+ if (entry.isFile())
28
+ return candidate;
29
+ }
30
+ catch {
31
+ // Continue scanning candidate locations.
32
+ }
33
+ }
34
+ return undefined;
35
+ }
36
+ export async function assertReadableFile(path, label) {
37
+ let info;
38
+ try {
39
+ info = await stat(path);
40
+ }
41
+ catch (err) {
42
+ throw new Error(`voyant workflows selfhost: ${label} not found at "${path}"`, { cause: err });
43
+ }
44
+ if (!info.isFile()) {
45
+ throw new Error(`voyant workflows selfhost: ${label} must be a file (got "${path}")`);
46
+ }
47
+ }
48
+ export async function assertReadableDirectory(path, label) {
49
+ let info;
50
+ try {
51
+ info = await stat(path);
52
+ }
53
+ catch (err) {
54
+ throw new Error(`voyant workflows selfhost: ${label} not found at "${path}"`, { cause: err });
55
+ }
56
+ if (!info.isDirectory()) {
57
+ throw new Error(`voyant workflows selfhost: ${label} must be a directory (got "${path}")`);
58
+ }
59
+ }
60
+ export function mimeFor(path) {
61
+ const ext = extname(path).toLowerCase();
62
+ switch (ext) {
63
+ case ".html":
64
+ return "text/html; charset=utf-8";
65
+ case ".js":
66
+ case ".mjs":
67
+ return "application/javascript; charset=utf-8";
68
+ case ".css":
69
+ return "text/css; charset=utf-8";
70
+ case ".json":
71
+ return "application/json; charset=utf-8";
72
+ case ".svg":
73
+ return "image/svg+xml";
74
+ case ".png":
75
+ return "image/png";
76
+ case ".map":
77
+ return "application/json";
78
+ default:
79
+ return "application/octet-stream";
80
+ }
81
+ }
82
+ export function urlPath(raw) {
83
+ try {
84
+ return new URL(raw, "http://local").pathname;
85
+ }
86
+ catch {
87
+ return raw;
88
+ }
89
+ }
@@ -0,0 +1,134 @@
1
+ import type { createServer } from "node:http";
2
+ import type { ServiceResolver } from "@voyantjs/workflows/driver";
3
+ import type { WaitpointInjection } from "@voyantjs/workflows-orchestrator";
4
+ import type { ChunkBus } from "./dashboard-chunks.js";
5
+ import type { SchedulerHandle } from "./scheduler.js";
6
+ import type { ListFilter, SnapshotRunStore, StoredRun } from "./snapshot-run-store.js";
7
+ export interface ServeDeps {
8
+ store: SnapshotRunStore;
9
+ createServer: typeof createServer;
10
+ shutdown?: () => void | Promise<void>;
11
+ healthCheck?: () => Promise<HealthReport> | HealthReport;
12
+ readinessCheck?: () => Promise<HealthReport> | HealthReport;
13
+ collectMetrics?: () => Promise<string> | string;
14
+ staticDir?: string;
15
+ readStatic?: (path: string) => Promise<Uint8Array | null>;
16
+ triggerRun?: (args: {
17
+ workflowId: string;
18
+ input: unknown;
19
+ runId?: string;
20
+ tags?: string[];
21
+ triggeredByUserId?: string | null;
22
+ }) => Promise<{
23
+ ok: true;
24
+ saved: StoredRun;
25
+ } | {
26
+ ok: false;
27
+ message: string;
28
+ exitCode: number;
29
+ }>;
30
+ resumeRun?: (args: {
31
+ parentRunId: string;
32
+ workflowId?: string;
33
+ input?: unknown;
34
+ resumeFromStep?: string;
35
+ seedResults?: Record<string, unknown>;
36
+ runId?: string;
37
+ tags?: string[];
38
+ triggeredByUserId?: string | null;
39
+ }) => Promise<{
40
+ ok: true;
41
+ saved: StoredRun;
42
+ parentRunId: string;
43
+ resumeFromStep: string;
44
+ } | {
45
+ ok: false;
46
+ message: string;
47
+ exitCode: number;
48
+ }>;
49
+ listWorkflows?: () => {
50
+ id: string;
51
+ description?: string;
52
+ }[];
53
+ injectWaitpoint?: (args: {
54
+ runId: string;
55
+ injection: WaitpointInjection;
56
+ }) => Promise<{
57
+ ok: true;
58
+ saved: StoredRun;
59
+ } | {
60
+ ok: false;
61
+ message: string;
62
+ exitCode: number;
63
+ }>;
64
+ scheduler?: SchedulerHandle;
65
+ listSchedules?: () => {
66
+ workflowId: string;
67
+ name?: string;
68
+ nextAt: number;
69
+ done: boolean;
70
+ }[];
71
+ cancelRun?: (args: {
72
+ runId: string;
73
+ }) => Promise<{
74
+ ok: true;
75
+ saved: StoredRun;
76
+ } | {
77
+ ok: false;
78
+ message: string;
79
+ exitCode: number;
80
+ }>;
81
+ chunkBus?: ChunkBus;
82
+ }
83
+ export interface RequestHandlerDeps {
84
+ store: SnapshotRunStore;
85
+ healthCheck?: ServeDeps["healthCheck"];
86
+ readinessCheck?: ServeDeps["readinessCheck"];
87
+ collectMetrics?: ServeDeps["collectMetrics"];
88
+ readStatic?: (path: string) => Promise<Uint8Array | null>;
89
+ hasStaticDashboard?: boolean;
90
+ triggerRun?: ServeDeps["triggerRun"];
91
+ resumeRun?: ServeDeps["resumeRun"];
92
+ listWorkflows?: ServeDeps["listWorkflows"];
93
+ injectWaitpoint?: ServeDeps["injectWaitpoint"];
94
+ listSchedules?: ServeDeps["listSchedules"];
95
+ cancelRun?: ServeDeps["cancelRun"];
96
+ }
97
+ export interface HandlerResponse {
98
+ status: number;
99
+ headers: Record<string, string>;
100
+ body: string | Uint8Array;
101
+ }
102
+ export interface HealthReport {
103
+ ok: boolean;
104
+ service?: string;
105
+ checks?: Record<string, "ok" | "error">;
106
+ details?: Record<string, unknown>;
107
+ }
108
+ export interface MetricsSnapshot {
109
+ workflowsRegistered: number;
110
+ schedulesRegistered: number;
111
+ runsTotal: number;
112
+ wakeupsTotal: number;
113
+ runsByStatus: Record<string, number>;
114
+ generatedAtMs: number;
115
+ }
116
+ export interface ServeHandle {
117
+ close: () => Promise<void>;
118
+ url: string;
119
+ }
120
+ export interface NodeSelfHostServerOptions {
121
+ entryFile: string;
122
+ port?: number;
123
+ host?: string;
124
+ staticDir?: string;
125
+ cacheBustEntry?: boolean;
126
+ services?: ServiceResolver;
127
+ store?: SnapshotRunStore;
128
+ databaseUrl?: string;
129
+ wakeupPollIntervalMs?: number;
130
+ wakeupLeaseMs?: number;
131
+ wakeupLeaseOwner?: string;
132
+ }
133
+ export type DashboardListFilter = ListFilter;
134
+ //# sourceMappingURL=dashboard-types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dashboard-types.d.ts","sourceRoot":"","sources":["../src/dashboard-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AAC7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAA;AAC1E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AACrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEtF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,gBAAgB,CAAA;IACvB,YAAY,EAAE,OAAO,YAAY,CAAA;IACjC,QAAQ,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;IACrC,WAAW,CAAC,EAAE,MAAM,OAAO,CAAC,YAAY,CA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W,WAAW;IAC1B,KAAK,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAA;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ;AAED,MAAM,WAAW,yBAAyB;IACxC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;IACxB,QAAQ,CAAC,EAAE,eAAe,CAAA;IAC1B,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,oBAAoB,CAAC,EAAE,MAAM,CAAA;IAC7B,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAC1B;AAED,MAAM,MAAM,mBAAmB,GAAG,UAAU,CAAA"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ export declare const localTenantMeta: {
2
+ tenantId: string;
3
+ projectId: string;
4
+ organizationId: string;
5
+ };
6
+ export declare function createDefaultWakeupLeaseOwner(): string;
7
+ //# sourceMappingURL=node-selfhost-defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-selfhost-defaults.d.ts","sourceRoot":"","sources":["../src/node-selfhost-defaults.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe;;;;CAI3B,CAAA;AAED,wBAAgB,6BAA6B,IAAI,MAAM,CAEtD"}
@@ -0,0 +1,8 @@
1
+ export const localTenantMeta = {
2
+ tenantId: "tnt_local",
3
+ projectId: "prj_local",
4
+ organizationId: "org_local",
5
+ };
6
+ export function createDefaultWakeupLeaseOwner() {
7
+ return `node-selfhost-${process.pid}-${Math.random().toString(36).slice(2, 8)}`;
8
+ }
@@ -0,0 +1,4 @@
1
+ import type { NodeSelfHostServerOptions, ServeDeps, ServeHandle } from "./dashboard-types.js";
2
+ export declare function startNodeSelfHostServer(opts: NodeSelfHostServerOptions): Promise<ServeHandle>;
3
+ export declare function createNodeSelfHostDeps(opts: Pick<NodeSelfHostServerOptions, "entryFile" | "staticDir" | "cacheBustEntry" | "services" | "store" | "databaseUrl" | "wakeupPollIntervalMs" | "wakeupLeaseMs" | "wakeupLeaseOwner">): Promise<ServeDeps>;
4
+ //# sourceMappingURL=node-selfhost-deps.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"node-selfhost-deps.d.ts","sourceRoot":"","sources":["../src/node-selfhost-deps.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAEV,yBAAyB,EACzB,SAAS,EACT,WAAW,EACZ,MAAM,sBAAsB,CAAA;AAyB7B,wBAAsB,uBAAuB,CAC3C,IAAI,EAAE,yBAAyB,GAC9B,OAAO,CAAC,WAAW,CAAC,CAStB;AAED,wBAAsB,sBAAsB,CAC1C,IAAI,EAAE,IAAI,CACR,yBAAyB,EACvB,WAAW,GACX,WAAW,GACX,gBAAgB,GAChB,UAAU,GACV,OAAO,GACP,aAAa,GACb,sBAAsB,GACtB,eAAe,GACf,kBAAkB,CACrB,GACA,OAAO,CAAC,SAAS,CAAC,CAkapB"}