@mechane-ai/elements 0.60.0 → 0.61.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/catalog.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@mechane-ai/elements",
3
- "version": "0.60.0",
3
+ "version": "0.61.0",
4
4
  "recipes": [
5
5
  {
6
6
  "slug": "allocation-report",
@@ -1511,6 +1511,10 @@
1511
1511
  "kind": "type",
1512
1512
  "declaration": "dist/packages/ai/src/message.d.ts"
1513
1513
  },
1514
+ "MessageSpeakerTone": {
1515
+ "kind": "type",
1516
+ "declaration": "dist/packages/ai/src/message.d.ts"
1517
+ },
1514
1518
  "MessageProps": {
1515
1519
  "kind": "type",
1516
1520
  "declaration": "dist/packages/ai/src/message.d.ts"
@@ -2437,6 +2441,10 @@
2437
2441
  "kind": "type",
2438
2442
  "declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
2439
2443
  },
2444
+ "TraceLink": {
2445
+ "kind": "type",
2446
+ "declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
2447
+ },
2440
2448
  "TraceSpan": {
2441
2449
  "kind": "type",
2442
2450
  "declaration": "dist/packages/charts/src/timeline/trace-timeline-layout.d.ts"
@@ -1,3 +1,3 @@
1
1
  import { i as e, n as t, r as n, t as r } from "../waterfall-Dre6i02Z.js";
2
- import { n as i, t as a } from "../timeline-C1d9YJlJ.js";
2
+ import { n as i, t as a } from "../timeline-kDb6bY7M.js";
3
3
  export { t as EventStrip, a as TraceTimeline, r as Waterfall, n as eventStripGutter, e as eventStripLimits, i as traceTimelineLimits };
@@ -3,5 +3,9 @@ import type { CommandDetailsProps } from './command-details.tsx';
3
3
  export type CommandStatus = 'pending' | 'running' | 'complete' | 'failed' | 'stopped' | 'unknown';
4
4
  export type CommandActivityProps = Omit<CommandDetailsProps, 'isRunning'> & {
5
5
  readonly status: CommandStatus;
6
+ /** Optional right-aligned duration readout shown on the collapsed header row, e.g. `"1.5s"` or `"556ms"`. */
7
+ readonly duration?: string | undefined;
8
+ /** Optional right-aligned metadata beside `duration`, e.g. `"↑ 20.9K ↓ 372"`. */
9
+ readonly meta?: string | undefined;
6
10
  };
7
- export declare function CommandActivity({ status, ...details }: CommandActivityProps): ReactNode;
11
+ export declare function CommandActivity({ status, duration, meta, ...details }: CommandActivityProps): ReactNode;
@@ -6,7 +6,7 @@ export { CommandDetails } from './command-details.tsx';
6
6
  export type { CommandDetailsProps } from './command-details.tsx';
7
7
  export type { ConversationRootProps, ConversationViewportProps, ConversationContentProps, ConversationItemProps, ConversationJumpProps, ConversationControlsProps, ConversationLatestButtonProps, } from './conversation.tsx';
8
8
  export { Conversation } from './conversation.tsx';
9
- export type { MessageKind, MessageProps, MessageAttachmentProps } from './message.tsx';
9
+ export type { MessageKind, MessageSpeakerTone, MessageProps, MessageAttachmentProps } from './message.tsx';
10
10
  export { Message, MessageAttachment } from './message.tsx';
11
11
  export type { MessageActionProps } from './message-action.tsx';
12
12
  export { MessageAction } from './message-action.tsx';
@@ -1,5 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  export type MessageKind = 'user' | 'assistant' | 'system';
3
+ /** Semantic tone for the optional inline `speaker` pill badge on a `Message`. */
4
+ export type MessageSpeakerTone = 'neutral' | 'accent' | 'positive' | 'warning' | 'negative';
3
5
  export type MessageProps = {
4
6
  readonly author: string;
5
7
  readonly children: ReactNode;
@@ -10,6 +12,12 @@ export type MessageProps = {
10
12
  readonly actions?: ReactNode;
11
13
  readonly attachments?: ReactNode;
12
14
  readonly variant?: 'default' | 'chat';
15
+ /** Optional compact inline pill badge naming the speaker role in a multi-agent thread, e.g. `"Coordinator"`. */
16
+ readonly speaker?: string | undefined;
17
+ /** Semantic tone for the `speaker` pill badge. Defaults to `'neutral'`. */
18
+ readonly speakerTone?: MessageSpeakerTone | undefined;
19
+ /** Optional compact single-line quoted handoff context rendered with a subtle left rule above the message body. */
20
+ readonly quote?: string | undefined;
13
21
  };
14
22
  export type MessageAttachmentProps = {
15
23
  readonly name: string;
@@ -17,5 +25,5 @@ export type MessageAttachmentProps = {
17
25
  readonly href?: string;
18
26
  readonly actions?: ReactNode;
19
27
  };
20
- export declare function Message({ author, children, id, kind, meta, avatar, actions, attachments, variant, }: MessageProps): ReactNode;
28
+ export declare function Message({ author, children, id, kind, meta, avatar, actions, attachments, variant, speaker, speakerTone, quote, }: MessageProps): ReactNode;
21
29
  export declare function MessageAttachment({ name, description, href, actions }: MessageAttachmentProps): ReactNode;
@@ -1,6 +1,6 @@
1
1
  export type { EventStripItem, EventStripLane, EventStripMarker, EventStripProps, EventStripTime, EventStripWindow, } from './event-strip.tsx';
2
2
  export { EventStrip, eventStripGutter, eventStripLimits } from './event-strip.tsx';
3
- export type { TraceAction, TraceCategory, TraceLane, TraceSpan } from './trace-timeline-layout.ts';
3
+ export type { TraceAction, TraceCategory, TraceLane, TraceLink, TraceSpan } from './trace-timeline-layout.ts';
4
4
  export { traceTimelineLimits } from './trace-timeline-layout.ts';
5
5
  export type { TraceTimelineProps } from './trace-timeline.tsx';
6
6
  export { TraceTimeline } from './trace-timeline.tsx';
@@ -41,6 +41,14 @@ export type TraceAction = {
41
41
  readonly href?: string | undefined;
42
42
  readonly isExternal?: boolean | undefined;
43
43
  };
44
+ /** A directed handoff or causal connector drawn between two spans across lanes. */
45
+ export type TraceLink = {
46
+ readonly id: string;
47
+ readonly fromSpanId: string;
48
+ readonly toSpanId: string;
49
+ readonly label?: string | undefined;
50
+ readonly tone?: ChartTone | undefined;
51
+ };
44
52
  /** The most lanes and spans one trace timeline draws before requiring aggregation. */
45
53
  export declare const traceTimelineLimits: {
46
54
  readonly lanes: 24;
@@ -73,7 +81,20 @@ export declare function shiftRange({ visible, domain, delta, }: {
73
81
  readonly delta: number;
74
82
  }): NumericDomain;
75
83
  export declare function fitSpanRange(span: TraceSpan, domain: NumericDomain): NumericDomain;
76
- export declare function computeRelatedIds(selectedId: string | null | undefined, spans: ReadonlyArray<TraceSpan>): ReadonlySet<string> | undefined;
84
+ export declare function computeRelatedIds(selectedId: string | null | undefined, spans: ReadonlyArray<TraceSpan>, links?: ReadonlyArray<TraceLink>): ReadonlySet<string> | undefined;
85
+ export type TraceSpanGeometry = {
86
+ readonly x1: number;
87
+ readonly x2: number;
88
+ readonly y: number;
89
+ };
90
+ export type TraceLinkGeometry = {
91
+ readonly path: string;
92
+ readonly arrowPoints: string;
93
+ };
94
+ export declare function traceLinkGeometry({ from, to, }: {
95
+ readonly from: TraceSpanGeometry;
96
+ readonly to: TraceSpanGeometry;
97
+ }): TraceLinkGeometry;
77
98
  export declare function packLaneSpans({ lanes, spans, minExtent, }: {
78
99
  readonly lanes: ReadonlyArray<TraceLane>;
79
100
  readonly spans: ReadonlyArray<TraceSpan>;
@@ -2,11 +2,13 @@ import type { ReactNode } from 'react';
2
2
  import type { ValueFormat } from '../figure/figure-format.ts';
3
3
  import type { FigureProps, FigureSelectionProps } from '../figure/figure-props.ts';
4
4
  import type { NumericDomain } from '../plot/scale.ts';
5
- import type { TraceAction, TraceCategory, TraceLane, TraceSpan } from './trace-timeline-layout.ts';
5
+ import type { TraceAction, TraceCategory, TraceLane, TraceLink, TraceSpan } from './trace-timeline-layout.ts';
6
6
  /** Props for an APM-style swimlane span timeline with minimap zoom, panning, and causal highlighting. */
7
7
  export type TraceTimelineProps = FigureProps & FigureSelectionProps & {
8
8
  readonly lanes: ReadonlyArray<TraceLane>;
9
9
  readonly spans: ReadonlyArray<TraceSpan>;
10
+ /** Optional directed handoff or causal links drawn as curved arrows between spans across lanes. */
11
+ readonly links?: ReadonlyArray<TraceLink> | undefined;
10
12
  /** Full trace domain in `offsetFormat` units, such as `[0, 47.5]` seconds or `[0, 47500]` ms. */
11
13
  readonly domain: NumericDomain;
12
14
  /** Optional categories used to color-code bars and render clickable filter pills. */
@@ -34,4 +36,4 @@ export type TraceTimelineProps = FigureProps & FigureSelectionProps & {
34
36
  * An APM-style swimlane span timeline for multi-step execution traces. It draws color-coded duration bars stacked per
35
37
  * lane on a relative time axis. Readers can zoom and pan, highlight causally related spans, and trigger wired actions.
36
38
  */
37
- export declare function TraceTimeline({ lanes, spans, domain, categories, visibleRange, onVisibleRangeChange, offsetFormat, selected, onSelectedChange, highlightedIds, onActivateSpan, spanActions, isMinimapVisible, xTitle, ...figure }: TraceTimelineProps): ReactNode;
39
+ export declare function TraceTimeline({ lanes, spans, links, domain, categories, visibleRange, onVisibleRangeChange, offsetFormat, selected, onSelectedChange, highlightedIds, onActivateSpan, spanActions, isMinimapVisible, xTitle, ...figure }: TraceTimelineProps): ReactNode;
package/dist/styles2.css CHANGED
@@ -1011,6 +1011,10 @@
1011
1011
  background-color: color-mix(in srgb,var(--xzqn2nu) 10%,transparent);
1012
1012
  }
1013
1013
 
1014
+ .x1ld8el8 {
1015
+ background-color: color-mix(in srgb,var(--xzqn2nu) 14%,var(--x13kja51));
1016
+ }
1017
+
1014
1018
  .xtwfq29 {
1015
1019
  background-color: currentColor;
1016
1020
  }
@@ -1344,6 +1348,10 @@
1344
1348
  color: var(--xyheekc);
1345
1349
  }
1346
1350
 
1351
+ .x1v5v99g {
1352
+ color: var(--xzqn2nu);
1353
+ }
1354
+
1347
1355
  .x1jkipek {
1348
1356
  color: var(--xzwo5h9);
1349
1357
  }
@@ -1588,6 +1596,10 @@
1588
1596
  fill-opacity: .34;
1589
1597
  }
1590
1598
 
1599
+ .xbd1tli {
1600
+ fill-opacity: .35;
1601
+ }
1602
+
1591
1603
  .x6b6j1m {
1592
1604
  fill-opacity: .55;
1593
1605
  }
@@ -2060,6 +2072,10 @@
2060
2072
  opacity: .2;
2061
2073
  }
2062
2074
 
2075
+ .xvpkmg4 {
2076
+ opacity: .25;
2077
+ }
2078
+
2063
2079
  .xk8c4ds {
2064
2080
  opacity: .32;
2065
2081
  }
@@ -2084,6 +2100,10 @@
2084
2100
  opacity: .7;
2085
2101
  }
2086
2102
 
2103
+ .x1iy03kw {
2104
+ opacity: .9;
2105
+ }
2106
+
2087
2107
  .x1hc1fzr {
2088
2108
  opacity: 1;
2089
2109
  }