@workflow/web-shared 5.2.0 → 5.3.1

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.
Files changed (168) hide show
  1. package/dist/components/event-list/event-details-panel.d.ts.map +1 -1
  2. package/dist/components/event-list/event-details-panel.js +3 -3
  3. package/dist/components/event-list/event-list-toolbar.d.ts +2 -1
  4. package/dist/components/event-list/event-list-toolbar.d.ts.map +1 -1
  5. package/dist/components/event-list/event-list-toolbar.js +20 -11
  6. package/dist/components/event-list/event-row.d.ts +3 -3
  7. package/dist/components/event-list/event-row.d.ts.map +1 -1
  8. package/dist/components/event-list/event-row.js +15 -13
  9. package/dist/components/event-list/use-event-search.d.ts +3 -1
  10. package/dist/components/event-list/use-event-search.d.ts.map +1 -1
  11. package/dist/components/event-list/use-event-search.js +19 -20
  12. package/dist/components/event-list-view.d.ts.map +1 -1
  13. package/dist/components/event-list-view.js +53 -24
  14. package/dist/components/hook-actions.d.ts +0 -1
  15. package/dist/components/hook-actions.d.ts.map +1 -1
  16. package/dist/components/hook-actions.js +1 -3
  17. package/dist/components/index.d.ts +5 -9
  18. package/dist/components/index.d.ts.map +1 -1
  19. package/dist/components/index.js +4 -9
  20. package/dist/components/sidebar/attribute-panel.d.ts +0 -13
  21. package/dist/components/sidebar/attribute-panel.d.ts.map +1 -1
  22. package/dist/components/sidebar/attribute-panel.js +5 -5
  23. package/dist/components/sidebar/attributes-block.d.ts +0 -7
  24. package/dist/components/sidebar/attributes-block.d.ts.map +1 -1
  25. package/dist/components/sidebar/attributes-block.js +5 -5
  26. package/dist/components/sidebar/conversation-view.d.ts.map +1 -1
  27. package/dist/components/sidebar/conversation-view.js +4 -3
  28. package/dist/components/sidebar/copyable-data-block.d.ts.map +1 -1
  29. package/dist/components/sidebar/copyable-data-block.js +8 -6
  30. package/dist/components/sidebar/entity-detail-panel.d.ts.map +1 -1
  31. package/dist/components/sidebar/entity-detail-panel.js +2 -3
  32. package/dist/components/stream-image-preview.js +2 -2
  33. package/dist/components/stream-viewer.js +3 -3
  34. package/dist/components/trace-viewer/components/middle-truncate/truncate.d.ts +1 -4
  35. package/dist/components/trace-viewer/components/middle-truncate/truncate.d.ts.map +1 -1
  36. package/dist/components/trace-viewer/components/middle-truncate/truncate.js +2 -2
  37. package/dist/components/trace-viewer/components/minimap.d.ts.map +1 -1
  38. package/dist/components/trace-viewer/components/minimap.js +6 -4
  39. package/dist/components/trace-viewer/components/timeline.d.ts +0 -11
  40. package/dist/components/trace-viewer/components/timeline.d.ts.map +1 -1
  41. package/dist/components/trace-viewer/components/timeline.js +1 -2
  42. package/dist/components/trace-viewer/trace-viewer.js +4 -10
  43. package/dist/components/ui/button.d.ts +28 -17
  44. package/dist/components/ui/button.d.ts.map +1 -1
  45. package/dist/components/ui/button.js +47 -43
  46. package/dist/components/ui/context-card.js +3 -3
  47. package/dist/components/ui/copy-button.d.ts +15 -0
  48. package/dist/components/ui/copy-button.d.ts.map +1 -0
  49. package/dist/components/ui/copy-button.js +41 -0
  50. package/dist/components/ui/data-inspector.d.ts.map +1 -1
  51. package/dist/components/ui/data-inspector.js +8 -38
  52. package/dist/components/ui/decrypt-button.d.ts +3 -2
  53. package/dist/components/ui/decrypt-button.d.ts.map +1 -1
  54. package/dist/components/ui/decrypt-button.js +13 -7
  55. package/dist/components/ui/duplicate-event-tooltip.d.ts +1 -9
  56. package/dist/components/ui/duplicate-event-tooltip.d.ts.map +1 -1
  57. package/dist/components/ui/duplicate-event-tooltip.js +2 -10
  58. package/dist/components/ui/error-stack-block.js +3 -3
  59. package/dist/components/ui/icon-button.d.ts +2 -2
  60. package/dist/components/ui/icon-button.d.ts.map +1 -1
  61. package/dist/components/ui/icon-button.js +2 -3
  62. package/dist/components/ui/kbd.d.ts +1 -1
  63. package/dist/components/ui/kbd.d.ts.map +1 -1
  64. package/dist/components/ui/kbd.js +1 -2
  65. package/dist/components/ui/search-input.d.ts +19 -0
  66. package/dist/components/ui/search-input.d.ts.map +1 -0
  67. package/dist/components/ui/search-input.js +61 -0
  68. package/dist/components/ui/spinner.d.ts +54 -6
  69. package/dist/components/ui/spinner.d.ts.map +1 -1
  70. package/dist/components/ui/spinner.js +84 -46
  71. package/dist/components/workflow-traces/trace-span-construction.d.ts +1 -22
  72. package/dist/components/workflow-traces/trace-span-construction.d.ts.map +1 -1
  73. package/dist/components/workflow-traces/trace-span-construction.js +3 -3
  74. package/dist/index.d.ts +9 -14
  75. package/dist/index.d.ts.map +1 -1
  76. package/dist/index.js +8 -11
  77. package/dist/lib/event-analysis.d.ts +1 -25
  78. package/dist/lib/event-analysis.d.ts.map +1 -1
  79. package/dist/lib/event-analysis.js +2 -75
  80. package/dist/lib/event-list-model.d.ts +4 -2
  81. package/dist/lib/event-list-model.d.ts.map +1 -1
  82. package/dist/lib/event-list-model.js +13 -11
  83. package/dist/lib/exact-event-search-id.d.ts +0 -2
  84. package/dist/lib/exact-event-search-id.d.ts.map +1 -1
  85. package/dist/lib/exact-event-search-id.js +1 -12
  86. package/dist/lib/hydration.d.ts +1 -12
  87. package/dist/lib/hydration.d.ts.map +1 -1
  88. package/dist/lib/hydration.js +8 -20
  89. package/dist/lib/stream-display.d.ts +0 -1
  90. package/dist/lib/stream-display.d.ts.map +1 -1
  91. package/dist/lib/stream-display.js +2 -2
  92. package/dist/lib/trace-builder.d.ts +0 -8
  93. package/dist/lib/trace-builder.d.ts.map +1 -1
  94. package/dist/lib/trace-builder.js +2 -2
  95. package/dist/lib/utils.d.ts +0 -22
  96. package/dist/lib/utils.d.ts.map +1 -1
  97. package/dist/lib/utils.js +1 -31
  98. package/dist/styles.css +268 -118
  99. package/package.json +4 -16
  100. package/src/components/event-list/event-details-panel.tsx +3 -4
  101. package/src/components/event-list/event-list-toolbar.tsx +35 -28
  102. package/src/components/event-list/event-row.tsx +33 -29
  103. package/src/components/event-list/use-event-search.ts +29 -22
  104. package/src/components/event-list-view.tsx +180 -52
  105. package/src/components/hook-actions.tsx +0 -1
  106. package/src/components/index.ts +4 -20
  107. package/src/components/sidebar/attribute-panel.tsx +4 -7
  108. package/src/components/sidebar/attributes-block.tsx +7 -6
  109. package/src/components/sidebar/conversation-view.tsx +3 -2
  110. package/src/components/sidebar/copyable-data-block.tsx +17 -14
  111. package/src/components/sidebar/entity-detail-panel.tsx +2 -7
  112. package/src/components/stream-image-preview.tsx +1 -1
  113. package/src/components/stream-viewer.tsx +4 -4
  114. package/src/components/trace-viewer/components/middle-truncate/truncate.ts +1 -2
  115. package/src/components/trace-viewer/components/minimap.tsx +4 -3
  116. package/src/components/trace-viewer/components/timeline.tsx +0 -2
  117. package/src/components/trace-viewer/trace-viewer.tsx +12 -38
  118. package/src/components/ui/button.tsx +144 -46
  119. package/src/components/ui/context-card.tsx +2 -2
  120. package/src/components/ui/copy-button.tsx +86 -0
  121. package/src/components/ui/data-inspector.tsx +23 -67
  122. package/src/components/ui/decrypt-button.tsx +23 -48
  123. package/src/components/ui/duplicate-event-tooltip.tsx +1 -22
  124. package/src/components/ui/error-stack-block.tsx +4 -4
  125. package/src/components/ui/icon-button.tsx +1 -3
  126. package/src/components/ui/kbd.tsx +0 -2
  127. package/src/components/ui/search-input.tsx +143 -0
  128. package/src/components/ui/spinner.tsx +105 -55
  129. package/src/components/workflow-traces/trace-span-construction.ts +2 -2
  130. package/src/index.ts +7 -55
  131. package/src/lib/event-analysis.ts +1 -104
  132. package/src/lib/event-list-model.ts +15 -12
  133. package/src/lib/exact-event-search-id.ts +0 -13
  134. package/src/lib/hydration.ts +6 -31
  135. package/src/lib/stream-display.ts +1 -1
  136. package/src/lib/trace-builder.ts +1 -1
  137. package/src/lib/utils.ts +0 -48
  138. package/src/styles.css +268 -118
  139. package/dist/components/trace-viewer/components/copy-button.d.ts +0 -9
  140. package/dist/components/trace-viewer/components/copy-button.d.ts.map +0 -1
  141. package/dist/components/trace-viewer/components/copy-button.js +0 -27
  142. package/dist/components/ui/alert.d.ts +0 -9
  143. package/dist/components/ui/alert.d.ts.map +0 -1
  144. package/dist/components/ui/alert.js +0 -23
  145. package/dist/components/ui/card.d.ts +0 -9
  146. package/dist/components/ui/card.d.ts.map +0 -1
  147. package/dist/components/ui/card.js +0 -18
  148. package/dist/components/ui/load-more-button.d.ts +0 -13
  149. package/dist/components/ui/load-more-button.d.ts.map +0 -1
  150. package/dist/components/ui/load-more-button.js +0 -12
  151. package/dist/components/ui/menu-dropdown.d.ts +0 -16
  152. package/dist/components/ui/menu-dropdown.d.ts.map +0 -1
  153. package/dist/components/ui/menu-dropdown.js +0 -30
  154. package/dist/hooks/use-dark-mode.d.ts +0 -9
  155. package/dist/hooks/use-dark-mode.d.ts.map +0 -1
  156. package/dist/hooks/use-dark-mode.js +0 -30
  157. package/dist/lib/event-materialization.d.ts +0 -91
  158. package/dist/lib/event-materialization.d.ts.map +0 -1
  159. package/dist/lib/event-materialization.js +0 -219
  160. package/src/components/index.d.ts +0 -1
  161. package/src/components/trace-viewer/components/copy-button.tsx +0 -68
  162. package/src/components/ui/alert.tsx +0 -59
  163. package/src/components/ui/card.tsx +0 -79
  164. package/src/components/ui/load-more-button.tsx +0 -38
  165. package/src/components/ui/menu-dropdown.tsx +0 -97
  166. package/src/hooks/use-dark-mode.ts +0 -34
  167. package/src/index.d.ts +0 -1
  168. package/src/lib/event-materialization.ts +0 -304
@@ -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; ObjectInspector reads `constructor.name` for the displayed
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
- * ObjectInspector renders the constructor name ("🔒 Encrypted") with no
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
- // ObjectInspector doesn't show them as children
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
- export const EXPIRED_DISPLAY_NAME = 'Expired Data';
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
- * ObjectInspector renders the constructor name ("Expired Data") with no
453
- * expandable children.
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
- export function summarizeArrayBufferView(value: ArrayBufferView): string {
12
+ function summarizeArrayBufferView(value: ArrayBufferView): string {
13
13
  const ta = value as unknown as {
14
14
  length: number;
15
15
  constructor: { name: string };
@@ -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
- export const isRunLevelEvent = (event: Event): boolean =>
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
- }