@epam/ai-dial-conversation-stages 1.2.0-dev.99 → 1.3.0-dev.5

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 (36) hide show
  1. package/components/CollapsedGroup/CollapsedGroup.d.ts.map +1 -1
  2. package/components/StageItem/StageItem.d.ts +11 -3
  3. package/components/StageItem/StageItem.d.ts.map +1 -1
  4. package/components/StageList/StageList.d.ts +29 -0
  5. package/components/StageList/StageList.d.ts.map +1 -0
  6. package/components/StageMarkdownContent/StageCodeBlock.d.ts +4 -2
  7. package/components/StageMarkdownContent/StageCodeBlock.d.ts.map +1 -1
  8. package/components/StageMarkdownContent/StageMarkdownContent.d.ts +6 -0
  9. package/components/StageMarkdownContent/StageMarkdownContent.d.ts.map +1 -1
  10. package/components/StagesPanel/StagesPanel.d.ts +15 -1
  11. package/components/StagesPanel/StagesPanel.d.ts.map +1 -1
  12. package/constants/stage-accordion.d.ts +11 -0
  13. package/constants/stage-accordion.d.ts.map +1 -0
  14. package/hooks/useStageExpansion/useStageExpansion.d.ts +9 -0
  15. package/hooks/useStageExpansion/useStageExpansion.d.ts.map +1 -0
  16. package/index.css +2 -2
  17. package/index.js +790 -426
  18. package/models/collapsed-group.d.ts +12 -6
  19. package/models/collapsed-group.d.ts.map +1 -1
  20. package/models/stage-grouping.d.ts +6 -6
  21. package/models/stage-grouping.d.ts.map +1 -1
  22. package/models/stage-tree.d.ts +21 -0
  23. package/models/stage-tree.d.ts.map +1 -0
  24. package/models/stages-props.d.ts +15 -5
  25. package/models/stages-props.d.ts.map +1 -1
  26. package/package.json +5 -4
  27. package/utils/stage-attachments.d.ts +11 -0
  28. package/utils/stage-attachments.d.ts.map +1 -0
  29. package/utils/stage-grouping.d.ts +7 -3
  30. package/utils/stage-grouping.d.ts.map +1 -1
  31. package/utils/stage-name.d.ts +0 -6
  32. package/utils/stage-name.d.ts.map +1 -1
  33. package/utils/stage-progress.d.ts +0 -2
  34. package/utils/stage-progress.d.ts.map +1 -1
  35. package/utils/stage-tree.d.ts +14 -0
  36. package/utils/stage-tree.d.ts.map +1 -0
@@ -1,4 +1,4 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
1
+ import { DisplayAttachment, Stage } from '@epam/ai-dial-chat-shared';
2
2
  import { StagesPanelColors } from './stages-props';
3
3
  /** Color overrides for the `CollapsedGroup` component applied as CSS custom properties. */
4
4
  export interface CollapsedGroupColors {
@@ -6,8 +6,6 @@ export interface CollapsedGroupColors {
6
6
  labelColor?: string;
7
7
  /** Color of the toggle button label and icon on hover. */
8
8
  labelHoverColor?: string;
9
- /** Color of the execution time. */
10
- stepsCountColor?: string;
11
9
  /** Color of the leading check icon in the finished-and-successful summary. */
12
10
  doneColor?: string;
13
11
  /** Color of the "N failed" text in the failed summary. */
@@ -35,16 +33,22 @@ export interface CollapsedGroupLabels {
35
33
  stepsLabel?: (count: number) => string;
36
34
  /** Returns the "N failed" text in the failed summary. Defaults to `(n) => \`${n} failed\``. */
37
35
  failedCountLabel?: (failedCount: number) => string;
38
- /** Returns the "Step X of Y" text in the running summary. Defaults to `(current, total) => \`Step ${current} of ${total}\``. */
39
- runningStepLabel?: (current: number, total: number) => string;
40
36
  /** Accessible label announced for the running summary's spinner. Defaults to `'Running'`. */
41
37
  runningAriaLabel?: string;
42
- /** Accessible label for the copy button on each stage's content. Defaults to `'Copy'`. */
38
+ /** Accessible label for the copy button on each stage content code block. Defaults to `'Copy stage content'`. */
43
39
  copyAriaLabel?: string;
40
+ /** Status announced after a stage content code block has been copied. Defaults to `'Copied!'`. */
41
+ codeBlockCopiedLabel?: string;
42
+ /** Accessible label for a table's horizontally scrollable region in stage content. Defaults to `'Scrollable table'`. */
43
+ tableScrollRegionAriaLabel?: string;
44
+ /** Accessible label for a block formula's horizontally scrollable region in stage content. Defaults to `'Scrollable formula'`. */
45
+ mathScrollRegionAriaLabel?: string;
44
46
  /** Visually-hidden label announced alongside a failed stage's icon. Defaults to `'Failed'`. */
45
47
  failedAriaLabel?: string;
46
48
  /** Returns the label for a single attempt inside a collapsed `×N` group. Defaults to `(n) => \`Attempt ${n}\``. */
47
49
  attemptLabel?: (attemptNumber: number) => string;
50
+ /** Accessible label for a stage attachment tile's interactive click action. Defaults to `'Preview search result'`. */
51
+ attachmentClickLabel?: string;
48
52
  }
49
53
  /** Props accepted by the `CollapsedGroup` component. */
50
54
  export interface CollapsedGroupProps {
@@ -58,5 +62,7 @@ export interface CollapsedGroupProps {
58
62
  className?: string;
59
63
  /** Color and typography overrides applied as CSS custom properties. */
60
64
  styles?: CollapsedGroupStyles;
65
+ /** Called when a stage attachment tile is clicked/activated. Forwarded unchanged to the inner `StagesPanel`. */
66
+ onAttachmentClick?: (attachment: DisplayAttachment) => void;
61
67
  }
62
68
  //# 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;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAExD,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,iDAAiD;IACjD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mCAAmC;IACnC,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,wBAAwB;IACvC,6FAA6F;IAC7F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,2FAA2F;AAC3F,MAAM,WAAW,oBAAoB;IACnC,wDAAwD;IACxD,MAAM,CAAC,EAAE,oBAAoB,CAAC;IAC9B,8CAA8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,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,8FAA8F;IAC9F,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,gHAAgH;IAChH,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7D"}
@@ -1,13 +1,13 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
2
- /** A row rendered inside a `StagesPanel` — either one stage or a collapsed `×N` group of identical attempts. */
1
+ import { StageNode } from './stage-tree';
2
+ /** A row rendered inside one sibling list — either one stage node or a collapsed `×N` group of identical attempts. */
3
3
  export interface StageRow {
4
4
  /** Stable key for list rendering — the first attempt's index. */
5
5
  key: number;
6
6
  /** Shared cleaned display name for the group. */
7
7
  name?: string;
8
- /** The single stage for this row (present only when there is one attempt). */
9
- stage?: Stage;
10
- /** Individual attempts in original order. */
11
- attempts?: Stage[];
8
+ /** The single stage node for this row (present only when there is one attempt). */
9
+ node?: StageNode;
10
+ /** Individual attempts in original order, each keeping its own descendants. */
11
+ attempts?: StageNode[];
12
12
  }
13
13
  //# sourceMappingURL=stage-grouping.d.ts.map
@@ -1 +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,gHAAgH;AAChH,MAAM,WAAW,QAAQ;IACvB,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,KAAK,CAAC,EAAE,KAAK,CAAC;IACd,6CAA6C;IAC7C,QAAQ,CAAC,EAAE,KAAK,EAAE,CAAC;CACpB"}
1
+ {"version":3,"file":"stage-grouping.d.ts","sourceRoot":"","sources":["../../src/models/stage-grouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE9C,sHAAsH;AACtH,MAAM,WAAW,QAAQ;IACvB,iEAAiE;IACjE,GAAG,EAAE,MAAM,CAAC;IACZ,iDAAiD;IACjD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,mFAAmF;IACnF,IAAI,CAAC,EAAE,SAAS,CAAC;IACjB,+EAA+E;IAC/E,QAAQ,CAAC,EAAE,SAAS,EAAE,CAAC;CACxB"}
@@ -0,0 +1,21 @@
1
+ import { Stage } from '@epam/ai-dial-chat-shared';
2
+ /** One stage in the display hierarchy derived from `parent_stage_index`. */
3
+ export interface StageNode {
4
+ /** The original normalized stage; never mutated. */
5
+ stage: Stage;
6
+ /** Child nodes in their input encounter order. */
7
+ children: StageNode[];
8
+ }
9
+ /** Panel-local disclosure state, keyed by stable stage identity. */
10
+ export interface StageExpansion {
11
+ /** Returns whether the disclosure with this key is expanded. */
12
+ isExpanded: (key: string) => boolean;
13
+ /** Records the user's expand/collapse choice for this key. */
14
+ onToggle: (key: string, isExpanded: boolean) => void;
15
+ }
16
+ /** Disclosure state together with the owner's ability to discard every choice. */
17
+ export interface StageExpansionState extends StageExpansion {
18
+ /** Collapses every disclosure, e.g. when the surrounding panel unmounts. */
19
+ reset: () => void;
20
+ }
21
+ //# sourceMappingURL=stage-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-tree.d.ts","sourceRoot":"","sources":["../../src/models/stage-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAEvD,4EAA4E;AAC5E,MAAM,WAAW,SAAS;IACxB,oDAAoD;IACpD,KAAK,EAAE,KAAK,CAAC;IACb,kDAAkD;IAClD,QAAQ,EAAE,SAAS,EAAE,CAAC;CACvB;AAED,oEAAoE;AACpE,MAAM,WAAW,cAAc;IAC7B,gEAAgE;IAChE,UAAU,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC;IACrC,8DAA8D;IAC9D,QAAQ,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,OAAO,KAAK,IAAI,CAAC;CACtD;AAED,kFAAkF;AAClF,MAAM,WAAW,mBAAoB,SAAQ,cAAc;IACzD,4EAA4E;IAC5E,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB"}
@@ -1,4 +1,4 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
1
+ import { DisplayAttachment, Stage } from '@epam/ai-dial-chat-shared';
2
2
  /** Typography class overrides for stage name and expanded content elements in `StagesPanel`. */
3
3
  export interface StageTypography {
4
4
  /** CSS utility class applied to the stage/step name. Defaults to `'dial-small-text'`. */
@@ -9,9 +9,9 @@ export interface StageTypography {
9
9
  strongClassName?: string;
10
10
  /** CSS utility class applied to every heading level (`h1`–`h6`) inside expanded content. Defaults to `'dial-small-semi-text'`. */
11
11
  headingClassName?: string;
12
- /** CSS utility class applied to inline code elements. Defaults to `'dial-code-text rounded-md'`. */
12
+ /** CSS utility class applied to inline code elements; the monospace family comes from the panel stylesheet. Defaults to `'dial-tiny-text rounded-md'`. */
13
13
  codeClassName?: string;
14
- /** CSS utility class applied to fenced code blocks (`<pre>`). Defaults to `'dial-code-text'`. */
14
+ /** CSS utility class applied to fenced code blocks. Defaults to `'dial-code-text'`. */
15
15
  codeBlockClassName?: string;
16
16
  /** CSS utility class applied to count badges (e.g. `×N` collapsed group). Defaults to `'dial-tiny-text'`. */
17
17
  countFontClassName?: string;
@@ -38,7 +38,7 @@ export interface StagesPanelColors {
38
38
  durationTextColor?: string;
39
39
  /** Color of secondary (non-status) icons. Defaults to `--text-secondary` at 70% opacity. */
40
40
  iconSecondaryColor?: string;
41
- /** Color of the completed-check icon. Defaults to `--text-tertiary`. */
41
+ /** Color of the completed-check icon. Defaults to `--text-success`. */
42
42
  iconCompletedColor?: string;
43
43
  /** Color of the error/exception icon. Defaults to `--text-warning`. */
44
44
  iconErrorColor?: string;
@@ -60,14 +60,22 @@ export interface StagesPanelStyles {
60
60
  }
61
61
  /** User-visible strings for the `StagesPanel` component. */
62
62
  export interface StagesPanelLabels {
63
- /** Accessible label for the copy button on each stage's content. Defaults to `'Copy'`. */
63
+ /** Accessible label for the copy button on each stage content code block. Defaults to `'Copy stage content'`. */
64
64
  copyAriaLabel?: string;
65
+ /** Status announced after a stage content code block has been copied. Defaults to `'Copied!'`. */
66
+ codeBlockCopiedLabel?: string;
67
+ /** Accessible label for a table's horizontally scrollable region in stage content. Defaults to `'Scrollable table'`. */
68
+ tableScrollRegionAriaLabel?: string;
69
+ /** Accessible label for a block formula's horizontally scrollable region in stage content. Defaults to `'Scrollable formula'`. */
70
+ mathScrollRegionAriaLabel?: string;
65
71
  /** Accessible label announced for a running stage's spinner. Defaults to `'Running'`. */
66
72
  runningAriaLabel?: string;
67
73
  /** Visually-hidden label announced alongside a failed stage's icon. Defaults to `'Failed'`. */
68
74
  failedAriaLabel?: string;
69
75
  /** Label for a single attempt given its 1-based number. Defaults to `(n) => \`Attempt ${n}\``. */
70
76
  attemptLabel?: (attemptNumber: number) => string;
77
+ /** Accessible label for a stage attachment tile's interactive click action. Defaults to `'Preview search result'`. */
78
+ attachmentClickLabel?: string;
71
79
  }
72
80
  /** Props accepted by the `StagesPanel` component. */
73
81
  export interface StagesPanelProps {
@@ -81,5 +89,7 @@ export interface StagesPanelProps {
81
89
  styles?: StagesPanelStyles;
82
90
  /** User-visible strings. */
83
91
  labels?: StagesPanelLabels;
92
+ /** Called when a stage attachment tile is clicked/activated. Receives the mapped display attachment. */
93
+ onAttachmentClick?: (attachment: DisplayAttachment) => void;
84
94
  }
85
95
  //# sourceMappingURL=stages-props.d.ts.map
@@ -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,gGAAgG;AAChG,MAAM,WAAW,eAAe;IAC9B,yFAAyF;IACzF,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,wJAAwJ;IACxJ,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,kJAAkJ;IAClJ,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kIAAkI;IAClI,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,oGAAoG;IACpG,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iGAAiG;IACjG,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,6GAA6G;IAC7G,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,gIAAgI;IAChI,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,2EAA2E;AAC3E,MAAM,WAAW,iBAAiB;IAChC,wDAAwD;IACxD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qEAAqE;IACrE,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,qEAAqE;IACrE,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,4EAA4E;IAC5E,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,qEAAqE;IACrE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,wFAAwF;IACxF,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,4FAA4F;IAC5F,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,wEAAwE;IACxE,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,uEAAuE;IACvE,cAAc,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ChC,wDAAwD;IACxD,MAAM,CAAC,EAAE,iBAAiB,CAAC;IAC3B,iEAAiE;IACjE,UAAU,CAAC,EAAE,eAAe,CAAC;CAC9B;AAED,4DAA4D;AAC5D,MAAM,WAAW,iBAAiB;IAChC,iHAAiH;IACjH,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kGAAkG;IAClG,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,wHAAwH;IACxH,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,kIAAkI;IAClI,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,yFAAyF;IACzF,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,+FAA+F;IAC/F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,kGAAkG;IAClG,YAAY,CAAC,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,MAAM,CAAC;IACjD,sHAAsH;IACtH,oBAAoB,CAAC,EAAE,MAAM,CAAC;CAC/B;AAED,qDAAqD;AACrD,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,yEAAyE;IACzE,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;IAC3B,wGAAwG;IACxG,iBAAiB,CAAC,EAAE,CAAC,UAAU,EAAE,iBAAiB,KAAK,IAAI,CAAC;CAC7D"}
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.2.0-dev.99",
4
+ "version": "1.3.0-dev.5",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -17,12 +17,13 @@
17
17
  }
18
18
  },
19
19
  "dependencies": {
20
- "@tabler/icons-react": "^3.44.0"
20
+ "@tabler/icons-react": "^3.44.0",
21
+ "@epam/ai-dial-attachment-input": "1.3.0-dev.5"
21
22
  },
22
23
  "peerDependencies": {
23
24
  "react": "^19.2.8",
24
- "@epam/ai-dial-chat-shared": "1.2.0-dev.99",
25
- "@epam/ai-dial-ui-kit": "^0.15.0-dev.12"
25
+ "@epam/ai-dial-chat-shared": "1.3.0-dev.5",
26
+ "@epam/ai-dial-ui-kit": "^0.15.0"
26
27
  },
27
28
  "repository": {
28
29
  "type": "git",
@@ -0,0 +1,11 @@
1
+ import { DisplayAttachment, MessageAttachment } from '@epam/ai-dial-chat-shared';
2
+ /**
3
+ * Maps stage attachments to their display-only model, preferring each
4
+ * attachment's own declared `type` for `contentType` over the type inferred
5
+ * from `reference_url`'s path. A stage attachment's `reference_url` points at
6
+ * the source document a search result was extracted from, not at the
7
+ * attachment's own content, so the generic message-attachment mapper's
8
+ * reference-url-first inference produces the wrong content type here.
9
+ */
10
+ export declare const mapStageAttachmentsToDisplay: (attachments?: MessageAttachment[]) => DisplayAttachment[];
11
+ //# sourceMappingURL=stage-attachments.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-attachments.d.ts","sourceRoot":"","sources":["../../src/utils/stage-attachments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAGnC;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GACvC,cAAc,iBAAiB,EAAE,KAChC,iBAAiB,EAqBnB,CAAC"}
@@ -1,5 +1,9 @@
1
- import { Stage } from '@epam/ai-dial-chat-shared';
2
1
  import { StageRow } from '../models/stage-grouping';
3
- /** Groups consecutive stages with the same cleaned name into a `×N` group row; all others render as single rows. */
4
- export declare const groupStagesByName: (stages: Stage[]) => StageRow[];
2
+ import { StageNode } from '../models/stage-tree';
3
+ /**
4
+ * Groups consecutive sibling nodes with the same cleaned name into a `×N`
5
+ * group row; all others render as single rows. Applied to one sibling list
6
+ * at a time, so equal names under different parents never share a group.
7
+ */
8
+ export declare const groupStagesByName: (nodes: StageNode[]) => StageRow[];
5
9
  //# sourceMappingURL=stage-grouping.d.ts.map
@@ -1 +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,oHAAoH;AACpH,eAAO,MAAM,iBAAiB,GAAI,QAAQ,KAAK,EAAE,KAAG,QAAQ,EA+B3D,CAAC"}
1
+ {"version":3,"file":"stage-grouping.d.ts","sourceRoot":"","sources":["../../src/utils/stage-grouping.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;;GAIG;AACH,eAAO,MAAM,iBAAiB,GAAI,OAAO,SAAS,EAAE,KAAG,QAAQ,EA2B9D,CAAC"}
@@ -9,11 +9,5 @@ interface CleanedStageName {
9
9
  export declare const cleanStageName: (rawName: string) => CleanedStageName;
10
10
  /** Returns true if the name looks like a raw identifier: no whitespace and contains an underscore. */
11
11
  export declare const isIdentifierLike: (name: string) => boolean;
12
- /** Formats a total duration in seconds as `'Xm Ys'` when >= 60s, otherwise `'X.Xs'`. */
13
- export declare const formatTotalDuration: (totalSeconds: number) => string;
14
- /** Parses a duration label produced by {@link cleanStageName} (e.g. `'3.99s'`) back into seconds. */
15
- export declare const parseDurationSeconds: (durationLabel: string | undefined) => number | undefined;
16
- /** Returns the elapsed duration represented by stage names, without double-counting overlapping timed stages. */
17
- export declare const calculateStagesDurationSeconds: (stageNames: string[]) => number;
18
12
  export {};
19
13
  //# sourceMappingURL=stage-name.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"stage-name.d.ts","sourceRoot":"","sources":["../../src/utils/stage-name.ts"],"names":[],"mappings":"AAuCA,+DAA+D;AAC/D,UAAU,gBAAgB;IACxB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAkCD,0HAA0H;AAC1H,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,gBAiBhD,CAAC;AAEF,sGAAsG;AACtG,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;AAEF,iHAAiH;AACjH,eAAO,MAAM,8BAA8B,GACzC,YAAY,MAAM,EAAE,KACnB,MA2DF,CAAC"}
1
+ {"version":3,"file":"stage-name.d.ts","sourceRoot":"","sources":["../../src/utils/stage-name.ts"],"names":[],"mappings":"AA+BA,+DAA+D;AAC/D,UAAU,gBAAgB;IACxB,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,8FAA8F;IAC9F,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAuBD,0HAA0H;AAC1H,eAAO,MAAM,cAAc,GAAI,SAAS,MAAM,KAAG,gBAiBhD,CAAC;AAEF,sGAAsG;AACtG,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,KAAG,OACW,CAAC"}
@@ -1,6 +1,4 @@
1
1
  import { Stage } from '@epam/ai-dial-chat-shared';
2
2
  /** Returns the last stage with `status: null` (the currently executing stage), or `undefined` if none exists. */
3
3
  export declare const findLiveStage: (stages: Stage[]) => Stage | undefined;
4
- /** 1-based position of `stage` within `stages`, by its stable `index` field. */
5
- export declare const stagePosition: (stages: Stage[], stage: Stage) => number;
6
4
  //# sourceMappingURL=stage-progress.d.ts.map
@@ -1 +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,iHAAiH;AACjH,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"}
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,iHAAiH;AACjH,eAAO,MAAM,aAAa,GAAI,QAAQ,KAAK,EAAE,KAAG,KAAK,GAAG,SACK,CAAC"}
@@ -0,0 +1,14 @@
1
+ import { Stage } from '@epam/ai-dial-chat-shared';
2
+ import { StageNode } from '../models/stage-tree';
3
+ /**
4
+ * Derives the display forest from a flat, normalized stage array in O(n).
5
+ * Roots and each child list keep input encounter order; a stage whose parent
6
+ * reference is missing, unknown, self/forward-pointing or malformed becomes a
7
+ * root. Every input stage appears exactly once; the input is not mutated.
8
+ */
9
+ export declare const buildStageTree: (stages: Stage[]) => StageNode[];
10
+ /** Disclosure key of a single stage — its stable index, never its streaming name. */
11
+ export declare const getStageExpansionKey: (stageIndex: number) => string;
12
+ /** Disclosure key of a `×N` retry group — its first attempt's index. */
13
+ export declare const getGroupExpansionKey: (firstAttemptIndex: number) => string;
14
+ //# sourceMappingURL=stage-tree.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stage-tree.d.ts","sourceRoot":"","sources":["../../src/utils/stage-tree.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AACvD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAC;AAuBtD;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,QAAQ,KAAK,EAAE,KAAG,SAAS,EAgBzD,CAAC;AAEF,qFAAqF;AACrF,eAAO,MAAM,oBAAoB,GAAI,YAAY,MAAM,KAAG,MACnC,CAAC;AAExB,wEAAwE;AACxE,eAAO,MAAM,oBAAoB,GAAI,mBAAmB,MAAM,KAAG,MACnC,CAAC"}