@epam/ai-dial-conversation-stages 1.0.0-dev.515 → 1.0.0-dev.518

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.
@@ -1,9 +1,11 @@
1
1
  import { FC } from 'react';
2
2
  import { CollapsedGroupProps } from '../../models/collapsed-group';
3
3
  /**
4
- * Shows all stages when there are fewer than `collapseThreshold`. When there are `collapseThreshold` or more,
5
- * completed stages are collapsed behind an expandable toggle while active
6
- * stages remain always visible.
4
+ * Wraps `StagesPanel` with a single summary line whose text and default
5
+ * open/closed state track the run: expanded with a live progress line while
6
+ * streaming, then collapsed to one line — finished or failed — the moment
7
+ * it ends. A lone stage skips the summary line entirely and renders
8
+ * directly; an empty list renders nothing.
7
9
  */
8
10
  export declare const CollapsedGroup: FC<CollapsedGroupProps>;
9
11
  //# sourceMappingURL=CollapsedGroup.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAWA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAIxE;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAqGlD,CAAC"}
1
+ {"version":3,"file":"CollapsedGroup.d.ts","sourceRoot":"","sources":["../../../src/components/CollapsedGroup/CollapsedGroup.tsx"],"names":[],"mappings":"AAeA,OAAO,EAAE,EAAE,EAA+B,MAAM,OAAO,CAAC;AACxD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AAUxE;;;;;;GAMG;AACH,eAAO,MAAM,cAAc,EAAE,EAAE,CAAC,mBAAmB,CAkNlD,CAAC"}
@@ -1,12 +1,30 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
1
+ import { StageStatus } from '@epam/ai-dial-chat-shared';
2
2
  import { FC } from 'react';
3
- interface Props {
3
+ /** Props for {@link StageIcon}. */
4
+ export interface StageIconProps {
4
5
  /** The stage status value; `null` means the stage is pending or running. */
5
- status: Stage['status'];
6
+ status: StageStatus | null;
6
7
  /** Whether this stage is the currently executing (live) stage. */
7
8
  isLive: boolean;
9
+ /** Accessible label announced for the running spinner. Defaults to `'Running'`. */
10
+ runningLabel?: string;
11
+ /** Accessible label announced (visually hidden) alongside a failed stage's icon. Defaults to `'Failed'`. */
12
+ failedLabel?: string;
8
13
  }
9
- /** Maps a stage status to the appropriate icon element. */
10
- export declare const StageIcon: FC<Props>;
11
- export {};
14
+ /**
15
+ * The row's single icon slot, filled by priority: exception (failed, or
16
+ * running via a spinner) always wins; everything else — completed, or a
17
+ * settled-but-unresolved stage from an aborted stream — falls back to one
18
+ * uniform check glyph, the same `IconCheck` glyph and size as the
19
+ * `CollapsedGroup` summary's own "Executed N steps" check, but in a quiet
20
+ * grey ink rather than the summary's success color — the summary is the one
21
+ * place that should read as a vivid confirmation, not every row. There is
22
+ * no separate "pending" glyph: the quiet tier is intentionally a single
23
+ * glyph, not a per-state icon set.
24
+ *
25
+ * The icon itself is `aria-hidden` (decorative) — status is also carried by
26
+ * text: failed stages get a visually-hidden label here, and their row name
27
+ * gets the warning ink color at the call site.
28
+ */
29
+ export declare const StageIcon: FC<StageIconProps>;
12
30
  //# sourceMappingURL=StageIcon.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StageIcon.d.ts","sourceRoot":"","sources":["../../../src/components/StageIcon/StageIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,UAAU,KAAK;IACb,4EAA4E;IAC5E,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IACxB,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;CACjB;AAED,2DAA2D;AAC3D,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,KAAK,CA2B/B,CAAC"}
1
+ {"version":3,"file":"StageIcon.d.ts","sourceRoot":"","sources":["../../../src/components/StageIcon/StageIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAGxD,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAG3B,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,4EAA4E;IAC5E,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAC3B,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,mFAAmF;IACnF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,4GAA4G;IAC5G,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CA8BxC,CAAC"}
@@ -1,17 +1,29 @@
1
1
  import { Stage } from '@epam/ai-dial-chat-shared';
2
2
  import { FC } from 'react';
3
- import { StageTypography } from '../../models/stages-props';
4
- interface Props {
3
+ import { StagesPanelLabels, StageTypography } from '../../models/stages-props';
4
+ /** Props for {@link StageItem}. */
5
+ export interface StageItemProps {
5
6
  /** The stage data to render. */
6
7
  stage: Stage;
7
8
  /** Whether this stage is the currently executing (live) stage. */
8
9
  isLive: boolean;
9
10
  /** Typography configuration applied to stage text elements. */
10
- typography: StageTypography;
11
- /** Accessible label for the copy button inside stage content. */
12
- copyAriaLabel?: string;
11
+ typography?: StageTypography;
12
+ /** User-visible strings. */
13
+ labels?: StagesPanelLabels;
14
+ /**
15
+ * Overrides the displayed name without affecting duration extraction —
16
+ * used to relabel an individual attempt (e.g. `'Attempt 2'`) inside a
17
+ * collapsed `×N` group while still reading that attempt's own duration
18
+ * from its real `stage.name`.
19
+ */
20
+ nameOverride?: string;
13
21
  }
14
- /** A single stage row — plain when no content, collapsible when content is present. */
15
- export declare const StageItem: FC<Props>;
16
- export {};
22
+ /**
23
+ * A single flat stage row: icon · name · tag? · duration? · chevron? — every
24
+ * element but the icon and name is optional and renders only when the data
25
+ * exists. Plain when the stage has no expandable content or attachments;
26
+ * becomes a disclosure button when it does.
27
+ */
28
+ export declare const StageItem: FC<StageItemProps>;
17
29
  //# sourceMappingURL=StageItem.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAKjE,UAAU,KAAK;IACb,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,UAAU,EAAE,eAAe,CAAC;IAC5B,iEAAiE;IACjE,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,uFAAuF;AACvF,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,KAAK,CAyE/B,CAAC"}
1
+ {"version":3,"file":"StageItem.d.ts","sourceRoot":"","sources":["../../../src/components/StageItem/StageItem.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAIvD,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EACV,iBAAiB,EACjB,eAAe,EAChB,MAAM,2BAA2B,CAAC;AAMnC,mCAAmC;AACnC,MAAM,WAAW,cAAc;IAC7B,gCAAgC;IAChC,KAAK,EAAE,KAAK,CAAC;IACb,kEAAkE;IAClE,MAAM,EAAE,OAAO,CAAC;IAChB,+DAA+D;IAC/D,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,eAAO,MAAM,SAAS,EAAE,EAAE,CAAC,cAAc,CAwHxC,CAAC"}
@@ -5,7 +5,7 @@ interface Props {
5
5
  /** Raw markdown string to render. */
6
6
  content: string;
7
7
  /** Typography configuration applied to text elements (`p`, `ul`, `ol`). */
8
- typography: StageTypography;
8
+ typography?: StageTypography;
9
9
  /** Accessible label for the copy button inside code blocks. Defaults to `'Copy'`. */
10
10
  copyAriaLabel?: string;
11
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StageMarkdownContent.d.ts","sourceRoot":"","sources":["../../../src/components/StageMarkdownContent/StageMarkdownContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,gGAAgG;AAChG,UAAU,KAAK;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,UAAU,EAAE,eAAe,CAAC;IAC5B,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qFAAqF;AACrF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA+C1C,CAAC"}
1
+ {"version":3,"file":"StageMarkdownContent.d.ts","sourceRoot":"","sources":["../../../src/components/StageMarkdownContent/StageMarkdownContent.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,EAAwB,MAAM,OAAO,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAIjE,gGAAgG;AAChG,UAAU,KAAK;IACb,qCAAqC;IACrC,OAAO,EAAE,MAAM,CAAC;IAChB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,eAAe,CAAC;IAC7B,qFAAqF;IACrF,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qFAAqF;AACrF,eAAO,MAAM,oBAAoB,EAAE,EAAE,CAAC,KAAK,CA2F1C,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { FC } from 'react';
2
2
  import { StagesPanelProps } from '../../models/stages-props';
3
3
  /**
4
- * Displays an agent's accumulated stages as a collapsible list.
5
- * Renders above the assistant message bubble during and after streaming.
4
+ * Displays an agent's accumulated stages as a flat, inline list of rows — no
5
+ * card, border, or panel around it. Repeated identical stage names collapse
6
+ * into one `×N` row that expands to the individual attempts.
6
7
  */
7
8
  export declare const StagesPanel: FC<StagesPanelProps>;
8
9
  //# sourceMappingURL=StagesPanel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAC3B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAIlE;;;GAGG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAqD5C,CAAC"}
1
+ {"version":3,"file":"StagesPanel.d.ts","sourceRoot":"","sources":["../../../src/components/StagesPanel/StagesPanel.tsx"],"names":[],"mappings":"AAOA,OAAO,EAAE,EAAE,EAAY,MAAM,OAAO,CAAC;AAErC,OAAO,KAAK,EAEV,gBAAgB,EAEjB,MAAM,2BAA2B,CAAC;AA4InC;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,CAoD5C,CAAC"}
package/index.css CHANGED
@@ -1,2 +1,2 @@
1
- ._panel_1e8hb_1{background:var(--cs-bg,transparent);border-color:var(--cs-border,transparent);color:var(--cs-text,var(--text-primary,#161b2d))}._collapseButton_1e8hb_7{background:var(--cs-button-bg,transparent)}._stageName_1e8hb_11{color:var(--cs-stage-text,var(--text-secondary,#575f73))}._iconSecondary_1e8hb_15{color:var(--cs-icon-secondary,var(--text-secondary,#575f73))}._stageContent_1e8hb_19{color:var(--cs-stage-text,var(--text-secondary,#575f73))}._codeBlock_1e8hb_23{background:var(--cs-code-bg,var(--bg-layer-0,#fcfcfc));border-color:var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._codeInline_1e8hb_29{background:var(--cs-code-bg,var(--bg-layer-0,#fcfcfc));color:var(--cs-code-text,var(--text-primary,#161b2d))}._blockquote_1e8hb_34{border-color:var(--cs-stage-text,var(--text-secondary,#575f73));color:var(--cs-stage-text,var(--text-secondary,#575f73))}._tableCell_1e8hb_39{border-color:var(--cs-border,var(--stroke-secondary,#d1dbea));color:var(--cs-stage-text,var(--text-secondary,#575f73))}._toggleButton_1rkek_1{color:var(--cs-cg-label,var(--text-secondary,#575f73))}._toggleButton_1rkek_1:hover{color:var(--cs-cg-label-hover,var(--text-primary,#161b2d))}._stepsCount_1rkek_8{color:var(--cs-cg-steps-count,var(--text-primary,#161b2d))}._contentBox_1rkek_12{border-color:var(--cs-cg-border,var(--stroke-secondary,#d1dbea))}
1
+ ._panel_mqtpu_2{color:var(--cs-text,var(--text-primary,#161b2d))}._row_mqtpu_6{border-radius:8px}._row_mqtpu_6:hover{background:var(--cs-row-hover,var(--bg-layer-2,#eef1f7))}._collapseButton_mqtpu_13{background:var(--cs-button-bg,transparent)}._stageName_mqtpu_17{color:var(--cs-stage-text,var(--text-secondary,#575f73))}._stageNameFailed_mqtpu_21{color:var(--cs-failed-text,var(--text-warning,#7f6300))}._monoName_mqtpu_25{font-family:ui-monospace,SF Mono,Menlo,Consolas,monospace}._tag_mqtpu_29{color:var(--cs-tag-text,var(--text-tertiary,#808898));text-transform:uppercase;letter-spacing:.04em}._count_mqtpu_35{color:var(--cs-count-text,var(--text-tertiary,#808898));font-variant-numeric:tabular-nums}._duration_mqtpu_40{color:var(--cs-duration-text,var(--text-tertiary,#808898));font-variant-numeric:tabular-nums}._iconSecondary_mqtpu_45{color:var(--cs-icon-secondary,var(--text-secondary,#575f73));opacity:.7}._iconCompleted_mqtpu_51{color:var(--cs-icon-completed,var(--text-tertiary,#808898))}._iconError_mqtpu_56{color:var(--cs-icon-error,var(--text-warning,#7f6300))}._stageContent_mqtpu_60{color:var(--cs-stage-text,var(--text-secondary,#575f73));line-height:150%!important}._codeBlock_mqtpu_65{background:var(--cs-code-bg,var(--bg-layer-0,#fcfcfc));border-color:var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._codeInline_mqtpu_71{background:var(--cs-code-bg,var(--bg-layer-0,#fcfcfc));border:1px solid var(--cs-code-border,var(--stroke-secondary,#d1dbea));color:var(--cs-code-text,var(--text-primary,#161b2d))}._blockquote_mqtpu_77{border-color:var(--cs-stage-text,var(--text-secondary,#575f73));color:var(--cs-stage-text,var(--text-secondary,#575f73))}._tableCell_mqtpu_82{border-color:var(--cs-border,var(--stroke-secondary,#d1dbea));color:var(--cs-stage-text,var(--text-secondary,#575f73))}._toggleButton_1exhc_2{color:var(--cs-cg-label,var(--text-secondary,#575f73));width:100%;justify-content:flex-start!important}._toggleButton_1exhc_2:hover{color:var(--cs-cg-label-hover,var(--text-primary,#161b2d))}._executedLabel_1exhc_11{color:var(--cs-cg-label,var(--text-secondary,#575f73))}._stepsCount_1exhc_16{color:var(--cs-cg-steps-count,var(--text-tertiary,#808898));font-variant-numeric:tabular-nums}._doneIcon_1exhc_22{color:var(--cs-cg-done,var(--text-success,#007274))}._failedText_1exhc_27{color:var(--cs-cg-failed,var(--text-warning,#7f6300))}._liveName_1exhc_32{color:var(--cs-cg-label,var(--text-primary,#161b2d))}
2
2
  /*$vite$:1*/
package/index.js CHANGED
@@ -1,202 +1,424 @@
1
1
  import { MarkdownRenderer as e, StageStatus as t, buildCssVars as n, copyToClipboard as r, mergeClasses as i } from "@epam/ai-dial-chat-shared";
2
2
  import { DIAL_ICON_SIZE as a, DialEllipsisTooltip as o, DialGhostIconButton as s, DialLinkButton as c, DialSpinner as l, ElementSize as u } from "@epam/ai-dial-ui-kit";
3
- import { IconAlertCircle as d, IconCheck as f, IconChevronDown as p, IconChevronRight as m, IconCircleCheck as h, IconCopy as g } from "@tabler/icons-react";
4
- import { memo as _, useCallback as v, useEffect as y, useRef as b, useState as x } from "react";
5
- import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
6
- var T = {
7
- panel: "_panel_1e8hb_1",
8
- collapseButton: "_collapseButton_1e8hb_7",
9
- stageName: "_stageName_1e8hb_11",
10
- iconSecondary: "_iconSecondary_1e8hb_15",
11
- stageContent: "_stageContent_1e8hb_19",
12
- codeBlock: "_codeBlock_1e8hb_23",
13
- codeInline: "_codeInline_1e8hb_29",
14
- blockquote: "_blockquote_1e8hb_34",
15
- tableCell: "_tableCell_1e8hb_39"
16
- }, E = ({ status: e, isLive: n }) => e ? e === t.Completed ? /* @__PURE__ */ C(h, {
3
+ import { IconAlertCircle as d, IconCheck as f, IconChevronDown as p, IconChevronRight as m, IconCopy as h } from "@tabler/icons-react";
4
+ import { memo as g, useCallback as _, useEffect as v, useRef as y, useState as b } from "react";
5
+ import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
6
+ //#region src/utils/stage-name.ts
7
+ var w = /[([][^()[\]]*[)\]]/g, T = /(\d+(?:\.\d+)?)\s*s\b/, E = /:\s*$/, D = (e) => {
8
+ w.lastIndex = 0;
9
+ let t, n = null, r = -1, i = 0;
10
+ for (; t = w.exec(e);) {
11
+ let e = t[0].slice(1, -1), a = T.exec(e);
12
+ if (a) {
13
+ n = a, r = t.index, i = t[0].length;
14
+ break;
15
+ }
16
+ }
17
+ return {
18
+ name: (n && r >= 0 ? e.slice(0, r) + e.slice(r + i) : e).replace(E, "").trim().replace(/ {2,}/g, " "),
19
+ durationLabel: n ? `${n[1]}s` : void 0
20
+ };
21
+ }, O = (e) => e.length > 0 && !/\s/.test(e) && e.includes("_"), k = (e) => e >= 60 ? `${Math.floor(e / 60)}m ${Math.round(e % 60)}s` : `${e.toFixed(1)}s`, A = (e) => {
22
+ if (!e) return;
23
+ let t = /^(\d+(?:\.\d+)?)s$/.exec(e);
24
+ return t ? parseFloat(t[1]) : void 0;
25
+ }, j = (e) => [...e].reverse().find((e) => e.status == null), M = (e, t) => e.findIndex((e) => e.index === t.index) + 1, N = (e) => {
26
+ let t = [], n = 0;
27
+ for (; n < e.length;) {
28
+ let r = e[n], i = D(r.name).name, a = n + 1;
29
+ for (; a < e.length && D(e[a].name).name === i;) a += 1;
30
+ let o = e.slice(n, a);
31
+ o.length > 1 ? t.push({
32
+ kind: "group",
33
+ key: r.index,
34
+ name: i,
35
+ attempts: o
36
+ }) : t.push({
37
+ kind: "single",
38
+ key: r.index,
39
+ stage: r
40
+ }), n = a;
41
+ }
42
+ return t;
43
+ }, P = {
44
+ panel: "_panel_mqtpu_2",
45
+ row: "_row_mqtpu_6",
46
+ collapseButton: "_collapseButton_mqtpu_13",
47
+ stageName: "_stageName_mqtpu_17",
48
+ stageNameFailed: "_stageNameFailed_mqtpu_21",
49
+ monoName: "_monoName_mqtpu_25",
50
+ tag: "_tag_mqtpu_29",
51
+ count: "_count_mqtpu_35",
52
+ duration: "_duration_mqtpu_40",
53
+ iconSecondary: "_iconSecondary_mqtpu_45",
54
+ iconCompleted: "_iconCompleted_mqtpu_51",
55
+ iconError: "_iconError_mqtpu_56",
56
+ stageContent: "_stageContent_mqtpu_60",
57
+ codeBlock: "_codeBlock_mqtpu_65",
58
+ codeInline: "_codeInline_mqtpu_71",
59
+ blockquote: "_blockquote_mqtpu_77",
60
+ tableCell: "_tableCell_mqtpu_82"
61
+ }, F = ({ status: e, isLive: n, runningLabel: r = "Running", failedLabel: i = "Failed" }) => n ? /* @__PURE__ */ S(l, {
62
+ size: 16,
63
+ ariaLabel: r
64
+ }) : e === t.Failed ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(d, {
17
65
  size: a.MD,
18
- className: T.iconSecondary
19
- }) : /* @__PURE__ */ C(d, {
20
- size: a.MD,
21
- className: T.iconSecondary
22
- }) : n ? /* @__PURE__ */ C(l, { size: 20 }) : /* @__PURE__ */ C(d, {
23
- size: a.MD,
24
- className: T.iconSecondary
25
- }), D = ({ children: e, codeClassName: t, copyAriaLabel: n }) => {
26
- let [o, c] = x(!1), l = b(null);
27
- y(() => () => {
66
+ className: P.iconError,
67
+ "aria-hidden": !0
68
+ }), /* @__PURE__ */ S("span", {
69
+ className: "sr-only",
70
+ children: i
71
+ })] }) : /* @__PURE__ */ S(f, {
72
+ size: a.SM,
73
+ className: P.iconCompleted,
74
+ "aria-hidden": !0
75
+ }), I = ({ children: e, codeClassName: t, copyAriaLabel: n }) => {
76
+ let [o, c] = b(!1), l = y(null);
77
+ v(() => () => {
28
78
  l.current != null && clearTimeout(l.current);
29
79
  }, []);
30
- let d = v(() => {
80
+ let d = _(() => {
31
81
  r(typeof e == "string" ? e : String(e ?? "")), l.current && clearTimeout(l.current), c(!0), l.current = setTimeout(() => c(!1), 2e3);
32
82
  }, [e]);
33
- return /* @__PURE__ */ w("pre", {
34
- className: i("relative max-h-[300px] overflow-auto rounded border p-3 text-sm", T.codeBlock),
35
- children: [/* @__PURE__ */ C(s, {
83
+ return /* @__PURE__ */ C("pre", {
84
+ className: i("relative max-h-[300px] overflow-auto rounded border p-3 text-sm", P.codeBlock),
85
+ children: [/* @__PURE__ */ S(s, {
36
86
  size: u.Small,
37
- icon: C(o ? f : g, {
87
+ icon: S(o ? f : h, {
38
88
  size: a.SM,
39
- className: T.iconSecondary
89
+ className: P.iconSecondary
40
90
  }),
41
91
  "aria-label": n,
42
92
  onClick: d,
43
93
  className: "absolute end-2 top-2"
44
- }), /* @__PURE__ */ C("code", {
94
+ }), /* @__PURE__ */ S("code", {
45
95
  className: i("font-mono", t),
46
96
  children: e
47
97
  })]
48
98
  });
49
- }, O = _(({ content: t, typography: n, copyAriaLabel: r = "Copy" }) => /* @__PURE__ */ C(e, {
50
- content: t,
51
- classNames: {
52
- p: i(n.fontClassName, T.stageContent),
53
- ul: i(n.fontClassName, T.stageContent),
54
- ol: i(n.fontClassName, T.stageContent),
55
- codeInline: T.codeInline,
56
- blockquote: T.blockquote,
57
- link: T.stageContent,
58
- tableCell: T.tableCell
59
- },
60
- components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ C(D, {
61
- codeClassName: t,
62
- copyAriaLabel: r,
63
- children: e
64
- }) : /* @__PURE__ */ C("code", {
65
- className: i("px-1 py-0.5", n.codeClassName ?? "rounded font-mono text-sm", T.codeInline),
66
- children: e
67
- }) }
68
- })), k = ({ stage: e, isLive: t, typography: n, copyAriaLabel: r = "Copy stage content" }) => {
69
- let [s, c] = x(!1), l = /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C(E, {
70
- status: e.status,
71
- isLive: t
72
- }), /* @__PURE__ */ C("span", {
73
- className: i("min-w-0 flex-1 truncate capitalize", T.stageName),
74
- children: /* @__PURE__ */ C(o, { text: e.name || e.status })
75
- })] });
76
- return e.content ? /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("button", {
99
+ }, L = g(({ content: t, typography: n, copyAriaLabel: r = "Copy" }) => {
100
+ let a = "mb-1.5 last:mb-0", o = i(n?.headingClassName ?? "dial-small-semi-text", P.stageContent, a);
101
+ return /* @__PURE__ */ S(e, {
102
+ content: t,
103
+ classNames: {
104
+ h1: o,
105
+ h2: o,
106
+ h3: o,
107
+ h4: o,
108
+ h5: o,
109
+ h6: o,
110
+ p: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent, "mb-1.5"),
111
+ ul: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent, a),
112
+ ol: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent, a),
113
+ strong: i(n?.strongClassName ?? n?.contentClassName ?? "dial-tiny-text", P.stageContent),
114
+ codeInline: P.codeInline,
115
+ blockquote: i(n?.contentClassName ?? "dial-tiny-text", P.blockquote, a),
116
+ link: i(n?.contentClassName ?? "dial-tiny-text", P.stageContent),
117
+ tableCell: i(n?.contentClassName ?? "dial-tiny-text", P.tableCell)
118
+ },
119
+ components: { code: ({ children: e, className: t }) => t?.includes("language-") ? /* @__PURE__ */ S(I, {
120
+ codeClassName: t,
121
+ copyAriaLabel: r,
122
+ children: e
123
+ }) : /* @__PURE__ */ S("code", {
124
+ className: i("inline-block px-1.5 py-1", n?.codeClassName ?? "rounded-md font-mono text-sm", P.codeInline),
125
+ children: e
126
+ }) }
127
+ });
128
+ }), R = ({ stage: e, isLive: n, typography: r, labels: s, nameOverride: c }) => {
129
+ let [l, u] = b(!1), { copyAriaLabel: d = "Copy stage content", runningAriaLabel: f, failedAriaLabel: h } = s ?? {}, { name: g, durationLabel: _ } = D(e.name), v = c ?? g, y = !c && O(g), w = e.status === t.Failed, T = !!e.content, E = /* @__PURE__ */ C(x, { children: [
130
+ /* @__PURE__ */ S("span", {
131
+ className: "flex flex-none items-center",
132
+ children: /* @__PURE__ */ S(F, {
133
+ status: e.status,
134
+ isLive: n,
135
+ runningLabel: f,
136
+ failedLabel: h
137
+ })
138
+ }),
139
+ /* @__PURE__ */ S("span", {
140
+ className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", P.stageName, w && P.stageNameFailed, y && P.monoName),
141
+ children: /* @__PURE__ */ S(o, { text: v || e.status || "" })
142
+ }),
143
+ e.tag && /* @__PURE__ */ S("span", {
144
+ className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", P.tag),
145
+ children: e.tag
146
+ }),
147
+ _ && /* @__PURE__ */ S("span", {
148
+ className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", P.duration),
149
+ children: _
150
+ }),
151
+ T && /* @__PURE__ */ S("span", {
152
+ className: i("flex-none", P.iconSecondary),
153
+ children: l ? /* @__PURE__ */ S(p, {
154
+ size: a.SM,
155
+ "aria-hidden": !0
156
+ }) : /* @__PURE__ */ S(m, {
157
+ size: a.SM,
158
+ className: "rtl:scale-x-[-1]",
159
+ "aria-hidden": !0
160
+ })
161
+ })
162
+ ] }), k = i("flex w-full items-center gap-2 px-2 py-1.5", P.row);
163
+ return T ? /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("button", {
77
164
  type: "button",
78
- onClick: () => c((e) => !e),
79
- className: i("flex w-full cursor-pointer items-center gap-2 p-0", T.collapseButton),
80
- children: [l, s ? /* @__PURE__ */ C(p, {
81
- size: a.MD,
82
- className: T.iconSecondary
83
- }) : /* @__PURE__ */ C(m, {
84
- size: a.MD,
85
- className: i(T.iconSecondary, "rtl:scale-x-[-1]")
86
- })]
87
- }), /* @__PURE__ */ C("div", {
88
- className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", s ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
89
- children: /* @__PURE__ */ C("div", {
165
+ onClick: () => u((e) => !e),
166
+ "aria-expanded": l,
167
+ className: i(k, "cursor-pointer text-start"),
168
+ children: E
169
+ }), /* @__PURE__ */ S("div", {
170
+ className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", l ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
171
+ children: /* @__PURE__ */ S("div", {
90
172
  className: "overflow-hidden",
91
- children: /* @__PURE__ */ C("div", {
92
- className: "mt-3 flex flex-col gap-3 ps-7",
93
- children: e.content && /* @__PURE__ */ C("div", {
173
+ children: /* @__PURE__ */ S("div", {
174
+ className: "mt-2 flex flex-col gap-3 py-1 ps-8",
175
+ children: e.content && /* @__PURE__ */ S("div", {
94
176
  className: "max-h-[300px] overflow-y-auto",
95
- children: /* @__PURE__ */ C(O, {
177
+ children: /* @__PURE__ */ S(L, {
96
178
  content: e.content,
97
- typography: n,
98
- copyAriaLabel: r
179
+ typography: r,
180
+ copyAriaLabel: d
99
181
  })
100
182
  })
101
183
  })
102
184
  })
103
- })] }) : /* @__PURE__ */ C("div", {
104
- className: "flex items-center gap-2",
105
- children: l
185
+ })] }) : /* @__PURE__ */ S("div", {
186
+ className: k,
187
+ children: E
106
188
  });
107
- }, A = ({ stages: e, isStreaming: t, className: r, styles: a, labels: o }) => {
108
- let { colors: s, typography: c = { fontClassName: "dial-small-text" } } = a ?? {}, { copyAriaLabel: l } = o ?? {}, u = n({
109
- "--cs-bg": s?.background,
110
- "--cs-border": s?.border,
189
+ }, z = ({ row: e, isLive: n, typography: r, labels: s }) => {
190
+ let { runningAriaLabel: c, failedAriaLabel: l, attemptLabel: u = (e) => `Attempt ${e}` } = s ?? {}, [d, f] = b(!1), h = e.attempts.some((e) => e.status === t.Failed), g = e.attempts.reduce((e, t) => {
191
+ let { durationLabel: n } = D(t.name);
192
+ return e + (A(n) ?? 0);
193
+ }, 0), _ = g > 0 ? k(g) : void 0;
194
+ return /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("button", {
195
+ type: "button",
196
+ onClick: () => f((e) => !e),
197
+ "aria-expanded": d,
198
+ className: i("flex w-full items-center gap-2 px-2 py-1.5 text-start", P.row),
199
+ children: [
200
+ /* @__PURE__ */ S("span", {
201
+ className: "flex flex-none items-center",
202
+ children: /* @__PURE__ */ S(F, {
203
+ status: h ? t.Failed : t.Completed,
204
+ isLive: n,
205
+ runningLabel: c,
206
+ failedLabel: l
207
+ })
208
+ }),
209
+ /* @__PURE__ */ S("span", {
210
+ className: i("min-w-0 max-w-[22rem] truncate", r?.fontClassName ?? "dial-small-text", P.stageName, h && P.stageNameFailed),
211
+ children: /* @__PURE__ */ S(o, { text: e.name })
212
+ }),
213
+ /* @__PURE__ */ C("span", {
214
+ className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", P.count),
215
+ children: ["×", e.attempts.length]
216
+ }),
217
+ _ && /* @__PURE__ */ S("span", {
218
+ className: i("flex-none", r?.countFontClassName ?? "dial-tiny-text", P.duration),
219
+ children: _
220
+ }),
221
+ /* @__PURE__ */ S("span", {
222
+ className: i("flex-none", P.iconSecondary),
223
+ children: d ? /* @__PURE__ */ S(p, {
224
+ size: a.SM,
225
+ "aria-hidden": !0
226
+ }) : /* @__PURE__ */ S(m, {
227
+ size: a.SM,
228
+ className: "rtl:scale-x-[-1]",
229
+ "aria-hidden": !0
230
+ })
231
+ })
232
+ ]
233
+ }), /* @__PURE__ */ S("div", {
234
+ className: i("grid overflow-hidden transition-[grid-template-rows] duration-[250ms] ease-in-out", d ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
235
+ children: /* @__PURE__ */ S("div", {
236
+ className: "overflow-hidden",
237
+ children: /* @__PURE__ */ S("ul", {
238
+ role: "list",
239
+ className: "mt-1 flex flex-col gap-0.5 ps-6",
240
+ children: e.attempts.map((t, i) => /* @__PURE__ */ S("li", {
241
+ role: "listitem",
242
+ children: /* @__PURE__ */ S(R, {
243
+ stage: t,
244
+ nameOverride: u(i + 1),
245
+ isLive: n && t.index === e.attempts[e.attempts.length - 1].index,
246
+ typography: r,
247
+ labels: s
248
+ })
249
+ }, t.index))
250
+ })
251
+ })
252
+ })] });
253
+ }, B = ({ stages: e, isStreaming: t, className: r, styles: a, labels: o }) => {
254
+ let { colors: s, typography: c } = a ?? {}, l = n({
111
255
  "--cs-text": s?.text,
256
+ "--cs-row-hover": s?.rowHoverColor,
112
257
  "--cs-stage-text": s?.stageTextColor,
113
- "--cs-running": s?.runningColor,
114
- "--cs-completed": s?.completedColor,
115
- "--cs-failed": s?.failedColor,
116
- "--cs-button-bg": s?.buttonBackground
117
- }), d = t ? e.reduce((e, t, n) => t.status ? e : n, -1) : -1;
118
- return /* @__PURE__ */ C("div", {
119
- style: u,
120
- className: i("w-full", T.panel, r),
121
- children: /* @__PURE__ */ C("ul", {
258
+ "--cs-failed-text": s?.failedColor
259
+ }), u = t ? j(e) : void 0, d = N(e);
260
+ return /* @__PURE__ */ S("div", {
261
+ style: l,
262
+ className: i("w-full", P.panel, r),
263
+ children: /* @__PURE__ */ S("ul", {
122
264
  role: "list",
123
- className: "flex w-full flex-col gap-4",
124
- children: e.map((e, t) => /* @__PURE__ */ C("li", {
265
+ className: "flex w-full flex-col gap-0.5 ps-5",
266
+ children: d.map((e) => e.kind === "single" ? /* @__PURE__ */ S("li", {
267
+ role: "listitem",
268
+ children: /* @__PURE__ */ S(R, {
269
+ stage: e.stage,
270
+ isLive: u?.index === e.stage.index,
271
+ typography: c,
272
+ labels: o
273
+ })
274
+ }, e.key) : /* @__PURE__ */ S("li", {
125
275
  role: "listitem",
126
- className: i("w-full", c.fontClassName),
127
- children: /* @__PURE__ */ C(k, {
128
- stage: e,
129
- isLive: d === t,
276
+ children: /* @__PURE__ */ S(z, {
277
+ row: e,
278
+ isLive: u?.index === e.attempts[e.attempts.length - 1].index,
130
279
  typography: c,
131
- copyAriaLabel: l
280
+ labels: o
132
281
  })
133
- }, e.index))
282
+ }, e.key))
134
283
  })
135
284
  });
136
- }, j = {
137
- toggleButton: "_toggleButton_1rkek_1",
138
- stepsCount: "_stepsCount_1rkek_8",
139
- contentBox: "_contentBox_1rkek_12"
140
- }, M = ({ stages: e, isStreaming: r, labels: o, collapseThreshold: s = 7, className: l, styles: u }) => {
141
- let { executedLabel: d = "Executed", stepsLabel: h = () => "steps" } = o ?? {}, [g, _] = x(!1);
142
- if (r) return /* @__PURE__ */ C(A, {
143
- stages: e,
144
- isStreaming: !0
145
- });
146
- let { colors: v, typography: y = { fontClassName: "dial-tiny-text" } } = u ?? {}, b = n({
147
- "--cs-cg-label": v?.labelColor,
148
- "--cs-cg-label-hover": v?.labelHoverColor,
149
- "--cs-cg-steps-count": v?.stepsCountColor,
150
- "--cs-cg-border": v?.contentBorderColor
285
+ }, V = {
286
+ toggleButton: "_toggleButton_1exhc_2",
287
+ executedLabel: "_executedLabel_1exhc_11",
288
+ stepsCount: "_stepsCount_1exhc_16",
289
+ doneIcon: "_doneIcon_1exhc_22",
290
+ failedText: "_failedText_1exhc_27",
291
+ liveName: "_liveName_1exhc_32"
292
+ }, H = ({ stages: e, isStreaming: r, labels: o, className: s, styles: u }) => {
293
+ let { executedLabel: d = "Executed", stepsLabel: h = () => "steps", failedCountLabel: g = (e) => `${e} failed`, runningStepLabel: _ = (e, t) => `Step ${e} of ${t}`, runningAriaLabel: x = "Running", copyAriaLabel: w, failedAriaLabel: T, attemptLabel: E } = o ?? {}, [O, N] = b(r), P = y(r);
294
+ v(() => {
295
+ P.current && !r && N(!1), P.current = r;
296
+ }, [r]);
297
+ let { colors: F } = u ?? {}, I = u?.typography ?? { fontClassName: "dial-small-text" }, L = n({
298
+ "--cs-cg-label": F?.labelColor,
299
+ "--cs-cg-label-hover": F?.labelHoverColor,
300
+ "--cs-cg-steps-count": F?.stepsCountColor,
301
+ "--cs-cg-done": F?.doneColor,
302
+ "--cs-cg-failed": F?.failedColor
151
303
  });
152
- if (e.length < s) return /* @__PURE__ */ C("div", {
153
- style: b,
154
- className: i("flex w-full flex-col gap-1", l),
155
- children: /* @__PURE__ */ C(A, {
156
- stages: e,
157
- isStreaming: !1
158
- })
304
+ if (e.length === 0) return null;
305
+ let R = {
306
+ copyAriaLabel: w,
307
+ runningAriaLabel: x,
308
+ failedAriaLabel: T,
309
+ attemptLabel: E
310
+ };
311
+ if (e.length === 1) return /* @__PURE__ */ S(B, {
312
+ stages: e,
313
+ isStreaming: r,
314
+ className: s,
315
+ styles: { typography: u?.typography },
316
+ labels: R
159
317
  });
160
- let T = e.filter((e) => e.status === t.Completed), E = e.filter((e) => e.status !== t.Completed);
161
- return /* @__PURE__ */ w("div", {
162
- style: b,
163
- className: i("flex w-full flex-col gap-1", l),
164
- children: [T.length > 0 && /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C(c, {
165
- className: j.toggleButton,
166
- onClick: () => _((e) => !e),
167
- iconBefore: /* @__PURE__ */ C(f, { size: a.SM }),
168
- iconAfter: g ? /* @__PURE__ */ C(p, { size: 12 }) : /* @__PURE__ */ C(m, {
169
- size: 12,
170
- className: "rtl:scale-x-[-1]"
318
+ let z = e.some((e) => e.status === t.Failed), H = e.reduce((e, t) => {
319
+ let { durationLabel: n } = D(t.name);
320
+ return e + (A(n) ?? 0);
321
+ }, 0), U = H > 0 ? k(H) : void 0, W = r ? j(e) : void 0, G;
322
+ if (r) {
323
+ let t = W ? M(e, W) : e.length, n = W ? D(W.name).name : "";
324
+ G = /* @__PURE__ */ C("span", {
325
+ role: "status",
326
+ "aria-live": "polite",
327
+ className: "inline-flex items-center gap-2",
328
+ children: [
329
+ /* @__PURE__ */ S(l, {
330
+ size: 14,
331
+ ariaLabel: x
332
+ }),
333
+ /* @__PURE__ */ S("span", {
334
+ className: i(I.fontClassName, V.liveName),
335
+ children: _(t, e.length)
336
+ }),
337
+ n && /* @__PURE__ */ S("span", {
338
+ className: i(I.fontClassName, V.executedLabel),
339
+ children: n
340
+ })
341
+ ]
342
+ });
343
+ } else if (z) {
344
+ let n = e.filter((e) => e.status === t.Failed).length;
345
+ G = /* @__PURE__ */ C("span", {
346
+ className: "inline-flex items-center gap-1",
347
+ children: [
348
+ /* @__PURE__ */ C("span", {
349
+ className: i(I.fontClassName, V.executedLabel),
350
+ children: [
351
+ d,
352
+ " ",
353
+ e.length,
354
+ " ",
355
+ h(e.length)
356
+ ]
357
+ }),
358
+ /* @__PURE__ */ S("span", {
359
+ className: i(I.fontClassName, V.failedText),
360
+ children: g(n)
361
+ }),
362
+ U && /* @__PURE__ */ S("span", {
363
+ className: i(I.fontClassName, V.stepsCount),
364
+ children: U
365
+ })
366
+ ]
367
+ });
368
+ } else G = /* @__PURE__ */ C("span", {
369
+ className: "inline-flex items-center gap-1",
370
+ children: [
371
+ /* @__PURE__ */ S(f, {
372
+ size: a.SM,
373
+ className: V.doneIcon,
374
+ "aria-hidden": !0
171
375
  }),
172
- label: /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("span", {
173
- className: i(y.fontClassName, "pe-1"),
174
- children: d
175
- }), /* @__PURE__ */ w("span", {
176
- className: i(y.fontClassName, j.stepsCount),
376
+ /* @__PURE__ */ C("span", {
377
+ className: i(I.fontClassName, V.executedLabel),
177
378
  children: [
178
- T.length,
379
+ d,
380
+ " ",
381
+ e.length,
179
382
  " ",
180
- h(T.length)
383
+ h(e.length)
181
384
  ]
182
- })] })
183
- }), /* @__PURE__ */ C("div", {
184
- className: i("grid pt-1 transition-[grid-template-rows] duration-300 ease-in-out", g ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
185
- children: /* @__PURE__ */ C("div", {
385
+ }),
386
+ U && /* @__PURE__ */ S("span", {
387
+ className: i(I.fontClassName, V.stepsCount),
388
+ children: U
389
+ })
390
+ ]
391
+ });
392
+ return /* @__PURE__ */ C("div", {
393
+ style: L,
394
+ className: i("flex w-full flex-col gap-1", s),
395
+ children: [/* @__PURE__ */ S(c, {
396
+ className: V.toggleButton,
397
+ onClick: () => N((e) => !e),
398
+ "aria-expanded": O,
399
+ iconAfter: O ? /* @__PURE__ */ S(p, {
400
+ size: 12,
401
+ "aria-hidden": !0
402
+ }) : /* @__PURE__ */ S(m, {
403
+ size: 12,
404
+ className: "rtl:scale-x-[-1]",
405
+ "aria-hidden": !0
406
+ }),
407
+ label: G
408
+ }), /* @__PURE__ */ S("div", {
409
+ className: i("grid transition-[grid-template-rows] duration-300 ease-in-out", O ? "grid-rows-[1fr]" : "grid-rows-[0fr]"),
410
+ children: /* @__PURE__ */ S("div", {
186
411
  className: "overflow-hidden",
187
- children: /* @__PURE__ */ C("div", {
188
- className: i("rounded border px-2 py-3", j.contentBox),
189
- children: /* @__PURE__ */ C(A, {
190
- stages: T,
191
- isStreaming: !1
192
- })
412
+ children: /* @__PURE__ */ S(B, {
413
+ stages: e,
414
+ isStreaming: r,
415
+ styles: { typography: u?.typography },
416
+ labels: R,
417
+ className: "pt-1"
193
418
  })
194
419
  })
195
- })] }), E.length > 0 && /* @__PURE__ */ C(A, {
196
- stages: E,
197
- isStreaming: !1
198
420
  })]
199
421
  });
200
422
  };
201
423
  //#endregion
202
- export { M as CollapsedGroup, A as StagesPanel };
424
+ export { H as CollapsedGroup, B as StagesPanel };
@@ -5,14 +5,16 @@ export interface CollapsedGroupColors {
5
5
  labelColor?: string;
6
6
  /** Color of the toggle button label and icon on hover. Defaults to `var(--text-primary, #161B2D)`. */
7
7
  labelHoverColor?: string;
8
- /** Color of the steps count. Defaults to `var(--text-primary, #161B2D)`. */
8
+ /** Color of the execution time. Defaults to `var(--text-tertiary, #808898)` — muted, matching the row-level duration's tone. */
9
9
  stepsCountColor?: string;
10
- /** Border color of the completed-stages content box. Defaults to `var(--stroke-secondary, #242c42)`. */
11
- contentBorderColor?: string;
10
+ /** Color of the leading check icon in the finished-and-successful summary. Defaults to `var(--text-success, #007274)`. */
11
+ doneColor?: string;
12
+ /** Color of the "N failed" text in the failed summary. Defaults to `var(--text-warning, #7f6300)`. */
13
+ failedColor?: string;
12
14
  }
13
15
  /** Typography configuration for the toggle button label text. */
14
16
  export interface CollapsedGroupTypography {
15
- /** CSS utility class applied to the toggle button label. Defaults to `'dial-tiny-text'`. */
17
+ /** CSS utility class applied to the toggle button label. Defaults to `'dial-small-text'` — matches the size of the step rows it summarizes, since a group header should never render smaller than its contents. */
16
18
  fontClassName?: string;
17
19
  /** Font family applied to the panel root via CSS custom property. */
18
20
  fontFamily?: string;
@@ -21,7 +23,7 @@ export interface CollapsedGroupTypography {
21
23
  export interface CollapsedGroupStyles {
22
24
  /** Color overrides applied as CSS custom properties. */
23
25
  colors?: CollapsedGroupColors;
24
- /** Typography for the toggle button label. Defaults to `{ fontClassName: 'dial-tiny-text' }`. */
26
+ /** Typography for the toggle button label. Defaults to `{ fontClassName: 'dial-small-text' }`. */
25
27
  typography?: CollapsedGroupTypography;
26
28
  }
27
29
  /** User-visible strings for the `CollapsedGroup` component. */
@@ -30,12 +32,28 @@ export interface CollapsedGroupLabels {
30
32
  executedLabel?: string;
31
33
  /** Returns the pluralized label for the steps count. Receives the count so callers can handle any plural rule. Defaults to `() => 'steps'`. */
32
34
  stepsLabel?: (count: number) => string;
35
+ /** Returns the "N failed" fragment shown in the failed summary. Defaults to `(n) => \`${n} failed\``. */
36
+ failedCountLabel?: (failedCount: number) => string;
37
+ /** Returns the "Step X of Y" fragment shown in the running summary. Defaults to `(current, total) => \`Step ${current} of ${total}\``. */
38
+ runningStepLabel?: (current: number, total: number) => string;
39
+ /** Accessible label announced for the running summary's spinner. Defaults to `'Running'`. */
40
+ runningAriaLabel?: string;
41
+ /** Accessible label for the copy button on each stage's content. Defaults to `'Copy'`. */
42
+ copyAriaLabel?: string;
43
+ /** Visually-hidden label announced alongside a failed stage's icon. Defaults to `'Failed'`. */
44
+ failedAriaLabel?: string;
45
+ /** Returns the label for a single attempt inside a collapsed `×N` group. Defaults to `(n) => \`Attempt ${n}\``. */
46
+ attemptLabel?: (attemptNumber: number) => string;
33
47
  }
34
48
  /** Props accepted by the `CollapsedGroup` component. */
35
49
  export interface CollapsedGroupProps {
36
50
  /** Ordered list of stages to display. */
37
51
  stages: Stage[];
38
- /** When `true` the component renders all stages directly via `StagesPanel` without collapsing. */
52
+ /**
53
+ * Whether the run is still streaming. Drives the summary line's state
54
+ * (running vs. finished vs. failed) and its default open/closed state —
55
+ * expanded while running, collapsed once finished.
56
+ */
39
57
  isStreaming: boolean;
40
58
  /** User-visible strings for the toggle button. */
41
59
  labels?: CollapsedGroupLabels;
@@ -43,7 +61,5 @@ export interface CollapsedGroupProps {
43
61
  className?: string;
44
62
  /** Color and typography overrides applied as CSS custom properties. */
45
63
  styles?: CollapsedGroupStyles;
46
- /** Minimum number of stages required to activate the collapse behaviour. Defaults to `7`. */
47
- collapseThreshold?: number;
48
64
  }
49
65
  //# sourceMappingURL=collapsed-group.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"collapsed-group.d.ts","sourceRoot":"","sources":["../../src/models/collapsed-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,4EAA4E;IAC5E,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wGAAwG;IACxG,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,iGAAiG;IACjG,UAAU,CAAC,EAAE,wBAAwB,CAAC;CACvC;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+IAA+I;IAC/I,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;CACxC;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,kGAAkG;IAClG,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,6FAA6F;IAC7F,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B"}
1
+ {"version":3,"file":"collapsed-group.d.ts","sourceRoot":"","sources":["../../src/models/collapsed-group.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,+FAA+F;IAC/F,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,sGAAsG;IACtG,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,gIAAgI;IAChI,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,0HAA0H;IAC1H,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sGAAsG;IACtG,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC,mNAAmN;IACnN,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,kGAAkG;IAClG,UAAU,CAAC,EAAE,wBAAwB,CAAC;CACvC;AAED,+DAA+D;AAC/D,MAAM,WAAW,oBAAoB;IACnC,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+IAA+I;IAC/I,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACvC,yGAAyG;IACzG,gBAAgB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,MAAM,CAAC;IACnD,0IAA0I;IAC1I,gBAAgB,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IAC9D,6FAA6F;IAC7F,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mHAAmH;IACnH,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB;;;;OAIG;IACH,WAAW,EAAE,OAAO,CAAC;IACrB,kDAAkD;IAClD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,oBAAoB,CAAC;CAC/B"}
@@ -0,0 +1,21 @@
1
+ import { Stage } from '@epam/ai-dial-chat-shared';
2
+ /** A single ungrouped stage row. */
3
+ export interface SingleStageRow {
4
+ kind: 'single';
5
+ /** Stable key for list rendering — the stage's own index. */
6
+ key: number;
7
+ stage: Stage;
8
+ }
9
+ /** A row formed by collapsing consecutive stages that share the same cleaned name into one `×N` row. */
10
+ export interface GroupedStageRow {
11
+ kind: 'group';
12
+ /** Stable key for list rendering — the first attempt's index. */
13
+ key: number;
14
+ /** Shared cleaned display name for the group. */
15
+ name: string;
16
+ /** Individual attempts in original order. */
17
+ attempts: Stage[];
18
+ }
19
+ /** A row rendered inside a `StagesPanel` — either one stage or a collapsed `×N` group of identical attempts. */
20
+ export type StageRow = SingleStageRow | GroupedStageRow;
21
+ //# sourceMappingURL=stage-grouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-grouping.d.ts","sourceRoot":"","sources":["../../src/models/stage-grouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,oCAAoC;AACpC,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,QAAQ,CAAC;IACf,6DAA6D;IAC7D,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,KAAK,CAAC;CACd;AAED,wGAAwG;AACxG,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,6CAA6C;IAC7C,QAAQ,EAAE,KAAK,EAAE,CAAC;CACnB;AAED,gHAAgH;AAChH,MAAM,MAAM,QAAQ,GAAG,cAAc,GAAG,eAAe,CAAC"}
@@ -1,50 +1,61 @@
1
1
  import { Stage } from '@epam/ai-dial-chat-shared';
2
2
  /**
3
- * Typography configuration for stage content text.
4
- * Use either `fontClassName` (a CSS utility class) or the explicit CSS property fields not both.
5
- * When `fontClassName` is provided, the individual CSS-property fields are ignored.
3
+ * Typography configuration for a stage row. The name is always the
4
+ * dominant text in the row bigger than the expanded contentso
5
+ * `fontClassName` (name) and `contentClassName` (expanded markdown content)
6
+ * are deliberately separate fields, not one shared class.
6
7
  */
7
8
  export interface StageTypography {
8
- /** CSS utility class applied to stage text elements (`p`, `ul`, `ol`). */
9
+ /** CSS utility class applied to the stage/step name. Defaults to `'dial-small-text'` (14px, normal weight). */
9
10
  fontClassName?: string;
10
- /** CSS utility class applied to inline code elements. Defaults to `'font-mono text-sm'`. */
11
+ /** CSS utility class applied to expanded stage content text elements (`p`, `ul`, `ol`, `blockquote`, `a`, table cells) — always smaller than the name. Defaults to `'dial-tiny-text'`, the DS's second-smallest text style (12px), with its line-height forced to 150% for readability. */
12
+ contentClassName?: string;
13
+ /** CSS utility class applied to `<strong>` (bold markdown) inside expanded content. Defaults to `contentClassName` — i.e. no extra weight — so bold markdown in tool/stage output doesn't out-emphasize the quiet, secondary tone of the rest of the content. Pass e.g. `'font-semibold'` to restore emphasis. */
14
+ strongClassName?: string;
15
+ /** CSS utility class applied to every heading level (`h1`–`h6`) inside expanded content. Defaults to `'dial-small-semi-text'` (14px, semibold) — headings inside a stage's content stay uniformly small rather than scaling up to the DS's larger heading sizes. */
16
+ headingClassName?: string;
17
+ /** CSS utility class applied to inline code elements. Defaults to `'rounded-md font-mono text-sm'`. */
11
18
  codeClassName?: string;
12
19
  /** Font family applied to the panel root via CSS custom property. */
13
20
  fontFamily?: string;
21
+ /** CSS utility class applied to count badges (e.g. `×N` collapsed group). Defaults to `'dial-tiny-text'`. */
22
+ countFontClassName?: string;
14
23
  }
15
- /** Color overrides for the `StagesPanel` component applied as CSS custom properties. */
24
+ /**
25
+ * Color overrides for the `StagesPanel` component applied as CSS custom
26
+ * properties. The panel is an inline list (no card/border), so these only
27
+ * cover the row-level surface: per-row hover tint and text tones.
28
+ */
16
29
  export interface StagesPanelColors {
17
- /** Background color of the panel surface. */
18
- background?: string;
19
- /** Border color of the panel. */
20
- border?: string;
21
- /** General text color (header label, count badge). */
30
+ /** General text color. */
22
31
  text?: string;
32
+ /** Background tint on row hover. Defaults to `--bg-layer-2`. */
33
+ rowHoverColor?: string;
23
34
  /**
24
35
  * Text color applied to each stage name row.
25
36
  * Defaults to the app's `--text-secondary` theme variable (`#9fa6bd`).
26
37
  */
27
38
  stageTextColor?: string;
28
- /** Icon / text color for a running stage. */
29
- runningColor?: string;
30
- /** Icon / text color for a completed stage. */
31
- completedColor?: string;
32
- /** Icon / text color for a failed or errored stage. */
39
+ /** Icon / text color for a failed or errored stage — the one exception that keeps a saturated color. */
33
40
  failedColor?: string;
34
- /** Background color of the collapsible stage button. Defaults to `transparent`. */
35
- buttonBackground?: string;
36
41
  }
37
42
  /** Combined style overrides (colors and typography) for the `StagesPanel` component. */
38
43
  export interface StagesPanelStyles {
39
44
  /** Color overrides applied as CSS custom properties. */
40
45
  colors?: StagesPanelColors;
41
- /** Typography applied to stage content text. Defaults to `{ fontClassName: 'dial-small-text' }`. */
46
+ /** Typography applied to the stage name and expanded content. Defaults to `{ fontClassName: 'dial-small-text', contentClassName: 'dial-tiny-text' }`. */
42
47
  typography?: StageTypography;
43
48
  }
44
49
  /** User-visible strings for the `StagesPanel` component. */
45
50
  export interface StagesPanelLabels {
46
51
  /** Accessible label for the copy button on each stage's content. Defaults to `'Copy'`. */
47
52
  copyAriaLabel?: string;
53
+ /** Accessible label announced for a running stage's spinner. Defaults to `'Running'`. */
54
+ runningAriaLabel?: string;
55
+ /** Visually-hidden label announced alongside a failed stage's icon. Defaults to `'Failed'`. */
56
+ failedAriaLabel?: string;
57
+ /** Returns the label for a single attempt inside a collapsed `×N` group, given its 1-based attempt number. Defaults to `(n) => \`Attempt ${n}\``. */
58
+ attemptLabel?: (attemptNumber: number) => string;
48
59
  }
49
60
  /** Props accepted by the `StagesPanel` component. */
50
61
  export interface StagesPanelProps {
@@ -1 +1 @@
1
- {"version":3,"file":"stages-props.d.ts","sourceRoot":"","sources":["../../src/models/stages-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B,0EAA0E;IAC1E,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,4FAA4F;IAC5F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,wFAAwF;AACxF,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6CAA6C;IAC7C,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+CAA+C;IAC/C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,uDAAuD;IACvD,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,mFAAmF;IACnF,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED,wFAAwF;AACxF,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,oGAAoG;IACpG,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,2EAA2E;IAC3E,WAAW,EAAE,OAAO,CAAC;IACrB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
1
+ {"version":3,"file":"stages-props.d.ts","sourceRoot":"","sources":["../../src/models/stages-props.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;;GAKG;AACH,MAAM,WAAW,eAAe;IAC9B,+GAA+G;IAC/G,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,2RAA2R;IAC3R,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kTAAkT;IAClT,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oQAAoQ;IACpQ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,uGAAuG;IACvG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,MAAM,CAAC;CAC7B;AAED;;;;GAIG;AACH,MAAM,WAAW,iBAAiB;IAChC,0BAA0B;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,wGAAwG;IACxG,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,wFAAwF;AACxF,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,yJAAyJ;IACzJ,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,0FAA0F;IAC1F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,qJAAqJ;IACrJ,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;CAClD;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,2EAA2E;IAC3E,WAAW,EAAE,OAAO,CAAC;IACrB,yDAAyD;IACzD,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,uEAAuE;IACvE,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,4BAA4B;IAC5B,MAAM,CAAC,EAAE,iBAAiB,CAAC;CAC5B"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-conversation-stages",
3
3
  "description": "Panel for displaying agent processing stages during LLM response streaming",
4
- "version": "1.0.0-dev.515",
4
+ "version": "1.0.0-dev.518",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -19,7 +19,7 @@
19
19
  "peerDependencies": {
20
20
  "react": "^19.0.0",
21
21
  "@tabler/icons-react": "^3.0.0",
22
- "@epam/ai-dial-chat-shared": "1.0.0-dev.515",
22
+ "@epam/ai-dial-chat-shared": "1.0.0-dev.518",
23
23
  "@epam/ai-dial-ui-kit": "0.12.0-dev.28"
24
24
  },
25
25
  "repository": {
@@ -0,0 +1,11 @@
1
+ import { Stage } from '@epam/ai-dial-chat-shared';
2
+ import { StageRow } from '../models/stage-grouping';
3
+ /**
4
+ * Collapses consecutive stages that share the same cleaned name into a
5
+ * single `×N` group row (expanding to the individual attempts); every other
6
+ * stage renders as its own row. Grouping is by cleaned name, not the raw
7
+ * backend string, so a name differing only by its embedded duration still
8
+ * groups correctly.
9
+ */
10
+ export declare const groupStagesByName: (stages: Stage[]) => StageRow[];
11
+ //# sourceMappingURL=stage-grouping.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-grouping.d.ts","sourceRoot":"","sources":["../../src/utils/stage-grouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,KAAK,EAAE,KAAG,QAAQ,EAgC3D,CAAC"}
@@ -0,0 +1,26 @@
1
+ /** Result of cleaning a raw backend stage name for display. */
2
+ export interface CleanedStageName {
3
+ /** Display name with any duration/timestamp group and trailing colon removed. Casing is preserved as given — never title-cased. */
4
+ name: string;
5
+ /** Extracted duration label (e.g. `'3.99s'`), or `undefined` if the raw name carried none. */
6
+ durationLabel?: string;
7
+ }
8
+ /**
9
+ * Cleans a raw backend stage name for display: extracts an embedded
10
+ * duration (discarding any accompanying timestamps, which have no
11
+ * structured home in the UI today) and strips a single trailing colon.
12
+ * Never re-cases or rewrites the remaining text.
13
+ */
14
+ export declare const cleanStageName: (rawName: string) => CleanedStageName;
15
+ /**
16
+ * Heuristic for "this cleaned name is a raw identifier, not prose":
17
+ * no whitespace and at least one underscore (e.g. `My_OMDB_Agent__0_0_1_tool`).
18
+ * Prose with an embedded identifier substring (e.g. `Call My_OMDB_Agent_tool`)
19
+ * still contains a space and is left as normal text.
20
+ */
21
+ export declare const isIdentifierLike: (name: string) => boolean;
22
+ /** Formats a total duration in seconds as `'Xm Ys'` when >= 60s, otherwise `'X.Xs'`. */
23
+ export declare const formatTotalDuration: (totalSeconds: number) => string;
24
+ /** Parses a duration label produced by {@link cleanStageName} (e.g. `'3.99s'`) back into seconds. */
25
+ export declare const parseDurationSeconds: (durationLabel: string | undefined) => number | undefined;
26
+ //# sourceMappingURL=stage-name.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-name.d.ts","sourceRoot":"","sources":["../../src/utils/stage-name.ts"],"names":[],"mappings":"AAeA,+DAA+D;AAC/D,MAAM,WAAW,gBAAgB;IAC/B,mIAAmI;IACnI,IAAI,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,gBAgChD,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OACW,CAAC;AAE5D,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,GAAI,cAAc,MAAM,KAAG,MAO1D,CAAC;AAEF,qGAAqG;AACrG,eAAO,MAAM,oBAAoB,GAC/B,eAAe,MAAM,GAAG,SAAS,KAChC,MAAM,GAAG,SAIX,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { Stage } from '@epam/ai-dial-chat-shared';
2
+ /**
3
+ * Finds the currently-executing stage while a run is streaming: the last
4
+ * entry with `status: null`. Returns `undefined` once every stage has
5
+ * settled (or the list is empty), even if the caller still reports
6
+ * `isStreaming: true` — a transitional state between the last stage settling
7
+ * and the stream closing.
8
+ */
9
+ export declare const findLiveStage: (stages: Stage[]) => Stage | undefined;
10
+ /** 1-based position of `stage` within `stages`, by its stable `index` field. */
11
+ export declare const stagePosition: (stages: Stage[], stage: Stage) => number;
12
+ //# sourceMappingURL=stage-progress.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-progress.d.ts","sourceRoot":"","sources":["../../src/utils/stage-progress.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD;;;;;;GAMG;AACH,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,KAAG,KAAK,GAAG,SACK,CAAC;AAE9D,gFAAgF;AAChF,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,EAAE,OAAO,KAAK,KAAG,MACR,CAAC"}