@pgflow/client 0.0.0-update-supabase-ba45e13a-20251119080026 → 0.0.0-worker-compilation-b0fe6186-20251201124606

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.
@@ -0,0 +1,307 @@
1
+ import type { AnyFlow, ExtractFlowInput, ExtractFlowOutput, ExtractFlowSteps, StepOutput } from '@pgflow/dsl';
2
+ import type { Json, RunRow, StepStateRow, FlowRow, StepRow } from '@pgflow/core';
3
+ import type { FlowRun } from './FlowRun.js';
4
+ /**
5
+ * Flow run status enum
6
+ */
7
+ export declare enum FlowRunStatus {
8
+ Started = "started",
9
+ Completed = "completed",
10
+ Failed = "failed"
11
+ }
12
+ /**
13
+ * Flow run event data types - individual event shapes (no circular reference)
14
+ */
15
+ export type FlowRunEventData<TFlow extends AnyFlow> = {
16
+ started: {
17
+ event_type: 'run:started';
18
+ run_id: string;
19
+ flow_slug: string;
20
+ input: ExtractFlowInput<TFlow>;
21
+ status: FlowRunStatus.Started;
22
+ started_at: string;
23
+ remaining_steps: number;
24
+ };
25
+ completed: {
26
+ event_type: 'run:completed';
27
+ run_id: string;
28
+ flow_slug: string;
29
+ output: ExtractFlowOutput<TFlow>;
30
+ status: FlowRunStatus.Completed;
31
+ completed_at: string;
32
+ };
33
+ failed: {
34
+ event_type: 'run:failed';
35
+ run_id: string;
36
+ flow_slug: string;
37
+ error_message: string;
38
+ status: FlowRunStatus.Failed;
39
+ failed_at: string;
40
+ };
41
+ };
42
+ /**
43
+ * Strong discriminated union for all flow run events (no circular reference)
44
+ */
45
+ export type FlowRunEvent<TFlow extends AnyFlow> = FlowRunEventData<TFlow>[keyof FlowRunEventData<TFlow>];
46
+ /**
47
+ * Type guard to check if an unknown value is a valid FlowRunEvent
48
+ */
49
+ export declare function isFlowRunEvent<TFlow extends AnyFlow>(value: unknown): value is FlowRunEvent<TFlow>;
50
+ /**
51
+ * Type guard for started events
52
+ */
53
+ export declare function isFlowRunStartedEvent<TFlow extends AnyFlow>(event: FlowRunEvent<TFlow>): event is FlowRunEventData<TFlow>['started'];
54
+ /**
55
+ * Type guard for completed events
56
+ */
57
+ export declare function isFlowRunCompletedEvent<TFlow extends AnyFlow>(event: FlowRunEvent<TFlow>): event is FlowRunEventData<TFlow>['completed'];
58
+ /**
59
+ * Type guard for failed events
60
+ */
61
+ export declare function isFlowRunFailedEvent<TFlow extends AnyFlow>(event: FlowRunEvent<TFlow>): event is FlowRunEventData<TFlow>['failed'];
62
+ /**
63
+ * Flow run event types matching nanoevents expectations (wildcard added separately)
64
+ */
65
+ export type FlowRunEvents<TFlow extends AnyFlow> = {
66
+ [K in keyof FlowRunEventData<TFlow>]: (event: FlowRunEventData<TFlow>[K]) => void;
67
+ } & {
68
+ '*': (event: FlowRunEvent<TFlow>) => void;
69
+ };
70
+ /**
71
+ * Flow step status enum
72
+ */
73
+ export declare enum FlowStepStatus {
74
+ Created = "created",
75
+ Started = "started",
76
+ Completed = "completed",
77
+ Failed = "failed"
78
+ }
79
+ /**
80
+ * Step event data types (no circular reference)
81
+ */
82
+ export type StepEventData<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string> = {
83
+ started: {
84
+ event_type: 'step:started';
85
+ run_id: string;
86
+ step_slug: TStepSlug;
87
+ status: FlowStepStatus.Started;
88
+ started_at: string;
89
+ };
90
+ completed: {
91
+ event_type: 'step:completed';
92
+ run_id: string;
93
+ step_slug: TStepSlug;
94
+ output: StepOutput<TFlow, TStepSlug>;
95
+ status: FlowStepStatus.Completed;
96
+ completed_at: string;
97
+ };
98
+ failed: {
99
+ event_type: 'step:failed';
100
+ run_id: string;
101
+ step_slug: TStepSlug;
102
+ error_message: string;
103
+ status: FlowStepStatus.Failed;
104
+ failed_at: string;
105
+ };
106
+ };
107
+ /**
108
+ * Strong discriminated union for all step events (no circular reference)
109
+ */
110
+ export type StepEvent<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string> = StepEventData<TFlow, TStepSlug>[keyof StepEventData<TFlow, TStepSlug>];
111
+ /**
112
+ * Type guard to check if an unknown value is a valid StepEvent
113
+ */
114
+ export declare function isStepEvent<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string>(value: unknown): value is StepEvent<TFlow, TStepSlug>;
115
+ /**
116
+ * Type guard for started step events
117
+ */
118
+ export declare function isStepStartedEvent<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string>(event: unknown): event is StepEventData<TFlow, TStepSlug>['started'];
119
+ /**
120
+ * Type guard for completed step events
121
+ */
122
+ export declare function isStepCompletedEvent<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string>(event: unknown): event is StepEventData<TFlow, TStepSlug>['completed'];
123
+ /**
124
+ * Type guard for failed step events
125
+ */
126
+ export declare function isStepFailedEvent<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string>(event: unknown): event is StepEventData<TFlow, TStepSlug>['failed'];
127
+ /**
128
+ * Step event types matching nanoevents expectations (wildcard added separately)
129
+ */
130
+ export type StepEvents<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string> = {
131
+ [K in keyof StepEventData<TFlow, TStepSlug>]: (event: StepEventData<TFlow, TStepSlug>[K]) => void;
132
+ } & {
133
+ '*': (event: StepEvent<TFlow, TStepSlug>) => void;
134
+ };
135
+ /**
136
+ * Function returned by event subscriptions to remove the listener
137
+ */
138
+ export type Unsubscribe = () => void;
139
+ /**
140
+ * Broadcast run event types for Supabase realtime
141
+ */
142
+ export type BroadcastRunStartedEvent = {
143
+ event_type: 'run:started';
144
+ run_id: string;
145
+ flow_slug: string;
146
+ status: FlowRunStatus.Started;
147
+ input: Json;
148
+ started_at: string;
149
+ remaining_steps: number;
150
+ error_message?: string;
151
+ };
152
+ export type BroadcastRunCompletedEvent = {
153
+ event_type: 'run:completed';
154
+ run_id: string;
155
+ flow_slug: string;
156
+ status: FlowRunStatus.Completed;
157
+ output: Json;
158
+ completed_at: string;
159
+ error_message?: string;
160
+ };
161
+ export type BroadcastRunFailedEvent = {
162
+ event_type: 'run:failed';
163
+ run_id: string;
164
+ flow_slug: string;
165
+ status: FlowRunStatus.Failed;
166
+ error_message: string;
167
+ failed_at: string;
168
+ };
169
+ export type BroadcastRunEvent = BroadcastRunStartedEvent | BroadcastRunCompletedEvent | BroadcastRunFailedEvent;
170
+ /**
171
+ * Broadcast step event types for Supabase realtime
172
+ */
173
+ export type BroadcastStepStartedEvent = {
174
+ event_type: 'step:started';
175
+ run_id: string;
176
+ step_slug: string;
177
+ status: FlowStepStatus.Started;
178
+ started_at: string;
179
+ remaining_tasks: number;
180
+ remaining_deps: number;
181
+ error_message?: string;
182
+ output?: Json;
183
+ };
184
+ export type BroadcastStepCompletedEvent = {
185
+ event_type: 'step:completed';
186
+ run_id: string;
187
+ step_slug: string;
188
+ status: FlowStepStatus.Completed;
189
+ output: Json;
190
+ completed_at: string;
191
+ error_message?: string;
192
+ };
193
+ export type BroadcastStepFailedEvent = {
194
+ event_type: 'step:failed';
195
+ run_id: string;
196
+ step_slug: string;
197
+ status: FlowStepStatus.Failed;
198
+ error_message: string;
199
+ failed_at: string;
200
+ output?: Json;
201
+ };
202
+ export type BroadcastStepEvent = BroadcastStepStartedEvent | BroadcastStepCompletedEvent | BroadcastStepFailedEvent;
203
+ /**
204
+ * Flow run state
205
+ */
206
+ export type FlowRunState<TFlow extends AnyFlow> = {
207
+ run_id: string;
208
+ flow_slug: string;
209
+ status: FlowRunStatus;
210
+ input: ExtractFlowInput<TFlow>;
211
+ output: ExtractFlowOutput<TFlow> | null;
212
+ error: Error | null;
213
+ error_message: string | null;
214
+ started_at: Date | null;
215
+ completed_at: Date | null;
216
+ failed_at: Date | null;
217
+ remaining_steps: number;
218
+ };
219
+ /**
220
+ * Flow step state
221
+ */
222
+ export type FlowStepState<TFlow extends AnyFlow, TStepSlug extends keyof ExtractFlowSteps<TFlow> & string> = {
223
+ run_id: string;
224
+ step_slug: TStepSlug;
225
+ status: FlowStepStatus;
226
+ output: StepOutput<TFlow, TStepSlug> | null;
227
+ error: Error | null;
228
+ error_message: string | null;
229
+ started_at: Date | null;
230
+ completed_at: Date | null;
231
+ failed_at: Date | null;
232
+ };
233
+ /**
234
+ * Interface for realtime updates (used by client library)
235
+ */
236
+ export interface IFlowRealtime<TFlow = unknown> {
237
+ /**
238
+ * Fetch flow definition metadata (looks up flows and steps tables)
239
+ */
240
+ fetchFlowDefinition(flow_slug: string): Promise<{
241
+ flow: FlowRow;
242
+ steps: StepRow[];
243
+ }>;
244
+ /**
245
+ * Register a callback for run events
246
+ * @returns Function to unsubscribe from the event
247
+ */
248
+ onRunEvent(callback: (event: BroadcastRunEvent) => void): Unsubscribe;
249
+ /**
250
+ * Register a callback for step events
251
+ * @returns Function to unsubscribe from the event
252
+ */
253
+ onStepEvent(callback: (event: BroadcastStepEvent) => void): Unsubscribe;
254
+ /**
255
+ * Subscribe to a flow run's events
256
+ */
257
+ subscribeToRun(run_id: string): Promise<Unsubscribe>;
258
+ /**
259
+ * Fetch current state of a run and its steps
260
+ */
261
+ getRunWithStates(run_id: string): Promise<{
262
+ run: RunRow;
263
+ steps: StepStateRow[];
264
+ }>;
265
+ }
266
+ /**
267
+ * Generic base interface for flow runs that uses proper event types
268
+ */
269
+ export interface FlowRunBase<TEvt = unknown> {
270
+ readonly run_id: string;
271
+ updateState(event: TEvt): boolean;
272
+ step(stepSlug: string): FlowStepBase<unknown>;
273
+ hasStep(stepSlug: string): boolean;
274
+ dispose(): void;
275
+ }
276
+ /**
277
+ * Generic base interface for flow steps that uses proper event types
278
+ */
279
+ export interface FlowStepBase<TEvt = unknown> {
280
+ updateState(event: TEvt): boolean;
281
+ }
282
+ /**
283
+ * Utility type for broadcast events
284
+ */
285
+ export type BroadcastEvent = BroadcastRunEvent | BroadcastStepEvent;
286
+ /**
287
+ * Composite interface for client
288
+ */
289
+ export interface IFlowClient<TFlow extends AnyFlow = AnyFlow> extends IFlowRealtime<TFlow> {
290
+ /**
291
+ * Start a flow with optional run_id
292
+ *
293
+ * @param flow_slug - Flow slug to start
294
+ * @param input - Input data for the flow
295
+ * @param run_id - Optional run ID (will be generated if not provided)
296
+ * @returns Promise that resolves with the FlowRun instance
297
+ */
298
+ startFlow<TSpecificFlow extends TFlow>(flow_slug: string, input: ExtractFlowInput<TSpecificFlow>, run_id?: string): Promise<FlowRun<TSpecificFlow>>;
299
+ /**
300
+ * Get a flow run by ID
301
+ *
302
+ * @param run_id - ID of the run to get
303
+ * @returns Promise that resolves with the FlowRun instance or null if not found
304
+ */
305
+ getRun<TSpecificFlow extends TFlow = TFlow>(run_id: string): Promise<FlowRun<TSpecificFlow> | null>;
306
+ }
307
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lib/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,OAAO,EACP,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACX,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,IAAI,EACJ,MAAM,EACN,YAAY,EACZ,OAAO,EACP,OAAO,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE5C;;GAEG;AACH,oBAAY,aAAa;IACvB,OAAO,YAAY;IACnB,SAAS,cAAc;IACvB,MAAM,WAAW;CAClB;AAED;;GAEG;AACH,MAAM,MAAM,gBAAgB,CAAC,KAAK,SAAS,OAAO,IAAI;IACpD,OAAO,EAAE;QACP,UAAU,EAAE,aAAa,CAAC;QAC1B,MAAM,EAAE,MAAM,CAAC;QACf,SAAS,EAAE,MAAM,CAAC;QAClB,KAAK,EAAE,gBAAgB,CAAC,KAAK,CAAC,CAAC;QAC/B,MAAM,EAAE,aAAa,CAAC,OAAO,CAAC;QAC9B,UAAU,EAAE,MAAM,CAA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AC,CAAC;CAC3C"}
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Flow run status enum
3
+ */
4
+ export var FlowRunStatus;
5
+ (function (FlowRunStatus) {
6
+ FlowRunStatus["Started"] = "started";
7
+ FlowRunStatus["Completed"] = "completed";
8
+ FlowRunStatus["Failed"] = "failed";
9
+ })(FlowRunStatus || (FlowRunStatus = {}));
10
+ /**
11
+ * Type guard to check if an unknown value is a valid FlowRunEvent
12
+ */
13
+ export function isFlowRunEvent(value) {
14
+ return (!!value &&
15
+ typeof value === 'object' &&
16
+ 'run_id' in value &&
17
+ 'flow_slug' in value &&
18
+ !('step_slug' in value) &&
19
+ 'status' in value &&
20
+ (value.status === FlowRunStatus.Started ||
21
+ value.status === FlowRunStatus.Completed ||
22
+ value.status === FlowRunStatus.Failed));
23
+ }
24
+ /**
25
+ * Type guard for started events
26
+ */
27
+ export function isFlowRunStartedEvent(event) {
28
+ return event.status === FlowRunStatus.Started;
29
+ }
30
+ /**
31
+ * Type guard for completed events
32
+ */
33
+ export function isFlowRunCompletedEvent(event) {
34
+ return event.status === FlowRunStatus.Completed;
35
+ }
36
+ /**
37
+ * Type guard for failed events
38
+ */
39
+ export function isFlowRunFailedEvent(event) {
40
+ return event.status === FlowRunStatus.Failed;
41
+ }
42
+ /**
43
+ * Flow step status enum
44
+ */
45
+ export var FlowStepStatus;
46
+ (function (FlowStepStatus) {
47
+ FlowStepStatus["Created"] = "created";
48
+ FlowStepStatus["Started"] = "started";
49
+ FlowStepStatus["Completed"] = "completed";
50
+ FlowStepStatus["Failed"] = "failed";
51
+ })(FlowStepStatus || (FlowStepStatus = {}));
52
+ /**
53
+ * Type guard to check if an unknown value is a valid StepEvent
54
+ */
55
+ export function isStepEvent(value) {
56
+ return (!!value &&
57
+ typeof value === 'object' &&
58
+ 'run_id' in value &&
59
+ 'step_slug' in value &&
60
+ 'status' in value &&
61
+ (value.status === FlowStepStatus.Started ||
62
+ value.status === FlowStepStatus.Completed ||
63
+ value.status === FlowStepStatus.Failed));
64
+ }
65
+ /**
66
+ * Type guard for started step events
67
+ */
68
+ export function isStepStartedEvent(event) {
69
+ return (isStepEvent(event) &&
70
+ event.status === FlowStepStatus.Started &&
71
+ 'event_type' in event &&
72
+ event.event_type === 'step:started');
73
+ }
74
+ /**
75
+ * Type guard for completed step events
76
+ */
77
+ export function isStepCompletedEvent(event) {
78
+ return (isStepEvent(event) &&
79
+ event.status === FlowStepStatus.Completed &&
80
+ 'event_type' in event &&
81
+ event.event_type === 'step:completed');
82
+ }
83
+ /**
84
+ * Type guard for failed step events
85
+ */
86
+ export function isStepFailedEvent(event) {
87
+ return (isStepEvent(event) &&
88
+ event.status === FlowStepStatus.Failed &&
89
+ 'event_type' in event &&
90
+ event.event_type === 'step:failed');
91
+ }
@@ -0,0 +1 @@
1
+ {"version":"5.8.3"}
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@pgflow/client",
3
- "version": "0.0.0-update-supabase-ba45e13a-20251119080026",
3
+ "version": "0.0.0-worker-compilation-b0fe6186-20251201124606",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "dependencies": {
7
7
  "@supabase/supabase-js": "^2.49.4",
8
8
  "nanoevents": "^7.0.1",
9
9
  "uuid": "^9.0.0",
10
- "@pgflow/core": "0.0.0-update-supabase-ba45e13a-20251119080026",
11
- "@pgflow/dsl": "0.0.0-update-supabase-ba45e13a-20251119080026"
10
+ "@pgflow/core": "0.0.0-worker-compilation-b0fe6186-20251201124606",
11
+ "@pgflow/dsl": "0.0.0-worker-compilation-b0fe6186-20251201124606"
12
12
  },
13
13
  "main": "./dist/index.js",
14
14
  "module": "./dist/index.js",
@@ -40,11 +40,10 @@
40
40
  "devDependencies": {
41
41
  "@types/uuid": "^10.0.0",
42
42
  "postgres": "^3.4.5",
43
- "supabase": "^2.34.3",
44
43
  "terser": "^5.43.0",
45
44
  "vite-plugin-dts": "~3.8.1",
46
45
  "vitest": "1.3.1",
47
- "@pgflow/dsl": "0.0.0-update-supabase-ba45e13a-20251119080026"
46
+ "@pgflow/dsl": "0.0.0-worker-compilation-b0fe6186-20251201124606"
48
47
  },
49
48
  "scripts": {
50
49
  "verify-exports": "node scripts/verify-exports.js"