@epam/ai-dial-chat-hooks 1.2.0-dev.99 → 1.3.0-dev.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (84) hide show
  1. package/api-error/api-error.js +7 -4
  2. package/catalog/catalog-derivations.js +1 -1
  3. package/catalog/deployment-id.js +8 -2
  4. package/catalog/map-deployment-limits-to-catalog.js +16 -24
  5. package/catalog/map-deployment-limits-to-input.js +81 -9
  6. package/catalog/map-deployment-to-catalog-item.js +34 -34
  7. package/catalog/map-entity-details-to-catalog.js +237 -192
  8. package/catalog/map-skill-to-catalog-item.js +61 -54
  9. package/catalog/publish.js +4 -4
  10. package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
  11. package/catalog/useCatalogItemDetails.js +9 -8
  12. package/catalog/usePublishFolders/usePublishFolders.js +1 -1
  13. package/catalog.d.ts +171 -34
  14. package/catalog.js +23 -23
  15. package/conversation/conversation-transfer/export-conversation.js +24 -16
  16. package/conversation/conversation-transfer/import-conversation.js +80 -31
  17. package/conversation/create-chat-stream-api.js +89 -49
  18. package/conversation/get-model-id-from-conversation-id.js +15 -9
  19. package/conversation/message-utils.js +44 -2
  20. package/conversation/stage.js +6 -2
  21. package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
  22. package/conversation/useConversationExport/useConversationExport.js +9 -9
  23. package/conversation/useConversationHandlers/message-utils.js +8 -5
  24. package/conversation/useConversationHandlers/useConversationHandlers.js +181 -167
  25. package/conversation/useConversationImport/useConversationImport.js +123 -121
  26. package/conversation/useConversationPanelItems/useConversationPanelItems.js +49 -31
  27. package/conversation/useConversationStream/frame-scheduler.js +39 -0
  28. package/conversation/useConversationStream/generation-resume.js +122 -64
  29. package/conversation/useConversationStream/useConversationStream.js +298 -118
  30. package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
  31. package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
  32. package/conversation-sources.d.ts +1 -1
  33. package/conversation-transfer.d.ts +2 -1
  34. package/conversation.d.ts +218 -22
  35. package/conversation.js +32 -31
  36. package/file-manager-canvas.d.ts +27 -7
  37. package/file-manager.d.ts +87 -32
  38. package/file-manager.js +25 -24
  39. package/files/attachment-canvas.js +67 -44
  40. package/files/dial-file-manager-copy-move.util.js +9 -8
  41. package/files/dial-file-manager-mapping.util.js +2 -1
  42. package/files/dial-file-manager-path.util.js +24 -2
  43. package/files/dial-file-manager.model.js +23 -19
  44. package/files/dial-file-manager.types.js +3 -3
  45. package/files/file-manager-variant.js +1 -1
  46. package/files/resolve-dial-file-api-path.js +11 -12
  47. package/files/useDialFileListing/useDialFileListing.js +140 -127
  48. package/files/useDialFileManager/useDialFileManager.js +139 -135
  49. package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
  50. package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -15
  51. package/files/useDialFileMutations/useDialFileMutations.js +65 -60
  52. package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
  53. package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +28 -23
  54. package/index.d.ts +643 -128
  55. package/index.js +136 -134
  56. package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
  57. package/oauth/authorize-url.js +3 -3
  58. package/oauth/toolset-id.js +5 -3
  59. package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
  60. package/oauth.d.ts +34 -2
  61. package/oauth.js +9 -9
  62. package/package.json +19 -23
  63. package/scheduled-task/scheduled-task-description.js +43 -39
  64. package/scheduled-task/scheduled-task-trigger.js +74 -71
  65. package/scheduled-task/use-scheduled-task-runs.js +162 -50
  66. package/scheduled-task/use-scheduled-tasks.js +52 -48
  67. package/scheduled-tasks.d.ts +27 -6
  68. package/scheduled-tasks.js +2 -2
  69. package/shared/application-schema.js +5 -2
  70. package/shared/cron-day-of-month.js +13 -0
  71. package/skill/skill-archive.js +19 -0
  72. package/skill/skill-types.js +8 -7
  73. package/skill/skill.js +52 -29
  74. package/skill/useSkillArchiveImport/useSkillArchiveImport.js +38 -34
  75. package/skill/useSkillEditorLoad.js +65 -59
  76. package/skill/useSkillEditorSubmit.js +105 -93
  77. package/skill/useSkillFileActions.js +70 -58
  78. package/skill-editor.d.ts +62 -13
  79. package/skill-editor.js +9 -9
  80. package/usage/map-user-usage-to-model-limits.js +137 -95
  81. package/usage.d.ts +8 -3
  82. package/usePageFileDrag/usePageFileDrag.js +3 -3
  83. package/utils.d.ts +26 -6
  84. package/utils.js +10 -10
package/utils.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { DeploymentCreationFormLocaleEntry } from '@epam/ai-dial-builder-form';
2
- import { DeploymentCreationFormLocaleOption } from '@epam/ai-dial-builder-form';
3
1
  import { ExportFolder } from '@epam/ai-dial-chat-shared';
2
+ import { LocaleOption } from '@epam/ai-dial-chat-shared';
4
3
  import { LocaleTextEntryDto } from '@epam/ai-dial-chat-api-client';
4
+ import { LocalizedTextEntry } from '@epam/ai-dial-chat-shared';
5
5
  import { Middleware } from '@epam/ai-dial-chat-api-client';
6
6
  import { PromptFolderResponseDto } from '@epam/ai-dial-chat-api-client';
7
7
  import { PromptListResponseDto } from '@epam/ai-dial-chat-api-client';
@@ -10,12 +10,24 @@ import { UserLimitStatsResponseDto } from '@epam/ai-dial-chat-api-client';
10
10
 
11
11
  /** Normalized shape returned by {@link getApiErrorDetails}. */
12
12
  export declare interface ApiErrorDetails {
13
+ /** Stable domain error code supplied by the API, when present. */
14
+ code?: string;
13
15
  /** HTTP status code carried by the error, when available. */
14
16
  status?: number;
15
17
  /** Resolved human-readable error message, or `null` when none could be resolved. */
16
18
  message: string | null;
17
19
  /** Extracted W3C trace ID, when the error's response carries a valid `traceparent`. */
18
20
  traceId?: string;
21
+ /**
22
+ * Error code reported by the service behind the API, when the API forwards one
23
+ * (`upstreamCode`). Passed through as-is; the host decides whether to act on it.
24
+ */
25
+ upstreamCode?: string;
26
+ /**
27
+ * Error reason reported by the service behind the API, when the API forwards one
28
+ * (`upstreamMessage`). Untranslated; the host decides whether to display it.
29
+ */
30
+ upstreamMessage?: string;
19
31
  }
20
32
 
21
33
  /** Appends a locale's uppercased code to a field label, e.g. `'Name [EN]'`. */
@@ -29,7 +41,7 @@ export declare const apSchedulerDayToJsDay: (apSchedulerDay: number) => number;
29
41
  * `additionalLocaleCodes` and excluding whichever code is already the
30
42
  * primary Name/Description field.
31
43
  */
32
- export declare const buildAdditionalLocaleOptions: (additionalLocaleCodes: string[], primaryLocale: string) => DeploymentCreationFormLocaleOption[];
44
+ export declare const buildAdditionalLocaleOptions: (additionalLocaleCodes: string[], primaryLocale: string) => LocaleOption[];
33
45
 
34
46
  /** Reconstructs the exact scope id Core expects as `ResourceSignInRequest`/`ResourceSignOutRequest`'s `url` field. */
35
47
  export declare const buildExternalServiceScopeId: (appId: string, serviceName: string) => string;
@@ -52,7 +64,7 @@ export declare const buildPromptPath: (folderId: string, name: string) => string
52
64
  * `undefined` (not `[]`) when nothing remains, so a request untouched by
53
65
  * this feature stays byte-identical to today.
54
66
  */
55
- export declare const composeLocalePayload: (otherLocales: DeploymentCreationFormLocaleEntry[], primaryLocale: string) => LocaleTextEntryDto[] | undefined;
67
+ export declare const composeLocalePayload: (otherLocales: LocalizedTextEntry[], primaryLocale: string) => LocaleTextEntryDto[] | undefined;
56
68
 
57
69
  /**
58
70
  * Builds a generated-client `Middleware` that attaches `X-CSRF-Token` on every
@@ -113,7 +125,7 @@ export declare type CsrfRefreshOutcome = {
113
125
  * present in either map, excluding `primaryLocale` — that key is already the
114
126
  * primary Name/Description field, not a row in the popup.
115
127
  */
116
- export declare const decomposeLocalizedFields: (displayName: LocalizedText | undefined, description: LocalizedText | undefined, primaryLocale: string) => DeploymentCreationFormLocaleEntry[];
128
+ export declare const decomposeLocalizedFields: (displayName: LocalizedText | undefined, description: LocalizedText | undefined, primaryLocale: string) => LocalizedTextEntry[];
117
129
 
118
130
  /** A prompt record as it appears inside a downloaded prompt file. */
119
131
  export declare interface ExportedPrompt {
@@ -132,7 +144,7 @@ export declare interface ExportedPrompt {
132
144
  /** Formats a Unix timestamp (ms) as a locale-formatted calendar date, e.g. `'22/7/2026'`. */
133
145
  export declare const formatCalendarDate: (timestampMs: number) => string;
134
146
 
135
- /** Normalizes any API error into a `{ status?, message, traceId? }` shape. */
147
+ /** Normalizes any API error into a `{ status?, message, traceId?, code?, upstreamCode?, upstreamMessage? }` shape. */
136
148
  export declare const getApiErrorDetails: (error: unknown) => Promise<ApiErrorDetails>;
137
149
 
138
150
  /** Resolves a human-readable message from an API error's response body, or falls back to `Error.message`. */
@@ -162,6 +174,9 @@ export declare const getExternalServiceFallbackName: (serviceName: string) => st
162
174
  */
163
175
  export declare const getRemainingCharacters: (value: string, maxLength: number) => number | null;
164
176
 
177
+ /** Returns the schemas that create schema-based apps: unique by id, without id-less entries or the custom-app schema. */
178
+ export declare const getRunnerSchemas: <T extends QuickAppSchemaLike>(schemas: T[]) => RunnerSchema<T>[];
179
+
165
180
  /** Case-insensitive substring match. */
166
181
  export declare const includesIgnoreCase: (str: string, query: string) => boolean;
167
182
 
@@ -285,6 +300,11 @@ export declare interface QuickAppSchemaLike {
285
300
  */
286
301
  export declare const resolveLocalizedText: (value: LocalizedText | undefined | null, activeLocale: string, primaryLocale: string) => string;
287
302
 
303
+ /** An application schema with a resolved id, as returned by {@link getRunnerSchemas}. */
304
+ export declare type RunnerSchema<T extends QuickAppSchemaLike> = T & {
305
+ id: string;
306
+ };
307
+
288
308
  /** Decodes a URI-encoded path segment, returning the original string if decoding fails. */
289
309
  export declare const safeDecodeURI: (path: string) => string;
290
310
 
package/utils.js CHANGED
@@ -5,13 +5,13 @@ import { includesIgnoreCase as o, safeDecodeURI as s, safeDecodeURIComponent as
5
5
  import { appendLocaleCode as d, buildAdditionalLocaleOptions as f, composeLocalePayload as p, decomposeLocalizedFields as m, resolveLocalizedText as h, toBaseLocale as g } from "./shared/locale.js";
6
6
  import { formatCalendarDate as _, padTwoDigits as v } from "./shared/formatting.js";
7
7
  import { PromptSource as y, parsePromptResourceUrl as b } from "./prompt/prompt-resource.js";
8
- import { buildPromptExportEnvelope as x, buildPromptExportFileName as S, serializePromptExport as C } from "./prompt/export-prompt.js";
9
- import { PROMPT_CONTENT_MAX_LENGTH as w, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as T, PROMPT_DESCRIPTION_MAX_LENGTH as E, PROMPT_NAME_MAX_LENGTH as D, PromptFieldError as O, buildPromptPath as k, getRemainingCharacters as A, validatePromptContent as j, validatePromptDescription as M, validatePromptName as N } from "./prompt/prompt.js";
10
- import { usePromptsState as P } from "./prompt/usePromptsState/usePromptsState.js";
11
- import { apSchedulerDayToJsDay as F, jsDayToApSchedulerDay as I } from "./shared/cron-weekday.js";
12
- import { isCustomAppSchema as L, isQuickAppSchema as R } from "./shared/application-schema.js";
13
- import { getBrowserTimezone as z } from "./shared/browser-timezone.js";
14
- import { isValidAbsoluteUrl as B, isValidFeaturesData as V, parseFeaturesData as H } from "./shared/custom-apps.js";
15
- import { buildExternalServiceScopeId as U, getExternalServiceFallbackName as W, parseExternalServiceUrl as G } from "./shared/external-services.js";
16
- import { useUsageData as K } from "./usage/useUsageData/useUsageData.js";
17
- export { w as PROMPT_CONTENT_MAX_LENGTH, T as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, E as PROMPT_DESCRIPTION_MAX_LENGTH, D as PROMPT_NAME_MAX_LENGTH, O as PromptFieldError, y as PromptSource, F as apSchedulerDayToJsDay, d as appendLocaleCode, f as buildAdditionalLocaleOptions, U as buildExternalServiceScopeId, x as buildPromptExportEnvelope, S as buildPromptExportFileName, k as buildPromptPath, p as composeLocalePayload, i as createCsrfMiddleware, a as createUnauthorizedMiddleware, m as decomposeLocalizedFields, _ as formatCalendarDate, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, z as getBrowserTimezone, W as getExternalServiceFallbackName, A as getRemainingCharacters, o as includesIgnoreCase, r as isConversationNotFoundError, L as isCustomAppSchema, R as isQuickAppSchema, B as isValidAbsoluteUrl, V as isValidFeaturesData, I as jsDayToApSchedulerDay, v as padTwoDigits, G as parseExternalServiceUrl, H as parseFeaturesData, b as parsePromptResourceUrl, h as resolveLocalizedText, s as safeDecodeURI, c as safeDecodeURIComponent, C as serializePromptExport, l as stripSurroundingSlashes, u as stripTrailingSlashes, g as toBaseLocale, P as usePromptsState, K as useUsageData, j as validatePromptContent, M as validatePromptDescription, N as validatePromptName };
8
+ import { getRunnerSchemas as x, isCustomAppSchema as S, isQuickAppSchema as C } from "./shared/application-schema.js";
9
+ import { buildPromptExportEnvelope as w, buildPromptExportFileName as T, serializePromptExport as E } from "./prompt/export-prompt.js";
10
+ import { PROMPT_CONTENT_MAX_LENGTH as D, PROMPT_COUNTER_ANNOUNCE_THRESHOLD as O, PROMPT_DESCRIPTION_MAX_LENGTH as k, PROMPT_NAME_MAX_LENGTH as A, PromptFieldError as j, buildPromptPath as M, getRemainingCharacters as N, validatePromptContent as P, validatePromptDescription as F, validatePromptName as I } from "./prompt/prompt.js";
11
+ import { usePromptsState as L } from "./prompt/usePromptsState/usePromptsState.js";
12
+ import { apSchedulerDayToJsDay as R, jsDayToApSchedulerDay as z } from "./shared/cron-weekday.js";
13
+ import { getBrowserTimezone as B } from "./shared/browser-timezone.js";
14
+ import { isValidAbsoluteUrl as V, isValidFeaturesData as H, parseFeaturesData as U } from "./shared/custom-apps.js";
15
+ import { buildExternalServiceScopeId as W, getExternalServiceFallbackName as G, parseExternalServiceUrl as K } from "./shared/external-services.js";
16
+ import { useUsageData as q } from "./usage/useUsageData/useUsageData.js";
17
+ export { D as PROMPT_CONTENT_MAX_LENGTH, O as PROMPT_COUNTER_ANNOUNCE_THRESHOLD, k as PROMPT_DESCRIPTION_MAX_LENGTH, A as PROMPT_NAME_MAX_LENGTH, j as PromptFieldError, y as PromptSource, R as apSchedulerDayToJsDay, d as appendLocaleCode, f as buildAdditionalLocaleOptions, W as buildExternalServiceScopeId, w as buildPromptExportEnvelope, T as buildPromptExportFileName, M as buildPromptPath, p as composeLocalePayload, i as createCsrfMiddleware, a as createUnauthorizedMiddleware, m as decomposeLocalizedFields, _ as formatCalendarDate, e as getApiErrorDetails, t as getApiErrorMessage, n as getApiErrorStatus, B as getBrowserTimezone, G as getExternalServiceFallbackName, N as getRemainingCharacters, x as getRunnerSchemas, o as includesIgnoreCase, r as isConversationNotFoundError, S as isCustomAppSchema, C as isQuickAppSchema, V as isValidAbsoluteUrl, H as isValidFeaturesData, z as jsDayToApSchedulerDay, v as padTwoDigits, K as parseExternalServiceUrl, U as parseFeaturesData, b as parsePromptResourceUrl, h as resolveLocalizedText, s as safeDecodeURI, c as safeDecodeURIComponent, E as serializePromptExport, l as stripSurroundingSlashes, u as stripTrailingSlashes, g as toBaseLocale, L as usePromptsState, q as useUsageData, P as validatePromptContent, F as validatePromptDescription, I as validatePromptName };