@epam/ai-dial-chat-hooks 1.2.0-dev.225 → 1.2.0-dev.229

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.
@@ -14,10 +14,14 @@ var t = (t) => t === e.Completed ? e.Completed : t === e.Failed ? e.Failed : nul
14
14
  status: t(e.status),
15
15
  ...e.content != null && { content: e.content },
16
16
  ...e.tag != null && { tag: e.tag },
17
- ...e.attachments?.length && { attachments: e.attachments.map(n) }
17
+ ...e.attachments?.length && { attachments: e.attachments.map(n) },
18
+ ...e.parent_stage_index != null && { parent_stage_index: e.parent_stage_index }
18
19
  }), i = (e) => {
19
20
  let t = Array.isArray(e) ? e : e?.custom_content?.stages ?? e?.customContent?.stages;
20
- if (t?.length) return t.map(r);
21
+ if (t?.length) return t.map((e, t) => r(e.index == null ? {
22
+ ...e,
23
+ index: t
24
+ } : e));
21
25
  };
22
26
  //#endregion
23
27
  export { i as mapStages, r as toStage };
package/conversation.d.ts CHANGED
@@ -643,9 +643,12 @@ declare interface LocalModeValues {
643
643
  }
644
644
 
645
645
  /**
646
- * Returns the normalized stages of a raw stage array or a message-like
647
- * payload (reading `custom_content.stages`, falling back to
648
- * `customContent.stages`), or `undefined` when there are none.
646
+ * Returns the normalized stages of a complete raw stage array or a
647
+ * message-like payload (reading `custom_content.stages`, falling back to
648
+ * `customContent.stages`), or `undefined` when there are none. An entry
649
+ * without an `index` takes its array position — the identity a complete
650
+ * non-streaming array's `parent_stage_index` refers to — while explicit
651
+ * (possibly sparse) indexes are kept. Not for partial stream deltas.
649
652
  */
650
653
  export declare const mapStages: (source: RawStage[] | RawStageSource | null | undefined) => Stage[] | undefined;
651
654
 
@@ -731,6 +734,11 @@ export declare interface RawStage {
731
734
  tag?: string | null;
732
735
  /** Files produced or referenced by this stage. */
733
736
  attachments?: RawStageAttachment[] | null;
737
+ /**
738
+ * `index` of the parent stage (its array position in a complete unindexed
739
+ * array). Nullish means top level; `0` is a valid parent.
740
+ */
741
+ parent_stage_index?: number | null;
734
742
  }
735
743
 
736
744
  /**
@@ -851,7 +859,8 @@ export declare class StreamUpstreamError extends Error {
851
859
  /**
852
860
  * Returns a renderable `Stage` for one raw payload: `index` defaults to `0`,
853
861
  * `name` to `''`, an unrecognized `status` to `null` (still running), and
854
- * `content`/`tag`/`attachments` are passed through when present.
862
+ * `content`/`tag`/`attachments`/`parent_stage_index` are passed through when
863
+ * present (a parent of `0` included).
855
864
  */
856
865
  export declare const toStage: (stage: RawStage) => Stage;
857
866
 
package/index.d.ts CHANGED
@@ -2403,9 +2403,12 @@ export declare interface MapSkillToCatalogItemOptions {
2403
2403
  }
2404
2404
 
2405
2405
  /**
2406
- * Returns the normalized stages of a raw stage array or a message-like
2407
- * payload (reading `custom_content.stages`, falling back to
2408
- * `customContent.stages`), or `undefined` when there are none.
2406
+ * Returns the normalized stages of a complete raw stage array or a
2407
+ * message-like payload (reading `custom_content.stages`, falling back to
2408
+ * `customContent.stages`), or `undefined` when there are none. An entry
2409
+ * without an `index` takes its array position — the identity a complete
2410
+ * non-streaming array's `parent_stage_index` refers to — while explicit
2411
+ * (possibly sparse) indexes are kept. Not for partial stream deltas.
2409
2412
  */
2410
2413
  export declare const mapStages: (source: RawStage[] | RawStageSource | null | undefined) => Stage[] | undefined;
2411
2414
 
@@ -3224,6 +3227,11 @@ export declare interface RawStage {
3224
3227
  tag?: string | null;
3225
3228
  /** Files produced or referenced by this stage. */
3226
3229
  attachments?: RawStageAttachment[] | null;
3230
+ /**
3231
+ * `index` of the parent stage (its array position in a complete unindexed
3232
+ * array). Nullish means top level; `0` is a valid parent.
3233
+ */
3234
+ parent_stage_index?: number | null;
3227
3235
  }
3228
3236
 
3229
3237
  /**
@@ -4438,7 +4446,8 @@ export declare const toPublishRuleDto: (rule: PublicationRule) => PublishRuleDto
4438
4446
  /**
4439
4447
  * Returns a renderable `Stage` for one raw payload: `index` defaults to `0`,
4440
4448
  * `name` to `''`, an unrecognized `status` to `null` (still running), and
4441
- * `content`/`tag`/`attachments` are passed through when present.
4449
+ * `content`/`tag`/`attachments`/`parent_stage_index` are passed through when
4450
+ * present (a parent of `0` included).
4442
4451
  */
4443
4452
  export declare const toStage: (stage: RawStage) => Stage;
4444
4453
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@epam/ai-dial-chat-hooks",
3
3
  "description": "Framework-level React hooks extracted from AI DIAL Chat for building custom chat interfaces",
4
- "version": "1.2.0-dev.225",
4
+ "version": "1.2.0-dev.229",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
7
7
  "main": "./index.js",
@@ -111,7 +111,7 @@
111
111
  }
112
112
  },
113
113
  "dependencies": {
114
- "@epam/ai-dial-chat-api-client": "1.2.0-dev.225",
114
+ "@epam/ai-dial-chat-api-client": "1.2.0-dev.229",
115
115
  "dompurify": "3.4.15",
116
116
  "fflate": "^0.8.3",
117
117
  "lru-cache": "^10.4.3",
@@ -120,21 +120,21 @@
120
120
  },
121
121
  "peerDependencies": {
122
122
  "react": "^19.2.8",
123
- "@epam/ai-dial-attachment-canvas": "1.2.0-dev.225",
124
- "@epam/ai-dial-attachment-input": "1.2.0-dev.225",
125
- "@epam/ai-dial-catalog": "1.2.0-dev.225",
126
- "@epam/ai-dial-chat-overlay": "1.2.0-dev.225",
127
- "@epam/ai-dial-chat-shared": "1.2.0-dev.225",
128
- "@epam/ai-dial-mcp-apps": "1.2.0-dev.225",
129
- "@epam/ai-dial-publish-panel": "1.2.0-dev.225",
130
- "@epam/ai-dial-quotations": "1.2.0-dev.225",
131
- "@epam/ai-dial-react-file-manager": "^0.3.0-dev.19",
132
- "@epam/ai-dial-scheduled-tasks": "1.2.0-dev.225",
133
- "@epam/ai-dial-share": "1.2.0-dev.225",
134
- "@epam/ai-dial-skill-editor": "1.2.0-dev.225",
135
- "@epam/ai-dial-source-panel": "1.2.0-dev.225",
136
- "@epam/ai-dial-ui-kit": "^0.15.0-dev.27",
137
- "@epam/ai-dial-usage-dashboard": "1.2.0-dev.225",
123
+ "@epam/ai-dial-attachment-canvas": "1.2.0-dev.229",
124
+ "@epam/ai-dial-attachment-input": "1.2.0-dev.229",
125
+ "@epam/ai-dial-catalog": "1.2.0-dev.229",
126
+ "@epam/ai-dial-chat-overlay": "1.2.0-dev.229",
127
+ "@epam/ai-dial-chat-shared": "1.2.0-dev.229",
128
+ "@epam/ai-dial-mcp-apps": "1.2.0-dev.229",
129
+ "@epam/ai-dial-publish-panel": "1.2.0-dev.229",
130
+ "@epam/ai-dial-quotations": "1.2.0-dev.229",
131
+ "@epam/ai-dial-react-file-manager": "^0.3.0-dev.20",
132
+ "@epam/ai-dial-scheduled-tasks": "1.2.0-dev.229",
133
+ "@epam/ai-dial-share": "1.2.0-dev.229",
134
+ "@epam/ai-dial-skill-editor": "1.2.0-dev.229",
135
+ "@epam/ai-dial-source-panel": "1.2.0-dev.229",
136
+ "@epam/ai-dial-ui-kit": "^0.15.0-dev.30",
137
+ "@epam/ai-dial-usage-dashboard": "1.2.0-dev.229",
138
138
  "@modelcontextprotocol/sdk": "^1.29.0",
139
139
  "@epam/pdf-highlighter-kit": "^0.0.19",
140
140
  "@mcp-ui/client": "^7.1.1"