@epam/ai-dial-chat-hooks 1.2.0-dev.15 → 1.2.0-dev.152

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 (63) hide show
  1. package/api-error/api-error.js +5 -4
  2. package/attachment/useAttachmentValidation/useAttachmentValidation.js +26 -19
  3. package/attachments.d.ts +10 -4
  4. package/catalog/map-deployment-limits-to-input.js +81 -9
  5. package/catalog/map-deployment-to-catalog-item.js +2 -2
  6. package/catalog/map-skill-to-catalog-item.js +30 -27
  7. package/catalog/publish.js +2 -1
  8. package/catalog/useApplicationCredentials/useApplicationCredentials.js +39 -0
  9. package/catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js +39 -39
  10. package/catalog/useSkillItemDetails.js +17 -13
  11. package/catalog.d.ts +86 -19
  12. package/catalog.js +6 -5
  13. package/conversation/conversation-transfer/queue.js +8 -5
  14. package/conversation/create-chat-stream-api.js +30 -21
  15. package/conversation/stage.js +23 -0
  16. package/conversation/useAttachmentUpload/useAttachmentUpload.js +12 -5
  17. package/conversation/useConversationImport/useConversationImport.js +1 -1
  18. package/conversation/useConversationPanelItems/useConversationPanelItems.js +2 -3
  19. package/conversation/useConversationScroll/useConversationScroll.js +68 -64
  20. package/conversation/useConversationStream/apply-chunk.js +1 -1
  21. package/conversation/useConversationStream/generation-resume.js +75 -63
  22. package/conversation/useConversationStream/useConversationStream.js +145 -102
  23. package/conversation-overlay.d.ts +7 -0
  24. package/conversation-overlay.js +2 -0
  25. package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
  26. package/conversation-sources.d.ts +1 -1
  27. package/conversation.d.ts +147 -15
  28. package/conversation.js +31 -30
  29. package/file-manager-canvas.d.ts +398 -0
  30. package/file-manager-canvas.js +2 -0
  31. package/file-manager.d.ts +71 -330
  32. package/file-manager.js +15 -15
  33. package/files/attachment-canvas.js +51 -13
  34. package/files/attachment-types.js +14 -13
  35. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +1 -5
  36. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +43 -0
  37. package/index.d.ts +784 -57
  38. package/index.js +123 -111
  39. package/mcp-apps/useMcpAppHostAdapter/useMcpAppHostAdapter.js +7 -5
  40. package/mcp-apps/useMcpAppHostContext/useMcpAppHostContext.js +1 -1
  41. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
  42. package/mcp-apps/useOpenMcpAppCanvas/useOpenMcpAppCanvas.js +25 -23
  43. package/mcp-apps.d.ts +8 -6
  44. package/package.json +37 -18
  45. package/scheduled-task/scheduled-task-description.js +77 -0
  46. package/scheduled-task/scheduled-task-preparation.js +24 -0
  47. package/scheduled-task/scheduled-task-trigger.js +7 -2
  48. package/scheduled-task/scheduled-tasks-api-client.js +19 -0
  49. package/scheduled-task/use-scheduled-task-runs.js +82 -0
  50. package/scheduled-task/use-scheduled-tasks.js +93 -0
  51. package/scheduled-tasks.d.ts +180 -3
  52. package/scheduled-tasks.js +7 -2
  53. package/skill/skill.js +10 -7
  54. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +75 -0
  55. package/skill/useSkillEditorLoad.js +29 -28
  56. package/skill/useSkillEditorSubmit.js +93 -75
  57. package/skill-editor.d.ts +110 -1
  58. package/skill-editor.js +9 -8
  59. package/usage/map-usage-data-to-dashboard.js +66 -0
  60. package/usage/map-user-usage-to-model-limits.js +160 -0
  61. package/usage.d.ts +120 -0
  62. package/usage.js +3 -0
  63. package/utils.d.ts +3 -1
package/index.d.ts CHANGED
@@ -1,5 +1,7 @@
1
1
  import { Annotation } from '@epam/ai-dial-chat-shared';
2
2
  import { AnnotationGroup } from '@epam/ai-dial-quotations';
3
+ import { ApplicationExternalServiceDto } from '@epam/ai-dial-chat-api-client';
4
+ import { ApplicationVisualizer } from '@epam/ai-dial-chat-shared';
3
5
  import { ArchiveItemDto } from '@epam/ai-dial-chat-api-client';
4
6
  import { Attachment } from '@epam/ai-dial-chat-shared';
5
7
  import { AttachmentDisplayResolvers } from '@epam/ai-dial-chat-shared';
@@ -25,6 +27,7 @@ import { ConversationTransferJob } from '@epam/ai-dial-chat-shared';
25
27
  import { ConversationTransferWarningCode } from '@epam/ai-dial-chat-shared';
26
28
  import { CopyFilesResponseDto } from '@epam/ai-dial-chat-api-client';
27
29
  import { CopyItemDto } from '@epam/ai-dial-chat-api-client';
30
+ import { CreatedScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
28
31
  import { CreateFolderDto } from '@epam/ai-dial-chat-api-client';
29
32
  import { CreateFolderResponseDto } from '@epam/ai-dial-chat-api-client';
30
33
  import { CreateScheduledTaskBodyDto } from '@epam/ai-dial-chat-api-client';
@@ -59,20 +62,29 @@ import { Dispatch } from 'react';
59
62
  import { DisplayAttachment } from '@epam/ai-dial-chat-shared';
60
63
  import { DropdownItem } from '@epam/ai-dial-ui-kit';
61
64
  import { ExportFolder } from '@epam/ai-dial-chat-shared';
65
+ import { ExternalServicesApi } from '@epam/ai-dial-chat-api-client';
62
66
  import { FileManagerColumnKey } from '@epam/ai-dial-react-file-manager';
67
+ import { FileManagerSelectableNode } from '@epam/ai-dial-chat-shared';
63
68
  import { FileMetadataResponseDto } from '@epam/ai-dial-chat-api-client';
64
69
  import { FilesApi } from '@epam/ai-dial-chat-api-client';
70
+ import { FileTreeOptions } from '@epam/ai-dial-react-file-manager';
65
71
  import { FileUploadBatchState } from '@epam/ai-dial-chat-shared';
66
72
  import { FileUploadEntry } from '@epam/ai-dial-chat-shared';
67
73
  import { FileUploadResponseDto } from '@epam/ai-dial-chat-api-client';
68
74
  import { FileUploadStatus } from '@epam/ai-dial-chat-shared';
69
75
  import { FileUploadValidationResult } from '@epam/ai-dial-chat-shared';
76
+ import { FilterChipItem } from '@epam/ai-dial-ui-kit';
70
77
  import { FilterTab } from '@epam/ai-dial-chat-shared';
71
78
  import { getParentFolderPath } from '@epam/ai-dial-chat-shared';
79
+ import type { GroupedAttachmentItem } from '@epam/ai-dial-chat-shared';
80
+ import { Implementation } from '@modelcontextprotocol/sdk/types.js';
72
81
  import type { InputHighlightData } from '@epam/pdf-highlighter-kit';
73
82
  import { ListFilesItemDto } from '@epam/ai-dial-chat-api-client';
74
83
  import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
75
84
  import { ListPublicFilesRequest } from '@epam/ai-dial-chat-api-client';
85
+ import { ListScheduledTaskRunsResponseDto } from '@epam/ai-dial-chat-api-client';
86
+ import { ListScheduledTasksResponseDto } from '@epam/ai-dial-chat-api-client';
87
+ import { ListScheduledTasksSortEnum } from '@epam/ai-dial-chat-api-client';
76
88
  import { ListSharedFilesRequest } from '@epam/ai-dial-chat-api-client';
77
89
  import { LocaleTextEntryDto } from '@epam/ai-dial-chat-api-client';
78
90
  import { McpAppToolSummaryDto } from '@epam/ai-dial-chat-api-client';
@@ -82,10 +94,13 @@ import { MessageAttachment } from '@epam/ai-dial-chat-shared';
82
94
  import { MessageCustomContent } from '@epam/ai-dial-chat-shared';
83
95
  import { MessageRating } from '@epam/ai-dial-chat-shared';
84
96
  import { Middleware } from '@epam/ai-dial-chat-api-client';
97
+ import { ModelLimitPeriodStatuses } from '@epam/ai-dial-usage-dashboard';
98
+ import { ModelLimitRow } from '@epam/ai-dial-usage-dashboard';
85
99
  import { MoveFilesResponseDto } from '@epam/ai-dial-chat-api-client';
86
100
  import { MoveItemDto } from '@epam/ai-dial-chat-api-client';
87
101
  import { MutableRefObject } from 'react';
88
102
  import { NotificationVariant } from '@epam/ai-dial-ui-kit';
103
+ import { OfflineCredentialsApi } from '@epam/ai-dial-chat-api-client';
89
104
  import { OverlayChatMessage } from '@epam/ai-dial-chat-overlay';
90
105
  import { PromptFolderResponseDto } from '@epam/ai-dial-chat-api-client';
91
106
  import { PromptListResponseDto } from '@epam/ai-dial-chat-api-client';
@@ -111,6 +126,10 @@ import { RevokeAccessItemDto } from '@epam/ai-dial-chat-api-client';
111
126
  import { RevokeAccessResponseDto } from '@epam/ai-dial-chat-api-client';
112
127
  import { ScheduledTaskCreateFormValues } from '@epam/ai-dial-scheduled-tasks';
113
128
  import { ScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
129
+ import { ScheduledTaskRunDto } from '@epam/ai-dial-chat-api-client';
130
+ import { ScheduledTaskValidationErrors } from '../../libs/scheduled-tasks/validation';
131
+ import { ScheduledTaskValidationOptions } from '../../libs/scheduled-tasks/validation';
132
+ import { ScheduleTriggerDto } from '@epam/ai-dial-chat-api-client';
114
133
  import { SendCompletionDtoModeEnum } from '@epam/ai-dial-chat-api-client';
115
134
  import { SetStateAction } from 'react';
116
135
  import { ShareApi } from '@epam/ai-dial-chat-api-client';
@@ -127,11 +146,10 @@ import { SkillFileUploadCandidate } from '@epam/ai-dial-skill-editor';
127
146
  import { SkillFileValidationResult } from '@epam/ai-dial-skill-editor';
128
147
  import { SkillMetadataItemDto } from '@epam/ai-dial-chat-api-client';
129
148
  import { SkillUploadResponseDto } from '@epam/ai-dial-chat-api-client';
149
+ import { Stage } from '@epam/ai-dial-chat-shared';
130
150
  import { StarterOption } from '@epam/ai-dial-chat-shared';
131
151
  import { StatusMessage } from '@epam/ai-dial-chat-shared';
132
152
  import { StreamChunk } from '@epam/ai-dial-chat-shared';
133
- import { TabModel } from '@epam/ai-dial-ui-kit';
134
- import { ToolbarOptions } from '@epam/ai-dial-react-file-manager';
135
153
  import { ToolMenuItem } from '@epam/ai-dial-chat-shared';
136
154
  import { ToolsetLoginBodyDto } from '@epam/ai-dial-chat-api-client';
137
155
  import { ToolsetLogoutBodyDto } from '@epam/ai-dial-chat-api-client';
@@ -139,9 +157,11 @@ import { ToolsetsApi } from '@epam/ai-dial-chat-api-client';
139
157
  import { TranscriptionApi } from '@epam/ai-dial-chat-api-client';
140
158
  import { UnpublishCatalogEntityDto } from '@epam/ai-dial-chat-api-client';
141
159
  import { UnpublishResultDto } from '@epam/ai-dial-chat-api-client';
160
+ import { UpdatedScheduledTaskDto } from '@epam/ai-dial-chat-api-client';
142
161
  import { UpdateScheduledTaskBodyDto } from '@epam/ai-dial-chat-api-client';
143
162
  import { UploadArchiveResponseDto } from '@epam/ai-dial-chat-api-client';
144
163
  import { UploadedAttachmentResult } from '@epam/ai-dial-chat-shared';
164
+ import { UsageLimitCardData } from '@epam/ai-dial-usage-dashboard';
145
165
  import { useGridEditingScroll } from '@epam/ai-dial-chat-shared';
146
166
  import { UseGridEditingScrollOptions } from '@epam/ai-dial-chat-shared';
147
167
  import { UseGridEditingScrollResult } from '@epam/ai-dial-chat-shared';
@@ -236,6 +256,8 @@ export declare interface AnnouncementListItemLink {
236
256
 
237
257
  /** Normalized shape returned by {@link getApiErrorDetails}. */
238
258
  export declare interface ApiErrorDetails {
259
+ /** Stable domain error code supplied by the API, when present. */
260
+ code?: string;
239
261
  /** HTTP status code carried by the error, when available. */
240
262
  status?: number;
241
263
  /** Resolved human-readable error message, or `null` when none could be resolved. */
@@ -247,6 +269,25 @@ export declare interface ApiErrorDetails {
247
269
  /** Appends a locale's uppercased code to a field label, e.g. `'Name [EN]'`. */
248
270
  export declare const appendLocaleCode: (label: string, locale: string) => string;
249
271
 
272
+ /**
273
+ * Applies a single SSE stream chunk to the message list.
274
+ *
275
+ *
276
+ * Attachments are accumulated: each chunk's attachments are appended to the
277
+ * existing array rather than replacing it.
278
+ *
279
+ * Annotations are merged by `index`: partial `body.title` and `body.quote`
280
+ * strings are concatenated across chunks, matching the same delta-merge
281
+ * semantics used for stages.
282
+ *
283
+ * `state` is overwritten (not merged) by each chunk that carries one,
284
+ * matching the DIAL stateful-app contract.
285
+ *
286
+ * @returns Updated message array, or `null` when the chunk carries no
287
+ * actionable data (empty content, no form_schema, and no attachments).
288
+ */
289
+ export declare const applyChunkToMessages: (messages: Message[], messageIndex: number, chunk: StreamChunk) => Message[] | null;
290
+
250
291
  /** Converts an APScheduler weekday (Monday=0..Sunday=6) to a JS `Date` weekday (Sunday=0..Saturday=6). */
251
292
  export declare const apSchedulerDayToJsDay: (apSchedulerDay: number) => number;
252
293
 
@@ -314,6 +355,7 @@ declare enum AttachmentContentType {
314
355
  Code = 'code',
315
356
  Html = 'html',
316
357
  Visualizer = 'visualizer',
358
+ GroupedVisualizer = 'grouped_visualizer',
317
359
  McpApp = 'mcp_app',
318
360
  Unsupported = 'unsupported',
319
361
  Error = 'error',
@@ -345,10 +387,12 @@ export declare const attachmentToDto: (attachment: Attachment) => AttachmentDto;
345
387
  export declare interface AttachmentValidationErrorEvent {
346
388
  /** Why the attachment(s) were rejected. */
347
389
  reason: AttachmentValidationErrorReason;
348
- /** The resolved MIME types the caller currently allows (possibly empty). */
349
- allowedMimeTypes: string[];
390
+ /** The resolved MIME types the caller currently allows (possibly empty). Present only when `reason` is `NoTypesAllowed` or `UnsupportedType`. */
391
+ allowedMimeTypes?: string[];
350
392
  /** Already-formatted, non-translated extension list (e.g. ".png, .jpg"), present only when `reason` is `UnsupportedType`. */
351
393
  formats?: string;
394
+ /** The size limit, in bytes, that was exceeded. Present only when `reason` is `FileTooLarge`. */
395
+ maxFileSizeBytes?: number;
352
396
  }
353
397
 
354
398
  /** Reason a rejected attachment failed validation. */
@@ -356,7 +400,9 @@ export declare enum AttachmentValidationErrorReason {
356
400
  /** No MIME types are allowed at all — attachments are disabled entirely. */
357
401
  NoTypesAllowed = "noTypesAllowed",
358
402
  /** The attachment's content type is not among the allowed MIME types. */
359
- UnsupportedType = "unsupportedType"
403
+ UnsupportedType = "unsupportedType",
404
+ /** The attachment's file size exceeds `maxFileSizeBytes`. */
405
+ FileTooLarge = "fileTooLarge"
360
406
  }
361
407
 
362
408
  /** Thrown by `transcribeAudio`; carries a machine-readable `reason` instead of translated text. */
@@ -522,6 +568,13 @@ export declare const buildSkillManifestFromFrontmatter: (baseFrontmatter: Record
522
568
  * authored it, when it last changed, and its file inventory. Grouping folders
523
569
  * in the file listing are excluded from both the count and the rows. Sizes are
524
570
  * not shown — the skill metadata carries no content-length field.
571
+ *
572
+ * `skill` is the authoritative `getSkillMetadata` response when that request
573
+ * fulfilled; the caller falls back to the catalog listing entry only when it
574
+ * rejected (`useSkillItemDetails`'s `onFetchSkillDetails`). Either way, this
575
+ * function never fills a gap in one source from the other — an absent
576
+ * `author` omits the row and an absent `updatedAt` leaves the updated row's
577
+ * value empty, exactly as `skill` carries it.
525
578
  */
526
579
  export declare const buildSkillOverview: (skill: SkillMetadataItemDto | undefined, files: SkillMetadataItemDto[], about: SkillAboutDetails | undefined, labels: SkillOverviewLabels) => CatalogItemOverview;
527
580
 
@@ -717,6 +770,13 @@ export declare interface ChatStreamCompletionOptions {
717
770
  signal?: AbortSignal;
718
771
  }
719
772
 
773
+ /**
774
+ * Classifies an import request's HTTP status into a semantic outcome: 400/413/422 are
775
+ * archive-content problems, 409 is a name collision, 429 is rate limiting, 502/503 mean the
776
+ * backend is unavailable, and anything else (including no status at all) is generic.
777
+ */
778
+ export declare const classifySkillArchiveImportError: (status: number | undefined) => SkillArchiveImportErrorKind;
779
+
720
780
  /** Clears all cached fetch results. Call this when leaving a conversation. */
721
781
  export declare const clearAttachmentCache: () => void;
722
782
 
@@ -759,6 +819,28 @@ export declare interface ConversationGenerationLifecycle {
759
819
  completeGeneration: (path: string, generationId: string) => void;
760
820
  }
761
821
 
822
+ /** Labels and formatter callbacks for the conversation-input limits mapping utility. */
823
+ export declare interface ConversationInputLimitsLabels {
824
+ /** Heading of the group listing the selected deployment's token limits. */
825
+ tokenGroup: string;
826
+ /** Heading of the group listing the caller's cost budget, which spans every deployment. */
827
+ costGroup: string;
828
+ /** Label for the current-UTC-day row, used by both groups. */
829
+ periodDay: string;
830
+ /** Label for the current-UTC-week row, used by both groups. */
831
+ periodWeek: string;
832
+ /** Label for the current-UTC-month row, used by both groups. */
833
+ periodMonth: string;
834
+ /** Formats the combined used/total display value for a capped row. */
835
+ formatValueLabel: (used: string, total: string) => string;
836
+ /** Formats the ARIA label for a capped progress row. */
837
+ formatProgressAriaLabel: (params: {
838
+ label: string;
839
+ used: string;
840
+ total: string;
841
+ }) => string;
842
+ }
843
+
762
844
  /** Stable reverse-lookup maps returned by `useConversationLookupMaps`. */
763
845
  export declare interface ConversationLookupMaps {
764
846
  /** Returns the raw context id for a panel-space conversation id, or `undefined` when not found. */
@@ -958,6 +1040,12 @@ export declare const createMessagePair: (content: string, customContent?: Messag
958
1040
  */
959
1041
  export declare const createPublishApiClient: (publishApi: PublishApi) => PublishApiClient;
960
1042
 
1043
+ /**
1044
+ * Composes scheduler operations over an already configured generated client.
1045
+ * Authentication, base URL, CSRF, and retries remain host responsibilities.
1046
+ */
1047
+ export declare const createScheduledTasksApiClient: (client: ScheduledTasksConfiguredClient) => ScheduledTasksApiClient;
1048
+
961
1049
  /**
962
1050
  * Builds a generated-client `Middleware` that throws on 401, and on a
963
1051
  * classified invalid-CSRF 403 refreshes the token and retries the original
@@ -1041,6 +1129,9 @@ export declare const decomposeLocalizedFields: (displayName: LocalizedText | und
1041
1129
  /** Fallback text of a {@link GenerationConflictError} when no message is supplied. */
1042
1130
  export declare const DEFAULT_GENERATION_CONFLICT_MESSAGE = "A response is already being generated in this conversation. Wait for it to finish or stop it before sending another message.";
1043
1131
 
1132
+ /** Safe fallback for hosts that do not supply a translated persistence warning. */
1133
+ export declare const DEFAULT_GENERATION_PERSISTENCE_ERROR_MESSAGE = "The response could not be saved. It is still shown here, but may be lost if you reload or leave this page. Copy it before continuing.";
1134
+
1044
1135
  /**
1045
1136
  * Default ceiling on the summed byte length of an export's attachments.
1046
1137
  *
@@ -1124,6 +1215,14 @@ export declare const deriveConversationRowActionState: (item: Pick<ConversationL
1124
1215
  */
1125
1216
  export declare const deriveFavoriteItems: (items: readonly CatalogItem[]) => CatalogItem[];
1126
1217
 
1218
+ /**
1219
+ * Describes the complete trigger without requiring unrelated task metadata.
1220
+ * Unsupported constraints remain Custom, with the full source expression.
1221
+ * Calendar-month shifts crossing month boundaries or days 29–31 remain
1222
+ * Custom because a shifted monthly day is not equivalent around short months.
1223
+ */
1224
+ export declare const describeScheduledTaskTrigger: (trigger: ScheduleTriggerDto, { timeZone, referenceDate, }?: ScheduledTaskTriggerDescriptionOptions) => ScheduledTaskTriggerDescription;
1225
+
1127
1226
  /** Strip the "files/{bucket}/" prefix from a DIAL Core URL to get the path within the bucket. */
1128
1227
  export declare const dialCorePathToRelative: (dialCorePath: string, bucket: string) => string;
1129
1228
 
@@ -1635,6 +1734,9 @@ export declare const formatOperationFolderName: (destinationFolder: string, root
1635
1734
  */
1636
1735
  export declare const formatQuotedNameList: (names: string[]) => string;
1637
1736
 
1737
+ /** Formats a raw `resetsAt` into display strings, or returns `undefined` when it cannot be formatted. */
1738
+ export declare type FormatResetTime = (resetsAt: string | undefined) => ResetTimeDisplay | undefined;
1739
+
1638
1740
  /**
1639
1741
  * Reported through `onError` when the backend rejects a completion because
1640
1742
  * another generation is already active on the same conversation — what a
@@ -1646,7 +1748,13 @@ export declare class GenerationConflictError extends Error {
1646
1748
  constructor(message?: string);
1647
1749
  }
1648
1750
 
1649
- /** Normalizes any API error into a `{ status?, message, traceId? }` shape. */
1751
+ /** Identifies a failed terminal save independently of the model's generation outcome. */
1752
+ export declare class GenerationPersistenceError extends Error {
1753
+ static readonly type = "conversation_save_failed";
1754
+ constructor();
1755
+ }
1756
+
1757
+ /** Normalizes any API error into a `{ status?, message, traceId?, code? }` shape. */
1650
1758
  export declare const getApiErrorDetails: (error: unknown) => Promise<ApiErrorDetails>;
1651
1759
 
1652
1760
  /** Resolves a human-readable message from an API error's response body, or falls back to `Error.message`. */
@@ -1838,6 +1946,30 @@ export declare interface GreetingTranslations {
1838
1946
  nightNoName: string;
1839
1947
  }
1840
1948
 
1949
+ /** Content payload for an application-scoped grouped visualizer: every attachment a message's visualizer claims, rendered together inside one sandboxed iframe. */
1950
+ declare interface GroupedVisualizerCanvasContent {
1951
+ /** Discriminates the content type to select the correct renderer. */
1952
+ type: AttachmentContentType.GroupedVisualizer;
1953
+ /** Iframe `src`, resolved from the matching registry entry's `url`. */
1954
+ url: string;
1955
+ /** One item per claimed attachment, in the message's attachment order. Each `url` is absolute, resolved by the host. */
1956
+ attachments: GroupedAttachmentItem[];
1957
+ /** Presentation layout hints (`themeId`, `width`, `height`, `mobileHeight`) shared by every item. */
1958
+ layout: CustomVisualizerDataLayout;
1959
+ /** postMessage protocol namespace — MUST equal the registry entry's `title`, or the iframe never receives data. */
1960
+ visualizerName: string;
1961
+ /** Milliseconds to wait for a `send()` request's response before rejecting. From the registry entry; does NOT bound the handshake. */
1962
+ requestTimeout?: number;
1963
+ }
1964
+
1965
+ /** Outcome of building a grouped visualizer payload. */
1966
+ export declare interface GroupedVisualizerResolution {
1967
+ /** The grouped payload, or `null` when no claimed attachment resolved to a URL. */
1968
+ content: GroupedVisualizerCanvasContent | null;
1969
+ /** The claimed attachments that reached `content.attachments`, in the input's order. The caller returns the rest to the ordinary attachment tray. */
1970
+ resolved: DisplayAttachment[];
1971
+ }
1972
+
1841
1973
  /** Whether at least one tool toggle in `value` is active. */
1842
1974
  export declare const hasActiveToolConfig: (value: Record<string, boolean> | undefined) => boolean;
1843
1975
 
@@ -1907,8 +2039,8 @@ export declare const isAnswerIncomplete: (answer: Message | undefined) => boolea
1907
2039
  * True when the conversation's last message is an unresolved assistant
1908
2040
  * placeholder: the backend only persists a conversation at generation start
1909
2041
  * (empty placeholder) and at generation end (final content, or a partial
1910
- * flagged `streamErrorMessage`/`wasStoppedByUser`), so this shape means a
1911
- * generation was still active elsewhere when the conversation was loaded.
2042
+ * flagged `streamErrorMessage`/`wasStoppedByUser`). This can mean generation
2043
+ * is still active elsewhere, or that its terminal save failed.
1912
2044
  */
1913
2045
  export declare const isAwaitingGenerationResume: (conversation: Conversation) => boolean;
1914
2046
 
@@ -2043,8 +2175,8 @@ export declare const mapDeploymentDetailsDtoToEntityDetails: (dto: DeploymentDet
2043
2175
  /** Maps a deployment limits DTO to display-ready catalog limits, or `undefined` when no qualifying stats exist. */
2044
2176
  export declare const mapDeploymentLimitsDtoToCatalogLimits: (dto: DeploymentLimitsResponseDto | undefined, labels: DeploymentLimitsLabels) => CatalogItemLimits | undefined;
2045
2177
 
2046
- /** Maps the monthly deployment token limit to a display-ready value. */
2047
- export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined) => MonthlyUsageLimit | undefined;
2178
+ /** Maps a deployment's day, week, and month token limits and the caller's cost budget to display-ready rows, or `undefined` when none qualify. */
2179
+ export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined, labels: ConversationInputLimitsLabels, formatResetTime?: FormatResetTime) => CatalogItemLimits | undefined;
2048
2180
 
2049
2181
  /** Maps a deployment listing row into the catalog UI's `CatalogItem` shape. */
2050
2182
  export declare const mapDeploymentToCatalogItem: (deployment: DeploymentItemDto, { favoriteIds, entityDetails, folderLabels, editableSchemaIds, isCustomAppsEditable, activeLocale, primaryLocale, resolveIconUrl, }: MapDeploymentToCatalogItemOptions) => CatalogItem;
@@ -2110,12 +2242,18 @@ export declare const mapFileMetadataToDialFile: (metadata: FileMetadataResponseD
2110
2242
  export declare const mapFormValuesToCreateBody: (values: ScheduledTaskCreateFormValues) => CreateScheduledTaskBodyDto;
2111
2243
 
2112
2244
  /**
2113
- * Maps validated edit-form values to the `PUT /api/v1/scheduled-tasks/:scheduleId`
2114
- * request body. `UpdateScheduledTaskBodyDto` has the same shape as
2115
- * `CreateScheduledTaskBodyDto`, so this reuses the same trigger-building logic.
2245
+ * Maps a complete, validated edit draft to an update body. An unset skill
2246
+ * emits null to remove the saved reference; hydrate from detail before editing.
2116
2247
  */
2117
2248
  export declare const mapFormValuesToUpdateBody: (values: ScheduledTaskCreateFormValues) => UpdateScheduledTaskBodyDto;
2118
2249
 
2250
+ /**
2251
+ * Maps the same top-level Cost budgets used by the aggregate cards into table-header state.
2252
+ *
2253
+ * @param formatResetTime - Formats each period's top-level `resetsAt` into the header's reset trio. Omit it to produce statuses with no reset fields.
2254
+ */
2255
+ export declare const mapOverallCostLimitsToPeriodStatuses: (usage: UserLimitStatsResponseDto | undefined, activeLocale: string, t: Translate_2, formatResetTime?: FormatResetTime) => ModelLimitPeriodStatuses;
2256
+
2119
2257
  /**
2120
2258
  * Maps a prompt DTO into a catalog item.
2121
2259
  *
@@ -2174,6 +2312,13 @@ export declare interface MapSkillToCatalogItemOptions {
2174
2312
  favoriteIds: ReadonlySet<string>;
2175
2313
  }
2176
2314
 
2315
+ /**
2316
+ * Returns the normalized stages of a raw stage array or a message-like
2317
+ * payload (reading `custom_content.stages`, falling back to
2318
+ * `customContent.stages`), or `undefined` when there are none.
2319
+ */
2320
+ export declare const mapStages: (source: RawStage[] | RawStageSource | null | undefined) => Stage[] | undefined;
2321
+
2177
2322
  /**
2178
2323
  * Maps a toolset's specification into the lib's credential-status shape,
2179
2324
  * for refreshing the details panel after login/logout. Includes both
@@ -2198,6 +2343,24 @@ export declare interface MapToolsetToCatalogItemOptions {
2198
2343
  resolveIconUrl: (iconUrl: string | undefined) => string | undefined;
2199
2344
  }
2200
2345
 
2346
+ /**
2347
+ * Maps a `UserLimitStatsResponseDto` into `UsageLimitCardGroup`'s `cards` prop,
2348
+ * in Today / This week / This month order. A period is omitted entirely when
2349
+ * the response carries no usable stat for it. Each card's reset trio comes from
2350
+ * `formatResetTime`, and is absent when that callback returns `undefined`.
2351
+ */
2352
+ export declare const mapUsageDataToDashboard: (usage: UserLimitStatsResponseDto | undefined, t: Translate, formatResetTime: FormatResetTime) => UsageLimitCardData[];
2353
+
2354
+ /**
2355
+ * Maps `usage.deployments` into `ModelLimitsSection`'s `rows` prop, joined with model identity
2356
+ * from `deploymentItems`. Rows are included only when any displayed period stat has nonzero usage.
2357
+ * Order follows `Object.keys(deployments)` — `deploymentItems` is enrichment-only.
2358
+ *
2359
+ * @param resolveIconUrl - Resolves a deployment's raw `iconUrl` to the URL the avatar should load.
2360
+ * @param resolveDisplayName - Resolves a localized-text map or plain string to the display name for `activeLocale`.
2361
+ */
2362
+ export declare const mapUserUsageToModelLimits: (usage: UserLimitStatsResponseDto | undefined, deploymentItems: DeploymentItemDto[], activeLocale: string, t: Translate_2, resolveIconUrl: ResolveIconUrl, resolveDisplayName: ResolveDisplayName) => ModelLimitRow[];
2363
+
2201
2364
  /** Content payload for Markdown file attachments. */
2202
2365
  declare interface MarkdownCanvasContent {
2203
2366
  /** Discriminates the content type to select the correct renderer. */
@@ -2218,6 +2381,8 @@ declare type McpAppDisplayMode = NonNullable<McpUiHostContext['displayMode']>;
2218
2381
  declare interface McpAppHostAdapter {
2219
2382
  /** `McpUiHostContext` to deliver to the mounted app's `ui/initialize` handshake. */
2220
2383
  hostContext: McpUiHostContext;
2384
+ /** Host identity (`name`/`version`) to deliver to the mounted app's `ui/initialize` handshake. */
2385
+ hostInfo: Implementation;
2221
2386
  /** Operator-configured MCP Apps sandbox-proxy URL, or `null` when unconfigured. */
2222
2387
  sandboxUrl: string | null;
2223
2388
  /** Fetches the matched tool's MCP Apps `ui://` resource. */
@@ -2234,7 +2399,7 @@ export declare interface McpAppHostContextParams {
2234
2399
  mcpAppTheme?: string;
2235
2400
  /** Host's current i18n locale (BCP 47). */
2236
2401
  locale: string;
2237
- /** Operator-configured MCP App user-agent override. Defaults to `'ai-dial-chat'`. */
2402
+ /** Operator-configured MCP App user-agent override. Defaults to the browser's own `navigator.userAgent`. */
2238
2403
  mcpAppUserAgent?: string;
2239
2404
  /**
2240
2405
  * Display modes the host can switch an app between via
@@ -2356,6 +2521,22 @@ export declare enum McpResourceKind {
2356
2521
 
2357
2522
  export declare const mergeCreatedFolderIntoCache: (cache: Map<string, ListFilesItemDto[]>, parentApiPath: string, created: CreateFolderResponseDto, inheritedPermissions?: string[]) => Map<string, ListFilesItemDto[]>;
2358
2523
 
2524
+ /**
2525
+ * Merges incoming stage deltas into an existing stage list, keyed by `index`.
2526
+ *
2527
+ * Partial `name` and `content` strings are concatenated across chunks;
2528
+ * attachments are merged by their own `index` (concatenating partial `title`
2529
+ * and `data`); every other field on the incoming delta overwrites the
2530
+ * accumulated one. A brand-new stage whose first chunk carries `name: null`
2531
+ * is normalized to `''`.
2532
+ *
2533
+ * Exported for hosts that keep a flattened `Stage[]` on the message instead
2534
+ * of `Message.custom_content.stages` and therefore cannot reuse
2535
+ * {@link applyChunkToMessages}. Prefer `useConversationStream` when the host
2536
+ * can delegate the whole stream loop.
2537
+ */
2538
+ export declare const mergeStages: (existing: Stage[], incoming: Stage[]) => Stage[];
2539
+
2359
2540
  /** True when `message` is an assistant message carrying at least one stage. */
2360
2541
  export declare const messageHasStages: (message: Message) => boolean;
2361
2542
 
@@ -2368,7 +2549,14 @@ export declare interface MessagePair {
2368
2549
  /** Formats MIME types as a human-readable, comma-separated list of dotted extensions (or the MIME type itself for wildcards). */
2369
2550
  export declare const mimeTypesToAttachmentExtensionLabels: (types: string[]) => string;
2370
2551
 
2371
- /** Normalizes `*` to the all-files wildcard and drops any value that is not a valid `DialFileAcceptType`. */
2552
+ /**
2553
+ * Normalizes `*` to the all-files wildcard, canonicalizes MIME aliases, and drops
2554
+ * any value that is not a valid `DialFileAcceptType`.
2555
+ *
2556
+ * Aliases are resolved because a file picker matches an `accept` entry against its
2557
+ * own MIME table: a declared `text/json` offers no `.json` file, while the
2558
+ * `application/json` it denotes does.
2559
+ */
2372
2560
  export declare const mimeTypesToDialFileAcceptTypes: (types?: string[]) => DialFileAcceptType[] | undefined;
2373
2561
 
2374
2562
  /**
@@ -2435,18 +2623,6 @@ export declare interface ModelSpecification {
2435
2623
  createdAt?: number;
2436
2624
  }
2437
2625
 
2438
- /** Normalized monthly token usage consumed by the conversation input control. */
2439
- export declare interface MonthlyUsageLimit {
2440
- /** Normalized used-token count. */
2441
- used: number;
2442
- /** Configured monthly token limit. */
2443
- total: number;
2444
- /** Remaining monthly tokens, clamped to zero. */
2445
- remaining: number;
2446
- /** Monthly utilization percentage, clamped to 0–100. */
2447
- usedPercent: number;
2448
- }
2449
-
2450
2626
  /** Returns a skill relative path's final segment (its display name in the file tree). */
2451
2627
  export declare const nameFromPath: (path: string) => string;
2452
2628
 
@@ -2544,7 +2720,17 @@ declare interface OoxmlDocxHighlightLocation {
2544
2720
  text: string;
2545
2721
  }
2546
2722
 
2547
- /** Supported document formats rendered by the bundled `@silurus/ooxml` runtime. */
2723
+ /** A complete table row in the DOCX body, matched by cell text. */
2724
+ declare interface OoxmlDocxTableRowLocation {
2725
+ /** Location kind. */
2726
+ kind: OoxmlHighlightKind.DocxTableRow;
2727
+ /** Plain text of each cell, in column order. */
2728
+ cells: string[];
2729
+ /** 1-based matching row in document order. */
2730
+ occurrence: number;
2731
+ }
2732
+
2733
+ /** Supported document formats rendered by the installed `@silurus/ooxml` runtime. */
2548
2734
  declare enum OoxmlFileType {
2549
2735
  Docx = 'docx',
2550
2736
  Xlsx = 'xlsx',
@@ -2566,6 +2752,10 @@ declare enum OoxmlHighlightKind {
2566
2752
  DocxTextRange = 'docxTextRange',
2567
2753
  /** A character range inside a single PPTX shape on one slide. */
2568
2754
  PptxTextRange = 'pptxTextRange',
2755
+ /** A complete DOCX table row identified by its cell text. */
2756
+ DocxTableRow = 'docxTableRow',
2757
+ /** A complete PPTX table row identified by its cell text on one slide. */
2758
+ PptxTableRow = 'pptxTableRow',
2569
2759
  /** One cell, or a contiguous same-row cell range, on a named XLSX sheet. */
2570
2760
  XlsxCellRange = 'xlsxCellRange',
2571
2761
  }
@@ -2574,6 +2764,8 @@ declare enum OoxmlHighlightKind {
2574
2764
  declare type OoxmlHighlightLocation =
2575
2765
  | OoxmlDocxHighlightLocation
2576
2766
  | OoxmlPptxHighlightLocation
2767
+ | OoxmlDocxTableRowLocation
2768
+ | OoxmlPptxTableRowLocation
2577
2769
  | OoxmlXlsxHighlightLocation;
2578
2770
 
2579
2771
  /** A cited character range inside a single shape on one PPTX slide. */
@@ -2592,6 +2784,18 @@ declare interface OoxmlPptxHighlightLocation {
2592
2784
  text: string;
2593
2785
  }
2594
2786
 
2787
+ /** A complete table row on one PPTX slide, matched by cell text. */
2788
+ declare interface OoxmlPptxTableRowLocation {
2789
+ /** Location kind. */
2790
+ kind: OoxmlHighlightKind.PptxTableRow;
2791
+ /** Plain text of each cell, in column order. */
2792
+ cells: string[];
2793
+ /** 1-based matching row on the specified slide. */
2794
+ occurrence: number;
2795
+ /** 1-based slide number. */
2796
+ slide: number;
2797
+ }
2798
+
2595
2799
  /** A cited cell, or contiguous same-row cell range, on a named XLSX sheet. */
2596
2800
  declare interface OoxmlXlsxHighlightLocation {
2597
2801
  /** Discriminates this location within `OoxmlHighlightLocation`. */
@@ -2763,6 +2967,15 @@ export declare const prepareMoveRenameItems: (copiedItems: DialCopiedItem[], buc
2763
2967
  preparedMoveItems: PreparedCopyMoveItem<MoveItemDto>[];
2764
2968
  };
2765
2969
 
2970
+ /**
2971
+ * Validates form values before creating a request body. Hosts translate the
2972
+ * returned field codes and must not issue a write when `ok` is false.
2973
+ */
2974
+ export declare const prepareScheduledTaskCreateBody: (values: ScheduledTaskCreateFormValues, options: ScheduledTaskValidationOptions) => ScheduledTaskPreparationResult<CreateScheduledTaskBodyDto>;
2975
+
2976
+ /** Validates form values before preparing an update request body. */
2977
+ export declare const prepareScheduledTaskUpdateBody: (values: ScheduledTaskCreateFormValues, options: ScheduledTaskValidationOptions) => ScheduledTaskPreparationResult<UpdateScheduledTaskBodyDto>;
2978
+
2766
2979
  /** Maximum body length accepted by `CreatePromptDto.content`. */
2767
2980
  export declare const PROMPT_CONTENT_MAX_LENGTH = 50000;
2768
2981
 
@@ -2846,6 +3059,63 @@ export declare interface QuickAppSchemaLike {
2846
3059
  displayName?: string;
2847
3060
  }
2848
3061
 
3062
+ /**
3063
+ * One stage as it arrives from the REST API or the SSE stream, before
3064
+ * normalization. Structurally satisfied by the generated `StageDto` and by a
3065
+ * raw stream delta, both of which omit `index`/`name`/`status` on the chunk
3066
+ * that opens a stage.
3067
+ */
3068
+ export declare interface RawStage {
3069
+ /** Ordering key. Defaults to `0` when absent. */
3070
+ index?: number | null;
3071
+ /** Stage title. `null` on the chunk that opens the stage. */
3072
+ name?: string | null;
3073
+ /** Terminal state as a raw wire string; anything other than `'completed'`/`'failed'` means still running. */
3074
+ status?: string | null;
3075
+ /** Additional stage text. */
3076
+ content?: string | null;
3077
+ /** Short source/category label shown beside the stage name. */
3078
+ tag?: string | null;
3079
+ /** Files produced or referenced by this stage. */
3080
+ attachments?: RawStageAttachment[] | null;
3081
+ }
3082
+
3083
+ /**
3084
+ * One stage attachment as it arrives from the REST API or the SSE stream,
3085
+ * before normalization: every field is optional and may be `null`.
3086
+ */
3087
+ export declare interface RawStageAttachment {
3088
+ /** Zero-based position in the attachment list. */
3089
+ index?: number | null;
3090
+ /** MIME type of the attachment content. */
3091
+ type?: string | null;
3092
+ /** Display name shown in the UI. */
3093
+ title?: string | null;
3094
+ /** Inline base-64 encoded content. */
3095
+ data?: string | null;
3096
+ /** Remote URL pointing to the attachment content. */
3097
+ url?: string | null;
3098
+ /** MIME type of the referenced resource. */
3099
+ reference_type?: string | null;
3100
+ /** URL of an alternate reference resource. */
3101
+ reference_url?: string | null;
3102
+ }
3103
+
3104
+ /**
3105
+ * Message-like payload carrying stages under either the wire's snake_case
3106
+ * `custom_content` or a host's camelCased `customContent`.
3107
+ */
3108
+ export declare interface RawStageSource {
3109
+ /** Custom content as the DIAL wire format spells it. */
3110
+ custom_content?: {
3111
+ stages?: RawStage[] | null;
3112
+ } | null;
3113
+ /** Custom content as a camelCasing host spells it. */
3114
+ customContent?: {
3115
+ stages?: RawStage[] | null;
3116
+ } | null;
3117
+ }
3118
+
2849
3119
  /**
2850
3120
  * Reads a skill file response as raw bytes, or `null` when the body is
2851
3121
  * larger than `SKILL_MANIFEST_MAX_BYTES`. The declared `content-length` is
@@ -2919,6 +3189,23 @@ export declare const referenceAttachmentToPdfCanvasContent: (attachment: Attachm
2919
3189
  /** Name reserved for the hidden marker file used to create empty folders. */
2920
3190
  export declare const RESERVED_MARKER_NAME = ".dial_folder";
2921
3191
 
3192
+ /**
3193
+ * One reset time, already parsed and formatted by the host. Declared
3194
+ * structurally here so this library never imports an application type; the
3195
+ * host passes a value that satisfies this shape (e.g. `apps/chat`'s own
3196
+ * `ResetTimeDisplay`).
3197
+ */
3198
+ export declare interface ResetTimeDisplay {
3199
+ /** Exclusive end of the period as an epoch ms value, for the host's boundary scheduling. */
3200
+ resetsAtMs: number;
3201
+ /** Machine-readable instant for a `<time dateTime>` attribute. */
3202
+ isoValue: string;
3203
+ /** Visible reset line. */
3204
+ label: string;
3205
+ /** Accessible expansion of the reset line. */
3206
+ ariaLabel: string;
3207
+ }
3208
+
2922
3209
  /**
2923
3210
  * Resolves the primary action for a catalog item.
2924
3211
  *
@@ -2938,7 +3225,8 @@ export declare const resolveCatalogPrimaryAction: (item: CatalogItem, fetchPromp
2938
3225
  /** Resolves a syntax-highlighted code canvas content payload from a DisplayAttachment, or `null` if unavailable. */
2939
3226
  export declare const resolveCodeCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers, language?: string) => Promise<CodeCanvasContent | ErrorCanvasContent | null>;
2940
3227
 
2941
- export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDto, "isMy" | "sharedWithMe" | "applicationFolder">, labels: DeploymentFolderLabels) => string[];
3228
+ /** Resolves a deployment's display folder, including organization applications without a folder path. */
3229
+ export declare const resolveDeploymentFolder: (deployment: Pick<DeploymentItemDto, "isMy" | "sharedWithMe" | "applicationFolder"> & Partial<Pick<DeploymentItemDto, "type">>, labels: DeploymentFolderLabels) => string[];
2942
3230
 
2943
3231
  /**
2944
3232
  * Resolves a DialFile to the bucket-relative API path used by files BFF endpoints.
@@ -2956,6 +3244,9 @@ export declare const resolveDialFileBucketAndPath: (fileId: string) => {
2956
3244
  path: string;
2957
3245
  } | undefined;
2958
3246
 
3247
+ /** A callback that resolves a display name from a localized-text value. */
3248
+ declare type ResolveDisplayName = (name: string | Record<string, string> | undefined | null, locale: string) => string;
3249
+
2959
3250
  /** Resolves a DIAL Core file id to a downloadable URL. Host-owned — encodes the app's own file-download endpoint. */
2960
3251
  export declare type ResolveDownloadUrl = (fileId: string) => string | undefined;
2961
3252
 
@@ -2974,6 +3265,17 @@ export declare type ResolveDownloadUrl = (fileId: string) => string | undefined;
2974
3265
  */
2975
3266
  export declare const resolveExternalSourceContentType: (contentType: string, url: string) => string;
2976
3267
 
3268
+ /**
3269
+ * Builds the grouped payload for an application-scoped visualizer from the
3270
+ * attachments its entry claims, reporting which of them `resolveAbsoluteUrl`
3271
+ * could produce a URL for. Unlike the single-attachment resolver this fetches
3272
+ * nothing: the grouped protocol hands the visualizer URLs and lets it read
3273
+ * them itself, so the URLs must be absolute — a host-relative path would
3274
+ * resolve against the iframe's own origin. Producing one is host knowledge,
3275
+ * which is why it arrives as a callback rather than being built here.
3276
+ */
3277
+ export declare const resolveGroupedVisualizerCanvasContent: (attachments: DisplayAttachment[], resolveAbsoluteUrl: (attachment: DisplayAttachment) => string | undefined, entry: ApplicationVisualizer, themeId: string) => GroupedVisualizerResolution;
3278
+
2977
3279
  /**
2978
3280
  * Resolves an HTML canvas content payload from a DisplayAttachment.
2979
3281
  * Fetches and inlines the HTML as `srcdoc` when the attachment has a download URL or inline data.
@@ -2982,12 +3284,17 @@ export declare const resolveExternalSourceContentType: (contentType: string, url
2982
3284
  */
2983
3285
  export declare const resolveHtmlCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => Promise<HtmlCanvasContent | ErrorCanvasContent | null>;
2984
3286
 
3287
+ /** A callback that resolves an icon URL from a deployment's raw `iconUrl` field. */
3288
+ declare type ResolveIconUrl = (iconUrl: string | undefined) => string | undefined;
3289
+
2985
3290
  /**
2986
3291
  * Resolves an image canvas content payload from a DisplayAttachment without
2987
- * fetching — returns the BFF download URL (or a local/inline blob URL)
2988
- * directly so the browser cache can be shared with the conversation view's
2989
- * `<img>` element. Error detection is delegated to `<img onError>` in the
2990
- * canvas renderer. Returns `null` if no URL source is available.
3292
+ * fetching — returns a local blob URL or the BFF download URL directly so the
3293
+ * browser cache can be shared with the conversation view's `<img>` element.
3294
+ * A local `File` with bytes takes precedence over the DIAL download URL; a
3295
+ * 0-byte `File` (the file-manager placeholder) does not. Error detection is
3296
+ * delegated to `<img onError>` in the canvas renderer. Returns `null` if no
3297
+ * URL source is available.
2991
3298
  */
2992
3299
  export declare const resolveImageCanvasContent: (attachment: DisplayAttachment, resolvers: AttachmentCanvasUrlResolvers) => ImageCanvasContent | null;
2993
3300
 
@@ -3105,6 +3412,106 @@ export declare type ScheduledTaskDtoMappingResult = {
3105
3412
  reason: UnsupportedTriggerReason;
3106
3413
  };
3107
3414
 
3415
+ /** A checked request preparation result that never serializes invalid values. */
3416
+ export declare type ScheduledTaskPreparationResult<TBody> = {
3417
+ ok: true;
3418
+ body: TBody;
3419
+ } | {
3420
+ ok: false;
3421
+ errors: ScheduledTaskValidationErrors;
3422
+ };
3423
+
3424
+ export declare interface ScheduledTaskRunsListRequest {
3425
+ scheduleId: string;
3426
+ limit?: number;
3427
+ offset?: number;
3428
+ signal?: AbortSignal;
3429
+ }
3430
+
3431
+ export declare interface ScheduledTasksApiClient {
3432
+ listScheduledTasks: (request?: ScheduledTasksListRequest) => Promise<ListScheduledTasksResponseDto>;
3433
+ listScheduledTaskRuns: (request: ScheduledTaskRunsListRequest) => Promise<ListScheduledTaskRunsResponseDto>;
3434
+ createScheduledTask: (body: CreateScheduledTaskBodyDto) => Promise<CreatedScheduledTaskDto>;
3435
+ getScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
3436
+ updateScheduledTask: (scheduleId: string, body: UpdateScheduledTaskBodyDto) => Promise<UpdatedScheduledTaskDto>;
3437
+ pauseScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
3438
+ resumeScheduledTask: (scheduleId: string) => Promise<ScheduledTaskDto>;
3439
+ deleteScheduledTask: (scheduleId: string) => Promise<void>;
3440
+ }
3441
+
3442
+ /** Narrow configured generated-client surface required by scheduler hooks. */
3443
+ export declare interface ScheduledTasksConfiguredClient {
3444
+ listScheduledTasks: (request: {
3445
+ limit?: number;
3446
+ offset?: number;
3447
+ search?: string;
3448
+ sort?: ListScheduledTasksSortEnum;
3449
+ }, options?: RequestInit) => Promise<ListScheduledTasksResponseDto>;
3450
+ listScheduledTaskRuns: (request: {
3451
+ scheduleId: string;
3452
+ limit?: number;
3453
+ offset?: number;
3454
+ }, options?: RequestInit) => Promise<ListScheduledTaskRunsResponseDto>;
3455
+ createScheduledTask: (request: {
3456
+ createScheduledTaskBodyDto: CreateScheduledTaskBodyDto;
3457
+ }) => Promise<CreatedScheduledTaskDto>;
3458
+ getScheduledTask: (request: {
3459
+ scheduleId: string;
3460
+ }) => Promise<ScheduledTaskDto>;
3461
+ updateScheduledTask: (request: {
3462
+ scheduleId: string;
3463
+ updateScheduledTaskBodyDto: UpdateScheduledTaskBodyDto;
3464
+ }) => Promise<UpdatedScheduledTaskDto>;
3465
+ pauseScheduledTask: (request: {
3466
+ scheduleId: string;
3467
+ }) => Promise<ScheduledTaskDto>;
3468
+ resumeScheduledTask: (request: {
3469
+ scheduleId: string;
3470
+ }) => Promise<ScheduledTaskDto>;
3471
+ deleteScheduledTask: (request: {
3472
+ scheduleId: string;
3473
+ }) => Promise<void>;
3474
+ }
3475
+
3476
+ /** App-agnostic request options accepted by the scheduler facade. */
3477
+ export declare interface ScheduledTasksListRequest {
3478
+ limit?: number;
3479
+ offset?: number;
3480
+ search?: string;
3481
+ sort?: ListScheduledTasksSortEnum;
3482
+ signal?: AbortSignal;
3483
+ }
3484
+
3485
+ export declare interface ScheduledTaskTriggerDescription {
3486
+ kind: ScheduledTaskTriggerDescriptionKind;
3487
+ time?: string;
3488
+ dayOfWeek?: string;
3489
+ dayOfMonth?: string;
3490
+ intervalMinutes?: number;
3491
+ date?: Date;
3492
+ expression?: string;
3493
+ sourceTimezone: 'utc';
3494
+ }
3495
+
3496
+ /** Display categories are independent of task editability. */
3497
+ export declare enum ScheduledTaskTriggerDescriptionKind {
3498
+ OneTime = "oneTime",
3499
+ Hourly = "hourly",
3500
+ EveryNMinutes = "everyNMinutes",
3501
+ Daily = "daily",
3502
+ Weekly = "weekly",
3503
+ Monthly = "monthly",
3504
+ Custom = "custom",
3505
+ Invalid = "invalid"
3506
+ }
3507
+
3508
+ export declare interface ScheduledTaskTriggerDescriptionOptions {
3509
+ /** Display timezone; defaults to UTC for backwards compatibility. */
3510
+ timeZone?: string;
3511
+ /** Date whose timezone offset is used. Defaults to now (the existing UTC-storage policy). */
3512
+ referenceDate?: Date;
3513
+ }
3514
+
3108
3515
  /** Serializes a prompt export envelope into a pretty-printed JSON blob. */
3109
3516
  export declare const serializePromptExport: (envelope: PromptExportFormat) => Blob;
3110
3517
 
@@ -3180,6 +3587,28 @@ export declare interface SkillAboutDetails {
3180
3587
  skillPrompt?: string;
3181
3588
  }
3182
3589
 
3590
+ /** Semantic classification of an import request failure. */
3591
+ export declare enum SkillArchiveImportErrorKind {
3592
+ Validation = "validation",
3593
+ Collision = "collision",
3594
+ RateLimited = "rateLimited",
3595
+ ServiceUnavailable = "serviceUnavailable",
3596
+ Generic = "generic"
3597
+ }
3598
+
3599
+ /** Phase of a skill-archive import, driving the host's loading/success/error presentation. */
3600
+ export declare enum SkillArchiveImportStatus {
3601
+ Idle = "idle",
3602
+ Uploading = "uploading",
3603
+ Success = "success",
3604
+ Error = "error"
3605
+ }
3606
+
3607
+ /** Reason a selected/dropped file was rejected before any request was made. */
3608
+ export declare enum SkillArchiveSelectionRejectionReason {
3609
+ UnsupportedFilename = "unsupportedFilename"
3610
+ }
3611
+
3183
3612
  /** Injected API port for skill detail fetching. Mirrors exact server-api wrapper signatures. */
3184
3613
  export declare interface SkillDetailsApi {
3185
3614
  /** Downloads a raw skill file, returning the raw fetch `Response`. */
@@ -3193,6 +3622,12 @@ export declare interface SkillDetailsApi {
3193
3622
  limit?: number;
3194
3623
  recursive?: boolean;
3195
3624
  }, signal?: AbortSignal): Promise<SkillFileListResponseDto>;
3625
+ /**
3626
+ * Fetches a single skill's own authoritative metadata (`author`,
3627
+ * `updatedAt`, and the rest of `SkillMetadataItemDto`) — not the catalog
3628
+ * listing entry, which may be sparse for a shared skill.
3629
+ */
3630
+ getSkillMetadata(bucket: string, path: string, signal?: AbortSignal): Promise<SkillMetadataItemDto>;
3196
3631
  }
3197
3632
 
3198
3633
  /** Already-configured DIAL Core download operations `useSkillEditorLoad` needs. */
@@ -3236,6 +3671,12 @@ export declare interface SkillEditorSubmitClient {
3236
3671
  export declare interface SkillEditorSubmitMessages {
3237
3672
  /** Shown when a required field is empty. */
3238
3673
  required: string;
3674
+ /**
3675
+ * Shown when the Instructions value opens with its own YAML frontmatter
3676
+ * block — pasting a whole `SKILL.md` in there would otherwise produce a
3677
+ * manifest with two frontmatter blocks.
3678
+ */
3679
+ instructionsFrontmatter: string;
3239
3680
  /** Shown when the normalized skill name fails DIAL's naming rules. */
3240
3681
  nameInvalid: string;
3241
3682
  /** Shown when the skill name already exists (409), or defensively on an unreachable create-mode 412. */
@@ -3442,6 +3883,28 @@ export declare const splitFileNameExtension: (fileName: string) => {
3442
3883
  extension: string;
3443
3884
  };
3444
3885
 
3886
+ /**
3887
+ * Answers one question: would appending this text after the fence that
3888
+ * `buildSkillManifest` writes produce a *second* frontmatter block?
3889
+ *
3890
+ * That happens when the text's first non-blank line is a bare `---` and some
3891
+ * later line is a bare `---` too — the exact shape of a `SKILL.md` pasted
3892
+ * wholesale into the editor's Instructions field.
3893
+ *
3894
+ * Detection is deliberately structural rather than YAML-based: a pasted block
3895
+ * whose fenced content fails to parse corrupts the stored manifest
3896
+ * identically (and renders as a setext `h2` in the Catalog's Details tab just
3897
+ * the same), so requiring parseable YAML here would let the worst cases
3898
+ * through. Keeping `parseYaml` out also makes this cheap enough to run on
3899
+ * every keystroke.
3900
+ *
3901
+ * A single unclosed fence returns `false`: with no closing fence there is no
3902
+ * second block, matching `FRONTMATTER_PATTERN`'s own requirement. A `---`
3903
+ * appearing later in the body (a horizontal rule, a setext underline) is
3904
+ * likewise not a frontmatter block.
3905
+ */
3906
+ export declare const startsWithFrontmatterBlock: (text: string) => boolean;
3907
+
3445
3908
  /** Options accepted by {@link ConversationStreamTransport.streamCompletion}. */
3446
3909
  export declare interface StreamCompletionOptions {
3447
3910
  onChunk: (chunk: StreamChunk) => void;
@@ -3450,6 +3913,17 @@ export declare interface StreamCompletionOptions {
3450
3913
  signal: AbortSignal;
3451
3914
  }
3452
3915
 
3916
+ /**
3917
+ * Reported through `onError` when DIAL Core itself signals a failure with an
3918
+ * in-band `{ error: { message } }` SSE chunk. Its `message` is upstream text
3919
+ * intended for the user, unlike a transport failure (failed `fetch`, non-OK
3920
+ * status, broken stream), whose message is technical detail. A custom
3921
+ * transport raises this for any user-facing upstream error text.
3922
+ */
3923
+ export declare class StreamUpstreamError extends Error {
3924
+ constructor(message: string);
3925
+ }
3926
+
3453
3927
  /** Strips leading and trailing slashes from a path segment. */
3454
3928
  export declare const stripSurroundingSlashes: (path: string) => string;
3455
3929
 
@@ -3767,6 +4241,13 @@ export declare const toPublishEntityType: (type: CatalogEntityType) => CatalogPu
3767
4241
  */
3768
4242
  export declare const toPublishRuleDto: (rule: PublicationRule) => PublishRuleDto;
3769
4243
 
4244
+ /**
4245
+ * Returns a renderable `Stage` for one raw payload: `index` defaults to `0`,
4246
+ * `name` to `''`, an unrecognized `status` to `null` (still running), and
4247
+ * `content`/`tag`/`attachments` are passed through when present.
4248
+ */
4249
+ export declare const toStage: (stage: RawStage) => Stage;
4250
+
3770
4251
  /** Request shape the host's selected-deployment recognition call accepts. */
3771
4252
  export declare interface TranscribeWithDeploymentParams {
3772
4253
  audioUrl: string;
@@ -3775,6 +4256,12 @@ export declare interface TranscribeWithDeploymentParams {
3775
4256
  signal: AbortSignal;
3776
4257
  }
3777
4258
 
4259
+ /** A translate function compatible with i18next's `TFunction`. */
4260
+ declare type Translate = (key: string, options?: Record<string, unknown>) => string;
4261
+
4262
+ /** A translate function compatible with i18next's `TFunction`. */
4263
+ declare type Translate_2 = (key: string, options?: Record<string, unknown>) => string;
4264
+
3778
4265
  export declare const trimFileNameToByteLimit: (name: string, limit?: number) => string;
3779
4266
 
3780
4267
  /** An error thrown to indicate the caller is unauthenticated. */
@@ -3833,6 +4320,62 @@ export declare interface UploadFileWithProgressOptions {
3833
4320
  /** Upload mode passed to `FilesApi.uploadFile`: overwrite an existing file or fail if it already exists. */
3834
4321
  export declare type UploadMode = 'overwrite' | 'create-only';
3835
4322
 
4323
+ /**
4324
+ * i18n key strings that the consuming app's translation bundle must define for
4325
+ * `mapUsageDataToDashboard` to produce correctly translated strings. The
4326
+ * values are the default key paths used by AI DIAL Chat.
4327
+ */
4328
+ export declare const USAGE_DATA_I18N_KEYS: {
4329
+ /** Title for the current-UTC-day card (e.g. `'Today'`). */
4330
+ readonly todayTitle: "usage.todayTitle";
4331
+ /** Accessible period description for the current-UTC-day card. */
4332
+ readonly todayPeriodDescription: "usage.todayPeriodDescription";
4333
+ /** Title for the current-UTC-week card (e.g. `'This week'`). */
4334
+ readonly thisWeekTitle: "usage.thisWeekTitle";
4335
+ /** Accessible period description for the current-UTC-week card. */
4336
+ readonly thisWeekPeriodDescription: "usage.thisWeekPeriodDescription";
4337
+ /** Title for the current-UTC-month card (e.g. `'This month'`). */
4338
+ readonly thisMonthTitle: "usage.thisMonthTitle";
4339
+ /** Accessible period description for the current-UTC-month card. */
4340
+ readonly thisMonthPeriodDescription: "usage.thisMonthPeriodDescription";
4341
+ /** Aria label when there is no limit. Receives `{ used: string }`. */
4342
+ readonly unlimitedProgressAriaLabel: "usage.unlimitedProgressAriaLabel";
4343
+ /** Aria label for a progress bar with a finite limit. Receives `{ used: string, total: string, percent: number }`. */
4344
+ readonly progressAriaLabel: "usage.progressAriaLabel";
4345
+ };
4346
+
4347
+ /**
4348
+ * i18n key strings that the consuming app's translation bundle must define for
4349
+ * `mapUserUsageToModelLimits` and `mapOverallCostLimitsToPeriodStatuses` to produce
4350
+ * correctly translated strings. The values are the default key paths used by AI DIAL Chat.
4351
+ */
4352
+ export declare const USAGE_MODEL_LIMITS_I18N_KEYS: {
4353
+ /** Period label used in tooltip text. Receives no interpolation. */
4354
+ readonly todayPeriodDescription: "usage.todayPeriodDescription";
4355
+ /** Period label used in tooltip text. Receives no interpolation. */
4356
+ readonly thisWeekPeriodDescription: "usage.thisWeekPeriodDescription";
4357
+ /** Period label used in tooltip text. Receives no interpolation. */
4358
+ readonly thisMonthPeriodDescription: "usage.thisMonthPeriodDescription";
4359
+ /** Tooltip when the overall cost limit is running low. Receives `{ period: string }`. */
4360
+ readonly overallCostLimitRunningLowTooltip: "usage.overallCostLimitRunningLowTooltip";
4361
+ /** Tooltip when the overall cost limit is reached. Receives `{ period: string }`. */
4362
+ readonly overallCostLimitReachedTooltip: "usage.overallCostLimitReachedTooltip";
4363
+ /** Aria label for a metric cell with no data. */
4364
+ readonly unavailableLabel: "usage.unavailableLabel";
4365
+ /** Supporting label when a token limit follows the cost limit. */
4366
+ readonly followsCostLimitLabel: "usage.followsCostLimitLabel";
4367
+ /** Supporting label when there is no per-deployment token limit. */
4368
+ readonly noLimitLabel: "usage.noLimitLabel";
4369
+ /** Aria label when token usage has no limit but follows the cost limit. Receives `{ used: string }`. */
4370
+ readonly followsCostLimitAriaLabel: "usage.followsCostLimitAriaLabel";
4371
+ /** Aria label when there is no limit. Receives `{ used: string }`. */
4372
+ readonly unlimitedProgressAriaLabel: "usage.unlimitedProgressAriaLabel";
4373
+ /** Aria label for a progress bar with a finite limit. Receives `{ used: string, total: string, percent: number }`. */
4374
+ readonly progressAriaLabel: "usage.progressAriaLabel";
4375
+ /** Label for the spent-cost cell. Receives `{ amount: string }`. */
4376
+ readonly spentLabel: "usage.spentLabel";
4377
+ };
4378
+
3836
4379
  /**
3837
4380
  * Synchronises the active conversation with the conversation list and returns
3838
4381
  * the panel-space id of the active conversation, or `undefined` when none is active.
@@ -3867,6 +4410,25 @@ export declare interface UseActiveConversationSyncParams {
3867
4410
  toPanelConversationId: (id: string) => string;
3868
4411
  }
3869
4412
 
4413
+ /** Loads fresh service statuses without coupling proactive credentials to a live completion. */
4414
+ export declare const useApplicationCredentials: ({ appId, externalServicesClient, offlineCredentialsClient, }: UseApplicationCredentialsParams) => {
4415
+ services: ApplicationExternalServiceDto[];
4416
+ isOfflineConnected: boolean;
4417
+ isLoading: boolean;
4418
+ hasError: boolean;
4419
+ refresh: () => Promise<void>;
4420
+ };
4421
+
4422
+ /** Configured operations for loading application credential metadata. */
4423
+ export declare interface UseApplicationCredentialsParams {
4424
+ /** Application identifier passed through to the configured client. */
4425
+ appId: string;
4426
+ /** Host-configured external-services API. */
4427
+ externalServicesClient: Pick<ExternalServicesApi, 'listExternalServices'>;
4428
+ /** Host-configured offline-credentials API. */
4429
+ offlineCredentialsClient: Pick<OfflineCredentialsApi, 'getOfflineCredentials'>;
4430
+ }
4431
+
3870
4432
  /**
3871
4433
  * Generic single-slot pending / loading / error state machine for
3872
4434
  * confirmation dialogs that trigger an async operation.
@@ -3909,8 +4471,8 @@ export declare const useAttachmentUpload: ({ filesApi, bucket, onNetworkError, d
3909
4471
 
3910
4472
  /** Parameters for {@link useAttachmentUpload}. */
3911
4473
  export declare interface UseAttachmentUploadParams {
3912
- /** Already-configured generated-client instance used to upload the file. */
3913
- filesApi: Pick<FilesApi, 'uploadFile'>;
4474
+ /** Already-configured client; optional listing skips stored names after a conflict. */
4475
+ filesApi: Pick<FilesApi, 'uploadFile'> & Partial<Pick<FilesApi, 'listFiles'>>;
3914
4476
  /** DIAL Core bucket the file is uploaded into. */
3915
4477
  bucket: string | undefined;
3916
4478
  /** Called with batched filenames after a burst of network-error upload failures. */
@@ -3930,12 +4492,14 @@ export declare interface UseAttachmentUploadResult {
3930
4492
  * MIME types, debouncing a burst of rejected files into a single
3931
4493
  * `onValidationError` call rather than firing one per file.
3932
4494
  */
3933
- export declare const useAttachmentValidation: ({ allowedMimeTypes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
4495
+ export declare const useAttachmentValidation: ({ allowedMimeTypes, maxFileSizeBytes, onValidationError, debounceMs, }: UseAttachmentValidationParams) => UseAttachmentValidationResult;
3934
4496
 
3935
4497
  /** Parameters for {@link useAttachmentValidation}. */
3936
4498
  export declare interface UseAttachmentValidationParams {
3937
4499
  /** Resolved MIME types currently allowed for attachments. */
3938
4500
  allowedMimeTypes: string[];
4501
+ /** Maximum attachment file size, in bytes. When omitted, no file is rejected for size. */
4502
+ maxFileSizeBytes?: number;
3939
4503
  /** Called with a structured event when a rejected attachment is reported, at most once per debounce window. */
3940
4504
  onValidationError?: (event: AttachmentValidationErrorEvent) => void;
3941
4505
  /** Debounce window, in ms, before firing `onValidationError` for a rejected file. Defaults to `100`. */
@@ -4336,9 +4900,8 @@ export declare interface UseConversationLookupMapsParams {
4336
4900
  * panel's item contract. All app-specific concerns (icon URL resolution,
4337
4901
  * route generation, id normalisation) are injected via resolver callbacks.
4338
4902
  */
4339
- export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref, resolveTaskBadge, }: UseConversationPanelItemsParams) => {
4340
- showTaskBadge?: boolean | undefined;
4341
- taskBadgeLabel?: string | undefined;
4903
+ export declare const useConversationPanelItems: ({ items, deployments, isDeploymentsLoading, toPanelConversationId, resolveIconUrl, resolveIconTooltip, resolveHref, resolveTaskPresentation, }: UseConversationPanelItemsParams) => {
4904
+ leadingIcon?: ReactNode;
4342
4905
  isUnread?: boolean | undefined;
4343
4906
  id: string;
4344
4907
  title: string;
@@ -4374,11 +4937,12 @@ export declare interface UseConversationPanelItemsResolvers {
4374
4937
  /** Resolves the href to navigate to when the conversation row is clicked. */
4375
4938
  resolveHref: (panelConversationId: string) => string;
4376
4939
  /**
4377
- * Returns badge metadata for a scheduled-task conversation, or `undefined`
4378
- * when the item should not show a task badge.
4940
+ * Returns the row presentation for a scheduled-task conversation — a
4941
+ * host-rendered leading icon that replaces the deployment avatar, and the
4942
+ * unread flag — or `undefined` for an ordinary conversation.
4379
4943
  */
4380
- resolveTaskBadge?: (item: ConversationListItemDto) => {
4381
- label: string;
4944
+ resolveTaskPresentation?: (item: ConversationListItemDto) => {
4945
+ leadingIcon?: ReactNode;
4382
4946
  isUnread: boolean;
4383
4947
  } | undefined;
4384
4948
  }
@@ -4445,7 +5009,7 @@ export declare interface UseConversationSourcesResult {
4445
5009
  uploaded: DisplayAttachment[];
4446
5010
  /** Deduplicated attachments the assistant generated across the conversation. */
4447
5011
  generated: DisplayAttachment[];
4448
- /** Quotation sources referenced by assistant messages, deduplicated by URL. */
5012
+ /** Quotation sources referenced by assistant messages, deduplicated by URL; PDF sources are qualified with `#page=N`. */
4449
5013
  sources: QuotationSource[];
4450
5014
  }
4451
5015
 
@@ -4457,7 +5021,7 @@ export declare interface UseConversationSourcesResult {
4457
5021
  * `transport`/`generation`/`channel`/`overlay` capabilities rather than any
4458
5022
  * app context or `server-api` import.
4459
5023
  */
4460
- export declare const useConversationStream: ({ conversationId, state: { setConversation, conversationRef }, transport, generation: { startGeneration, completeGeneration }, channel, overlay, onStopError, generationConflictMessage, }: UseConversationStreamParams) => UseConversationStreamResult;
5024
+ export declare const useConversationStream: ({ conversationId, state: { setConversation, conversationRef }, transport, generation: { startGeneration, completeGeneration }, channel, overlay, onStopError, generationConflictMessage, generationPersistenceErrorMessage, onStreamError, }: UseConversationStreamParams) => UseConversationStreamResult;
4461
5025
 
4462
5026
  /** Parameters for {@link useConversationStream}. */
4463
5027
  export declare interface UseConversationStreamParams {
@@ -4475,6 +5039,15 @@ export declare interface UseConversationStreamParams {
4475
5039
  * {@link DEFAULT_GENERATION_CONFLICT_MESSAGE}.
4476
5040
  */
4477
5041
  generationConflictMessage?: string;
5042
+ /** Host-translated warning shown when the received answer could not be saved. */
5043
+ generationPersistenceErrorMessage?: string;
5044
+ /**
5045
+ * Receives the original error of every failed stream. The hook shows only
5046
+ * host-supplied or upstream-supplied text on the message bubble and hides
5047
+ * transport detail (e.g. `Failed to fetch`), so this is where the host can
5048
+ * still log or report the raw error.
5049
+ */
5050
+ onStreamError?: (error: Error) => void;
4478
5051
  }
4479
5052
 
4480
5053
  /** Return value of {@link useConversationStream}. */
@@ -4743,11 +5316,11 @@ export declare interface UseDialFileManagerResult {
4743
5316
  * current one becomes excluded. A `fileManagerTabs` of `undefined` means no
4744
5317
  * restriction — every tab in `allTabs` stays enabled and no reset ever fires.
4745
5318
  */
4746
- export declare const useDialFileManagerTabConfig: (activeTab: DialFileManagerTabs, onTabChange: (tab: DialFileManagerTabs) => void, allTabs: TabModel[] | undefined, fileManagerTabs: string[] | undefined) => UseDialFileManagerTabConfigResult;
5319
+ export declare const useDialFileManagerTabConfig: (activeTab: DialFileManagerTabs, onTabChange: (tab: DialFileManagerTabs) => void, allTabs: FilterChipItem<DialFileManagerTabs>[] | undefined, fileManagerTabs: string[] | undefined) => UseDialFileManagerTabConfigResult;
4747
5320
 
4748
5321
  /** Values returned by `useDialFileManagerTabConfig`. */
4749
5322
  export declare interface UseDialFileManagerTabConfigResult {
4750
- tabs: ToolbarOptions['tabs'];
5323
+ tabs: FileTreeOptions['tabs'];
4751
5324
  }
4752
5325
 
4753
5326
  /**
@@ -4936,6 +5509,64 @@ export declare interface UseFavoriteEntitiesStateResult {
4936
5509
  toggleFavorite: (id: string, isFavorite: boolean, entityType?: FavoriteEntityType) => Promise<void>;
4937
5510
  }
4938
5511
 
5512
+ /**
5513
+ * Composes the file-manager tab/listing hooks into the stateful part of an attachment picker:
5514
+ * active tab, selected paths, and hidden-path/MIME/size/folder row eligibility. Returns the
5515
+ * existing `useDialFileManager` controller unchanged and the selection/tab/eligibility fields
5516
+ * `FileManagerAttachModal` already consumes — it composes that modal, it does not replace it.
5517
+ * Final attachment filtering, deduplication, and count enforcement stay owned by the modal.
5518
+ */
5519
+ export declare const useFileAttachmentPicker: ({ fileManagerOptions, bucket, forbiddenSymbolsRegExp, tabLabels, allowedTabs, initialTab, allowedTypes, maxSelectableFileSize, canAttachFolders, }: UseFileAttachmentPickerOptions) => UseFileAttachmentPickerResult;
5520
+
5521
+ /** Options accepted by {@link useFileAttachmentPicker}. */
5522
+ export declare interface UseFileAttachmentPickerOptions {
5523
+ /**
5524
+ * Configured `useDialFileManager` options besides the values this hook derives:
5525
+ * `bucket`, `activeTab`, `rootLabel`, `variant`, and `forbiddenSymbolsRegExp`.
5526
+ */
5527
+ fileManagerOptions: Omit<UseDialFileManagerOptions, 'bucket' | 'activeTab' | 'rootLabel' | 'variant' | 'forbiddenSymbolsRegExp'>;
5528
+ /** DIAL Core bucket to browse. */
5529
+ bucket: string;
5530
+ /** Regexp of characters forbidden in file/folder names, forwarded to `useDialFileManager`. */
5531
+ forbiddenSymbolsRegExp?: RegExp;
5532
+ /** Host-translated label per tab; also supplies the active tab's root-folder label. */
5533
+ tabLabels: Record<DialFileManagerTabs, string>;
5534
+ /** Tab ids the host's configuration allows. `undefined` allows every tab. */
5535
+ allowedTabs?: string[];
5536
+ /** Initial active tab. Defaults to `DialFileManagerTabs.MyFiles`. */
5537
+ initialTab?: DialFileManagerTabs;
5538
+ /** MIME types eligible for selection/upload. Empty or absent allows every type. */
5539
+ allowedTypes?: string[];
5540
+ /** Files at or below this size (bytes) remain eligible; absent allows any size. */
5541
+ maxSelectableFileSize?: number;
5542
+ /** Whether folder rows are eligible for selection. Defaults to `false`. */
5543
+ canAttachFolders?: boolean;
5544
+ }
5545
+
5546
+ /** Result returned by {@link useFileAttachmentPicker}. */
5547
+ export declare interface UseFileAttachmentPickerResult {
5548
+ /** The composed file-manager controller; forward to `FileManagerAttachModal`'s `controller` prop. */
5549
+ controller: UseDialFileManagerResult;
5550
+ /** Active tab. */
5551
+ activeTab: DialFileManagerTabs;
5552
+ /** Tab list filtered to `allowedTabs`; forward to `FileManagerAttachModal`'s `tabs` prop. */
5553
+ tabs: FileTreeOptions['tabs'];
5554
+ /** Switches the active tab and clears the current selection. */
5555
+ onTabChange: (tab: DialFileManagerTabs) => void;
5556
+ /** Currently selected paths. */
5557
+ selectedPaths: Set<string>;
5558
+ /** Replaces the selection with a defensive copy of the given set. */
5559
+ onSelectedPathsChange: (paths: Set<string>) => void;
5560
+ /** Row eligibility predicate; forward to `FileManagerAttachModal`'s `isRowSelectable` prop. */
5561
+ isRowSelectable: (node: {
5562
+ data?: FileManagerSelectableNode | null;
5563
+ }) => boolean;
5564
+ /** MIME eligibility predicate; forward to `FileManagerAttachModal`'s `isFileTypeAllowed` prop. */
5565
+ isFileTypeAllowed: (contentType: string) => boolean;
5566
+ /** Accepted upload MIME types; forward to `FileManagerAttachModal`'s `allowedFileTypes` prop. */
5567
+ allowedFileTypes: DialFileAcceptType[] | undefined;
5568
+ }
5569
+
4939
5570
  export { useGridEditingScroll }
4940
5571
 
4941
5572
  export { UseGridEditingScrollOptions }
@@ -4979,10 +5610,11 @@ export declare interface UseImportFilePickerResult {
4979
5610
  * Builds the `McpAppHostAdapter` a host injects into `@epam/ai-dial-mcp-apps`'s
4980
5611
  * hooks/components, wiring the library's host-context/tool-call/resource-fetch
4981
5612
  * contract to a configured `McpAppsApiClient` and this app's theme/locale/config
4982
- * values (`hostContextParams`, `sandboxUrl`) — this hook itself never reads app
4983
- * context, so a host builds those values wherever it already has them.
5613
+ * values (`hostContextParams`, `sandboxUrl`), plus the host's own identity
5614
+ * (`hostInfo`) — this hook itself never reads app context, so a host builds
5615
+ * those values wherever it already has them.
4984
5616
  */
4985
- export declare const useMcpAppHostAdapter: (displayMode: "inline" | "fullscreen", client: McpAppsApiClient, sandboxUrl: string | null, hostContextParams: McpAppHostContextParams) => McpAppHostAdapter;
5617
+ export declare const useMcpAppHostAdapter: (displayMode: "inline" | "fullscreen", client: McpAppsApiClient, sandboxUrl: string | null, hostContextParams: McpAppHostContextParams, hostInfo: Implementation) => McpAppHostAdapter;
4986
5618
 
4987
5619
  /**
4988
5620
  * Builds the `McpUiHostContext` delivered to a mounted MCP App during its
@@ -5085,8 +5717,6 @@ export declare const useOpenMcpAppCanvas: (cache: McpAppResponseCache, hostAdapt
5085
5717
 
5086
5718
  /** User-facing text `useOpenMcpAppCanvas` needs but cannot resolve itself — a lib must not call `t()`. */
5087
5719
  export declare interface UseOpenMcpAppCanvasLabels {
5088
- /** Canvas panel title while an MCP App is loading or open. */
5089
- title: string;
5090
5720
  /** Error label shown when the resource fetch is forbidden (HTTP 403). */
5091
5721
  forbiddenErrorLabel: string;
5092
5722
  /** Error label shown for any other resource-load/tool-call failure. */
@@ -5224,6 +5854,50 @@ export declare interface UsePublishFoldersResult {
5224
5854
  hasPublishWriteAccess: (folderPath: string[]) => boolean;
5225
5855
  }
5226
5856
 
5857
+ /** Shared, cancellation-safe pagination for one schedule's run history. */
5858
+ export declare const useScheduledTaskRuns: (client: ScheduledTasksApiClient, { scheduleId, enabled, pageSize }: UseScheduledTaskRunsOptions) => {
5859
+ items: ScheduledTaskRunDto[];
5860
+ isLoading: boolean;
5861
+ isLoadingMore: boolean;
5862
+ initialError: Error | null;
5863
+ loadMoreError: Error | null;
5864
+ hasMore: boolean;
5865
+ loadMore: () => void;
5866
+ retryLoadMore: () => void;
5867
+ refetch: () => void;
5868
+ };
5869
+
5870
+ export declare interface UseScheduledTaskRunsOptions {
5871
+ scheduleId: string;
5872
+ enabled?: boolean;
5873
+ pageSize?: number;
5874
+ }
5875
+
5876
+ /** Shared scheduler-list lifecycle with generation-scoped stale-response guards. */
5877
+ export declare const useScheduledTasks: (client: ScheduledTasksApiClient, { enabled, pageSize, debounceMs, initialSearch, initialSort, }?: UseScheduledTasksOptions) => {
5878
+ items: ScheduledTaskDto[];
5879
+ searchQuery: string;
5880
+ setSearchQuery: Dispatch<SetStateAction<string>>;
5881
+ sortKey: "firstToRun" | "lastToRun" | "newest" | "nameAZ";
5882
+ setSortKey: Dispatch<SetStateAction<"firstToRun" | "lastToRun" | "newest" | "nameAZ">>;
5883
+ isLoading: boolean;
5884
+ isLoadingMore: boolean;
5885
+ initialError: Error | null;
5886
+ loadMoreError: Error | null;
5887
+ hasMore: boolean;
5888
+ loadMore: () => void;
5889
+ retryLoadMore: () => void;
5890
+ refetch: () => void;
5891
+ };
5892
+
5893
+ export declare interface UseScheduledTasksOptions {
5894
+ enabled?: boolean;
5895
+ pageSize?: number;
5896
+ debounceMs?: number;
5897
+ initialSearch?: string;
5898
+ initialSort?: ListScheduledTasksSortEnum;
5899
+ }
5900
+
5227
5901
  /**
5228
5902
  * Resolves and manages share-link data for a DIAL Core resource.
5229
5903
  *
@@ -5264,6 +5938,46 @@ export declare interface UseShareRecipientsCountResult {
5264
5938
  invalidateRecipientsCount: (itemId: string) => void;
5265
5939
  }
5266
5940
 
5941
+ /**
5942
+ * Headless controller for the skill-archive upload flow: dialog visibility, the exact-filename
5943
+ * precheck, in-flight exclusion, and import completion. The host supplies the configured request
5944
+ * and observes completion/failure through the injected callbacks; the hook never imports app
5945
+ * contexts, i18n, or a configured API client.
5946
+ */
5947
+ export declare const useSkillArchiveImport: <TResult>({ importArchive, onImported, onError, manifestFileName, }: UseSkillArchiveImportOptions<TResult>) => UseSkillArchiveImportResult;
5948
+
5949
+ /** Options accepted by {@link useSkillArchiveImport}. */
5950
+ export declare interface UseSkillArchiveImportOptions<TResult> {
5951
+ /** Submits the selected archive; the host owns request configuration and the client. */
5952
+ importArchive: (file: File) => Promise<TResult>;
5953
+ /** Called once after a successful import (and any awaited host follow-up) settles. */
5954
+ onImported: (result: TResult) => void | Promise<void>;
5955
+ /** Called once when the import request, or the host's follow-up in {@link onImported}, fails. */
5956
+ onError: (error: unknown, kind: SkillArchiveImportErrorKind) => void;
5957
+ /** Exact filename treated as the skill manifest. Defaults to `'SKILL.md'`. */
5958
+ manifestFileName?: string;
5959
+ }
5960
+
5961
+ /** Result returned by {@link useSkillArchiveImport}. */
5962
+ export declare interface UseSkillArchiveImportResult {
5963
+ /** Whether the upload dialog is open. */
5964
+ isDialogOpen: boolean;
5965
+ /** Current phase of the import. */
5966
+ status: SkillArchiveImportStatus;
5967
+ /** Reason the current/last selection was rejected locally; `undefined` once cleared. */
5968
+ selectionRejectionReason: SkillArchiveSelectionRejectionReason | undefined;
5969
+ /** Classified failure of the last import request; `undefined` outside a request failure. */
5970
+ errorKind: SkillArchiveImportErrorKind | undefined;
5971
+ /** Opens the dialog, unless an import is already in flight. */
5972
+ openDialog: () => void;
5973
+ /** Closes the dialog and clears any rejection reason. */
5974
+ closeDialog: () => void;
5975
+ /** Wire to the dialog drop zone's `onChange`. */
5976
+ handleFilesSelected: (files: File[]) => void;
5977
+ /** Wire to the dialog drop zone's `onReject`. */
5978
+ handleFilesRejected: () => void;
5979
+ }
5980
+
5267
5981
  /**
5268
5982
  * Headless data pipeline behind a skill details side panel: resolves the
5269
5983
  * selected skill from the listings, maps it to a catalog item with its
@@ -5365,7 +6079,7 @@ export declare interface UseSkillEditorLoadResult {
5365
6079
  * `client.createSkill`/`client.updateSkill`, and mapping the resulting
5366
6080
  * success/error/conflict outcomes to presentable state.
5367
6081
  */
5368
- export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
6082
+ export declare const useSkillEditorSubmit: ({ bucket, isEditMode, files, filesContentRef, frontmatterRef, loadedPathRef, etagRef, returnUrl, getCreateReturnUrl, refetchSkills, client, messages, onNavigate, onNotify, }: UseSkillEditorSubmitParams) => UseSkillEditorSubmitResult;
5369
6083
 
5370
6084
  /** Parameters accepted by {@link useSkillEditorSubmit}. */
5371
6085
  export declare interface UseSkillEditorSubmitParams {
@@ -5385,6 +6099,8 @@ export declare interface UseSkillEditorSubmitParams {
5385
6099
  etagRef: React.MutableRefObject<string | undefined>;
5386
6100
  /** Where to navigate on a successful save. */
5387
6101
  returnUrl: string;
6102
+ /** Resolves the destination after creation from the normalized skill path. Defaults to `returnUrl`. */
6103
+ getCreateReturnUrl?: (path: string) => string;
5388
6104
  /** Refetches the host's skill listing after a successful save. */
5389
6105
  refetchSkills: () => Promise<void>;
5390
6106
  /** Already-configured create/update operations. */
@@ -5405,6 +6121,10 @@ export declare interface UseSkillEditorSubmitResult {
5405
6121
  errors: SkillEditorErrors;
5406
6122
  /** General submit-time error, distinct from a stale-edit `conflict`. */
5407
6123
  submitError: string | undefined;
6124
+ /** Whether `submitError` was caused by something a plain re-send can clear, rather than by the submission itself. */
6125
+ isSubmitErrorRetryable: boolean;
6126
+ /** Re-submits the values of the attempt that produced `submitError`. No-op before the first submit. */
6127
+ retrySubmit: () => void;
5408
6128
  /** Present when the last save hit a stale-ETag conflict. */
5409
6129
  conflict: {
5410
6130
  message: string;
@@ -5413,6 +6133,12 @@ export declare interface UseSkillEditorSubmitResult {
5413
6133
  clearConflict: () => void;
5414
6134
  /** Validates and submits the given form values. */
5415
6135
  handleSubmit: (values: SkillEditorValues) => Promise<void>;
6136
+ /**
6137
+ * Re-runs the Instructions frontmatter check against the editor's current
6138
+ * values, so a pasted `SKILL.md` is flagged as the text lands rather than
6139
+ * only on submit. Pass as the editor's `onValuesChange`.
6140
+ */
6141
+ handleValuesChange: (values: SkillEditorValues) => void;
5416
6142
  }
5417
6143
 
5418
6144
  /**
@@ -5491,10 +6217,11 @@ export declare interface UseSkillFilePreviewResult {
5491
6217
 
5492
6218
  /**
5493
6219
  * Headless hook that encapsulates skill detail fetching: manifest download and
5494
- * parse, package file listing, overview construction, and in-package file
5495
- * loads. `useCatalogItemDetails` delegates its skill branch here; hosts that
5496
- * only surface skill details consume this hook directly, without the
5497
- * deployment and prompt ports the full catalog pipeline requires.
6220
+ * parse, package file listing, authoritative metadata fetching, overview
6221
+ * construction, and in-package file loads. `useCatalogItemDetails` delegates
6222
+ * its skill branch here; hosts that only surface skill details consume this
6223
+ * hook directly, without the deployment and prompt ports the full catalog
6224
+ * pipeline requires.
5498
6225
  */
5499
6226
  export declare const useSkillItemDetails: ({ api, skills, skillOverviewLabels, }: UseSkillItemDetailsOptions) => UseSkillItemDetailsResult;
5500
6227