@requence/task 0.8.2-edge.1157 → 0.8.2-edge.1160

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 CHANGED
@@ -1,6 +1,10 @@
1
1
  # @requence/task
2
2
 
3
- This package lets you start and monitor Requence tasks programmatically from a TypeScript / Bun application.
3
+ Starts and monitors Requence tasks programmatically from a TypeScript / Bun application.
4
+
5
+ > **This README is a getting-started guide.** The reference — the task handle, streaming,
6
+ > watching every task, the delivery guarantee, the CLI — lives at
7
+ > **<https://docs.requence.cloud>**.
4
8
 
5
9
  ## Installation
6
10
 
@@ -10,7 +14,8 @@ npm install @requence/task
10
14
 
11
15
  ## Authentication
12
16
 
13
- Every call to `createTask` requires an **access token** — either a personal access token or a scoped token created at the organization, group, or project level.
17
+ Every call to `createTask` requires an **access token** — either a personal access token or a
18
+ scoped token created at the organization, group, or project level.
14
19
 
15
20
  The token is resolved in this order:
16
21
 
@@ -22,7 +27,7 @@ The token is resolved in this order:
22
27
  REQUENCE_ACCESS_TOKEN=your-token bun run index.ts
23
28
  ```
24
29
 
25
- ## Basic Usage
30
+ ## Starting a task
26
31
 
27
32
  ```typescript
28
33
  import { createTask } from '@requence/task'
@@ -35,349 +40,38 @@ const result = await createTask({
35
40
  console.log(result.result) // The final output of the task
36
41
  ```
37
42
 
38
- > **Note:** `await createTask(...)` waits for the **entire task** to finish. If you don't need to block, omit the `await` and use the returned task handle instead.
39
-
40
- ## Task Handle
41
-
42
- `createTask` returns a **task handle** immediately. You can use it to access task metadata without waiting for the task to complete:
43
-
44
- ```typescript
45
- const task = createTask({ taskTemplate: 'my-template', input: {} })
46
-
47
- const taskId = await task.getTaskId() // Resolves once the task is validated and started
48
- const taskUrl = await task.getTaskUrl() // URL to view the task in the Requence UI
49
-
50
- await task.abort('No longer needed') // Abort the running task
51
- await task.protect() // Protect the task from automatic cleanup
52
-
53
- // Await the final result when you need it
54
- const result = await task
55
- ```
56
-
57
- The task handle is also an **AsyncIterable** — iterate over it to stream updates as the task executes.
58
-
59
- ### Confirming the Task Started (Cheap Monitoring)
60
-
61
- By default, awaiting the result or iterating the handle starts full SSE monitoring. If you only need to confirm that the task passed input validation and started on the backend — without tracking every node — await `task.getTaskId()`:
62
-
63
- ```typescript
64
- const task = createTask({ taskTemplate: 'my-template', input: { /* ... */ } })
65
-
66
- try {
67
- const taskId = await task.getTaskId()
68
- console.log(`Task ${taskId} is running in the background`)
69
- } catch (error) {
70
- console.error('Validation failed:', error.message)
71
- }
72
- ```
73
-
74
- `getTaskId()` resolves with the task ID once the task has passed validation and started on the backend, or rejects with a `TaskError` if the task cannot be created (e.g. schema validation failure). It never opens the SSE stream, so it stays cheap — and it never resolves with an ID for a task that failed to start.
75
-
76
- ## Options
77
-
78
- | Option | Type | Default | Description |
79
- |---|---|---|---|
80
- | `taskTemplate` | `string` | — | **Required.** Name of the task template |
81
- | `input` | `unknown` | — | Required when the template defines an input schema |
82
- | `name` | `string` | — | Human-readable task name shown in the UI |
83
- | `priority` | `number` | `2` | Priority `0` (lowest) to `4` (highest) |
84
- | `accessToken` | `string` | — | Access token (falls back to env / config file) |
85
- | `requireAck` | `boolean` | `false` | Enable delivery guarantee (see below) |
86
- | `suppressBranchWarning` | `boolean` | `false` | Suppress the branch warning when running on a non-live branch |
87
-
88
- ## Result
89
-
90
- When awaited, the task handle resolves to a result object:
91
-
92
- ```typescript
93
- const result = await createTask({ taskTemplate: 'my-template', input: {} })
94
-
95
- result.input // The input you provided
96
- result.result // The final task output
97
- result.taskId // Unique task identifier
98
- result.taskUrl // URL to view the task in the Requence UI
99
- result.getNodeData(alias) // Get output from a specific node by alias
100
- result.getNodeError(alias) // Get error from a specific node by alias
101
- ```
102
-
103
- ## Streaming Updates
104
-
105
- The task handle is an `AsyncIterable` that emits updates as the task executes. Iterate over it with `for await`:
106
-
107
- ```typescript
108
- const task = createTask({
109
- taskTemplate: 'my-template',
110
- input: { data: [1, 2, 3] },
111
- })
112
-
113
- for await (const update of task) {
114
- switch (update.type) {
115
- case 'taskStart':
116
- console.log(`Task ${update.taskId} started`)
117
- break
118
- case 'nodeStart':
119
- console.log(`Node ${update.node.alias ?? update.node.id} started`)
120
- break
121
- case 'nodeUpdate':
122
- console.log(`Node output:`, update.data)
123
- break
124
- case 'nodeError':
125
- console.log(`Node error:`, update.error)
126
- break
127
- case 'nodeDefer':
128
- console.log(`Node deferred:`, update.reason)
129
- break
130
- case 'nodeEnd':
131
- console.log(`Node ${update.node.alias ?? update.node.id} finished`)
132
- break
133
- case 'taskEnd':
134
- console.log(`Task completed:`, update.context.result)
135
- break
136
- case 'taskError':
137
- console.log(`Task failed:`, update.reason)
138
- break
139
- case 'taskAborted':
140
- console.log(`Task aborted:`, update.reason)
141
- break
142
- }
143
- }
144
- ```
145
-
146
- ### `onUpdate` callback
147
-
148
- Alternatively, pass a callback as the second argument to stream updates while still awaiting the final result:
149
-
150
- ```typescript
151
- const result = await createTask(
152
- { taskTemplate: 'my-template', input: {} },
153
- (update) => {
154
- console.log(`[${update.type}]`, update.timestamp)
155
- },
156
- )
157
- ```
158
-
159
- ### Update types
160
-
161
- | Type | Description |
162
- |---|---|
163
- | `taskStart` | Task execution has begun. Contains `input` and `taskId`. |
164
- | `nodeStart` | A node started processing. Contains `node` info (id, type, alias). |
165
- | `nodeUpdate` | A node produced output. Contains `data` and `output` (named output, if any). |
166
- | `nodeError` | A node encountered an error. Contains `error` message. |
167
- | `nodeDefer` | A node has been deferred (waiting for an external callback). |
168
- | `nodeEnd` | A node finished processing. |
169
- | `taskEnd` | The task completed successfully. Contains final `result`. |
170
- | `taskError` | The task failed. Contains `reason`. |
171
- | `taskAborted` | The task was aborted. Contains `reason`. |
172
-
173
- ### Context on every update
174
-
175
- Every update includes a `context` object with the current accumulated state:
176
-
177
- ```typescript
178
- update.context.input // The task input
179
- update.context.taskId // The task ID
180
- update.context.result // Accumulated result (partial until taskEnd)
181
- update.context.getNodeData(alias) // Output from a specific node by alias
182
- update.context.getNodeError(alias) // Error from a specific node by alias
183
- ```
184
-
185
- ## Aborting a Task
186
-
187
- Via the task handle:
188
-
189
- ```typescript
190
- const task = createTask({ taskTemplate: 'my-template', input: {} })
191
- await task.abort('No longer needed')
192
- ```
193
-
194
- Or standalone, using a known task ID:
195
-
196
- ```typescript
197
- import { abortTask } from '@requence/task'
198
-
199
- await abortTask({
200
- taskId: 'some-task-id',
201
- reason: 'Cancelled by user',
202
- })
203
- ```
204
-
205
- ## Protecting a Task
206
-
207
- Protected tasks are excluded from automatic cleanup — useful for important results you want to keep indefinitely.
208
-
209
- Via the task handle:
43
+ `await createTask(...)` waits for the **entire task** to finish. Omit the `await` and you get a
44
+ **task handle** back immediately — it exposes the task's id and URL, aborts and protects it, and
45
+ is an `AsyncIterable` of live updates:
210
46
 
211
47
  ```typescript
212
48
  const task = createTask({ taskTemplate: 'my-template', input: {} })
213
- await task.protect()
214
- ```
215
-
216
- Or standalone:
217
-
218
- ```typescript
219
- import { protectTask } from '@requence/task'
220
-
221
- await protectTask({ taskId: 'some-task-id' })
222
- ```
223
-
224
- ## Fetching a Task by ID
225
-
226
- Retrieve the current state of any task:
227
-
228
- ```typescript
229
- import { getTask } from '@requence/task'
230
-
231
- const task = await getTask('some-task-id')
232
- // or: getTask({ taskId: 'some-task-id', accessToken: '...' })
233
-
234
- task.status // 'SUCCESSFUL' | 'FAILED' | 'IDLE' | 'PENDING' | 'RUNNING' | 'STOPPED' | 'AWAITING_DELIVERY'
235
- task.statusText // Human-readable status description, if any
236
- task.taskTemplate // The task template name
237
- task.name // Human-readable task name
238
- task.branch // 'live' or a branch name
239
-
240
- task.context.input // The task's input
241
- task.context.result // The task's result (if finished)
242
- task.context.getNodeData(alias) // Output from a specific node
243
- task.context.getNodeError(alias) // Error from a specific node
244
- ```
245
-
246
- ## Recreating a Task
247
-
248
- Re-run an existing task with the same template and input:
249
-
250
- ```typescript
251
- import { recreateTask } from '@requence/task'
252
-
253
- const task = await recreateTask({
254
- taskId: 'some-task-id',
255
- name: 'My Retry', // Optional — overrides the original name
256
- priority: 3, // Optional — overrides the original priority
257
- })
258
-
259
- const result = await task
260
- ```
261
-
262
- ## Watching All Tasks (`watchTasks`)
263
-
264
- Subscribe to real-time updates across **all tasks** — useful for dashboards, monitoring systems, or audit logs.
265
-
266
- ```typescript
267
- import { watchTasks } from '@requence/task'
268
-
269
- const stop = watchTasks({
270
- since: new Date(),
271
- onUpdate(update) {
272
- console.log(`[${update.type}] Task ${update.context.taskId}`)
273
- },
274
- })
275
-
276
- // Later — disconnect the watcher
277
- stop()
278
- ```
279
-
280
- `watchTasks` returns a stop function that is also an **AsyncIterable**:
281
-
282
- ```typescript
283
- const watcher = watchTasks({ since: new Date() })
284
-
285
- for await (const update of watcher) {
286
- console.log(update.type, update.context.taskId)
287
-
288
- if (shouldStop) {
289
- watcher() // stop watching
290
- break
291
- }
292
- }
293
- ```
294
-
295
- ### `watchTasks` options
296
-
297
- | Option | Type | Description |
298
- |---|---|---|
299
- | `since` | `Date` | **Required.** Only receive updates after this timestamp. |
300
- | `accessToken` | `string` | Access token (falls back to env / config file) |
301
- | `filter.only` | `string[]` | Filter to specific update types (e.g. `['taskEnd', 'taskError']`) |
302
- | `onUpdate` | `function` | Callback for each update |
303
- | `onConnect` | `function` | Called when the connection is established |
304
- | `onReconnecting` | `function` | Called when the connection is being re-established |
305
- | `onError` | `function` | Called on connection errors — receives `(status, reason)` |
306
-
307
- ### Incomplete updates
308
-
309
- Each update from `watchTasks` includes an `incomplete` flag. When `true`, it means the watcher connected after the task had already started and the `taskStart` event was missed. Use this to decide whether to skip or partially process the update.
310
-
311
- It also includes a `rootTaskId` field — the ID of the root task when the update belongs to a sub-task, or `null` for top-level tasks.
312
-
313
- ## Delivery Guarantee
314
-
315
- By default, a task transitions immediately from `RUNNING` to `SUCCESSFUL` / `FAILED` / `STOPPED` when it finishes. If the process that started the task crashes at the exact moment the terminal event is emitted, the event can be lost.
316
-
317
- Setting `requireAck: true` enables an explicit acknowledgement step:
318
49
 
319
- 1. When the task reaches its terminal state the backend holds it in **`AWAITING_DELIVERY`** instead of immediately finalising.
320
- 2. The SDK receives the terminal event over SSE and automatically sends an ACK back.
321
- 3. Only after the ACK is received does the task move to its real final status, and the exact delivery timestamp is recorded.
322
-
323
- ```typescript
324
- const result = await createTask({
325
- taskTemplate: 'my-template',
326
- input: { /* ... */ },
327
- requireAck: true,
328
- })
329
- // Resolves only after the ACK has been confirmed
50
+ const taskId = await task.getTaskId() // resolves once validated and started
51
+ const result = await task // …or await the final result
330
52
  ```
331
53
 
332
- `requireAck` also works with `watchTasks` — when a task with `requireAck` reaches its terminal state, the watcher ACKs it automatically using the same access token.
333
-
334
- ## CLI — Generate Types
335
-
336
- The package ships with a CLI that generates TypeScript types for your task templates, derived from the schemas defined in the Requence UI:
54
+ Generate types for `input`, `result` and node data from the template schemas you defined in the
55
+ UI:
337
56
 
338
57
  ```bash
339
58
  npx requence-task generate-types
340
59
  ```
341
60
 
342
- This creates a `requence-env.d.ts` file in your project root. TypeScript picks it up automatically — `input`, `result`, and node data will be fully typed.
343
-
344
- ### Options
61
+ ## Where to read next
345
62
 
346
- | Option | Default | Description |
347
- |---|---|---|
348
- | `--access-token` | — | Access token (falls back to env / config file) |
349
- | `--outfile` | `requence-env.d.ts` | Name of the generated type file |
350
- | `--outdir` | `.` | Directory to write the type file to |
63
+ | Topic | Page |
64
+ | ----------------------------------------------------------------- | -------------------------------- |
65
+ | Options, the task handle, abort, protect, `requireAck` | [Starting Tasks][starting] |
66
+ | Access tokens and their scopes | [Authentication][auth] |
67
+ | `for await`, `onUpdate`, the update types | [Streaming Updates][streaming] |
68
+ | `watchTasks` across every task | [Watching Tasks][watching] |
69
+ | `getTask`, `recreateTask` | [Fetching & Recreating][fetch] |
70
+ | `requence-task generate-types` | [CLI][cli] |
351
71
 
352
- The token resolution order for the CLI is the same as for `createTask`: option → `REQUENCE_TASK_ACCESS_TOKEN` / `REQUENCE_ACCESS_TOKEN` env var → `requence.task.accessToken` / `requence.accessToken` in `package.json`.
353
-
354
- ## Full Example
355
-
356
- ```typescript
357
- import { createTask, watchTasks } from '@requence/task'
358
-
359
- // Start a task and stream its progress
360
- const task = createTask(
361
- {
362
- taskTemplate: 'invoice-processing',
363
- input: { invoiceUrl: 'https://...' },
364
- name: 'Invoice #1234',
365
- priority: 3,
366
- },
367
- (update) => {
368
- if (update.type === 'nodeUpdate') {
369
- console.log('Node result:', update.data)
370
- }
371
- },
372
- )
373
-
374
- const taskId = await task.getTaskId()
375
- console.log('Started task:', taskId)
376
-
377
- try {
378
- const result = await task
379
- console.log('Final result:', result.result)
380
- } catch (error) {
381
- console.error('Task failed:', error.message)
382
- }
383
- ```
72
+ [starting]: https://docs.requence.cloud/execution/starting-tasks/
73
+ [auth]: https://docs.requence.cloud/execution/authentication/
74
+ [streaming]: https://docs.requence.cloud/execution/streaming/
75
+ [watching]: https://docs.requence.cloud/execution/watching-tasks/
76
+ [fetch]: https://docs.requence.cloud/execution/managing-tasks/
77
+ [cli]: https://docs.requence.cloud/execution/cli/
@@ -70,6 +70,9 @@ export declare function createCommandSchemaWith(parseTreeList: (treeList: InputT
70
70
  streamUrl: z.ZodOptional<z.ZodString>;
71
71
  maxPayloadSize: z.ZodOptional<z.ZodNumber>;
72
72
  maxFileSize: z.ZodOptional<z.ZodNumber>;
73
+ storeUrl: z.ZodOptional<z.ZodString>;
74
+ storeSignature: z.ZodOptional<z.ZodString>;
75
+ storeSignatures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
73
76
  continuous: z.ZodDefault<z.ZodObject<{
74
77
  maxReconnects: z.ZodDefault<z.ZodNumber>;
75
78
  }, z.core.$strip>>;
@@ -92,6 +95,9 @@ export declare function createCommandSchemaWith(parseTreeList: (treeList: InputT
92
95
  streamUrl?: string | undefined;
93
96
  maxPayloadSize?: number | undefined;
94
97
  maxFileSize?: number | undefined;
98
+ storeUrl?: string | undefined;
99
+ storeSignature?: string | undefined;
100
+ storeSignatures?: Record<string, string> | undefined;
95
101
  continuous: {
96
102
  maxReconnects: number;
97
103
  };
@@ -402,6 +408,9 @@ export declare function createCommandSchemaWith(parseTreeList: (treeList: InputT
402
408
  streamUrl?: string | undefined;
403
409
  maxPayloadSize?: number | undefined;
404
410
  maxFileSize?: number | undefined;
411
+ storeUrl?: string | undefined;
412
+ storeSignature?: string | undefined;
413
+ storeSignatures?: Record<string, string> | undefined;
405
414
  continuous: {
406
415
  maxReconnects: number;
407
416
  };
@@ -449,6 +458,9 @@ export declare function createCommandSchemaWithAsync(parseTreeList: (treeList: I
449
458
  streamUrl: z.ZodOptional<z.ZodString>;
450
459
  maxPayloadSize: z.ZodOptional<z.ZodNumber>;
451
460
  maxFileSize: z.ZodOptional<z.ZodNumber>;
461
+ storeUrl: z.ZodOptional<z.ZodString>;
462
+ storeSignature: z.ZodOptional<z.ZodString>;
463
+ storeSignatures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
452
464
  continuous: z.ZodDefault<z.ZodObject<{
453
465
  maxReconnects: z.ZodDefault<z.ZodNumber>;
454
466
  }, z.core.$strip>>;
@@ -471,6 +483,9 @@ export declare function createCommandSchemaWithAsync(parseTreeList: (treeList: I
471
483
  streamUrl?: string | undefined;
472
484
  maxPayloadSize?: number | undefined;
473
485
  maxFileSize?: number | undefined;
486
+ storeUrl?: string | undefined;
487
+ storeSignature?: string | undefined;
488
+ storeSignatures?: Record<string, string> | undefined;
474
489
  continuous: {
475
490
  maxReconnects: number;
476
491
  };
@@ -781,6 +796,9 @@ export declare function createCommandSchemaWithAsync(parseTreeList: (treeList: I
781
796
  streamUrl?: string | undefined;
782
797
  maxPayloadSize?: number | undefined;
783
798
  maxFileSize?: number | undefined;
799
+ storeUrl?: string | undefined;
800
+ storeSignature?: string | undefined;
801
+ storeSignatures?: Record<string, string> | undefined;
784
802
  continuous: {
785
803
  maxReconnects: number;
786
804
  };
@@ -815,6 +833,9 @@ export declare const createCommandSchema: z.ZodPipe<z.ZodObject<{
815
833
  streamUrl: z.ZodOptional<z.ZodString>;
816
834
  maxPayloadSize: z.ZodOptional<z.ZodNumber>;
817
835
  maxFileSize: z.ZodOptional<z.ZodNumber>;
836
+ storeUrl: z.ZodOptional<z.ZodString>;
837
+ storeSignature: z.ZodOptional<z.ZodString>;
838
+ storeSignatures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
818
839
  continuous: z.ZodDefault<z.ZodObject<{
819
840
  maxReconnects: z.ZodDefault<z.ZodNumber>;
820
841
  }, z.core.$strip>>;
@@ -837,6 +858,9 @@ export declare const createCommandSchema: z.ZodPipe<z.ZodObject<{
837
858
  streamUrl?: string | undefined;
838
859
  maxPayloadSize?: number | undefined;
839
860
  maxFileSize?: number | undefined;
861
+ storeUrl?: string | undefined;
862
+ storeSignature?: string | undefined;
863
+ storeSignatures?: Record<string, string> | undefined;
840
864
  continuous: {
841
865
  maxReconnects: number;
842
866
  };
@@ -1147,6 +1171,9 @@ export declare const createCommandSchema: z.ZodPipe<z.ZodObject<{
1147
1171
  streamUrl?: string | undefined;
1148
1172
  maxPayloadSize?: number | undefined;
1149
1173
  maxFileSize?: number | undefined;
1174
+ storeUrl?: string | undefined;
1175
+ storeSignature?: string | undefined;
1176
+ storeSignatures?: Record<string, string> | undefined;
1150
1177
  continuous: {
1151
1178
  maxReconnects: number;
1152
1179
  };
@@ -1230,6 +1257,9 @@ export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1230
1257
  streamUrl: z.ZodOptional<z.ZodString>;
1231
1258
  maxPayloadSize: z.ZodOptional<z.ZodNumber>;
1232
1259
  maxFileSize: z.ZodOptional<z.ZodNumber>;
1260
+ storeUrl: z.ZodOptional<z.ZodString>;
1261
+ storeSignature: z.ZodOptional<z.ZodString>;
1262
+ storeSignatures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1233
1263
  continuous: z.ZodDefault<z.ZodObject<{
1234
1264
  maxReconnects: z.ZodDefault<z.ZodNumber>;
1235
1265
  }, z.core.$strip>>;
@@ -1252,6 +1282,9 @@ export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1252
1282
  streamUrl?: string | undefined;
1253
1283
  maxPayloadSize?: number | undefined;
1254
1284
  maxFileSize?: number | undefined;
1285
+ storeUrl?: string | undefined;
1286
+ storeSignature?: string | undefined;
1287
+ storeSignatures?: Record<string, string> | undefined;
1255
1288
  continuous: {
1256
1289
  maxReconnects: number;
1257
1290
  };
@@ -1562,6 +1595,9 @@ export declare const commandSchema: z.ZodUnion<readonly [z.ZodObject<{
1562
1595
  streamUrl?: string | undefined;
1563
1596
  maxPayloadSize?: number | undefined;
1564
1597
  maxFileSize?: number | undefined;
1598
+ storeUrl?: string | undefined;
1599
+ storeSignature?: string | undefined;
1600
+ storeSignatures?: Record<string, string> | undefined;
1565
1601
  continuous: {
1566
1602
  maxReconnects: number;
1567
1603
  };
@@ -1 +1 @@
1
- {"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/command.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAG1B,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,QAAQ,EAEd,MAAM,gBAAgB,CAAA;AAGvB,eAAO,MAAM,kBAAkB;;;iBAG7B,CAAA;AAEF,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,eAAO,MAAM,sBAAsB;;iBAEjC,CAAA;AAEF,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAA;AA6BrE;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CACrC,aAAa,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAKxB,CAAA;AACF,MAAM,MAAM,OAAO,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA;AACnD,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAA"}
@@ -1,6 +1,7 @@
1
1
  export * from './clientProperties.ts';
2
2
  export * from './command.ts';
3
3
  export * from './configurationScript.ts';
4
+ export * from './logicExecutionTime.ts';
4
5
  export * from './logicLanguages.ts';
5
6
  export * from './loopDetection.ts';
6
7
  export * from './nodeType.ts';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAA;AACrC,cAAc,cAAc,CAAA;AAC5B,cAAc,0BAA0B,CAAA;AACxC,cAAc,yBAAyB,CAAA;AACvC,cAAc,qBAAqB,CAAA;AACnC,cAAc,oBAAoB,CAAA;AAClC,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,aAAa,CAAA;AAC3B,cAAc,gBAAgB,CAAA;AAC9B,cAAc,4BAA4B,CAAA;AAC1C,cAAc,eAAe,CAAA;AAC7B,cAAc,kBAAkB,CAAA;AAChC,cAAc,wBAAwB,CAAA"}
@@ -0,0 +1,22 @@
1
+ import type { TemplateTree } from './templateNodeTypes.ts';
2
+ /**
3
+ * Floor for a logic node's `maxExecutionTime`, in milliseconds. The ceiling is
4
+ * deployment-dependent (`env.MAX_LOGIC_EXECUTION_TIME`), so it is always passed
5
+ * in rather than declared here.
6
+ */
7
+ export declare const MIN_LOGIC_EXECUTION_TIME = 100;
8
+ export interface LogicExecutionTimeError {
9
+ detail: string;
10
+ nodeId: string;
11
+ }
12
+ /**
13
+ * Range check for every logic node's max execution time, shared by the backend
14
+ * save-time check (`validateTemplateTree`) and the frontend's live canvas
15
+ * monitor so the bound and the wording cannot drift apart.
16
+ *
17
+ * `max: null` means the ceiling is not known — the frontend before its meta
18
+ * query resolves — and only the floor is checked then; checking against the
19
+ * placeholder would flag every logic node in the graph.
20
+ */
21
+ export declare function validateLogicExecutionTime(templateTree: TemplateTree, max: number | null): LogicExecutionTimeError[];
22
+ //# sourceMappingURL=logicExecutionTime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logicExecutionTime.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/logicExecutionTime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAA;AAE1D;;;;GAIG;AACH,eAAO,MAAM,wBAAwB,MAAM,CAAA;AAE3C,MAAM,WAAW,uBAAuB;IACtC,MAAM,EAAE,MAAM,CAAA;IACd,MAAM,EAAE,MAAM,CAAA;CACf;AAED;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,YAAY,EAC1B,GAAG,EAAE,MAAM,GAAG,IAAI,GACjB,uBAAuB,EAAE,CAmC3B"}
@@ -10,6 +10,9 @@ export declare const taskOptionsSchema: z.ZodObject<{
10
10
  streamUrl: z.ZodOptional<z.ZodString>;
11
11
  maxPayloadSize: z.ZodOptional<z.ZodNumber>;
12
12
  maxFileSize: z.ZodOptional<z.ZodNumber>;
13
+ storeUrl: z.ZodOptional<z.ZodString>;
14
+ storeSignature: z.ZodOptional<z.ZodString>;
15
+ storeSignatures: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
13
16
  continuous: z.ZodDefault<z.ZodObject<{
14
17
  maxReconnects: z.ZodDefault<z.ZodNumber>;
15
18
  }, z.core.$strip>>;
@@ -1 +1 @@
1
- {"version":3,"file":"taskOptions.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/taskOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;iBA4B5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
1
+ {"version":3,"file":"taskOptions.d.ts","sourceRoot":"","sources":["../../../../../../helpers/src/protocol/taskOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,QAAQ,CAAA;AAE1B,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;iBAgE5B,CAAA;AAEF,MAAM,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC,OAAO,iBAAiB,CAAC,CAAA;AAC5D,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,iBAAiB,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@requence/task",
3
3
  "type": "module",
4
- "version": "0.8.2-edge.1157",
4
+ "version": "0.8.2-edge.1160",
5
5
  "bin": {
6
6
  "requence-task": "build/cli.js"
7
7
  },