@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.
- package/api-error/api-error.js +7 -4
- package/catalog/catalog-derivations.js +1 -1
- package/catalog/deployment-id.js +8 -2
- package/catalog/map-deployment-limits-to-catalog.js +16 -24
- package/catalog/map-deployment-limits-to-input.js +81 -9
- package/catalog/map-deployment-to-catalog-item.js +34 -34
- package/catalog/map-entity-details-to-catalog.js +237 -192
- package/catalog/map-skill-to-catalog-item.js +61 -54
- package/catalog/publish.js +4 -4
- package/catalog/useCatalogEditNavigation/useCatalogEditNavigation.js +122 -101
- package/catalog/useCatalogItemDetails.js +9 -8
- package/catalog/usePublishFolders/usePublishFolders.js +1 -1
- package/catalog.d.ts +171 -34
- package/catalog.js +23 -23
- package/conversation/conversation-transfer/export-conversation.js +24 -16
- package/conversation/conversation-transfer/import-conversation.js +80 -31
- package/conversation/create-chat-stream-api.js +89 -49
- package/conversation/get-model-id-from-conversation-id.js +15 -9
- package/conversation/message-utils.js +44 -2
- package/conversation/stage.js +6 -2
- package/conversation/useActiveConversationSync/useActiveConversationSync.js +7 -8
- package/conversation/useConversationExport/useConversationExport.js +9 -9
- package/conversation/useConversationHandlers/message-utils.js +8 -5
- package/conversation/useConversationHandlers/useConversationHandlers.js +181 -167
- package/conversation/useConversationImport/useConversationImport.js +123 -121
- package/conversation/useConversationPanelItems/useConversationPanelItems.js +49 -31
- package/conversation/useConversationStream/frame-scheduler.js +39 -0
- package/conversation/useConversationStream/generation-resume.js +122 -64
- package/conversation/useConversationStream/useConversationStream.js +298 -118
- package/conversation/useMessageSelectionReply/useMessageSelectionReply.js +189 -0
- package/conversation-sources/useConversationSources/useConversationSources.js +31 -24
- package/conversation-sources.d.ts +1 -1
- package/conversation-transfer.d.ts +2 -1
- package/conversation.d.ts +218 -22
- package/conversation.js +32 -31
- package/file-manager-canvas.d.ts +27 -7
- package/file-manager.d.ts +87 -32
- package/file-manager.js +25 -24
- package/files/attachment-canvas.js +67 -44
- package/files/dial-file-manager-copy-move.util.js +9 -8
- package/files/dial-file-manager-mapping.util.js +2 -1
- package/files/dial-file-manager-path.util.js +24 -2
- package/files/dial-file-manager.model.js +23 -19
- package/files/dial-file-manager.types.js +3 -3
- package/files/file-manager-variant.js +1 -1
- package/files/resolve-dial-file-api-path.js +11 -12
- package/files/useDialFileListing/useDialFileListing.js +140 -127
- package/files/useDialFileManager/useDialFileManager.js +139 -135
- package/files/useDialFileManagerSections/useDialFileManagerSections.js +155 -0
- package/files/useDialFileManagerTabConfig/useDialFileManagerTabConfig.js +20 -15
- package/files/useDialFileMutations/useDialFileMutations.js +65 -60
- package/files/useDialFileUploadBatch/useDialFileUploadBatch.js +117 -110
- package/files/useFileAttachmentPicker/useFileAttachmentPicker.js +28 -23
- package/index.d.ts +643 -128
- package/index.js +136 -134
- package/mcp-apps/useMcpAppTools/useMcpAppTools.js +1 -1
- package/oauth/authorize-url.js +3 -3
- package/oauth/toolset-id.js +5 -3
- package/oauth/useToolsetLogin/useToolsetLogin.js +8 -8
- package/oauth.d.ts +34 -2
- package/oauth.js +9 -9
- package/package.json +19 -23
- package/scheduled-task/scheduled-task-description.js +43 -39
- package/scheduled-task/scheduled-task-trigger.js +74 -71
- package/scheduled-task/use-scheduled-task-runs.js +162 -50
- package/scheduled-task/use-scheduled-tasks.js +52 -48
- package/scheduled-tasks.d.ts +27 -6
- package/scheduled-tasks.js +2 -2
- package/shared/application-schema.js +5 -2
- package/shared/cron-day-of-month.js +13 -0
- package/skill/skill-archive.js +19 -0
- package/skill/skill-types.js +8 -7
- package/skill/skill.js +52 -29
- package/skill/useSkillArchiveImport/useSkillArchiveImport.js +38 -34
- package/skill/useSkillEditorLoad.js +65 -59
- package/skill/useSkillEditorSubmit.js +105 -93
- package/skill/useSkillFileActions.js +70 -58
- package/skill-editor.d.ts +62 -13
- package/skill-editor.js +9 -9
- package/usage/map-user-usage-to-model-limits.js +137 -95
- package/usage.d.ts +8 -3
- package/usePageFileDrag/usePageFileDrag.js +3 -3
- package/utils.d.ts +26 -6
- package/utils.js +10 -10
package/catalog.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { ApplicationExternalServiceDto } from '@epam/ai-dial-chat-api-client';
|
|
2
|
+
import { ApplicationSchemaSummaryDto } from '@epam/ai-dial-chat-api-client';
|
|
2
3
|
import { CatalogContentTreeNode } from '@epam/ai-dial-catalog';
|
|
4
|
+
import { CatalogCreateSearch } from '@epam/ai-dial-catalog';
|
|
3
5
|
import { CatalogEntityType } from '@epam/ai-dial-chat-shared';
|
|
4
6
|
import { CatalogItem } from '@epam/ai-dial-catalog';
|
|
5
7
|
import { CatalogItemApiDetails } from '@epam/ai-dial-catalog';
|
|
@@ -16,6 +18,7 @@ import { DialToolsetAuthSettingsDto } from '@epam/ai-dial-chat-api-client';
|
|
|
16
18
|
import { DialToolsetDto } from '@epam/ai-dial-chat-api-client';
|
|
17
19
|
import { DropdownItem } from '@epam/ai-dial-ui-kit';
|
|
18
20
|
import { ExternalServicesApi } from '@epam/ai-dial-chat-api-client';
|
|
21
|
+
import { LimitStatsDto } from '@epam/ai-dial-chat-api-client';
|
|
19
22
|
import { ListFilesResponseDto } from '@epam/ai-dial-chat-api-client';
|
|
20
23
|
import { NotificationVariant } from '@epam/ai-dial-ui-kit';
|
|
21
24
|
import { OfflineCredentialsApi } from '@epam/ai-dial-chat-api-client';
|
|
@@ -35,6 +38,7 @@ import { ToolsetLoginBodyDto } from '@epam/ai-dial-chat-api-client';
|
|
|
35
38
|
import { ToolsetLogoutBodyDto } from '@epam/ai-dial-chat-api-client';
|
|
36
39
|
import { UnpublishCatalogEntityDto } from '@epam/ai-dial-chat-api-client';
|
|
37
40
|
import { UnpublishResultDto } from '@epam/ai-dial-chat-api-client';
|
|
41
|
+
import { UsageLimitProgressRow } from '@epam/ai-dial-catalog';
|
|
38
42
|
|
|
39
43
|
/** Feature-support flags for an agent (application) deployment. */
|
|
40
44
|
export declare interface AgentCapabilities {
|
|
@@ -50,6 +54,7 @@ export declare interface AgentCapabilities {
|
|
|
50
54
|
hasConfiguration?: boolean;
|
|
51
55
|
hasChatCompletion?: boolean;
|
|
52
56
|
hasResponsesApi?: boolean;
|
|
57
|
+
hasSkills?: boolean;
|
|
53
58
|
}
|
|
54
59
|
|
|
55
60
|
/** Input-attachment configuration for an agent (application) deployment. */
|
|
@@ -108,6 +113,8 @@ export declare const buildDeploymentConnectApi: (baseUrl: string, id: string, {
|
|
|
108
113
|
*/
|
|
109
114
|
export declare const buildPromptOverview: (prompt: PromptResponseDto, labels: PromptOverviewLabels) => CatalogItemOverview;
|
|
110
115
|
|
|
116
|
+
export declare const buildResetFields: (stats: LimitStatsDto, formatResetTime: FormatResetTime | undefined) => Pick<UsageLimitProgressRow, "resetLabel" | "resetIsoValue" | "resetAriaLabel">;
|
|
117
|
+
|
|
111
118
|
/** Builds the Responses API endpoint URL for a deployment. */
|
|
112
119
|
export declare const buildResponsesUrl: (baseUrl: string) => string;
|
|
113
120
|
|
|
@@ -122,7 +129,9 @@ export declare const buildResponsesUrl: (baseUrl: string) => string;
|
|
|
122
129
|
* itself) contributes no node. Every folder entry is attached under its own
|
|
123
130
|
* stripped path so an empty grouping folder still appears; every file entry
|
|
124
131
|
* attaches under the folder chain its stripped path implies, synthesizing
|
|
125
|
-
* any intermediate folder the listing never enumerated on its own.
|
|
132
|
+
* any intermediate folder the listing never enumerated on its own. An
|
|
133
|
+
* empty-folder marker (`.dial_folder`) only proves its folder exists and
|
|
134
|
+
* never becomes a file node. A file
|
|
126
135
|
* node's `id` is the listing entry's own (unstripped) path, so it round-trips
|
|
127
136
|
* back to `downloadSkillFile` without being re-derived; a folder node's `id`
|
|
128
137
|
* is the stripped path and only keys client-side expand/collapse state.
|
|
@@ -162,7 +171,6 @@ export declare interface CatalogDetailsApi extends SkillDetailsApi {
|
|
|
162
171
|
|
|
163
172
|
/** Localized copy `useCatalogEditNavigation` needs for the Create menu and delete errors. */
|
|
164
173
|
export declare interface CatalogEditNavigationLabels {
|
|
165
|
-
createQuickApp: string;
|
|
166
174
|
createToolset: string;
|
|
167
175
|
createCustomApp: string;
|
|
168
176
|
createSkill: string;
|
|
@@ -200,9 +208,9 @@ export declare interface CatalogEditNavigationUrls {
|
|
|
200
208
|
buildCustomAppEditUrl(appId: string): string;
|
|
201
209
|
/** URL to create a new custom (schema-less) app. */
|
|
202
210
|
buildCustomAppCreateUrl(): string;
|
|
203
|
-
/** URL to edit an existing quick app under the given schema. */
|
|
211
|
+
/** URL to edit an existing schema-based app (quick app or any other runner) under the given schema. */
|
|
204
212
|
buildQuickAppEditUrl(schemaId: string, appId: string): string;
|
|
205
|
-
/** URL to create a new quick app under the given schema. */
|
|
213
|
+
/** URL to create a new schema-based app (quick app or any other runner) under the given schema. */
|
|
206
214
|
buildQuickAppCreateUrl(schemaId: string): string;
|
|
207
215
|
}
|
|
208
216
|
|
|
@@ -247,6 +255,28 @@ export declare enum CatalogPrimaryActionType {
|
|
|
247
255
|
*/
|
|
248
256
|
export declare type CatalogPublishEntityType = 'model' | 'toolset' | 'application' | 'prompt' | 'skill';
|
|
249
257
|
|
|
258
|
+
/** Labels and formatter callbacks for the conversation-input limits mapping utility. */
|
|
259
|
+
export declare interface ConversationInputLimitsLabels {
|
|
260
|
+
/** Heading of the group listing the selected deployment's token limits. */
|
|
261
|
+
tokenGroup: string;
|
|
262
|
+
/** Heading of the group listing the caller's cost budget and spend against it. */
|
|
263
|
+
costGroup: string;
|
|
264
|
+
/** Label for the current-UTC-day row, used by both groups. */
|
|
265
|
+
periodDay: string;
|
|
266
|
+
/** Label for the current-UTC-week row, used by both groups. */
|
|
267
|
+
periodWeek: string;
|
|
268
|
+
/** Label for the current-UTC-month row, used by both groups. */
|
|
269
|
+
periodMonth: string;
|
|
270
|
+
/** Formats the combined used/total display value for a capped row. */
|
|
271
|
+
formatValueLabel: (used: string, total: string) => string;
|
|
272
|
+
/** Formats the ARIA label for a capped progress row. */
|
|
273
|
+
formatProgressAriaLabel: (params: {
|
|
274
|
+
label: string;
|
|
275
|
+
used: string;
|
|
276
|
+
total: string;
|
|
277
|
+
}) => string;
|
|
278
|
+
}
|
|
279
|
+
|
|
250
280
|
/**
|
|
251
281
|
* Wraps the generated `PublishApi` in the positional-argument surface the
|
|
252
282
|
* catalog and conversation publish flows call, so each host app re-exports one
|
|
@@ -255,6 +285,18 @@ export declare type CatalogPublishEntityType = 'model' | 'toolset' | 'applicatio
|
|
|
255
285
|
*/
|
|
256
286
|
export declare const createPublishApiClient: (publishApi: PublishApi) => PublishApiClient;
|
|
257
287
|
|
|
288
|
+
/**
|
|
289
|
+
* Inverse of `encodeDeploymentId` — decodes each `/`-separated segment back
|
|
290
|
+
* to its raw, human-readable form. A segment that isn't valid
|
|
291
|
+
* percent-encoding is passed through unchanged rather than throwing, since
|
|
292
|
+
* this decodes externally-sourced ids (the settings iframe's postMessage
|
|
293
|
+
* protocol).
|
|
294
|
+
*/
|
|
295
|
+
export declare const decodeDeploymentId: (id: string) => string;
|
|
296
|
+
|
|
297
|
+
/** The English Overview labels `mapEntityDetailsToCatalogDetails` uses when a host passes none. */
|
|
298
|
+
export declare const DEFAULT_ENTITY_DETAILS_LABELS: EntityDetailsLabels;
|
|
299
|
+
|
|
258
300
|
/** Translated folder-path labels for the Personal/Shared/Public deployment groupings. */
|
|
259
301
|
export declare interface DeploymentFolderLabels {
|
|
260
302
|
personal: string;
|
|
@@ -272,16 +314,14 @@ export declare interface DeploymentGenerationApiSupport {
|
|
|
272
314
|
export declare interface DeploymentLimitsLabels {
|
|
273
315
|
/** Heading of the group every token stat row is listed under. */
|
|
274
316
|
tokenGroup: string;
|
|
275
|
-
/** Label for the
|
|
317
|
+
/** Label for the current-UTC-day token row, e.g. "Today". */
|
|
276
318
|
tokensPerDay: string;
|
|
277
|
-
/** Label for the
|
|
319
|
+
/** Label for the current-UTC-week token row, e.g. "This week". */
|
|
278
320
|
tokensPerWeek: string;
|
|
279
|
-
/** Label for the
|
|
321
|
+
/** Label for the current-UTC-month token row, e.g. "This month". */
|
|
280
322
|
tokensPerMonth: string;
|
|
281
323
|
/** Note shown instead of a total on a row whose limit follows the cost limit. */
|
|
282
324
|
followsCostLimit: string;
|
|
283
|
-
/** Formats the "$X spent" caption under a row's label. */
|
|
284
|
-
formatSpentCaption: (amount: string) => string;
|
|
285
325
|
/** Formats the combined used/total display value for a capped row. */
|
|
286
326
|
formatValueLabel: (used: string, total: string) => string;
|
|
287
327
|
/** Formats the ARIA label for a capped progress row. */
|
|
@@ -295,6 +335,8 @@ export declare interface DeploymentLimitsLabels {
|
|
|
295
335
|
label: string;
|
|
296
336
|
used: string;
|
|
297
337
|
}) => string;
|
|
338
|
+
/** Formats each period's `resetsAt` into the row's reset line. Omit it to render rows without one. */
|
|
339
|
+
formatResetTime?: FormatResetTime;
|
|
298
340
|
}
|
|
299
341
|
|
|
300
342
|
/**
|
|
@@ -304,7 +346,7 @@ export declare interface DeploymentLimitsLabels {
|
|
|
304
346
|
export declare const deriveAvailableTabIds: <T extends CatalogEntityType>(items: readonly CatalogItem[], tabOrder: readonly T[]) => T[];
|
|
305
347
|
|
|
306
348
|
/**
|
|
307
|
-
* Returns items marked as a user favorite, in original order.
|
|
349
|
+
* Returns items marked as a user favorite that are not hidden, in original order.
|
|
308
350
|
*/
|
|
309
351
|
export declare const deriveFavoriteItems: (items: readonly CatalogItem[]) => CatalogItem[];
|
|
310
352
|
|
|
@@ -320,6 +362,62 @@ export declare const deriveFavoriteItems: (items: readonly CatalogItem[]) => Cat
|
|
|
320
362
|
*/
|
|
321
363
|
export declare const encodeDeploymentId: (id: string) => string;
|
|
322
364
|
|
|
365
|
+
/**
|
|
366
|
+
* Overview section titles and spec labels rendered by
|
|
367
|
+
* `mapEntityDetailsToCatalogDetails`. Hosts pass translated strings; every
|
|
368
|
+
* field defaults to the English text in {@link DEFAULT_ENTITY_DETAILS_LABELS}.
|
|
369
|
+
*/
|
|
370
|
+
export declare interface EntityDetailsLabels {
|
|
371
|
+
/** Default: `'Capabilities'`. */
|
|
372
|
+
capabilitiesTitle: string;
|
|
373
|
+
/** Default: `'Specification'`. */
|
|
374
|
+
specificationTitle: string;
|
|
375
|
+
/** Default: `'Configuration'`. */
|
|
376
|
+
configurationTitle: string;
|
|
377
|
+
/** Default: `'Tools'`. */
|
|
378
|
+
tools: string;
|
|
379
|
+
/** Default: `'Parallel tool calls'`. */
|
|
380
|
+
parallelToolCalls: string;
|
|
381
|
+
/** Default: `'Reasoning efforts'`. */
|
|
382
|
+
reasoningEfforts: string;
|
|
383
|
+
/** Default: `'Skills'`. */
|
|
384
|
+
skills: string;
|
|
385
|
+
/** Default: `'Provider'`. */
|
|
386
|
+
provider: string;
|
|
387
|
+
/** Default: `'Vendor'`. */
|
|
388
|
+
vendor: string;
|
|
389
|
+
/** Default: `'License'`. */
|
|
390
|
+
license: string;
|
|
391
|
+
/** Default: `'Knowledge cutoff date'`. */
|
|
392
|
+
knowledgeCutoffDate: string;
|
|
393
|
+
/** Default: `'Parameters'`. */
|
|
394
|
+
parameters: string;
|
|
395
|
+
/** Default: `'Hosted by'`. */
|
|
396
|
+
hostedBy: string;
|
|
397
|
+
/** Default: `'Release date'`. */
|
|
398
|
+
releaseDate: string;
|
|
399
|
+
/** Default: `'Context window'`. */
|
|
400
|
+
contextWindow: string;
|
|
401
|
+
/** Default: `'Max output tokens'`. */
|
|
402
|
+
maxOutputTokens: string;
|
|
403
|
+
/** Default: `'Input modalities'`. */
|
|
404
|
+
inputModalities: string;
|
|
405
|
+
/** Default: `'Input attachments'`. */
|
|
406
|
+
inputAttachments: string;
|
|
407
|
+
/** Default: `'Routes'`. */
|
|
408
|
+
routes: string;
|
|
409
|
+
/** Default: `'Configuration schema'`. */
|
|
410
|
+
configurationSchema: string;
|
|
411
|
+
/** Default: `'Authentication'`. */
|
|
412
|
+
authentication: string;
|
|
413
|
+
/** Default: `'Authorization endpoint'`. */
|
|
414
|
+
authorizationEndpoint: string;
|
|
415
|
+
/** Default: `'Token endpoint'`. */
|
|
416
|
+
tokenEndpoint: string;
|
|
417
|
+
/** Default: `'OAuth scopes'`. */
|
|
418
|
+
oauthScopes: string;
|
|
419
|
+
}
|
|
420
|
+
|
|
323
421
|
/** Discriminated-union entity details for a deployment, keyed by catalog entity type. */
|
|
324
422
|
export declare type EntitySpecificDetails = {
|
|
325
423
|
type: 'MODEL';
|
|
@@ -369,6 +467,9 @@ export declare const filterHiddenOwnedItems: (items: readonly CatalogItem[], hid
|
|
|
369
467
|
*/
|
|
370
468
|
export declare const findDeploymentByIdOrReference: (deployments: DeploymentItemDto[], idOrReference: string | null | undefined) => DeploymentItemDto | undefined;
|
|
371
469
|
|
|
470
|
+
/** Formats a raw `resetsAt` into display strings, or returns `undefined` when it cannot be formatted. */
|
|
471
|
+
declare type FormatResetTime = (resetsAt: string | undefined) => ResetTimeDisplay | undefined;
|
|
472
|
+
|
|
372
473
|
/**
|
|
373
474
|
* The publish folder a public catalog entity id sits in: the segments between
|
|
374
475
|
* the `public` bucket and the entity name, decoded to the plain text the
|
|
@@ -406,8 +507,8 @@ export declare const mapDeploymentDetailsDtoToEntityDetails: (dto: DeploymentDet
|
|
|
406
507
|
/** Maps a deployment limits DTO to display-ready catalog limits, or `undefined` when no qualifying stats exist. */
|
|
407
508
|
export declare const mapDeploymentLimitsDtoToCatalogLimits: (dto: DeploymentLimitsResponseDto | undefined, labels: DeploymentLimitsLabels) => CatalogItemLimits | undefined;
|
|
408
509
|
|
|
409
|
-
/** Maps
|
|
410
|
-
export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined) =>
|
|
510
|
+
/** 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. */
|
|
511
|
+
export declare const mapDeploymentLimitsToInput: (dto: DeploymentLimitsResponseDto | undefined, labels: ConversationInputLimitsLabels, formatResetTime?: FormatResetTime) => CatalogItemLimits | undefined;
|
|
411
512
|
|
|
412
513
|
/** Maps a deployment listing row into the catalog UI's `CatalogItem` shape. */
|
|
413
514
|
export declare const mapDeploymentToCatalogItem: (deployment: DeploymentItemDto, { favoriteIds, entityDetails, folderLabels, editableSchemaIds, isCustomAppsEditable, activeLocale, primaryLocale, resolveIconUrl, }: MapDeploymentToCatalogItemOptions) => CatalogItem;
|
|
@@ -449,10 +550,11 @@ export declare const mapDeploymentToolsetCredentials: (toolsetId: string, authSe
|
|
|
449
550
|
|
|
450
551
|
/**
|
|
451
552
|
* Converts a strongly-typed entity domain model into the lib's `CatalogItemTabData` shape.
|
|
452
|
-
*
|
|
453
|
-
*
|
|
553
|
+
* Section titles and spec labels come from `labels`, merged over
|
|
554
|
+
* {@link DEFAULT_ENTITY_DETAILS_LABELS} — the lib cannot import a host's
|
|
555
|
+
* translation keys, so the host passes its translated strings in.
|
|
454
556
|
*/
|
|
455
|
-
export declare const mapEntityDetailsToCatalogDetails: (details: EntitySpecificDetails) => CatalogItemTabData;
|
|
557
|
+
export declare const mapEntityDetailsToCatalogDetails: (details: EntitySpecificDetails, labels?: Partial<EntityDetailsLabels>) => CatalogItemTabData;
|
|
456
558
|
|
|
457
559
|
/**
|
|
458
560
|
* Maps a prompt DTO into a catalog item.
|
|
@@ -550,6 +652,7 @@ export declare interface ModelCapabilities {
|
|
|
550
652
|
hasResume?: boolean;
|
|
551
653
|
hasChatCompletion?: boolean;
|
|
552
654
|
hasResponsesApi?: boolean;
|
|
655
|
+
hasSkills?: boolean;
|
|
553
656
|
reasoningEfforts?: string[];
|
|
554
657
|
}
|
|
555
658
|
|
|
@@ -573,6 +676,8 @@ export declare interface ModelPriceRow {
|
|
|
573
676
|
export declare interface ModelPricing {
|
|
574
677
|
/** Every price DIAL Core reports for the deployment, `unit` excluded. */
|
|
575
678
|
prices?: ModelPriceRow[];
|
|
679
|
+
/** DIAL Core billing unit the prices are quoted in, e.g. `token` or `char_without_whitespace`; absent means tokens. */
|
|
680
|
+
unit?: string;
|
|
576
681
|
}
|
|
577
682
|
|
|
578
683
|
/** Catalog-facing specification fields for a model deployment. */
|
|
@@ -589,17 +694,19 @@ export declare interface ModelSpecification {
|
|
|
589
694
|
createdAt?: number;
|
|
590
695
|
}
|
|
591
696
|
|
|
592
|
-
/**
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
697
|
+
/**
|
|
698
|
+
* Encodes a deployment/application id to its single-encoded form regardless
|
|
699
|
+
* of whether the value it received was already percent-encoded or the raw,
|
|
700
|
+
* human-readable form — decoding first then re-encoding once is idempotent
|
|
701
|
+
* either way, since `decodeDeploymentId` on a raw (unencoded) id is a no-op.
|
|
702
|
+
* Use this instead of `encodeDeploymentId` at a boundary that cannot
|
|
703
|
+
* guarantee which form it receives, such as a `postMessage` payload from the
|
|
704
|
+
* settings iframe: calling `encodeDeploymentId` directly on a value the
|
|
705
|
+
* sender already encoded escapes the existing `%` characters a second time
|
|
706
|
+
* (`%20` becomes `%2520`), which the backend only ever undoes once and so
|
|
707
|
+
* 404s on.
|
|
708
|
+
*/
|
|
709
|
+
export declare const normalizeDeploymentId: (id: string) => string;
|
|
603
710
|
|
|
604
711
|
/** A skill resource URL split into the bucket and the path within it. */
|
|
605
712
|
export declare interface ParsedSkillResourceUrl {
|
|
@@ -633,7 +740,11 @@ declare enum PromptSource {
|
|
|
633
740
|
Public = "public"
|
|
634
741
|
}
|
|
635
742
|
|
|
636
|
-
/**
|
|
743
|
+
/**
|
|
744
|
+
* DIAL Core bucket holding organisation-wide skills.
|
|
745
|
+
*
|
|
746
|
+
* @deprecated Use `PUBLIC_BUCKET` from `@epam/ai-dial-chat-shared`.
|
|
747
|
+
*/
|
|
637
748
|
export declare const PUBLIC_SKILL_BUCKET = "public";
|
|
638
749
|
|
|
639
750
|
/** The DIAL publish API surface produced by {@link createPublishApiClient}. */
|
|
@@ -693,6 +804,23 @@ export declare const readSkillManifest: (response: Response) => Promise<string |
|
|
|
693
804
|
*/
|
|
694
805
|
export declare const reconcileFilterTopics: (persistedTopics: ReadonlySet<string>, items: readonly CatalogItem[]) => Set<string>;
|
|
695
806
|
|
|
807
|
+
/**
|
|
808
|
+
* One reset time, already parsed and formatted by the host. Declared
|
|
809
|
+
* structurally here so this library never imports an application type; the
|
|
810
|
+
* host passes a value that satisfies this shape (e.g. `apps/chat`'s own
|
|
811
|
+
* `ResetTimeDisplay`).
|
|
812
|
+
*/
|
|
813
|
+
declare interface ResetTimeDisplay {
|
|
814
|
+
/** Exclusive end of the period as an epoch ms value, for the host's boundary scheduling. */
|
|
815
|
+
resetsAtMs: number;
|
|
816
|
+
/** Machine-readable instant for a `<time dateTime>` attribute. */
|
|
817
|
+
isoValue: string;
|
|
818
|
+
/** Visible reset line. */
|
|
819
|
+
label: string;
|
|
820
|
+
/** Accessible expansion of the reset line. */
|
|
821
|
+
ariaLabel: string;
|
|
822
|
+
}
|
|
823
|
+
|
|
696
824
|
/**
|
|
697
825
|
* Resolves the primary action for a catalog item.
|
|
698
826
|
*
|
|
@@ -940,7 +1068,7 @@ export declare interface UseApplicationCredentialsParams {
|
|
|
940
1068
|
* item through the endpoint its type owns and refetching/notifying on
|
|
941
1069
|
* completion, and building the Create dropdown's options.
|
|
942
1070
|
*/
|
|
943
|
-
export declare const useCatalogEditNavigation: ({ deployments, isCustomAppsEnabled, isSchemaAppsEnabled, isHideCustomAppCreationEnabled, isToolsetsEnabled, isPromptsEnabled,
|
|
1071
|
+
export declare const useCatalogEditNavigation: ({ deployments, isCustomAppsEnabled, isSchemaAppsEnabled, isHideCustomAppCreationEnabled, isToolsetsEnabled, isPromptsEnabled, schemas, urls, onNavigate, deletePrompt, deleteToolset, deleteSkill, deleteApplication, refetchPrompts, refetchToolsets, refetchSkills, refetchDeployments, onDeleteSuccess, labels, onNotify, onSkillUploadClick, }: UseCatalogEditNavigationParams) => UseCatalogEditNavigationResult;
|
|
944
1072
|
|
|
945
1073
|
/** Parameters accepted by {@link useCatalogEditNavigation}. */
|
|
946
1074
|
export declare interface UseCatalogEditNavigationParams {
|
|
@@ -950,8 +1078,8 @@ export declare interface UseCatalogEditNavigationParams {
|
|
|
950
1078
|
isHideCustomAppCreationEnabled: boolean;
|
|
951
1079
|
isToolsetsEnabled: boolean;
|
|
952
1080
|
isPromptsEnabled: boolean;
|
|
953
|
-
/**
|
|
954
|
-
|
|
1081
|
+
/** Application type schemas (runners) loaded at startup; each one except the custom-app schema gets its own Create option. */
|
|
1082
|
+
schemas: ApplicationSchemaSummaryDto[];
|
|
955
1083
|
/** Already-configured editor-route URL builders. */
|
|
956
1084
|
urls: CatalogEditNavigationUrls;
|
|
957
1085
|
/** Navigates the host to a URL built by `urls`. */
|
|
@@ -982,7 +1110,10 @@ export declare interface UseCatalogEditNavigationParams {
|
|
|
982
1110
|
export declare interface UseCatalogEditNavigationResult {
|
|
983
1111
|
handleEdit: (item: CatalogItem) => void;
|
|
984
1112
|
handleDelete: (item: CatalogItem) => Promise<void>;
|
|
1113
|
+
/** The Create dropdown's items: runners and static options sorted together by label, all filtered by `createSearch.value`. */
|
|
985
1114
|
createOptions: DropdownItem[];
|
|
1115
|
+
/** The Create menu's search field state, or `undefined` when no runner option is offered. */
|
|
1116
|
+
createSearch: CatalogCreateSearch | undefined;
|
|
986
1117
|
}
|
|
987
1118
|
|
|
988
1119
|
/**
|
|
@@ -990,7 +1121,7 @@ export declare interface UseCatalogEditNavigationResult {
|
|
|
990
1121
|
* Extracts the inline dispatch logic from `CatalogView` into a reusable,
|
|
991
1122
|
* library-isolated unit.
|
|
992
1123
|
*/
|
|
993
|
-
export declare const useCatalogItemDetails: ({ api, skills, isAdmin, dialCoreExternalUrl, skillOverviewLabels, promptOverviewLabels, deploymentLimitsLabels, }: UseCatalogItemDetailsOptions) => UseCatalogItemDetailsResult;
|
|
1124
|
+
export declare const useCatalogItemDetails: ({ api, skills, isAdmin, dialCoreExternalUrl, skillOverviewLabels, promptOverviewLabels, deploymentLimitsLabels, entityDetailsLabels, }: UseCatalogItemDetailsOptions) => UseCatalogItemDetailsResult;
|
|
994
1125
|
|
|
995
1126
|
/** Options accepted by `useCatalogItemDetails`. */
|
|
996
1127
|
export declare interface UseCatalogItemDetailsOptions {
|
|
@@ -1011,6 +1142,12 @@ export declare interface UseCatalogItemDetailsOptions {
|
|
|
1011
1142
|
promptOverviewLabels: PromptOverviewLabels;
|
|
1012
1143
|
/** Labels for deployment limits table. */
|
|
1013
1144
|
deploymentLimitsLabels: DeploymentLimitsLabels;
|
|
1145
|
+
/**
|
|
1146
|
+
* Overview section titles and spec labels for models, agents and toolsets,
|
|
1147
|
+
* merged over the English defaults. Memoise it like the other label objects:
|
|
1148
|
+
* a new object on every render recreates `onFetchDetails`.
|
|
1149
|
+
*/
|
|
1150
|
+
entityDetailsLabels?: Partial<EntityDetailsLabels>;
|
|
1014
1151
|
}
|
|
1015
1152
|
|
|
1016
1153
|
/** Returned callbacks from `useCatalogItemDetails`. All callbacks are stable for stable inputs. */
|
|
@@ -1160,9 +1297,9 @@ export declare interface UsePublishFoldersResult {
|
|
|
1160
1297
|
*/
|
|
1161
1298
|
onCreatePublishFolder: (parentPath: string[], name: string) => Promise<void>;
|
|
1162
1299
|
/**
|
|
1163
|
-
* Records `folderPath` as
|
|
1164
|
-
* so it keeps appearing in the tree on
|
|
1165
|
-
* successful publish.
|
|
1300
|
+
* Records `folderPath` as the most recent publish destination (moving it to
|
|
1301
|
+
* the front if already remembered), so it keeps appearing in the tree on
|
|
1302
|
+
* later publishes. Call it after a successful publish.
|
|
1166
1303
|
*/
|
|
1167
1304
|
rememberPublishFolder: (folderPath: string[]) => void;
|
|
1168
1305
|
/** Heuristic write-access check for a folder path (see the TODO above). */
|
package/catalog.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import { createPublishApiClient as e, toPublishRuleDto as t } from "./catalog/create-publish-api.js";
|
|
2
2
|
import { buildChatCompletionsUrl as n, buildDeploymentConnectApi as r, buildResponsesUrl as i } from "./catalog/deployment-endpoint-url.js";
|
|
3
|
-
import {
|
|
4
|
-
import { AuthenticationType as
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { mapDeploymentDetailsDtoToEntityDetails as
|
|
8
|
-
import { mapDeploymentToCatalogItem as
|
|
9
|
-
import { buildPromptOverview as
|
|
10
|
-
import { PUBLIC_SKILL_BUCKET as
|
|
11
|
-
import { buildSkillContentTree as
|
|
12
|
-
import { McpResourceKind as
|
|
13
|
-
import { getPublicCatalogEntityFolderPath as
|
|
14
|
-
import { deriveAvailableTabIds as
|
|
15
|
-
import { CatalogPrimaryActionType as
|
|
16
|
-
import { useCatalogEditNavigation as
|
|
17
|
-
import { useSkillItemDetails as
|
|
18
|
-
import { useCatalogItemDetails as
|
|
19
|
-
import { useCatalogToolsetCredentials as
|
|
20
|
-
import { useApplicationCredentials as
|
|
21
|
-
import { useSkillDetailsPanelData as
|
|
22
|
-
import { FavoriteEntityType as
|
|
23
|
-
import { usePublishFolders as
|
|
24
|
-
import { SkillPreviewErrorKind as
|
|
25
|
-
export {
|
|
3
|
+
import { decodeDeploymentId as a, encodeDeploymentId as o, findDeploymentByIdOrReference as s, normalizeDeploymentId as c } from "./catalog/deployment-id.js";
|
|
4
|
+
import { AuthenticationType as l } from "./catalog/entity-details.js";
|
|
5
|
+
import { buildResetFields as u, mapDeploymentLimitsToInput as d } from "./catalog/map-deployment-limits-to-input.js";
|
|
6
|
+
import { mapDeploymentLimitsDtoToCatalogLimits as f } from "./catalog/map-deployment-limits-to-catalog.js";
|
|
7
|
+
import { DEFAULT_ENTITY_DETAILS_LABELS as p, mapDeploymentDetailsDtoToEntityDetails as m, mapEntityDetailsToCatalogDetails as h, mapToolsetCredentials as g } from "./catalog/map-entity-details-to-catalog.js";
|
|
8
|
+
import { mapDeploymentToCatalogItem as _, mapDeploymentToolsetCredentials as v, mapToolsetToCatalogItem as y, resolveDeploymentFolder as b } from "./catalog/map-deployment-to-catalog-item.js";
|
|
9
|
+
import { buildPromptOverview as x, isOrganisationPromptItem as S, mapPromptToCatalogItem as C } from "./catalog/map-prompt-to-catalog-item.js";
|
|
10
|
+
import { PUBLIC_SKILL_BUCKET as w, SKILL_LISTING_MAX_PAGES as T, SKILL_LISTING_PAGE_SIZE as E, SKILL_MANIFEST_MAX_BYTES as D, SkillSource as O, parseSkillResourceUrl as k } from "./skill/skill-types.js";
|
|
11
|
+
import { buildSkillContentTree as A, buildSkillOverview as j, mapSkillToCatalogItem as M, readSkillFileBytes as N, readSkillFilePreviewBytes as P, readSkillManifest as F, resolveSkillFileDownloadPath as I, resolveSkillManifestFileId as L } from "./catalog/map-skill-to-catalog-item.js";
|
|
12
|
+
import { McpResourceKind as R, buildApplicationMcpUrl as z, buildConnectApi as B, buildToolsetMcpUrl as V, resolveMcpResourceKind as H } from "./catalog/mcp-endpoint-url.js";
|
|
13
|
+
import { getPublicCatalogEntityFolderPath as U, isPublicCatalogEntityId as W, mapPublishConversationResultDto as G, mapPublishHistoryEntryDto as K, toPublishEntityType as q } from "./catalog/publish.js";
|
|
14
|
+
import { deriveAvailableTabIds as J, deriveFavoriteItems as Y, filterCatalogItemsBySelector as X, filterHiddenOwnedItems as Z, reconcileFilterTopics as Q } from "./catalog/catalog-derivations.js";
|
|
15
|
+
import { CatalogPrimaryActionType as $, resolveCatalogPrimaryAction as ee } from "./catalog/catalog-primary-action.js";
|
|
16
|
+
import { useCatalogEditNavigation as te } from "./catalog/useCatalogEditNavigation/useCatalogEditNavigation.js";
|
|
17
|
+
import { useSkillItemDetails as ne } from "./catalog/useSkillItemDetails.js";
|
|
18
|
+
import { useCatalogItemDetails as re } from "./catalog/useCatalogItemDetails.js";
|
|
19
|
+
import { useCatalogToolsetCredentials as ie } from "./catalog/useCatalogToolsetCredentials/useCatalogToolsetCredentials.js";
|
|
20
|
+
import { useApplicationCredentials as ae } from "./catalog/useApplicationCredentials/useApplicationCredentials.js";
|
|
21
|
+
import { useSkillDetailsPanelData as oe } from "./catalog/useSkillDetailsPanelData/useSkillDetailsPanelData.js";
|
|
22
|
+
import { FavoriteEntityType as se, useFavoriteEntitiesState as ce } from "./catalog/useFavoriteEntitiesState/useFavoriteEntitiesState.js";
|
|
23
|
+
import { usePublishFolders as le } from "./catalog/usePublishFolders/usePublishFolders.js";
|
|
24
|
+
import { SkillPreviewErrorKind as ue, useSkillFilePreview as de } from "./skill/useSkillFilePreview.js";
|
|
25
|
+
export { l as AuthenticationType, $ as CatalogPrimaryActionType, p as DEFAULT_ENTITY_DETAILS_LABELS, se as FavoriteEntityType, R as McpResourceKind, w as PUBLIC_SKILL_BUCKET, T as SKILL_LISTING_MAX_PAGES, E as SKILL_LISTING_PAGE_SIZE, D as SKILL_MANIFEST_MAX_BYTES, ue as SkillPreviewErrorKind, O as SkillSource, z as buildApplicationMcpUrl, n as buildChatCompletionsUrl, B as buildConnectApi, r as buildDeploymentConnectApi, x as buildPromptOverview, u as buildResetFields, i as buildResponsesUrl, A as buildSkillContentTree, j as buildSkillOverview, V as buildToolsetMcpUrl, e as createPublishApiClient, a as decodeDeploymentId, J as deriveAvailableTabIds, Y as deriveFavoriteItems, o as encodeDeploymentId, X as filterCatalogItemsBySelector, Z as filterHiddenOwnedItems, s as findDeploymentByIdOrReference, U as getPublicCatalogEntityFolderPath, S as isOrganisationPromptItem, W as isPublicCatalogEntityId, m as mapDeploymentDetailsDtoToEntityDetails, f as mapDeploymentLimitsDtoToCatalogLimits, d as mapDeploymentLimitsToInput, _ as mapDeploymentToCatalogItem, v as mapDeploymentToolsetCredentials, h as mapEntityDetailsToCatalogDetails, C as mapPromptToCatalogItem, G as mapPublishConversationResultDto, K as mapPublishHistoryEntryDto, M as mapSkillToCatalogItem, g as mapToolsetCredentials, y as mapToolsetToCatalogItem, c as normalizeDeploymentId, k as parseSkillResourceUrl, N as readSkillFileBytes, P as readSkillFilePreviewBytes, F as readSkillManifest, Q as reconcileFilterTopics, ee as resolveCatalogPrimaryAction, b as resolveDeploymentFolder, H as resolveMcpResourceKind, I as resolveSkillFileDownloadPath, L as resolveSkillManifestFileId, q as toPublishEntityType, t as toPublishRuleDto, ae as useApplicationCredentials, te as useCatalogEditNavigation, re as useCatalogItemDetails, ie as useCatalogToolsetCredentials, ce as useFavoriteEntitiesState, le as usePublishFolders, oe as useSkillDetailsPanelData, de as useSkillFilePreview, ne as useSkillItemDetails };
|
|
@@ -1,32 +1,40 @@
|
|
|
1
1
|
import { formatDateYMD as e } from "./date.js";
|
|
2
2
|
import { ExportFileNameKind as t } from "./types.js";
|
|
3
3
|
//#region src/conversation/conversation-transfer/export-conversation.ts
|
|
4
|
-
var n = "ai_dial", r = (e) => e.map(({ attachments: e, ...t }) => t), i = (e) => {
|
|
4
|
+
var n = "ai_dial", r = (e) => e.map(({ attachments: e, ...t }) => t), i = (e) => e.map((e) => {
|
|
5
|
+
if (e.body?.source == null) return e;
|
|
6
|
+
let { source: t, ...n } = e.body;
|
|
7
|
+
return {
|
|
8
|
+
...e,
|
|
9
|
+
body: n
|
|
10
|
+
};
|
|
11
|
+
}), a = (e) => {
|
|
5
12
|
let t = e.custom_content;
|
|
6
13
|
if (!t) return e;
|
|
7
|
-
let { attachments: n, stages:
|
|
8
|
-
if (n == null &&
|
|
9
|
-
let
|
|
10
|
-
...
|
|
11
|
-
...
|
|
14
|
+
let { attachments: n, stages: a, annotations: o, ...s } = t;
|
|
15
|
+
if (n == null && a == null && o == null) return e;
|
|
16
|
+
let c = {
|
|
17
|
+
...s,
|
|
18
|
+
...a ? { stages: r(a) } : {},
|
|
19
|
+
...o ? { annotations: i(o) } : {}
|
|
12
20
|
};
|
|
13
|
-
if (Object.keys(
|
|
21
|
+
if (Object.keys(c).length > 0) return {
|
|
14
22
|
...e,
|
|
15
|
-
custom_content:
|
|
23
|
+
custom_content: c
|
|
16
24
|
};
|
|
17
|
-
let { custom_content:
|
|
18
|
-
return
|
|
19
|
-
},
|
|
25
|
+
let { custom_content: l, ...u } = e;
|
|
26
|
+
return u;
|
|
27
|
+
}, o = (e) => ({
|
|
20
28
|
...e,
|
|
21
|
-
messages: e.messages.map(
|
|
22
|
-
}),
|
|
29
|
+
messages: e.messages.map(a)
|
|
30
|
+
}), s = (e, t = []) => ({
|
|
23
31
|
version: 5,
|
|
24
32
|
history: e,
|
|
25
33
|
folders: t
|
|
26
|
-
}),
|
|
34
|
+
}), c = (e) => new Blob([JSON.stringify(e, null, 2)], { type: "application/json" }), l = {
|
|
27
35
|
[t.SingleConversation]: "json",
|
|
28
36
|
[t.SingleConversationWithAttachments]: "dial",
|
|
29
37
|
[t.AllConversationsHistory]: "json"
|
|
30
|
-
},
|
|
38
|
+
}, u = (t, n, r = /* @__PURE__ */ new Date()) => `${e(r)}_${n}_${t}.${l[t]}`;
|
|
31
39
|
//#endregion
|
|
32
|
-
export { n as EXPORT_APP_NAME,
|
|
40
|
+
export { n as EXPORT_APP_NAME, s as buildExportEnvelope, u as buildExportFileName, c as serializeExportEnvelope, o as stripConversationAttachments };
|