@pgflow/dsl 0.0.0-fix-supa-version-d565b97a-20251124083521 → 0.0.0-fix-max-conn-2da7657d-20260112035120
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/README.md +57 -50
- package/dist/CHANGELOG.md +41 -1
- package/dist/README.md +57 -50
- package/dist/dsl.d.ts +58 -35
- package/dist/dsl.d.ts.map +1 -1
- package/dist/dsl.js +10 -19
- package/dist/example-flow.d.ts +1 -1
- package/dist/example-flow.d.ts.map +1 -1
- package/dist/example-flow.js +16 -7
- package/dist/flow-shape.d.ts +81 -0
- package/dist/flow-shape.d.ts.map +1 -0
- package/dist/flow-shape.js +119 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/package.json +6 -1
- package/dist/platforms/supabase.d.ts +4 -3
- package/dist/platforms/supabase.d.ts.map +1 -1
- package/package.json +6 -1
package/README.md
CHANGED
|
@@ -31,30 +31,30 @@ type Input = {
|
|
|
31
31
|
|
|
32
32
|
// Define a flow with steps and dependencies
|
|
33
33
|
export const AnalyzeWebsite = new Flow<Input>({
|
|
34
|
-
slug: '
|
|
34
|
+
slug: 'analyzeWebsite',
|
|
35
35
|
maxAttempts: 3,
|
|
36
36
|
baseDelay: 5,
|
|
37
37
|
timeout: 10,
|
|
38
38
|
})
|
|
39
39
|
.step(
|
|
40
40
|
{ slug: 'website' },
|
|
41
|
-
async (
|
|
41
|
+
async (flowInput) => await scrapeWebsite(flowInput.url)
|
|
42
42
|
)
|
|
43
43
|
.step(
|
|
44
44
|
{ slug: 'sentiment', dependsOn: ['website'] },
|
|
45
|
-
async (
|
|
45
|
+
async (deps) => await analyzeSentiment(deps.website.content)
|
|
46
46
|
)
|
|
47
47
|
.step(
|
|
48
48
|
{ slug: 'summary', dependsOn: ['website'] },
|
|
49
|
-
async (
|
|
49
|
+
async (deps) => await summarizeWithAI(deps.website.content)
|
|
50
50
|
)
|
|
51
51
|
.step(
|
|
52
52
|
{ slug: 'saveToDb', dependsOn: ['sentiment', 'summary'] },
|
|
53
|
-
async (
|
|
53
|
+
async (deps, ctx) => {
|
|
54
54
|
return await saveToDb({
|
|
55
|
-
websiteUrl:
|
|
56
|
-
sentiment:
|
|
57
|
-
summary:
|
|
55
|
+
websiteUrl: ctx.flowInput.url,
|
|
56
|
+
sentiment: deps.sentiment.score,
|
|
57
|
+
summary: deps.summary.aiSummary,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
);
|
|
@@ -62,16 +62,22 @@ export const AnalyzeWebsite = new Flow<Input>({
|
|
|
62
62
|
|
|
63
63
|
### Understanding Data Flow
|
|
64
64
|
|
|
65
|
-
In pgflow,
|
|
65
|
+
In pgflow, step handlers use **asymmetric signatures** based on whether they have dependencies:
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
**Root steps (no dependencies):**
|
|
68
|
+
- First parameter: `flowInput` - the original flow input directly
|
|
69
|
+
- Second parameter: `ctx` - context object (env, supabase, flowInput, etc.)
|
|
70
|
+
|
|
71
|
+
**Dependent steps (with dependsOn):**
|
|
72
|
+
- First parameter: `deps` - object with outputs from dependency steps (`deps.{stepName}`)
|
|
73
|
+
- Second parameter: `ctx` - context object (includes `ctx.flowInput` if needed)
|
|
69
74
|
|
|
70
75
|
This design ensures:
|
|
71
76
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
77
|
+
- Root steps receive flow input directly for clean, simple handlers
|
|
78
|
+
- Dependent steps focus on their dependencies without wrapping
|
|
79
|
+
- Original flow input is always accessible via `ctx.flowInput` when needed
|
|
80
|
+
- Steps can combine dependency outputs with original input via context
|
|
75
81
|
|
|
76
82
|
### Step Methods
|
|
77
83
|
|
|
@@ -84,8 +90,9 @@ The standard method for adding steps to a flow. Each step processes input and re
|
|
|
84
90
|
```typescript
|
|
85
91
|
.step(
|
|
86
92
|
{ slug: 'process', dependsOn: ['previous'] },
|
|
87
|
-
async (
|
|
88
|
-
// Access
|
|
93
|
+
async (deps, ctx) => {
|
|
94
|
+
// Access deps.previous for dependency output
|
|
95
|
+
// Access ctx.flowInput if original flow input is needed
|
|
89
96
|
return { result: 'processed' };
|
|
90
97
|
}
|
|
91
98
|
)
|
|
@@ -98,14 +105,14 @@ A semantic wrapper around `.step()` that provides type enforcement for steps tha
|
|
|
98
105
|
```typescript
|
|
99
106
|
// Fetch an array of items to be processed
|
|
100
107
|
.array(
|
|
101
|
-
{ slug: '
|
|
108
|
+
{ slug: 'fetchItems' },
|
|
102
109
|
async () => [1, 2, 3, 4, 5]
|
|
103
110
|
)
|
|
104
111
|
|
|
105
112
|
// With dependencies - combining data from multiple sources
|
|
106
113
|
.array(
|
|
107
|
-
{ slug: '
|
|
108
|
-
async (
|
|
114
|
+
{ slug: 'combineResults', dependsOn: ['source1', 'source2'] },
|
|
115
|
+
async (deps) => [...deps.source1, ...deps.source2]
|
|
109
116
|
)
|
|
110
117
|
```
|
|
111
118
|
|
|
@@ -131,7 +138,7 @@ Processes arrays element-by-element, similar to JavaScript's `Array.map()`. The
|
|
|
131
138
|
```typescript
|
|
132
139
|
// ROOT MAP - No array: property means use flow input
|
|
133
140
|
// Flow input MUST be an array (e.g., ["hello", "world"])
|
|
134
|
-
new Flow<string[]>({ slug: '
|
|
141
|
+
new Flow<string[]>({ slug: 'processStrings' })
|
|
135
142
|
.map(
|
|
136
143
|
{ slug: 'uppercase' }, // No array: property!
|
|
137
144
|
(item) => item.toUpperCase()
|
|
@@ -139,7 +146,7 @@ new Flow<string[]>({ slug: 'process_strings' })
|
|
|
139
146
|
// Each string in the input array gets uppercased in parallel
|
|
140
147
|
|
|
141
148
|
// DEPENDENT MAP - array: property specifies the source step
|
|
142
|
-
new Flow<{}>({ slug: '
|
|
149
|
+
new Flow<{}>({ slug: 'dataPipeline' })
|
|
143
150
|
.array({ slug: 'numbers' }, () => [1, 2, 3])
|
|
144
151
|
.map(
|
|
145
152
|
{ slug: 'double', array: 'numbers' }, // Processes 'numbers' output
|
|
@@ -166,7 +173,7 @@ The `.map()` method provides full TypeScript type inference for array elements:
|
|
|
166
173
|
```typescript
|
|
167
174
|
type User = { id: number; name: string };
|
|
168
175
|
|
|
169
|
-
new Flow<{}>({ slug: '
|
|
176
|
+
new Flow<{}>({ slug: 'userFlow' })
|
|
170
177
|
.array({ slug: 'users' }, (): User[] => [
|
|
171
178
|
{ id: 1, name: 'Alice' },
|
|
172
179
|
{ id: 2, name: 'Bob' }
|
|
@@ -181,7 +188,7 @@ new Flow<{}>({ slug: 'user_flow' })
|
|
|
181
188
|
|
|
182
189
|
```typescript
|
|
183
190
|
// Batch processing - process multiple items in parallel
|
|
184
|
-
new Flow<number[]>({ slug: '
|
|
191
|
+
new Flow<number[]>({ slug: 'batchProcessor' })
|
|
185
192
|
.map({ slug: 'validate' }, (item) => {
|
|
186
193
|
if (item < 0) throw new Error('Invalid item');
|
|
187
194
|
return item;
|
|
@@ -192,17 +199,17 @@ new Flow<number[]>({ slug: 'batch_processor' })
|
|
|
192
199
|
});
|
|
193
200
|
|
|
194
201
|
// Data transformation pipeline
|
|
195
|
-
new Flow<{}>({ slug: '
|
|
196
|
-
.step({ slug: '
|
|
197
|
-
.map({ slug: 'scrape', array: '
|
|
202
|
+
new Flow<{}>({ slug: 'etlPipeline' })
|
|
203
|
+
.step({ slug: 'fetchUrls' }, () => ['url1', 'url2', 'url3'])
|
|
204
|
+
.map({ slug: 'scrape', array: 'fetchUrls' }, async (url) => {
|
|
198
205
|
return await fetchContent(url);
|
|
199
206
|
})
|
|
200
207
|
.map({ slug: 'extract', array: 'scrape' }, (html) => {
|
|
201
208
|
return extractData(html);
|
|
202
209
|
})
|
|
203
|
-
.step({ slug: 'aggregate', dependsOn: ['extract'] }, (
|
|
204
|
-
//
|
|
205
|
-
return consolidateResults(
|
|
210
|
+
.step({ slug: 'aggregate', dependsOn: ['extract'] }, (deps) => {
|
|
211
|
+
// deps.extract is the aggregated array from all map tasks
|
|
212
|
+
return consolidateResults(deps.extract);
|
|
206
213
|
});
|
|
207
214
|
```
|
|
208
215
|
|
|
@@ -218,9 +225,9 @@ Step handlers can optionally receive a second parameter - the **context object**
|
|
|
218
225
|
```typescript
|
|
219
226
|
.step(
|
|
220
227
|
{ slug: 'saveToDb' },
|
|
221
|
-
async (
|
|
228
|
+
async (flowInput, ctx) => {
|
|
222
229
|
// Access platform resources through context
|
|
223
|
-
const result = await
|
|
230
|
+
const result = await ctx.sql`SELECT * FROM users WHERE id = ${flowInput.userId}`;
|
|
224
231
|
return result[0];
|
|
225
232
|
}
|
|
226
233
|
)
|
|
@@ -230,40 +237,40 @@ Step handlers can optionally receive a second parameter - the **context object**
|
|
|
230
237
|
|
|
231
238
|
All platforms provide these core resources:
|
|
232
239
|
|
|
233
|
-
- **`
|
|
234
|
-
- **`
|
|
235
|
-
- **`
|
|
240
|
+
- **`ctx.env`** - Environment variables (`Record<string, string | undefined>`)
|
|
241
|
+
- **`ctx.flowInput`** - Original flow input (typed as the flow's input type)
|
|
242
|
+
- **`ctx.shutdownSignal`** - AbortSignal for graceful shutdown handling
|
|
243
|
+
- **`ctx.rawMessage`** - Original pgmq message with metadata
|
|
236
244
|
```typescript
|
|
237
245
|
interface PgmqMessageRecord<T> {
|
|
238
246
|
msg_id: number;
|
|
239
247
|
read_ct: number;
|
|
240
248
|
enqueued_at: Date;
|
|
241
249
|
vt: Date;
|
|
242
|
-
message: T;
|
|
250
|
+
message: T;
|
|
243
251
|
}
|
|
244
252
|
```
|
|
245
|
-
- **`
|
|
253
|
+
- **`ctx.stepTask`** - Current step task details (flow handlers only)
|
|
246
254
|
```typescript
|
|
247
255
|
interface StepTaskRecord<TFlow> {
|
|
248
256
|
flow_slug: string;
|
|
249
257
|
run_id: string;
|
|
250
258
|
step_slug: string;
|
|
251
|
-
input: StepInput<TFlow, StepSlug>; // <-- this is handler 'input'
|
|
252
259
|
msg_id: number;
|
|
253
260
|
}
|
|
254
261
|
```
|
|
255
|
-
- **`
|
|
262
|
+
- **`ctx.workerConfig`** - Resolved worker configuration with all defaults applied
|
|
256
263
|
```typescript
|
|
257
264
|
// Provides access to worker settings like retry limits
|
|
258
|
-
const isLastAttempt =
|
|
265
|
+
const isLastAttempt = ctx.rawMessage.read_ct >= ctx.workerConfig.retry.limit;
|
|
259
266
|
```
|
|
260
267
|
|
|
261
268
|
#### Supabase Platform Resources
|
|
262
269
|
|
|
263
270
|
When using the Supabase platform with EdgeWorker, additional resources are available:
|
|
264
271
|
|
|
265
|
-
- **`
|
|
266
|
-
- **`
|
|
272
|
+
- **`ctx.sql`** - PostgreSQL client (postgres.js)
|
|
273
|
+
- **`ctx.supabase`** - Supabase client with service role key for full database access
|
|
267
274
|
|
|
268
275
|
To use Supabase resources, import the `Flow` class from the Supabase preset:
|
|
269
276
|
|
|
@@ -271,18 +278,18 @@ To use Supabase resources, import the `Flow` class from the Supabase preset:
|
|
|
271
278
|
import { Flow } from '@pgflow/dsl/supabase';
|
|
272
279
|
|
|
273
280
|
const MyFlow = new Flow<{ userId: string }>({
|
|
274
|
-
slug: '
|
|
275
|
-
}).step({ slug: 'process' }, async (
|
|
276
|
-
// TypeScript knows
|
|
277
|
-
const { data } = await
|
|
281
|
+
slug: 'myFlow',
|
|
282
|
+
}).step({ slug: 'process' }, async (flowInput, ctx) => {
|
|
283
|
+
// TypeScript knows ctx includes Supabase resources
|
|
284
|
+
const { data } = await ctx.supabase
|
|
278
285
|
.from('users')
|
|
279
286
|
.select('*')
|
|
280
|
-
.eq('id',
|
|
287
|
+
.eq('id', flowInput.userId);
|
|
281
288
|
|
|
282
289
|
// Use SQL directly
|
|
283
|
-
const stats = await
|
|
284
|
-
SELECT COUNT(*) as total FROM events
|
|
285
|
-
WHERE user_id = ${
|
|
290
|
+
const stats = await ctx.sql`
|
|
291
|
+
SELECT COUNT(*) as total FROM events
|
|
292
|
+
WHERE user_id = ${flowInput.userId}
|
|
286
293
|
`;
|
|
287
294
|
|
|
288
295
|
return { user: data[0], eventCount: stats[0].total };
|
|
@@ -300,7 +307,7 @@ Configure flows and steps with runtime options:
|
|
|
300
307
|
|
|
301
308
|
```typescript
|
|
302
309
|
new Flow<Input>({
|
|
303
|
-
slug: '
|
|
310
|
+
slug: 'myFlow', // Required: Unique flow identifier
|
|
304
311
|
maxAttempts: 3, // Optional: Maximum retry attempts (default: 1)
|
|
305
312
|
baseDelay: 5, // Optional: Base delay in seconds for retries (default: 1)
|
|
306
313
|
timeout: 10, // Optional: Task timeout in seconds (default: 30)
|
package/dist/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,46 @@
|
|
|
1
1
|
# @pgflow/dsl
|
|
2
2
|
|
|
3
|
-
## 0.0.0-fix-
|
|
3
|
+
## 0.0.0-fix-max-conn-2da7657d-20260112035120
|
|
4
|
+
|
|
5
|
+
## 0.13.1
|
|
6
|
+
|
|
7
|
+
## 0.13.0
|
|
8
|
+
|
|
9
|
+
## 0.12.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 37402eb: BREAKING: Asymmetric handler signatures - remove `run` key from step inputs
|
|
14
|
+
|
|
15
|
+
- Root steps: `(flowInput, ctx) => ...` - flow input directly as first param
|
|
16
|
+
- Dependent steps: `(deps, ctx) => ...` - only dependency outputs as first param
|
|
17
|
+
- Access flow input in dependent steps via `await ctx.flowInput` (async/lazy-loaded)
|
|
18
|
+
- Lazy loading prevents data duplication for map steps processing large arrays
|
|
19
|
+
- Enables functional composition and simplifies types for future subflows
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- 5dc5cfc: Fix Supabase Edge Runtime compatibility by replacing npm:postgres with jsr:@oscar6echo/postgres fork. The npm package fails to parse database URLs in Deno edge environments, causing CONNECT_TIMEOUT errors.
|
|
24
|
+
|
|
25
|
+
## 0.11.0
|
|
26
|
+
|
|
27
|
+
## 0.10.0
|
|
28
|
+
|
|
29
|
+
### Patch Changes
|
|
30
|
+
|
|
31
|
+
- 0b84bb0: Add automatic flow compilation at worker startup. Workers now call ensure_flow_compiled to verify flows are up-to-date. In development, mismatched flows are recompiled automatically. In production, mismatches cause errors. Use ensureCompiledOnStartup: false to opt-out.
|
|
32
|
+
|
|
33
|
+
## 0.9.1
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 992a86b: Unify connection configuration with improved local detection. The `connectionString` config option now works correctly, and you can pass a raw postgres.js `sql` instance via `config.sql` for full control over connection options (SSL, pooling, etc.).
|
|
38
|
+
|
|
39
|
+
Fixes [#469](https://github.com/pgflow-dev/pgflow/issues/469), [#424](https://github.com/pgflow-dev/pgflow/issues/424). Thanks to [@Nciso](https://github.com/Nciso), [@mikz](https://github.com/mikz), [@ddlaws0n](https://github.com/ddlaws0n), and **PixelEcho** for feedback and bug reports.
|
|
40
|
+
|
|
41
|
+
## 0.9.0
|
|
42
|
+
|
|
43
|
+
## 0.8.1
|
|
4
44
|
|
|
5
45
|
## 0.8.0
|
|
6
46
|
|
package/dist/README.md
CHANGED
|
@@ -31,30 +31,30 @@ type Input = {
|
|
|
31
31
|
|
|
32
32
|
// Define a flow with steps and dependencies
|
|
33
33
|
export const AnalyzeWebsite = new Flow<Input>({
|
|
34
|
-
slug: '
|
|
34
|
+
slug: 'analyzeWebsite',
|
|
35
35
|
maxAttempts: 3,
|
|
36
36
|
baseDelay: 5,
|
|
37
37
|
timeout: 10,
|
|
38
38
|
})
|
|
39
39
|
.step(
|
|
40
40
|
{ slug: 'website' },
|
|
41
|
-
async (
|
|
41
|
+
async (flowInput) => await scrapeWebsite(flowInput.url)
|
|
42
42
|
)
|
|
43
43
|
.step(
|
|
44
44
|
{ slug: 'sentiment', dependsOn: ['website'] },
|
|
45
|
-
async (
|
|
45
|
+
async (deps) => await analyzeSentiment(deps.website.content)
|
|
46
46
|
)
|
|
47
47
|
.step(
|
|
48
48
|
{ slug: 'summary', dependsOn: ['website'] },
|
|
49
|
-
async (
|
|
49
|
+
async (deps) => await summarizeWithAI(deps.website.content)
|
|
50
50
|
)
|
|
51
51
|
.step(
|
|
52
52
|
{ slug: 'saveToDb', dependsOn: ['sentiment', 'summary'] },
|
|
53
|
-
async (
|
|
53
|
+
async (deps, ctx) => {
|
|
54
54
|
return await saveToDb({
|
|
55
|
-
websiteUrl:
|
|
56
|
-
sentiment:
|
|
57
|
-
summary:
|
|
55
|
+
websiteUrl: ctx.flowInput.url,
|
|
56
|
+
sentiment: deps.sentiment.score,
|
|
57
|
+
summary: deps.summary.aiSummary,
|
|
58
58
|
});
|
|
59
59
|
}
|
|
60
60
|
);
|
|
@@ -62,16 +62,22 @@ export const AnalyzeWebsite = new Flow<Input>({
|
|
|
62
62
|
|
|
63
63
|
### Understanding Data Flow
|
|
64
64
|
|
|
65
|
-
In pgflow,
|
|
65
|
+
In pgflow, step handlers use **asymmetric signatures** based on whether they have dependencies:
|
|
66
66
|
|
|
67
|
-
|
|
68
|
-
|
|
67
|
+
**Root steps (no dependencies):**
|
|
68
|
+
- First parameter: `flowInput` - the original flow input directly
|
|
69
|
+
- Second parameter: `ctx` - context object (env, supabase, flowInput, etc.)
|
|
70
|
+
|
|
71
|
+
**Dependent steps (with dependsOn):**
|
|
72
|
+
- First parameter: `deps` - object with outputs from dependency steps (`deps.{stepName}`)
|
|
73
|
+
- Second parameter: `ctx` - context object (includes `ctx.flowInput` if needed)
|
|
69
74
|
|
|
70
75
|
This design ensures:
|
|
71
76
|
|
|
72
|
-
-
|
|
73
|
-
-
|
|
74
|
-
-
|
|
77
|
+
- Root steps receive flow input directly for clean, simple handlers
|
|
78
|
+
- Dependent steps focus on their dependencies without wrapping
|
|
79
|
+
- Original flow input is always accessible via `ctx.flowInput` when needed
|
|
80
|
+
- Steps can combine dependency outputs with original input via context
|
|
75
81
|
|
|
76
82
|
### Step Methods
|
|
77
83
|
|
|
@@ -84,8 +90,9 @@ The standard method for adding steps to a flow. Each step processes input and re
|
|
|
84
90
|
```typescript
|
|
85
91
|
.step(
|
|
86
92
|
{ slug: 'process', dependsOn: ['previous'] },
|
|
87
|
-
async (
|
|
88
|
-
// Access
|
|
93
|
+
async (deps, ctx) => {
|
|
94
|
+
// Access deps.previous for dependency output
|
|
95
|
+
// Access ctx.flowInput if original flow input is needed
|
|
89
96
|
return { result: 'processed' };
|
|
90
97
|
}
|
|
91
98
|
)
|
|
@@ -98,14 +105,14 @@ A semantic wrapper around `.step()` that provides type enforcement for steps tha
|
|
|
98
105
|
```typescript
|
|
99
106
|
// Fetch an array of items to be processed
|
|
100
107
|
.array(
|
|
101
|
-
{ slug: '
|
|
108
|
+
{ slug: 'fetchItems' },
|
|
102
109
|
async () => [1, 2, 3, 4, 5]
|
|
103
110
|
)
|
|
104
111
|
|
|
105
112
|
// With dependencies - combining data from multiple sources
|
|
106
113
|
.array(
|
|
107
|
-
{ slug: '
|
|
108
|
-
async (
|
|
114
|
+
{ slug: 'combineResults', dependsOn: ['source1', 'source2'] },
|
|
115
|
+
async (deps) => [...deps.source1, ...deps.source2]
|
|
109
116
|
)
|
|
110
117
|
```
|
|
111
118
|
|
|
@@ -131,7 +138,7 @@ Processes arrays element-by-element, similar to JavaScript's `Array.map()`. The
|
|
|
131
138
|
```typescript
|
|
132
139
|
// ROOT MAP - No array: property means use flow input
|
|
133
140
|
// Flow input MUST be an array (e.g., ["hello", "world"])
|
|
134
|
-
new Flow<string[]>({ slug: '
|
|
141
|
+
new Flow<string[]>({ slug: 'processStrings' })
|
|
135
142
|
.map(
|
|
136
143
|
{ slug: 'uppercase' }, // No array: property!
|
|
137
144
|
(item) => item.toUpperCase()
|
|
@@ -139,7 +146,7 @@ new Flow<string[]>({ slug: 'process_strings' })
|
|
|
139
146
|
// Each string in the input array gets uppercased in parallel
|
|
140
147
|
|
|
141
148
|
// DEPENDENT MAP - array: property specifies the source step
|
|
142
|
-
new Flow<{}>({ slug: '
|
|
149
|
+
new Flow<{}>({ slug: 'dataPipeline' })
|
|
143
150
|
.array({ slug: 'numbers' }, () => [1, 2, 3])
|
|
144
151
|
.map(
|
|
145
152
|
{ slug: 'double', array: 'numbers' }, // Processes 'numbers' output
|
|
@@ -166,7 +173,7 @@ The `.map()` method provides full TypeScript type inference for array elements:
|
|
|
166
173
|
```typescript
|
|
167
174
|
type User = { id: number; name: string };
|
|
168
175
|
|
|
169
|
-
new Flow<{}>({ slug: '
|
|
176
|
+
new Flow<{}>({ slug: 'userFlow' })
|
|
170
177
|
.array({ slug: 'users' }, (): User[] => [
|
|
171
178
|
{ id: 1, name: 'Alice' },
|
|
172
179
|
{ id: 2, name: 'Bob' }
|
|
@@ -181,7 +188,7 @@ new Flow<{}>({ slug: 'user_flow' })
|
|
|
181
188
|
|
|
182
189
|
```typescript
|
|
183
190
|
// Batch processing - process multiple items in parallel
|
|
184
|
-
new Flow<number[]>({ slug: '
|
|
191
|
+
new Flow<number[]>({ slug: 'batchProcessor' })
|
|
185
192
|
.map({ slug: 'validate' }, (item) => {
|
|
186
193
|
if (item < 0) throw new Error('Invalid item');
|
|
187
194
|
return item;
|
|
@@ -192,17 +199,17 @@ new Flow<number[]>({ slug: 'batch_processor' })
|
|
|
192
199
|
});
|
|
193
200
|
|
|
194
201
|
// Data transformation pipeline
|
|
195
|
-
new Flow<{}>({ slug: '
|
|
196
|
-
.step({ slug: '
|
|
197
|
-
.map({ slug: 'scrape', array: '
|
|
202
|
+
new Flow<{}>({ slug: 'etlPipeline' })
|
|
203
|
+
.step({ slug: 'fetchUrls' }, () => ['url1', 'url2', 'url3'])
|
|
204
|
+
.map({ slug: 'scrape', array: 'fetchUrls' }, async (url) => {
|
|
198
205
|
return await fetchContent(url);
|
|
199
206
|
})
|
|
200
207
|
.map({ slug: 'extract', array: 'scrape' }, (html) => {
|
|
201
208
|
return extractData(html);
|
|
202
209
|
})
|
|
203
|
-
.step({ slug: 'aggregate', dependsOn: ['extract'] }, (
|
|
204
|
-
//
|
|
205
|
-
return consolidateResults(
|
|
210
|
+
.step({ slug: 'aggregate', dependsOn: ['extract'] }, (deps) => {
|
|
211
|
+
// deps.extract is the aggregated array from all map tasks
|
|
212
|
+
return consolidateResults(deps.extract);
|
|
206
213
|
});
|
|
207
214
|
```
|
|
208
215
|
|
|
@@ -218,9 +225,9 @@ Step handlers can optionally receive a second parameter - the **context object**
|
|
|
218
225
|
```typescript
|
|
219
226
|
.step(
|
|
220
227
|
{ slug: 'saveToDb' },
|
|
221
|
-
async (
|
|
228
|
+
async (flowInput, ctx) => {
|
|
222
229
|
// Access platform resources through context
|
|
223
|
-
const result = await
|
|
230
|
+
const result = await ctx.sql`SELECT * FROM users WHERE id = ${flowInput.userId}`;
|
|
224
231
|
return result[0];
|
|
225
232
|
}
|
|
226
233
|
)
|
|
@@ -230,40 +237,40 @@ Step handlers can optionally receive a second parameter - the **context object**
|
|
|
230
237
|
|
|
231
238
|
All platforms provide these core resources:
|
|
232
239
|
|
|
233
|
-
- **`
|
|
234
|
-
- **`
|
|
235
|
-
- **`
|
|
240
|
+
- **`ctx.env`** - Environment variables (`Record<string, string | undefined>`)
|
|
241
|
+
- **`ctx.flowInput`** - Original flow input (typed as the flow's input type)
|
|
242
|
+
- **`ctx.shutdownSignal`** - AbortSignal for graceful shutdown handling
|
|
243
|
+
- **`ctx.rawMessage`** - Original pgmq message with metadata
|
|
236
244
|
```typescript
|
|
237
245
|
interface PgmqMessageRecord<T> {
|
|
238
246
|
msg_id: number;
|
|
239
247
|
read_ct: number;
|
|
240
248
|
enqueued_at: Date;
|
|
241
249
|
vt: Date;
|
|
242
|
-
message: T;
|
|
250
|
+
message: T;
|
|
243
251
|
}
|
|
244
252
|
```
|
|
245
|
-
- **`
|
|
253
|
+
- **`ctx.stepTask`** - Current step task details (flow handlers only)
|
|
246
254
|
```typescript
|
|
247
255
|
interface StepTaskRecord<TFlow> {
|
|
248
256
|
flow_slug: string;
|
|
249
257
|
run_id: string;
|
|
250
258
|
step_slug: string;
|
|
251
|
-
input: StepInput<TFlow, StepSlug>; // <-- this is handler 'input'
|
|
252
259
|
msg_id: number;
|
|
253
260
|
}
|
|
254
261
|
```
|
|
255
|
-
- **`
|
|
262
|
+
- **`ctx.workerConfig`** - Resolved worker configuration with all defaults applied
|
|
256
263
|
```typescript
|
|
257
264
|
// Provides access to worker settings like retry limits
|
|
258
|
-
const isLastAttempt =
|
|
265
|
+
const isLastAttempt = ctx.rawMessage.read_ct >= ctx.workerConfig.retry.limit;
|
|
259
266
|
```
|
|
260
267
|
|
|
261
268
|
#### Supabase Platform Resources
|
|
262
269
|
|
|
263
270
|
When using the Supabase platform with EdgeWorker, additional resources are available:
|
|
264
271
|
|
|
265
|
-
- **`
|
|
266
|
-
- **`
|
|
272
|
+
- **`ctx.sql`** - PostgreSQL client (postgres.js)
|
|
273
|
+
- **`ctx.supabase`** - Supabase client with service role key for full database access
|
|
267
274
|
|
|
268
275
|
To use Supabase resources, import the `Flow` class from the Supabase preset:
|
|
269
276
|
|
|
@@ -271,18 +278,18 @@ To use Supabase resources, import the `Flow` class from the Supabase preset:
|
|
|
271
278
|
import { Flow } from '@pgflow/dsl/supabase';
|
|
272
279
|
|
|
273
280
|
const MyFlow = new Flow<{ userId: string }>({
|
|
274
|
-
slug: '
|
|
275
|
-
}).step({ slug: 'process' }, async (
|
|
276
|
-
// TypeScript knows
|
|
277
|
-
const { data } = await
|
|
281
|
+
slug: 'myFlow',
|
|
282
|
+
}).step({ slug: 'process' }, async (flowInput, ctx) => {
|
|
283
|
+
// TypeScript knows ctx includes Supabase resources
|
|
284
|
+
const { data } = await ctx.supabase
|
|
278
285
|
.from('users')
|
|
279
286
|
.select('*')
|
|
280
|
-
.eq('id',
|
|
287
|
+
.eq('id', flowInput.userId);
|
|
281
288
|
|
|
282
289
|
// Use SQL directly
|
|
283
|
-
const stats = await
|
|
284
|
-
SELECT COUNT(*) as total FROM events
|
|
285
|
-
WHERE user_id = ${
|
|
290
|
+
const stats = await ctx.sql`
|
|
291
|
+
SELECT COUNT(*) as total FROM events
|
|
292
|
+
WHERE user_id = ${flowInput.userId}
|
|
286
293
|
`;
|
|
287
294
|
|
|
288
295
|
return { user: data[0], eventCount: stats[0].total };
|
|
@@ -300,7 +307,7 @@ Configure flows and steps with runtime options:
|
|
|
300
307
|
|
|
301
308
|
```typescript
|
|
302
309
|
new Flow<Input>({
|
|
303
|
-
slug: '
|
|
310
|
+
slug: 'myFlow', // Required: Unique flow identifier
|
|
304
311
|
maxAttempts: 3, // Optional: Maximum retry attempts (default: 1)
|
|
305
312
|
baseDelay: 5, // Optional: Base delay in seconds for retries (default: 1)
|
|
306
313
|
timeout: 10, // Optional: Task timeout in seconds (default: 30)
|
package/dist/dsl.d.ts
CHANGED
|
@@ -106,15 +106,14 @@ export type ExtractFlowLeafSteps<TFlow extends AnyFlow> = {
|
|
|
106
106
|
};
|
|
107
107
|
export type StepOutput<TFlow extends AnyFlow, TStepSlug extends string> = TStepSlug extends keyof ExtractFlowSteps<TFlow> ? ExtractFlowSteps<TFlow>[TStepSlug] : never;
|
|
108
108
|
/**
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
109
|
+
* Asymmetric step input type:
|
|
110
|
+
* - Root steps (no dependencies): receive flow input directly
|
|
111
|
+
* - Dependent steps: receive only their dependencies (flow input available via context)
|
|
112
|
+
*
|
|
113
|
+
* This enables functional composition where subflows can receive typed inputs
|
|
114
|
+
* without the 'run' wrapper that previously blocked type matching.
|
|
114
115
|
*/
|
|
115
|
-
export type StepInput<TFlow extends AnyFlow, TStepSlug extends string> = {
|
|
116
|
-
run: ExtractFlowInput<TFlow>;
|
|
117
|
-
} & {
|
|
116
|
+
export type StepInput<TFlow extends AnyFlow, TStepSlug extends string> = StepDepsOf<TFlow, TStepSlug> extends never ? ExtractFlowInput<TFlow> : {
|
|
118
117
|
[K in Extract<keyof ExtractFlowSteps<TFlow>, StepDepsOf<TFlow, TStepSlug>>]: ExtractFlowSteps<TFlow>[K];
|
|
119
118
|
};
|
|
120
119
|
export interface RuntimeOptions {
|
|
@@ -149,8 +148,16 @@ export interface BaseContext<TEnv extends Env = Env> {
|
|
|
149
148
|
rawMessage: MessageRecord;
|
|
150
149
|
workerConfig: Readonly<WorkerConfig>;
|
|
151
150
|
}
|
|
152
|
-
|
|
151
|
+
/**
|
|
152
|
+
* Flow context extends base with stepTask and flowInput.
|
|
153
|
+
*
|
|
154
|
+
* Note: flowInput is a Promise to support lazy loading. Only root non-map steps
|
|
155
|
+
* receive flow_input from SQL; other step types lazy-load it on demand.
|
|
156
|
+
* Use `await ctx.flowInput` to access the original flow input.
|
|
157
|
+
*/
|
|
158
|
+
export interface FlowContext<TEnv extends Env = Env, TFlowInput extends AnyInput = AnyInput> extends BaseContext<TEnv> {
|
|
153
159
|
stepTask: StepTaskRecord<AnyFlow>;
|
|
160
|
+
flowInput: Promise<TFlowInput>;
|
|
154
161
|
}
|
|
155
162
|
export type Context<T extends Record<string, unknown> = Record<string, never>, TEnv extends Env = Env> = FlowContext<TEnv> & T;
|
|
156
163
|
export interface StepRuntimeOptions extends RuntimeOptions {
|
|
@@ -181,22 +188,32 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
|
|
|
181
188
|
} & RuntimeOptions>, stepDefinitions?: Record<string, StepDefinition<AnyInput, AnyOutput>>, stepOrder?: string[]);
|
|
182
189
|
/**
|
|
183
190
|
* Get a specific step definition by slug with proper typing
|
|
191
|
+
*
|
|
192
|
+
* Returns the step definition with asymmetric input typing:
|
|
193
|
+
* - Root steps (no dependencies): input is flowInput directly
|
|
194
|
+
* - Dependent steps: input is deps object only (flowInput available via context)
|
|
195
|
+
*
|
|
184
196
|
* @throws Error if the step with the given slug doesn't exist
|
|
185
197
|
*/
|
|
186
|
-
getStepDefinition<SlugType extends keyof Steps & keyof StepDependencies>(slug: SlugType): StepDefinition<Simplify<{
|
|
187
|
-
run: TFlowInput;
|
|
188
|
-
} & {
|
|
198
|
+
getStepDefinition<SlugType extends keyof Steps & keyof StepDependencies>(slug: SlugType): StepDefinition<StepDependencies[SlugType] extends [] | readonly [] ? TFlowInput : Simplify<{
|
|
189
199
|
[K in StepDependencies[SlugType][number]]: K extends keyof Steps ? Steps[K] : never;
|
|
190
|
-
}>,
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
} & {
|
|
194
|
-
[K in Deps]: K extends keyof Steps ? Steps[K] : never;
|
|
195
|
-
}>, context: FlowContext<TEnv> & TContext) => any, Deps extends Extract<keyof Steps, string> = never>(opts: Simplify<{
|
|
200
|
+
}>, // Dependent step: only deps
|
|
201
|
+
Steps[SlugType], FlowContext<TEnv, TFlowInput> & TContext>;
|
|
202
|
+
step<Slug extends string, TOutput>(opts: Simplify<{
|
|
196
203
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
197
|
-
dependsOn?:
|
|
198
|
-
} & StepRuntimeOptions>, handler:
|
|
199
|
-
[K in Slug]:
|
|
204
|
+
dependsOn?: never;
|
|
205
|
+
} & StepRuntimeOptions>, handler: (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
|
|
206
|
+
[K in Slug]: Awaited<TOutput>;
|
|
207
|
+
}, StepDependencies & {
|
|
208
|
+
[K in Slug]: [];
|
|
209
|
+
}, TEnv>;
|
|
210
|
+
step<Slug extends string, Deps extends Extract<keyof Steps, string>, TOutput>(opts: Simplify<{
|
|
211
|
+
slug: Slug extends keyof Steps ? never : Slug;
|
|
212
|
+
dependsOn: [Deps, ...Deps[]];
|
|
213
|
+
} & StepRuntimeOptions>, handler: (deps: {
|
|
214
|
+
[K in Deps]: K extends keyof Steps ? Steps[K] : never;
|
|
215
|
+
}, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
|
|
216
|
+
[K in Slug]: Awaited<TOutput>;
|
|
200
217
|
}, StepDependencies & {
|
|
201
218
|
[K in Slug]: Deps[];
|
|
202
219
|
}, TEnv>;
|
|
@@ -213,15 +230,21 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
|
|
|
213
230
|
* @param handler - Function that processes input and returns an array (null/undefined rejected)
|
|
214
231
|
* @returns A new Flow instance with the array step added
|
|
215
232
|
*/
|
|
216
|
-
array<Slug extends string,
|
|
217
|
-
run: TFlowInput;
|
|
218
|
-
} & {
|
|
219
|
-
[K in Deps]: K extends keyof Steps ? Steps[K] : never;
|
|
220
|
-
}>, context: BaseContext & TContext) => readonly any[] | Promise<readonly any[]>, Deps extends Extract<keyof Steps, string> = never>(opts: Simplify<{
|
|
233
|
+
array<Slug extends string, TOutput extends readonly any[]>(opts: Simplify<{
|
|
221
234
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
222
|
-
dependsOn?:
|
|
223
|
-
} & StepRuntimeOptions>, handler:
|
|
224
|
-
[K in Slug]:
|
|
235
|
+
dependsOn?: never;
|
|
236
|
+
} & StepRuntimeOptions>, handler: (flowInput: TFlowInput, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
|
|
237
|
+
[K in Slug]: Awaited<TOutput>;
|
|
238
|
+
}, StepDependencies & {
|
|
239
|
+
[K in Slug]: [];
|
|
240
|
+
}, TEnv>;
|
|
241
|
+
array<Slug extends string, Deps extends Extract<keyof Steps, string>, TOutput extends readonly any[]>(opts: Simplify<{
|
|
242
|
+
slug: Slug extends keyof Steps ? never : Slug;
|
|
243
|
+
dependsOn: [Deps, ...Deps[]];
|
|
244
|
+
} & StepRuntimeOptions>, handler: (deps: {
|
|
245
|
+
[K in Deps]: K extends keyof Steps ? Steps[K] : never;
|
|
246
|
+
}, context: FlowContext<TEnv, TFlowInput> & TContext) => TOutput | Promise<TOutput>): Flow<TFlowInput, TContext, Steps & {
|
|
247
|
+
[K in Slug]: Awaited<TOutput>;
|
|
225
248
|
}, StepDependencies & {
|
|
226
249
|
[K in Slug]: Deps[];
|
|
227
250
|
}, TEnv>;
|
|
@@ -236,21 +259,21 @@ Steps extends AnySteps = EmptySteps, StepDependencies extends AnyDeps = EmptyDep
|
|
|
236
259
|
* @param handler - Function that processes individual array elements
|
|
237
260
|
* @returns A new Flow instance with the map step added
|
|
238
261
|
*/
|
|
239
|
-
map<Slug extends string, THandler extends TFlowInput extends readonly (infer Item)[] ? (item: Item, context:
|
|
262
|
+
map<Slug extends string, THandler extends TFlowInput extends readonly (infer Item)[] ? (item: Item, context: FlowContext<TEnv, TFlowInput> & TContext) => Json | Promise<Json> : never>(opts: Simplify<{
|
|
240
263
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
241
|
-
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext
|
|
264
|
+
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext, Steps & {
|
|
242
265
|
[K in Slug]: AwaitedReturn<THandler>[];
|
|
243
266
|
}, StepDependencies & {
|
|
244
267
|
[K in Slug]: [];
|
|
245
|
-
}>;
|
|
246
|
-
map<Slug extends string, TArrayDep extends Extract<keyof Steps, string>, THandler extends Steps[TArrayDep] extends readonly (infer Item)[] ? (item: Item, context:
|
|
268
|
+
}, TEnv>;
|
|
269
|
+
map<Slug extends string, TArrayDep extends Extract<keyof Steps, string>, THandler extends Steps[TArrayDep] extends readonly (infer Item)[] ? (item: Item, context: FlowContext<TEnv, TFlowInput> & TContext) => Json | Promise<Json> : never>(opts: Simplify<{
|
|
247
270
|
slug: Slug extends keyof Steps ? never : Slug;
|
|
248
271
|
array: TArrayDep;
|
|
249
|
-
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext
|
|
272
|
+
} & StepRuntimeOptions>, handler: THandler): Flow<TFlowInput, TContext, Steps & {
|
|
250
273
|
[K in Slug]: AwaitedReturn<THandler>[];
|
|
251
274
|
}, StepDependencies & {
|
|
252
275
|
[K in Slug]: [TArrayDep];
|
|
253
|
-
}>;
|
|
276
|
+
}, TEnv>;
|
|
254
277
|
}
|
|
255
278
|
export {};
|
|
256
279
|
//# sourceMapp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AG;SAAG,CAAC,IAAI,IAAI,GAAG,CAAC,SAAS,CAAC;KAAE,EAC/C,IAAI,CACL;CA8DF"}
|
package/dist/dsl.js
CHANGED
|
@@ -27,6 +27,11 @@ export class Flow {
|
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
29
|
* Get a specific step definition by slug with proper typing
|
|
30
|
+
*
|
|
31
|
+
* Returns the step definition with asymmetric input typing:
|
|
32
|
+
* - Root steps (no dependencies): input is flowInput directly
|
|
33
|
+
* - Dependent steps: input is deps object only (flowInput available via context)
|
|
34
|
+
*
|
|
30
35
|
* @throws Error if the step with the given slug doesn't exist
|
|
31
36
|
*/
|
|
32
37
|
getStepDefinition(slug) {
|
|
@@ -39,7 +44,7 @@ export class Flow {
|
|
|
39
44
|
// but we know it's safe because we only add steps through the strongly-typed `step` method
|
|
40
45
|
return this.stepDefinitions[slug];
|
|
41
46
|
}
|
|
42
|
-
//
|
|
47
|
+
// Implementation (type safety enforced by overloads above)
|
|
43
48
|
step(opts, handler) {
|
|
44
49
|
const slug = opts.slug;
|
|
45
50
|
// Validate the step slug
|
|
@@ -68,10 +73,10 @@ export class Flow {
|
|
|
68
73
|
options.startDelay = opts.startDelay;
|
|
69
74
|
// Validate runtime options (optional for step level)
|
|
70
75
|
validateRuntimeOptions(options, { optional: true });
|
|
71
|
-
//
|
|
76
|
+
// Create step definition (type assertions needed due to complex generic constraints)
|
|
72
77
|
const newStepDefinition = {
|
|
73
78
|
slug,
|
|
74
|
-
handler
|
|
79
|
+
handler,
|
|
75
80
|
dependencies: dependencies,
|
|
76
81
|
options,
|
|
77
82
|
};
|
|
@@ -82,24 +87,10 @@ export class Flow {
|
|
|
82
87
|
// Create a new stepOrder array with the new slug appended
|
|
83
88
|
const newStepOrder = [...this.stepOrder, slug];
|
|
84
89
|
// Create a new flow with the same slug and options but with updated type parameters
|
|
85
|
-
//
|
|
86
|
-
// between the specific step definition types and the generic Flow type parameters
|
|
87
|
-
// This is safe because we're constructing the newStepDefinitions in a type-safe way above
|
|
90
|
+
// Type safety is enforced by the overload signatures above
|
|
88
91
|
return new Flow({ slug: this.slug, ...this.options }, newStepDefinitions, newStepOrder);
|
|
89
92
|
}
|
|
90
|
-
|
|
91
|
-
* Add an array-returning step to the flow with compile-time type safety
|
|
92
|
-
*
|
|
93
|
-
* This method provides semantic clarity and type enforcement for steps that return arrays,
|
|
94
|
-
* while maintaining full compatibility with the existing step system by delegating to `.step()`.
|
|
95
|
-
*
|
|
96
|
-
* @template Slug - The unique identifier for this step
|
|
97
|
-
* @template THandler - The handler function that must return an array or Promise<array>
|
|
98
|
-
* @template Deps - The step dependencies (must be existing step slugs)
|
|
99
|
-
* @param opts - Step configuration including slug, dependencies, and runtime options
|
|
100
|
-
* @param handler - Function that processes input and returns an array (null/undefined rejected)
|
|
101
|
-
* @returns A new Flow instance with the array step added
|
|
102
|
-
*/
|
|
93
|
+
// Implementation
|
|
103
94
|
array(opts, handler) {
|
|
104
95
|
// Delegate to existing .step() method for maximum code reuse
|
|
105
96
|
return this.step(opts, handler);
|
package/dist/example-flow.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example-flow.d.ts","sourceRoot":"","sources":["../src/example-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"example-flow.d.ts","sourceRoot":"","sources":["../src/example-flow.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,KAAK,KAAK,GAAG;IACX,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;0BAiCxB,CAAC"}
|
package/dist/example-flow.js
CHANGED
|
@@ -5,14 +5,23 @@ export const AnalyzeWebsite = new Flow({
|
|
|
5
5
|
baseDelay: 5,
|
|
6
6
|
timeout: 10,
|
|
7
7
|
})
|
|
8
|
-
.step({ slug: 'website' },
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.step({ slug: '
|
|
8
|
+
.step({ slug: 'website' },
|
|
9
|
+
// Root step: receives flowInput directly
|
|
10
|
+
async (flowInput) => await scrapeWebsite(flowInput.url))
|
|
11
|
+
.step({ slug: 'sentiment', dependsOn: ['website'], timeout: 30, maxAttempts: 5 },
|
|
12
|
+
// Dependent step: receives deps, flowInput via context
|
|
13
|
+
async (deps) => await analyzeSentiment(deps.website.content))
|
|
14
|
+
.step({ slug: 'summary', dependsOn: ['website'] },
|
|
15
|
+
// Dependent step: receives deps
|
|
16
|
+
async (deps) => await summarizeWithAI(deps.website.content))
|
|
17
|
+
.step({ slug: 'saveToDb', dependsOn: ['sentiment', 'summary'] },
|
|
18
|
+
// Dependent step needing flowInput: access via await ctx.flowInput
|
|
19
|
+
async (deps, ctx) => {
|
|
20
|
+
const flowInput = await ctx.flowInput;
|
|
12
21
|
const results = await saveToDb({
|
|
13
|
-
websiteUrl:
|
|
14
|
-
sentiment:
|
|
15
|
-
summary:
|
|
22
|
+
websiteUrl: flowInput.url,
|
|
23
|
+
sentiment: deps.sentiment.score,
|
|
24
|
+
summary: deps.summary.aiSummary,
|
|
16
25
|
});
|
|
17
26
|
return results.status;
|
|
18
27
|
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { AnyFlow } from './dsl.js';
|
|
2
|
+
/**
|
|
3
|
+
* Step-level options that can be included in the shape for creation,
|
|
4
|
+
* but are NOT compared during shape comparison (runtime tunable).
|
|
5
|
+
*/
|
|
6
|
+
export interface StepShapeOptions {
|
|
7
|
+
maxAttempts?: number;
|
|
8
|
+
baseDelay?: number;
|
|
9
|
+
timeout?: number;
|
|
10
|
+
startDelay?: number;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Flow-level options that can be included in the shape for creation,
|
|
14
|
+
* but are NOT compared during shape comparison (runtime tunable).
|
|
15
|
+
*/
|
|
16
|
+
export interface FlowShapeOptions {
|
|
17
|
+
maxAttempts?: number;
|
|
18
|
+
baseDelay?: number;
|
|
19
|
+
timeout?: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* StepShape captures the structural definition of a step for drift detection.
|
|
23
|
+
*
|
|
24
|
+
* The `options` field is included for flow creation but NOT compared during
|
|
25
|
+
* shape comparison. Options can be tuned at runtime via SQL without
|
|
26
|
+
* requiring recompilation. See: /deploy/tune-flow-config/
|
|
27
|
+
*/
|
|
28
|
+
export interface StepShape {
|
|
29
|
+
slug: string;
|
|
30
|
+
stepType: 'single' | 'map';
|
|
31
|
+
dependencies: string[];
|
|
32
|
+
options?: StepShapeOptions;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* FlowShape captures the structural definition of a flow for drift detection.
|
|
36
|
+
*
|
|
37
|
+
* This represents the DAG topology - which steps exist, their types, and how
|
|
38
|
+
* they connect via dependencies.
|
|
39
|
+
*
|
|
40
|
+
* The `options` field is included for flow creation but NOT compared during
|
|
41
|
+
* shape comparison. Options can be tuned at runtime via SQL without recompilation.
|
|
42
|
+
*
|
|
43
|
+
* Note: flowSlug is intentionally excluded - it's an identifier, not structural
|
|
44
|
+
* data. The slug comes from context (URL, registry lookup, function parameter).
|
|
45
|
+
*/
|
|
46
|
+
export interface FlowShape {
|
|
47
|
+
steps: StepShape[];
|
|
48
|
+
options?: FlowShapeOptions;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Result of comparing two FlowShapes.
|
|
52
|
+
*/
|
|
53
|
+
export interface ShapeComparisonResult {
|
|
54
|
+
match: boolean;
|
|
55
|
+
differences: string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Extracts a FlowShape from a Flow object.
|
|
59
|
+
* The shape captures structural information needed for drift detection,
|
|
60
|
+
* plus options for flow creation.
|
|
61
|
+
*
|
|
62
|
+
* Options are included in the shape for proper flow/step creation, but
|
|
63
|
+
* are NOT compared during shape comparison (they're runtime tunable).
|
|
64
|
+
*
|
|
65
|
+
* @param flow - The Flow object to extract shape from
|
|
66
|
+
* @returns A FlowShape representing the flow's structure and options
|
|
67
|
+
*/
|
|
68
|
+
export declare function extractFlowShape(flow: AnyFlow): FlowShape;
|
|
69
|
+
/**
|
|
70
|
+
* Compares two FlowShapes and returns detailed differences.
|
|
71
|
+
* Used by ControlPlane for Layer 1 comparison (Worker vs ControlPlane).
|
|
72
|
+
*
|
|
73
|
+
* Only compares structural aspects (steps, types, dependencies).
|
|
74
|
+
* Runtime options are not compared as they can be tuned independently.
|
|
75
|
+
*
|
|
76
|
+
* @param a - First FlowShape (typically from worker)
|
|
77
|
+
* @param b - Second FlowShape (typically from ControlPlane or database)
|
|
78
|
+
* @returns ShapeComparisonResult with match status and list of differences
|
|
79
|
+
*/
|
|
80
|
+
export declare function compareFlowShapes(a: FlowShape, b: FlowShape): ShapeComparisonResult;
|
|
81
|
+
//# sourceMappingURL=flow-shape.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow-shape.d.ts","sourceRoot":"","sources":["../src/flow-shape.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAMnC;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;GAGG;AACH,MAAM,WAAW,gBAAgB;IAC/B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,QAAQ,GAAG,KAAK,CAAC;IAC3B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,SAAS,EAAE,CAAC;IACnB,OAAO,CAAC,EAAE,gBAAgB,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,OAAO,CAAC;IACf,WAAW,EAAE,MAAM,EAAE,CAAC;CACvB;AAyBD;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,GAAG,SAAS,CAwCzD;AAMD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAC/B,CAAC,EAAE,SAAS,EACZ,CAAC,EAAE,SAAS,GACX,qBAAqB,CA6BvB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
// ========================
|
|
2
|
+
// SHAPE EXTRACTION
|
|
3
|
+
// ========================
|
|
4
|
+
/**
|
|
5
|
+
* Checks if an options object has any defined (non-undefined) values.
|
|
6
|
+
*/
|
|
7
|
+
function hasDefinedOptions(options) {
|
|
8
|
+
return Object.values(options).some((v) => v !== undefined);
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Filters out undefined values from an options object.
|
|
12
|
+
* Returns only the keys with defined values.
|
|
13
|
+
*/
|
|
14
|
+
function filterDefinedOptions(options) {
|
|
15
|
+
return Object.fromEntries(Object.entries(options).filter(([_, v]) => v !== undefined));
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Extracts a FlowShape from a Flow object.
|
|
19
|
+
* The shape captures structural information needed for drift detection,
|
|
20
|
+
* plus options for flow creation.
|
|
21
|
+
*
|
|
22
|
+
* Options are included in the shape for proper flow/step creation, but
|
|
23
|
+
* are NOT compared during shape comparison (they're runtime tunable).
|
|
24
|
+
*
|
|
25
|
+
* @param flow - The Flow object to extract shape from
|
|
26
|
+
* @returns A FlowShape representing the flow's structure and options
|
|
27
|
+
*/
|
|
28
|
+
export function extractFlowShape(flow) {
|
|
29
|
+
const steps = flow.stepOrder.map((stepSlug) => {
|
|
30
|
+
const stepDef = flow.getStepDefinition(stepSlug);
|
|
31
|
+
const stepShape = {
|
|
32
|
+
slug: stepSlug,
|
|
33
|
+
stepType: stepDef.stepType ?? 'single',
|
|
34
|
+
// Sort dependencies alphabetically for deterministic comparison
|
|
35
|
+
dependencies: [...stepDef.dependencies].sort(),
|
|
36
|
+
};
|
|
37
|
+
// Only include options if at least one is defined
|
|
38
|
+
const stepOptions = {
|
|
39
|
+
maxAttempts: stepDef.options.maxAttempts,
|
|
40
|
+
baseDelay: stepDef.options.baseDelay,
|
|
41
|
+
timeout: stepDef.options.timeout,
|
|
42
|
+
startDelay: stepDef.options.startDelay,
|
|
43
|
+
};
|
|
44
|
+
if (hasDefinedOptions(stepOptions)) {
|
|
45
|
+
stepShape.options = filterDefinedOptions(stepOptions);
|
|
46
|
+
}
|
|
47
|
+
return stepShape;
|
|
48
|
+
});
|
|
49
|
+
const shape = { steps };
|
|
50
|
+
// Only include flow options if at least one is defined
|
|
51
|
+
const flowOptions = {
|
|
52
|
+
maxAttempts: flow.options.maxAttempts,
|
|
53
|
+
baseDelay: flow.options.baseDelay,
|
|
54
|
+
timeout: flow.options.timeout,
|
|
55
|
+
};
|
|
56
|
+
if (hasDefinedOptions(flowOptions)) {
|
|
57
|
+
shape.options = filterDefinedOptions(flowOptions);
|
|
58
|
+
}
|
|
59
|
+
return shape;
|
|
60
|
+
}
|
|
61
|
+
// ========================
|
|
62
|
+
// SHAPE COMPARISON
|
|
63
|
+
// ========================
|
|
64
|
+
/**
|
|
65
|
+
* Compares two FlowShapes and returns detailed differences.
|
|
66
|
+
* Used by ControlPlane for Layer 1 comparison (Worker vs ControlPlane).
|
|
67
|
+
*
|
|
68
|
+
* Only compares structural aspects (steps, types, dependencies).
|
|
69
|
+
* Runtime options are not compared as they can be tuned independently.
|
|
70
|
+
*
|
|
71
|
+
* @param a - First FlowShape (typically from worker)
|
|
72
|
+
* @param b - Second FlowShape (typically from ControlPlane or database)
|
|
73
|
+
* @returns ShapeComparisonResult with match status and list of differences
|
|
74
|
+
*/
|
|
75
|
+
export function compareFlowShapes(a, b) {
|
|
76
|
+
const differences = [];
|
|
77
|
+
// Compare step counts
|
|
78
|
+
if (a.steps.length !== b.steps.length) {
|
|
79
|
+
differences.push(`Step count differs: ${a.steps.length} vs ${b.steps.length}`);
|
|
80
|
+
}
|
|
81
|
+
// Compare steps by index (order matters)
|
|
82
|
+
const maxLen = Math.max(a.steps.length, b.steps.length);
|
|
83
|
+
for (let i = 0; i < maxLen; i++) {
|
|
84
|
+
const aStep = a.steps[i];
|
|
85
|
+
const bStep = b.steps[i];
|
|
86
|
+
if (!aStep) {
|
|
87
|
+
differences.push(`Step at index ${i}: missing in first shape (second has '${bStep.slug}')`);
|
|
88
|
+
}
|
|
89
|
+
else if (!bStep) {
|
|
90
|
+
differences.push(`Step at index ${i}: missing in second shape (first has '${aStep.slug}')`);
|
|
91
|
+
}
|
|
92
|
+
else {
|
|
93
|
+
compareSteps(aStep, bStep, i, differences);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
return {
|
|
97
|
+
match: differences.length === 0,
|
|
98
|
+
differences,
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Compares two steps at the same index and adds differences to the list.
|
|
103
|
+
*/
|
|
104
|
+
function compareSteps(a, b, index, differences) {
|
|
105
|
+
// Compare slug (order matters, so slugs must match at same index)
|
|
106
|
+
if (a.slug !== b.slug) {
|
|
107
|
+
differences.push(`Step at index ${index}: slug differs '${a.slug}' vs '${b.slug}'`);
|
|
108
|
+
}
|
|
109
|
+
// Compare step type
|
|
110
|
+
if (a.stepType !== b.stepType) {
|
|
111
|
+
differences.push(`Step at index ${index}: type differs '${a.stepType}' vs '${b.stepType}'`);
|
|
112
|
+
}
|
|
113
|
+
// Compare dependencies (already sorted)
|
|
114
|
+
const aDeps = a.dependencies.join(',');
|
|
115
|
+
const bDeps = b.dependencies.join(',');
|
|
116
|
+
if (aDeps !== bDeps) {
|
|
117
|
+
differences.push(`Step at index ${index}: dependencies differ [${a.dependencies.join(', ')}] vs [${b.dependencies.join(', ')}]`);
|
|
118
|
+
}
|
|
119
|
+
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,iBAAiB,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgflow/dsl",
|
|
3
|
-
"version": "0.0.0-fix-
|
|
3
|
+
"version": "0.0.0-fix-max-conn-2da7657d-20260112035120",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/pgflow-dev/pgflow",
|
|
8
|
+
"directory": "pkgs/dsl"
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"main": "./dist/index.js",
|
|
7
12
|
"module": "./dist/index.js",
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import type postgres from 'postgres';
|
|
2
2
|
import type { SupabaseClient } from '@supabase/supabase-js';
|
|
3
3
|
import { Flow as CoreFlow, type AnyInput, type AnySteps, type AnyDeps, EmptySteps, EmptyDeps, type Env } from '../index.js';
|
|
4
4
|
export interface SupabaseResources extends Record<string, unknown> {
|
|
5
|
-
sql: Sql;
|
|
5
|
+
sql: postgres.Sql;
|
|
6
6
|
/**
|
|
7
7
|
* Supabase client with service role key for full database access
|
|
8
8
|
*/
|
|
9
9
|
supabase: SupabaseClient;
|
|
10
10
|
}
|
|
11
11
|
export interface SupabaseEnv extends Env {
|
|
12
|
-
|
|
12
|
+
SUPABASE_DB_URL: string;
|
|
13
13
|
SUPABASE_URL: string;
|
|
14
14
|
SUPABASE_ANON_KEY: string;
|
|
15
15
|
SUPABASE_SERVICE_ROLE_KEY: string;
|
|
16
16
|
SB_EXECUTION_ID: string;
|
|
17
|
+
EDGE_WORKER_DB_URL?: string;
|
|
17
18
|
EDGE_WORKER_LOG_LEVEL?: string;
|
|
18
19
|
}
|
|
19
20
|
export type SupabasePlatformContext = SupabaseResources;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/platforms/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"supabase.d.ts","sourceRoot":"","sources":["../../src/platforms/supabase.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAC;AACrC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EACL,IAAI,IAAI,QAAQ,EAChB,KAAK,QAAQ,EAAE,KAAK,QAAQ,EAAE,KAAK,OAAO,EAC1C,UAAU,EAAE,SAAS,EAAE,KAAK,GAAG,EAChC,MAAM,aAAa,CAAC;AAGrB,MAAM,WAAW,iBAAkB,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;IAChE,GAAG,EAAc,QAAQ,CAAC,GAAG,CAAC;IAC9B;;OAEG;IACH,QAAQ,EAAS,cAAc,CAAC;CACjC;AAGD,MAAM,WAAW,WAAY,SAAQ,GAAG;IACtC,eAAe,EAAY,MAAM,CAAC;IAClC,YAAY,EAAe,MAAM,CAAC;IAClC,iBAAiB,EAAU,MAAM,CAAC;IAClC,yBAAyB,EAAE,MAAM,CAAC;IAClC,eAAe,EAAY,MAAM,CAAC;IAClC,kBAAkB,CAAC,EAAQ,MAAM,CAAC;IAClC,qBAAqB,CAAC,EAAK,MAAM,CAAC;CACnC;AAMD,MAAM,MAAM,uBAAuB,GAAG,iBAAiB,CAAC;AAGxD,qBAAa,IAAI,CACf,CAAC,SAAS,QAAQ,GAAG,QAAQ,EAE7B,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,EAAE,EAC9C,CAAC,SAAS,QAAQ,GAAG,UAAU,EAC/B,CAAC,SAAS,OAAO,GAAK,SAAS,EAC/B,IAAI,SAAS,GAAG,GAAG,WAAW,CAC9B,SAAQ,QAAQ,CAChB,CAAC,EACD,uBAAuB,GAAG,SAAS,EACnC,CAAC,EAAE,CAAC,EACJ,IAAI,CACL;CAAG"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pgflow/dsl",
|
|
3
|
-
"version": "0.0.0-fix-
|
|
3
|
+
"version": "0.0.0-fix-max-conn-2da7657d-20260112035120",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/pgflow-dev/pgflow",
|
|
8
|
+
"directory": "pkgs/dsl"
|
|
9
|
+
},
|
|
5
10
|
"type": "module",
|
|
6
11
|
"main": "./dist/index.js",
|
|
7
12
|
"module": "./dist/index.js",
|