@epam/ai-dial-chat-hooks 1.2.0-dev.6 → 1.2.0-dev.69
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/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
- package/attachments.d.ts +10 -4
- package/catalog/map-deployment-to-catalog-item.js +2 -2
- package/catalog/map-skill-to-catalog-item.js +2 -2
- package/catalog/publish.js +2 -1
- package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
- package/catalog/useSkillItemDetails.js +19 -17
- package/catalog.d.ts +38 -5
- package/catalog.js +14 -14
- package/conversation/conversation-transfer/queue.js +8 -5
- package/conversation/stage.js +23 -0
- package/conversation/useAttachmentUpload/useAttachmentUpload.js +12 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +13 -17
- package/conversation/useConversationImport/useConversationImport.js +1 -1
- package/conversation/useConversationStream/apply-chunk.js +1 -1
- package/conversation/useConversationStream/useConversationStream.js +5 -1
- package/conversation-overlay.d.ts +7 -0
- package/conversation-overlay.js +2 -0
- package/conversation.d.ts +108 -5
- package/conversation.js +24 -23
- package/file-manager-canvas.d.ts +398 -0
- package/file-manager-canvas.js +2 -0
- package/file-manager.d.ts +0 -325
- package/file-manager.js +14 -15
- package/files/attachment-canvas.js +51 -13
- package/index.d.ts +238 -22
- package/index.js +111 -109
- package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
- package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
- package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
- package/mcp-apps.d.ts +8 -6
- package/package.json +28 -18
package/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Annotation } from '@epam/ai-dial-chat-shared';
|
|
2
2
|
import { AnnotationGroup } from '@epam/ai-dial-quotations';
|
|
3
|
+
import { ApplicationVisualizer } from '@epam/ai-dial-chat-shared';
|
|
3
4
|
import { ArchiveItemDto } from '@epam/ai-dial-chat-api-client';
|
|
4
5
|
import { Attachment } from '@epam/ai-dial-chat-shared';
|
|
5
6
|
import { AttachmentDisplayResolvers } from '@epam/ai-dial-chat-shared';
|
|
@@ -69,6 +70,8 @@ import { FileUploadStatus } from '@epam/ai-dial-chat-shared';
|
|
|
69
70
|
import { FileUploadValidationResult } from '@epam/ai-dial-chat-shared';
|
|
70
71
|
import { FilterTab } from '@epam/ai-dial-chat-shared';
|
|
71
72
|
import { getParentFolderPath } from '@epam/ai-dial-chat-shared';
|
|
73
|
+
import type { GroupedAttachmentItem } from '@epam/ai-dial-chat-shared';
|
|
74
|
+
import { Implementation } from '@modelcontextprotocol/sdk/types.js';
|
|
72
75
|
import type { InputHighlightData } from '@epam/pdf-highlighter-kit';
|
|
73
76
|
import { ListFilesItemDto } from '@epam/ai-dial-chat-api-client';
|
|
74
77
|
import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
@@ -127,6 +130,7 @@ import { SkillFileUploadCandidate } from '@epam/ai-dial-skill-editor';
|
|
|
127
130
|
import { SkillFileValidationResult } from '@epam/ai-dial-skill-editor';
|
|
128
131
|
import { SkillMetadataItemDto } from '@epam/ai-dial-chat-api-client';
|
|
129
132
|
import { SkillUploadResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
133
|
+
import { Stage } from '@epam/ai-dial-chat-shared';
|
|
130
134
|
import { StarterOption } from '@epam/ai-dial-chat-shared';
|
|
131
135
|
import { StatusMessage } from '@epam/ai-dial-chat-shared';
|
|
132
136
|
import { StreamChunk } from '@epam/ai-dial-chat-shared';
|
|
@@ -247,6 +251,25 @@ export declare interface ApiErrorDetails {
|
|
|
247
251
|
/** Appends a locale's uppercased code to a field label, e.g. `'Name [EN]'`. */
|
|
248
252
|
export declare const appendLocaleCode: (label: string, locale: string) => string;
|
|
249
253
|
|
|
254
|
+
/**
|
|
255
|
+
* Applies a single SSE stream chunk to the message list.
|
|
256
|
+
*
|
|
257
|
+
*
|
|
258
|
+
* Attachments are accumulated: each chunk's attachments are appended to the
|
|
259
|
+
* existing array rather than replacing it.
|
|
260
|
+
*
|
|
261
|
+
* Annotations are merged by `index`: partial `body.title` and `body.quote`
|
|
262
|
+
* strings are concatenated across chunks, matching the same delta-merge
|
|
263
|
+
* semantics used for stages.
|
|
264
|
+
*
|
|
265
|
+
* `state` is overwritten (not merged) by each chunk that carries one,
|
|
266
|
+
* matching the DIAL stateful-app contract.
|
|
267
|
+
*
|
|
268
|
+
* @returns Updated message array, or `null` when the chunk carries no
|
|
269
|
+
* actionable data (empty content, no form_schema, and no attachments).
|
|
270
|
+
*/
|
|
271
|
+
export declare const applyChunkToMessages: (messages: Message[], messageIndex: number, chunk: StreamChunk) => Message[] | null;
|
|
272
|
+
|
|
250
273
|
/** Converts an APScheduler weekday (Monday=0..Sunday=6) to a JS `Date` weekday (Sunday=0..Saturday=6). */
|
|
251
274
|
export declare const apSchedulerDayToJsDay: (apSchedulerDay: number) => number;
|
|
252
275
|
|
|
@@ -314,6 +337,7 @@ declare enum AttachmentContentType {
|
|
|
314
337
|
Code = 'code',
|
|
315
338
|
Html = 'html',
|
|
316
339
|
Visualizer = 'visualizer',
|
|
340
|
+
GroupedVisualizer = 'grouped_visualizer',
|
|
317
341
|
McpApp = 'mcp_app',
|
|
318
342
|
Unsupported = 'unsupported',
|
|
319
343
|
Error = 'error',
|
|
@@ -345,10 +369,12 @@ export declare const attachmentToDto: (attachment: Attachment) => AttachmentDto;
|
|
|
345
369
|
export declare interface AttachmentValidationErrorEvent {
|
|
346
370
|
/** Why the attachment(s) were rejected. */
|
|
347
371
|
reason: AttachmentValidationErrorReason;
|
|
348
|
-
/** The resolved MIME types the caller currently allows (possibly empty). */
|
|
349
|
-
allowedMimeTypes
|
|
372
|
+
/** The resolved MIME types the caller currently allows (possibly empty). Present only when `reason` is `NoTypesAllowed` or `UnsupportedType`. */
|
|
373
|
+
allowedMimeTypes?: string[];
|
|
350
374
|
/** Already-formatted, non-translated extension list (e.g. ".png, .jpg"), present only when `reason` is `UnsupportedType`. */
|
|
351
375
|
formats?: string;
|
|
376
|
+
/** The size limit, in bytes, that was exceeded. Present only when `reason` is `FileTooLarge`. */
|
|
377
|
+
maxFileSizeBytes?: number;
|
|
352
378
|
}
|
|
353
379
|
|
|
354
380
|
/** Reason a rejected attachment failed validation. */
|
|
@@ -356,7 +382,9 @@ export declare enum AttachmentValidationErrorReason {
|
|
|
356
382
|
/** No MIME types are allowed at all — attachments are disabled entirely. */
|
|
357
383
|
NoTypesAllowed = "noTypesAllowed",
|
|
358
384
|
/** The attachment's content type is not among the allowed MIME types. */
|
|
359
|
-
UnsupportedType = "unsupportedType"
|
|
385
|
+
UnsupportedType = "unsupportedType",
|
|
386
|
+
/** The attachment's file size exceeds `maxFileSizeBytes`. */
|
|
387
|
+
FileTooLarge = "fileTooLarge"
|
|
360
388
|
}
|
|
361
389
|
|
|
362
390
|
/** Thrown by `transcribeAudio`; carries a machine-readable `reason` instead of translated text. */
|
|
@@ -522,6 +550,13 @@ export declare const buildSkillManifestFromFrontmatter: (baseFrontmatter: Record
|
|
|
522
550
|
* authored it, when it last changed, and its file inventory. Grouping folders
|
|
523
551
|
* in the file listing are excluded from both the count and the rows. Sizes are
|
|
524
552
|
* not shown — the skill metadata carries no content-length field.
|
|
553
|
+
*
|
|
554
|
+
* `skill` is the authoritative `getSkillMetadata` response when that request
|
|
555
|
+
* fulfilled; the caller falls back to the catalog listing entry only when it
|
|
556
|
+
* rejected (`useSkillItemDetails`'s `onFetchSkillDetails`). Either way, this
|
|
557
|
+
* function never fills a gap in one source from the other — an absent
|
|
558
|
+
* `author` omits the row and an absent `updatedAt` leaves the updated row's
|
|
559
|
+
* value empty, exactly as `skill` carries it.
|
|
525
560
|
*/
|
|
526
561
|
export declare const buildSkillOverview: (skill: SkillMetadataItemDto | undefined, files: SkillMetadataItemDto[], about: SkillAboutDetails | undefined, labels: SkillOverviewLabels) => CatalogItemOverview;
|
|
527
562
|
|
|
@@ -1838,6 +1873,30 @@ export declare interface GreetingTranslations {
|
|
|
1838
1873
|
nightNoName: string;
|
|
1839
1874
|
}
|
|
1840
1875
|
|
|
1876
|
+
/** Content payload for an application-scoped grouped visualizer: every attachment a message's visualizer claims, rendered together inside one sandboxed iframe. */
|
|
1877
|
+
declare interface GroupedVisualizerCanvasContent {
|
|
1878
|
+
/** Discriminates the content type to select the correct renderer. */
|
|
1879
|
+
type: AttachmentContentType.GroupedVisualizer;
|
|
1880
|
+
/** Iframe `src`, resolved from the matching registry entry's `url`. */
|
|
1881
|
+
url: string;
|
|
1882
|
+
/** One item per claimed attachment, in the message's attachment order. Each `url` is absolute, resolved by the host. */
|
|
1883
|
+
attachments: GroupedAttachmentItem[];
|
|
1884
|
+
/** Presentation layout hints (`themeId`, `width`, `height`, `mobileHeight`) shared by every item. */
|
|
1885
|
+
layout: CustomVisualizerDataLayout;
|
|
1886
|
+
/** postMessage protocol namespace — MUST equal the registry entry's `title`, or the iframe never receives data. */
|
|
1887
|
+
visualizerName: string;
|
|
1888
|
+
/** Milliseconds to wait for a `send()` request's response before rejecting. From the registry entry; does NOT bound the handshake. */
|
|
1889
|
+
requestTimeout?: number;
|
|
1890
|
+
}
|
|
1891
|
+
|
|
1892
|
+
/** Outcome of building a grouped visualizer payload. */
|
|
1893
|
+
export declare interface GroupedVisualizerResolution {
|
|
1894
|
+
/** The grouped payload, or `null` when no claimed attachment resolved to a URL. */
|
|
1895
|
+
content: GroupedVisualizerCanvasContent | null;
|
|
1896
|
+
/** The claimed attachments that reached `content.attachments`, in the input's order. The caller returns the rest to the ordinary attachment tray. */
|
|
1897
|
+
resolved: DisplayAttachment[];
|
|
1898
|
+
}
|
|
1899
|
+
|
|
1841
1900
|
/** Whether at least one tool toggle in `value` is active. */
|
|
1842
1901
|
export declare const hasActiveToolConfig: (value: Record<string, boolean> | undefined) => boolean;
|
|
1843
1902
|
|
|
@@ -2174,6 +2233,13 @@ export declare interface MapSkillToCatalogItemOptions {
|
|
|
2174
2233
|
favoriteIds: ReadonlySet<string>;
|
|
2175
2234
|
}
|
|
2176
2235
|
|
|
2236
|
+
/**
|
|
2237
|
+
* Returns the normalized stages of a raw stage array or a message-like
|
|
2238
|
+
* payload (reading `custom_content.stages`, falling back to
|
|
2239
|
+
* `customContent.stages`), or `undefined` when there are none.
|
|
2240
|
+
*/
|
|
2241
|
+
export declare const mapStages: (source: RawStage[] | RawStageSource | null | undefined) => Stage[] | undefined;
|
|
2242
|
+
|
|
2177
2243
|
/**
|
|
2178
2244
|
* Maps a toolset's specification into the lib's credential-status shape,
|
|
2179
2245
|
* for refreshing the details panel after login/logout. Includes both
|
|
@@ -2218,6 +2284,8 @@ declare type McpAppDisplayMode = NonNullable<McpUiHostContext['displayMode']>;
|
|
|
2218
2284
|
declare interface McpAppHostAdapter {
|
|
2219
2285
|
/** `McpUiHostContext` to deliver to the mounted app's `ui/initialize` handshake. */
|
|
2220
2286
|
hostContext: McpUiHostContext;
|
|
2287
|
+
/** Host identity (`name`/`version`) to deliver to the mounted app's `ui/initialize` handshake. */
|
|
2288
|
+
hostInfo: Implementation;
|
|
2221
2289
|
/** Operator-configured MCP Apps sandbox-proxy URL, or `null` when unconfigured. */
|
|
2222
2290
|
sandboxUrl: string | null;
|
|
2223
2291
|
/** Fetches the matched tool's MCP Apps `ui://` resource. */
|
|
@@ -2234,7 +2302,7 @@ export declare interface McpAppHostContextParams {
|
|
|
2234
2302
|
mcpAppTheme?: string;
|
|
2235
2303
|
/** Host's current i18n locale (BCP 47). */
|
|
2236
2304
|
locale: string;
|
|
2237
|
-
/** Operator-configured MCP App user-agent override. Defaults to `
|
|
2305
|
+
/** Operator-configured MCP App user-agent override. Defaults to the browser's own `navigator.userAgent`. */
|
|
2238
2306
|
mcpAppUserAgent?: string;
|
|
2239
2307
|
/**
|
|
2240
2308
|
* Display modes the host can switch an app between via
|
|
@@ -2356,6 +2424,22 @@ export declare enum McpResourceKind {
|
|
|
2356
2424
|
|
|
2357
2425
|
export declare const mergeCreatedFolderIntoCache: (cache: Map<string, ListFilesItemDto[]>, parentApiPath: string, created: CreateFolderResponseDto, inheritedPermissions?: string[]) => Map<string, ListFilesItemDto[]>;
|
|
2358
2426
|
|
|
2427
|
+
/**
|
|
2428
|
+
* Merges incoming stage deltas into an existing stage list, keyed by `index`.
|
|
2429
|
+
*
|
|
2430
|
+
* Partial `name` and `content` strings are concatenated across chunks;
|
|
2431
|
+
* attachments are merged by their own `index` (concatenating partial `title`
|
|
2432
|
+
* and `data`); every other field on the incoming delta overwrites the
|
|
2433
|
+
* accumulated one. A brand-new stage whose first chunk carries `name: null`
|
|
2434
|
+
* is normalized to `''`.
|
|
2435
|
+
*
|
|
2436
|
+
* Exported for hosts that keep a flattened `Stage[]` on the message instead
|
|
2437
|
+
* of `Message.custom_content.stages` and therefore cannot reuse
|
|
2438
|
+
* {@link applyChunkToMessages}. Prefer `useConversationStream` when the host
|
|
2439
|
+
* can delegate the whole stream loop.
|
|
2440
|
+
*/
|
|
2441
|
+
export declare const mergeStages: (existing: Stage[], incoming: Stage[]) => Stage[];
|
|
2442
|
+
|
|
2359
2443
|
/** True when `message` is an assistant message carrying at least one stage. */
|
|
2360
2444
|
export declare const messageHasStages: (message: Message) => boolean;
|
|
2361
2445
|
|
|
@@ -2544,7 +2628,17 @@ declare interface OoxmlDocxHighlightLocation {
|
|
|
2544
2628
|
text: string;
|
|
2545
2629
|
}
|
|
2546
2630
|
|
|
2547
|
-
/**
|
|
2631
|
+
/** A complete table row in the DOCX body, matched by cell text. */
|
|
2632
|
+
declare interface OoxmlDocxTableRowLocation {
|
|
2633
|
+
/** Location kind. */
|
|
2634
|
+
kind: OoxmlHighlightKind.DocxTableRow;
|
|
2635
|
+
/** Plain text of each cell, in column order. */
|
|
2636
|
+
cells: string[];
|
|
2637
|
+
/** 1-based matching row in document order. */
|
|
2638
|
+
occurrence: number;
|
|
2639
|
+
}
|
|
2640
|
+
|
|
2641
|
+
/** Supported document formats rendered by the installed `@silurus/ooxml` runtime. */
|
|
2548
2642
|
declare enum OoxmlFileType {
|
|
2549
2643
|
Docx = 'docx',
|
|
2550
2644
|
Xlsx = 'xlsx',
|
|
@@ -2566,6 +2660,10 @@ declare enum OoxmlHighlightKind {
|
|
|
2566
2660
|
DocxTextRange = 'docxTextRange',
|
|
2567
2661
|
/** A character range inside a single PPTX shape on one slide. */
|
|
2568
2662
|
PptxTextRange = 'pptxTextRange',
|
|
2663
|
+
/** A complete DOCX table row identified by its cell text. */
|
|
2664
|
+
DocxTableRow = 'docxTableRow',
|
|
2665
|
+
/** A complete PPTX table row identified by its cell text on one slide. */
|
|
2666
|
+
PptxTableRow = 'pptxTableRow',
|
|
2569
2667
|
/** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
|
|
2570
2668
|
XlsxCellRange = 'xlsxCellRange',
|
|
2571
2669
|
}
|
|
@@ -2574,6 +2672,8 @@ declare enum OoxmlHighlightKind {
|
|
|
2574
2672
|
declare type OoxmlHighlightLocation =
|
|
2575
2673
|
| OoxmlDocxHighlightLocation
|
|
2576
2674
|
| OoxmlPptxHighlightLocation
|
|
2675
|
+
| OoxmlDocxTableRowLocation
|
|
2676
|
+
| OoxmlPptxTableRowLocation
|
|
2577
2677
|
| OoxmlXlsxHighlightLocation;
|
|
2578
2678
|
|
|
2579
2679
|
/** A cited character range inside a single shape on one PPTX slide. */
|
|
@@ -2592,6 +2692,18 @@ declare interface OoxmlPptxHighlightLocation {
|
|
|
2592
2692
|
text: string;
|
|
2593
2693
|
}
|
|
2594
2694
|
|
|
2695
|
+
/** A complete table row on one PPTX slide, matched by cell text. */
|
|
2696
|
+
declare interface OoxmlPptxTableRowLocation {
|
|
2697
|
+
/** Location kind. */
|
|
2698
|
+
kind: OoxmlHighlightKind.PptxTableRow;
|
|
2699
|
+
/** Plain text of each cell, in column order. */
|
|
2700
|
+
cells: string[];
|
|
2701
|
+
/** 1-based matching row on the specified slide. */
|
|
2702
|
+
occurrence: number;
|
|
2703
|
+
/** 1-based slide number. */
|
|
2704
|
+
slide: number;
|
|
2705
|
+
}
|
|
2706
|
+
|
|
2595
2707
|
/** A cited cell, or contiguous same-row cell range, on a named XLSX sheet. */
|
|
2596
2708
|
declare interface OoxmlXlsxHighlightLocation {
|
|
2597
2709
|
/** Discriminates this location within `OoxmlHighlightLocation`. */
|
|
@@ -2846,6 +2958,63 @@ export declare interface QuickAppSchemaLike {
|
|
|
2846
2958
|
displayName?: string;
|
|
2847
2959
|
}
|
|
2848
2960
|
|
|
2961
|
+
/**
|
|
2962
|
+
* One stage as it arrives from the REST API or the SSE stream, before
|
|
2963
|
+
* normalization. Structurally satisfied by the generated `StageDto` and by a
|
|
2964
|
+
* raw stream delta, both of which omit `index`/`name`/`status` on the chunk
|
|
2965
|
+
* that opens a stage.
|
|
2966
|
+
*/
|
|
2967
|
+
export declare interface RawStage {
|
|
2968
|
+
/** Ordering key. Defaults to `0` when absent. */
|
|
2969
|
+
index?: number | null;
|
|
2970
|
+
/** Stage title. `null` on the chunk that opens the stage. */
|
|
2971
|
+
name?: string | null;
|
|
2972
|
+
/** Terminal state as a raw wire string; anything other than `'completed'`/`'failed'` means still running. */
|
|
2973
|
+
status?: string | null;
|
|
2974
|
+
/** Additional stage text. */
|
|
2975
|
+
content?: string | null;
|
|
2976
|
+
/** Short source/category label shown beside the stage name. */
|
|
2977
|
+
tag?: string | null;
|
|
2978
|
+
/** Files produced or referenced by this stage. */
|
|
2979
|
+
attachments?: RawStageAttachment[] | null;
|
|
2980
|
+
}
|
|
2981
|
+
|
|
2982
|
+
/**
|
|
2983
|
+
* One stage attachment as it arrives from the REST API or the SSE stream,
|
|
2984
|
+
* before normalization: every field is optional and may be `null`.
|
|
2985
|
+
*/
|
|
2986
|
+
export declare interface RawStageAttachment {
|
|
2987
|
+
/** Zero-based position in the attachment list. */
|
|
2988
|
+
index?: number | null;
|
|
2989
|
+
/** MIME type of the attachment content. */
|
|
2990
|
+
type?: string | null;
|
|
2991
|
+
/** Display name shown in the UI. */
|
|
2992
|
+
title?: string | null;
|
|
2993
|
+
/** Inline base-64 encoded content. */
|
|
2994
|
+
data?: string | null;
|
|
2995
|
+
/** Remote URL pointing to the attachment content. */
|
|
2996
|
+
url?: string | null;
|
|
2997
|
+
/** MIME type of the referenced resource. */
|
|
2998
|
+
reference_type?: string | null;
|
|
2999
|
+
/** URL of an alternate reference resource. */
|
|
3000
|
+
reference_url?: string | null;
|
|
3001
|
+
}
|
|
3002
|
+
|
|
3003
|
+
/**
|
|
3004
|
+
* Message-like payload carrying stages under either the wire's snake_case
|
|
3005
|
+
* `custom_content` or a host's camelCased `customContent`.
|
|
3006
|
+
*/
|
|
3007
|
+
export declare interface RawStageSource {
|
|
3008
|
+
/** Custom content as the DIAL wire format spells it. */
|
|
3009
|
+
custom_content?: {
|
|
3010
|
+
stages?: RawStage[] | null;
|
|
3011
|
+
} | null;
|
|
3012
|
+
/** Custom content as a camelCasing host spells it. */
|
|
3013
|
+
customContent?: {
|
|
3014
|
+
stages?: RawStage[] | null;
|
|
3015
|
+
} | null;
|
|
3016
|
+
}
|
|
3017
|
+
|
|
2849
3018
|
/**
|
|
2850
3019
|
* Reads a skill file response as raw bytes, or `null` when the body is
|
|
2851
3020
|
* larger than `SKILL_MANIFEST_MAX_BYTES`. The declared `content-length` is
|
|
@@ -2856,6 +3025,24 @@ export declare interface QuickAppSchemaLike {
|
|
|
2856
3025
|
*/
|
|
2857
3026
|
export declare const readSkillFileBytes: (response: Response) => Promise<Uint8Array | null>;
|
|
2858
3027
|
|
|
3028
|
+
/**
|
|
3029
|
+
* Reads a skill file response as raw bytes with no size ceiling, for the
|
|
3030
|
+
* supporting-file **preview** path.
|
|
3031
|
+
*
|
|
3032
|
+
* Previews are user-initiated, one file at a time, and a realistic binary
|
|
3033
|
+
* (a PDF, an image) routinely exceeds `SKILL_MANIFEST_MAX_BYTES` — a cap
|
|
3034
|
+
* sized for `SKILL.md` frontmatter, not for binaries — so applying that cap
|
|
3035
|
+
* here rejected virtually every real PDF before it was ever decoded. This
|
|
3036
|
+
* reader therefore never returns `null`: file size is not a failure class on
|
|
3037
|
+
* the preview path.
|
|
3038
|
+
*
|
|
3039
|
+
* `readSkillFileBytes` and `readSkillManifest` keep their
|
|
3040
|
+
* `SKILL_MANIFEST_MAX_BYTES` ceiling, because they feed the manifest parse
|
|
3041
|
+
* and the textual Content-tab read, where an oversized body must never be
|
|
3042
|
+
* decoded into a string.
|
|
3043
|
+
*/
|
|
3044
|
+
export declare const readSkillFilePreviewBytes: (response: Response) => Promise<Uint8Array>;
|
|
3045
|
+
|
|
2859
3046
|
/**
|
|
2860
3047
|
* Reads a skill manifest response as text, or `null` when the body is larger
|
|
2861
3048
|
* than `SKILL_MANIFEST_MAX_BYTES`. The size is checked before decoding, so an
|
|
@@ -2920,7 +3107,8 @@ export declare const resolveCatalogPrimaryAction: (item: CatalogItem, fetchPromp
|
|
|
2920
3107
|
/** Resolves a syntax-highlighted code canvas content payload from a DisplayAttachment, or `null` if unavailable. */
|
|
2921
3108
|
export declare const resolveCodeCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, language?: string) => Promise<CodeCanvasContent | ErrorCanvasContent | null>;
|
|
2922
3109
|
|
|
2923
|
-
|
|
3110
|
+
/** Resolves a deployment's display folder, including organization applications without a folder path. */
|
|
3111
|
+
export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDto, "isMy" | "sharedWithMe" | "applicationFolder"> & Partial<Pick<DeploymentItemDto, "type">>, labels: DeploymentFolderLabels) => string[];
|
|
2924
3112
|
|
|
2925
3113
|
/**
|
|
2926
3114
|
* Resolves a DialFile to the bucket-relative API path used by files BFF endpoints.
|
|
@@ -2956,6 +3144,17 @@ export declare type ResolveDownloadUrl = (fileId: string) => string | undefined;
|
|
|
2956
3144
|
*/
|
|
2957
3145
|
export declare const resolveExternalSourceContentType: (contentType: string, url: string) => string;
|
|
2958
3146
|
|
|
3147
|
+
/**
|
|
3148
|
+
* Builds the grouped payload for an application-scoped visualizer from the
|
|
3149
|
+
* attachments its entry claims, reporting which of them `resolveAbsoluteUrl`
|
|
3150
|
+
* could produce a URL for. Unlike the single-attachment resolver this fetches
|
|
3151
|
+
* nothing: the grouped protocol hands the visualizer URLs and lets it read
|
|
3152
|
+
* them itself, so the URLs must be absolute — a host-relative path would
|
|
3153
|
+
* resolve against the iframe's own origin. Producing one is host knowledge,
|
|
3154
|
+
* which is why it arrives as a callback rather than being built here.
|
|
3155
|
+
*/
|
|
3156
|
+
export declare const resolveGroupedVisualizerCanvasContent: (attachments: DisplayAttachment[], resolveAbsoluteUrl: (attachment: DisplayAttachment) => string | undefined, entry: ApplicationVisualizer, themeId: string) => GroupedVisualizerResolution;
|
|
3157
|
+
|
|
2959
3158
|
/**
|
|
2960
3159
|
* Resolves an HTML canvas content payload from a DisplayAttachment.
|
|
2961
3160
|
* Fetches and inlines the HTML as `srcdoc` when the attachment has a download URL or inline data.
|
|
@@ -2966,10 +3165,12 @@ export declare const resolveHtmlCanvasContent: (attachment: DisplayAttachment, r
|
|
|
2966
3165
|
|
|
2967
3166
|
/**
|
|
2968
3167
|
* Resolves an image canvas content payload from a DisplayAttachment without
|
|
2969
|
-
* fetching — returns
|
|
2970
|
-
*
|
|
2971
|
-
*
|
|
2972
|
-
*
|
|
3168
|
+
* fetching — returns a local blob URL or the BFF download URL directly so the
|
|
3169
|
+
* browser cache can be shared with the conversation view's `<img>` element.
|
|
3170
|
+
* A local `File` with bytes takes precedence over the DIAL download URL; a
|
|
3171
|
+
* 0-byte `File` (the file-manager placeholder) does not. Error detection is
|
|
3172
|
+
* delegated to `<img onError>` in the canvas renderer. Returns `null` if no
|
|
3173
|
+
* URL source is available.
|
|
2973
3174
|
*/
|
|
2974
3175
|
export declare const resolveImageCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => ImageCanvasContent | null;
|
|
2975
3176
|
|
|
@@ -3175,6 +3376,12 @@ export declare interface SkillDetailsApi {
|
|
|
3175
3376
|
limit?: number;
|
|
3176
3377
|
recursive?: boolean;
|
|
3177
3378
|
}, signal?: AbortSignal): Promise<SkillFileListResponseDto>;
|
|
3379
|
+
/**
|
|
3380
|
+
* Fetches a single skill's own authoritative metadata (`author`,
|
|
3381
|
+
* `updatedAt`, and the rest of `SkillMetadataItemDto`) — not the catalog
|
|
3382
|
+
* listing entry, which may be sparse for a shared skill.
|
|
3383
|
+
*/
|
|
3384
|
+
getSkillMetadata(bucket: string, path: string, signal?: AbortSignal): Promise<SkillMetadataItemDto>;
|
|
3178
3385
|
}
|
|
3179
3386
|
|
|
3180
3387
|
/** Already-configured DIAL Core download operations `useSkillEditorLoad` needs. */
|
|
@@ -3749,6 +3956,13 @@ export declare const toPublishEntityType: (type: CatalogEntityType) => CatalogPu
|
|
|
3749
3956
|
*/
|
|
3750
3957
|
export declare const toPublishRuleDto: (rule: PublicationRule) => PublishRuleDto;
|
|
3751
3958
|
|
|
3959
|
+
/**
|
|
3960
|
+
* Returns a renderable `Stage` for one raw payload: `index` defaults to `0`,
|
|
3961
|
+
* `name` to `''`, an unrecognized `status` to `null` (still running), and
|
|
3962
|
+
* `content`/`tag`/`attachments` are passed through when present.
|
|
3963
|
+
*/
|
|
3964
|
+
export declare const toStage: (stage: RawStage) => Stage;
|
|
3965
|
+
|
|
3752
3966
|
/** Request shape the host's selected-deployment recognition call accepts. */
|
|
3753
3967
|
export declare interface TranscribeWithDeploymentParams {
|
|
3754
3968
|
audioUrl: string;
|
|
@@ -3891,8 +4105,8 @@ export declare const useAttachmentUpload: ({ filesApi, bucket, onNetworkError, d
|
|
|
3891
4105
|
|
|
3892
4106
|
/** Parameters for {@link useAttachmentUpload}. */
|
|
3893
4107
|
export declare interface UseAttachmentUploadParams {
|
|
3894
|
-
/** Already-configured
|
|
3895
|
-
filesApi: Pick<FilesApi, 'uploadFile'
|
|
4108
|
+
/** Already-configured client; optional listing skips stored names after a conflict. */
|
|
4109
|
+
filesApi: Pick<FilesApi, 'uploadFile'> & Partial<Pick<FilesApi, 'listFiles'>>;
|
|
3896
4110
|
/** DIAL Core bucket the file is uploaded into. */
|
|
3897
4111
|
bucket: string | undefined;
|
|
3898
4112
|
/** Called with batched filenames after a burst of network-error upload failures. */
|
|
@@ -3912,12 +4126,14 @@ export declare interface UseAttachmentUploadResult {
|
|
|
3912
4126
|
* MIME types, debouncing a burst of rejected files into a single
|
|
3913
4127
|
* `onValidationError` call rather than firing one per file.
|
|
3914
4128
|
*/
|
|
3915
|
-
export declare const useAttachmentValidation: ({ allowedMimeTypes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
|
|
4129
|
+
export declare const useAttachmentValidation: ({ allowedMimeTypes, maxFileSizeBytes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
|
|
3916
4130
|
|
|
3917
4131
|
/** Parameters for {@link useAttachmentValidation}. */
|
|
3918
4132
|
export declare interface UseAttachmentValidationParams {
|
|
3919
4133
|
/** Resolved MIME types currently allowed for attachments. */
|
|
3920
4134
|
allowedMimeTypes: string[];
|
|
4135
|
+
/** Maximum attachment file size, in bytes. When omitted, no file is rejected for size. */
|
|
4136
|
+
maxFileSizeBytes?: number;
|
|
3921
4137
|
/** Called with a structured event when a rejected attachment is reported, at most once per debounce window. */
|
|
3922
4138
|
onValidationError?: (event: AttachmentValidationErrorEvent) => void;
|
|
3923
4139
|
/** Debounce window, in ms, before firing `onValidationError` for a rejected file. Defaults to `100`. */
|
|
@@ -4961,10 +5177,11 @@ export declare interface UseImportFilePickerResult {
|
|
|
4961
5177
|
* Builds the `McpAppHostAdapter` a host injects into `@epam/ai-dial-mcp-apps`'s
|
|
4962
5178
|
* hooks/components, wiring the library's host-context/tool-call/resource-fetch
|
|
4963
5179
|
* contract to a configured `McpAppsApiClient` and this app's theme/locale/config
|
|
4964
|
-
* values (`hostContextParams`, `sandboxUrl`)
|
|
4965
|
-
*
|
|
5180
|
+
* values (`hostContextParams`, `sandboxUrl`), plus the host's own identity
|
|
5181
|
+
* (`hostInfo`) — this hook itself never reads app context, so a host builds
|
|
5182
|
+
* those values wherever it already has them.
|
|
4966
5183
|
*/
|
|
4967
|
-
export declare const useMcpAppHostAdapter: (displayMode: "inline" | "fullscreen", client: McpAppsApiClient, sandboxUrl: string | null, hostContextParams: McpAppHostContextParams) => McpAppHostAdapter;
|
|
5184
|
+
export declare const useMcpAppHostAdapter: (displayMode: "inline" | "fullscreen", client: McpAppsApiClient, sandboxUrl: string | null, hostContextParams: McpAppHostContextParams, hostInfo: Implementation) => McpAppHostAdapter;
|
|
4968
5185
|
|
|
4969
5186
|
/**
|
|
4970
5187
|
* Builds the `McpUiHostContext` delivered to a mounted MCP App during its
|
|
@@ -5067,8 +5284,6 @@ export declare const useOpenMcpAppCanvas: (cache: McpAppResponseCache, hostAdapt
|
|
|
5067
5284
|
|
|
5068
5285
|
/** User-facing text `useOpenMcpAppCanvas` needs but cannot resolve itself — a lib must not call `t()`. */
|
|
5069
5286
|
export declare interface UseOpenMcpAppCanvasLabels {
|
|
5070
|
-
/** Canvas panel title while an MCP App is loading or open. */
|
|
5071
|
-
title: string;
|
|
5072
5287
|
/** Error label shown when the resource fetch is forbidden (HTTP 403). */
|
|
5073
5288
|
forbiddenErrorLabel: string;
|
|
5074
5289
|
/** Error label shown for any other resource-load/tool-call failure. */
|
|
@@ -5473,10 +5688,11 @@ export declare interface UseSkillFilePreviewResult {
|
|
|
5473
5688
|
|
|
5474
5689
|
/**
|
|
5475
5690
|
* Headless hook that encapsulates skill detail fetching: manifest download and
|
|
5476
|
-
* parse, package file listing,
|
|
5477
|
-
* loads. `useCatalogItemDetails` delegates
|
|
5478
|
-
* only surface skill details consume this
|
|
5479
|
-
* deployment and prompt ports the full catalog
|
|
5691
|
+
* parse, package file listing, authoritative metadata fetching, overview
|
|
5692
|
+
* construction, and in-package file loads. `useCatalogItemDetails` delegates
|
|
5693
|
+
* its skill branch here; hosts that only surface skill details consume this
|
|
5694
|
+
* hook directly, without the deployment and prompt ports the full catalog
|
|
5695
|
+
* pipeline requires.
|
|
5480
5696
|
*/
|
|
5481
5697
|
export declare const useSkillItemDetails: ({ api, skills, skillOverviewLabels, }: UseSkillItemDetailsOptions) => UseSkillItemDetailsResult;
|
|
5482
5698
|
|