aitable-workflow-base 0.1.18-beta.1787209216198

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,531 @@
1
+ import { S as StageTaskIdentityDTO } from './stage-state-BxNfh_H1.js';
2
+
3
+ declare const projectFiles: {
4
+ path: string;
5
+ content: string;
6
+ }[];
7
+ declare const workflowPreview: {
8
+ steps: never[];
9
+ edges: never[];
10
+ };
11
+ declare const projectState: {
12
+ projectId: string;
13
+ activeStage: "run";
14
+ stages: {
15
+ init: {
16
+ identity: StageTaskIdentityDTO;
17
+ state: {
18
+ phase: "ready";
19
+ warnings: never[];
20
+ roleFiles: never[];
21
+ };
22
+ next: {
23
+ kind: "idle";
24
+ };
25
+ };
26
+ design: {
27
+ identity: StageTaskIdentityDTO;
28
+ state: {
29
+ phase: "ready";
30
+ confirmed: {
31
+ form: {
32
+ id: string;
33
+ title: string;
34
+ questions: {
35
+ id: string;
36
+ label: string;
37
+ type: "radio";
38
+ required: true;
39
+ options: {
40
+ label: string;
41
+ value: string;
42
+ }[];
43
+ }[];
44
+ };
45
+ answers: {
46
+ scope: string;
47
+ };
48
+ clarifications: string;
49
+ summary: string;
50
+ agentSessionId: string;
51
+ };
52
+ manifest: {
53
+ projectId: string;
54
+ taskId: string;
55
+ designVersion: number;
56
+ status: "ready";
57
+ expected: string[];
58
+ generated: {
59
+ path: string;
60
+ kind: "workflow";
61
+ checksum: string;
62
+ required: true;
63
+ }[];
64
+ validation: {
65
+ passed: true;
66
+ errors: never[];
67
+ warnings: never[];
68
+ };
69
+ createdAt: string;
70
+ updatedAt: string;
71
+ };
72
+ rounds: number;
73
+ };
74
+ next: {
75
+ kind: "idle";
76
+ };
77
+ };
78
+ setup: {
79
+ identity: StageTaskIdentityDTO;
80
+ state: {
81
+ phase: "ready";
82
+ tableUrl: string;
83
+ baseId: string;
84
+ tableId: string;
85
+ schema: {
86
+ fieldCount: number;
87
+ viewCount: number;
88
+ fields: ({
89
+ id: string;
90
+ name: string;
91
+ type: string;
92
+ group: "business";
93
+ options?: undefined;
94
+ } | {
95
+ id: string;
96
+ name: string;
97
+ type: string;
98
+ options: string[];
99
+ group: "process";
100
+ })[];
101
+ views: {
102
+ id: string;
103
+ name: string;
104
+ kind: "grid";
105
+ desc: string;
106
+ }[];
107
+ };
108
+ warnings: never[];
109
+ };
110
+ next: {
111
+ kind: "idle";
112
+ };
113
+ };
114
+ run: {
115
+ identity: StageTaskIdentityDTO;
116
+ state: {
117
+ phase: "listening";
118
+ workflowName: string;
119
+ stepCount: number;
120
+ intervalMs: number;
121
+ };
122
+ next: {
123
+ kind: "attach_stream";
124
+ endpoint: string;
125
+ };
126
+ };
127
+ };
128
+ runSnapshot: {
129
+ records: {
130
+ id: string;
131
+ title: string;
132
+ state: string;
133
+ status: "running";
134
+ currentStepId: string;
135
+ doneStepIds: string[];
136
+ createdAt: number;
137
+ updatedAt: number;
138
+ }[];
139
+ logs: {
140
+ id: string;
141
+ ts: number;
142
+ itemId: string;
143
+ stepId: string;
144
+ level: "info";
145
+ text: string;
146
+ }[];
147
+ };
148
+ updatedAt: string;
149
+ };
150
+ declare const designClarifyAwaitingState: {
151
+ projectId: string;
152
+ activeStage: "design";
153
+ stages: {
154
+ init: {
155
+ identity: StageTaskIdentityDTO;
156
+ state: {
157
+ phase: "ready";
158
+ warnings: never[];
159
+ roleFiles: never[];
160
+ };
161
+ next: {
162
+ kind: "idle";
163
+ };
164
+ };
165
+ design: {
166
+ identity: StageTaskIdentityDTO;
167
+ state: {
168
+ phase: "clarify_awaiting";
169
+ form: {
170
+ id: string;
171
+ title: string;
172
+ questions: {
173
+ id: string;
174
+ label: string;
175
+ type: "radio";
176
+ required: true;
177
+ options: {
178
+ label: string;
179
+ value: string;
180
+ }[];
181
+ }[];
182
+ };
183
+ answers: {
184
+ scope: string;
185
+ };
186
+ agentSessionId: string;
187
+ };
188
+ next: {
189
+ kind: "await_user";
190
+ action: {
191
+ type: "confirm_input";
192
+ label: string;
193
+ description: string;
194
+ api: {
195
+ method: "POST";
196
+ path: string;
197
+ };
198
+ };
199
+ };
200
+ };
201
+ };
202
+ updatedAt: string;
203
+ };
204
+ declare const designGenerateFailedState: {
205
+ projectId: string;
206
+ activeStage: null;
207
+ stages: {
208
+ init: {
209
+ identity: StageTaskIdentityDTO;
210
+ state: {
211
+ phase: "ready";
212
+ warnings: never[];
213
+ roleFiles: never[];
214
+ };
215
+ next: {
216
+ kind: "idle";
217
+ };
218
+ };
219
+ design: {
220
+ identity: StageTaskIdentityDTO;
221
+ state: {
222
+ phase: "generate_failed";
223
+ confirmed: {
224
+ form: {
225
+ id: string;
226
+ title: string;
227
+ questions: {
228
+ id: string;
229
+ label: string;
230
+ type: "radio";
231
+ required: true;
232
+ options: {
233
+ label: string;
234
+ value: string;
235
+ }[];
236
+ }[];
237
+ };
238
+ answers: {
239
+ scope: string;
240
+ };
241
+ clarifications: string;
242
+ summary: string;
243
+ agentSessionId: string;
244
+ };
245
+ error: {
246
+ code: string;
247
+ message: string;
248
+ retryable: true;
249
+ };
250
+ };
251
+ next: {
252
+ kind: "await_user";
253
+ action: {
254
+ type: "retry";
255
+ label: string;
256
+ description: string;
257
+ api: {
258
+ method: "POST";
259
+ path: string;
260
+ };
261
+ };
262
+ };
263
+ };
264
+ };
265
+ updatedAt: string;
266
+ };
267
+ /**
268
+ * 事件流夹具:状态只由 `stage.changed` 表达,一条事件一次相变。
269
+ * 澄清 → 等待用户 → 确认后生成,与 `TRANSITIONS.design` 的边一一对应。
270
+ */
271
+ declare const designEvents: ({
272
+ type: "stage.changed";
273
+ stage: "design";
274
+ stageState: {
275
+ identity: StageTaskIdentityDTO;
276
+ state: {
277
+ phase: "clarify_awaiting";
278
+ form: {
279
+ id: string;
280
+ title: string;
281
+ questions: {
282
+ id: string;
283
+ label: string;
284
+ type: "radio";
285
+ required: true;
286
+ options: {
287
+ label: string;
288
+ value: string;
289
+ }[];
290
+ }[];
291
+ };
292
+ answers: {
293
+ scope: string;
294
+ };
295
+ agentSessionId: string;
296
+ };
297
+ next: {
298
+ kind: "await_user";
299
+ action: {
300
+ type: "confirm_input";
301
+ label: string;
302
+ description: string;
303
+ api: {
304
+ method: "POST";
305
+ path: string;
306
+ };
307
+ };
308
+ };
309
+ };
310
+ files?: undefined;
311
+ } | {
312
+ type: "stage.changed";
313
+ stage: "design";
314
+ stageState: {
315
+ identity: StageTaskIdentityDTO;
316
+ state: {
317
+ phase: "generating";
318
+ confirmed: {
319
+ form: {
320
+ id: string;
321
+ title: string;
322
+ questions: {
323
+ id: string;
324
+ label: string;
325
+ type: "radio";
326
+ required: true;
327
+ options: {
328
+ label: string;
329
+ value: string;
330
+ }[];
331
+ }[];
332
+ };
333
+ answers: {
334
+ scope: string;
335
+ };
336
+ clarifications: string;
337
+ summary: string;
338
+ agentSessionId: string;
339
+ };
340
+ round: number;
341
+ isFix: false;
342
+ };
343
+ next: {
344
+ kind: "attach_stream";
345
+ endpoint: string;
346
+ };
347
+ };
348
+ files?: undefined;
349
+ } | {
350
+ type: "design.files";
351
+ files: {
352
+ path: string;
353
+ content: string;
354
+ }[];
355
+ stage?: undefined;
356
+ stageState?: undefined;
357
+ } | {
358
+ type: "stage.changed";
359
+ stage: "design";
360
+ stageState: {
361
+ identity: StageTaskIdentityDTO;
362
+ state: {
363
+ phase: "ready";
364
+ confirmed: {
365
+ form: {
366
+ id: string;
367
+ title: string;
368
+ questions: {
369
+ id: string;
370
+ label: string;
371
+ type: "radio";
372
+ required: true;
373
+ options: {
374
+ label: string;
375
+ value: string;
376
+ }[];
377
+ }[];
378
+ };
379
+ answers: {
380
+ scope: string;
381
+ };
382
+ clarifications: string;
383
+ summary: string;
384
+ agentSessionId: string;
385
+ };
386
+ manifest: {
387
+ projectId: string;
388
+ taskId: string;
389
+ designVersion: number;
390
+ status: "ready";
391
+ expected: string[];
392
+ generated: {
393
+ path: string;
394
+ kind: "workflow";
395
+ checksum: string;
396
+ required: true;
397
+ }[];
398
+ validation: {
399
+ passed: true;
400
+ errors: never[];
401
+ warnings: never[];
402
+ };
403
+ createdAt: string;
404
+ updatedAt: string;
405
+ };
406
+ rounds: number;
407
+ };
408
+ next: {
409
+ kind: "idle";
410
+ };
411
+ };
412
+ files?: undefined;
413
+ })[];
414
+ declare const setupEvents: ({
415
+ type: "stage.changed";
416
+ stage: "setup";
417
+ stageState: {
418
+ identity: StageTaskIdentityDTO;
419
+ state: {
420
+ phase: "provisioning_table";
421
+ };
422
+ next: {
423
+ kind: "attach_stream";
424
+ endpoint: string;
425
+ };
426
+ };
427
+ } | {
428
+ type: "stage.changed";
429
+ stage: "setup";
430
+ stageState: {
431
+ identity: StageTaskIdentityDTO;
432
+ state: {
433
+ phase: "ready";
434
+ tableUrl: string;
435
+ baseId: string;
436
+ tableId: string;
437
+ schema: {
438
+ fieldCount: number;
439
+ viewCount: number;
440
+ fields: ({
441
+ id: string;
442
+ name: string;
443
+ type: string;
444
+ group: "business";
445
+ options?: undefined;
446
+ } | {
447
+ id: string;
448
+ name: string;
449
+ type: string;
450
+ options: string[];
451
+ group: "process";
452
+ })[];
453
+ views: {
454
+ id: string;
455
+ name: string;
456
+ kind: "grid";
457
+ desc: string;
458
+ }[];
459
+ };
460
+ warnings: never[];
461
+ };
462
+ next: {
463
+ kind: "idle";
464
+ };
465
+ };
466
+ })[];
467
+ declare const runEvents: ({
468
+ type: "stage.changed";
469
+ stage: "run";
470
+ stageState: {
471
+ identity: StageTaskIdentityDTO;
472
+ state: {
473
+ phase: "listening";
474
+ workflowName: string;
475
+ stepCount: number;
476
+ intervalMs: number;
477
+ };
478
+ next: {
479
+ kind: "attach_stream";
480
+ endpoint: string;
481
+ };
482
+ };
483
+ record?: undefined;
484
+ itemId?: undefined;
485
+ stepId?: undefined;
486
+ stepName?: undefined;
487
+ logs?: undefined;
488
+ } | {
489
+ type: "run.record.detected";
490
+ record: {
491
+ id: string;
492
+ title: string;
493
+ state: string;
494
+ currentStep: null;
495
+ };
496
+ stage?: undefined;
497
+ stageState?: undefined;
498
+ itemId?: undefined;
499
+ stepId?: undefined;
500
+ stepName?: undefined;
501
+ logs?: undefined;
502
+ } | {
503
+ type: "run.step.started";
504
+ itemId: string;
505
+ stepId: string;
506
+ stepName: string;
507
+ stage?: undefined;
508
+ stageState?: undefined;
509
+ record?: undefined;
510
+ logs?: undefined;
511
+ } | {
512
+ type: "run.step.succeeded";
513
+ itemId: string;
514
+ stepId: string;
515
+ stepName: string;
516
+ logs: string[];
517
+ stage?: undefined;
518
+ stageState?: undefined;
519
+ record?: undefined;
520
+ } | {
521
+ type: "run.record.completed";
522
+ itemId: string;
523
+ stage?: undefined;
524
+ stageState?: undefined;
525
+ record?: undefined;
526
+ stepId?: undefined;
527
+ stepName?: undefined;
528
+ logs?: undefined;
529
+ })[];
530
+
531
+ export { designClarifyAwaitingState, designEvents, designGenerateFailedState, projectFiles, projectState, runEvents, setupEvents, workflowPreview };