@workflow/web-shared 4.0.1-beta.25 → 4.0.1-beta.27
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/dist/api/workflow-api-client.d.ts +44 -25
- package/dist/api/workflow-api-client.d.ts.map +1 -1
- package/dist/api/workflow-api-client.js +280 -196
- package/dist/api/workflow-api-client.js.map +1 -1
- package/dist/api/workflow-server-actions.d.ts +8 -1
- package/dist/api/workflow-server-actions.d.ts.map +1 -1
- package/dist/api/workflow-server-actions.js +114 -93
- package/dist/api/workflow-server-actions.js.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/utils.d.ts +44 -0
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +109 -0
- package/dist/lib/utils.js.map +1 -1
- package/dist/sidebar/attribute-panel.d.ts +9 -2
- package/dist/sidebar/attribute-panel.d.ts.map +1 -1
- package/dist/sidebar/attribute-panel.js +152 -11
- package/dist/sidebar/attribute-panel.js.map +1 -1
- package/dist/sidebar/conversation-view.d.ts +7 -0
- package/dist/sidebar/conversation-view.d.ts.map +1 -0
- package/dist/sidebar/conversation-view.js +125 -0
- package/dist/sidebar/conversation-view.js.map +1 -0
- package/dist/sidebar/workflow-detail-panel.d.ts +3 -1
- package/dist/sidebar/workflow-detail-panel.d.ts.map +1 -1
- package/dist/sidebar/workflow-detail-panel.js +2 -2
- package/dist/sidebar/workflow-detail-panel.js.map +1 -1
- package/dist/stream-viewer.d.ts +13 -0
- package/dist/stream-viewer.d.ts.map +1 -0
- package/dist/stream-viewer.js +108 -0
- package/dist/stream-viewer.js.map +1 -0
- package/dist/trace-viewer/util/timing.d.ts +4 -13
- package/dist/trace-viewer/util/timing.d.ts.map +1 -1
- package/dist/trace-viewer/util/timing.js +5 -64
- package/dist/trace-viewer/util/timing.js.map +1 -1
- package/dist/workflow-trace-view.d.ts +3 -1
- package/dist/workflow-trace-view.d.ts.map +1 -1
- package/dist/workflow-trace-view.js +2 -2
- package/dist/workflow-trace-view.js.map +1 -1
- package/package.json +6 -3
|
@@ -2,17 +2,23 @@ import type { Hook, WorkflowRun, WorkflowRunStatus } from '@workflow/world';
|
|
|
2
2
|
import type { EnvMap, ServerActionError } from './workflow-server-actions';
|
|
3
3
|
/**
|
|
4
4
|
* Gets a user-facing error message from an error object.
|
|
5
|
-
* Handles both
|
|
5
|
+
* Handles both WorkflowWebAPIError and regular Error instances.
|
|
6
6
|
*/
|
|
7
|
-
export declare const getErrorMessage: (error: Error |
|
|
7
|
+
export declare const getErrorMessage: (error: Error | WorkflowWebAPIError) => string;
|
|
8
8
|
/**
|
|
9
|
-
* Helper to handle server action results and throw
|
|
9
|
+
* Helper to handle server action results and throw WorkflowWebAPIError on failure
|
|
10
10
|
*/
|
|
11
|
-
export declare function unwrapServerActionResult<T>(
|
|
11
|
+
export declare function unwrapServerActionResult<T>(promise: Promise<{
|
|
12
12
|
success: boolean;
|
|
13
13
|
data?: T;
|
|
14
14
|
error?: ServerActionError;
|
|
15
|
-
}):
|
|
15
|
+
}>): Promise<{
|
|
16
|
+
error: WorkflowWebAPIError;
|
|
17
|
+
result: null;
|
|
18
|
+
} | {
|
|
19
|
+
error: null;
|
|
20
|
+
result: T;
|
|
21
|
+
}>;
|
|
16
22
|
/**
|
|
17
23
|
* Error instance for API and server-side errors.
|
|
18
24
|
* `error.message` will be a user-facing error message, to be displayed in UI.
|
|
@@ -27,7 +33,7 @@ export declare function unwrapServerActionResult<T>(result: {
|
|
|
27
33
|
* calling the server action, these fields will be populated:
|
|
28
34
|
* - `error.layer` will be 'server'
|
|
29
35
|
*/
|
|
30
|
-
export declare class
|
|
36
|
+
export declare class WorkflowWebAPIError extends Error {
|
|
31
37
|
request?: any;
|
|
32
38
|
layer?: 'client' | 'server' | 'API';
|
|
33
39
|
constructor(message: string, options?: {
|
|
@@ -246,6 +252,24 @@ export declare function useWorkflowResourceData(env: EnvMap, resource: 'run' | '
|
|
|
246
252
|
runId?: string;
|
|
247
253
|
}): {
|
|
248
254
|
data: {
|
|
255
|
+
runId: string;
|
|
256
|
+
stepId: string;
|
|
257
|
+
stepName: string;
|
|
258
|
+
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
259
|
+
input: any[];
|
|
260
|
+
attempt: number;
|
|
261
|
+
createdAt: Date;
|
|
262
|
+
updatedAt: Date;
|
|
263
|
+
output?: any;
|
|
264
|
+
error?: {
|
|
265
|
+
message: string;
|
|
266
|
+
stack?: string | undefined;
|
|
267
|
+
code?: string | undefined;
|
|
268
|
+
} | undefined;
|
|
269
|
+
startedAt?: Date | undefined;
|
|
270
|
+
completedAt?: Date | undefined;
|
|
271
|
+
retryAfter?: Date | undefined;
|
|
272
|
+
} | {
|
|
249
273
|
runId: string;
|
|
250
274
|
deploymentId: string;
|
|
251
275
|
workflowName: string;
|
|
@@ -305,24 +329,6 @@ export declare function useWorkflowResourceData(env: EnvMap, resource: 'run' | '
|
|
|
305
329
|
executionContext?: Record<string, any> | undefined;
|
|
306
330
|
expiredAt?: Date | undefined;
|
|
307
331
|
startedAt?: Date | undefined;
|
|
308
|
-
} | {
|
|
309
|
-
runId: string;
|
|
310
|
-
stepId: string;
|
|
311
|
-
stepName: string;
|
|
312
|
-
status: "pending" | "running" | "completed" | "failed" | "cancelled";
|
|
313
|
-
input: any[];
|
|
314
|
-
attempt: number;
|
|
315
|
-
createdAt: Date;
|
|
316
|
-
updatedAt: Date;
|
|
317
|
-
output?: any;
|
|
318
|
-
error?: {
|
|
319
|
-
message: string;
|
|
320
|
-
stack?: string | undefined;
|
|
321
|
-
code?: string | undefined;
|
|
322
|
-
} | undefined;
|
|
323
|
-
startedAt?: Date | undefined;
|
|
324
|
-
completedAt?: Date | undefined;
|
|
325
|
-
retryAfter?: Date | undefined;
|
|
326
332
|
} | (({
|
|
327
333
|
eventType: "step_completed";
|
|
328
334
|
correlationId: string;
|
|
@@ -405,6 +411,19 @@ export declare function cancelRun(env: EnvMap, runId: string): Promise<void>;
|
|
|
405
411
|
* Start a new workflow run
|
|
406
412
|
*/
|
|
407
413
|
export declare function recreateRun(env: EnvMap, runId: string): Promise<string>;
|
|
408
|
-
export declare function readStream(env: EnvMap, streamId: string, startIndex?: number): Promise<ReadableStream<
|
|
414
|
+
export declare function readStream(env: EnvMap, streamId: string, startIndex?: number): Promise<ReadableStream<unknown>>;
|
|
415
|
+
/**
|
|
416
|
+
* List all stream IDs for a run
|
|
417
|
+
*/
|
|
418
|
+
export declare function listStreams(env: EnvMap, runId: string): Promise<string[]>;
|
|
419
|
+
/**
|
|
420
|
+
* Hook to fetch and manage stream list for a run
|
|
421
|
+
*/
|
|
422
|
+
export declare function useWorkflowStreams(env: EnvMap, runId: string, refreshInterval?: number): {
|
|
423
|
+
streams: string[];
|
|
424
|
+
loading: boolean;
|
|
425
|
+
error: Error | null;
|
|
426
|
+
refresh: () => Promise<void>;
|
|
427
|
+
};
|
|
409
428
|
export {};
|
|
410
429
|
//# sourceMappingURL=workflow-api-client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workflow-api-client.d.ts","sourceRoot":"","sources":["../../src/api/workflow-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,IAAI,EAEJ,WAAW,EACX,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"workflow-api-client.d.ts","sourceRoot":"","sources":["../../src/api/workflow-api-client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAEV,IAAI,EAEJ,WAAW,EACX,iBAAiB,EAClB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAkC3E;;;GAGG;AACH,eAAO,MAAM,eAAe,GAAI,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