@workflow/web-shared 5.2.0 → 5.3.0
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/components/event-list/event-details-panel.d.ts.map +1 -1
- package/dist/components/event-list/event-details-panel.js +3 -3
- package/dist/components/event-list/event-list-toolbar.d.ts +2 -1
- package/dist/components/event-list/event-list-toolbar.d.ts.map +1 -1
- package/dist/components/event-list/event-list-toolbar.js +20 -11
- package/dist/components/event-list/event-row.d.ts +3 -3
- package/dist/components/event-list/event-row.d.ts.map +1 -1
- package/dist/components/event-list/event-row.js +15 -13
- package/dist/components/event-list/use-event-search.d.ts +3 -1
- package/dist/components/event-list/use-event-search.d.ts.map +1 -1
- package/dist/components/event-list/use-event-search.js +19 -20
- package/dist/components/event-list-view.d.ts.map +1 -1
- package/dist/components/event-list-view.js +53 -24
- package/dist/components/hook-actions.d.ts +0 -1
- package/dist/components/hook-actions.d.ts.map +1 -1
- package/dist/components/hook-actions.js +1 -3
- package/dist/components/index.d.ts +5 -9
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -9
- package/dist/components/sidebar/attribute-panel.d.ts +0 -13
- package/dist/components/sidebar/attribute-panel.d.ts.map +1 -1
- package/dist/components/sidebar/attribute-panel.js +5 -5
- package/dist/components/sidebar/attributes-block.d.ts +0 -7
- package/dist/components/sidebar/attributes-block.d.ts.map +1 -1
- package/dist/components/sidebar/attributes-block.js +5 -5
- package/dist/components/sidebar/conversation-view.d.ts.map +1 -1
- package/dist/components/sidebar/conversation-view.js +4 -3
- package/dist/components/sidebar/copyable-data-block.d.ts.map +1 -1
- package/dist/components/sidebar/copyable-data-block.js +8 -6
- package/dist/components/sidebar/entity-detail-panel.d.ts.map +1 -1
- package/dist/components/sidebar/entity-detail-panel.js +2 -3
- package/dist/components/stream-image-preview.js +2 -2
- package/dist/components/stream-viewer.js +3 -3
- package/dist/components/trace-viewer/components/middle-truncate/truncate.d.ts +1 -4
- package/dist/components/trace-viewer/components/middle-truncate/truncate.d.ts.map +1 -1
- package/dist/components/trace-viewer/components/middle-truncate/truncate.js +2 -2
- package/dist/components/trace-viewer/components/minimap.d.ts.map +1 -1
- package/dist/components/trace-viewer/components/minimap.js +6 -4
- package/dist/components/trace-viewer/components/timeline.d.ts +0 -11
- package/dist/components/trace-viewer/components/timeline.d.ts.map +1 -1
- package/dist/components/trace-viewer/components/timeline.js +1 -2
- package/dist/components/trace-viewer/trace-viewer.js +4 -10
- package/dist/components/ui/button.d.ts +28 -17
- package/dist/components/ui/button.d.ts.map +1 -1
- package/dist/components/ui/button.js +47 -43
- package/dist/components/ui/context-card.js +3 -3
- package/dist/components/ui/copy-button.d.ts +15 -0
- package/dist/components/ui/copy-button.d.ts.map +1 -0
- package/dist/components/ui/copy-button.js +41 -0
- package/dist/components/ui/data-inspector.d.ts.map +1 -1
- package/dist/components/ui/data-inspector.js +8 -38
- package/dist/components/ui/decrypt-button.d.ts +3 -2
- package/dist/components/ui/decrypt-button.d.ts.map +1 -1
- package/dist/components/ui/decrypt-button.js +13 -7
- package/dist/components/ui/duplicate-event-tooltip.d.ts +1 -9
- package/dist/components/ui/duplicate-event-tooltip.d.ts.map +1 -1
- package/dist/components/ui/duplicate-event-tooltip.js +2 -10
- package/dist/components/ui/error-stack-block.js +3 -3
- package/dist/components/ui/icon-button.d.ts +2 -2
- package/dist/components/ui/icon-button.d.ts.map +1 -1
- package/dist/components/ui/icon-button.js +2 -3
- package/dist/components/ui/kbd.d.ts +1 -1
- package/dist/components/ui/kbd.d.ts.map +1 -1
- package/dist/components/ui/kbd.js +1 -2
- package/dist/components/ui/search-input.d.ts +19 -0
- package/dist/components/ui/search-input.d.ts.map +1 -0
- package/dist/components/ui/search-input.js +61 -0
- package/dist/components/ui/spinner.d.ts +54 -6
- package/dist/components/ui/spinner.d.ts.map +1 -1
- package/dist/components/ui/spinner.js +84 -46
- package/dist/components/workflow-traces/trace-span-construction.d.ts +1 -22
- package/dist/components/workflow-traces/trace-span-construction.d.ts.map +1 -1
- package/dist/components/workflow-traces/trace-span-construction.js +3 -3
- package/dist/index.d.ts +9 -14
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -11
- package/dist/lib/event-analysis.d.ts +1 -25
- package/dist/lib/event-analysis.d.ts.map +1 -1
- package/dist/lib/event-analysis.js +2 -75
- package/dist/lib/event-list-model.d.ts +4 -2
- package/dist/lib/event-list-model.d.ts.map +1 -1
- package/dist/lib/event-list-model.js +13 -11
- package/dist/lib/exact-event-search-id.d.ts +0 -2
- package/dist/lib/exact-event-search-id.d.ts.map +1 -1
- package/dist/lib/exact-event-search-id.js +1 -12
- package/dist/lib/hydration.d.ts +1 -12
- package/dist/lib/hydration.d.ts.map +1 -1
- package/dist/lib/hydration.js +8 -20
- package/dist/lib/stream-display.d.ts +0 -1
- package/dist/lib/stream-display.d.ts.map +1 -1
- package/dist/lib/stream-display.js +2 -2
- package/dist/lib/trace-builder.d.ts +0 -8
- package/dist/lib/trace-builder.d.ts.map +1 -1
- package/dist/lib/trace-builder.js +2 -2
- package/dist/lib/utils.d.ts +0 -22
- package/dist/lib/utils.d.ts.map +1 -1
- package/dist/lib/utils.js +1 -31
- package/dist/styles.css +268 -118
- package/package.json +4 -16
- package/src/components/event-list/event-details-panel.tsx +3 -4
- package/src/components/event-list/event-list-toolbar.tsx +35 -28
- package/src/components/event-list/event-row.tsx +33 -29
- package/src/components/event-list/use-event-search.ts +29 -22
- package/src/components/event-list-view.tsx +180 -52
- package/src/components/hook-actions.tsx +0 -1
- package/src/components/index.ts +4 -20
- package/src/components/sidebar/attribute-panel.tsx +4 -7
- package/src/components/sidebar/attributes-block.tsx +7 -6
- package/src/components/sidebar/conversation-view.tsx +3 -2
- package/src/components/sidebar/copyable-data-block.tsx +17 -14
- package/src/components/sidebar/entity-detail-panel.tsx +2 -7
- package/src/components/stream-image-preview.tsx +1 -1
- package/src/components/stream-viewer.tsx +4 -4
- package/src/components/trace-viewer/components/middle-truncate/truncate.ts +1 -2
- package/src/components/trace-viewer/components/minimap.tsx +4 -3
- package/src/components/trace-viewer/components/timeline.tsx +0 -2
- package/src/components/trace-viewer/trace-viewer.tsx +12 -38
- package/src/components/ui/button.tsx +144 -46
- package/src/components/ui/context-card.tsx +2 -2
- package/src/components/ui/copy-button.tsx +86 -0
- package/src/components/ui/data-inspector.tsx +23 -67
- package/src/components/ui/decrypt-button.tsx +23 -48
- package/src/components/ui/duplicate-event-tooltip.tsx +1 -22
- package/src/components/ui/error-stack-block.tsx +4 -4
- package/src/components/ui/icon-button.tsx +1 -3
- package/src/components/ui/kbd.tsx +0 -2
- package/src/components/ui/search-input.tsx +143 -0
- package/src/components/ui/spinner.tsx +105 -55
- package/src/components/workflow-traces/trace-span-construction.ts +2 -2
- package/src/index.ts +7 -55
- package/src/lib/event-analysis.ts +1 -104
- package/src/lib/event-list-model.ts +15 -12
- package/src/lib/exact-event-search-id.ts +0 -13
- package/src/lib/hydration.ts +6 -31
- package/src/lib/stream-display.ts +1 -1
- package/src/lib/trace-builder.ts +1 -1
- package/src/lib/utils.ts +0 -48
- package/src/styles.css +268 -118
- package/dist/components/trace-viewer/components/copy-button.d.ts +0 -9
- package/dist/components/trace-viewer/components/copy-button.d.ts.map +0 -1
- package/dist/components/trace-viewer/components/copy-button.js +0 -27
- package/dist/components/ui/alert.d.ts +0 -9
- package/dist/components/ui/alert.d.ts.map +0 -1
- package/dist/components/ui/alert.js +0 -23
- package/dist/components/ui/card.d.ts +0 -9
- package/dist/components/ui/card.d.ts.map +0 -1
- package/dist/components/ui/card.js +0 -18
- package/dist/components/ui/load-more-button.d.ts +0 -13
- package/dist/components/ui/load-more-button.d.ts.map +0 -1
- package/dist/components/ui/load-more-button.js +0 -12
- package/dist/components/ui/menu-dropdown.d.ts +0 -16
- package/dist/components/ui/menu-dropdown.d.ts.map +0 -1
- package/dist/components/ui/menu-dropdown.js +0 -30
- package/dist/hooks/use-dark-mode.d.ts +0 -9
- package/dist/hooks/use-dark-mode.d.ts.map +0 -1
- package/dist/hooks/use-dark-mode.js +0 -30
- package/dist/lib/event-materialization.d.ts +0 -91
- package/dist/lib/event-materialization.d.ts.map +0 -1
- package/dist/lib/event-materialization.js +0 -219
- package/src/components/index.d.ts +0 -1
- package/src/components/trace-viewer/components/copy-button.tsx +0 -68
- package/src/components/ui/alert.tsx +0 -59
- package/src/components/ui/card.tsx +0 -79
- package/src/components/ui/load-more-button.tsx +0 -38
- package/src/components/ui/menu-dropdown.tsx +0 -97
- package/src/hooks/use-dark-mode.ts +0 -34
- package/src/index.d.ts +0 -1
- package/src/lib/event-materialization.ts +0 -304
package/src/lib/hydration.ts
CHANGED
|
@@ -20,22 +20,14 @@ import { getEventDataRefFields } from '@workflow/world';
|
|
|
20
20
|
|
|
21
21
|
// Re-export types and utilities that consumers need
|
|
22
22
|
export {
|
|
23
|
-
CLASS_INSTANCE_REF_TYPE,
|
|
24
23
|
ClassInstanceRef,
|
|
25
24
|
ENCRYPTED_PLACEHOLDER,
|
|
26
|
-
extractStreamIds,
|
|
27
25
|
isClassInstanceRef,
|
|
28
|
-
isEncryptedData,
|
|
29
26
|
isRunRef,
|
|
30
|
-
isStreamId,
|
|
31
27
|
isStreamRef,
|
|
32
28
|
type Revivers,
|
|
33
|
-
RUN_REF_TYPE,
|
|
34
29
|
type RunRef,
|
|
35
|
-
STREAM_REF_TYPE,
|
|
36
30
|
type StreamRef,
|
|
37
|
-
serializedInstanceToRef,
|
|
38
|
-
truncateId,
|
|
39
31
|
} from '@workflow/core/serialization-format';
|
|
40
32
|
|
|
41
33
|
// ---------------------------------------------------------------------------
|
|
@@ -179,7 +171,7 @@ export function getWebRevivers(): Revivers {
|
|
|
179
171
|
// doesn't need `instanceof FatalError` to pass (no user code runs
|
|
180
172
|
// here). The web o11y UI needs `name`, `message`, `stack`, and any extra
|
|
181
173
|
// enumerable fields to render. Construct a plain `Error` with `name`
|
|
182
|
-
// set;
|
|
174
|
+
// set; DataInspector reads `constructor.name` for the displayed
|
|
183
175
|
// class label, but we don't have the real class, so we emit a tagged
|
|
184
176
|
// Error whose `name` field carries the class identity. This matches
|
|
185
177
|
// how the existing base `Error` reviver presents unknown subclasses.
|
|
@@ -410,7 +402,7 @@ export const ENCRYPTED_DISPLAY_NAME = 'Encrypted';
|
|
|
410
402
|
* Create a display-friendly object for encrypted data.
|
|
411
403
|
*
|
|
412
404
|
* Uses the same named-constructor trick as the Instance reviver so that
|
|
413
|
-
*
|
|
405
|
+
* the inspector renders the constructor name ("Encrypted") with no
|
|
414
406
|
* expandable children. The original encrypted bytes are stored in a
|
|
415
407
|
* non-enumerable property for later decryption.
|
|
416
408
|
*/
|
|
@@ -421,7 +413,7 @@ function createEncryptedMarker(data: Uint8Array): object {
|
|
|
421
413
|
]!;
|
|
422
414
|
const obj = Object.create(ctor.prototype);
|
|
423
415
|
// Store original bytes for decryption, but non-enumerable so
|
|
424
|
-
//
|
|
416
|
+
// DataInspector doesn't list them as entries
|
|
425
417
|
Object.defineProperty(obj, '__encryptedData', {
|
|
426
418
|
value: data,
|
|
427
419
|
enumerable: false,
|
|
@@ -443,14 +435,14 @@ export function isEncryptedMarker(value: unknown): boolean {
|
|
|
443
435
|
// Expired data display markers
|
|
444
436
|
// ---------------------------------------------------------------------------
|
|
445
437
|
|
|
446
|
-
|
|
438
|
+
const EXPIRED_DISPLAY_NAME = 'Expired Data';
|
|
447
439
|
|
|
448
440
|
/**
|
|
449
441
|
* Create a display-friendly object for expired data.
|
|
450
442
|
*
|
|
451
443
|
* Uses the same named-constructor trick as the encrypted marker so that
|
|
452
|
-
*
|
|
453
|
-
*
|
|
444
|
+
* DataInspector shows the constructor name ("Expired Data") with no
|
|
445
|
+
* entries.
|
|
454
446
|
*/
|
|
455
447
|
function createExpiredMarker(): object {
|
|
456
448
|
// biome-ignore lint/complexity/useArrowFunction: arrow functions have no .prototype
|
|
@@ -519,23 +511,6 @@ function replaceEncryptedAndExpiredWithMarkers<T>(resource: T): T {
|
|
|
519
511
|
return result as T;
|
|
520
512
|
}
|
|
521
513
|
|
|
522
|
-
/**
|
|
523
|
-
* Hydrate resource data with decryption support.
|
|
524
|
-
*
|
|
525
|
-
* When a key is provided, encrypted fields are decrypted before hydration.
|
|
526
|
-
* This is the async version used when the user clicks "Decrypt" in the web UI.
|
|
527
|
-
*
|
|
528
|
-
* Handles both top-level fields (input, output, metadata) and nested eventData
|
|
529
|
-
* payload fields for that event type.
|
|
530
|
-
*/
|
|
531
|
-
export async function hydrateResourceIOWithKey<T>(
|
|
532
|
-
resource: T,
|
|
533
|
-
key: Uint8Array,
|
|
534
|
-
extraRevivers?: Revivers
|
|
535
|
-
): Promise<T> {
|
|
536
|
-
return hydrateResourceIOAsync(resource, key, extraRevivers);
|
|
537
|
-
}
|
|
538
|
-
|
|
539
514
|
/**
|
|
540
515
|
* Async hydration for web display.
|
|
541
516
|
*
|
|
@@ -9,7 +9,7 @@ export interface FormattedStreamChunkDisplay {
|
|
|
9
9
|
decodedFrom?: DecodedStreamChunkSource;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
function summarizeArrayBufferView(value: ArrayBufferView): string {
|
|
13
13
|
const ta = value as unknown as {
|
|
14
14
|
length: number;
|
|
15
15
|
constructor: { name: string };
|
package/src/lib/trace-builder.ts
CHANGED
|
@@ -35,7 +35,7 @@ import type { Span } from './trace-types';
|
|
|
35
35
|
* step/timer/hook events (e.g. `attr_set`, whose correlationId is a dedup
|
|
36
36
|
* token rather than a child entity ID).
|
|
37
37
|
*/
|
|
38
|
-
|
|
38
|
+
const isRunLevelEvent = (event: Event): boolean =>
|
|
39
39
|
!event.correlationId ||
|
|
40
40
|
(!isWaitEventType(event.eventType) &&
|
|
41
41
|
!isHookLifecycleEventType(event.eventType) &&
|
package/src/lib/utils.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Step } from '@workflow/world';
|
|
2
1
|
import type { ModelMessage } from 'ai';
|
|
3
2
|
|
|
4
3
|
const MS_IN_SECOND = 1000;
|
|
@@ -127,24 +126,6 @@ export function formatDurationPrecise(ms: number, fractionDigits = 2): string {
|
|
|
127
126
|
return parts.join(' ');
|
|
128
127
|
}
|
|
129
128
|
|
|
130
|
-
/**
|
|
131
|
-
* Returns a formatted pagination display string
|
|
132
|
-
* @param currentPage - The current page number
|
|
133
|
-
* @param totalPages - The total number of pages visited so far
|
|
134
|
-
* @param hasMore - Whether there are more pages available
|
|
135
|
-
* @returns Formatted string like "Page 1 of 3+" or "Page 2 of 2"
|
|
136
|
-
*/
|
|
137
|
-
export function getPaginationDisplay(
|
|
138
|
-
currentPage: number,
|
|
139
|
-
totalPages: number,
|
|
140
|
-
hasMore: boolean
|
|
141
|
-
): string {
|
|
142
|
-
if (hasMore) {
|
|
143
|
-
return `Page ${currentPage} of ${totalPages}+`;
|
|
144
|
-
}
|
|
145
|
-
return `Page ${currentPage} of ${totalPages}`;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
129
|
// ============================================================================
|
|
149
130
|
// Durable Agent Utilities
|
|
150
131
|
// ============================================================================
|
|
@@ -181,32 +162,3 @@ export function extractConversation(stepInput: unknown): ModelMessage[] | null {
|
|
|
181
162
|
|
|
182
163
|
return firstArg as ModelMessage[];
|
|
183
164
|
}
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* A doStreamStep with its conversation input extracted
|
|
187
|
-
*/
|
|
188
|
-
export interface StreamStep {
|
|
189
|
-
stepId: string;
|
|
190
|
-
stepName: string;
|
|
191
|
-
displayName: string;
|
|
192
|
-
conversation: ModelMessage[];
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
/**
|
|
196
|
-
* Identifies all stream steps (doStreamStep) in a run and extracts their conversations.
|
|
197
|
-
*/
|
|
198
|
-
export function identifyStreamSteps(steps: Step[]): StreamStep[] {
|
|
199
|
-
return steps
|
|
200
|
-
.filter((step) => isDoStreamStep(step.stepName))
|
|
201
|
-
.map((step) => {
|
|
202
|
-
const functionName = step.stepName.split('//').pop() ?? 'unknown';
|
|
203
|
-
const conversation = extractConversation(step.input) ?? [];
|
|
204
|
-
|
|
205
|
-
return {
|
|
206
|
-
stepId: step.stepId,
|
|
207
|
-
stepName: step.stepName,
|
|
208
|
-
displayName: functionName,
|
|
209
|
-
conversation,
|
|
210
|
-
};
|
|
211
|
-
});
|
|
212
|
-
}
|